Every nonnegative integer is a sum of squares with four terms, with zero terms allowed. Precisely, for every integer , there exist nonnegative integers such that
Allowing arbitrary integer roots gives the same statement: changing a root to its absolute value leaves the resulting square number unchanged. Four is a uniform upper bound on the number of nonzero terms, rather than a demand for four positive terms. Repeated square numbers are allowed. Conrad states the positive case and explicitly explains the role of zero terms; follows by taking all four roots zero. [ref]
The small cases make the convention visible:
In particular, could not be a sum of squares with four strictly positive roots, since each term would be at least one. Geometrically, a square of integer side length has area : the theorem says that any nonnegative whole-number total area can be split into at most four such square areas. It does not assert that those squares tile one larger square or a prescribed rectangle.
Figure 1.
Four-square representations as areas counted in unit cells
. The roots for were found by enumerating nonnegative four-tuples. Each panel has the same unit length, and each little cell has area one. The four separate squares illustrate addition of areas, with no claim about tiling a prescribed shape. These are exact arithmetic examples, not measured data. Details.
Why does the fourth term matter? Two square numbers do not suffice for : in modular arithmetic, a square number has remainder zero or one modulo four, so their sum cannot be three modulo four. The sum of two squares theorem gives a complete criterion for the positive integers representable with two terms. Even three terms leave gaps. A square number has remainder or modulo eight; adding three of these, with repetition allowed, never gives seven modulo eight. Thus cannot be sums of three square numbers, although Lagrange's four-square theorem represents all of them with four. This also proves that the bound four cannot be reduced to three.
The modulo-eight obstruction is not the only way that three terms can fail. For example, needs four: if three square numbers added to , their remainders modulo four would force all three roots even. Dividing by four would then express as a sum of three square numbers, contradicting the preceding calculation. These short checks explain the examples without requiring a full classification of sums of three square numbers.
Figure 2.
Minimum number of nonzero square terms for integers from one to one hundred
. Each cell is labelled by the positive integer being represented; its colour records the least number of nonzero square numbers whose sum equals it. Direct enumeration gives requiring one term, two, three, and four. Zero is omitted from the grid and requires no nonzero terms. Zero padding converts every representation into four slots. This finite computation illustrates Lagrange's four-square theorem; it does not prove its assertion for all nonnegative integers. Details.
The practical benefit of Lagrange's four-square theorem is an existence guarantee for a family of Diophantine equations: for every nonnegative integer , the displayed equation has an integer solution. It does not specify a unique solution. For instance, . To find a representation by a finite search, enumerate and test the sum. The floor function supplies a finite bound because no single term can exceed , and sorting roots removes duplicate orderings without discarding any possible sum. The theorem guarantees that the search succeeds.
A greedy algorithm that repeatedly subtracts the largest available square number need not find four terms: for it chooses , while uses four. The appeal of the theorem is this gap between local choices and a global promise: individual square numbers become farther apart, and two or three terms leave arithmetic obstructions, yet four terms cover every nonnegative integer.
For historical orientation, Conrad dates Lagrange's four-square theorem to and identifies the memoir as Démonstration d'un théorème d'arithmétique: it appeared in the Berlin Academy's volume for the year , published in , pages –. Keeping the volume year and publication year distinct avoids an apparent conflict between dates. [ref]
Lemniscatic integral 2026-10-14
Choose the holomorphic square root equal to one at zero on the unit disc. The resulting elliptic integral maps that disc conformally onto the square with vertices , where . For the inverse Cayley transform between the half-plane and disk , the square of the derivative of , with , is . Thus the two square maps differ by an affine change of coordinate.
Matrix determinant lemma Created 2026-09-24 Updated 2026-10-14
For an invertible matrix and real vectors , the matrix determinant lemma states
The expression is a scalar, so a rank-one matrix update changes the determinant by a single multiplicative factor. One need not expand the updated determinant entry by entry.
For the preceding example with , the dot product is . Hence the updated determinant is . Direct evaluation confirms
More generally, let for a real scalar . The same calculation gives . The determinant is one at , two at , and zero at .
Figure 1.
A rank-one correction can preserve, stretch, or collapse the area of a square
. Each panel maps the unit square by with and . Blue and orange arrows are the images of the two standard basis vectors. At , the parallelogram has area two, despite its strong skew. At , the images are linearly dependent and the full square collapses onto a line. Panel scales differ; the stated areas come from the determinant, rather than from comparing pixel areas. Details.
A compact proof explains the scalar reduction. Put and factor . If , choose a basis starting with . In that basis, , while every other basis vector changes only by a multiple of . Its matrix is triangular with diagonal , giving the required determinant. If , the correction vanishes. This uses multiplicativity of the determinant to restore the factor .
The denominator in the Sherman–Morrison formula is exactly this factor. The rank-one update singularity criterion therefore identifies when the updated matrix inverse ceases to exist. Batson, Spielman and Srivastava use both identities for the symmetric update in Twice-Ramanujan Sparsifiers, section 2.3, Lemmas 2.1–2.2.
Minkowski addition Created 2026-10-06 Updated 2026-10-14
The Minkowski sum of subsets of a vector space collects the result of vector addition for every possible pair:
Think of fixing a point of , making a translation of the whole of by , and then taking the union of these copies over every . The points of specify displacement vectors; they need not be the centre of a shape. Minkowski addition applies to nonconvex sets too. It is different from set union: for on the real line, but .
For axis-aligned rectangles in the Euclidean plane, the coordinate intervals add separately:
Every coordinate between and can be split into one coordinate in and another in , and likewise for the vertical coordinate. Thus a rectangle plus a rectangle gives a square of area , although the two input areas total only . The Minkowski sum adds possible displacements, so its area need not be the sum of input areas.
For closed Euclidean disks centred at the origin, the triangle inequality gives . Conversely, if , split any as . Therefore , including the case . Disks of radii and give a disk of radius , with areas . For disks with centres , the resulting centre is . These two examples lead to the root-of-area comparison in the Brunn-Minkowski theorem.
Figure 1.
Minkowski addition of two rectangles and of two closed disks: exact toy shapes, sample displacement arrows, and the square-root-of-area comparison
. Details.
Minkowski addition is commutative and associative because vector addition is. Its identity is the singleton , and . For displacement vectors and , translations and uniform dilations satisfy
where uses scalar multiplication. A Minkowski sum of convex sets is convex: a line segment between and is obtained by adding the corresponding points of the line segments in and . Closure requires care; see sum of two closed sets need not be closed and sum of a compact set and a closed set.
Multiplication Created 2026-09-24 Updated 2026-10-13
Multiplication combines two factors into their product of numbers. For a natural number , is the sum of copies of ; with no copies the result is zero. This repeated-addition interpretation directly explains integer grouping, while multiplication of arbitrary real numbers also describes scaling by noninteger factors.
A rectangle of side lengths and has area . Split the second side into lengths and . The two areas are and , giving the visible identity
Rotating the same rectangle interchanges the sides without changing its area, explaining . These pictures illustrate distributivity and commutativity for ordinary positive numbers; matrix multiplication and other operations require their own rules.
Figure 1.
Partitioning a rectangle explains distributivity; partitioning a unit square gives an exact product of fractions
. Details.
For a fractional example, take of a quantity and then of that result: the combined scale is . The two fractions are multiplicative inverses. In the unit square on the right, the overlap of a strip occupying of the width with one occupying of the height contains six of twelve equal cells. Its area is . The product stays exact even though the decimal expansion of repeats. [ref]
Objective function 2026-10-13
An objective function is a real-valued function assigning a score to each decision under consideration. An optimization problem seeks a feasible solution maximizing or minimizing this score. The optimizing decision and its score are different objects: in the budget constraint example, the decision is and the optimal value is .
Choosing an objective function expresses what matters. With and , maximizing makes every feasible point equally good; maximizing selects ; maximizing rewards balance. If are side lengths, is a rectangle's area, and the budget constraint fixes its perimeter at . The same mathematics then says that a square encloses the largest area among these rectangles.
For the product objective function, the positive level sets are hyperbolas. Each collects decisions with identical scores. The highest attainable level set touches the feasible set at ; higher ones miss it entirely.
Figure 1.
Product contours meet the feasible budget segment, with a unique maximum of 25 at (5,5)
. Details.
The product is neither a convex function nor a concave function on the positive quadrant: along it is , while along it is . Yet its restriction to this feasible set is a strictly concave function. Thus the geometry of the allowed decisions can make an otherwise nonconcave maximization problem tractable. Replacing by always converts a maximization problem into an equivalent minimization problem.
Orbit (group theory) 2026-10-14
For a group action of a group on a set , the orbit of a group action of is the subset of all positions reachable from :
Two points belong to the same group orbit exactly when one can be moved to the other by a group element. This is an equivalence relation: the identity element gives , the inverse element of a transformation reverses a move, and a product combines two moves. Hence the group orbits form a partition of a set of into equivalence classes. A transitive group action on a nonempty set has just one group orbit. See Ackerman's algebra notes, lemma 0.5.1.3, for the orbit partition.
For the square and the eight-element dihedral group defined under group action, direct enumeration gives the following separate group orbits:
These counts depend on the chosen group action, not just the group. An orbit of a group action describes all configurations equivalent under the permitted transformations. For ordered pairs under the symmetric group, equality of the two entries is preserved, separating the two group orbits in equality-pattern orbits of ordered pairs; the orbit-stabilizer theorem computes their sizes when the symmetric group is .
Orbit-stabilizer theorem Created 2026-09-24 Updated 2026-10-14
For a group action of any group on a set , the cardinality of the orbit of a group action through is the index of a subgroup of its stabilizer subgroup:
In particular, if is a finite group,
For a fixed finite group, a larger stabilizer subgroup means a smaller group orbit: more transformations repeat the same image of . The set itself need not be finite.
The underlying bijection uses left cosets, without requiring to be a normal subgroup:
To check it briefly, replacing by with preserves , so is well-defined. Every member of the group orbit has this form. Finally, implies , hence , proving the bijection. This is the construction in MIT's group-action notes, lemma 23.5. For infinite groups, the bijection and the cardinality statement still hold; division of infinite cardinalities does not supply the finite formula.
For the eight-element dihedral group acting on the square described under group action, moving a marked vertex of a polygon gives . Moving a marked side of a polygon also gives ; moving one unoriented diagonal of a polygon gives ; moving the centroid gives . These are four different group actions, each with one group orbit. In the first group action, the four left cosets of are
They correspond respectively to . Counting all eight transformations would count each position of the marked vertex of a polygon twice.
Figure 1. . The left panel matches four left cosets of a stabilizer subgroup to four images of a vertex of a polygon. The right panel compares the group orbits for separate group actions on vertices of a polygon, sides of a polygon, diagonals of a polygon, and the centroid; each group orbit size times the corresponding stabilizer subgroup group order equals eight. Details.
For a second computed example, let the symmetric group act on the Cartesian product by . There are two orbits of a group action:
and
The first stabilizer subgroup can exchange and while fixing ; the second must fix both and , so also fixes . The orbit-stabilizer theorem gives and , and the two group orbit sizes account for all nine ordered pairs. The general reason for exactly these two group orbits is equality-pattern orbits of ordered pairs.
For equal-length crystallographic root configurations in a plane, taking in the closure condition gives , so every vector occurs with its negative. For fixed , a vector has , because both vectors are unit vectors. Thus its angle relative to belongs to the finite list .
If all vectors are collinear, the set is exactly , giving two opposite points of the unit circle.
If an orthogonal vector occurs, closure supplies . A unit vector making an angle of or with would have inner product with , contradicting integrality of twice that inner product. Thus these four points are the whole set: the vertices of a square.
In the remaining case a noncollinear pair makes an angle of or . Changing a sign, take their angles as . Reflecting the second in the line perpendicular to the first supplies the angle , and negation supplies the other three hexagon vertices. No perpendicular vector can occur, by the preceding inner-product obstruction. The initial finite list now leaves only these six points. Conversely the opposite pair, square and regular hexagon each satisfy both reflection closure and the integrality condition. Hence
For equal-length crystallographic root configurations in a plane, taking in the closure condition gives , so every vector occurs with its negative. For fixed , a vector has , because both vectors are unit vectors. Thus its angle relative to belongs to the finite list .
If all vectors are collinear, the set is exactly , giving two opposite points of the unit circle.
If an orthogonal vector occurs, closure supplies . A unit vector making an angle of or with would have inner product with , contradicting integrality of twice that inner product. Thus these four points are the whole set: the vertices of a square.
In the remaining case a noncollinear pair makes an angle of or . Changing a sign, take their angles as . Reflecting the second in the line perpendicular to the first supplies the angle , and negation supplies the other three hexagon vertices. No perpendicular vector can occur, by the preceding inner-product obstruction. The initial finite list now leaves only these six points. Conversely the opposite pair, square and regular hexagon each satisfy both reflection closure and the integrality condition. Hence
The given permutations satisfy and . The eight elements for are distinct: , whose only element of order two is . Thus is the order-eight dihedral group, and we may use the matrices
They obey the same relations and describe a quarter-turn and a reflection of a square.
The eigenvalues of over the complex numbers are and , with respective eigenlines spanned by and . Since interchanges these eigenlines, neither is an invariant subspace for . Any proper nonzero subrepresentation of this two-dimensional complex representation would be a line invariant under both and , and an -invariant line must be one of those eigenlines. None qualifies, so is irreducible.
For the calculation in part (e), its character is
Indeed , while a quarter-turn or a reflection has trace zero. The character inner product provides a second irreducibility check.
Let , the inverse Cayley transform between the half-plane and disk. Direct calculation gives
so
On the unit disc, choose the holomorphic square root of equal to one at zero. Both sides define nonvanishing holomorphic derivatives, and their quotient has constant square. The branch chosen in part ii gives . Consequently
An affine change of image coordinate preserves conformality, so the lemniscatic integral maps the disc bijectively onto a square.
The normalization specifies the square exactly. Put . The substitution gives . The integral satisfies and , so its four corner values are . Thus
In particular the image is a square rotated through relative to the one in part ii, and its side length is . These symmetries also give from the affine identity.
Figure 1.
The lemniscate and the four-corner boundary correspondence of the lemniscatic disc-to-square map
. Details.
Choose the holomorphic square root in the complex upper half-plane whose boundary value is positive on . Its primitive has derivative . The integral from the boundary basepoint zero is well-defined by a limiting path: the local singularity is only .
The three finite prevertices have derivative exponent , hence image angle . At infinity , so the local coordinate also gives image angle . These are the four corners of a Schwarz-Christoffel mapping to a rectangle. To establish that it is a square rather than a general rectangle, put
The length along is also by . The length along is
by , and the fourth side has the same length by symmetry. With the chosen branch, the boundary derivatives on the intervals have phases , respectively. Therefore
The extended real boundary maps continuously and once around this square. Each side is traversed monotonically, and the four corner limits are finite. The argument principle, applied after small indentations around the boundary singularities, counts one inverse image of each interior value and zero of each exterior value. Since never vanishes in the complex upper half-plane, those interior inverse images are simple. Thus
Take a real modulus and complementary modulus . The Jacobi elliptic sine is constructed by inverting a Schwarz-Christoffel mapping. The main reason for the Schwarz-Christoffel derivative is local angle behavior: if a prevertex corresponds to a polygon angle , straightening that corner gives . Hence has exponent . Along each straight boundary side its argument is constant. Dividing by removes those angle changes; Schwarz reflection extends the quotient across the real boundary and the corner singularities. With all vertices finite, its behavior at infinity is also regular, because the sum of the derivative exponents is . It is therefore a nonzero constant on the sphere. This yields
This argument explains the exponents, the branch choices and the role of boundary reflection, rather than just writing down the formula.
For a rectangle, four angles are , so choose prevertices and normalize the inverse map as
Use the branch positive on . Set
The two middle corner values are . The right side length is
as the substitution shows. The selected branch makes the increment along that side . Thus the other corner values are and . The two boundary intervals through infinity have combined horizontal length ; the substitution gives length from to infinity. In particular . As in the square mapping, the boundary goes once around a rectangle, and the argument principle gives a conformal bijection
Its inverse maps that rectangle onto the complex upper half-plane, and near zero has , . Differentiating the inverse relation gives
These identities continue meromorphically.
All four rectangle edges have real images, so Schwarz reflection extends across them. Reflection in the bottom edge gives . Reflection in the right edge, combined with the first reflection, gives . The even inverse-integral derivative gives , and hence
Reflection in the top edge and then the bottom gives . The resulting period lattice of the Jacobi elliptic sine is
To see the poles, use near the boundary point infinity. Then , so the inverse has a simple pole at with residue . The real half-period shift gives another pole at with opposite residue. Reflection tiles the plane with copies of the rectangle, so these are exactly two simple poles per displayed fundamental cell. They also show there is no additional period: a period must permute these two pole classes; exchanging them would shift by modulo the displayed lattice, which reverses the function's sign and residues rather than preserving it.
For any finite , integrate around a fundamental parallelogram avoiding its zeros and poles. The opposite edges cancel by periodicity, so the number of zeros of equals the number of poles, namely two. Therefore every value has two inverse images modulo periods, counted with multiplicity. The value infinity likewise has the two simple poles as preimages. Usually the finite-value preimages are distinct; the involution interchanges them. At , a critical point supplies one double inverse image instead. For example , , . Thus the printed “exactly two” requires the standard multiplicity convention; it would be false if interpreted as two distinct solutions at these branch values of a holomorphic map.
Now choose and put . Since , is even, elliptic for , and has degree two. The Weierstrass elliptic function for the same lattice is even and has one double pole per cell, hence also degree two. Its generic fibers are precisely . Consequently an even is constant on those fibers and descends to a meromorphic function of . At the four fixed classes of , the even local Laurent expansion makes this descent meromorphic in the squared local coordinate. A meromorphic function on the Riemann sphere is rational, so . Generic map degrees multiply:
Thus has degree one and the degree-two even elliptic function conclusion is
The determinant condition follows because is nonconstant. This proves the existence requested, with the explicit allowable shift .
At a fixed , both cylinder inequalities become
Thus the cross section is a square of side and area . Integrating these cross-sectional areas gives the volume of this bicylinder:
The original double integral covers the triangle . By Fubini's theorem, after reversing the order, runs from to and from to . Since a continuous function is integrable on this bounded region,
For the square pyramid, a horizontal section at height is a square of side : each vertex moves linearly from the base towards . Hence its cross-sectional area is , and its volume is . To use the identity just proved, choose :
Pair each point of the square's boundary with . The vector field obeys , whereas the outward unit normal vector changes sign: . Corresponding arc length elements are equal. Thus the two contributions to the flux cancel, proving without evaluating any boundary integral that
The same cancellation appears in the divergence, which is an odd function of over a region symmetric under . To justify using the planar divergence theorem despite the lack of differentiability at the origin, remove a disk of radius . The vector field is continuously differentiable on the remaining region, its divergence has zero double integral by this symmetry, and the magnitude of the inner flux is at most , since there. Letting recovers the result. This is flux around a removable point singularity.
The group order is the number of elements of the finite group. A normal subgroup satisfies for every , equivalently its left and right cosets agree.
For the square, let be counterclockwise rotation by , and reflection in the horizontal axis. The dihedral group is
The first four elements rotate by degrees. The other four are Euclidean reflections in the horizontal axis, the line , the vertical axis and the line , respectively, for a square centred at the origin with sides parallel to the axes.
The eight nontrivial proper subgroups are
To check completeness, Lagrange's theorem allows proper orders one, two and four. The order-two subgroups are generated by the five involutions displayed. An order-four subgroup containing or is the rotation subgroup. Otherwise it must contain reflections; their product is a rotation, which must be , so its reflections differ by that half-turn, giving the two listed Klein subgroups. The trivial subgroup is an additional proper subgroup. Thus the PDF's count of eight uses “proper” to exclude the trivial subgroup; with the usual inclusive definition there are nine proper subgroups.
A normal subgroup of order two is central: conjugation fixes its identity and must also fix its only other member. The half-turn commutes with every square symmetry, whereas the reflection subgroups are exchanged by conjugation. Hence the unique order-two normal subgroup is
For the general polygon, write with and . A rotation commutes with exactly when , or . A reflection cannot commute with when , because
Therefore the center of a group here is for odd , and for even . The order-two normal subgroups correspond exactly to nonidentity central involutions, proving
This agrees with the involutions in an even dihedral group and uses the convention throughout.
Take the electric potential to vanish at infinity. The distance from the centre to each point charge is half the diagonal of a polygon of the square, namely . The superposition principle for the electric potential therefore gives, for four charges ,
Strictly, specifying only the magnitude of each electric charge leaves its sign undetermined. For signed charges , the general answer is . For example, two positive and two negative charges of equal magnitude give zero electric potential at the centre. The boxed result uses the usual interpretation that all four charges have the same positive sign.
For integers ,
Thus reducing coordinates modulo one gives a well-defined function on the torus . Its determinant is one and its inverse matrix is the integer matrix , so it induces a bijection of the torus. The Jacobian determinant one makes this bijection area-preserving.
Its eigenvalues solve , giving
There are therefore expanding and contracting eigendirections and no eigenvalue on the unit circle: the function is a hyperbolic toral automorphism. The Lyapunov exponents per iterate are
They sum to zero, as required by area preservation.
The four vertices of the unit square map to , the vertices of an area-one parallelogram. To reduce it modulo one, cut it by the integer grid. For each piece in the cell , translate by . Up to boundary identifications these translated pieces partition the unit square, because the inverse integer matrix gives exactly one torus preimage to every point. The colored pieces in the original diagram show the same pieces before and after these translations.
Figure 1.
Area-preserving torus map by cutting and translating its parallelogram
. Details.
For the Fibonacci identity, at the claimed matrix is . If the identity holds at , multiplication on the right by gives
Each equality uses , with the specified indexing . This proves the formula for every positive integer .
A fixed point satisfies . Since has an inverse integer matrix, this forces , so the origin is the only fixed point modulo one.
For period dividing two,
The second congruence gives ; inserting it into the first gives . Thus the complete list is
The first is the fixed origin. Direct application of exchanges the other four in exactly two pairs:
This both verifies the periodic orbits and excludes additional ones.
Finally, if is fixed by , then for an integer vector . The eigenvalues of are and , neither zero. Hence its inverse exists and has rational entries by the adjugate matrix formula for an integer matrix. Therefore has rational coordinates. The derivative of the return map is , with eigenvalues and . Every periodic point is a hyperbolic saddle fixed point of a map and is unstable, although perturbations in its stable eigendirection contract.