Geometrically, the formulae make perfect sense. Of course, intuition is no substitute for a formal proof. Let us start by proving the max function:
x≤y⟹y−x≥0⟹max(x,y)=2x+y+(y−x)⟹max(x,y)=22y=y
y≤x⟹y−x≤0⟹max(x,y)=2x+y−(y−x)⟹max(x,y)=22x=xTo prove the min function:
x≤y⟹y−x≥0⟹min(x,y)=2x+y−(y−x)⟹min(x,y)=22x=x
y≤x⟹y−x≤0⟹min(x,y)=2x+y−(−(y−x))⟹min(x,y)=2x+y+(y−x)⟹min(x,y)=22y=y