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.Construction.ExponentialCoherence |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Paths.SquareRoot.Action.SquareDensity |
| 3 | import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus |
| 4 | import Mathlib.Analysis.Calculus.Deriv.Slope |
| 5 | |
| 6 | /-! |
| 7 | # Initial limit of the actual tangential reduced length |
| 8 | |
| 9 | On every positive surviving prefix, the action is the primitive of |
| 10 | one fixed continuous square density. Its mean tends to the actual |
| 11 | initial kinetic value. No zero-time convention for the supplied |
| 12 | family's action or reduced length is assumed. |
| 13 | Morgan-Tian Proposition 6.78, pp. 142-144. |
| 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 | private theorem tendsto_intervalAverage_right {b : ℝ} (hb : 0 < b) |
| 26 | (f : ℝ → ℝ) (hf : ContinuousOn f (Icc 0 b)) : |
| 27 | Tendsto (fun r => (∫ t in 0..r, f t) / r) (𝓝[>] (0 : ℝ)) (𝓝 (f 0)) := by |
| 28 | let : Fact ((0 : ℝ) ∈ Icc 0 b) := ⟨⟨le_rfl, hb.le⟩⟩ |
| 29 | have hi : IntervalIntegrable f volume 0 0 := by simp |
| 30 | have hd := intervalIntegral.integral_hasDerivWithinAt_right |
| 31 | (s := Icc 0 b) (t := Icc 0 b) hi |
| 32 | (hf.stronglyMeasurableAtFilter_nhdsWithin measurableSet_Icc 0) (hf 0 ⟨le_rfl, hb.le⟩) |
| 33 | have hl := hasDerivWithinAt_iff_tendsto_slope.mp hd |
| 34 | rw [Icc_sdiff_left, nhdsWithin_Ioc_eq_nhdsGT hb] at hl |
| 35 | change Tendsto (fun r => slope (fun u => ∫ t in 0..u, f t) 0 r) |
| 36 | (𝓝[>] (0 : ℝ)) (𝓝 (f 0)) at hl |
| 37 | simpa only [slope_def_field, intervalIntegral.integral_same, sub_zero] using hl |
| 38 | |
| 39 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 40 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 41 | {T : ℝ} {x : G.Point} |
| 42 | |
| 43 | private theorem initial_inner_transport {q r : G.Point} (h : q = r) |
| 44 | (v : G.Horizontal q) : |
| 45 | G.spacetime.horizontalMetric.inner q v v = |
| 46 | G.spacetime.horizontalMetric.inner r (h ▸ v) (h ▸ v) := by |
| 47 | cases h |
| 48 | rfl |
| 49 | |
| 50 | /-- The initial square-density mean is the squared norm of the |
| 51 | prescribed normalized initial vector, Proposition 6.78, pp. 142-144. -/ |
| 52 | theorem exponential_squareDensity_zero |
| 53 | (E : M14ExponentialFamily G T x) {Z : G.Horizontal x} {b : ℝ} |
| 54 | (hb : (Z, b) ∈ E.domain) (hpos : 0 < b) : |
| 55 | squareRootLIntegrand (E.square_path Z b hb hpos) 0 / 2 = |
| 56 | G.spacetime.horizontalMetric.inner x Z Z := by |
| 57 | obtain ⟨hpoint, hA⟩ := E.square_initial_velocity Z b hb hpos |
| 58 | have hinner := initial_inner_transport hpoint ((E.square_path Z b hb hpos).horizontal_velocity 0) |
| 59 | rw [hA] at hinner |
| 60 | simp only [map_smul, smul_apply, smul_eq_mul] at hinner |
| 61 | simp only [squareRootLIntegrand, zero_pow (by decide : 2 ≠ 0), mul_zero, zero_mul, |
| 62 | zero_add, hinner] |
| 63 | ring |
| 64 | |
| 65 | /-- Along any positive surviving branch, tangential reduced length |
| 66 | tends to the actual initial squared norm. The supplied value at zero |
| 67 | is not used, Proposition 6.78, pp. 142-144. -/ |
| 68 | theorem tendsto_exponential_reducedLength_zero |
| 69 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 70 | (E : M14ExponentialFamily G T x) {Z : G.Horizontal x} {b : ℝ} |
| 71 | (hb : (Z, b) ∈ E.domain) (hpos : 0 < b) : |
| 72 | Tendsto (E.reduced_length Z) (𝓝[>] (0 : ℝ)) |
| 73 | (𝓝 (G.spacetime.horizontalMetric.inner x Z Z)) := by |
| 74 | let P := exponentialInitialValuePath E Z b hb hpos |
| 75 | have hc : ContinuousOn (squareRootLIntegrand P.square_path) (Icc 0 b) := by |
| 76 | simpa only [M14SqrtParameterInterval, Real.sqrt_zero, Real.sqrt_sq hpos.le] using |
| 77 | (squareRootLIntegrand_contDiffOn hM12 P.square_path).continuousOn |
| 78 | have hl := |
| 79 | (tendsto_intervalAverage_right hpos (squareRootLIntegrand P.square_path) hc).div_const 2 |
| 80 | have hvalue : squareRootLIntegrand P.square_path 0 / 2 = |
| 81 | G.spacetime.horizontalMetric.inner x Z Z := exponential_squareDensity_zero E hb hpos |
| 82 | rw [hvalue] at hl |
| 83 | have heq : E.reduced_length Z =ᶠ[𝓝[>] (0 : ℝ)] |
| 84 | (fun r => (∫ t in 0..r, squareRootLIntegrand P.square_path t) / r / 2) := by |
| 85 | filter_upwards [Ioc_mem_nhdsGT hpos] with r hr |
| 86 | have hsurv := (E.maximal_lifetime Z).out (E.domain_zero Z) hb ⟨hr.1.le, hr.2⟩ |
| 87 | rw [E.reduced_length_eq Z r hsurv hr.1, |
| 88 | exponentialFamily_action_eq hM04 hM12 E hsurv hr.1, |
| 89 | initialValueAction_eq_integral_prefix hM04 hM12 P |
| 90 | (by simpa only [Real.sqrt_sq hpos.le] using ⟨hr.1.le, hr.2⟩)] |
| 91 | ring |
| 92 | exact hl.congr' heq.symm |
| 93 | |
| 94 | end PoincareMT.M14 |