Geometry

Two right angles and the diagonal of a box

The theorem applied once gives the diagonal of a floor. Applied again, standing on the first result, it gives the diagonal of the room — and the pattern does not stop at three, which is where a fact about triangles quietly becomes the definition of distance.
16 min read 7 figures Proof without wordsSmall cases lie

Worth reading first: Two squares, four triangles, and no algebra · The dot product is a shadow.

A box twelve units long, four deep and three high has a diagonal of exactly thirteen. Not approximately thirteen: thirteen, because 144+16+9=169144 + 16 + 9 = 169.

The diagonal of a box, by using the theorem twiceA box 12 by 4 by 3 with the diagonal of its floor drawn, and the diagonal of the box standing on it; the two right triangles share a side and give the sum of three squares.124312.6513.00a floor 12 by 4 makes a diagonal of √(12² + 4²) = 12.649that diagonal and the height of 3 are the legs of a second right triangle, whose hypotenuse is√(12.649² + 3²) = 13.000 = √(144 + 16 + 9)
Fig. 1 The diagonal of the floor is found first, by one right triangle. The diagonal of the box is then found by a second right triangle standing on the first, with the floor diagonal as one leg and the height as the other.

That number arrives by using the theorem twice, and the second use is the interesting one, because its right angle is not an edge of the box. It is between a line drawn across the floor and a line going up, and those two were never fastened together by the construction. Something has to justify it.

The argument, in two steps

The floor is a rectangle twelve by four. Its diagonal is a hypotenuse in the ordinary sense: two edges meet at a corner at a right angle, and the theorem gives 144+16=16012.649\sqrt{144+16} = \sqrt{160} \approx 12.649.

Squares on the three sides of a right triangleA right triangle with a square built outward on each side; the two smaller squares together hold as much area as the largest.abc
Fig. 2 The floor on its own: a right triangle with legs twelve and four, and squares on all three sides. Nothing three-dimensional has happened yet.

Now stand that diagonal up. The second triangle has the floor diagonal as its base, the vertical edge of height three as its other leg, and the box diagonal as its hypotenuse. Its legs are 160\sqrt{160} and 33, so the hypotenuse is

(160)2+32=160+9=169=13.\sqrt{\left(\sqrt{160}\right)^{2} + 3^{2}} = \sqrt{160+9} = \sqrt{169} = 13.

The square root and the square undo each other in the middle of that line, which is why the three-dimensional formula has no roots inside it. Applying the theorem nn times leaves one root and nn squares, and the intermediate diagonals never appear.

The right angle nobody built

The step worth examining is the claim that the vertical edge meets the floor diagonal at a right angle.

The box was built with three edges meeting squarely at each corner, so the vertical edge is perpendicular to the two floor edges. The diagonal is neither of those. It is a line drawn across the floor at an angle to both, and no part of the construction says anything about it.

What rescues the step is a small theorem about perpendicularity that gets used constantly and stated rarely: a line perpendicular to two intersecting lines in a plane is perpendicular to every line in that plane. The two floor edges span the floor; every direction in the floor is a combination of them; and perpendicularity survives that combination, because the dot product of the vertical with any combination is the same combination of two dot products, both of which are zero.

That is the dot product doing the work it exists for, and it is why the three-dimensional theorem is really a theorem about orthogonality rather than about boxes. The box is scaffolding.

Not three, but any number

Once the pattern is visible, nothing stops it. Four perpendicular directions give

d2=x12+x22+x32+x42,d^2 = x_1^2 + x_2^2 + x_3^2 + x_4^2,

and the argument is the same: find the diagonal of the three-dimensional face, then stand it up against the fourth edge.

The diagonal of a box, by using the theorem twiceA box 1 by 1 by 1 with the diagonal of its floor drawn, and the diagonal of the box standing on it; the two right triangles share a side and give the sum of three squares.1111.411.73a floor 1 by 1 makes a diagonal of √(1² +1²) = 1.414that diagonal and the height of 1 are thelegs of a second right triangle, whosehypotenuse is √(1.414² + 1²) = 1.732 = √(1+ 1 + 1)
Fig. 3 The unit cube, whose diagonal is 31.732\sqrt{3} \approx 1.732. In four dimensions the corresponding diagonal is exactly 22 — a straight segment inside a unit box, twice as long as any of its sides.

That last remark is worth stopping on. A unit square holds a segment of length 2\sqrt2; a unit cube holds one of 3\sqrt3; the four-dimensional unit box holds one of length exactly 22, and the hundred-dimensional one holds a segment ten times longer than any side of the box containing it. Nothing has gone wrong. The box has more corners to be far apart in.

A second consequence of the same arithmetic is worth stating because it is so often met without being noticed. Adding a coordinate can only increase a distance, never decrease it, since a square is never negative — so shadows are always shorter than the objects casting them, and a projection of a set of points can bring two of them together but never push them apart. Every dimension-reduction method in use rests on that one-line fact, and every one of them accordingly distorts in the same direction.

Somewhere in that sequence the character of the statement changes. In two and three dimensions the formula is a theorem: right angles and lengths already have meanings, and the equation is a discovered fact relating them. In seventeen dimensions there is no prior notion of length to discover a fact about, so the formula is taken as the definition of distance, and the theorem becomes a convention that agrees with the theorem where both apply.

That is the moment the anchor of this ladder stops being about triangles. Choosing a formula for distance is choosing a geometry, and the sum of squares is one choice among many — the one whose unit ball is round, and the only one in which the theorem above is true.

The same theorem about areas

There is a second way to move the statement up a dimension, and it is not the same as the first. Instead of asking about the length of a diagonal, ask about the area of a face.

Cut a corner off a box with a single slanting plane. The piece that comes away has four triangular faces: three right triangles meeting at the corner, and one slanted face opposite it.

De Gua's theorem: the corner of a box, and four areasA tetrahedron cut from the corner of a box: three right triangles meeting at the corner and one slanted face opposite it, whose area squared equals the sum of the other three areas squared.4.423.402.606.15legs 2.6, 3.4 and 2 at the corner give right facesof 4.42, 3.40, 2.60and a slanted face of 6.153, whose square is37.856 — the sum of 19.54 + 11.56 + 6.76
Fig. 4 The corner cut from a box. The three faces meeting at the corner are right triangles; the fourth is not. The square of the slanted face’s area equals the sum of the squares of the other three.

Aslant2=A12+A22+A32.A_{\text{slant}}^{2} = A_1^{2} + A_2^{2} + A_3^{2}.

This is de Gua’s theorem, published in 1783 by Jean Paul de Gua de Malves and known to Descartes a century earlier. It is the Pythagorean theorem with lengths replaced by areas and a right angle replaced by a right corner — three faces meeting the way three walls meet in the corner of a room.

The reason it is a different statement from the box diagonal is that it does not reduce to the two-step argument. There is no intermediate face to stand up; the three squares are added at once. And unlike the length version, it is genuinely about the corner: a tetrahedron whose three faces at a vertex are not mutually perpendicular satisfies no such relation.

De Gua's theorem: the corner of a box, and four areasA tetrahedron cut from the corner of a box: three right triangles meeting at the corner and one slanted face opposite it, whose area squared equals the sum of the other three areas squared.4.504.504.507.79legs 3, 3 and 3 at the corner give right faces of 4.50,4.50, 4.50and a slanted face of 7.794, whose square is 60.750— the sum of 20.25 + 20.25 + 20.25
Fig. 5 The symmetric case: three equal legs, three equal right faces, and an equilateral slanted face. Each right face has area 4.54.5 and the slanted one 3×4.52=7.794\sqrt{3\times 4.5^2} = 7.794, which is not the sum of any two of them and is the root of the sum of their squares.

The generalisation to higher dimensions is the one a reader would guess, and for once the guess is right: for a simplex with a right corner in nn dimensions, the square of the (n1)(n-1)-dimensional content of the face opposite the corner is the sum of the squares of the contents of the other nn faces. Every one of these is the same statement about a normal vector, decomposed into perpendicular components — which is the sum of squares again, one level up.

Where the sum of squares stops behaving

High dimensions are where this ladder’s rung earns the theme it is tagged with, because the small cases are actively misleading.

The sphere wedged between the corner spheres of a cubeA square of side four holding four unit circles at its corners with a small circle wedged between them, beside the radius of that wedged sphere as the dimension rises — which passes the cube's half-width at ten.two dimensions0.414012351015dimensionradius of the inner spherethe cube's half-side93.00in the plane the wedged circle is small and nothing is surprising; the radius is √n − 1 and it does not stopat nine dimensions it is as wide as the cube's half-side, and from ten on the sphere trapped between the corner spheressticks out through the faces of the box holding them
Fig. 6 A square of side four with a unit circle in each corner, and the largest circle that fits between them: radius 210.414\sqrt2 - 1 \approx 0.414. Beside it, the same radius as the dimension grows — n1\sqrt{n}-1, which passes the box’s own half-width at ten dimensions.

Take a cube of side four, and pack a unit sphere into each of its 2n2^n corner cells. Then drop a sphere into the middle, as large as will fit between them. Its centre is at the origin and each corner sphere’s centre is at distance n\sqrt{n} — that is the theorem, applied to the point (1,1,,1)(1,1,\ldots,1) — so the inner sphere has radius n1\sqrt{n}-1.

In two dimensions that is 0.4140.414: a small circle wedged between four big ones, exactly as the picture shows and exactly as intuition expects. In three dimensions it is 0.7320.732. At nine dimensions it is 22, which is the half-width of the cube itself, so the inner sphere touches the faces from the inside. At ten dimensions and beyond, the sphere trapped between the corner spheres pokes out through the walls of the box that contains them.

Nothing is wrong with the arithmetic and nothing is wrong with the picture. What is wrong is the transfer of an intuition about between from two dimensions to ten. The corner spheres do not surround the middle in high dimensions; there are 2102^{10} of them and they cluster near the corners, leaving the middle far more open than a two-dimensional imagination allows.

This is the same phenomenon that makes almost all of a high-dimensional distribution’s mass sit far from its mode and makes nearest-neighbour searching lose its meaning past a few dozen dimensions. In each case the mechanism is the sum of squares: adding many independent squared coordinates concentrates a distance around n\sqrt{n}, and typical stops resembling central.

What it costs

The formula assumes perpendicular axes, and that assumption is doing more work than it looks.

Coordinates are a choice. Nothing forces the three edges of the box to be at right angles to each other, and plenty of natural coordinate systems are skew: crystal axes, oblique map grids, two measurements that are correlated. In skew coordinates the diagonal is not the root of the sum of squares — it is the root of a quadratic form with cross terms, gijxixj\sum g_{ij}x_i x_j, and the gijg_{ij} record the angles between the axes.

A linear map redrawing the planeThe integer grid before and after a linear transformation; the shaded unit square becomes a parallelogram whose area is the determinant.beforeafter · area × 110.5501
Fig. 7 A skew set of axes, drawn as the image of the square grid under a shear. Every cell still has area one and the horizontal distances are unchanged, but the diagonal of a cell is no longer the root of the sum of two squares — the cross term the sheared axes introduce is exactly what the formula assumes away.

The sum of squares is the special case where all the cross terms vanish, which happens exactly when the axes are mutually perpendicular. So the clean formula is not a fact about space; it is a fact about a description of space, and the description was chosen to make it true. A change of basis rearranges the same information into a form where a different thing is obvious, and the rectangular basis is the one that makes distance obvious.

The builder’s version of the same problem is a good test of whether the assumption holds. A rectangular room can be checked by measuring its two floor diagonals, which agree exactly when the corners are square. A box cannot be checked that way: a parallelepiped can have all four space diagonals equal and still be skew, so equal diagonals verify a rectangle in the plane and verify nothing in three dimensions. The check has to be done face by face, which is three plane checks rather than one solid one.

The cost of that convenience is that the theorem cannot be used until orthogonality has been established, and establishing it is often the hard part. In a room with walls out of square, the box formula gives the wrong diagonal, and the error is second order in the skew — small enough to be invisible and large enough to matter.

Who noticed, and when

The three-dimensional case is old and anonymous: it is implicit in any calculation of a diagonal brace, and no one is credited with it because there is nothing to credit.

De Gua’s theorem has a more interesting record. De Gua published it in 1783; Descartes had it in an unpublished manuscript around 1620; Johann Faulhaber stated a version in 1622; and the same result was found again, independently, by Charles Tinseau in 1774. Four independent discoveries over a hundred and sixty years is a fair sign of a result that is easy to reach and easy to forget, which is exactly what a theorem with no application tends to be.

The extension past three dimensions is much later and did not come from geometry. Arthur Cayley wrote about nn-dimensional analytic geometry in 1843, and Hermann Grassmann’s Ausdehnungslehre of 1844 built the whole apparatus of linear combinations in any number of dimensions — and was so badly written that it was ignored for twenty years. What settled the matter was Riemann’s habilitation lecture of 1854, which proposed that a space carries a rule for measuring lengths locally, that the rule may vary from place to place, and that the sum of squares is merely the simplest such rule. Sixty years later that lecture was the mathematics general relativity needed, which is the standard advertisement for it, and the more useful point is the smaller one: after Riemann, distance is a structure a space is given rather than a property it has.

What the picture cannot show

Every figure here is a drawing of three dimensions on a flat page, which means every right angle in the box is drawn as an angle that is not right. The projection distorts each one, and the reader is asked to accept the corner as square on the strength of the caption. That is the ordinary bargain of an axonometric drawing and it is worth noticing rather than assuming, because the argument’s whole content is which angles are right.

The fourth dimension is worse: there is no drawing at all. The claim that a unit four-dimensional box has a diagonal of exactly 22 is arithmetic with no picture behind it, and the figures showing the unit cube are analogies, not evidence. What the corner-sphere figure draws is the two-dimensional case, which is precisely the case that misleads; the surprising part of it is a curve, not a shape.

A curve is a weaker kind of picture, and admitting that is part of the argument. There is no honest illustration of a sphere leaving a box in ten dimensions. There is only n1\sqrt{n}-1, drawn against nn, crossing a line.

The ladder from here

Below this rung: the rearrangement proof, Euclid’s shearing argument, the whole-number solutions and the converse, which is the version that builds things. Above it: what happens when the space is curved, where the sum of squares survives only in the infinitesimal and the theorem becomes a statement about a metric tensor rather than about a box.

Sideways from here, the sum of squares is the quantity a circle’s rational points are about, the reason error-correcting codes measure distance in a cube of bits, and the object least squares minimises — each of them the same expression asked a different question.

Distance was never found lying around

The lasting point is the transition that happens between the third dimension and the seventeenth.

In the plane, the sum of squares is a theorem: length exists first, right angles exist first, and the equation is a discovery about the relationship. In seventeen dimensions the equation comes first and length is whatever it says. Nothing was discovered; something was decided, and the decision was made to agree with the theorem in the cases where a theorem was available.

That move — extending a proved relation into territory where it can only be a definition, and choosing it precisely because it agrees with the proof below — is one of the most common in the subject. It is how exponentiation is extended past the whole numbers, how the factorial is extended to the gamma function, and how the notion of size is extended to infinite sets. In each case the extension is not forced, and in each case the choice made is the one that keeps a picture true.

What links here

Computed from the collection, not written here: the essays that point at this one.

Reads more easily once this is understood

Essays that name this one as worth reading first.

Named objects

A dashed tag is an object no other essay names yet.

De gua theoremDimensionDistanceHypercubeOrthogonalityPythagorean theoremRight angle