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.Generalized.ReducedGeometry.Basic |
| 2 | import Mathlib.Analysis.SpecialFunctions.Integrals.Basic |
| 3 | |
| 4 | /-! |
| 5 | # Positive scalar action and the cap-entry comparison |
| 6 | |
| 7 | Morgan--Tian Lemma 16.15, equations (16.2)-(16.3), pp. 381-382, and |
| 8 | Proposition 16.21, pp. 384-385. The positive scalar part makes the weighted |
| 9 | density nonnegative. A scalar lower bound controls its difference from the |
| 10 | actual L-action. All finite integral hypotheses are kept explicit. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set MeasureTheory |
| 16 | open scoped intervalIntegral |
| 17 | |
| 18 | namespace PoincareMT.Proofs.M46 |
| 19 | |
| 20 | /-- The elementary square-root integral used to pass from the scalar |
| 21 | floor to the positive-action budget; Proposition 16.21, p. 384. -/ |
| 22 | theorem integral_sqrt_nonneg_endpoint {tau : ℝ} (htau : 0 ≤ tau) : |
| 23 | (∫ s in (0 : ℝ)..tau, Real.sqrt s) = (2 / 3 : ℝ) * tau * Real.sqrt tau := by |
| 24 | obtain rfl | htau := htau.eq_or_lt |
| 25 | · simp |
| 26 | simp_rw [Real.sqrt_eq_rpow] |
| 27 | rw [integral_rpow (Or.inl (by norm_num)), Real.rpow_add htau] |
| 28 | norm_num |
| 29 | ring |
| 30 | |
| 31 | /-- The scalar floor bounds the difference between positive action and |
| 32 | actual action; at K=6 this is the added `4*tau^(3/2)` budget in |
| 33 | Proposition 16.21, p. 384. -/ |
| 34 | theorem positiveAction_le_action_add {R kinetic : ℝ → ℝ} {tau K : ℝ} |
| 35 | (htau : 0 ≤ tau) (hK : 0 ≤ K) |
| 36 | (hscalar : ∀ s ∈ Ioo 0 tau, -K ≤ R s) |
| 37 | (hactual : IntervalIntegrable |
| 38 | (fun s => Real.sqrt s * (R s + kinetic s)) volume 0 tau) |
| 39 | (hpositive : IntervalIntegrable |
| 40 | (fun s => Real.sqrt s * (max (R s) 0 + kinetic s)) volume 0 tau) : |
| 41 | (∫ s in (0 : ℝ)..tau, Real.sqrt s * (max (R s) 0 + kinetic s)) ≤ |
| 42 | (∫ s in (0 : ℝ)..tau, Real.sqrt s * (R s + kinetic s)) + |
| 43 | (2 / 3 : ℝ) * K * tau * Real.sqrt tau := by |
| 44 | have hcorrection : IntervalIntegrable (fun s : ℝ => K * Real.sqrt s) |
| 45 | volume 0 tau := (Real.continuous_sqrt.const_mul K).intervalIntegrable 0 tau |
| 46 | have hbound := intervalIntegral.integral_mono_on_of_le_Ioo htau |
| 47 | hpositive (hactual.add hcorrection) (fun s hs => show |
| 48 | Real.sqrt s * (max (R s) 0 + kinetic s) ≤ |
| 49 | Real.sqrt s * (R s + kinetic s) + K * Real.sqrt s from by |
| 50 | have hm : max (R s) 0 ≤ R s + K := max_le (by linarith) (by linarith [hscalar s hs]) |
| 51 | have hmul := mul_le_mul_of_nonneg_left hm (Real.sqrt_nonneg s) |
| 52 | nlinarith) |
| 53 | rw [intervalIntegral.integral_add hactual hcorrection, |
| 54 | intervalIntegral.integral_const_mul, integral_sqrt_nonneg_endpoint htau] at hbound |
| 55 | convert hbound using 1 |
| 56 | ring |
| 57 | |
| 58 | /-- The positive weighted action dominates each later unweighted piece. |
| 59 | This is equation (16.2), p. 381; no derivative at either endpoint is used. -/ |
| 60 | theorem weightedAction_ge_tail {density : ℝ → ℝ} {a b tau : ℝ} |
| 61 | (ha : 0 ≤ a) (hab : a ≤ b) (hbtau : b ≤ tau) |
| 62 | (hnonneg : ∀ s, 0 ≤ density s) |
| 63 | (hweighted : IntervalIntegrable (fun s => Real.sqrt s * density s) volume 0 tau) |
| 64 | (htail : IntervalIntegrable density volume a b) : |
| 65 | Real.sqrt a * (∫ s in a..b, density s) ≤ |
| 66 | ∫ s in (0 : ℝ)..tau, Real.sqrt s * density s := by |
| 67 | have hsub : uIcc a b ⊆ uIcc 0 tau := by |
| 68 | rw [uIcc_of_le hab, uIcc_of_le (ha.trans (hab.trans hbtau))] |
| 69 | exact Icc_subset_Icc ha hbtau |
| 70 | have hlocal := intervalIntegral.integral_mono_on hab |
| 71 | (htail.const_mul (Real.sqrt a)) (hweighted.mono_set hsub) |
| 72 | (fun s hs => mul_le_mul_of_nonneg_right (Real.sqrt_le_sqrt hs.1) (hnonneg s)) |
| 73 | rw [intervalIntegral.integral_const_mul] at hlocal |
| 74 | exact hlocal.trans (intervalIntegral.integral_mono_interval ha hab hbtau |
| 75 | (Filter.Eventually.of_forall (fun s => mul_nonneg (Real.sqrt_nonneg s) (hnonneg s))) |
| 76 | hweighted) |
| 77 | |
| 78 | /-- A cap-entry energy above the rescaled budget contradicts short |
| 79 | positive action; equations (16.2)-(16.3), pp. 381-382. -/ |
| 80 | theorem weightedAction_gt_of_tail {density : ℝ → ℝ} {a b tau budget : ℝ} |
| 81 | (ha : 0 < a) (hab : a ≤ b) (hbtau : b ≤ tau) |
| 82 | (hnonneg : ∀ s, 0 ≤ density s) |
| 83 | (hweighted : IntervalIntegrable (fun s => Real.sqrt s * density s) volume 0 tau) |
| 84 | (htail : IntervalIntegrable density volume a b) |
| 85 | (hentry : budget / Real.sqrt a < ∫ s in a..b, density s) : |
| 86 | budget < ∫ s in (0 : ℝ)..tau, Real.sqrt s * density s := by |
| 87 | have hroot : 0 < Real.sqrt a := Real.sqrt_pos.mpr ha |
| 88 | have hbudget : budget < Real.sqrt a * (∫ s in a..b, density s) := by |
| 89 | have h := (div_lt_iff₀ hroot).mp hentry |
| 90 | simpa only [mul_comm] using h |
| 91 | exact hbudget.trans_le (weightedAction_ge_tail ha.le hab hbtau hnonneg hweighted htail) |
| 92 | |
| 93 | end PoincareMT.Proofs.M46 |