Ma · Mathematics

How to Rewrite max(t, 0) Using a Minimum

Published By the 9to5Science editorial team

At a glance

  1. 1. Apply sign reversal

    Use max(a, b) = -min(-a, -b) to turn the maximum into a minimum.

  2. 2. Substitute the terms

    Set a = t and b = 0, giving max(t, 0) = -min(-t, 0).

  3. 3. Check both cases

    For t at least zero the result is t; for t below zero it is zero.

For a real number tt, the expression max⁡{t,0}\max\{t,0\} is the positive part of tt: it equals tt when tt is nonnegative and equals 00 when tt is negative. To write it using a minimum, use the general identity that a maximum is the negative of a minimum after both inputs are negated:

max⁡{t,0}=−min⁡{−t,0}.\max\{t,0\}=-\min\{-t,0\}.

The minus sign outside the minimum is part of the identity. Simply changing max to min does not preserve the value.

Why the identity works

For any real numbers aa and bb,

max⁡{a,b}=−min⁡{−a,−b}.\max\{a,b\}=-\min\{-a,-b\}.

Negating reverses the order: if a≥ba\ge b, then −a≤−b-a\le -b. Thus the smaller of −a-a and −b-b is −a-a; negating that minimum gives aa, the original maximum. Taking a=ta=t and b=0b=0 gives the desired formula.

You can also verify it by cases:

  • If t≥0t\ge 0, then −t≤0-t\le 0, so min⁡{−t,0}=−t\min\{-t,0\}=-t. Therefore −min⁡{−t,0}=t-\min\{-t,0\}=t.
  • If t<0t<0, then −t>0-t>0, so min⁡{−t,0}=0\min\{-t,0\}=0. Therefore −min⁡{−t,0}=0-\min\{-t,0\}=0.

These are exactly the two values of max⁡{t,0}\max\{t,0\}.

Worked examples

Take t=4t=4. Then

−min⁡{−4,0}=−(−4)=4=max⁡{4,0}.-\min\{-4,0\}=-(-4)=4=\max\{4,0\}.

For t=−3t=-3, the same expression gives

−min⁡{3,0}=−(0)=0=max⁡{−3,0}.-\min\{3,0\}=-(0)=0=\max\{-3,0\}.

The formula also works at the boundary t=0t=0: both sides are zero.

Another equivalent form

A related identity is

max⁡{t,0}=t−min⁡{t,0}.\max\{t,0\}=t-\min\{t,0\}.

If t≥0t\ge0, the minimum is zero and the right side is tt. If t<0t<0, the minimum is tt and the right side is t−t=0t-t=0. This form can be useful when an expression already contains tt and min⁡{t,0}\min\{t,0\}.

Using the rewrite in optimization

The rewrite is an exact algebraic equality, so you can substitute −min⁡{−t,0}-\min\{-t,0\} wherever max⁡{t,0}\max\{t,0\} appears. For example, for t=2x−1t=2x-1,

max⁡{2x−1,0}=−min⁡{1−2x,0}.\max\{2x-1,0\}=-\min\{1-2x,0\}.

At x=0x=0, both expressions equal zero; at x=1x=1, both equal one.

Be careful about what the optimization model requires. The graph y=max⁡{t,0}y=\max\{t,0\} is often represented by the inequalities y≥ty\ge t and y≥0y\ge0. These describe the epigraph: they ensure yy is at least the maximum, but do not by themselves force equality. Equality follows in some models when the objective makes yy as small as possible; otherwise, additional modeling constraints may be needed. Replacing the maximum with its minimum identity changes none of these modeling requirements.

Common mistakes

  • Dropping the outside minus: min⁡{−t,0}\min\{-t,0\} equals −t-t for positive tt, not tt.
  • Negating only one input: The general identity requires negating both inputs before taking the minimum.
  • Assuming a minimum of affine functions is interchangeable with a maximum: A minimum of affine functions is concave, while max⁡{t,0}\max\{t,0\} is convex. In general, you cannot express this positive-part function as a minimum of affine functions without the outside negative sign.

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.