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.Variation.Pullback.OpenSurfaceDensity |
| 2 | |
| 3 | /-! |
| 4 | # The original geometric Euler expression from momentum |
| 5 | |
| 6 | Morgan-Tian Lemma 6.4 and Definition 6.7, pp. 107-108. Equality of |
| 7 | the actual density variation and weighted momentum derivatives, together |
| 8 | with surface torsion, gives the geometric Euler expression with its |
| 9 | singular weight and the prescribed Ricci sign. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | -- The two slice extensions have the same horizontal fiber at their intersection. |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.M14 |
| 22 | |
| 23 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 24 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 25 | {α : ℝ × ℝ → G.Point} {J P : Set ℝ} {T s v d : ℝ} |
| 26 | |
| 27 | /-- Matching the actual weighted momentum and variation-density |
| 28 | derivatives forces the original paired geometric Euler expression to |
| 29 | vanish, Lemma 6.4 and Definition 6.7, pp. 107-108. -/ |
| 30 | theorem surfaceEulerPair_eq_zero (hCoordinates : M12MetricPredecessors.{0} n) |
| 31 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) (hJ : IsOpen J) (hP : IsOpen P) |
| 32 | (hα : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (spacetimeModel n) ∞ α (J ×ˢ P)) |
| 33 | (hclock : ∀ z ∈ J ×ˢ P, G.spacetime.timeFunction (α z) = T - z.1) |
| 34 | (hs : s ∈ J) (hv : v ∈ P) (hspos : 0 < s) |
| 35 | (E : M14PullbackExtension G (fun r => α (r, v)) J (fun r => surfaceHorizontalFst α r v)) |
| 36 | (hmomentum : HasDerivAt |
| 37 | (fun r => 2 * Real.sqrt r * G.spacetime.horizontalMetric.inner (α (r, v)) |
| 38 | (surfaceHorizontalFst α r v) (surfaceHorizontalSnd α r v)) d s) |
| 39 | (hdensity : HasDerivAt |
| 40 | (fun u => M14RawLIntegrand G (fun r => α (r, u)) (fun r => surfaceHorizontalFst α r u) s) |
| 41 | d v) : |
| 42 | G.spacetime.horizontalMetric.inner (α (s, v)) |
| 43 | (M14HorizontalCovariantDerivative G (fun r => α (r, v)) J |
| 44 | (fun r => surfaceHorizontalFst α r v) E s) (surfaceHorizontalSnd α s v) - |
| 45 | (1 / 2 : ℝ) * M14HorizontalScalarDifferential G (α (s, v)) (surfaceHorizontalSnd α s v).val + |
| 46 | (1 / (2 * s) : ℝ) * G.spacetime.horizontalMetric.inner (α (s, v)) |
| 47 | (surfaceHorizontalFst α s v) (surfaceHorizontalSnd α s v) + |
| 48 | 2 * horizontalRicci G.leafwise (α (s, v)) |
| 49 | (surfaceHorizontalFst α s v) (surfaceHorizontalSnd α s v) = 0 := by |
| 50 | obtain ⟨F⟩ := exists_surfaceHorizontalSnd_extension hJ hP hα hv |
| 51 | obtain ⟨EU⟩ := exists_surfaceHorizontalFst_parameter_extension hJ hP hα hs |
| 52 | have hvar := hasDerivAt_surfaceRawDensity hM12 hJ hP hα hclock hs hv EU |
| 53 | have htorsion := horizontalCovariantDerivative_surface_commute hCoordinates |
| 54 | (hJ.prod hP) hα ⟨hs, hv⟩ (hJ.mem_nhds hs) (hP.mem_nhds hv) F EU |
| 55 | rw [← htorsion] at hvar |
| 56 | have hpair := hasDerivAt_surfaceWeightedPair hJ hP hα hclock hs hv hspos E F |
| 57 | have heq := (hpair.unique hmomentum).trans (hdensity.unique hvar) |
| 58 | have hsqrt : Real.sqrt s ≠ 0 := (Real.sqrt_pos.mpr hspos).ne' |
| 59 | have hweight : (1 / Real.sqrt s : ℝ) = 2 * Real.sqrt s * (1 / (2 * s)) := by |
| 60 | field_simp [hsqrt, hspos.ne'] |
| 61 | nlinarith [Real.sq_sqrt hspos.le] |
| 62 | rw [hweight] at heq |
| 63 | have hz : 2 * Real.sqrt s * |
| 64 | (G.spacetime.horizontalMetric.inner (α (s, v)) |
| 65 | (M14HorizontalCovariantDerivative G (fun r => α (r, v)) J |
| 66 | (fun r => surfaceHorizontalFst α r v) E s) (surfaceHorizontalSnd α s v) - |
| 67 | (1 / 2 : ℝ) * M14HorizontalScalarDifferential G (α (s, v)) |
| 68 | (surfaceHorizontalSnd α s v).val + |
| 69 | (1 / (2 * s) : ℝ) * G.spacetime.horizontalMetric.inner (α (s, v)) |
| 70 | (surfaceHorizontalFst α s v) (surfaceHorizontalSnd α s v) + |
| 71 | 2 * horizontalRicci G.leafwise (α (s, v)) |
| 72 | (surfaceHorizontalFst α s v) (surfaceHorizontalSnd α s v)) = 0 := by |
| 73 | linear_combination heq |
| 74 | exact (mul_eq_zero.mp hz).resolve_left (mul_ne_zero two_ne_zero hsqrt) |
| 75 | |
| 76 | end PoincareMT.M14 |