User:Blackbombchu/Sandbox/Distance Formula

Theorem
The distance $d$ between two points $A = \left({x, y}\right)$ and $B = \left({z, w}\right)$ in Cartesian coordinates is $\sqrt{ \left({y - x}\right)^2 + \left({w - z}\right)^2 }$.

Proof
By definition, for any ordered pair (x, y) and any real number r, the distance of the point (x, y) is r if and only if there is exactly one distance function and that function assigns r to (x, y). For any function f from R2 to R, suppose f is a distance function, then f(x, y) = $\sqrt{(f(x, y))2}$ = $\sqrt{f(x, y) × f(x, -y)}$ = $\sqrt{f(x2 + y2, 0)}$ = $\sqrt{x2 + y2}$

Conversely, suppose that for all ordered pairs (x, y), f(x, y) = $\sqrt{x2 + y2}$, then: so f is a distance function. This shows that the funtion that assigns $\sqrt{x2 + y2}$ to (x, y) for every ordered pair (x, y) is the only distance function. Therefore, for every point (x, y), the distance of (x, y) is $\sqrt{x2 + y2}$.
 * For any nonnegative real number r, f(r, 0) = r
 * For any ordered pair (x, y), x2 and y2 are nonnegative real numbers so x2 + y2 is a nonnegative real number so $\sqrt{x2 + y2}$ is a nonnegative real number
 * For any ordered pair (x, y), f(x, -y) = $\sqrt{x2 + (-y)2}$ = $\sqrt{x2 + y2}$ = f(x, y)
 * For any ordered pairs (r, s) and (t, u), f(ru - st, rt + su) = $\sqrt{(ru - st)2 + (rt + su)2}$ = $\sqrt{r2u2 - 2rstu + s2t2 + r2t2 + 2rstu + s2u2}$ = $\sqrt{r2t2 + r2u2 + s2t2 + s2u2}$ = $\sqrt{r2(t2 + u2) + s2(t2 + u2)}$ = $\sqrt{(r2 + s2)(t2 + u2)}$ = $\sqrt{(r2 + s2)}$$\sqrt{(t2 + u2)}$ = f(r, s) × f(t, u)

For any 2 points (x, y) and (z, w), the distance from (x, y) to (z, w) is the distance of (z - x, w - y) which is $\sqrt{(z - x)2 + (w - y)2}$. Also the distance from (z, w) to (x, y) is $\sqrt{(x - z)2 + (y - w)2}$ = $\sqrt{(z - x)2 + (w - y)2}$. Thereforefore, for any two points (x, y) and (z, w), by definition the distance between (x, y) and (z, w) is $\sqrt{(z - x)2 + (w - y)2}$.