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.Surgery.CanonicalInduction.Component.ComponentEstimatePersistence |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Component.ComponentEstimateScalarPatch |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Existence.InitialEstimates.Regularity |
| 4 | import Mathlib.Topology.Order.Compact |
| 5 | |
| 6 | /-! |
| 7 | # Excluding a last scalar maximum crossing |
| 8 | |
| 9 | The actual initial maximum gives a positive scalar patch. Local persistence |
| 10 | contradicts the strict terminal upper bound. A separate compactness argument |
| 11 | selects the last level crossing of a continuous maximum function. |
| 12 | Source: the induction argument on pp. 402-405. |
| 13 | See `proof-work/tasks/M47/derivations/component-estimate.md`, Stage D5. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set |
| 20 | open scoped Manifold ContDiff Topology |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT.M47 |
| 25 | |
| 26 | /-- The last crossing lies strictly before the terminal time and bounds |
| 27 | the entire intervening interval; the stopping step on pp. 402-405. -/ |
| 28 | theorem exists_last_component_scalar_crossing |
| 29 | {f : ℝ → ℝ} {s t H : ℝ} (hst : s ≤ t) |
| 30 | (hf : ContinuousOn f (Icc s t)) (hs : H ≤ f s) (ht : f t < H) : |
| 31 | ∃ c ∈ Ico s t, f c = H ∧ (∀ u ∈ Icc c t, f u ≤ H) ∧ |
| 32 | ∀ u ∈ Ioc c t, f u < H := by |
| 33 | have hclosed : IsClosed (Icc s t ∩ f ⁻¹' Ici H) := |
| 34 | hf.preimage_isClosed_of_isClosed isClosed_Icc isClosed_Ici |
| 35 | obtain ⟨c, hc, hmax⟩ := |
| 36 | (isCompact_Icc.of_isClosed_subset hclosed inter_subset_left).exists_isGreatest |
| 37 | ⟨s, ⟨⟨le_rfl, hst⟩, hs⟩⟩ |
| 38 | have hct : c < t := by |
| 39 | apply lt_of_le_of_ne hc.1.2 |
| 40 | intro heq |
| 41 | have h := hc.2 |
| 42 | rw [heq] at h |
| 43 | exact not_le_of_gt ht h |
| 44 | have hvalue : f c = H := by |
| 45 | obtain ⟨v, hv, hfv⟩ := intermediate_value_Icc' hct.le |
| 46 | (hf.mono (Icc_subset_Icc hc.1.1 le_rfl)) ⟨ht.le, hc.2⟩ |
| 47 | have hvc : v ≤ c := hmax ⟨⟨hc.1.1.trans hv.1, hv.2⟩, hfv.ge⟩ |
| 48 | simpa only [le_antisymm hvc hv.1] using hfv |
| 49 | have hstrict : ∀ u ∈ Ioc c t, f u < H := by |
| 50 | intro u hu |
| 51 | apply lt_of_not_ge |
| 52 | intro hHu |
| 53 | exact not_le_of_gt hu.1 (hmax ⟨⟨hc.1.1.trans hu.1.le, hu.2⟩, hHu⟩) |
| 54 | refine ⟨c, ⟨hc.1.1, hct⟩, hvalue, ?_, hstrict⟩ |
| 55 | intro u hu |
| 56 | rcases lt_or_eq_of_le hu.1 with hcu | rfl |
| 57 | · exact (hstrict u ⟨hcu, hu.2⟩).le |
| 58 | · exact hvalue.le |
| 59 | |
| 60 | /-- Stopped full-curvature, scalar and gradient bounds rule out an |
| 61 | initial H maximum when the actual terminal scalar is below H/4. |
| 62 | The duration is fixed before the manifold and flow; pp. 402-405. -/ |
| 63 | theorem exists_component_maximum_exclusion_duration |
| 64 | (P : M47ScalarPersistencePredecessors.{u}) |
| 65 | (rescale : GeneralizedParabolicRescalingTheory.{u} 3) |
| 66 | (K B : ℝ) (hK : 0 < K) (hB : 0 < B) : |
| 67 | ∃ tau : ℝ, 0 < tau ∧ tau ≤ 1 ∧ |
| 68 | ∀ (M : Type u) [TopologicalSpace M] |
| 69 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 70 | [T2Space M] [SecondCountableTopology M] [CompactSpace M], |
| 71 | ∀ (s t H : ℝ), s < t → 0 < H → |
| 72 | ∀ F : RicciFlow 3 M (Icc s t), |
| 73 | (∀ u ∈ Icc s t, ∀ x : M, (F.connection u).curvatureTensorNorm x ≤ K * H) → |
| 74 | (∀ u ∈ Icc s t, ∀ x : M, -H ≤ (F.connection u).scalarCurvature x) → |
| 75 | (∀ x : M, (F.connection s).scalarCurvature x ≤ H) → |
| 76 | (∀ x : M, 3 * H / 4 ≤ (F.connection s).scalarCurvature x → |
| 77 | ∀ v : TangentSpace (𝓡 3) x, (F.metric s).inner x v v = 1 → |
| 78 | |mvfderiv (𝓡 3) (F.connection s).scalarCurvature x v| ≤ |
| 79 | B * (F.connection s).scalarCurvature x ^ (3 / 2 : ℝ)) → |
| 80 | H * (t - s) ≤ tau → |
| 81 | (∀ x : M, (F.connection t).scalarCurvature x < H / 4) → |
| 82 | ∀ p : M, (F.connection s).scalarCurvature p ≠ H := by |
| 83 | have ha : 0 < 1 / (8 * B) := by positivity |
| 84 | obtain ⟨tau, htau, htau1, hpersist⟩ := |
| 85 | exists_physical_scalar_persistence P rescale K (1 / (8 * B)) hK ha |
| 86 | refine ⟨tau, htau, htau1, ?_⟩ |
| 87 | intro M _ _ _ _ _ _ s t H hst hH F hcurvature hfloor hupper hgrad hshort hterminal p hp |
| 88 | have hpatch := component_maximum_scalar_patch (F.metric s) (F.connection s) |
| 89 | (M34.contMDiff_scalarCurvature (F.connection s)) hB hH p hp |
| 90 | (fun x _hx => hupper x) (fun x _hx => hgrad x) |
| 91 | have hradius : (Real.sqrt H)⁻¹ / (8 * B) = (1 / (8 * B)) / Real.sqrt H := by |
| 92 | simp only [div_eq_mul_inv, one_mul] |
| 93 | ring |
| 94 | rw [hradius] at hpatch |
| 95 | have hfinal := hpersist M s t H hst hH F p isClosed_closure.isCompact |
| 96 | (fun u hu x _hx => hcurvature u hu x) (fun u hu x _hx => hfloor u hu x) |
| 97 | hpatch hshort |
| 98 | exact not_le_of_gt (hterminal p) hfinal |
| 99 | |
| 100 | end PoincareMT.M47 |