0

From this question, I am getting that $2\times \max(a,b) = \max(2a,2b)$, and more generally, $c\times \max(a,b) = \max(c\times a, c\times b)$ for $c\geq0$, since we have $$ \begin{align*} a + b + |a-b| &= a+b + \max(a-b, b-a) \\ &= \max\big[(a+b) + a-b),\; (a+b) + b-a\big] \\ &= \max(2a,2b))\\ a + b + |a-b| &= \big[\max(a,b) + \min(a,b)\big] + \big[\max(a,b) - \min(a,b)\big] \\ &= 2\max(a,b) \end{align*} $$

Is this correct? It feels odd to move $(a+b)$ into the max in the first line. This seems to indicate that for $f:\mathbb{R}^n\to \mathbb{R}$ defined by the pointwise max $$f(x) := \max(x_1,x_2,\ldots,x_n)$$ satisfies $f(c\times x + d) = cf(x) + d$ for $c\geq0$ and $d$ a (specific?) linear combination of $x$. For $d$ a constant scalar, we have that $f$ some translation and scaling properties (not sure what this is called), which is intuitive, but is this right for $d = d(x)$ some linear combination of $x$?

What operations are allowed for moving terms in and out of $\max(\cdot)$?

jjjjjj
  • 2,671
  • What do you mean by $c\times x$ when $x$ is a high dimension vector? –  Feb 20 '21 at 20:05
  • I mean a scalar $c$ multiplied componentwise to $x$ – jjjjjj Feb 20 '21 at 20:05
  • and add $d$ componentwise as well? –  Feb 20 '21 at 20:11
  • yes, thanks, when $d$ is a scalar added componentwise – jjjjjj Feb 20 '21 at 20:12
  • So it'd be linear if we had $f(x + y) = f(x) + f(y)$ (together with $f(cx) = cf(x)$), but we only have something less: for $y \equiv (1,1,\ldots,1) \cdot L$ for a scalar $L$. Does this property have a name? – jjjjjj Feb 20 '21 at 20:15
  • You don't have linearity since $c$ must be nonnegative.// $f(x+y)=f(x)+f(y)$ is not correct. –  Feb 20 '21 at 20:18
  • but we also don't have additivity $f(x+y) = f(x) + f(y)$, right? for example, $max(1 + -1,-1+ 1) = 0 \neq \max(1,-1) + \max(-1,1)$ – jjjjjj Feb 20 '21 at 20:20
  • yes, that is right. –  Feb 20 '21 at 20:20
  • 1
    I have not seen a name for such property. Maybe it is not interesting enough to have a name. People give a specific name to a certain concept for some purposes; not for sake of just having a name. –  Feb 20 '21 at 20:25

1 Answers1

1

You are making things too complicated.

It is simply that $a\ge b$ if and only if $2a\ge 2b$; so

when $a\ge b$, $$ LHS=2\cdot a=2a=\max(2a,2b) $$

and when $a<b$, $$ LHS=2\cdot b=2b=\max(2a,2b) $$

If you want to apply the formula that $$ \max(x,y)=\frac{x+y-|x-y|}{2} $$ then it is simply $$ 2\max(x,y)=\frac{2x+2y-2|x-y|}{2}=\frac{2x+2y-|2x-2y|}{2}=\max(2x,2y) $$


Added.

Okay, after fixing the typos, in your approach, you have $$ \begin{align} a+b+|a-b| &=a+b+\max(a-b,b-a)\\ &=\max(a-b+(a+b),b-a+(a+b))\\ &=\max(2a,2b) \end{align} $$

In particular, it is correct that $$ a+b+\max(a-b,b-a) =\max(a-b+(a+b),b-a+(a+b)) $$ because $$ \max(x,y)+L=\max(x+L,y+L) $$ since $x\ge y$ if and only if $x+L\ge y+L$.


In general, if you have $x=(x_1,x_2,\cdots,x_2)$ and $c\ge 0$, you have $$ c\max(x_1,\cdots,x_n)=\max(cx_1,\cdots,cx_n) $$

So $f(cx)=cf(x)$.

On the other hand, for any $L\in\mathbb{R}$, $$ \max(x_1+L,\cdots,x_n+L)=\max(x_1,\cdots,x_n)+L $$ Combining together, $$ \max(cx_1+L,\cdots,cx_n+L)=c\max(x_1,\cdots,x_n)+L $$

  • I see, thank you. Is it fine to move (a+b) into the max? – jjjjjj Feb 20 '21 at 19:42
  • 1
    @jjjjjj Your expression $\max((a+b)+a-b)$ does not make sense; the function $\max$ has two arguments. –  Feb 20 '21 at 19:52
  • Oh sorry, typo, let me fix what i meant. thanks – jjjjjj Feb 20 '21 at 19:53
  • 1
    @jjjjjj: yes, that is correct then. –  Feb 20 '21 at 19:57
  • got it, and that's just because $a \geq b \iff a + (a+b) \geq b + (a+b)$. So it feels like there's something close to linearity, but i'm not seeing the place it breaks down; e.g., for "max(0,x)" linearity breaks at 0. – jjjjjj Feb 20 '21 at 20:00
  • thanks, i've upvoted, still trying to figure out how the pointwise max isn't "linear", specifically the (×+)=()+ part or how that relates to linearity – jjjjjj Feb 20 '21 at 20:03
  • 1
    @jjjjjj please see my edits. –  Feb 20 '21 at 20:14
  • thanks very much. before accepting, does the property you detail have a name? it seems close to linearity, but not quite. – jjjjjj Feb 20 '21 at 20:17
  • 1
    @jjjjjj it is far from linearity. Note in particular that $c\ge 0$. –  Feb 20 '21 at 20:21
  • and nonnegative homogeneous? – jjjjjj Feb 20 '21 at 20:21