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.ActualPositiveAction |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.SmallTime.Confinement.SmallTimeEnergy |
| 3 | |
| 4 | /-! |
| 5 | # Positive action controls the full square-time kinetic energy |
| 6 | |
| 7 | Lemma 16.15, pp. 379-381. Squaring the parameter cancels the singular |
| 8 | weight without assuming an endpoint derivative or a minimizing path. |
| 9 | The positive scalar term then bounds every initial square-time kinetic |
| 10 | integral by twice the actual positive action. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set MeasureTheory |
| 17 | open scoped Manifold ContDiff Bundle intervalIntegral |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.Proofs.M46 |
| 22 | |
| 23 | variable {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 24 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport 3 X time I} |
| 25 | {T tau : ℝ} {x y : G.Point} |
| 26 | |
| 27 | /-- The actual supplied horizontal square velocity has nonnegative |
| 28 | kinetic energy at every parameter. Source: equation (6.2), p. 106. -/ |
| 29 | theorem pathInitialSquareKinetic_nonneg (p : M14BackwardPath G T 0 tau x y) (s : ℝ) : |
| 30 | 0 ≤ M14.pathSquareKinetic p s := by |
| 31 | dsimp only [M14.pathSquareKinetic] |
| 32 | by_cases hv : (2 * s) • p.horizontal_velocity (s ^ 2) = 0 |
| 33 | · simp only [hv, map_zero, le_refl] |
| 34 | · exact (G.spacetime.horizontalMetric.pos _ _ hv).le |
| 35 | |
| 36 | /-- Positive action controls the entire square-time kinetic energy |
| 37 | of every admissible path. Source: equations (6.1)-(6.2) and Lemma 16.15, |
| 38 | pp. 106 and 379-381. -/ |
| 39 | theorem pathSquareKinetic_integral_le_positiveAction |
| 40 | (hM12 : GeneralizedRicciGaugeTheory.{u} 3) |
| 41 | (p : M14BackwardPath G T 0 tau x y) : |
| 42 | (∫ s in 0..Real.sqrt tau, M14.pathSquareKinetic p s) ≤ |
| 43 | 2 * ∫ t in 0..tau, Real.sqrt t * pathPositiveDensity p t := by |
| 44 | let density := fun t => Real.sqrt t * pathPositiveDensity p t |
| 45 | have hsqrt : 0 ≤ Real.sqrt tau := Real.sqrt_nonneg tau |
| 46 | have hderiv : ∀ s ∈ uIoo 0 (Real.sqrt tau), 0 ≤ 2 * s := by |
| 47 | intro s hs |
| 48 | rw [uIoo_of_le hsqrt] at hs |
| 49 | exact mul_nonneg (by norm_num) hs.1.le |
| 50 | have htrans : IntervalIntegrable (fun s => density (s ^ 2) * (2 * s)) |
| 51 | volume 0 (Real.sqrt tau) := by |
| 52 | apply (intervalIntegral.integrable_comp_mul_deriv_iff_of_deriv_nonneg |
| 53 | (f := fun s : ℝ => s ^ 2) (f' := fun s => 2 * s) (g := density) |
| 54 | (continuous_id.pow 2).continuousOn |
| 55 | (fun s _ => by simpa using hasDerivAt_pow 2 s) hderiv).mpr |
| 56 | simpa only [zero_pow (by decide : (2 : ℕ) ≠ 0), Real.sq_sqrt p.tau_lt.le, density] using |
| 57 | pathPositiveAction_integrable hM12 p |
| 58 | have hchange := intervalIntegral.integral_comp_mul_deriv_of_deriv_nonneg |
| 59 | (a := (0 : ℝ)) (b := Real.sqrt tau) |
| 60 | (f := fun s : ℝ => s ^ 2) (f' := fun s => 2 * s) (g := density) |
| 61 | (continuous_id.pow 2).continuousOn |
| 62 | (fun s _ => by simpa using hasDerivAt_pow 2 s) hderiv |
| 63 | simp only [zero_pow (by decide : (2 : ℕ) ≠ 0), Real.sq_sqrt p.tau_lt.le, |
| 64 | Function.comp_def] at hchange |
| 65 | have hk : IntervalIntegrable (M14.pathSquareKinetic p) volume 0 (Real.sqrt tau) := by |
| 66 | change IntervalIntegrable (fun s => G.spacetime.horizontalMetric.inner (p.curve (s ^ 2)) |
| 67 | ((2 * s) • p.horizontal_velocity (s ^ 2)) ((2 * s) • p.horizontal_velocity (s ^ 2))) |
| 68 | volume 0 (Real.sqrt tau) |
| 69 | simpa only [Real.sqrt_zero] using M14.squarePath_kinetic_intervalIntegrable p hM12 |
| 70 | have hpoint : ∀ s ∈ Icc 0 (Real.sqrt tau), |
| 71 | (1 / 2 : ℝ) * M14.pathSquareKinetic p s ≤ density (s ^ 2) * (2 * s) := by |
| 72 | intro s hs |
| 73 | dsimp only [density, pathPositiveDensity, M14.pathSquareKinetic] |
| 74 | simp only [Real.sqrt_sq hs.1, map_smul, smul_apply, smul_eq_mul] |
| 75 | nlinarith [mul_nonneg (sq_nonneg s) |
| 76 | (le_max_right (horizontalScalarCurvature G.leafwise (p.curve (s ^ 2))) 0)] |
| 77 | have hbound := intervalIntegral.integral_mono_on hsqrt (hk.const_mul (1 / 2)) htrans hpoint |
| 78 | rw [intervalIntegral.integral_const_mul, hchange] at hbound |
| 79 | dsimp only [density] at hbound |
| 80 | linarith |
| 81 | |
| 82 | /-- Every initial square-time prefix obeys the same positive-action |
| 83 | bound. Source: Lemma 16.15, pp. 379-381. -/ |
| 84 | theorem pathSquareKinetic_prefix_le_positiveAction |
| 85 | (hM12 : GeneralizedRicciGaugeTheory.{u} 3) |
| 86 | (p : M14BackwardPath G T 0 tau x y) {b : ℝ} |
| 87 | (hb : 0 ≤ b) (hbtau : b ≤ Real.sqrt tau) : |
| 88 | (∫ s in 0..b, M14.pathSquareKinetic p s) ≤ |
| 89 | 2 * ∫ t in 0..tau, Real.sqrt t * pathPositiveDensity p t := by |
| 90 | have hk : IntervalIntegrable (M14.pathSquareKinetic p) volume 0 (Real.sqrt tau) := by |
| 91 | change IntervalIntegrable (fun s => G.spacetime.horizontalMetric.inner (p.curve (s ^ 2)) |
| 92 | ((2 * s) • p.horizontal_velocity (s ^ 2)) ((2 * s) • p.horizontal_velocity (s ^ 2))) |
| 93 | volume 0 (Real.sqrt tau) |
| 94 | simpa only [Real.sqrt_zero] using M14.squarePath_kinetic_intervalIntegrable p hM12 |
| 95 | exact (intervalIntegral.integral_mono_interval le_rfl hb hbtau |
| 96 | (Filter.Eventually.of_forall (pathInitialSquareKinetic_nonneg p)) hk).trans |
| 97 | (pathSquareKinetic_integral_le_positiveAction hM12 p) |
| 98 | |
| 99 | end PoincareMT.Proofs.M46 |