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.SurfaceEulerMomentum |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Pullback.GaugeMomentum |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Pullback.GaugeMomentumPair |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Extension.BackwardTestField |
| 5 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Minimizers.MinimizerSmooth |
| 6 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Pullback.PullbackCongruence |
| 7 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Theory |
| 8 | |
| 9 | /-! |
| 10 | # The original-time geometric Euler equation for minimizing paths |
| 11 | |
| 12 | Morgan-Tian Lemma 6.4 and Definition 6.7, pp. 107-108. Actual |
| 13 | supported gauge surfaces realize every horizontal test vector. The |
| 14 | proved momentum and density derivatives then force the frozen Euler |
| 15 | residual to vanish for every actual velocity-extension witness. |
| 16 | -/ |
| 17 | |
| 18 | set_option autoImplicit false |
| 19 | -- Equal zero-slice curves identify the frozen dependent horizontal fibers. |
| 20 | set_option backward.isDefEq.respectTransparency false |
| 21 | |
| 22 | open Set Filter |
| 23 | open scoped Manifold ContDiff Topology |
| 24 | |
| 25 | universe u |
| 26 | |
| 27 | namespace PoincareMT.M14 |
| 28 | |
| 29 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 30 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 31 | {T τ₁ τ₂ : ℝ} {x y : G.Point} {p : M14BackwardPath G T τ₁ τ₂ x y} |
| 32 | |
| 33 | private theorem horizontal_heq_of_val_eq {q r : G.Point} (h : q = r) |
| 34 | {a : G.Horizontal q} {b : G.Horizontal r} (hab : a.val = b.val) : HEq a b := by |
| 35 | cases h |
| 36 | exact heq_of_eq (Subtype.ext hab) |
| 37 | |
| 38 | private theorem horizontal_inner_heq {q r : G.Point} (h : q = r) |
| 39 | {a b : G.Horizontal q} {c d : G.Horizontal r} (ha : HEq a c) (hb : HEq b d) : |
| 40 | G.spacetime.horizontalMetric.inner q a b = G.spacetime.horizontalMetric.inner r c d := by |
| 41 | cases h |
| 42 | cases ha |
| 43 | cases hb |
| 44 | rfl |
| 45 | |
| 46 | private theorem horizontal_scalar_heq {q r : G.Point} (h : q = r) |
| 47 | {a : G.Horizontal q} {b : G.Horizontal r} (ha : HEq a b) : |
| 48 | M14HorizontalScalarDifferential G q a.val = M14HorizontalScalarDifferential G r b.val := by |
| 49 | cases h |
| 50 | cases ha |
| 51 | rfl |
| 52 | |
| 53 | private theorem horizontal_ricci_heq {q r : G.Point} (h : q = r) |
| 54 | {a b : G.Horizontal q} {c d : G.Horizontal r} (ha : HEq a c) (hb : HEq b d) : |
| 55 | horizontalRicci G.leafwise q a b = horizontalRicci G.leafwise r c d := by |
| 56 | cases h |
| 57 | cases ha |
| 58 | cases hb |
| 59 | rfl |
| 60 | |
| 61 | /-- An actual minimizing path satisfies the frozen original-time |
| 62 | paired Euler equation at every interior point, for every actual velocity |
| 63 | extension, Lemma 6.4 and Definition 6.7, pp. 107-108. -/ |
| 64 | theorem eulerResidual_eq_zero_of_minimizing |
| 65 | (hCoordinates : M12MetricPredecessors.{0} n) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 66 | (hmin : M14IsMinimizing p) |
| 67 | (E : M14PullbackExtension G p.curve (Ioo τ₁ τ₂) p.horizontal_velocity) |
| 68 | {s : ℝ} (hs : s ∈ Ioo τ₁ τ₂) (W : G.Horizontal (p.curve s)) : |
| 69 | M14EulerResidual G p E s W = 0 := by |
| 70 | obtain ⟨b, U, lift, hU, hsU, hlift, hright, η, hη, hsupp, hsrc, hvalue⟩ := |
| 71 | exists_supportedBackwardGaugeTest_at p hs W |
| 72 | have hrightSupport : ∀ t ∈ tsupport η, |
| 73 | (G.gaugeCover.cylinder b).toSpacetime (lift (p.curve t)) = p.curve t := |
| 74 | fun t ht => hright _ (hsrc t ht) |
| 75 | obtain ⟨r, hr, hshift⟩ := exists_supportedBackwardGauge_radius p b lift η hU hlift hη hsupp hsrc |
| 76 | let P := Ioo (-r) r |
| 77 | have hP : IsOpen P := isOpen_Ioo |
| 78 | have hzero : (0 : ℝ) ∈ P := ⟨neg_lt_zero.mpr hr, hr⟩ |
| 79 | let α := fun z : ℝ × ℝ => supportedBackwardGaugeFamily p b lift η z.2 z.1 |
| 80 | have hα : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (spacetimeModel n) ∞ α |
| 81 | (Ioo τ₁ τ₂ ×ˢ P) := |
| 82 | supportedBackwardGaugeFamily_joint_contMDiffOn p b lift η |
| 83 | (minimizing_curve_contMDiffOn p hM12 hmin) hU hlift hright hη hsrc hshift |
| 84 | have hclock : ∀ z ∈ Ioo τ₁ τ₂ ×ˢ P, G.spacetime.timeFunction (α z) = T - z.1 := by |
| 85 | intro z hz |
| 86 | exact supportedBackwardGaugeFamily_time p b lift η |
| 87 | (fun t ht => ((G.gaugeCover.cylinder b).time_eq (lift (p.curve t))).symm.trans |
| 88 | (congrArg G.spacetime.timeFunction (hrightSupport t ht))) (Ioo_subset_Icc_self hz.1) z.2 |
| 89 | have hbase : p.curve = fun t => α (t, 0) := |
| 90 | (funext (supportedBackwardGaugeFamily_at_zero p b lift η hrightSupport)).symm |
| 91 | have hvelocity : ∀ t ∈ Ioo τ₁ τ₂, |
| 92 | HEq (p.horizontal_velocity t) (surfaceHorizontalFst α t 0) := by |
| 93 | intro t ht |
| 94 | apply horizontal_heq_of_val_eq (congrFun hbase t) |
| 95 | exact (congrArg Subtype.val (backwardPath_velocity_eq_projected p ht)).trans |
| 96 | (congrArg (fun γ : ℝ → G.Point => (projectedCurveVelocity G γ t).val) hbase) |
| 97 | let EX := pullbackExtensionCongr E hbase hvelocity |
| 98 | let J := Ioo τ₁ τ₂ ∩ p.curve ⁻¹' U |
| 99 | have hJ : IsOpen J := p.curve_regular.continuousOn.isOpen_inter_preimage isOpen_Ioo hU |
| 100 | have hsJ : s ∈ J := ⟨hs, hsU⟩ |
| 101 | obtain ⟨a, c, _, hacN, hacJ⟩ := exists_Icc_mem_subset_of_mem_nhds (hJ.mem_nhds hsJ) |
| 102 | have hsac := Icc_mem_nhds_iff.mp hacN |
| 103 | obtain ⟨d, hcoordinate, hdensity⟩ := minimizing_gauge_momentum_density_derivatives |
| 104 | p b lift η (lift (p.curve s)).2 hM12 hmin hU hlift hright hJ inter_subset_left |
| 105 | (fun _ ht => ht.2) (hsac.1.trans hsac.2) hacJ hsac hη |
| 106 | have hmomentum : HasDerivAt |
| 107 | (fun t => 2 * Real.sqrt t * G.spacetime.horizontalMetric.inner (α (t, 0)) |
| 108 | (surfaceHorizontalFst α t 0) (surfaceHorizontalSnd α t 0)) d s := by |
| 109 | apply hcoordinate.congr_of_eventuallyEq |
| 110 | filter_upwards [hJ.mem_nhds hsJ] with t ht |
| 111 | exact supportedBackwardGauge_weightedPair p b lift η (lift (p.curve s)).2 |
| 112 | hU hlift hright hsrc ht.1 ht.2 |
| 113 | change HasDerivAt |
| 114 | (fun v => M14RawLIntegrand G (fun t => α (t, v)) (fun t => surfaceHorizontalFst α t v) s) |
| 115 | d 0 at hdensity |
| 116 | have heuler := surfaceEulerPair_eq_zero hCoordinates hM12 isOpen_Ioo hP hα hclock hs hzero |
| 117 | (p.tau_nonneg.trans_lt hs.1) EX hmomentum hdensity |
| 118 | have hpoint : α (s, 0) = p.curve s := (congrFun hbase s).symm |
| 119 | have hX := (hvelocity s hs).symm |
| 120 | have hDX := (horizontalCovariantDerivative_congr E hbase hvelocity s).symm |
| 121 | have hZval : (surfaceHorizontalSnd α s 0).val = W.val := by |
| 122 | rw [surfaceHorizontalSnd_val isOpen_Ioo hP hα hclock hs hzero] |
| 123 | exact (supportedBackwardGaugeFamily_parameter_mfderiv p b lift η hrightSupport s).trans hvalue |
| 124 | have hZ := horizontal_heq_of_val_eq hpoint hZval |
| 125 | rw [horizontal_inner_heq hpoint hDX hZ, horizontal_scalar_heq hpoint hZ, |
| 126 | horizontal_inner_heq hpoint hX hZ, horizontal_ricci_heq hpoint hX hZ] at heuler |
| 127 | exact heuler |
| 128 | |
| 129 | /-- The exact frozen original-time minimizer Euler statement, with |
| 130 | the actual horizontal extension and no completeness or square-root |
| 131 | regularity assumption, Lemma 6.4 and Definition 6.7, pp. 107-108. -/ |
| 132 | theorem minimizerEulerStatement (hCoordinates : M12MetricPredecessors.{0} n) |
| 133 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) : M14MinimizerEulerStatement G := by |
| 134 | intro T τ₁ τ₂ x y p hmin |
| 135 | obtain ⟨E⟩ := exists_minimizing_velocity_extension p hM12 hmin |
| 136 | exact ⟨E, fun s hs W => eulerResidual_eq_zero_of_minimizing hCoordinates hM12 hmin E hs W⟩ |
| 137 | |
| 138 | end PoincareMT.M14 |