So, let's say you are writing a mathematical program, and you reason that
x=y⇒yx>1. Right? The ratio must be more than one if they are not equal. But then, someone tells you, it's only true if
Argh! There goes your wonderful conjecture. You could write that
x=y⇒min(x,y)max(x,y)>1. But, those are non-standard functions!
Let's try to make a max function using only standard functions.
What we'll do is figure out whether x−y is positive or negative. Then, we'll return x if it is positive and y if it is negative. To figure out whether it is positive or negative, we compute
isPositive(x−y)=2x−y∣x−y∣+1⇒{+→1,−→0} Okay, cool. Now, when the function returns positive, we want to return x. We can do that by multiplying by x:
max(x,y)=x⋅2x−y∣x−y∣+1⇒{x→x, y→0} Oh, but now we get 0 when the maximum is y! We can add the same function, but comparing against y:
max(x,y)=x⋅2x−y∣x−y∣+1+y⋅2y−x∣x−y∣+1⇒{x→x,y→y} Great! Now we just need a minimum function. All we need to do is switch the outputs:
min(x,y)=y⋅2x−y∣x−y∣+1+x⋅2y−x∣x−y∣+1⇒{x→x, y→y} Can you fix my conjecture for me now? Thanks!