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.Induction.Noncollapse.LGeometry.Avoidance.PositiveAction |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Induction.Noncollapse.Assembly.Configuration |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Paths.Action.PathPrefix |
| 4 | |
| 5 | /-! |
| 6 | # The minimizing prefix leaves a uniform action margin |
| 7 | |
| 8 | Morgan--Tian Claim 16.27, pp. 391-393. Adding the scalar floor |
| 9 | correction makes the original action density nonnegative. Its exact |
| 10 | square-root integral bounds every prefix by L plus 4 S^(3/2). |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Filter MeasureTheory |
| 16 | open scoped Manifold ContDiff Topology intervalIntegral |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.Proofs.M46 |
| 21 | |
| 22 | variable {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 23 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport 3 X time I} |
| 24 | |
| 25 | /-- The scalar floor gives the exact positive-action budget for any |
| 26 | actual prefix, without imposing a sign on the uncorrected density. -/ |
| 27 | theorem prefix_action_le_scalar_floor_correction {T S tau : ℝ} {x y : G.Point} |
| 28 | (p : M14BackwardPath G T 0 S x y) (htau : 0 < tau) (htauS : tau ≤ S) |
| 29 | (hscalar : ∀ s ∈ Icc 0 S, |
| 30 | -6 ≤ horizontalScalarCurvature G.leafwise (p.curve s)) : |
| 31 | M14BackwardLAction G (M14.prefixPath p tau htau htauS) ≤ |
| 32 | M14BackwardLAction G p + 4 * S * Real.sqrt S := by |
| 33 | let f s := M14BackwardLIntegrand G p s + 6 * Real.sqrt s |
| 34 | have hroot : IntervalIntegrable (fun s : ℝ => 6 * Real.sqrt s) volume 0 S := |
| 35 | (Real.continuous_sqrt.const_mul 6).intervalIntegrable _ _ |
| 36 | have hf : IntervalIntegrable f volume 0 S := p.action_integrable.add hroot |
| 37 | have hsub : uIcc 0 tau ⊆ uIcc 0 S := by |
| 38 | rw [uIcc_of_le htau.le, uIcc_of_le p.tau_lt.le] |
| 39 | exact Icc_subset_Icc_right htauS |
| 40 | have hnonneg (s : ℝ) (hs : s ∈ Icc 0 S) : 0 ≤ f s := by |
| 41 | have hkin : 0 ≤ G.spacetime.horizontalMetric.inner (p.curve s) |
| 42 | (p.horizontal_velocity s) (p.horizontal_velocity s) := |
| 43 | (G.spacetime.horizontalMetric.toRiemannianMetric.toCore |
| 44 | (p.curve s)).re_inner_nonneg (p.horizontal_velocity s) |
| 45 | have hsum : 0 ≤ horizontalScalarCurvature G.leafwise (p.curve s) + |
| 46 | G.spacetime.horizontalMetric.inner (p.curve s) |
| 47 | (p.horizontal_velocity s) (p.horizontal_velocity s) + 6 := by |
| 48 | linarith [hscalar s hs] |
| 49 | have h := mul_nonneg (Real.sqrt_nonneg s) hsum |
| 50 | dsimp only [f, M14BackwardLIntegrand, M14RawLIntegrand] |
| 51 | nlinarith |
| 52 | have hprefix : (∫ s in (0 : ℝ)..tau, M14BackwardLIntegrand G p s) ≤ |
| 53 | ∫ s in (0 : ℝ)..tau, f s := |
| 54 | intervalIntegral.integral_mono_on htau.le (p.action_integrable.mono_set hsub) |
| 55 | (hf.mono_set hsub) (fun s _ => by |
| 56 | dsimp only [f] |
| 57 | exact le_add_of_nonneg_right (mul_nonneg (by norm_num) (Real.sqrt_nonneg s))) |
| 58 | have hwhole := intervalIntegral.integral_mono_interval le_rfl htau.le htauS |
| 59 | ((ae_restrict_iff' measurableSet_Ioc).mpr |
| 60 | (ae_of_all volume (fun s hs => hnonneg s ⟨hs.1.le, hs.2⟩))) hf |
| 61 | have hvalue : (∫ s in (0 : ℝ)..S, f s) = |
| 62 | M14BackwardLAction G p + 4 * S * Real.sqrt S := by |
| 63 | change (∫ s in (0 : ℝ)..S, |
| 64 | M14RawLIntegrand G p.curve p.horizontal_velocity s + 6 * Real.sqrt s) = _ |
| 65 | rw [intervalIntegral.integral_add p.action_integrable hroot, |
| 66 | intervalIntegral.integral_const_mul, integral_sqrt_nonneg_endpoint p.tau_lt.le] |
| 67 | change M14BackwardLAction G p + 6 * ((2 / 3 : ℝ) * S * Real.sqrt S) = _ |
| 68 | ring |
| 69 | exact hprefix.trans (hvalue ▸ hwhole) |
| 70 | |
| 71 | /-- The old-radius seed construction has a whole square-root horizon |
| 72 | of spare action before its short tail is attached. -/ |
| 73 | theorem prefix_action_budget_margin {K : MetricSurgeryConstants} |
| 74 | (prefixData : SurgeryParameterPrefix K) {T S tau : ℝ} {x y : G.Point} |
| 75 | (path : M14BackwardPath G T 0 S x y) (htau : 0 < tau) (htauS : tau ≤ S) |
| 76 | (hS : S ≤ surgeryEpochStart (prefixData.i + 1)) |
| 77 | (hscalar : ∀ s ∈ Icc 0 S, |
| 78 | -6 ≤ horizontalScalarCurvature G.leafwise (path.curve s)) |
| 79 | (hshort : M14BackwardLAction G path ≤ 3 * Real.sqrt S) : |
| 80 | M14BackwardLAction G (M14.prefixPath path tau htau htauS) ≤ |
| 81 | actionBudget prefixData / 2 - Real.sqrt (surgeryEpochStart (prefixData.i + 1)) := by |
| 82 | have hroot := Real.sqrt_le_sqrt hS |
| 83 | have hprod := mul_le_mul hS hroot (Real.sqrt_nonneg S) |
| 84 | (path.tau_lt.le.trans hS) |
| 85 | have hbound := prefix_action_le_scalar_floor_correction path htau htauS hscalar |
| 86 | unfold actionBudget |
| 87 | nlinarith |
| 88 | |
| 89 | end PoincareMT.Proofs.M46 |