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.Curvature.Estimates.ScalarTrace |
| 2 | import PoincareLib.Topology.Manifold.Poincare.Final.Compatibility.SourceNames |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.Induction.ScalarPersistence |
| 4 | import PoincareLib.Analysis.Parabolic.Maximum.CompactSlab |
| 5 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Existence.InitialEstimates.Regularity |
| 6 | |
| 7 | local notation:max D ".laplacian_nonneg_of_isLocalMin" => |
| 8 | PoincareMT.LeviCivitaData.laplacian_nonneg_of_isLocalMinAt D |
| 9 | /-! |
| 10 | # Scalar minimum on a compact ordinary component |
| 11 | |
| 12 | The actual scalar evolution preserves any initial lower floor on a compact |
| 13 | open component. Its attained initial minimum is at most every later scalar |
| 14 | value. Source: equation (3.7), p. 41, and the compact maximum principle used |
| 15 | in the induction on pp. 402-405. |
| 16 | See `proof-work/tasks/M47/derivations/component-estimate.md`, Stage D3. |
| 17 | -/ |
| 18 | |
| 19 | set_option autoImplicit false |
| 20 | |
| 21 | open Set Filter |
| 22 | open scoped Manifold ContDiff Bundle Topology |
| 23 | |
| 24 | universe u |
| 25 | |
| 26 | namespace PoincareMT.M47 |
| 27 | |
| 28 | variable {M : Type u} [TopologicalSpace M] |
| 29 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 30 | |
| 31 | /-- Scalar lower floors persist on an actual compact open set through the |
| 32 | included terminal endpoint; equation (3.7), p. 41, used on pp. 402-405. -/ |
| 33 | theorem component_scalar_floor_preserved |
| 34 | (P : M47ScalarPersistencePredecessors.{u}) |
| 35 | {J : Set ℝ} (F : RicciFlow 3 M J) {U : Set M} |
| 36 | (hcompact : IsCompact U) (hopen : IsOpen U) |
| 37 | {a b m : ℝ} (hab : a ≤ b) (hJ : Icc a b ⊆ J) |
| 38 | (hinit : ∀ x ∈ U, m ≤ (F.connection a).scalarCurvature x) : |
| 39 | ∀ t ∈ Icc a b, ∀ x ∈ U, m ≤ (F.connection t).scalarCurvature x := by |
| 40 | rcases lt_or_eq_of_le hab with hab | rfl |
| 41 | · let f : ℝ → M → ℝ := fun t x => (F.connection t).scalarCurvature x - m |
| 42 | let v : ℝ → M → ℝ := fun t x => |
| 43 | (F.connection t).laplacian (F.connection t).scalarCurvature x + |
| 44 | 2 * (F.connection t).ricciNormSq x |
| 45 | have hf : ContinuousOn (Function.uncurry f) (Icc a b ×ˢ U) := |
| 46 | ((P.scalar_regular M J F).continuousOn.mono |
| 47 | (prod_mono hJ (subset_univ U))).sub continuousOn_const |
| 48 | have hderiv : ∀ t ∈ Icc a b, ∀ x ∈ U, |
| 49 | HasDerivWithinAt (fun s => f s x) (v t x) (Icc a b) t := by |
| 50 | intro t ht x _hx |
| 51 | exact ((P.scalar_evolution M J F t (hJ ht) x).mono hJ).sub_const m |
| 52 | have hmin : ∀ t ∈ Ioc a b, ∀ x ∈ U, |
| 53 | (∀ y ∈ U, f t x ≤ f t y) → f t x < 0 → -0 * f t x ≤ v t x := by |
| 54 | intro t _ht x hx hmin _hneg |
| 55 | have hlocal : IsLocalMin (F.connection t).scalarCurvature x := by |
| 56 | filter_upwards [hopen.mem_nhds hx] with y hy |
| 57 | exact (sub_le_sub_iff_right m).mp (hmin y hy) |
| 58 | have hlap := (F.connection t).laplacian_nonneg_of_isLocalMin |
| 59 | (M34.contMDiff_scalarCurvature (F.connection t) x) hlocal |
| 60 | have hRic : 0 ≤ (F.connection t).ricciNormSq x := |
| 61 | Finset.sum_nonneg fun _ _ => Finset.sum_nonneg fun _ _ => sq_nonneg _ |
| 62 | simp only [neg_zero, zero_mul] |
| 63 | exact add_nonneg hlap (mul_nonneg (by norm_num) hRic) |
| 64 | have h := M04.compact_subset_min_velocity_nonnegative_Icc hcompact (K := 0) |
| 65 | hab f v hf hderiv hmin (fun x hx => sub_nonneg.mpr (hinit x hx)) |
| 66 | intro t ht x hx |
| 67 | exact sub_nonneg.mp (h t ht x hx) |
| 68 | · intro t ht x hx |
| 69 | have heq : t = a := le_antisymm ht.2 ht.1 |
| 70 | subst t |
| 71 | exact hinit x hx |
| 72 | |
| 73 | /-- An actual terminal scalar value bounds the attained earlier minimum |
| 74 | on the same compact ordinary component; pp. 402-405. -/ |
| 75 | theorem exists_earlier_component_scalar_le |
| 76 | (P : M47ScalarPersistencePredecessors.{u}) |
| 77 | {J : Set ℝ} (F : RicciFlow 3 M J) {U : Set M} |
| 78 | (hcompact : IsCompact U) (hopen : IsOpen U) |
| 79 | {a b : ℝ} (hab : a ≤ b) (hJ : Icc a b ⊆ J) {x : M} (hx : x ∈ U) : |
| 80 | ∃ q ∈ U, (F.connection a).scalarCurvature q ≤ |
| 81 | (F.connection b).scalarCurvature x := by |
| 82 | obtain ⟨q, hq, hmin⟩ := hcompact.exists_isMinOn ⟨x, hx⟩ |
| 83 | (M34.contMDiff_scalarCurvature (F.connection a)).continuous.continuousOn |
| 84 | exact ⟨q, hq, component_scalar_floor_preserved P F hcompact hopen hab hJ |
| 85 | hmin b ⟨hab, le_rfl⟩ x hx⟩ |
| 86 | |
| 87 | end PoincareMT.M47 |