The Pythagoren theorem doesn't state that for any right angle triangle, the area of a square with one of its edges being the hypotenuse is the sum of the squares of the lengths of the legs. The Pythagorean theorem states that for any right angle triangle, the square of the length of the hypotenuse is the sum of the squares of the lengths of its legs. Some people make the assumption that the area of any square is the square of the length of its edges so they accept a proof like the one in this answer as a proof of the Pythagorean theorem.
The distance formula can be considered a binary function from $\mathbb{R}^2$ to $\mathbb{R}$, in otherwords, a function from $(\mathbb{R}^2)^2$. Most of those who accept that proof of the Pythagorean theorem are probably actually making an additional assumption that $\forall x \in \mathbb{R}\forall y \in \mathbb{R}\forall z \in \mathbb{R}\forall w \in \mathbb{R}d((0, 0), (xz - yw, xw + yz)) = d((0, 0), (x, y))d((0, 0), (z, w))$ Without the additional assumption, that just shows that the distance formula is $d((x, y), (z, w)) = \sqrt{(z - x)^2 + (w - y)^2}$ going from any point to any different point and therefore that the Pythagoren theorem holds for all right angle triangles whose axes are parallel to the axes. That's because area can be defined using Calculus. With the additional assumption, you can then show that the Pythagorean theorem holds for all right angle triangles. To show that the distance formula is that even going from a point to itself, we have to make the additional assumption that the distance from any point to itself is 0.
How do we know a function satisfying those properties exists? Because if you define the distance formula to be $d((x, y), (z, w)) = \sqrt{(z - x)^2 + (w - y)^2}$, you can in fact show that it does satisfies all 3 properties. It's trivial to show that using that definition, the distance from any point to itself is 0. That so called proof of the Pythagorean theorem shows that using that definition of distance, the area of any square is in fact the square of the length of its edges. That definition can also be shown to satisfy $\forall x \in \mathbb{R}\forall y \in \mathbb{R}\forall z \in \mathbb{R}\forall w \in \mathbb{R}d((0, 0), (xz - yw, xw + yz)) = d((0, 0), (x, y))d((0, 0), (z, w))$ as follows.
$\forall x \in \mathbb{R}\forall y \in \mathbb{R}\forall z \in \mathbb{R}\forall w \in \mathbb{R} d((0, 0), (xz - yw, xw + yz)) = \sqrt{(xz - yw)^2 + (xw + yz)^2} = \sqrt{x^2z^2 - 2xyzw + y^2w^2 + x^2w^2 + 2xyzw + y^2z^2} = \sqrt{x^2z^2 + x^2w^2 + y^2z^2 + y^2w^2} = \sqrt{(x^2 + y^2)(z^2 + w^2)} = \sqrt{x^2 + y^2}\sqrt{z^2 + w^2} = d((0, 0), (x, y))d((0, 0), (z, w))$
You may instead be thinking that you cannot assume that the area of any square is the square of the length of its edges and can only assume that the distance formula satisfies the following properties:
- $\forall x \in \mathbb{R}\forall y \in \mathbb{R}\forall z \in \mathbb{R}\forall w \in \mathbb{R}d((x, y), (x + z, y + w)) = d((0, 0), (z, w))$
- $\forall x \in \mathbb{R}\forall y \in \mathbb{R}\forall z \in \mathbb{R}\forall w \in \mathbb{R}d((x, y), (z, w))$ is nonnegative
- $\forall \text{ nonnegative } x \in \mathbb{R}d((0, 0), (x, 0)) = x$
- $\forall x \in \mathbb{R}\forall y \in \mathbb{R}d((0, 0), (x, -y)) = d((0, 0), (x, y))$
- $\forall x \in \mathbb{R}\forall y \in \mathbb{R}\forall z \in \mathbb{R}\forall w \in \mathbb{R}d((0, 0), (xz - yw, xw + yz)) = d((0, 0), (x, y))d((0, 0), (z, w))$
but you still saw a proof of the Pythagoren theorem like the one in this answer and that's why you wondered if the Pythagorean theorem was just a theorem about area and not a theorem about distance. It really is a theorem about distance and some people accept that proof because they make the assumption that the area of any square is the square of the length of its edges.
However if you use just those assumptions about distance, you can still show that the distance formula is $d((x, y), (z, w)) = \sqrt{(z - x)^2 + (w - y)^2}$ and therefore that the area of any square is the square of the length of its edges. How do we know there actually exists a way of defining distance that satisfies all 5 of those properties? Because it's trivial to show that the function that satisfies the first 4 properties it has been shown earlier that that function also satisfies property 5. Now we know that since it satisfies those properties, it also satisfies the property that the area of any square is the square of the length of its edges.
There's still one more property of distance that some people find so intuitive that I never mentioned earlier. That's that $\forall x \in \mathbb{R}d((0, 0), (\cos(x), \sin(x))) = 1$. How do we know that function also satisfies that additional property? Because it can be proven as follows. $\cos$ and $\sin$ can be defined by the following differential equations:
- $\cos(0) = 1$
- $\sin(0) = 0$
- $\cos' = -\sin$
- $\sin' = \cos$
$\frac{d}{dx}(\cos^2(x) + \sin^2(x)) = \frac{d}{dx}(\cos^2(x)) + \frac{d}{dx}(\sin^2(x)) = 2\cos(x)(-\sin(x)) + 2\sin(x)\cos(x) = 0$ This shows that $\cos^2(x) + \sin^2(x)$ is constant. Also $\cos^2(x) + \sin^2(x) = 1$ so $\forall x \in \mathbb{R}\cos^2(x) + \sin^2(x) = 1$. Now using the distance formula, we can show that $\forall x \in \mathbb{R}d((0, 0), (\cos(x), \sin(x))) = 1$.