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.Harnack.Noncompact.Barriers |
| 2 | import PoincareLib.Geometry.RicciFlow.Harnack.Matrix.Positivity.Perturbation |
| 3 | import PoincareLib.Geometry.RicciFlow.Harnack.Matrix.Bounds.Quadratic |
| 4 | |
| 5 | /-! |
| 6 | # Compact localization of the perturbed Hamilton quadratic |
| 7 | |
| 8 | The explicit exhaustion perturbations dominate a uniform mixed quadratic |
| 9 | lower bound outside one compact spatial sublevel, and near the initial |
| 10 | time. The tensor lower bound and properness of the geometric exhaustion |
| 11 | remain inputs to this scalar localization step. |
| 12 | |
| 13 | Source: Chow et al., Part II, Section 15.4.5, printed p. 287 (PDF p. 314). |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | open Set |
| 19 | open scoped Manifold ContDiff Bundle |
| 20 | open scoped BigOperators |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT.RicciFlow |
| 25 | |
| 26 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 27 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 28 | {J : Set ℝ} {F : RicciFlow n M J} {O : M} |
| 29 | |
| 30 | /-- A single compact sublevel confines all nonpositive values of quadratics |
| 31 | with a common mixed lower bound, for the explicit exponential perturbations. -/ |
| 32 | lemma SmoothExhaustion.exists_compact_quadratic_perturbation_pos_on |
| 33 | (S : SmoothExhaustion F O) (V : Set M) |
| 34 | (hproper : ∀ r : ℝ, IsCompact {x | S.toFun x ≤ r ∧ x ∈ V}) |
| 35 | {C ε δ A T : ℝ} (hC : 0 ≤ C) (hε : 0 < ε) (hδ : 0 < δ) (hA : 0 ≤ A) : |
| 36 | ∃ K : Set M, IsCompact K ∧ K ⊆ V ∧ ∀ t ∈ Ioc 0 T, ∀ x ∈ V, x ∉ K → |
| 37 | ∀ q u w : ℝ, -C * w ^ 2 - C * u * w ≤ q → u ≠ 0 ∨ w ≠ 0 → |
| 38 | 0 < q + (ε * Real.exp (A * t) * S.toFun x / t) * w ^ 2 + |
| 39 | (δ * Real.exp (A * t)) * u ^ 2 := by |
| 40 | let B := C + C ^ 2 / (2 * δ) + 1 |
| 41 | have hB : 0 < B := by dsimp [B]; positivity |
| 42 | refine ⟨{x | S.toFun x ≤ T * B / ε ∧ x ∈ V}, hproper _, fun _ hx => hx.2, ?_⟩ |
| 43 | intro t ht x hxV hx q u w hlower hnonzero |
| 44 | have hx' : T * B < S.toFun x * ε := |
| 45 | (div_lt_iff₀ hε).mp (lt_of_not_ge (fun h => hx ⟨h, hxV⟩)) |
| 46 | have he : 1 ≤ Real.exp (A * t) := Real.one_le_exp (mul_nonneg hA ht.1.le) |
| 47 | have hscale : S.toFun x * ε ≤ ε * Real.exp (A * t) * S.toFun x := by |
| 48 | have hh : 0 ≤ S.toFun x := (le_of_lt zero_lt_one).trans (S.one_le x) |
| 49 | nlinarith [mul_le_mul_of_nonneg_right |
| 50 | (mul_le_mul_of_nonneg_left he hε.le) hh] |
| 51 | have hα : B < ε * Real.exp (A * t) * S.toFun x / t := |
| 52 | (lt_div_iff₀ ht.1).mpr |
| 53 | ((by nlinarith only [mul_le_mul_of_nonneg_right ht.2 hB.le] : B * t ≤ T * B) |
| 54 | |>.trans_lt (hx'.trans_le hscale)) |
| 55 | have hp := Poincare.RicciFlow.Harnack.quadratic_perturbation_pos hδ |
| 56 | (show C + C ^ 2 / (2 * δ) < ε * Real.exp (A * t) * S.toFun x / t by |
| 57 | dsimp [B] at hα |
| 58 | linarith only [hα]) hlower hnonzero |
| 59 | have hψ : δ ≤ δ * Real.exp (A * t) := by nlinarith only [he, hδ] |
| 60 | have hψu := mul_le_mul_of_nonneg_right hψ (sq_nonneg u) |
| 61 | linarith only [hp, hψu] |
| 62 | |
| 63 | /-- Global properness is the special case of compact localization on the |
| 64 | whole spatial manifold. -/ |
| 65 | lemma SmoothExhaustion.exists_compact_quadratic_perturbation_pos |
| 66 | (S : SmoothExhaustion F O) |
| 67 | (hproper : ∀ r : ℝ, IsCompact {x | S.toFun x ≤ r}) |
| 68 | {C ε δ A T : ℝ} (hC : 0 ≤ C) (hε : 0 < ε) (hδ : 0 < δ) (hA : 0 ≤ A) : |
| 69 | ∃ K : Set M, IsCompact K ∧ ∀ t ∈ Ioc 0 T, ∀ x ∉ K, |
| 70 | ∀ q u w : ℝ, -C * w ^ 2 - C * u * w ≤ q → u ≠ 0 ∨ w ≠ 0 → |
| 71 | 0 < q + (ε * Real.exp (A * t) * S.toFun x / t) * w ^ 2 + |
| 72 | (δ * Real.exp (A * t)) * u ^ 2 := by |
| 73 | obtain ⟨K, hK, _, hpos⟩ := S.exists_compact_quadratic_perturbation_pos_on univ |
| 74 | (fun r => by simpa only [mem_univ, and_true] using hproper r) hC hε hδ hA (T := T) |
| 75 | exact ⟨K, hK, fun t ht x hx => hpos t ht x (mem_univ x) hx⟩ |
| 76 | |
| 77 | /-- The same scalar perturbations are initially positive uniformly in space; |
| 78 | the time is chosen before the point and the two test directions. -/ |
| 79 | lemma SmoothExhaustion.exists_initial_time_quadratic_perturbation_pos |
| 80 | (S : SmoothExhaustion F O) |
| 81 | {C ε δ A : ℝ} (hC : 0 ≤ C) (hε : 0 < ε) (hδ : 0 < δ) (hA : 0 ≤ A) : |
| 82 | ∃ t₀ : ℝ, 0 < t₀ ∧ ∀ t ∈ Ioc 0 t₀, ∀ x, |
| 83 | ∀ q u w : ℝ, -C * w ^ 2 - C * u * w ≤ q → u ≠ 0 ∨ w ≠ 0 → |
| 84 | 0 < q + (ε * Real.exp (A * t) * S.toFun x / t) * w ^ 2 + |
| 85 | (δ * Real.exp (A * t)) * u ^ 2 := by |
| 86 | obtain ⟨t₀, ht₀, hpos⟩ := |
| 87 | Poincare.RicciFlow.Harnack.exists_initial_time_quadratic_perturbation_pos hC hε hδ |
| 88 | refine ⟨t₀, ht₀, ?_⟩ |
| 89 | intro t ht x q u w hlower hnonzero |
| 90 | apply hpos t ht q u w _ _ hlower hnonzero |
| 91 | · exact div_le_div_of_nonneg_right (S.le_exp_mul hε.le hA ht.1.le x) ht.1.le |
| 92 | · have he := Real.one_le_exp (mul_nonneg hA ht.1.le) |
| 93 | nlinarith only [he, hδ] |
| 94 | |
| 95 | end PoincareMT.RicciFlow |
| 96 | |
| 97 | namespace Poincare.RicciFlow.Harnack |
| 98 | |
| 99 | open PoincareMT |
| 100 | |
| 101 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 102 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 103 | {J : Set ℝ} {F : RicciFlow n M J} {O : M} |
| 104 | |
| 105 | /-- Curvature derivative bounds supply the lower-bound input to compact |
| 106 | localization of the actual Hamilton quadratic. -/ |
| 107 | theorem exists_compact_hamilton_perturbation_pos |
| 108 | (hC : RicciFlowCurvatureTheory.{u}) (S : RicciFlow.SmoothExhaustion F O) |
| 109 | (hproper : ∀ r : ℝ, IsCompact {x | S.toFun x ≤ r}) |
| 110 | {K ε δ A T : ℝ} (hK : 0 ≤ K) |
| 111 | (hbound : ∀ t ∈ Ioc 0 T, ∀ x, ∀ j ≤ 2, |
| 112 | (F.connection t).curvatureDerivativeNorm j x ≤ K) |
| 113 | (hcurv : ∀ t ∈ Ioc 0 T, ∀ x, (F.connection t).NonnegativeCurvatureOperator x) |
| 114 | (hε : 0 < ε) (hδ : 0 < δ) (hA : 0 ≤ A) : |
| 115 | ∃ L : Set M, IsCompact L ∧ ∀ t ∈ Ioc 0 T, ∀ x ∉ L, |
| 116 | ∀ (U : Fin (Module.finrank ℝ (TangentSpace (𝓡 n) x)) → |
| 117 | Fin (Module.finrank ℝ (TangentSpace (𝓡 n) x)) → ℝ) |
| 118 | (W : Fin (Module.finrank ℝ (TangentSpace (𝓡 n) x)) → ℝ), |
| 119 | (∀ i j, U i j = -U j i) → |
| 120 | (Real.sqrt (∑ i, ∑ j, (U i j) ^ 2) ≠ 0 ∨ |
| 121 | Real.sqrt (∑ i, (W i) ^ 2) ≠ 0) → |
| 122 | let b := (F.metric t).orthonormalBasis x |
| 123 | 0 < (∑ i, ∑ j, hamiltonM (F.connection t) t x (b i) (b j) * W i * W j) + |
| 124 | 2 * (∑ i, ∑ j, ∑ k, hamiltonP (F.connection t) x (b i) (b j) (b k) * |
| 125 | U i j * W k) + |
| 126 | (∑ i, ∑ j, ∑ k, ∑ l, (F.connection t).curvatureTensor x |
| 127 | (b i) (b j) (b k) (b l) * U i j * U k l) + |
| 128 | (ε * Real.exp (A * t) * S.toFun x / t) * (∑ i, (W i) ^ 2) + |
| 129 | (δ * Real.exp (A * t)) * (∑ i, ∑ j, (U i j) ^ 2) := by |
| 130 | let C := 6 * (n : ℝ) ^ 4 * K + 3 * (n : ℝ) ^ 5 * K ^ 2 |
| 131 | have hCnonneg : 0 ≤ C := by dsimp [C]; positivity |
| 132 | obtain ⟨L, hL, hpos⟩ := S.exists_compact_quadratic_perturbation_pos |
| 133 | hproper hCnonneg hε hδ hA (T := T) |
| 134 | refine ⟨L, hL, ?_⟩ |
| 135 | intro t ht x hx U W hU hn |
| 136 | have hlower := hamilton_quadratic_lower_bound_of_bound (F.connection t) |
| 137 | (hC.tensor_calculus n M (F.metric t) (F.connection t)) ht.1.le x |
| 138 | (hcurv t ht x) (hbound t ht x) U W hU |
| 139 | have h := hpos t ht x hx _ _ _ hlower hn |
| 140 | simpa only [Real.sq_sqrt (Finset.sum_nonneg (fun i _ => sq_nonneg (W i))), |
| 141 | Real.sq_sqrt (Finset.sum_nonneg (fun i _ => |
| 142 | Finset.sum_nonneg (fun j _ => sq_nonneg (U i j))))] using h |
| 143 | |
| 144 | end Poincare.RicciFlow.Harnack |