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.Euler.EulerSurfaceDerivative |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Paths.Regularity.ExtendedPathRegularity |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Pullback.GaugeMomentumPair |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Pullback.PullbackCongruence |
| 5 | |
| 6 | /-! |
| 7 | # Actual gauge momentum pairings along Euler paths |
| 8 | |
| 9 | Morgan-Tian Lemma 6.4, Definition 6.7 and Lemma 6.8, pp. 107-109. |
| 10 | A supplied smooth velocity extension gives interior path smoothness. |
| 11 | Supported gauge variations then transport its actual Euler equation |
| 12 | to the surface and identify the coordinate momentum-pair derivative |
| 13 | with the actual density variation. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | -- Equal base points identify the actual dependent horizontal tangent fibers. |
| 18 | set_option backward.isDefEq.respectTransparency false |
| 19 | |
| 20 | open Set Filter |
| 21 | open scoped Manifold ContDiff Topology |
| 22 | |
| 23 | universe u |
| 24 | |
| 25 | namespace PoincareMT.M14 |
| 26 | |
| 27 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 28 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 29 | |
| 30 | private theorem horizontal_heq_of_val_eq {q r : G.Point} (h : q = r) |
| 31 | {a : G.Horizontal q} {b : G.Horizontal r} (hab : a.val = b.val) : HEq a b := by |
| 32 | cases h |
| 33 | exact heq_of_eq (Subtype.ext hab) |
| 34 | |
| 35 | private theorem eulerPair_heq {q r : G.Point} (h : q = r) |
| 36 | {A V W : G.Horizontal q} {A' V' W' : G.Horizontal r} |
| 37 | (hA : HEq A A') (hV : HEq V V') (hW : HEq W W') (s : ℝ) : |
| 38 | G.spacetime.horizontalMetric.inner q A W - |
| 39 | (1 / 2 : ℝ) * M14HorizontalScalarDifferential G q W.val + |
| 40 | (1 / (2 * s) : ℝ) * G.spacetime.horizontalMetric.inner q V W + |
| 41 | 2 * horizontalRicci G.leafwise q V W = |
| 42 | G.spacetime.horizontalMetric.inner r A' W' - |
| 43 | (1 / 2 : ℝ) * M14HorizontalScalarDifferential G r W'.val + |
| 44 | (1 / (2 * s) : ℝ) * G.spacetime.horizontalMetric.inner r V' W' + |
| 45 | 2 * horizontalRicci G.leafwise r V' W' := by |
| 46 | cases h |
| 47 | cases hA |
| 48 | cases hV |
| 49 | cases hW |
| 50 | rfl |
| 51 | |
| 52 | variable {T τ₁ τ₂ : ℝ} {x y : G.Point} (p : M14BackwardPath G T τ₁ τ₂ x y) |
| 53 | (b : G.gaugeCover.index) |
| 54 | (lift : G.Point → (G.timeIntervals.interval (G.gaugeCover.interval b)).Point × |
| 55 | G.gaugeCover.spatial b) (η : ℝ → EuclideanSpace ℝ (Fin n)) |
| 56 | |
| 57 | /-- The actual coordinate momentum pairing of an Euler path has |
| 58 | the derivative of its supported gauge-density variation, Lemma 6.4 |
| 59 | and Definition 6.7, pp. 107-108. -/ |
| 60 | theorem hasDerivAt_supportedBackwardGauge_pair_of_euler (x₀ : G.gaugeCover.spatial b) |
| 61 | (hCoordinates : M12MetricPredecessors.{0} n) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 62 | (E : M14PullbackExtension G p.curve (Ioo τ₁ τ₂) p.horizontal_velocity) |
| 63 | {U : Set G.Point} (hU : IsOpen U) |
| 64 | (hlift : ContMDiffOn (spacetimeModel n) (spacetimeModel n) ∞ lift U) |
| 65 | (hright : ∀ q ∈ U, (G.gaugeCover.cylinder b).toSpacetime (lift q) = q) |
| 66 | (hη : ContDiff ℝ ∞ η) (hsupp : tsupport η ⊆ Ioo τ₁ τ₂) |
| 67 | (hsrcSupport : ∀ t ∈ tsupport η, p.curve t ∈ U) |
| 68 | {s d : ℝ} (hs : s ∈ Ioo τ₁ τ₂) (hsrc : p.curve s ∈ U) |
| 69 | (heuler : ∀ W : G.Horizontal (p.curve s), M14EulerResidual G p E s W = 0) |
| 70 | (hdensity : HasDerivAt |
| 71 | (fun v => M14RawLIntegrand G (supportedBackwardGaugeFamily p b lift η v) |
| 72 | (projectedCurveVelocity G (supportedBackwardGaugeFamily p b lift η v)) s) d 0) : |
| 73 | HasDerivAt (fun t => |
| 74 | backwardMetricCoefficient (G.gaugeCover.spatial b) (G.gaugeCover.metric b).metric T x₀ |
| 75 | (t, (lift (p.curve t)).2.val) (deriv (fun r => (lift (p.curve r)).2.val) t) (η t)) d s := by |
| 76 | have hrightSupport : ∀ t ∈ tsupport η, |
| 77 | (G.gaugeCover.cylinder b).toSpacetime (lift (p.curve t)) = p.curve t := |
| 78 | fun t ht => hright _ (hsrcSupport t ht) |
| 79 | obtain ⟨r, hr, hshift⟩ := |
| 80 | exists_supportedBackwardGauge_radius p b lift η hU hlift hη hsupp hsrcSupport |
| 81 | let P := Ioo (-r) r |
| 82 | have hP : IsOpen P := isOpen_Ioo |
| 83 | have hzero : (0 : ℝ) ∈ P := ⟨neg_lt_zero.mpr hr, hr⟩ |
| 84 | let α := fun z : ℝ × ℝ => supportedBackwardGaugeFamily p b lift η z.2 z.1 |
| 85 | have hα : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (spacetimeModel n) ∞ α |
| 86 | (Ioo τ₁ τ₂ ×ˢ P) := |
| 87 | supportedBackwardGaugeFamily_joint_contMDiffOn p b lift η |
| 88 | (backwardPath_contMDiffOn_of_velocity_extension p E) hU hlift hright hη hsrcSupport hshift |
| 89 | have hclock : ∀ z ∈ Ioo τ₁ τ₂ ×ˢ P, G.spacetime.timeFunction (α z) = T - z.1 := by |
| 90 | intro z hz |
| 91 | exact supportedBackwardGaugeFamily_time p b lift η |
| 92 | (fun t ht => ((G.gaugeCover.cylinder b).time_eq (lift (p.curve t))).symm.trans |
| 93 | (congrArg G.spacetime.timeFunction (hrightSupport t ht))) (Ioo_subset_Icc_self hz.1) z.2 |
| 94 | have hbase : p.curve = fun t => α (t, 0) := |
| 95 | (funext (supportedBackwardGaugeFamily_at_zero p b lift η hrightSupport)).symm |
| 96 | have hvelocity : ∀ t ∈ Ioo τ₁ τ₂, |
| 97 | HEq (p.horizontal_velocity t) (surfaceHorizontalFst α t 0) := by |
| 98 | intro t ht |
| 99 | apply horizontal_heq_of_val_eq (congrFun hbase t) |
| 100 | exact (congrArg Subtype.val (backwardPath_velocity_eq_projected p ht)).trans |
| 101 | (congrArg (fun γ : ℝ → G.Point => (projectedCurveVelocity G γ t).val) hbase) |
| 102 | let EX := pullbackExtensionCongr E hbase hvelocity |
| 103 | obtain ⟨W, hW⟩ : ∃ W : G.Horizontal (p.curve s), HEq W (surfaceHorizontalSnd α s 0) := by |
| 104 | rw [congrFun hbase s] |
| 105 | exact ⟨surfaceHorizontalSnd α s 0, HEq.rfl⟩ |
| 106 | have hpairEuler := eulerPair_heq (congrFun hbase s) |
| 107 | (horizontalCovariantDerivative_congr E hbase hvelocity s) (hvelocity s hs) hW s |
| 108 | change M14EulerResidual G p E s W = _ at hpairEuler |
| 109 | have hpair := hasDerivAt_surfaceWeightedPair_of_euler hCoordinates hM12 isOpen_Ioo hP |
| 110 | hα hclock hs hzero (p.tau_nonneg.trans_lt hs.1) EX |
| 111 | (hpairEuler.symm.trans (heuler W)) hdensity |
| 112 | apply hpair.congr_of_eventuallyEq |
| 113 | have hp := (p.curve_regular s hs).contMDiffAt (isOpen_Ioo.mem_nhds hs) |
| 114 | filter_upwards [isOpen_Ioo.mem_nhds hs, |
| 115 | hp.continuousAt.preimage_mem_nhds (hU.mem_nhds hsrc)] with t ht htU |
| 116 | exact (supportedBackwardGauge_weightedPair p b lift η x₀ |
| 117 | hU hlift hright hsrcSupport ht htU).symm |
| 118 | |
| 119 | end PoincareMT.M14 |