The Pythagorean theorem generalizes naturally to arbitrary inner product spaces.

Theorem $1 .$ If $\mathrm{x} \perp \mathrm{y}$, then

$$

\|\mathrm{x}+\mathbf{y}\|^{2}=\|\mathrm{x}\|^{2}+\|\mathbf{y}\|^{2}

$$

Proof. Suppose $\mathbf{x} \perp \mathbf{y}$, i.e. $\langle\mathbf{x}, \mathbf{y}\rangle=0$. Then

$$

\|\mathrm{x}+\mathbf{y}\|^{2}=\langle\mathrm{x}+\mathbf{y}, \mathrm{x}+\mathbf{y}\rangle=\langle\mathrm{x}, \mathrm{x}\rangle+\langle\mathbf{y}, \mathrm{x}\rangle+\langle\mathrm{x}, \mathbf{y}\rangle+\langle\mathbf{y}, \mathbf{y}\rangle=\|\mathrm{x}\|^{2}+\|\mathbf{y}\|^{2}

$$

as claimed.