Area can be defined using calculus. Suppose you have a square in $\mathbb{R}^2$.
Let $x$ be the change in the first coordinate going from E to D. Let $y$ be the change in the second coordinate going from E to D. We can see that the area of the square is $(x - y)^2 + 2xy = x^2 - 2xy + y^2 + 2xy = x^2 + y^2$. With no assumptions about what properties the distance formula follows, that just proves that the area is $x^2 + y^2$ and proves nothing about what the distance formula is. We could seek a function $d$ that's a binary function from $\mathbb{R}^2$ to $\mathbb{R}$, in other words, a function from $(\mathbb{R}^2)^2$ to $\mathbb{R}$ satisfying certain properties where we say that $\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 the distance from $(x, y)$ to $(z, w)$. We seek a function $d$ satisfying the following properties:
- The distance from any point to itself is 0
- For any square, the distance from any vertex to the one adjacent to it in the counterclockwise direction is the square root of the area
It can be easily shown that $d((x, y), (z, w)) = \sqrt{(z - x)^2 + (w - y)^2}$ is the unique function satisfying those properties. That just shows that using this definition of distance, the Pythagorean theorem holds for all right angle triangles whose legs are parallel to the axes. To show that the Pythagorean theorem holds for all right angle triangles, we also have to show that that function satisfies the following property
- $\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))$
That can be done 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 find other properties of distance so intuitive. How do we know that 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$
Image source: https://www.maa.org/press/periodicals/convergence/proportionality-in-similar-triangles-a-cross-cultural-comparison-the-student-module