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.Extinction.Width.Deformation.SmoothTimeTheory |
| 2 | import PoincareLib.Geometry.Riemannian.LoopSpace.Area.Filling |
| 3 | import Mathlib.Tactic.Linarith |
| 4 | import Mathlib.Tactic.FieldSimp |
| 5 | import Mathlib.Tactic.Positivity |
| 6 | |
| 7 | /-! |
| 8 | # Width comparison on an ordinary slab |
| 9 | |
| 10 | Morgan--Tian, Proposition 18.24 and Claims 18.21--18.22, pp. 432--434. |
| 11 | The short-loop alternative is controlled by M58's small-area disks. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | open scoped Manifold ContDiff Bundle Topology ENNReal intervalIntegral |
| 16 | universe u |
| 17 | namespace PoincareMT |
| 18 | |
| 19 | variable {M : Type u} [TopologicalSpace M] |
| 20 | [ChartedSpace LoopAmbient M] [IsManifold (𝓡 3) ∞ M] |
| 21 | |
| 22 | private theorem fillingArea_nonnegative (g : RiemannianMetric 3 M) |
| 23 | (c : C1FreeLoopSpace (M := M)) : 0 ≤ fillingArea g c := by |
| 24 | apply Real.sInf_nonneg |
| 25 | rintro a ⟨D, rfl⟩ |
| 26 | exact D.area_nonnegative |
| 27 | |
| 28 | private theorem profile_affine {a b : ℝ} (F : RicciFlow 3 M (Set.Icc a b)) |
| 29 | (w d t : ℝ) : |
| 30 | areaComparisonProfile F (w + d) t = areaComparisonProfile F w t + |
| 31 | Real.exp (-(∫ s in a..t, flowScalarCurvatureInfimum F s / 2)) * d := by |
| 32 | unfold areaComparisonProfile flowScalarCurvatureInfimum |
| 33 | ring |
| 34 | |
| 35 | private theorem profile_mono {a b : ℝ} (F : RicciFlow 3 M (Set.Icc a b)) |
| 36 | {w v : ℝ} (h : w ≤ v) (t : ℝ) : |
| 37 | areaComparisonProfile F w t ≤ areaComparisonProfile F v t := by |
| 38 | unfold areaComparisonProfile |
| 39 | exact mul_le_mul_of_nonneg_left (sub_le_sub_right h _) (Real.exp_pos _).le |
| 40 | |
| 41 | /-- M65 supplies a terminal representative with a controlled family maximum; |
| 42 | nontriviality also prevents the comparison profile from becoming negative. |
| 43 | The parameter `e` controls both the initial near-minimizer and the deformation. |
| 44 | -/ |
| 45 | theorem m66_deformed_comparison |
| 46 | (hM61 : M61RawWidthCore.{u}) |
| 47 | (hM58 : RepairedShortLoopTrivialityTheory.{u}) |
| 48 | {hM64 : M64ComparisonTheory.{u}} |
| 49 | (hM65 : M65DeformationTheory hM61 hM64) |
| 50 | {a b : ℝ} (P : M65RawFlowInput M a b) |
| 51 | (hconnected : IsConnected (Set.univ : Set M)) (basepoint : M) |
| 52 | (hpi : Subsingleton (HomotopyGroup.Pi 2 M basepoint)) |
| 53 | (hnontrivial : ¬ P.family.Homotopic (constantLoopFamily basepoint)) |
| 54 | (e eta : ℝ) (he : 0 < e) (heta : 0 < eta) : |
| 55 | let A := areaComparisonProfile P.flow |
| 56 | (m61FreeClassWidth (P.flow.metric a) P.family) b |
| 57 | let E := Real.exp (-(∫ s in a..b, flowScalarCurvatureInfimum P.flow s / 2)) |
| 58 | 0 ≤ A + (2 * E + 1) * e ∧ |
| 59 | m61FreeClassWidth (P.flow.metric b) P.family ≤ |
| 60 | max eta (A + (2 * E + 1) * e) := by |
| 61 | classical |
| 62 | let : T2Space M := P.hausdorff |
| 63 | let : SecondCountableTopology M := P.second_countable |
| 64 | dsimp only |
| 65 | let A := areaComparisonProfile P.flow |
| 66 | (m61FreeClassWidth (P.flow.metric a) P.family) b |
| 67 | let E := Real.exp (-(∫ s in a..b, flowScalarCurvatureInfimum P.flow s / 2)) |
| 68 | have hE : 0 < E := Real.exp_pos _ |
| 69 | obtain ⟨G, hGn, hGh, hG⟩ := |
| 70 | (hM61.free_class (P.flow.metric a) P.compact P.family P.family_null).near_minimizer e he |
| 71 | obtain ⟨r, hr, hshort⟩ := hM58.short_loop.raw_short_loop_family_trivial |
| 72 | (P.flow.metric b) P.compact hconnected basepoint hpi |
| 73 | obtain ⟨q, hq, _, hsmall⟩ := |
| 74 | hM58.short_loop.small_loop_filling (P.flow.metric b) P.compact eta heta |
| 75 | let z := min e (min r q) |
| 76 | have hz : 0 < z := lt_min he (lt_min hr hq) |
| 77 | have hze : z ≤ e := min_le_left _ _ |
| 78 | have hzr : z ≤ r := (min_le_right _ _).trans (min_le_left _ _) |
| 79 | have hzq : z ≤ q := (min_le_right _ _).trans (min_le_right _ _) |
| 80 | let Q : M65RawFlowInput M a b := { P with family := G, family_null := hGn } |
| 81 | obtain ⟨K⟩ := hM65 M Q |
| 82 | obtain ⟨D⟩ := K.deformation z hz |
| 83 | let ta : Set.Icc a b := ⟨a, le_rfl, P.time_ordered⟩ |
| 84 | let tb : Set.Icc a b := ⟨b, P.time_ordered, le_rfl⟩ |
| 85 | have hhom : P.family.Homotopic (D.family tb) := |
| 86 | hGh.trans (D.free_homotopy_to_initial tb) |
| 87 | have hpoint : ∀ c, areaComparisonProfile P.flow |
| 88 | (fillingArea (P.flow.metric a) (D.family ta c)) b + z ≤ |
| 89 | A + (2 * E + 1) * e := by |
| 90 | intro c |
| 91 | have hinit := (abs_lt.mp (D.initial_area_close c)).2 |
| 92 | have hsup : fillingArea (P.flow.metric a) (G c) ≤ |
| 93 | m61FamilyWidth (P.flow.metric a) G := |
| 94 | le_csSup (hM61.family (P.flow.metric a) P.compact G hGn).bounded_above |
| 95 | (Set.mem_range_self c) |
| 96 | have hc : fillingArea (P.flow.metric a) (D.family ta c) ≤ |
| 97 | m61FreeClassWidth (P.flow.metric a) P.family + (e + z) := by |
| 98 | change fillingArea (P.flow.metric a) (D.family ta c) - |
| 99 | fillingArea (P.flow.metric a) (G c) < z at hinit |
| 100 | linarith |
| 101 | have hp := profile_mono P.flow hc b |
| 102 | rw [profile_affine] at hp |
| 103 | change areaComparisonProfile P.flow |
| 104 | (fillingArea (P.flow.metric a) (D.family ta c)) b ≤ A + E * (e + z) at hp |
| 105 | nlinarith |
| 106 | have hlong : ∃ c, ¬ freeLoopLength (P.flow.metric b) (D.family tb c) < z := by |
| 107 | by_contra! hall |
| 108 | exact hnontrivial (hhom.trans |
| 109 | (hshort (D.family tb) (D.null tb) (fun c => (hall c).trans_le hzr))) |
| 110 | obtain ⟨c, hc⟩ := hlong |
| 111 | have hbound := (D.terminal_alternative c).resolve_left hc |
| 112 | have hnonneg : 0 ≤ A + (2 * E + 1) * e := |
| 113 | (fillingArea_nonnegative (P.flow.metric b) (D.family tb c)).trans |
| 114 | (hbound.trans (hpoint c)) |
| 115 | refine ⟨hnonneg, ?_⟩ |
| 116 | apply (hM61.free_class (P.flow.metric b) P.compact P.family P.family_null).le_member |
| 117 | (D.family tb) (D.null tb) hhom |>.trans |
| 118 | obtain ⟨c, hc⟩ := (hM61.family (P.flow.metric b) P.compact |
| 119 | (D.family tb) (D.null tb)).attained |
| 120 | rw [← hc] |
| 121 | rcases D.terminal_alternative c with hs | hl |
| 122 | · obtain ⟨disk, hdisk⟩ := hsmall (D.family tb c) (hs.trans_le hzq) |
| 123 | exact ((m60FillingArea_le_disk _ _ disk).trans hdisk.le).trans (le_max_left _ _) |
| 124 | · exact (hl.trans (hpoint c)).trans (le_max_right _ _) |
| 125 | |
| 126 | /-- The M61 free width satisfies the exact integrating-factor comparison |
| 127 | between the endpoints of an ordinary slab. -/ |
| 128 | theorem m66_endpoint_comparison |
| 129 | (hM61 : M61RawWidthCore.{u}) |
| 130 | (hM58 : RepairedShortLoopTrivialityTheory.{u}) |
| 131 | {hM64 : M64ComparisonTheory.{u}} |
| 132 | (hM65 : M65DeformationTheory hM61 hM64) |
| 133 | {a b : ℝ} (P : M65RawFlowInput M a b) |
| 134 | (hconnected : IsConnected (Set.univ : Set M)) (basepoint : M) |
| 135 | (hpi : Subsingleton (HomotopyGroup.Pi 2 M basepoint)) |
| 136 | (hnontrivial : ¬ P.family.Homotopic (constantLoopFamily basepoint)) : |
| 137 | m61FreeClassWidth (P.flow.metric b) P.family ≤ |
| 138 | areaComparisonProfile P.flow |
| 139 | (m61FreeClassWidth (P.flow.metric a) P.family) b := by |
| 140 | let A := areaComparisonProfile P.flow |
| 141 | (m61FreeClassWidth (P.flow.metric a) P.family) b |
| 142 | let E := Real.exp (-(∫ s in a..b, flowScalarCurvatureInfimum P.flow s / 2)) |
| 143 | have hE : 0 < 2 * E + 1 := by dsimp [E]; positivity |
| 144 | have hA : 0 ≤ A := by |
| 145 | by_contra! hneg |
| 146 | have h := (m66_deformed_comparison hM61 hM58 hM65 P hconnected basepoint hpi hnontrivial |
| 147 | (-A / (2 * (2 * E + 1))) 1 |
| 148 | (div_pos (neg_pos.mpr hneg) (mul_pos (by norm_num) hE)) zero_lt_one).1 |
| 149 | change 0 ≤ A + (2 * E + 1) * (-A / (2 * (2 * E + 1))) at h |
| 150 | field_simp at h |
| 151 | nlinarith |
| 152 | apply le_of_forall_pos_le_add |
| 153 | intro eps heps |
| 154 | have h := (m66_deformed_comparison hM61 hM58 hM65 P hconnected basepoint hpi hnontrivial |
| 155 | (eps / (2 * E + 1)) eps (div_pos heps hE) heps).2 |
| 156 | change _ ≤ max eps (A + (2 * E + 1) * (eps / (2 * E + 1))) at h |
| 157 | have heq : (2 * E + 1) * (eps / (2 * E + 1)) = eps := |
| 158 | mul_div_cancel₀ _ (ne_of_gt hE) |
| 159 | rw [heq] at h |
| 160 | exact h.trans (max_le (by linarith) le_rfl) |
| 161 | |
| 162 | end PoincareMT |