Which theorems have Pythagoras' Theorem as a special case? Loomis famously wrote hundreds of proofs of Pythagoras' Theorem (reference below), but these are all basically proofs "from below".  Today on Twitter @panlepan mentioned Carnot's theorem which has Pythagoras' Theorem as a special case and this got me thinking.   Which theorems have Pythagoras' Theorem as a special case?
@BOOK{Loomis1968,
  author =       {Loomis, E.},
  title =        {The {Pythagorean} Proposition},
  publisher =    {National Council of Teachers of Mathematics},
  year =         {1968},
  address =      {Washington},
}

 A: The discrete form of the parallel axes theorem for the second moment of area for $\,n\,$ points $\,A_k\,$ with centroid $\,G\,$ and an arbitrary point $\,P\,$ is $\,\sum_{k=1}^n PA_k^2 = n \cdot PG^2 + \sum_{k=1}^n GA_k^2 \;\;(*)\,$.
Let $\,\triangle ABC\,$ be a right triangle and $\,O\,$ the midpoint of hypotenuse $\,BC\,$, known to also be its circumcenter, so $\,OA = OB = OC = \frac{1}{2} BC\,$. Then$\,(*)\,$ for $\,A_1A_2A_3 \equiv BOC\,$, $\,G\equiv O\,$ and $\,P \equiv A\,$ reduces to Pythagoras' theorem:
$$
\require{cancel}
\begin{align}
AB^2+AO^2+AC^2 = 3 \, AO^2 + OB^2+\bcancel{0}+OC^2 \iff AB^2+AC^2 &=4 AO^2 = BC^2
\end{align}
$$
A: I like to think about Pythagoras theorem as a corollary/special case of the following theorem:
Theorem: Let $X$ be a finite dimensional real Banach space such that the group of linear isometries (that is, isometries which fix $0$) of $X$ acts transitively on the unit sphere of $X$. Then $X$ is a Hilbert space.
That is, having enough rotations forces the norm to come from an inner product, and from this Pythagoras theorem follows
A: The Binet-Cauchy formula says that if $A$ and $B$ are a $n\times m$ and $B$ a $m\times n$ real matrices, respectively, and for $s\subseteq\{1,\ldots ,m\}$ with $|s|=n$ we denote by $A_s$ the $n\times n$ submatrix of $A$ obtained deleting the columns not in $s$, and by $B^s$ the $n\times n$ submatrix of $B$ obtained deleting the rows not in $s$, then
$$\det(AB)=\sum_{\begin{array}{c} s\subseteq\{1,\ldots ,m\}\\ |s=n|\end{array}} \det(A_s)\det(B^s)$$
In the case $B = A^T$, the transpose of $A$, since $B_s = (A^T)_s=(A_s)^T$ the formula gives
$$\det(AA^T) = \sum_{\begin{array}{c} s\subseteq\{1,\ldots ,m\}\\ |s=n|\end{array}} \det(A_s)\det((A_s)^T)=\sum_{\begin{array}{c} s\subseteq\{1,\ldots ,m\}\\ |s=n|\end{array}} (\det(A_s))^2$$
Since the parallelotope in $\mathbb{R}^n$ generated by the $n$ row vectors of $A$ has measure $\sqrt{\det(AA^T)}$, then the formula says that the square of the $n$-dimensional measure of an $n$-dimensional parallelotope equals the sum of the squares of the
measures of its projections onto all possible $n$-dimensional coordinate hyperplanes. If $n = 1$ this reduces to the Pythagorean theorem.
A: In a less “higher” maths fashion :
This Numberphile video somewhat says that Pythagoras theorem is a special case of Ptolemy’s theorem which is a more general view of properties of a cyclic quadrilateral. But navigating between the 2 always seems some sort of tautology to me …
There is also Casey’s theorem which reduces to Ptolemy’s (so which could reduce to Pythagoras’).
Quoting the Ptolemy’s theorem Wikipedia article :

More generally, if the quadrilateral is a rectangle with sides a and b and diagonal d then Ptolemy's theorem reduces to the Pythagorean theorem. In this case the center of the circle coincides with the point of intersection of the diagonals. The product of the diagonals is then d2, the right hand side of Ptolemy's relation is the sum a2 + b2.

Later on, it is cited as a corollary theorem.
A: There’s an “n-dimensional Pythagorean theorem” https://billcookmath.com/papers/2012-06_nD_pythag.pdf, saying that the square of the $k$-dimensional area of a $k$-dimensional parallelogram $P$ in $n$-space is equal to the sum of the squares of the $k$-dimensional areas of the projections of $P$ onto all $k$-dimensional planes spanned by the coordinate axes.
This theorem is in particular relevant when introducing differential forms; I learned about it from this MSE question.
A: The Law of cosines is the first that comes to my mind:
$$c^{2}=a^{2}+b^{2}-2ab\cos \gamma$$

(source: Wikipedia)
If $\gamma$ is a right angle, its cosine is 0 and all that remains is Pythagoras' Theorem.
A: Parseval identities in the theory of Fourier series and integrals.
A: The parallelogram law says that if $\mathcal{V}$ is an inner product space and $\mathbf{v},\mathbf{w} \in \mathcal{V}$, then
$$
2\|\mathbf{v}\|^2 + 2\|\mathbf{w}\|^2 = \|\mathbf{v} + \mathbf{w}\|^2 + \|\mathbf{v} - \mathbf{w}\|^2,
$$
where the norm here is the one induced by the inner product (in fact, a result of John von Neumann says that a norm is induced by an inner product if and only if the above parallelogram law holds). Its name comes from the fact that, if $\mathcal{V} = \mathbb{R}^2$ then the equality above simply tells us something about the sides lengths of a parallelogram compared to the lengths of its diagonals.
In the special case when $\langle \mathbf{v},\mathbf{w}\rangle = 0$, we have $\|\mathbf{v} + \mathbf{w}\|^2 = \|\mathbf{v} - \mathbf{w}\|^2$, so the parallelogram law simplifies to
$$
\|\mathbf{v}\|^2 + \|\mathbf{w}\|^2 = \|\mathbf{v} + \mathbf{w}\|^2,
$$
which is the Pythagorean theorem (if $\mathcal{V} = \mathbb{R}^2$).
A: The Pythagorean theorem is a limit of the general formula for spherical or hyperbolic space: $\cos(a\sqrt{\kappa})\cos(b\sqrt{\kappa})=\cos(c\sqrt{\kappa})$, where $\kappa$ is the curvature.
A: So far no one has mentioned the original generalization!
Early in Euclid's Elements, the Pythagorean theorem is stated by comparing square areas:

Book I, Proposition 47: In right-angled triangles the square on the side opposite the right angle equals the sum of the squares on the
sides containing the right angle.


Later on, the Elements generalizes this far beyond squares. First it defines similar figures, meaning any similar figures with straight line segments:

Book VI, Definition 1: Similar rectilinear figures are such as have their angles severally
equal and the sides about the equal angles proportional.

So the generalization that appears in the Elements is the Pythageorean theorem for any similar figures, as known some 2500 years ago:

Book VI, Proposition 31: In right-angled triangles the figure on the side opposite the right angle equals the sum of the similar and
similarly described figures on the sides containing the right angle.


A: This is probably the simplest: $(a+b)^2=a^2+b^2+2ab$, if you take $a,b$ elements of some inner product vector space and $(\cdot)^2$ means inner product with itself.
A: One of the most attractive generalisations is de Gua's theorem:  If a tetrahedron $ABCD$ is rectangular at $A$, then $$  |BCD|^2=|ABC|^2+|ACD|^2+|ABD|^2$$ where the absolute value signs denote area.
This can easily be proved analytically by the $p,q$ method.  One assumes,as one can, that the vertices are $(0,0,0)$, $(1,0,0)$, $(0,q,0)$ and  $(0,0,t)$--the calculations are then done in a matter of minutes.
Given the objection below, here is the hierarchy of results: The square of the measure of a measurable set in $m$-dimensional affine subspace of euclidean $n$-space is the sum of the squares of the measures of the $n \choose m$ orthogonal projections on all the $m$-dimensional coordinate subspaces of $n$-space with respect to a fixed ONB basis of the latter (Conant and Beyer).
A: Pythagoras' theorem is a special case of the three point identity for Bregman distances: Let $h$ be convex and lower semi-continuous on a Banach space - further assume differentiability of $h$ for simplicity. Then $h$ induces a Bregman distance
$$D_h(u,v) = h(u)-h(v) - \langle \nabla h(v), u-v\rangle $$
and this Bregman distance fulfills the mentioned three point equality
$$\langle \nabla h(u) - \nabla h(v),v-w\rangle = D_h(w,u) + D_h(w,v) + D_h(v,u).$$
The special case appears for $h(u) = \tfrac12\|u\|^2$ on a Hilbert space $X$ (or on $X = \mathbb{R}^2$). Here we get $\nabla h(u) = u$ and $D_h(u,v) = \tfrac12\|x-y\|^2$ and you get Pythagoras.
A: $$1=\cos^2 x+\sin^2x$$ (which can be proven without using Pythagoras) holds for arbitrary $x$ in $\mathbb C$ and yields Pythagoras for real $x$.
A: There is a generalisation of Pythagoras to the case of a non-right angled triangle. Inscribe an isosceles triangle $\triangle ADE$ in $\triangle ABC$ so that $[DE]\subseteq[BC]$ and $|\angle BAC|=|\angle ADC|=|\angle AEB|$. Set $r=|BE|$ and $s=|DC|$. (See a picture here.) Then by observing that $\triangle ABC$, $\triangle DAC$ and $\triangle EBA$ are similar, we get $\frac{a}{b}=\frac{b}{s}$ and $\frac{a}{c}=\frac{c}{r}$, which yields $$b^2+c^2=a(r+s).$$
If $\angle BAC$ is acute, then $[BE]$ and $[DC]$ overlap, so that $r+s>a$, while if $\angle BAC$ is obtuse we have $r+s<a$. And of course if $\angle BAC$ is a right angle, we get $r+s=a$ and recover Pythagoras' Theorem.
Wikipedia attributes this to Thābit ibn Qurra.
A: The law of total variance says that if $X,Y$ are real-valued random variables and $\operatorname E(X^2)<+\infty,$ then
$$
\operatorname{var}(X) = \overbrace{\operatorname{var}(\operatorname E(X\mid Y))}^{\begin{smallmatrix} \text{explained} \\ \text{component} \\ \text{of the variance} \end{smallmatrix}} {} + {} \overbrace{ \operatorname E(\operatorname{var}(X\mid Y)) }^{\begin{smallmatrix} \text{unexplained} \\ \text{component} \\ \text{of the variance} \end{smallmatrix}}
$$
A more concrete version is that in the analysis of variance, the sum of squares of residuals ("residuals" are not to be confused with "errors") plus the sum of squares due to regression equals the total corrected sum of squares (that last being the sum of squares of deviations from the sample mean).
Most statistics texts tell you that the proportion of the total variance that is "explained" is the square of the correlation between $X$ and $Y.$ (For that you need to assume $Y$ also has a finite second moment. But the validity of the identity above does not depend on $Y$ being real-valued at all, and in cases where $Y$ takes values in a set with no structure or in $\mathbb R^n$ or something else, it is still standard to call the explained proportion of the total variance $\text{“}R^2\text{”},$ even though in such cases there is no quantity called $R.$) Some textbooks go on to say that that is also the square of the cosine of an angle (one of the angles of the right triangle that is involved), and then deduce certain bounds on the correlation between $X$ and $Z$ given those between $X$ and $Y$ and between $Y$ and $Z.$
A further generalization is Brillinger's law of total cumulance, of which the following is the case $n=4{:}$
\begin{align}
\text{joint cumulant} = {} & \kappa(X_1,X_2,X_3,X_4) \\[8pt]
= {} & \kappa(\kappa(X_1,X_2,X_3,X_4\mid Y)) \\[6pt]
& {} + {} \underbrace{ \kappa(\kappa(X_1,X_2,X_3\mid Y), \kappa(X_4\mid Y)) + \cdots}_\text{4 terms} \\[2pt]
& {} + {} \underbrace{ \kappa(\kappa(X_1,X_2\mid Y),\kappa(X_3,X_4\mid Y)) + \cdots }_\text{3 terms} \\[6pt]
& {} + {} \underbrace{\kappa(\kappa(X_1,X_2\mid Y),\kappa(X_3\mid Y), \kappa(X_4\mid Y)) + \cdots}_\text{6 terms} \\[6pt]
& {} + \kappa(\kappa(X_1\mid Y),\kappa(X_2\mid Y), \kappa(X_3\mid Y), \kappa(X_4\mid Y))
\end{align}
where the sum is over the set of all partitions of the set $\{X_1,\ldots,X_n\}$ of random variables.
