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.SourceNames.LGeometry |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Surface.VariationGauge |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Coordinates.GaugeCovariantFields |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Pullback.PullbackRestriction |
| 5 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Pullback.PullbackCongruence |
| 6 | |
| 7 | /-! |
| 8 | # The actual endpoint acceleration in a compatible gauge |
| 9 | |
| 10 | Morgan-Tian Proposition 6.33, pp. 120-121. Restricting and transporting |
| 11 | the supplied endpoint extension identifies its actual derivative with |
| 12 | the spatial second parameter derivative plus the Christoffel term. |
| 13 | The parameter derivative is unrestricted even at a closed time endpoint. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | -- The actual base point and its gauge reconstruction have equal horizontal 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 | {T τ₁ τ₂ : ℝ} {x y : G.Point} {p : M14BackwardPath G T τ₁ τ₂ x y} |
| 30 | {R : M14SquareRootPath G p} |
| 31 | |
| 32 | private theorem acceleration_transport_heq {q r : G.Point} (h : q = r) |
| 33 | (v : G.Horizontal q) : HEq (h.symm ▸ v : G.Horizontal r) v := by |
| 34 | cases h |
| 35 | rfl |
| 36 | |
| 37 | /-- Every supplied endpoint extension gives the actual coordinate |
| 38 | acceleration in any compatible gauge rectangle, including closed time |
| 39 | endpoints; Proposition 6.33, pp. 120-121. -/ |
| 40 | theorem variationEndpointAcceleration_gauge |
| 41 | (V : M14LVariationData G p R) (D : M14VariationDerivativeData V) |
| 42 | (b : G.gaugeCover.index) |
| 43 | (hCoordinates : SpacetimeGaugeTheory.{u, 0} G.leafwise G.timeIntervals) |
| 44 | (W : OrdinaryGaugeWitness G.leafwise (G.gaugeCover.cylinder b) (G.gaugeCover.metric b)) |
| 45 | (x₀ : G.gaugeCover.spatial b) {S P : Set ℝ} |
| 46 | (hS : S ⊆ M14SqrtParameterInterval τ₁ τ₂) (hP : IsOpen P) |
| 47 | (hzero : (0 : ℝ) ∈ P) (hPsub : P ⊆ V.parameterDomain) |
| 48 | {β : ℝ × ℝ → (G.timeIntervals.interval (G.gaugeCover.interval b)).Point × |
| 49 | G.gaugeCover.spatial b} |
| 50 | (hβ : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (spacetimeModel n) ∞ β (S ×ˢ P)) |
| 51 | (hrec : ∀ r ∈ S, ∀ u ∈ P, |
| 52 | (G.gaugeCover.cylinder b).toSpacetime (β (r, u)) = V.squareFamily r u) |
| 53 | (hclock : ∀ r ∈ S, ∀ u ∈ P, (β (r, u)).1.val = T - r ^ 2) |
| 54 | {s : ℝ} (hs : s ∈ S) : |
| 55 | HEq (M14VariationEndpointAcceleration V D s (hS hs)) |
| 56 | ((G.gaugeCover.metric b).spatialTangentEquiv (β (s, 0)).1 (β (s, 0)).2 |
| 57 | (deriv (deriv (fun v => (β (s, v)).2.val)) 0 + |
| 58 | M08.closedChartConnection W.flow T x₀ S (s, (β (s, 0)).2.val) |
| 59 | (deriv (fun v => (β (s, v)).2.val) 0) |
| 60 | (deriv (fun v => (β (s, v)).2.val) 0))) := by |
| 61 | let γ := fun u => (G.gaugeCover.cylinder b).toSpacetime (β (s, u)) |
| 62 | let Y : ∀ u, G.Horizontal (γ u) := fun u => |
| 63 | (G.gaugeCover.metric b).spatialTangentEquiv (β (s, u)).1 (β (s, u)).2 |
| 64 | (deriv (fun v => (β (s, v)).2.val) u) |
| 65 | let E := pullbackExtensionRestrict (D.endpoint_extension s (hS hs)) hPsub |
| 66 | have hγ : EqOn (fun u => V.squareFamily s u) γ P := |
| 67 | fun u hu => (hrec s hs u hu).symm |
| 68 | have hY : ∀ u ∈ P, HEq (M14EndpointVariationField V s u) (Y u) := |
| 69 | fun u hu => endpointVariationField_gauge V b hP hβ hrec hs hu |
| 70 | let E' := pullbackExtensionCongrOn E hγ hY |
| 71 | have hcurve := hβ.comp ((contMDiff_const (c := s)).prodMk contMDiff_id).contMDiffOn |
| 72 | (fun _ hr => ⟨hs, hr⟩) |
| 73 | have htime (r : ℝ) (hr : r ∈ S) : T - r ^ 2 ∈ (G.gaugeCover.interval b).domain := by |
| 74 | rw [← hclock r hr 0 hzero] |
| 75 | exact (β (r, 0)).1.property |
| 76 | have hc := horizontalCovariantDerivative_gauge_coefficient b hCoordinates W T x₀ htime |
| 77 | (β := fun u => β (s, u)) E' hzero (hP.uniqueDiffOn 0 hzero) |
| 78 | ((hcurve 0 hzero).mdifferentiableWithinAt (by simp)) hs (hclock s hs 0 hzero) |
| 79 | have hform : M14HorizontalCovariantDerivative G γ P Y E' 0 = |
| 80 | (G.gaugeCover.metric b).spatialTangentEquiv (β (s, 0)).1 (β (s, 0)).2 |
| 81 | (deriv (deriv (fun v => (β (s, v)).2.val)) 0 + |
| 82 | M08.closedChartConnection W.flow T x₀ S (s, (β (s, 0)).2.val) |
| 83 | (deriv (fun v => (β (s, v)).2.val) 0) |
| 84 | (deriv (fun v => (β (s, v)).2.val) 0)) := by |
| 85 | apply ((G.gaugeCover.metric b).spatialTangentEquiv (β (s, 0)).1 (β (s, 0)).2).symm.injective |
| 86 | simpa only [Y, ContinuousLinearEquiv.symm_apply_apply, |
| 87 | derivWithin_of_mem_nhds (hP.mem_nhds hzero)] using hc |
| 88 | exact (acceleration_transport_heq (V.square_base s) _).trans |
| 89 | ((heq_of_eq (horizontalCovariantDerivative_restrict |
| 90 | (D.endpoint_extension s (hS hs)) hPsub (hP.mem_nhds hzero))).trans |
| 91 | ((horizontalCovariantDerivative_congrOn E hγ hY hzero).trans (heq_of_eq hform))) |
| 92 | |
| 93 | end PoincareMT.M14 |