Skip to content
The Lumenary
First-year graduateGraduate 110 min

Reading the mathematical literature

Finding the sources, reading them non-linearly, reconstructing what the author left out — Zagier's one-sentence proof, checked line by line — and judging what is proved, cited, conjectured or merely hoped.

Formally verified · 12 LeanComputationally tested · 2 PythonAI-drafted · awaiting human reviewMathematically reviewed: Awaiting human review
MotivationH

A proof in one sentence

In 1990 Don Zagier published in the American Mathematical Monthly a note whose entire proof is a single sentence. It proves Fermat's theorem that every prime p≡1(mod4)p \equiv 1 \pmod 4 is a sum of two squares:

The involution on the finite set S={(x,y,z)∈N3:x2+4yz=p}S = \{(x, y, z) \in \N^3 : x^2 + 4yz = p\} defined by (x,y,z)↦(x+2z, z, y−x−z)(x, y, z) \mapsto (x + 2z,\ z,\ y - x - z) if x<y−zx \lt y - z; (2y−x, y, x−y+z)(2y - x,\ y,\ x - y + z) if y−z<x<2yy - z \lt x \lt 2y; (x−2y, x−y+z, y)(x - 2y,\ x - y + z,\ y) if x>2yx \gt 2y has exactly one fixed point, so ∣S∣|S| is odd and the involution defined by (x,y,z)↦(x,z,y)(x, y, z) \mapsto (x, z, y) also has a fixed point.

Every word is correct, and almost nothing is explained. Why is SS finite? Why does the map send SS to SS, and why is it an involution? What about the cases x=y−zx = y - z and x=2yx = 2y, which the sentence skips? Which fixed point, and why only one? Why does a fixed point of the second involution give two squares? Where is it used that pp is prime, and that p≡1(mod4)p \equiv 1 \pmod 4?

Research mathematics is written like this — not always so tersely, but always for readers who will supply routine steps. Reading it is a skill: finding the right sources among millions of documents, reading them in the right order, reconstructing what was left out, and knowing at every point whether a statement is proved, cited, conjectured or hoped. This lesson develops that skill, with Zagier's sentence as a fully worked case study (checked by computer and in Lean).

IntuitionH

Reading is not linear

Nobody reads a research paper once, from the first line to the last. Experienced readers make several passes:

  1. Survey. Title, abstract, introduction, the statements of the main theorems, the section headings, the bibliography. What is claimed? Is it new? Is this the paper I need?
  2. Map. Read the statements of all lemmas and propositions, and draw the dependency graph: which results are used to prove which, which are proved here and which are cited. Identify the one or two key ideas.
  3. Read the proofs that matter, with pencil and paper: check examples and special cases, reconstruct omitted steps, and mark every place a hypothesis is used.
  4. Place it. Follow the references backwards (where do the tools come from?) and the citations forwards (who used, corrected or improved this?).

Getting stuck is normal, not a sign of inadequacy: "it is easy to see" may hide an hour of work, and occasionally an error. The aim of a first reading is understanding the structure; full verification comes later, and only for what you need. Reading is the other side of mathematical writing: the conventions a good writer follows are the ones a good reader relies on, and checks.

DefinitionsH

Kinds of documents and kinds of claims

Definition— preprint

A preprint is a paper made public before, or without, peer review — today usually on the arXiv. A published article has been accepted by a journal after peer review: one or more referees, chosen by an editor, judge its correctness, novelty and interest. Review lowers the probability of error; it does not eliminate it.

Definition— survey, research article, monograph

A research article claims new results with proofs. A survey summarises a field, its main results and its literature, usually without full proofs. A monograph is a book-length research treatment; lecture notes and textbooks are expository. Surveys and textbooks are the right starting points for a new field; research articles are the primary sources for specific results.

Definition— conjecture and open problem

A conjecture is a precise statement believed, but not proved, to be true. An open problem is a question with no accepted resolution; it need not come with a predicted answer (for example "is π+e\pi + e irrational?"). A claim is conditional if it is proved assuming an unproved hypothesis ("assuming the generalised Riemann hypothesis …"); the implication is then a theorem, and its conclusion is not.

Definition— status of a claim

In reading a paper, label each claim as proved (in this paper), cited (proved elsewhere — where?), conditional, conjectured, heuristic (supported by a non-rigorous argument), numerical (supported by computation, with stated bounds), or folklore (claimed to be known, with no source — a warning sign).

ExplanationH

Finding the literature

Start from expository sources. For a field you do not know, read a survey, a good textbook, the relevant article of the Princeton Companion to Mathematics, or a talk in the proceedings of the International Congress of Mathematicians. Surveys in the Bulletin of the AMS and the Séminaire Bourbaki are written to be read by non-specialists.

Databases. The arXiv (since 1991) holds preprints in all areas of mathematics, freely available; it moderates but does not referee. zbMATH Open — the former Zentralblatt für Mathematik, freely accessible since 2021 — indexes the published literature with reviews and summaries, reaching back to the nineteenth century through the Jahrbuch über die Fortschritte der Mathematik; MathSciNet (the American Mathematical Society's Mathematical Reviews, since 1940) does the same by subscription. Both classify papers by the Mathematics Subject Classification (MSC2020), so that, for example, 11A41 collects papers on primes; both link authors' publication lists, references and citations.

Following citations. Backward citations (the bibliography) lead to the tools and the history; forward citations ("cited by", in zbMATH, MathSciNet or general search engines) lead to later corrections, simplifications and generalisations — essential before relying on an old result. Errata and retractions are attached to papers in the databases.

Specialised resources. The OEIS for integer sequences; the NIST Digital Library of Mathematical Functions; the LMFDB for LL-functions and modular forms; the Stacks Project, whose results have permanent "tags" that can be cited; Mathlib's documentation for formalised mathematics; MathOverflow for research-level questions.

Languages. Important work exists in Russian, French, German, Chinese, Japanese and other languages. Many Russian journals have cover-to-cover English translations (for example Uspekhi Matematicheskikh Nauk as Russian Mathematical Surveys), and reviews in zbMATH and MathSciNet are in English; machine translation now makes the original accessible too. Mathematical notation travels well; terminology does not always — see the conventions below.

ProofH

Reconstructing Zagier's proof

Here is the sentence, reconstructed as a sequence of lemmas. Throughout, pp is prime with p≡1(mod4)p \equiv 1 \pmod 4, and (as in Zagier's note) N\N means the positive integers; the Lean formalisation uses N={0,1,2,… }\N = \{0, 1, 2, \dots\}, which gives the same set SS by Lemma 1.

Theorem— Lemma 1 (S is finite, and its elements are well behaved)

If (x,y,z)∈N3(x, y, z) \in \N^3 with x2+4yz=px^2 + 4yz = p, then x,y,z≤px, y, z \le p; and neither x=y−zx = y - z nor x=2yx = 2y holds. (With N\N including 00: also x,y,z≥1x, y, z \ge 1.)

Proof

The bounds are clear since each of x2x^2 and 4yz4yz is at most pp (and y,z≥1y, z \ge 1). If x=y−zx = y - z then p=x2+4(x+z)z=(x+2z)2p = x^2 + 4(x + z)z = (x + 2z)^2 is a square; if x=2yx = 2y then p=4y2+4yz=4y(y+z)p = 4y^2 + 4yz = 4y(y + z) is divisible by 44. A prime is neither. (If zero were allowed: y=0y = 0 or z=0z = 0 would make p=x2p = x^2 a square, and x=0x = 0 would make 4∣p4 \mid p.) ■\blacksquare

∎

So the three cases of the map cover SS completely — the first place where primality is used, silently.

Theorem— Lemma 2 (the map sends S to S)

Write ff for Zagier's map. If t∈St \in S then f(t)∈Sf(t) \in S.

Proof

In each case the entries are positive integers by the case conditions, and x2+4yzx^2 + 4yz is preserved:

(x+2z)2+4z(y−x−z)=x2+4yz,(2y−x)2+4y(x−y+z)=x2+4yz,(x−2y)2+4(x−y+z)y=x2+4yz,(x + 2z)^2 + 4z(y - x - z) = x^2 + 4yz, \quad (2y - x)^2 + 4y(x - y + z) = x^2 + 4yz, \quad (x - 2y)^2 + 4(x - y + z)y = x^2 + 4yz,

each checked by expanding. ■\blacksquare

∎

Theorem— Lemma 3 (f is an involution)

f(f(t))=tf(f(t)) = t for all t∈St \in S.

Proof

If x<y−zx \lt y - z, then f(t)=(x′,y′,z′)=(x+2z,z,y−x−z)f(t) = (x', y', z') = (x + 2z, z, y - x - z) satisfies x′=x+2z>2z=2y′x' = x + 2z \gt 2z = 2y', so the third formula applies: f(f(t))=(x′−2y′,x′−y′+z′,y′)=(x,y,z)f(f(t)) = (x' - 2y', x' - y' + z', y') = (x, y, z). Symmetrically, the third case is sent to the first and back. If y−z<x<2yy - z \lt x \lt 2y, then f(t)=(2y−x,y,x−y+z)f(t) = (2y - x, y, x - y + z) again lies in the middle case (since y′−z′=2y−x−z<2y−x=x′<2y=2y′y' - z' = 2y - x - z \lt 2y - x = x' \lt 2y = 2y', using z≥1z \ge 1 and x≥1x \ge 1), and applying the middle formula once more returns (x,y,z)(x, y, z). ■\blacksquare

∎

Theorem— Lemma 4 (exactly one fixed point)

The only fixed point of ff in SS is (1,1,k)(1, 1, k), where p=4k+1p = 4k + 1.

Proof

A fixed point in the first case would need z=0z = 0, and in the third case y=0y = 0; neither occurs. In the middle case 2y−x=x2y - x = x forces x=yx = y, so p=x2+4xz=x(x+4z)p = x^2 + 4xz = x(x + 4z). Since pp is prime, x=1x = 1 or x=px = p, and x=px = p would give p+4z=1p + 4z = 1, which is impossible; so x=1x = 1. Then 4z=p−14z = p - 1. Conversely (1,1,k)(1, 1, k) satisfies y−z<1<2y - z \lt 1 \lt 2 and is fixed. This is where p≡1(mod4)p \equiv 1 \pmod 4 is used — to make kk an integer — and primality is used a second time. ■\blacksquare

∎

Theorem— Lemma 5 (parity of fixed points)

If gg is an involution of a finite set XX, then ∣X∣≡∣Fix(g)∣(mod2)|X| \equiv |\mathrm{Fix}(g)| \pmod 2.

Proof

The elements not fixed by gg fall into pairs {t,g(t)}\{t, g(t)\} with t≠g(t)t \ne g(t). ■\blacksquare

∎

Theorem— Theorem (Fermat; Zagier's proof)

Every prime p≡1(mod4)p \equiv 1 \pmod 4 is a sum of two squares.

Proof

By Lemmas 2–5, ∣S∣≡1(mod2)|S| \equiv 1 \pmod 2. The map g(x,y,z)=(x,z,y)g(x, y, z) = (x, z, y) is another involution of SS, so by Lemma 5 it has an odd — hence non-zero — number of fixed points. A fixed point has y=zy = z, and then p=x2+4y2=x2+(2y)2p = x^2 + 4y^2 = x^2 + (2y)^2. ■\blacksquare

∎

no boundary casesuses: p primemap sends S to SS is finitemap is an involutionunique fixed pointuses: p prime, p ≡ 1 (mod 4)parity lemmacited|S| is oddswap fixes a pointp = x² + (2y)²
The dependency graph of Zagier's proof. Arrows point from a result to the results that use it; the dashed box is the one cited ingredient (Lemma 5). The finiteness of S is used by both parity arguments.

The reconstruction also shows what the hypotheses buy. For n≡3(mod4)n \equiv 3 \pmod 4 the set SS is empty, since x2+4yz≡1(mod4)x^2 + 4yz \equiv 1 \pmod 4 for odd xx. For composite n≡1(mod4)n \equiv 1 \pmod 4 there is one fixed point of ff for each factorisation n=x(x+4z)n = x(x + 4z), so ∣S∣|S| can be even (for n=21n = 21, which is not a sum of two squares) or odd (for n=45=32+62n = 45 = 3^2 + 6^2). For squares the boundary cases occur and ff is not an involution of SS. The first computation below checks all of this. Zagier's proof is itself a distillation of an argument of Heath-Brown (1984), inspired by Liouville — something a reader learns by following his references.

ExplanationH

Judging what a paper establishes

Annotate the claims. In the introduction of a typical paper you will meet sentences of every kind: "We prove that … (Theorem 1.1)" — proved here; "By a theorem of Siegel [12] …" — cited (check that the cited result really has the hypotheses needed); "Assuming the generalised Riemann hypothesis, we show … (Theorem 1.3)" — a proved implication, not a proved conclusion; "We conjecture that the constant 22 is optimal" — conjectured; "A heuristic argument suggests …" — heuristic; "Numerical computations up to 101210^{12} support …" — numerical, with its bound; "It is well known that …" — folklore, if no source is given. An abstract or a title may claim more than the theorems prove; the theorems are what count.

Read the quantifiers and constants. "For all sufficiently large NN" may hide an ineffective constant, as in Vinogradov's 1937 theorem that every sufficiently large odd number is a sum of three primes — closing that gap for every odd number greater than 55 took Helfgott's work of 2013, combining improved analysis with large computations. Implied constants in O(⋅)O(\cdot) and ≪\ll may or may not be computable; the paper should say which.

Know the status of preprints. A preprint's claims are claims. Perelman's 2002–2003 arXiv preprints on the Poincaré and geometrisation conjectures were never submitted to a journal; they became accepted mathematics after several teams (Kleiner and Lott; Morgan and Tian; Cao and Zhu) worked through every step. By contrast, Mochizuki's 2012 claimed proof of the abc conjecture, published in 2021 in a journal edited at his own institute, is not accepted by most experts: Scholze and Stix (2018) argued that a key step does not hold. Status is decided by the community's checking, not by the place of publication.

Know that published results can be wrong. Kempe's 1879 "proof" of the four colour theorem was accepted for eleven years until Heawood found the error. Grunwald's 1933 theorem in algebraic number theory was false; Shianghao Wang found the counterexample in 1948, and the corrected statement is now called the Grunwald–Wang theorem. Dulac's 1923 proof that a polynomial vector field has finitely many limit cycles contained a gap noticed by Ilyashenko around 1981; complete proofs were given by Écalle and by Ilyashenko in the early 1990s. Before relying on a result, look for later papers that cite it.

Know what evidence can do. Goldbach's conjecture has been verified for every even number up to 4×10184 \times 10^{18} (Oliveira e Silva, Herzog and Pardi, 2014) and is unproved. The Mertens conjecture, ∣M(n)∣<n|M(n)| \lt \sqrt n for all n>1n \gt 1, holds for every nn ever checked — and is false (Odlyzko and te Riele, 1985), although no counterexample is known explicitly. Numerical support makes a conjecture worth taking seriously; it does not make it a theorem. See experimental mathematics.

Mind the conventions. Is 0∈N0 \in \N? (Zagier's N\N starts at 11; Lean's at 00.) In French, positif means ≥0\ge 0 and strictement positif means >0\gt 0. Bourbaki's "compact" includes the Hausdorff condition, which English-language texts often call "compact Hausdorff"; Bourbaki's "quasi-compact" is the English "compact". "Ring" may or may not require a unit; "log⁡\log" may be natural or base 22; "smooth" may mean C∞C^\infty or "sufficiently differentiable". In formal libraries a/0=0a/0 = 0 and natural-number subtraction is truncated, so identities carry side conditions that informal texts leave implicit. A statement is only meaningful once its conventions are fixed.

Formal mathematicsF

Zagier's proof, reconstructed in Lean

The Lean module carries out the reconstruction above, step by step. The set SS and Zagier's map, with the boundary cases assigned to branches (they never occur):

zagierSetLean 4Formally verified
/-- The finite set `S = {(x, y, z) : x² + 4yz = p}`, written as a filter of the box
`{0, …, p}³` so that its finiteness is evident. -/
def zagierSet (p : ℕ) : Finset (ℕ × ℕ × ℕ) :=
  (Finset.range (p + 1) ×ˢ Finset.range (p + 1) ×ˢ Finset.range (p + 1)).filter
    fun t => t.1 ^ 2 + 4 * t.2.1 * t.2.2 = p
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ReadingLiterature.leanTry it in the Lean web editor
zagierLean 4Formally verified
/-- Zagier's map, in his three cases:
`(x, y, z) ↦ (x + 2z, z, y - x - z)` if `x < y - z`;
`(2y - x, y, x - y + z)` if `y - z < x < 2y`; and `(x - 2y, x - y + z, y)` if `x > 2y`.
(The boundary cases `x = y - z` and `x = 2y` are assigned to the second and third branch;
they never occur for prime `p`.) -/
def zagier (t : ℕ × ℕ × ℕ) : ℕ × ℕ × ℕ :=
  if t.1 + t.2.2 < t.2.1 then (t.1 + 2 * t.2.2, t.2.2, t.2.1 - t.1 - t.2.2)
  else if t.1 < 2 * t.2.1 then (2 * t.2.1 - t.1, t.2.1, t.1 + t.2.2 - t.2.1)
  else (t.1 - 2 * t.2.1, t.1 + t.2.2 - t.2.1, t.2.1)
Axioms used: No axiomsformal/Lumenary/ReadingLiterature.leanTry it in the Lean web editor

Lemma 1 — the silent uses of primality — and the consequence that the box bounds are automatic:

mem_factsLean 4Proved here from basic factsFormally verified
/-- **The omitted case analysis.** If `x² + 4yz = p` with `p` prime, then `x, y, z ≥ 1`, and
neither boundary case `x + z = y` nor `x = 2y` can occur: the first would make `p` a square,
`(x + 2z)²`, and the second would make `4 ∣ p`. This is where Zagier's sentence silently uses
that `p` is prime. -/
theorem mem_facts {p x y z : ℕ} (hp : p.Prime) (h : x ^ 2 + 4 * y * z = p) :
    1 ≤ x ∧ 1 ≤ y ∧ 1 ≤ z ∧ x + z ≠ y ∧ x ≠ 2 * y := by
  have hp2 := hp.two_le
  -- `p` is not a perfect square
  have nsq : ∀ m : ℕ, m ^ 2 ≠ p := by
    intro m hm
    have hdvd : m ∣ p := ⟨m, by rw [← hm]; ring⟩
    rcases hp.eq_one_or_self_of_dvd m hdvd with h1 | h1
    · subst h1; omega
    · subst h1
      have : m * m = m * 1 := by rw [← sq, mul_one]; exact hm
      have hm0 : m ≠ 0 := by omega
      have := Nat.eq_of_mul_eq_mul_left (Nat.pos_of_ne_zero hm0) this
      omega
  -- `4` does not divide `p`
  have n4 : ¬ 4 ∣ p := by
    intro h4
    have h2 : 2 ∣ p := Nat.dvd_trans ⟨2, rfl⟩ h4
    rcases hp.eq_one_or_self_of_dvd 2 h2 with h1 | h1
    · omega
    · rw [← h1] at h4; omega
  refine ⟨?_, ?_, ?_, ?_, ?_⟩
  · by_contra hx
    have hx0 : x = 0 := by omega
    subst hx0
    exact n4 ⟨y * z, by rw [← h]; ring⟩
  · by_contra hy
    have hy0 : y = 0 := by omega
    subst hy0
    exact nsq x (by simpa using h)
  · by_contra hz
    have hz0 : z = 0 := by omega
    subst hz0
    exact nsq x (by simpa using h)
  · intro hxy
    subst hxy
    exact nsq (x + 2 * z) (by rw [← h]; ring)
  · intro hx
    subst hx
    exact n4 ⟨y * y + y * z, by rw [← h]; ring⟩
Axioms used: propext, Quot.soundformal/Lumenary/ReadingLiterature.leanTry it in the Lean web editor
mem_zagierSetLean 4Proved here from basic factsFormally verified
/-- For prime `p`, membership in `S` is just the equation: the box bounds are automatic. -/
theorem mem_zagierSet {p : ℕ} (hp : p.Prime) (t : ℕ × ℕ × ℕ) :
    t ∈ zagierSet p ↔ t.1 ^ 2 + 4 * t.2.1 * t.2.2 = p := by
  constructor
  · intro h
    exact (Finset.mem_filter.1 h).2
  · intro h
    obtain ⟨hx, hy, hz, -, -⟩ := mem_facts hp h
    simp only [zagierSet, Finset.mem_filter, Finset.mem_product, Finset.mem_range]
    refine ⟨⟨?_, ?_, ?_⟩, h⟩
    · nlinarith
    · nlinarith
    · nlinarith
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ReadingLiterature.leanTry it in the Lean web editor

Lemmas 2–4:

zagier_memLean 4Proved here from basic factsFormally verified
/-- **The map preserves `x² + 4yz`.** In each case this is a polynomial identity, e.g.
`(x + 2z)² + 4z(y - x - z) = x² + 4yz`; the subtractions are legitimate by the case
conditions. -/
theorem zagier_mem {p : ℕ} (hp : p.Prime) {t : ℕ × ℕ × ℕ} (ht : t ∈ zagierSet p) :
    zagier t ∈ zagierSet p := by
  obtain ⟨x, y, z⟩ := t
  rw [mem_zagierSet hp] at ht ⊢
  dsimp only at ht
  by_cases h1 : x + z < y
  · rw [zagier_of_lt h1]
    dsimp only
    obtain ⟨k, rfl⟩ : ∃ k, y = x + z + k := ⟨y - x - z, by omega⟩
    rw [show x + z + k - x - z = k by omega, ← ht]
    ring
  by_cases h2 : x < 2 * y
  · rw [zagier_of_mid h1 h2]
    dsimp only
    rw [← ht]
    zify [show x ≤ 2 * y by omega, show y ≤ x + z by omega]
    ring
  · rw [zagier_of_ge h1 h2]
    dsimp only
    rw [← ht]
    zify [show 2 * y ≤ x by omega, show y ≤ x + z by omega]
    ring
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ReadingLiterature.leanTry it in the Lean web editor
zagier_zagierLean 4Proved here from basic factsFormally verified
/-- **Zagier's map is an involution on `S`.** The first case is sent to the third, the third
to the first, and the second to itself; once the boundary cases are excluded (`mem_facts`),
each verification is linear arithmetic. -/
theorem zagier_zagier {p : ℕ} (hp : p.Prime) {t : ℕ × ℕ × ℕ} (ht : t ∈ zagierSet p) :
    zagier (zagier t) = t := by
  obtain ⟨x, y, z⟩ := t
  rw [mem_zagierSet hp] at ht
  dsimp only at ht
  obtain ⟨hx, hy, hz, hb1, hb2⟩ := mem_facts hp ht
  by_cases h1 : x + z < y
  · rw [zagier_of_lt h1, zagier_of_ge]
    · simp only [Prod.mk.injEq, and_true]; omega
    all_goals omega
  by_cases h2 : x < 2 * y
  · rw [zagier_of_mid h1 h2, zagier_of_mid]
    · simp only [Prod.mk.injEq, true_and]; omega
    all_goals omega
  · rw [zagier_of_ge h1 h2, zagier_of_lt]
    · simp only [Prod.mk.injEq, true_and]; omega
    omega
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ReadingLiterature.leanTry it in the Lean web editor
zagier_fixed_iffLean 4Proved here from basic factsFormally verified
/-- **The fixed points.** A point of `S` is fixed by Zagier's map iff it is `(1, 1, k)` where
`p = 4k + 1`. (In the first and third cases a fixed point would need `z = 0` or `y = 0`; in the
second it needs `x = y`, so `p = x(x + 4z)`, and primality forces `x = 1`.) -/
theorem zagier_fixed_iff {p : ℕ} (hp : p.Prime) {t : ℕ × ℕ × ℕ} (ht : t ∈ zagierSet p) :
    zagier t = t ↔ t = (1, 1, p / 4) := by
  obtain ⟨x, y, z⟩ := t
  rw [mem_zagierSet hp] at ht
  dsimp only at ht
  obtain ⟨hx, hy, hz, hb1, hb2⟩ := mem_facts hp ht
  constructor
  · intro hfix
    by_cases h1 : x + z < y
    · rw [zagier_of_lt h1] at hfix
      simp only [Prod.mk.injEq] at hfix; omega
    by_cases h2 : x < 2 * y
    · rw [zagier_of_mid h1 h2] at hfix
      simp only [Prod.mk.injEq] at hfix
      have hxy : x = y := by omega
      subst hxy
      have hdvd : x ∣ p := ⟨x + 4 * z, by rw [← ht]; ring⟩
      rcases hp.eq_one_or_self_of_dvd x hdvd with h1' | h1'
      · subst h1'
        simp only [Prod.mk.injEq, true_and]
        omega
      · -- `x = p` is impossible: then `p² ≤ x² + 4xz = p`
        have hle : p * p ≤ p := by
          calc p * p = x ^ 2 := by rw [h1']; ring
            _ ≤ x ^ 2 + 4 * x * z := Nat.le_add_right _ _
            _ = p := ht
        have := hp.two_le
        nlinarith
    · rw [zagier_of_ge h1 h2] at hfix
      simp only [Prod.mk.injEq] at hfix; omega
  · intro h
    simp only [Prod.mk.injEq] at h
    obtain ⟨rfl, rfl, rfl⟩ := h
    rw [zagier_of_mid]
    · simp only [Prod.mk.injEq, true_and]; omega
    all_goals omega
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ReadingLiterature.leanTry it in the Lean web editor

The two parity arguments, using Mathlib's Equiv.Perm.card_fixedPoints_modEq for Lemma 5 (stated there for any map whose pnp^n-th power is the identity), and the theorem:

card_oddLean 4Proved here from basic factsFormally verified
/-- **`|S|` is odd** when `p ≡ 1 (mod 4)`: Zagier's map is an involution of the finite set `S`
with exactly one fixed point, and the number of fixed points of an involution of a finite set
has the same parity as the set (`Equiv.Perm.card_fixedPoints_modEq` with `2¹`). -/
theorem card_odd {p : ℕ} (hp : p.Prime) (h4 : p % 4 = 1) :
    Fintype.card (zagierSet p) % 2 = 1 := by
  let f : Function.End (zagierSet p) := fun t => ⟨zagier t.1, zagier_mem hp t.2⟩
  have hf : f ^ 2 ^ 1 = 1 := by
    funext t
    exact Subtype.ext (zagier_zagier hp t.2)
  have hmod := Equiv.Perm.card_fixedPoints_modEq (p := 2) (n := 1) hf
  have t0mem : ((1, 1, p / 4) : ℕ × ℕ × ℕ) ∈ zagierSet p := by
    rw [mem_zagierSet hp]
    show 1 ^ 2 + 4 * 1 * (p / 4) = p
    norm_num
    omega
  have hone : Fintype.card (Function.fixedPoints f) = 1 := by
    rw [Fintype.card_eq_one_iff]
    refine ⟨⟨⟨_, t0mem⟩, ?_⟩, ?_⟩
    · exact Subtype.ext ((zagier_fixed_iff hp t0mem).2 rfl)
    · rintro ⟨⟨t, htm⟩, hfix⟩
      have h' : zagier t = t := congrArg Subtype.val hfix
      exact Subtype.ext (Subtype.ext ((zagier_fixed_iff hp htm).1 h'))
  rw [hone] at hmod
  exact hmod
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ReadingLiterature.leanTry it in the Lean web editor
zagier_two_squaresLean 4Proved here from basic factsFormally verified
/-- **Fermat's two-squares theorem, by Zagier's proof, with every step reconstructed.** If `p` is
prime and `p ≡ 1 (mod 4)`, then `p = a² + b²`. Since `|S|` is odd, the involution
`(x, y, z) ↦ (x, z, y)` of `S` also has a fixed point `(x, y, y)`, and then
`p = x² + 4y² = x² + (2y)²`. -/
theorem zagier_two_squares {p : ℕ} (hp : p.Prime) (h4 : p % 4 = 1) :
    ∃ a b : ℕ, a ^ 2 + b ^ 2 = p := by
  have swap_mem : ∀ t ∈ zagierSet p, ((t.1, t.2.2, t.2.1) : ℕ × ℕ × ℕ) ∈ zagierSet p := by
    intro t ht
    rw [mem_zagierSet hp] at ht ⊢
    simp only
    rw [← ht]; ring
  let g : Function.End (zagierSet p) := fun t => ⟨(t.1.1, t.1.2.2, t.1.2.1), swap_mem _ t.2⟩
  have hg : g ^ 2 ^ 1 = 1 := by
    funext t
    exact Subtype.ext rfl
  have hmod := Equiv.Perm.card_fixedPoints_modEq (p := 2) (n := 1) hg
  have hodd := card_odd hp h4
  have hpos : 0 < Fintype.card (Function.fixedPoints g) := by
    have : Fintype.card (Function.fixedPoints g) % 2 = 1 := by
      rw [← hodd]; exact hmod.symm
    omega
  obtain ⟨⟨⟨⟨x, y, z⟩, hmem⟩, hfix⟩⟩ := Fintype.card_pos_iff.1 hpos
  have hyz : z = y := by
    have := congrArg (fun t => t.1.2.1) hfix
    simpa [g] using this
  rw [mem_zagierSet hp] at hmem
  simp only at hmem
  subst hyz
  exact ⟨x, 2 * z, by rw [← hmem]; ring⟩
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ReadingLiterature.leanTry it in the Lean web editor

The same theorem in Mathlib, proved through the arithmetic of the Gaussian integers — a different literature — and stated with the hypothesis p mod 4≠3p \bmod 4 \ne 3, which also covers p=2p = 2:

sq_add_sq_libraryLean 4Applies a library theoremFormally verified
/-- The same theorem as it appears in Mathlib (`Nat.Prime.sq_add_sq`), proved there through the
Gaussian integers — a different proof from a different literature. Note its hypothesis
`p % 4 ≠ 3`, which also covers `p = 2 = 1² + 1²`: the same theorem can be stated in slightly
different, non-equivalent ways, and a careful reader checks which one a source proves. -/
theorem sq_add_sq_library {p : ℕ} [Fact p.Prime] (hp : p % 4 ≠ 3) :
    ∃ a b : ℕ, a ^ 2 + b ^ 2 = p :=
  Nat.Prime.sq_add_sq hp
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ReadingLiterature.leanTry it in the Lean web editor

Two conventions that change the meaning of familiar formulas:

div_mul_cancel_needs_hypothesisLean 4Proved here from basic factsFormally verified
/-- In Lean (as in much of the formal literature) `a / 0 = 0`, so the "identity"
`(a / b) · b = a` is false without the hypothesis `b ≠ 0`, which informal texts often leave
implicit. Counterexample: `a = 1, b = 0`. -/
theorem div_mul_cancel_needs_hypothesis : ¬ ∀ a b : ℚ, a / b * b = a := by
  intro h
  have := h 1 0
  norm_num at this
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/ReadingLiterature.leanTry it in the Lean web editor
nat_sub_add_needs_hypothesisLean 4Proved here from basic factsFormally verified
/-- Subtraction of natural numbers is truncated (`3 - 5 = 0`), so `(a - b) + b = a` needs
`b ≤ a`. A text that works in `ℕ` and one that works in `ℤ` may write the same formula and mean
different things. -/
theorem nat_sub_add_needs_hypothesis : ¬ ∀ a b : ℕ, a - b + b = a := by
  intro h
  have := h 3 5
  omega
Axioms used: propext, Quot.soundformal/Lumenary/ReadingLiterature.leanTry it in the Lean web editor

What is formalised: the whole of Zagier's argument, with every omitted step; only the parity lemma (Lemma 5) and the library version of the theorem are cited from Mathlib. Formalising a proof is the most thorough way of reading it — every case the author skipped must be supplied — and a formal proof of this length took longer to write than the sentence did to read. Not formalised: anything about the literature itself — the claims about databases, history and status in this lesson are ordinary scholarly claims, with references.

ComputationC

Checking a proof, and weighing evidence

The first experiment tests our reading of Zagier's proof: it builds SS and both involutions and checks every claim of the sentence for all primes p≡1(mod4)p \equiv 1 \pmod 4 below 30003000; then it runs the same code where a hypothesis fails, to see exactly what breaks.

Checking every claim of Zagier's one-sentence proofPythonExhaustive finite checkCounterexampleComputationally tested
"""Reading a terse proof with a computer: Zagier's one-sentence proof.

Zagier (1990) proved that every prime p = 1 (mod 4) is a sum of two squares
in one sentence: an explicit involution of the finite set
S = {(x, y, z) in positive integers : x^2 + 4yz = p} has exactly one fixed
point, so |S| is odd, so the involution (x, y, z) -> (x, z, y) has a fixed
point too, giving p = x^2 + (2y)^2. The experiment checks every claim of the
sentence for all primes p = 1 (mod 4) below 3000 and then runs the same
machinery on numbers for which a hypothesis fails - p = 3 (mod 4), composite
numbers and squares - to see exactly where each hypothesis is used. This is
exhaustive-finite evidence that we have read the proof correctly; the proof
itself is the human argument (and the lesson's Lean formalisation).
"""

import math

def zagier_set(n):
    """All (x, y, z) of positive integers with x^2 + 4yz = n."""
    out = []
    for x in range(1, math.isqrt(n) + 1):
        rest = n - x * x
        if rest <= 0 or rest % 4:
            continue
        m = rest // 4
        out.extend((x, y, m // y) for y in range(1, m + 1) if m % y == 0)
    return out

def zagier_map(t):
    """Zagier's map; None on the boundary x = y - z or x = 2y."""
    x, y, z = t
    if x < y - z:
        return (x + 2 * z, z, y - x - z)
    if y - z < x < 2 * y:
        return (2 * y - x, y, x - y + z)
    if x > 2 * y:
        return (x - 2 * y, x - y + z, y)
    return None

def analyse(n):
    """Facts about S for the number n (a dict)."""
    s = zagier_set(n)
    members = set(s)
    images = {t: zagier_map(t) for t in s}
    boundary = [t for t, u in images.items() if u is None]
    involution = not boundary and all(
        images[t] in members and images[images[t]] == t for t in s)
    fixed = sorted(t for t, u in images.items() if u == t)
    swap_fixed = sorted(t for t in s if t[1] == t[2])
    squares = sorted({tuple(sorted((x, 2 * y))) for x, y, _ in swap_fixed})
    return {"size": len(s), "boundary": len(boundary),
            "involution": involution, "fixed": fixed,
            "swap_fixed": swap_fixed, "squares": squares}

def is_prime(n):
    """Trial division (n is small here)."""
    return n >= 2 and all(n % d for d in range(2, math.isqrt(n) + 1))

def check_primes(limit):
    """Check all claims of the proof for primes p = 1 (mod 4) below limit."""
    primes = [p for p in range(5, limit, 4) if is_prime(p)]
    bad = []
    for p in primes:
        a = analyse(p)
        ok = (a["involution"] and a["fixed"] == [(1, 1, (p - 1) // 4)]
              and a["size"] % 2 == 1 and a["squares"])
        if not ok:
            bad.append(p)
    return len(primes), bad

def main():
    count, bad = check_primes(3000)
    print(f"Primes p = 1 (mod 4) below 3000: {count}; claims failing for: "
          f"{bad if bad else 'none'}")
    print("(involution of S, unique fixed point (1, 1, (p-1)/4), |S| odd,")
    print(" and a fixed point of the swap giving p = a^2 + b^2)")
    print()
    print(f"{'n':>4} {'kind':<12}{'|S|':>4} {'bnd':>4}  {'Zagier fixed pts':<28}"
          f"{'n = a^2 + b^2'}")
    cases = [(13, "prime 1 mod 4"), (97, "prime 1 mod 4"),
             (19, "prime 3 mod 4"), (21, "3 * 7"), (45, "3^2 * 5"),
             (65, "5 * 13"), (9, "square"), (25, "square")]
    for n, kind in cases:
        a = analyse(n)
        fixed = ", ".join(f"({x},{y},{z})" for x, y, z in a["fixed"]) or "-"
        sq = ", ".join(f"{u}^2+{v}^2" for u, v in a["squares"]) or "-"
        print(f"{n:>4} {kind:<12}{a['size']:>4} {a['boundary']:>4}  "
              f"{fixed:<28}{sq}")
    print()
    print("bnd = points on Zagier's boundary, where his map is undefined.")
    print("p = 3 mod 4: S is empty (x^2 + 4yz is 1 mod 4). Composites: one fixed")
    print("point per factorisation n = x(x + 4z), so |S| may be even (21, 65)")
    print("or odd (45). Squares: boundary points appear and the map is not an")
    print("involution of S. Primality is what makes the fixed point unique.")
    print()
    print("Epistemic status: exhaustive-finite checks of each step of the proof")
    print("for all primes below 3000, plus counterexamples showing that the")
    print("hypotheses are used. This tests our reading of the proof; it does not")
    print("replace the proof, which is checked in full in the Lean module.")

if __name__ == "__main__":
    main()
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

The second experiment computes the kind of evidence a paper might quote for two famous conjectures — the Mertens conjecture and Goldbach's conjecture. The data look equally reassuring. One conjecture is false and the other is open.

Mertens and Goldbach: the same kind of evidence, different fatesPythonExhaustive finite checkExact computationComputationally tested
"""Two conjectures with impressive numerical support: one false, one open.

The Mertens conjecture says |M(n)| < sqrt(n) for all n > 1, where
M(n) = mu(1) + ... + mu(n) sums the Moebius function. Goldbach's conjecture
says every even n > 2 is a sum of two primes. For both, the experiment
computes the evidence a paper might quote: the largest |M(n)|/sqrt(n) for
n <= 10^6 (it stays far below 1), and the smallest number of Goldbach
representations in each decade up to 2 * 10^5 (it grows). Odlyzko and te
Riele proved in 1985 that the Mertens conjecture is false; Goldbach's
conjecture is open. The computations are exact and exhaustive up to the
stated bounds - and they cannot tell the two cases apart.
"""

import numpy as np

def mobius_sieve(limit):
    """mu(n) for 0 <= n <= limit (mu(0) set to 0), by a sieve over primes."""
    mu = np.ones(limit + 1, dtype=np.int64)
    mu[0] = 0
    is_prime = np.ones(limit + 1, dtype=bool)
    is_prime[:2] = False
    for p in range(2, limit + 1):
        if is_prime[p]:
            is_prime[2 * p::p] = False
            mu[p::p] *= -1
            mu[p * p::p * p] = 0
    return mu

def mertens(limit):
    """M(n) for 0 <= n <= limit."""
    return np.cumsum(mobius_sieve(limit))

def worst_mertens_ratio(m, lo, hi):
    """(n, |M(n)|/sqrt(n)) maximising the ratio over lo <= n <= hi."""
    n = np.arange(lo, hi + 1)
    ratio = np.abs(m[lo:hi + 1]) / np.sqrt(n)
    k = int(np.argmax(ratio))
    return lo + k, float(ratio[k])

def goldbach_counts(limit):
    """r[n] = #{(p, q) primes, p <= q, p + q = n} for 0 <= n <= limit."""
    is_prime = np.ones(limit + 1, dtype=bool)
    is_prime[:2] = False
    for p in range(2, int(limit ** 0.5) + 1):
        if is_prime[p]:
            is_prime[p * p::p] = False
    f = is_prime.astype(float)
    size = 1 << (2 * limit + 1).bit_length()
    ordered = np.rint(np.fft.irfft(np.fft.rfft(f, size) ** 2, size))
    ordered = ordered[: limit + 1].astype(np.int64)    # ordered pairs
    squares = np.zeros(limit + 1, dtype=np.int64)       # pairs with p = q
    evens = 2 * np.nonzero(is_prime[: limit // 2 + 1])[0]
    squares[evens] = 1
    return (ordered + squares) // 2

def decade_minima(r, limit):
    """Smallest r(n) over even n in [lo, hi) for decades up to limit."""
    rows, lo = [], 4
    while lo <= limit:
        hi = min(10 if lo == 4 else lo * 10, limit + 1)
        evens = np.arange(lo + lo % 2, hi, 2)
        rows.append((lo, hi - 1, int(r[evens].min())))
        lo = hi
    return rows

def main():
    limit = 10 ** 6
    m = mertens(limit)
    print(f"Mertens function M(n), n <= {limit}:")
    for k in range(1, 7):
        print(f"  M(10^{k}) = {int(m[10 ** k]):>4}")
    for lo in (2, 10 ** 4):
        n_star, worst = worst_mertens_ratio(m, lo, limit)
        print(f"  largest |M(n)|/sqrt(n) for {lo} <= n <= 10^6: {worst:.4f} "
              f"(at n = {n_star})")
    print()
    glimit = 2 * 10 ** 5
    r = goldbach_counts(glimit)
    print(f"Goldbach representations r(n), even 4 <= n <= {glimit}:")
    for lo, hi, least in decade_minima(r, glimit):
        print(f"  min r(n) for even n in [{lo}, {hi}]: {least}")
    print(f"  r(n) = 0 for some even n in range: {bool((r[4::2] == 0).any())}")
    print()
    print("Same shape of evidence: a quantity that stays safely inside its")
    print("bound, or grows. Yet |M(n)| > sqrt(n) for some n (Odlyzko and")
    print("te Riele, 1985), no explicit such n is known, and Goldbach's")
    print("conjecture, verified to 4 * 10^18, is still unproved.")
    print()
    print("Epistemic status: exact integer computations, exhaustive for the")
    print("stated ranges (the FFT counts are rounded from floating point and")
    print("cross-checked in the tests). They are evidence about those ranges")
    print("only; they cannot distinguish a true conjecture from a false one.")

if __name__ == "__main__":
    main()
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.
Explore

Explore: a theorem and its converse

Papers state implications, and readers often silently reverse them. Let pp stand for "nn is a prime with n≡1(mod4)n \equiv 1 \pmod 4" and qq for "nn is a sum of two squares". Fermat's theorem is p→qp \to q. Its converse q→pq \to p is false — 25=32+4225 = 3^2 + 4^2 is not prime — and the table shows the row where the two differ. Then type not q -> not p into the comparison box: the contrapositive is equivalent to the theorem, which is why proofs "by contrapositive" are valid. Remember also: "pp only if qq" means p→qp \to q; "qq is necessary for pp" means p→qp \to q; "qq is sufficient for pp" means q→pq \to p.

Fermat's theorem and its converse

p: n is a prime ≡ 1 (mod 4); q: n is a sum of two squares

Read as: p → q

Read as: q → p

Use the symbols ¬ ∧ ∨ → ↔, the words not, and, or, implies, iff, or ASCII ~ & | -> <->. Variables are single lowercase letters. ¬ binds tightest, then ∧, ∨, →, ↔; p → q → r means p → (q → r).

Try:

Contingent — true in 3 of 4 rows, false in the others.

Not equivalent — they differ in 2 of 4 rows (marked ≠).

pqp → qq → pRows where they differ
TTTT
TFFT≠
FTTF≠
FFTT

4 rows: one for every way of making the 2 variables true or false.

Exercises

Exercises

1. Reading the mathematical literature

Warm-upHuman

A preprint posted yesterday on the arXiv claims a proof of the twin prime conjecture. You are writing a survey. What is the appropriate way to mention it?

Choose one

2. Reading the mathematical literature

Warm-upHuman

You want reviews of the published papers on a topic, classified by subject, with their references and the later papers that cite them. Which resources are designed for this? (Choose all that apply.)

Choose all that apply

3. Reading the mathematical literature

Warm-upHuman

For p=29p = 29, Zagier's involution has the unique fixed point (1,1,z)(1, 1, z). What is zz?

4. Reading the mathematical literature

CoreComputational

List the set S={(x,y,z)∈N3:x2+4yz=17}S = \{(x, y, z) \in \N^3 : x^2 + 4yz = 17\} (positive integers). How many elements does it have?

5. Reading the mathematical literature

CoreHuman

Run Zagier's argument for n=9n = 9 instead of a prime. Here S={(1,1,2),(1,2,1)}S = \{(1, 1, 2), (1, 2, 1)\}. Which step of the reconstructed proof breaks?

Choose one

6. Reading the mathematical literature

CoreHuman

Which of these sentences from the introduction of a (hypothetical) paper assert results that the paper itself proves? (Choose all that apply.)

Choose all that apply

7. Reading the mathematical literature

CoreFormal

Which Lean statement says exactly what Zagier's note proves?

Choose one

8. Reading the mathematical literature

CoreHuman

A paper states: "∣M(n)∣<n|M(n)| \lt \sqrt n has been verified for all 1<n≤10161 \lt n \le 10^{16}", where MM is the Mertens function. What may a careful reader conclude?

Choose one

9. Reading the mathematical literature

StretchComputational

Turn Zagier's proof into an algorithm. Write two_squares(p) that, for a prime p≡1(mod4)p \equiv 1 \pmod 4, builds S={(x,y,z):x2+4yz=p}S = \{(x, y, z) : x^2 + 4yz = p\} (positive integers), finds a fixed point (x,y,y)(x, y, y) of the swap (x,y,z)↦(x,z,y)(x, y, z) \mapsto (x, z, y), and returns the pair (x, 2*y).

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.
Common misconceptionsH

Common misconceptions

Misconception

"A preprint's claims are established results." They are claims, made in good faith but not yet checked by others. Cite them as preprints, check whether a later version or a published version exists, and look for the community's response before relying on them.

Misconception

"I should understand every line on a first, linear reading." Professionals read in passes: structure first, then the proofs that matter. Being stuck on a line is normal; mark it, read on, and return with examples, special cases, the cited sources, or a colleague.

Misconception

"A conjecture with strong numerical support must be true." The Mertens conjecture holds for every nn that has been checked and was disproved in 1985; π(x)<li(x)\pi(x) \lt \mathrm{li}(x) holds wherever computed and fails infinitely often (Littlewood, 1914). Evidence measures plausibility, not truth.

Misconception

"Published means correct." Peer review lowers but does not remove the chance of error: Kempe's, Grunwald's and Dulac's published arguments all failed. Follow forward citations and errata before relying on a result, especially an old or isolated one.

Misconception

"The same symbols mean the same thing in every text." Conventions about N\N, positivity, compactness, rings, logarithms and division by zero vary. Find the author's conventions — often in a short section at the start, sometimes only implicitly — before judging a claim.

ViewpointsH

Many ways of seeing

Number theory— One theorem, several proofs, several literatures

Fermat stated the two-squares theorem in a letter to Mersenne on Christmas Day 1640 (Girard had stated it in 1625); Euler gave the first published proof (1747–1749), by descent. Lagrange and Gauss placed it in the theory of binary quadratic forms: a prime is represented by x2+y2x^2 + y^2 iff −1-1 is a square modulo pp, i.e. iff p=2p = 2 or p≡1(mod4)p \equiv 1 \pmod 4. Thue's lemma and Minkowski's theorem give further proofs, and Heath-Brown's and Zagier's involutions yet another. A reader who knows several proofs knows which hypotheses are essential — and can recognise the theorem in disguise, for example as the statement that pp splits in the Gaussian integers. See number theory.

Algebra— The Gaussian integers

Mathlib's proof goes through the ring Z[i]\Z[i], a Euclidean domain. If p≡1(mod4)p \equiv 1 \pmod 4, then −1≡a2(modp)-1 \equiv a^2 \pmod p for some aa (since (Z/pZ)×(\Z/p\Z)^\times is cyclic of order divisible by 44), so p∣a2+1=(a+i)(a−i)p \mid a^2 + 1 = (a + i)(a - i) but pp divides neither factor; hence pp is not prime in Z[i]\Z[i], and in a unique factorisation domain it factors as p=(x+iy)(x−iy)=x2+y2p = (x + iy)(x - iy) = x^2 + y^2. The algebraist's proof explains why the theorem is true in terms of structure — the splitting of primes in Q(i)\Q(i) — and generalises to the vast theory of which primes split in which number fields. See algebraic number theory.

Topology— Counting fixed points modulo 2

Lemma 5 is the simplest case of a principle that runs through topology. If a group of prime order qq acts on a finite set XX, then ∣X∣≡∣XG∣(modq)|X| \equiv |X^{G}| \pmod q, because non-fixed points come in orbits of size qq; the same cell-counting argument shows that for a finite GG-CW complex XX with GG of order qq, the Euler characteristics satisfy χ(X)≡χ(XG)(modq)\chi(X) \equiv \chi(X^G) \pmod q, the starting point of P. A. Smith's theory of periodic maps. Fixed-point counts as invariants appear again in the Lefschetz fixed-point theorem. Zagier's proof is a fixed-point argument: one involution with a known fixed point forces another to have one.

Geometry— Windmills

Zagier's involution has a well-known geometric reading. Draw x2+4yzx^2 + 4yz as a square of side xx with four y×zy \times z rectangles attached around it, one on each side and rotated in turn, like the sails of a windmill. The same windmill outline can be re-read with a different central square, and that re-reading is exactly Zagier's map; its three cases correspond to whether the new central square is larger or smaller than the old. The fixed point (1,1,k)(1, 1, k) is the windmill whose re-reading is itself, and a windmill whose sails are squares (y=zy = z) has area x2+4y2=x2+(2y)2x^2 + 4y^2 = x^2 + (2y)^2. Pictures like this are often how a terse algebraic argument was found, even when the published text omits them.

Logic— What a proof certifies

A proof is a finite object whose correctness can in principle be checked mechanically; the formal reconstruction in Lean does exactly that, and in doing so had to make explicit every case, convention and hypothesis that Zagier's sentence leaves implicit — the boundary cases, the meaning of N\N, the finiteness of SS. Reading a paper is checking an informal proof against an implicit standard of rigour; formal verification makes the standard explicit. Logic also explains the asymmetry of evidence: the Mertens and Goldbach conjectures are Π1\Pi_1 statements, refutable by a single computation, but never confirmable by one. See formalising published mathematics.

History & global context

History and global context

  • Commentaries. Reconstructing what an author left out is an ancient practice. Liu Hui's commentary (263 CE) on the Chinese Nine Chapters on the Mathematical Art supplied justifications for its procedures; Bhāskara I's commentary (629 CE) explained the terse verses of Āryabhaṭa's Āryabhaṭīya; scholars writing in Arabic and Persian, among them Naṣīr al-Dīn al-Ṭūsī in the thirteenth century, produced critical editions of Euclid that filled gaps and examined the parallel postulate.
  • Journals and reviews. The first scientific journals appeared in 1665 (the Journal des sçavans in Paris and the Philosophical Transactions in London); Crelle's Journal für die reine und angewandte Mathematik (1826) was among the first devoted to mathematics. The Jahrbuch über die Fortschritte der Mathematik reviewed the literature from 1868. Otto Neugebauer founded the Zentralblatt für Mathematik in 1931 and, after leaving Nazi Germany, Mathematical Reviews in the United States in 1940.
  • Self-taught readers. Srinivasa Ramanujan learned much of his mathematics in India from G. S. Carr's Synopsis of Elementary Results, a compendium of thousands of results with few proofs; reconstructing them shaped his style.
  • Preprints. Paul Ginsparg started the arXiv at Los Alamos in 1991, and mathematicians began posting there in 1992; today most new research in mathematics appears there first, free to readers everywhere.
  • The theorem of this lesson. Stated by Girard (1625) and Fermat (1640), proved by Euler (1747–1749), recast by Lagrange and Gauss, and proved in one sentence by Zagier (1990), after Heath-Brown (1984).
Further reading

Further reading

  • D. Zagier, "A one-sentence proof that every prime p≡1(mod4)p \equiv 1 \pmod 4 is a sum of two squares", American Mathematical Monthly 97 (1990), p. 144.
  • Martin Aigner and Günter M. Ziegler, Proofs from THE BOOK (6th ed., 2018) — several proofs of the two-squares theorem, including Zagier's.
  • Timothy Gowers (ed.), The Princeton Companion to Mathematics (2008) — an entry point to every field.
  • Imre Lakatos, Proofs and Refutations (1976) — how proofs, definitions and counterexamples evolve together.
  • Nicholas J. Higham, Handbook of Writing for the Mathematical Sciences (3rd ed., 2020) — includes chapters on reading, searching and refereeing.
  • Paul R. Halmos, "How to write mathematics", L'Enseignement Mathématique (1970); Steven G. Krantz, A Primer of Mathematical Writing (2nd ed., 2017) — the writer's side of the same contract. See also mathematical writing.