Solution (source code)

= Solution

Choose three mutually perpendicular axes through the same point, and label coordinates $x,y,z$. The <moments of inertia> of any <rigid body> are
$$
I_x=\int(y^2+z^2)\,dm,\qquad I_y=\int(z^2+x^2)\,dm,\qquad I_z=\int(x^2+y^2)\,dm.
$$
Subtracting gives
$$
I_x+I_y-I_z=2\int z^2\,dm\ge0.
$$
For a thin <planar lamina> lying in $z=0$, the right-hand side vanishes, proving the <perpendicular axis theorem>:
$$
\boxed{I_z=I_x+I_y.}
$$
The two in-plane axes and the perpendicular axis must intersect at one point; this need not be the <centre of mass>. For an extended three-dimensional <mass distribution>, the equality generally fails. The general <moment-of-inertia triangle inequalities> are
$$
\boxed{I_x+I_y\ge I_z,\quad I_y+I_z\ge I_x,\quad I_z+I_x\ge I_y,}
$$
with equality in the first precisely when all <mass> lies in the plane perpendicular to its $z$ axis, and cyclically for the others. None of these identities requires <principal axes>.