RH · checked in Lean

Classroom activities

Ten activities, each runnable in a browser with nothing to install. Each has a suggested year level, the curriculum ideas it supports (see the curriculum links) and teacher notes.

TL;DR

  • Ten browser activities, nothing to install, from primary-school primes to senior proof.
  • Each has a suggested year level, the curriculum ideas it supports, and teacher notes.
  • Quick picks: the sieve (1) for younger students, prime counting (2) for Years 9–12, and "Be the kernel" (10) to see how a proof checker thinks.

1. Sieve of Eratosthenes

Years 5–8 · primes, factorisation, algorithms

Tap the smallest number that isn't crossed out yet: it's prime, so it gets circled, and every one of its multiples is crossed out in one go. Can you guess how many it will remove? Keep going until the sieve tells you to stop, and find out why it can stop early.

Teacher notes
  • Ask why you can start crossing out at \(p^2\), and why you can stop once \(p^2>N\). Every composite number \(\le N\) has a prime factor \(\le\sqrt N\).
  • Extension: count the primes in each row of ten. Do they thin out? That leads into activity 2.

2. Counting primes: \(\pi(x)\) versus \(x/\ln x\)

Years 9–12 · functions and graphs, logarithms

\(\pi(x)\) counts the primes up to \(x\). Compare it with Gauss's guess \(x/\ln x\), and with the better \(\operatorname{li}(x)\).

Teacher notes
  • The ratio column creeps towards 1, slowly. That is the Prime Number Theorem.
  • Compare the error \(|\pi(x)-\operatorname{li}(x)|\) with the \(\sqrt x\) column. RH says the error is never much bigger than \(\sqrt x\ln x\).
  • Why \(\ln\)? Ask students to compute \(x/\pi(x)\): it grows by about 2.3 each time \(x\) is multiplied by 10, and \(\ln 10\approx2.303\).

3. Prime gaps versus \(\ln x\)

Years 9–12 · logarithms, statistics

Teacher notes
  • Individual gaps jump around, but the average gap near \(x\) tracks \(\ln x\). This is "one in \(\ln x\) numbers is prime" seen from the other side.
  • Discussion: twin primes (gap 2) seem never to stop, but nobody has proved it. RH doesn't settle that.

4. Zeta partial-sums explorer

Years 11–12 Specialist, first-year university · series, complex numbers

Choose \(s=\sigma+it\). The line ("partial sums") adds \(1+2^{-s}+3^{-s}+\cdots\) one term at a time. The large round dot ("ζ(s)") is the true value \(\zeta(s)\), computed by analytic continuation (Euler–Maclaurin summation). It is shown for \(-1\le\sigma\le30\) and \(|t|\le200\), where we checked it against the mpmath library to about 12 significant digits; outside that box, and at the pole \(s=1\), the page says so instead of giving a number. (An earlier version used the alternating-series formula \(\zeta(s)=\eta(s)/(1-2^{1-s})\). That formula is valid for \(\sigma\gt0\) except where \(1-2^{1-s}=0\), at \(s=1+2\pi ik/\ln 2\), and our 60-term version was also inaccurate for larger \(t\) (for example at \(s=\tfrac12+100i\)); see the note on the Students page.)

Teacher notes
  • At \(s=2\) the path settles at \(\pi^2/6\approx1.6449\) (the Basel problem).
  • At \(s=\tfrac12+14.1347i\) the series doesn't converge (the path keeps spiralling), but the continued function is almost exactly 0. This is the first non-trivial zero, whose imaginary part is about 14.134725.
  • At \(\sigma=\tfrac12\) the scan's approximate minima sit at the known zeros \(t\approx14.13,\ 21.02,\ 25.01,\ 30.42,\ 32.94,\ 37.59\) (drawn as dots). RH says every non-trivial zero has \(\sigma=\tfrac12\). Set the σ box to 0.6 and scan again: the dips stay clearly above 0. Try 0.55 too: the dips get smaller as σ approaches ½, but small is not zero.
  • The scan samples \(t\) every 0.05 and refines each dip, so it is evidence, not proof. Rigorous verification first counts how many zeros a region must contain (argument principle, Turing's method) so none can be missed between samples (DLMF §25.10; Platt and Trudgian, "The Riemann hypothesis is true up to 3·10¹²", 2021).

5. Euler product check

Years 11–12 · series, primes, index laws

Euler: \(\displaystyle\sum_{n\ge1}\frac1{n^s}=\prod_{p}\frac{1}{1-p^{-s}}\). Compare a sum over integers with a product over primes. Both sides converge only when \(\operatorname{Re}s\gt 1\); here \(s\) is real, so choose \(s\gt1\) (the box starts at 1.1). At \(s=1\) the sum is the harmonic series, which diverges.

Teacher notes
  • Expand \((1+\frac1{2^s}+\frac1{4^s}+\cdots)(1+\frac1{3^s}+\frac1{9^s}+\cdots)\) by hand. Every \(1/n^s\) with \(n\) built from 2s and 3s appears exactly once, because of unique factorisation.
  • Each factor is a geometric series with ratio \(p^{-s}\).
  • Why the two truncated numbers differ: the product over primes \(p\le N\) expands to \(1/n^s\) for every \(n\) whose prime factors are all at most \(N\), including many \(n\gt N\) (for example \(2^{10}\) when \(N=10\)). The truncated sum stops at \(n=N\). So the truncations need not agree; both approach \(\zeta(s)\) as \(N\) grows.

6. Spinning arrows: what \(n^{-s}\) means for complex \(s\)

Year 12 Specialist · complex numbers, polar form

\(n^{-s}=n^{-\sigma}\,e^{-it\ln n}\): an arrow of length \(n^{-\sigma}\) at angle \(-t\ln n\). Put the arrows head to tail. Each arrow is drawn in a different colour just to tell neighbours apart; small dots mark where one arrow ends and the next begins, and the first five are numbered.

Teacher notes
  • Uses \(e^{i\theta}=\cos\theta+i\sin\theta\) and \(n^{-it}=e^{-it\ln n}\).
  • With \(\sigma\le1\) the arrows shrink too slowly and the chain spirals forever. This is why \(\zeta\) needs analytic continuation there.

7. Infinitely many primes (Euclid)

Years 7–10 · primes, proof

Suppose these were all the primes. Multiply them and add 1.

Up to 12 different primes, separated by commas.

Teacher notes
  • A common misconception: "\(p_1p_2\cdots p_k+1\) is always prime." Try 2, 3, 5, 7, 11, 13: you get \(30031=59\times509\). The argument only says its prime factors are new.
  • This is a proof by contradiction, the same shape as the first step of the Lean proof (activity 8).

8. Proof by contradiction: √2, and the RH mirror

Years 10–12 · proof, quantifiers

Warm-up: √2 is irrational

  1. Suppose \(\sqrt2=a/b\) in lowest terms.
  2. Then \(a^2=2b^2\), so \(a^2\) is even, so \(a\) is even: \(a=2c\).
  3. Then \(4c^2=2b^2\), so \(b^2=2c^2\), so \(b\) is even.
  4. Both even contradicts "lowest terms". So \(\sqrt2\) is irrational. ∎

The real thing: the first step of the Lean proof

The theorem rh_of_right says: if \(\zeta(s)\neq0\) whenever \(\operatorname{Re}s>\tfrac12\), then RH holds. Its proof is a proof by contradiction using the mirror symmetry \(s\leftrightarrow1-s\) of the functional equation.

Question. Suppose \(\zeta(s)=0\), \(s\) is not a trivial zero, and \(\operatorname{Re}s=0.3\). Which step gives the contradiction?

Teacher notes
  • Point out the quantifiers in Mathlib's statement: "for all \(s\), if \(\zeta(s)=0\) and \(s\) is not trivial and \(s\neq1\), then \(\operatorname{Re}s=\tfrac12\)". See the students page.
  • The Lean file Formalism/GammaFactorNonvanishing/RhOfRight.lean is about 50 lines. Senior students can try to match its rcases lt_trichotomy case split to the three cases <, =, >.

9. Induction: sums and divisibility

Years 11–12 Specialist / Extension 1 · induction

Move the slider to choose a whole number \(n\) from 1 to 60. The box checks two claims for that one \(n\): that \(1+2+\cdots+n=\frac{n(n+1)}2\), and that \(n^3-n\) is divisible by 6.

Proof that \(1+2+\cdots+n=\frac{n(n+1)}2\). Base case \(n=1\): \(1=\frac{1\cdot2}2\). Inductive step: if it holds for \(n=k\), then \(1+\cdots+k+(k+1)=\frac{k(k+1)}2+(k+1)=\frac{(k+1)(k+2)}2\), which is the statement for \(n=k+1\). ∎

Teacher notes
  • In Lean, induction is a basic rule built into the definition of the natural numbers. The kernel checks that each use has a base case and a step.
  • Exercise: prove by induction that \(6\mid n^3-n\).

10. Be the kernel

Years 9–12 · proof, algorithms and checking

A proof checker doesn't need to be clever. It checks that every line follows from earlier lines by an allowed rule. Find the line that breaks the rules in this "proof" that \(2=1\):

  1. Let \(a=b\). (assumption)
  2. \(a^2=ab\) (multiply both sides by \(a\))
  3. \(a^2-b^2=ab-b^2\) (subtract \(b^2\))
  4. \((a+b)(a-b)=b(a-b)\) (factorise)
  5. \(a+b=b\) (divide both sides by \(a-b\))
  6. \(2b=b\), so \(2=1\) (substitute \(a=b\), divide by \(b\))

Teacher notes
  • This is what happened to the RH proof, at enormous scale. Over a million declarations were each checked by Lean's kernel, and the full proof was re-checked by independently written checkers. See the developers page.
  • Discussion: why do people trust a short checker more than a long proof? Why use several checkers written by different people?