Reference 0015

Absolute Value Recipe Card

Never hand a solver a kink. |t| = max(t, -t) — replace the V with the two lines under it. Pick the dialect by where the |·| sits.

The Three Patterns

1. |t| <= τ  (constraint only)          NO auxiliaries:
       -τ <= t <= τ                       (two walls; Lesson 0013's band)

2. |t| in objective / inside sums        EPIGRAPH:
       add u;  u >= t,  u >= -t;  use u in place of |t|

3. |t| in objective, portfolio flavor    SPLIT:
       t = b - s,  b >= 0,  s >= 0;  use b + s in place of |t|
       (b = buys, s = sells; handles asymmetric fees κ_b b + κ_s s)

The No-Padding Lemma (the license)

valid only under MINIMIZING pressure on the substitute:
    coefficient on (b + s) or u  >  0   ⇒  b·s = 0, so b + s = |t|  (exact)
    coefficient = 0                     ⇒  w* right, b + s meaningless
    coefficient < 0 / maximizing |t|    ⇒  pads forever; NON-CONVEX, stop

same statement, CVXPY dialect: cp.abs / cp.norm(·, 1) are convex atoms;
using them where concave is needed raises a DCP error — by design.

Portfolio Vocabulary

Turnover

Σ_i |w_i - w_prev,i|: split every asset, w_i = w_prev,i + b_i - s_i; turnover is Σ(b_i + s_i). All linear.

Leverage (130/30)

Σ|w_i| <= 1.6: split weights into long/short books w_i = w⁺_i - w⁻_i; constrain Σ(w⁺_i + w⁻_i).

Kink economics

At zero trade the V's one-sided slopes are ±κ: first unit costs κ → no-trade zone |f0'| <= κ. Quadratic penalty: first unit free → no zone.

CVXPY Snippets

t = w - w_prev
cp.norm(t, 1)                    # turnover, rewrite done internally
cp.abs(t)                        # elementwise V
cp.pos(t), cp.neg(t)             # b and s, if you need them separately

# explicit split (asymmetric fees):
b = cp.Variable(n, nonneg=True)
s = cp.Variable(n, nonneg=True)
constraints = [w == w_prev + b - s]
cost = kappa_buy @ b + kappa_sell @ s

Whiteboard Traps

maximizing |·|:        non-convex; the split will pad, CVXPY will refuse
zero fee + split:      solution fine, but b + s is NOT the turnover
|t| <= τ with u or b,s: legal but wasteful — it's just two walls
forgetting b, s >= 0:  without the sign constraints the split says nothing

Use this page with Lesson 0015 (the V picture, the lemma, and the padding lab), Reference 0012 (no-trade zone), and Reference 0013 (budget–penalty bridge). Formal sources: Boyd & Vandenberghe §4.1.3 and §6.1.1; MOSEK Modeling Cookbook §2.2.