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.OperatorReaction.Endomorphism |
| 2 | import PoincareLib.Geometry.RicciFlow.Pinching.OperatorReaction.Scalar |
| 3 | import PoincareLib.Geometry.RicciFlow.Pinching.OperatorReaction.Spectral |
| 4 | |
| 5 | /-! |
| 6 | # Invariance under the normalized operator reaction |
| 7 | |
| 8 | The initial orthonormal eigenbasis stays a diagonalizing basis by ODE |
| 9 | uniqueness. Initial ordering persists for the diagonal entries, and the |
| 10 | rate-two scalar theorem gives the absolute-time Hamilton--Ivey carrier. |
| 11 | |
| 12 | Reference: Morgan--Tian, Claims 4.30--4.31, pp. 78--79; |
| 13 | Lemma 4.13, pp. 68--69. |
| 14 | -/ |
| 15 | |
| 16 | namespace Poincare.HamiltonIvey |
| 17 | |
| 18 | open Set |
| 19 | open scoped BigOperators |
| 20 | |
| 21 | noncomputable section |
| 22 | |
| 23 | local instance : NormedAddCommGroup ThreeMatrix := Matrix.normedAddCommGroup |
| 24 | local instance : NormedSpace ℝ ThreeMatrix := Matrix.normedSpace |
| 25 | |
| 26 | theorem operatorReaction_diagonal (lam mu nu : ℝ) : |
| 27 | operatorReaction (Poincare.diagonalSpectrum lam mu nu) = |
| 28 | Poincare.diagonalSpectrum |
| 29 | (2 * (lam ^ 2 + mu * nu)) |
| 30 | (2 * (mu ^ 2 + lam * nu)) |
| 31 | (2 * (nu ^ 2 + lam * mu)) := |
| 32 | operatorReaction_diagonal_entries ![lam, mu, nu] |
| 33 | |
| 34 | /-- The normalized symmetric-operator ODE preserves the Hamilton--Ivey |
| 35 | carrier. Continuity at the endpoints and only interior derivatives suffice. -/ |
| 36 | theorem operator_reaction_invariance |
| 37 | {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] |
| 38 | [FiniteDimensional ℝ E] (hn : Module.finrank ℝ E = 3) |
| 39 | {a b : ℝ} (ha : 0 ≤ a) (hab : a ≤ b) |
| 40 | {A : ℝ → E →ₗ[ℝ] E} |
| 41 | (hcont : ∀ v : E, ContinuousOn (fun t => A t v) (Set.Icc a b)) |
| 42 | (hsymm : ∀ t ∈ Set.Icc a b, (A t).IsSymmetric) |
| 43 | (hderiv : ∀ t ∈ Set.Ioo a b, ∀ v : E, |
| 44 | HasDerivAt (fun s => A s v) (endomorphismReaction (A t) v) t) |
| 45 | (hinit : A a ∈ region hn a) : |
| 46 | ∀ t ∈ Set.Icc a b, A t ∈ region hn t := by |
| 47 | let hAa := hsymm a ⟨le_rfl, hab⟩ |
| 48 | let e := hAa.eigenvectorBasis hn |
| 49 | let B : ℝ → ThreeMatrix := fun t => LinearMap.toMatrix e.toBasis e.toBasis (A t) |
| 50 | let d : ℝ → Fin 3 → ℝ := fun t i => B t i i |
| 51 | have hBc : ContinuousOn B (Icc a b) := continuousOn_operatorMatrix e hcont |
| 52 | have hBd : ∀ t ∈ Ioo a b, HasDerivAt B (operatorReaction (B t)) t := by |
| 53 | intro t ht |
| 54 | simpa only [B, toMatrix_endomorphismReaction] using |
| 55 | hasDerivAt_operatorMatrix e (hderiv t ht) |
| 56 | have hBa : B a = Matrix.diagonal (hAa.eigenvalues hn) := by |
| 57 | simpa [B, e] using hAa.toMatrix_eigenvectorBasis hn |
| 58 | have hoff := operator_reaction_stays_diagonal hBc hBd (by |
| 59 | intro i j hij |
| 60 | simp [hBa, hij]) |
| 61 | have hBdiag : ∀ t ∈ Icc a b, B t = Matrix.diagonal (d t) := by |
| 62 | intro t ht |
| 63 | ext i j |
| 64 | by_cases hij : i = j |
| 65 | · subst j |
| 66 | simp [d] |
| 67 | · simp [hij, hoff t ht i j hij] |
| 68 | have hdc (i : Fin 3) : ContinuousOn (fun t => d t i) (Icc a b) := |
| 69 | (continuousOn_pi.mp (continuousOn_pi.mp hBc i) i) |
| 70 | have hdd : ∀ t ∈ Ioo a b, ∀ i, |
| 71 | HasDerivAt (fun s => d s i) |
| 72 | (![2 * (d t 0 ^ 2 + d t 1 * d t 2), |
| 73 | 2 * (d t 1 ^ 2 + d t 0 * d t 2), |
| 74 | 2 * (d t 2 ^ 2 + d t 0 * d t 1)] i) t := by |
| 75 | intro t ht i |
| 76 | have h := hasDerivAt_pi.mp (hasDerivAt_pi.mp (hBd t ht) i) i |
| 77 | rw [hBdiag t (Ioo_subset_Icc_self ht), operatorReaction_diagonal_entries] at h |
| 78 | simpa only [Matrix.diagonal_apply_eq] using h |
| 79 | have hda (i : Fin 3) : d a i = hAa.eigenvalues hn i := by |
| 80 | simp [d, hBa] |
| 81 | have horder : d a 1 ≤ d a 0 ∧ d a 2 ≤ d a 1 := by |
| 82 | simp only [hda] |
| 83 | exact ⟨hAa.eigenvalues_antitone hn (by decide), hAa.eigenvalues_antitone hn (by decide)⟩ |
| 84 | have heigen : ∀ t ∈ Icc a b, ∀ i, A t (e i) = d t i • e i := by |
| 85 | intro t ht i |
| 86 | apply e.toBasis.repr.injective |
| 87 | ext j |
| 88 | have h := congrFun (congrFun (hBdiag t ht) j) i |
| 89 | by_cases hij : i = j |
| 90 | · subst j |
| 91 | simpa [B, LinearMap.toMatrix_apply] using h |
| 92 | · simpa [B, LinearMap.toMatrix_apply, hij, Ne.symm hij] using h |
| 93 | have hscalarInit : (d a 0 + d a 1 + d a 2, max (-d a 2) 0) ∈ scalarRegion a := by |
| 94 | have hi := (mem_region_iff_diagonal hn hAa e (heigen a ⟨le_rfl, hab⟩) |
| 95 | (fun i j hij => by simpa only [hda] using hAa.eigenvalues_antitone hn hij) a).mp hinit |
| 96 | simpa [Fin.sum_univ_succ, add_assoc] using hi |
| 97 | have hpersist := reaction_two_invariance ha hab (hdc 0) (hdc 1) (hdc 2) |
| 98 | (fun t ht => hdd t ht 0) (fun t ht => hdd t ht 1) (fun t ht => hdd t ht 2) |
| 99 | horder hscalarInit |
| 100 | have hordered := reaction_two_order hab (hdc 0) (hdc 1) (hdc 2) |
| 101 | (fun t ht => hdd t ht 0) (fun t ht => hdd t ht 1) (fun t ht => hdd t ht 2) horder |
| 102 | intro t ht |
| 103 | apply (mem_region_iff_diagonal hn (hsymm t ht) e (heigen t ht) ?_ t).mpr |
| 104 | · simpa [Fin.sum_univ_succ, add_assoc] using hpersist t ht |
| 105 | · intro i j hij |
| 106 | have ho := hordered t ht |
| 107 | fin_cases i <;> fin_cases j <;> |
| 108 | first | exact le_rfl | exact ho.1 | exact ho.2 | exact ho.2.trans ho.1 | |
| 109 | norm_num [Fin.le_def] at hij |
| 110 | |
| 111 | end |
| 112 | |
| 113 | end Poincare.HamiltonIvey |