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.Exponential.InitialValue.InitialAction |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Paths.SquareRoot.Action.SquareDensity |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Exponential.InitialValue.InitialValueContinuation |
| 4 | import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus |
| 5 | |
| 6 | /-! |
| 7 | # The actual action derivative within the maximal survival slice |
| 8 | |
| 9 | Morgan-Tian equation (6.2) and Lemma 6.18, pp. 106, 113-114. |
| 10 | Actual continuation supplies a relative closed prefix neighborhood. |
| 11 | The selected action is its actual square-density primitive; the |
| 12 | closed-interval FTC and genuine density congruence give the frozen |
| 13 | time derivative even at a physical endpoint. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | open Set Filter MeasureTheory |
| 19 | open scoped Manifold ContDiff Topology intervalIntegral |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.M14 |
| 24 | |
| 25 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 26 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 27 | |
| 28 | /-- The selected action has the actual square-density derivative |
| 29 | within the entire survival slice at every positive surviving time. |
| 30 | The supplied path may be any actual normalized IVP for that pair, |
| 31 | equation (6.2) and Lemma 6.18, pp. 106, 113-114. -/ |
| 32 | theorem initialValueAction_hasDerivWithinAt |
| 33 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 34 | {T s : ℝ} {x y : G.Point} {Z : G.Horizontal x} (hs : 0 < s) |
| 35 | (P : M14SquareRootInitialValuePath G T (s ^ 2) x y Z) : |
| 36 | HasDerivWithinAt (initialValueAction G T x Z) |
| 37 | ((1 / 2 : ℝ) * G.spacetime.horizontalMetric.inner (P.square_path.curve s) |
| 38 | (P.square_path.horizontal_velocity s) (P.square_path.horizontal_velocity s) + |
| 39 | 2 * s ^ 2 * horizontalScalarCurvature G.leafwise (P.square_path.curve s)) |
| 40 | {r | (Z, r) ∈ initialValueDomain G T x} s := by |
| 41 | obtain ⟨d, hsd, hnear, z, Q, hQP⟩ := |
| 42 | exists_initialValuePath_extension_neighborhood hM04 hM12 P |
| 43 | rw [Real.sqrt_sq hs.le] at hsd hnear |
| 44 | have hd : 0 < d := hs.trans_le hsd |
| 45 | have hC : M14SqrtParameterInterval 0 (s ^ 2) = Icc 0 s := by |
| 46 | rw [M14SqrtParameterInterval, Real.sqrt_zero, Real.sqrt_sq hs.le] |
| 47 | have hD : M14SqrtParameterInterval 0 (d ^ 2) = Icc 0 d := by |
| 48 | rw [M14SqrtParameterInterval, Real.sqrt_zero, Real.sqrt_sq hd.le] |
| 49 | have hcont : ContinuousOn (squareRootLIntegrand Q.square_path) (Icc 0 d) := by |
| 50 | simpa only [hD] using (squareRootLIntegrand_contDiffOn hM12 Q.square_path).continuousOn |
| 51 | have hint : IntervalIntegrable (squareRootLIntegrand Q.square_path) volume 0 s := |
| 52 | (hcont.mono (Icc_subset_Icc le_rfl hsd)).intervalIntegrable_of_Icc hs.le |
| 53 | let : Fact (s ∈ Icc 0 d) := ⟨⟨hs.le, hsd⟩⟩ |
| 54 | have hderiv := intervalIntegral.integral_hasDerivWithinAt_right |
| 55 | (s := Icc 0 d) (t := Icc 0 d) hint |
| 56 | (hcont.stronglyMeasurableAtFilter_nhdsWithin measurableSet_Icc s) (hcont s ⟨hs.le, hsd⟩) |
| 57 | have hprimitive : ∀ r ∈ Icc 0 d, |
| 58 | initialValueAction G T x Z r = ∫ t in 0..r, squareRootLIntegrand Q.square_path t := by |
| 59 | intro r hr |
| 60 | exact initialValueAction_eq_integral_prefix hM04 hM12 Q |
| 61 | (by simpa only [Real.sqrt_sq hd.le] using hr) |
| 62 | have haction := hderiv.congr_of_mem hprimitive ⟨hs.le, hsd⟩ |
| 63 | have hbase : G.spacetime.timeFunction x = T := by |
| 64 | simpa only [GeneralizedFlowSpacetime.timeFunction, sub_zero] using P.path.base_time |
| 65 | have hnearD : Icc 0 d ∈ 𝓝[{r | (Z, r) ∈ initialValueDomain G T x}] s := |
| 66 | nhdsWithin_mono s (fun _ hr => initialValueDomain_admissible hbase hr) hnear |
| 67 | have hfull := haction.mono_of_mem_nhdsWithin hnearD |
| 68 | have heq : EqOn Q.square_path.curve P.square_path.curve (Icc 0 s) := by |
| 69 | simpa only [hC] using hQP |
| 70 | have hsubQ : Icc 0 s ⊆ M14SqrtParameterInterval 0 (d ^ 2) := |
| 71 | hD ▸ Icc_subset_Icc le_rfl hsd |
| 72 | have hsubP : Icc 0 s ⊆ M14SqrtParameterInterval 0 (s ^ 2) := hC ▸ Subset.refl _ |
| 73 | have hdensity := squareRootLIntegrand_eq_on_subset Q.square_path P.square_path |
| 74 | hsubQ hsubP heq ⟨hs.le, le_rfl⟩ (uniqueDiffOn_Icc hs s ⟨hs.le, le_rfl⟩) |
| 75 | rw [hdensity] at hfull |
| 76 | simpa only [squareRootLIntegrand, add_comm] using hfull |
| 77 | |
| 78 | end PoincareMT.M14 |