Poincaré conjecture: the Lean proof, cleaned up together
The 2026 Lean proof of the Poincaré conjecture after Morgan and Tian, 3 million lines, cleaned up together: smaller, faster to build, more readable, the theorems unchanged

| 1 | import PoincareLib.Geometry.RicciFlow.Pinching.Region |
| 2 | import PoincareLib.Geometry.RicciFlow.Pinching.Spectrum |
| 3 | |
| 4 | /-! |
| 5 | # Reading the Hamilton--Ivey carrier in a fixed eigenbasis |
| 6 | |
| 7 | An ordered orthonormal diagonalization identifies the trace and least eigenvalue |
| 8 | used in the operator carrier. The Rayleigh characterization avoids matching the |
| 9 | entire ordered spectrum when eigenvalues are repeated. |
| 10 | |
| 11 | Reference: Morgan--Tian, Claim 4.28, pp. 77--78. |
| 12 | -/ |
| 13 | |
| 14 | namespace Poincare.HamiltonIvey |
| 15 | |
| 16 | open scoped BigOperators |
| 17 | |
| 18 | variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] |
| 19 | [FiniteDimensional ℝ E] |
| 20 | |
| 21 | omit [FiniteDimensional ℝ E] in |
| 22 | theorem diagonal_rayleigh_eq_sum |
| 23 | {A : E →ₗ[ℝ] E} (hA : A.IsSymmetric) |
| 24 | (e : OrthonormalBasis (Fin 3) ℝ E) {d : Fin 3 → ℝ} |
| 25 | (hd : ∀ i, A (e i) = d i • e i) (v : E) : |
| 26 | inner ℝ v (A v) = ∑ i, d i * (inner ℝ (e i) v) ^ 2 := by |
| 27 | have hcoord : ∀ i, e.repr (A v) i = d i * e.repr v i := by |
| 28 | intro i |
| 29 | rw [e.repr_apply_apply, e.repr_apply_apply, ← hA, hd, inner_smul_left] |
| 30 | simp |
| 31 | rw [← e.repr.inner_map_map v (A v), EuclideanSpace.inner_eq_star_dotProduct] |
| 32 | simp only [dotProduct, Pi.star_apply, star_trivial, hcoord, e.repr_apply_apply] |
| 33 | apply Finset.sum_congr rfl |
| 34 | intro i hi |
| 35 | ring |
| 36 | |
| 37 | omit [FiniteDimensional ℝ E] in |
| 38 | theorem diagonal_rayleigh_ge_least |
| 39 | {A : E →ₗ[ℝ] E} (hA : A.IsSymmetric) |
| 40 | (e : OrthonormalBasis (Fin 3) ℝ E) {d : Fin 3 → ℝ} |
| 41 | (hd : ∀ i, A (e i) = d i • e i) (horder : Antitone d) |
| 42 | {v : E} (hv : ‖v‖ = 1) : |
| 43 | d 2 ≤ inner ℝ v (A v) := by |
| 44 | have hsq : ∑ i, (inner ℝ (e i) v) ^ 2 = 1 := by |
| 45 | simpa [hv] using e.sum_sq_inner_right v |
| 46 | rw [diagonal_rayleigh_eq_sum hA e hd] |
| 47 | calc |
| 48 | d 2 = ∑ i, d 2 * (inner ℝ (e i) v) ^ 2 := by |
| 49 | rw [← Finset.mul_sum, hsq, mul_one] |
| 50 | _ ≤ _ := Finset.sum_le_sum fun i _ => |
| 51 | mul_le_mul_of_nonneg_right (horder (by omega)) (sq_nonneg _) |
| 52 | |
| 53 | /-- The final entry of an ordered orthonormal diagonalization is the least |
| 54 | eigenvalue, also when some diagonal entries coincide. -/ |
| 55 | theorem diagonal_least_eigenvalue |
| 56 | (hn : Module.finrank ℝ E = 3) {A : E →ₗ[ℝ] E} (hA : A.IsSymmetric) |
| 57 | (e : OrthonormalBasis (Fin 3) ℝ E) {d : Fin 3 → ℝ} |
| 58 | (hd : ∀ i, A (e i) = d i • e i) (horder : Antitone d) : |
| 59 | hA.eigenvalues hn 2 = d 2 := by |
| 60 | apply le_antisymm |
| 61 | · have h := Poincare.symmetric_three_rayleigh_ge_least hA hn (e.orthonormal.1 2) |
| 62 | simpa [hd, inner_smul_right, e.orthonormal.1 2] using h |
| 63 | · obtain ⟨v, hv, heq⟩ := Poincare.symmetric_three_rayleigh_attains_least hA hn |
| 64 | rw [← heq] |
| 65 | exact diagonal_rayleigh_ge_least hA e hd horder hv |
| 66 | |
| 67 | omit [FiniteDimensional ℝ E] in |
| 68 | theorem diagonal_trace |
| 69 | {A : E →ₗ[ℝ] E} (e : OrthonormalBasis (Fin 3) ℝ E) {d : Fin 3 → ℝ} |
| 70 | (hd : ∀ i, A (e i) = d i • e i) : |
| 71 | LinearMap.trace ℝ E A = ∑ i, d i := by |
| 72 | rw [LinearMap.trace_eq_matrix_trace ℝ e.toBasis] |
| 73 | simp [Matrix.trace, LinearMap.toMatrix_apply, hd] |
| 74 | |
| 75 | /-- Carrier membership can be read from any ordered orthonormal diagonalization. -/ |
| 76 | theorem mem_region_iff_diagonal |
| 77 | (hn : Module.finrank ℝ E = 3) {A : E →ₗ[ℝ] E} (hA : A.IsSymmetric) |
| 78 | (e : OrthonormalBasis (Fin 3) ℝ E) {d : Fin 3 → ℝ} |
| 79 | (hd : ∀ i, A (e i) = d i • e i) (horder : Antitone d) (t : ℝ) : |
| 80 | A ∈ region hn t ↔ (∑ i, d i, max (-d 2) 0) ∈ scalarRegion t := by |
| 81 | constructor |
| 82 | · rintro ⟨h, hm⟩ |
| 83 | simpa only [diagonal_trace e hd, diagonal_least_eigenvalue hn h e hd horder] using hm |
| 84 | · intro hm |
| 85 | refine ⟨hA, ?_⟩ |
| 86 | simpa only [diagonal_trace e hd, diagonal_least_eigenvalue hn hA e hd horder] using hm |
| 87 | |
| 88 | end Poincare.HamiltonIvey |