Pythagorean theorem (source code)

= Pythagorean theorem
{c}
{title2=$a^2+b^2=c^2$}
{wiki}

For a <right triangle> in <Euclidean geometry> with perpendicular side <lengths> $a,b>0$ and <hypotenuse> $c$, the <Pythagorean theorem> states
$$
a^2+b^2=c^2.
$$
Geometrically, the <area> of the <square> on the <hypotenuse> equals the sum of the <areas> of the <squares> on the other two sides. Euclid's <Elements>, Book I, Proposition 47 states this <area> equality; Proposition 48 states its converse: a <triangle> satisfying the equality has a <right angle> opposite side $c$.https://mathcs.clarku.edu/~djoyce/elements/bookI/propI47.html[Euclid, Elements I.47]{ref}https://mathcs.clarku.edu/~djoyce/elements/bookI/propI48.html[Euclid, Elements I.48]{ref}

For $a=3$ and $b=4$, we compute $c=\sqrt{9+16}=5$. The <triangle> has <area> $ab/2=6$, and its side <lengths> form a <Pythagorean triple>. Conversely, a <triangle> measured to have sides $3,4,5$ must have a <right angle> between the sides $3$ and $4$. This makes the equality both a calculation tool and a test for perpendicularity.

The three <squares> in the next figure have <areas> $3^2=9$, $4^2=16$ and $5^2=25$ in squared <length> units. These are different from the central <right triangle>'s <area> $3\cdot4/2=6$. The <Pythagorean theorem> adds the <areas> of the attached <squares>, not their side <lengths> and not the <area> of the <triangle>. The <square> on the <hypotenuse> is tilted, but a <rotation> preserves its <area>. This makes the formula visible without suggesting that the <hypotenuse> has to align with an axis.

\Image[/pythagorean-square-areas.png]
{title=Squares on a 3-4-5 right triangle have areas $9+16=25$; the triangle itself has area $6$}

Historically, <Euclid's Elements> records an organized proof of the <Pythagorean theorem> as an equality of <areas>, rather than the modern equation between numbers representing <lengths>. Its placement in Book I makes it available before the treatment of <similar triangles> in Book VI. This is evidence of how the result was established within that text; the name <Pythagorean theorem> alone does not establish who first discovered or proved it. The precise historical anchor here is the surviving proposition, rather than an unsupported story of a single inventor.https://mathcs.clarku.edu/~djoyce/elements/bookI/propI47.html[Euclid, Elements I.47, statement and proof]{ref}

The dissection below makes the general identity tangible. Both outer <squares> have side $a+b$ and contain the same four <congruent> <right triangles>. In the first arrangement, their <hypotenuses> bound a <square> of side $c$: adjacent acute <angles> together make a <right angle>. In the second, the uncovered regions are <squares> of sides $a$ and $b$. Subtracting the same total <triangle> <area> from equal outer <areas> gives
$$
c^2=(a+b)^2-4\frac{ab}{2}=a^2+b^2.
$$
For the pictured dimensions, the shared uncovered <area> is $49-24=25=9+16$.

\Image[/pythagorean-area-dissection.png]
{title=Rearranging four congruent 3-4-5 right triangles proves that the uncovered square areas satisfy $25=9+16$}

The same mechanism survives in <inner product spaces>: for <orthogonal> <vectors> $u,v$, expanding the <inner product> gives $\|u+v\|^2=\|u\|^2+\|v\|^2$. This is why <orthogonal projection> separates a squared distance into independent contributions. The familiar <right triangle> is the simplest picture of a much more reusable principle.