23.2 The Arithmetic Seam, Prime Duality, and the Projection on Elliptic Curve Tori
When we look closely at the Pell remainder (Theorem 23.3) left by Hippasus on the integer grid, a deeper arithmetic question immediately arises: is this oscillation between and an isolated quirk of , or does the seam govern the splitting of prime numbers, the topology of elliptic curves, and the projection that runs through the entire book?
Following this crack uncovers three structural bridges uniting number theory, algebraic geometry, and quantum spinor geometry.
23.2.1 Pillar 1: The Pell Seam Splits Odd Primes into “Line Primes” and “Plane Primes”
Even in the elementary lattice of natural numbers, once the smallest even prime and the smallest odd prime form the hexagonal period base , every prime is forced to inhabit the seams flanking multiples of :
A far deeper bifurcation occurs the moment we replace the base in Pell’s equation by an arbitrary odd prime and inspect the generalized Pell equation
At first glance, the right-hand side is merely a sign choice between and . Yet in the two-dimensional Clifford exterior plane, is the square of the skew-adjoint unitary complex structure (the bivector imaginary generator) , namely (square_eq_neg_one_of_skewAdjoint_unitary)! Depending on whether exists modulo —that is, whether the Legendre symbol equals or , a dividing line that manual derivation 2 below obtains from frozen theorems—the seam splits all odd primes into two families of distinct geometric dimension:
Plane primes are the odd primes with (); line primes are the odd primes with (). The core of this dichotomy is frozen at the pinned trureturing@dev commit, and each of the two lemmas and two theorems below is checked by the Lean kernel. Start with the plainest mechanism: put the squares of the integers on a clock face with only four slots, the residues modulo . The square of an even number is and lands in slot ; the square of an odd number is and lands in slot . A sum of two squares can therefore only land in slots , or ; slot stays empty forever.
The mod dial: a sum of two squares lands only in cells , and ; cell stays empty. The three cyan cells show which residues of the two squares add up to land there, , and ; cell , outlined in dashed magenta, is empty, and the magenta line primes on the left point straight into it, while the cyan plane primes on the right sit in cell (Lemma 23.8).
For every natural number , either or ; and for all natural numbers , .
The Lean proof is the clock face above. Write , where is the remainder of on division by ; expand the square in the cases and (ring_nf) and read off the remainders and (omega). For the second part, the residues of and each take one of two values, and the four combinations sum to , never to . The full proof is checked by the Lean kernel.
The clock face shows at once that a line prime cannot be a sum of two squares: is exactly the empty slot. The converse direction, that a plane prime always is one, cannot be read off the clock face; it requires that arithmetic modulo really contain a rotation.
7: no lattice point on the circle. The magenta circle of radius threads between the lattice points and touches none of them: falls exactly into the empty slot of the clock face, so is not a sum of two squares (Lemma 23.8); it is a line prime.
- Let be a prime natural number with . Then there are natural numbers with .
- For all integers , in the complex numbers , .
In the Lean file, part 1 is a single wrapper: gives , and Mathlib’s version of Fermat’s two-square theorem, Nat.Prime.sq_add_sq, does the rest. Mathlib argues in the Gaussian integers . Since , is a square modulo (ZMod.exists_sq_eq_neg_one_iff), so there is with . Both factors have norm , smaller than the norm of , so divides neither of them, and is not a prime element of . In the Euclidean ring this means is reducible: with neither nor a unit. Taking norms, with neither factor equal to , which forces ; taking and to be the absolute values of the real and imaginary parts of gives . Part 2 rewrites as the squared modulus with Complex.mul_conj and evaluates the squared modulus of as (norm_num). The full proof is checked by the Lean kernel.
Geometrically, says that the circle of radius passes through the lattice point ; part 2 writes this as the product of a conjugate pair of vectors in the Gaussian plane, . Read as the bivector generator introduced above, and the prime spans an orthogonal face: hence the name “plane prime.” A line prime, in turn, has an even stronger rigidity: not only is it not a sum of two squares itself, but as soon as it divides a sum of two squares it must divide both legs.
Plane primes and line primes. When the circle of radius passes through a lattice point, is a plane prime, and squaring gives an integer right triangle; step through the odd primes with the rail under the figure, and for the circle touches no lattice point at all.
Let be a prime with , and let be natural numbers. If , then and .
Move the divisibility into the finite field (ZMod q in Lean), where it reads . If , then is invertible and gives , so is a square modulo ; Mathlib’s ZMod.mod_four_ne_three_of_sq_eq_neg_sq' then yields , contradicting the hypothesis. Hence , so , and since a field has no zero divisors, . Finally and translate back to and . The full proof is checked by the Lean kernel.
Putting the behaviour of the two kinds of prime together yields a criterion for every natural number: plane primes and may be multiplied in freely, while line primes can only enter in pairs.
For a natural number and a prime , let denote the exponent of in the prime factorization of ( when ; by Lean’s convention, every exponent of is ). Then for every natural number : there are natural numbers with if and only if is even for every prime with .
The Lean file only changes the form of the statement. Mathlib’s Nat.eq_sq_add_sq_iff states the condition only for the primes dividing and measures exponents with the -adic valuation padicValNat; the wrapper restates it for all primes: for a prime dividing the two exponents agree (Nat.factorization_def), a prime not dividing has exponent (Nat.factorization_eq_zero_of_not_dvd), and for both sides hold. The mathematics lives in Mathlib’s proof, which passes through the intermediate form “ with a square modulo .” For : if , pull out ; in the remaining the numbers are coprime and is a square modulo . A prime congruent to modulo dividing would make a square modulo that prime, which is impossible, so . For : write as a square times a squarefree . The exponent condition leaves with no prime factor congruent to modulo , so is a square modulo each prime factor of , and by the Chinese remainder theorem also modulo . Induction over the prime factors of then finishes: each prime factor is a sum of two squares (Fermat’s theorem), and a product of sums of two squares is again one,
after which the square factor is multiplied back in. The full proof is checked by the Lean kernel.
Three manual derivations. The following three statements are not frozen as such; apart from elementary congruence arithmetic, they use only the lemmas and theorems above (the derivations themselves are this book’s manual derivations):
- An odd prime is a sum of two squares if and only if . Sufficiency is part 1 of Theorem 23.9; necessity comes from Lemma 23.8: an odd prime leaves remainder or modulo , and slot is empty.
- For an odd prime , the congruence is solvable if and only if . If , take . Here would make the prime a perfect square, and gives ; so and is invertible modulo . From , the residue satisfies . If and with , then , and Lemma 23.10 gives , a contradiction. This is precisely the dividing line, drawn above, between primes modulo which exists and those modulo which it does not.
- For a line prime the negative Pell equation has no solution: if , then has no integer solution. Otherwise , so , and Lemma 23.10 again gives . The value , on the other hand, is reached, for instance and .
: is never reached. The convergents close in on the line , while runs through and repeats. The magenta points (negative gap) only reach ; every cycle comes back to a cyan (such as ) and never touches . This is hand derivation 3.
For the first five plane primes, here are the decomposition, the built by manual derivation 2, and, for comparison with the literature remark below, the least positive solution of the negative Pell equation (the one with the smallest ; every entry can be checked directly in exact integer arithmetic):
| , | least negative-Pell | ||||
|---|---|---|---|---|---|
For the line primes not a single row can be filled in: the second column is blocked by Lemma 23.8, and the fourth and last columns are ruled out by manual derivations 2 and 3.
Now apply Theorem 23.11 to a few specific numbers:
| factorization | exponents at primes | as two squares | ||
|---|---|---|---|---|
| , | no | |||
| no such prime factor | ||||
| (prime) | no |
The clock face already stops . It cannot stop , which is modulo ; what excludes is the pair of odd exponents . The number shows the descent at work: , so by Lemma 23.10 it divides both and ; cancelling leaves , and the exponent drops by in one step. In the factor is modulo , a plane prime with , and the product identity above gives
which are exactly the two legs read off from the Gaussian product .
Literature result, not formalized in this book. The boxes and manual derivations above stop at “is a sum of two squares” and “descends under division.” The following three classical results lie outside the frozen declarations of the trureturing@dev commit locked by this book:
-
Splitting, inertia and ramification in the Gaussian integers. In the ring of Gaussian integers, for the factors and are two non-associate Gaussian primes ( splits); for the prime remains a Gaussian prime ( is inert); and is the only ramified prime.
-
The negative Pell equation for plane primes. For every prime the negative Pell equation has an integer solution (the last column of the table above shows the first five cases), so the fundamental unit of the real quadratic field has norm . In this book’s geometric reading, a unit of norm is a glide reflection that flips orientation, and only its square, with , returns to the branch of pure rotations. The “no solution” half on the side of line primes has already been obtained from a frozen lemma in manual derivation 3.
-
Hilbert reciprocity. For all nonzero rationals , the local Hilbert symbol equals at only finitely many places , and its product over all prime places and the real place at infinity equals :
In this book’s geometric reading, a chiral twist can never arise in isolation on a single prime axis; it must cancel in pairs across places, an arithmetic echo of the principle of Chapter 10 that “pairwise comparison is always consistent and order-independent.”
Put the three steps of this first pillar side by side: a grid point times its own mirror lands on the real axis, multiplying grid points only turns and stretches them, and so whether a number is a sum of two squares depends only on whether each line prime in its factor ledger appears an even number of times.
Which numbers are two squares? (2 min 30 s). The numbers up to that are a sum of two squares light up cyan and look scattered. On the Gaussian grid, the amber point times its mirror has turns of that cancel, and the cyan line lands on the real axis at (part 2 of Theorem 23.9); multiplying grid points adds angles and multiplies lengths, so and give . In the left column the cyan plane primes are each written as two squares (part 1 of Theorem 23.9); in the right column the magenta line primes are blocked by the table of squares modulo in the middle (Lemma 23.8). In the factor ledger a number is two squares when each magenta line prime appears an even number of times: and , while , with and each appearing once, is not, since two different line primes do not make a pair (Theorem 23.11). The product identity follows by expanding both sides. The violet “dial plus a zoom” and the socks that pair only with their own kind are analogies; the splitting of primes into mirror pairs in the Gaussian integers is a literature result (Remark 23.13), and the names plane and line are the book’s reading; the cited theorems decide only whether a number is a sum of two squares, with no search and no count of representations; every number in the film is computed on screen.
23.2.2 Pillar 2: Intersecting Two Quadratic Seams ()—From a Single Quadric to the Congruent-Number Elliptic Curve Torus
Passing from a single quadratic conic to the classical congruent-number problem—where a rational right triangle simultaneously satisfies a Pythagorean hypotenuse constraint and a prescribed orthogonal area—leads to the following classical algebraic-geometric and Riemann-surface structure:
Literature result, not formalized in this book. In classical number theory, algebraic geometry, and Riemann-surface theory (outside the trureturing@dev formalization locked by this book), passing from a single conic to the intersection of two quadric surfaces in projective three-space is governed by the following results:
-
From a genus- conic to the congruent-number elliptic curve: A single Pell equation is a single quadratic conic of genus (affinely its solutions form a group under multiplication of , but this is a multiplicative-group structure, not an elliptic-curve one); over , a smooth projective curve of genus is topologically a 2-sphere with Euler characteristic (for the Hairy Ball obstruction, see Chapter 21, Remark 21.16), which cannot support a globally nowhere-vanishing group flow without singularities. In the classical Congruent Number Question—which positive integers occur as the area of a rational right triangle ?—one simultaneously imposes two quadratic constraints:
equivalently intersecting the two quadric surfaces defined by and in projective three-space after homogenization (degree ). Under the classical birational substitution (or for the standard Weierstrass model ), this pair of Pythagorean constraints is birationally equivalent to the congruent-number elliptic curve:
whose three roots on the right-hand side mark the origin together with the seam boundaries.
-
Complex torus topology and abelian group law: Over , the Riemann surface branched over is no longer a genus- 2-sphere (), but a genus- torus with Euler characteristic ;
-
Because , the even-sphere Hairy Ball obstruction (cf. Remark 21.16) disappears on the torus: the invariant holomorphic differential is everywhere nonvanishing and pole-free on the smooth projective curve , endowing with a smooth global abelian group law (cf. Remark 23.25 in §23.5 below on Poonen’s elliptic-curve divisibility method).
On a torus the arrows vanish nowhere. On the torus () the cyan unit tangent vectors all point along the big circle, with length everywhere; the amber point goes once round, its arrow never shrinking, and there is no magenta ring of a zero on the torus. , against for the sphere (literature result, not formalized in this book; see Remark 23.14). The picture shows a surface of the same topology, not the elliptic curve itself.
23.2.3 Pillar 3: Finite-Field Elliptic-Curve Reduction, the Frobenius Cosine, and the Projection
A deeper arithmetic–geometric correspondence appears when we reduce the normalized congruent-number elliptic curve onto each odd prime axis () from Chapter 22:
Literature result, not formalized in this book. In classical arithmetic geometry (outside the trureturing@dev formalization locked by this book), over the finite field (), the flat projective line has points (including the point at infinity), and the point-count deviation of the smooth projective elliptic curve () from is given by the Legendre-symbol character sum
which is governed by two foundational theorems:
-
Hasse’s Theorem (H. Hasse, 1936; the proved Riemann Hypothesis for elliptic curves over finite fields): For every prime of good reduction, the point-count deviation obeys
The scaling factor carries the critical-line exponent of the local finite-field zeta function. Dividing by normalizes the Frobenius eigenvalues onto the unit circle and turns each prime’s point-count deviation into a Frobenius cosine projection:
In the chord–sagitta language of §30.3: the normalized Frobenius eigenvalue is a rotor and is its sagitta; the Hasse bound is , and the point-count formula (literature result) reads , with the Chebyshev polynomial of the first kind.
-
Gauss’s CM Point-Count Formula and the Line/Plane Prime Dichotomy: On the Pythagorean congruent curve (which has complex multiplication by ), the two odd-prime families of Pillar 1 (Theorem 23.9, Lemma 23.10) separate cleanly under :
-
At inert “Line Primes” : because and , the spins at and cancel pairwise, forcing
-
At split “Plane Primes” : for any integers satisfying , with odd and even, the classical Gauss formula (a literature result; see Remark 23.16) gives . The magnitude of the Frobenius cosine therefore equals the Pythagorean cosine (adjacent leg over hypotenuse) of the prime’s own Gaussian right triangle :
-
Counting points mod . Put into a grid of only numbers and check every cell: cyan lattice points, neutral branch points with and the point at infinity make , six fewer than , so . The ring of spins at the upper right places on a circle and colours each by the Legendre symbol : cyan (the column holds a pair of points ), magenta (the column is empty) and neutral , summing to , which is in the formula above; the amber cosine on the right is . Since and , the deficit is twice the odd leg of the Gaussian triangle, as in item 2 above (literature result, not formalized in this book).
Literature result, not formalized in this book. Why does the same odd leg appear in the curve’s point count? The key is to express the deviation as the sum of two conjugate complex numbers. Conjugation cancels their imaginary parts, leaving twice the real part, while their length is the square root of the prime . Here is the classical character-sum derivation. Schoof’s survey provides background on point counting and complex multiplication1.
Fix any prime and any integers with , odd and even. Throughout, take and the same curve . Its projective equation is ; its discriminant is , so it is smooth. Setting shows that its unique point at infinity is . Write
Let be the quadratic character, with . Each vertical line meets the affine curve in zero, one, or two points, since for every ,
A nonzero square has two roots, a nonsquare has none, and zero has one. Thus the actual curve points consist of these vertical fibers together with exactly one :
Next record the fibers in the complex plane. The group is cyclic of order , and , so we may choose a multiplicative character of exact order four, again extended by zero at zero. On nonzero elements its values lie in , and its square is the unique nontrivial quadratic character. Hence , with the integer values of understood through their usual embedding into . This auxiliary is constructed from , rather than imposed as an additional assumption. We have , and are all nontrivial.
Define the Jacobi sum
Now group terms by . Since , we have . The weight is constant on each square fiber, so
The second line uses , the third uses , and the last uses complex conjugation of character values. This grouping includes the zero fiber: has one square root but ; at the weight contains . Thus have not been discarded: each contributes one affine point to the original count. Writing gives .
All these character values are Gaussian integers, so for integers . The classical Jacobi-sum norm formula applies when both characters and their product are nontrivial, giving 2, hence . We still need to identify which leg is the real part. The integrality congruence for quartic Jacobi sums gives some such that
Writing with and using , we obtain
Finally compare with the given . The Gaussian norm is multiplicative. Both numbers have norm equal to the prime , ruling out a factorization into nonunits; in the Euclidean ring , they are therefore Gaussian primes. Since , unique factorization in the Gaussian integers makes associate to either or . A unit must have norm , and the integer equation gives just the units . Multiplication by would put the even imaginary coordinate in the real slot, contradicting the oddness of ; multiplication by only changes the real part’s sign. Therefore for every such pair , and
This explains the adjacent-leg projection: has length , and its absolute real part is precisely the odd leg . No sign for is chosen, and no restriction modulo is imposed on . For example, at , the values of for are . There are seven affine points and the point , so , , and the absolute cosine is .
The three algebraic results used here have distinct scopes. The power-fiber counting formula applies to every finite field , positive integer , and complex multiplicative character of exact order . For every , it states, in ,
Characters are extended by zero at zero, and the natural-number count on the left is embedded in in the usual way. Taking , , and gives the square-fiber formula above, including at .
The Jacobi-sum norm formula applies to complex multiplicative characters on any finite field , under all three hypotheses , , and . Its conclusion is
Here denotes the trivial multiplicative character, equal to away from zero and at zero. For , , and , the exact orders are four for , two for , and four for , so all three nontriviality hypotheses hold. The classification of Gaussian units states that every invertible Gaussian integer satisfies , , , or : precisely the four possibilities used above to rule out exchanging the two legs.
The quartic integrality congruence corresponds to Mathlib’s exists_jacobiSum_eq_neg_one_add, with , primitive fourth root , and . The three algebraic results respectively control an individual fiber, the length of a Jacobi sum, and the units of the Gaussian integers; none assumes the curve’s trace formula. The complete derivation connecting the actual curve’s point count, Jacobi sums, Gaussian primes, and the normalized cosine remains a literature result, not formalized in this book. It supplies no formal proof of the adjacent inert-prime cancellation, the general Hasse bound, or the non-CM Sato–Tate distribution.
Literature result, not formalized in this book. Passing to a generic elliptic curve over without extra complex-multiplication symmetry (such as ), the asymptotic distribution of the normalized cosines as over all primes of good reduction is established by the Sato–Tate Theorem (proved for non-CM elliptic curves over by Barnet-Lamb, Geraghty, Harris, and Taylor, Publ. Res. Inst. Math. Sci. 47(1), 29–98 (2011)): is equidistributed with respect to the four-dimensional hyperspherical slice law:
Geometrically, on the three-dimensional unit quaternion rotor sphere —the parallelizable hypersphere defined by with (cf. Remark 21.16)—the two-dimensional latitude sphere at polar angle has radius and surface area proportional to ; projecting the uniform Haar measure of onto the normalized trace diameter yields the -coordinate density ; in the polar angle , the same measure is .
Across the first two sections of this chapter, the Lindemann–Weierstrass theorem and T. Y. Chow’s (1999) elementary-field theorem conditional on Schanuel’s conjecture (Conjecture 24.13), the splitting and inertia of primes in the Gaussian integers / negative Pell solvability for primes / Hilbert’s reciprocity law in Remark 23.13, the complex elliptic-curve torus topology and abelian group law in Remark 23.14, Hasse’s bound and Gauss’s CM point-count derivation in Remark 23.15 and Remark 23.16, and the Sato–Tate equidistribution theorem in the present remark are classical mathematical literature results outside the trureturing@dev formalization locked by this book; kernel-verified results in these sections are strictly the boxes with a lean attribute (such as Lemma 23.8, Theorem 23.9, Lemma 23.10, Theorem 23.11, Theorem 23.3, and Theorem 23.4) and the statements carrying explicit lean: citations (such as pell_form_eq_four_mul_norm, golden_fixed_point_unique, power_fiber_card_eq_one_add_character_sum, norm_jacobiSum, and gaussian_unit).
Another curve: the semicircle. Switch to (the cyan points): line primes no longer sit at zero, and the Frobenius cosines scatter between and ; at , for instance, the cosine is . On the right, the violet histogram over the primes of good reduction below follows the dashed amber semicircle law , and the amber vertical line marks the of . A histogram over finitely many primes is only a numerical demonstration; the Sato–Tate distribution is the literature result of the remark above.
In the overarching geometric synthesis of this book, starting from the Pell seam cracked open by Hippasus’s right triangle (Theorem 23.3) and reading across the arithmetic-geometry literature remarks above (Remark 23.13, Remark 23.14, Remark 23.15, and Remark 23.17), the point-count oscillations of a non-CM curve along the prime axes align visually with the cosine shadow cast by the quantum spinor sphere onto its diameter (the congruent-number curve has complex multiplication, so its distribution is not the semicircle).
Interactive laboratory ORTHO//PYTHAGORAS: three scenes along the seam. The Pell seam: the convergents of hug the line ever more closely while is a nonzero integer (for the gray rings mark solutions from the family verified in Lean); line primes and plane primes: whether the circle of radius passes through lattice points; points mod : for the curve , is held inside Hasse’s bound, line primes sit exactly at zero, and the absolute value of the Frobenius cosine of a plane prime equals the cosine of its Gaussian triangle measured from the odd leg . That plane primes are sums of two squares and line primes are not is verified in Lean (Theorem 23.9, Lemma 23.8); Hasse’s theorem and the Sato–Tate distribution are literature results, not formalized in this book.
-
René Schoof, “Counting points on elliptic curves over finite fields”, Journal de Théorie des Nombres de Bordeaux 7 (1995), §§1, 3. Cited here only for background on standard Weierstrass point counts and Gaussian complex multiplication. ↩
-
Keith Conrad, Gauss and Jacobi Sums, author’s notes, Theorem 2.4 and Corollary 2.5, on the norm of Gauss sums of nontrivial characters and the Jacobi-sum norm when both characters and their product are nontrivial. This citation supports only the norm step here, not the complete trace derivation for this curve. ↩