Without any assumptions about what properties the distance formula satisfies, you can't prove anything about what the distance formula is. If you take on blind faith that it has been proven that $\forall x \in \mathbb{R}\sin^2(x) + \cos^2(x) = 1$ and you assume that distance is a binary function from $\mathbb{R}^2$ to $\mathbb{R}$, in other words, a function from $(\mathbb{R}^2)^2$ to $\mathbb{R}$ satisfying 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 \text{ nonnegative }y \in \mathbb{R}d((0, 0), (y \cos(x), y \sin(x))) = y$
Then you can use them to prove that the distance formula is $d((x, y), (z, w)) = \sqrt{(z - x)^2 + (w - y)^2}$. This just shows that the Pythagorean theorem holds for all right angle triangles whose legs are parallel to the axes. If you make the additional assumption $\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))$, then you can show that the Pythagoren theorem holds for all right angle triangles, not just ones whose legs are parallel to the axes.
How can you prove the Pythagoren identity? If you take on blind faith that the Pythagoren theorem is a well known theorem and therefore must be true, then you can deduce the Pythagorean identity. Then how do you prove the Pythagorean theorem in the first place? If you take for granted that distance 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 \text{ nonnegative }y \in \mathbb{R}d((0, 0), (y \cos(x), y \sin(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))$
Then you can prove the Pythagoren theorem as follows. $\cos$ and $\sin$ are defined by the following differential equations
- $\cos(0) = 1$
- $\sin(0) = 0$
- $\cos' = -\sin$
- $\sin' = \cos$
so $\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$ so $\cos^2(x) + \sin^2(x)$ is constant. Also $\cos^2(0) + \sin^2(0) = 1$ so $\forall x \in \mathbb{R}\cos^2(x) + \sin^2(x) = 1$.
From this, we can show that the distance formula is $d((x, y), (z, w)) = \sqrt{(z - x)^2 + (w - y)^2}$. Since the distance formula also satisfies property 3, the Pythagorean theorem is true.
How do we know there even exists a way of defining distance that satisfies those properties? Since the proof that $\forall x \in \mathbb{R}\cos^2(x) + \sin^2(x) = 1$ didn't even use the concept of distance, we know that it's true. From the statement $\forall x \in \mathbb{R}\cos^2(x) + \sin^2(x) = 1$, it's easy to show that the function $d((x, y), (z, w)) = \sqrt{(z - x)^2 + (w - y)^2}$ satisfies the first 2 properties. It can also be shown to satisfy the third property as follows. $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))$
Some people make other assumptions about what properties the distance formula satisfies. How do we know there exists a way of defining distance that satisfies all of them? Because it has been proven in this answer that $d((x, y), (z, w)) = \sqrt{(z - x)^2 + (w - y)^2}$ is the unique function satisfying 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))$
and it also satisfies the additional properties
- The area of any square is the square of the length of its edges
- $\forall x \in \mathbb{R}d((0, 0), (\cos(x), \sin(x))) = 1$
The second of the two assumptions I made about distance don't appear as any of there 7 assumptions. That's because that assumption can be deduced from properties 3, 5, and 7 of these 7 properties.