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.AdaptedFields.UnitAdaptedField |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.AdaptedFields.ClosedAdaptedODE |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Jacobi.JacobiGaugeCoefficients |
| 5 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Jacobi.JacobiGaugeCoordinates |
| 6 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Extension.ClosedFieldExtension |
| 7 | |
| 8 | /-! |
| 9 | # Actual adapted factors within a compatible gauge |
| 10 | |
| 11 | The smooth solution of the closed coordinate transport equation gives |
| 12 | an actual horizontal field. Its covariant derivative cancels half the |
| 13 | metric time derivative, including at the physical endpoints. |
| 14 | Morgan-Tian Definition 6.35 and Lemma 6.36, p. 122. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | -- Open spatial tangent fibers and equal actual base fibers retain their models. |
| 19 | set_option backward.isDefEq.respectTransparency false |
| 20 | |
| 21 | open Set |
| 22 | open scoped Manifold ContDiff Bundle |
| 23 | |
| 24 | universe u |
| 25 | |
| 26 | namespace PoincareMT.M14 |
| 27 | |
| 28 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 29 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 30 | |
| 31 | private theorem horizontal_three_eval_heq |
| 32 | (F : ∀ q, G.Horizontal q → G.Horizontal q → G.Horizontal q → ℝ) |
| 33 | {q r : G.Point} (h : q = r) |
| 34 | {P DP W : G.Horizontal q} {P' DP' W' : G.Horizontal r} |
| 35 | (hP : HEq P P') (hDP : HEq DP DP') (hW : HEq W W') : |
| 36 | F q P DP W = F r P' DP' W' := by |
| 37 | cases h |
| 38 | cases hP |
| 39 | cases hDP |
| 40 | cases hW |
| 41 | rfl |
| 42 | |
| 43 | variable {T τ₁ τ₂ : ℝ} {x y : G.Point} {p : M14BackwardPath G T τ₁ τ₂ x y} |
| 44 | (R : M14SquareRootPath G p) (b : G.gaugeCover.index) |
| 45 | |
| 46 | /-- Every horizontal value prescribed in a closed compatible gauge |
| 47 | interval has an actual unit-adapted extension on that interval, |
| 48 | Definition 6.35 and Proposition 6.43, pp. 122, 127-128. -/ |
| 49 | theorem exists_gaugeHorizontalUnitAdaptedField |
| 50 | (hCoordinates : SpacetimeGaugeTheory.{u, 0} G.leafwise G.timeIntervals) |
| 51 | (W : OrdinaryGaugeWitness G.leafwise (G.gaugeCover.cylinder b) (G.gaugeCover.metric b)) |
| 52 | (hM04 : RicciFlowCurvatureTheory.{0}) (x₀ : G.gaugeCover.spatial b) |
| 53 | {a c t₀ : ℝ} (hac : a < c) (hsub : Icc a c ⊆ M14SqrtParameterInterval τ₁ τ₂) |
| 54 | {β : ℝ → (G.timeIntervals.interval (G.gaugeCover.interval b)).Point × |
| 55 | G.gaugeCover.spatial b} |
| 56 | (hβ : ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) ∞ β (Icc a c)) |
| 57 | (hrec : ∀ s ∈ Icc a c, (G.gaugeCover.cylinder b).toSpacetime (β s) = R.curve s) |
| 58 | (hclock : ∀ s ∈ Icc a c, (β s).1.val = T - s ^ 2) |
| 59 | (ht₀ : t₀ ∈ Icc a c) (P₀ : G.Horizontal (R.curve t₀)) : |
| 60 | ∃ P : ∀ s, G.Horizontal (R.curve s), |
| 61 | IsHorizontalUnitAdaptedFieldOn R a c P ∧ P t₀ = P₀ := by |
| 62 | let C := Icc a c |
| 63 | let q := fun s => (β s).2.val |
| 64 | have hq := gaugeLift_spatialCurve_contDiffOn b hβ |
| 65 | have hmem : MapsTo q C (extChartAt (𝓡 n) x₀).target := by |
| 66 | intro s hs |
| 67 | have hsrc : (β s).2 ∈ (extChartAt (𝓡 n) x₀).source := by |
| 68 | rw [extChartAt_source, (G.gaugeCover.spatial b).chartAt_source_eq_univ] |
| 69 | exact mem_univ _ |
| 70 | have he : extChartAt (𝓡 n) x₀ (β s).2 = (β s).2.val := by |
| 71 | rw [extChartAt_coe] |
| 72 | rfl |
| 73 | simpa only [he] using (extChartAt (𝓡 n) x₀).map_source hsrc |
| 74 | have htime (s : ℝ) (hs : s ∈ C) : T - s ^ 2 ∈ (G.gaugeCover.interval b).domain := by |
| 75 | rw [← hclock s hs] |
| 76 | exact (β s).1.property |
| 77 | obtain ⟨v₀, hv₀⟩ := exists_horizontalGauge_coordinates b (hrec t₀ ht₀) P₀ |
| 78 | obtain ⟨v, hv₀', hv, hvd⟩ := exists_closedCoordinateAdapted_solution W.flow T x₀ |
| 79 | hac htime hq hmem ht₀ v₀ |
| 80 | let P := horizontalFieldOfGauge b hrec v |
| 81 | have hP := horizontalFieldOfGauge_contMDiffOn b hβ hrec hv |
| 82 | obtain ⟨E⟩ := exists_pullbackExtension_Icc hac hP |
| 83 | have hPcoord := fun s hs => horizontalFieldOfGauge_heq b hrec v (s := s) hs |
| 84 | have hpaired (s : ℝ) (hs : s ∈ C) (Z : G.Horizontal (R.curve s)) : |
| 85 | G.spacetime.horizontalMetric.inner (R.curve s) |
| 86 | (M14HorizontalCovariantDerivative G R.curve C P E s) Z = |
| 87 | -(2 * s) * horizontalRicci G.leafwise (R.curve s) (P s) Z := by |
| 88 | obtain ⟨w, hw⟩ := exists_horizontalGauge_coordinates b (hrec s hs) Z |
| 89 | have hDP := horizontalCovariantDerivative_lifted_gauge b hCoordinates W T x₀ hβ hrec |
| 90 | hclock E v hPcoord hs (uniqueDiffOn_Icc hac s hs) |
| 91 | let d := derivWithin v C s + M08.closedChartConnection W.flow T x₀ C (s, q s) |
| 92 | (derivWithin q C s) (v s) |
| 93 | let φ := fun (z : G.Point) (P DP Z : G.Horizontal z) => |
| 94 | G.spacetime.horizontalMetric.inner z DP Z + 2 * s * horizontalRicci G.leafwise z P Z |
| 95 | have hgeom := horizontal_three_eval_heq φ (hrec s hs).symm (hPcoord s hs) hDP hw |
| 96 | have hmetric := gauge_chartActionMetric b W T x₀ (β s).2 s (β s).1 |
| 97 | (hclock s hs).symm d w |
| 98 | have htimePair := gauge_chartActionMetric_timeWithin_pair b hCoordinates W hM04 T hac |
| 99 | htime x₀ (β s).2 hs (β s).1 (hclock s hs).symm (v s) w |
| 100 | have hd : derivWithin v C s = |
| 101 | -M08.closedChartConnection W.flow T x₀ C (s, q s) (derivWithin q C s) (v s) - |
| 102 | (1 / 2 : ℝ) • M08.chartMetricDualInverse W.flow T x₀ (s, q s) |
| 103 | (M08.timeWithinFDeriv C (extChartAt (𝓡 n) x₀).target |
| 104 | (M08.chartActionMetric W.flow T x₀) (s, q s) (v s)) := by |
| 105 | exact (hvd s hs).derivWithin (uniqueDiffOn_Icc hac s hs) |
| 106 | have hcoord : M08.chartActionMetric W.flow T x₀ (s, q s) d w + |
| 107 | (1 / 2 : ℝ) * M08.timeWithinFDeriv C (extChartAt (𝓡 n) x₀).target |
| 108 | (M08.chartActionMetric W.flow T x₀) (s, q s) (v s) w = 0 := by |
| 109 | dsimp only [d] |
| 110 | rw [hd] |
| 111 | simp only [map_add, map_sub, map_neg, map_smul, add_apply, sub_apply, neg_apply, |
| 112 | smul_apply, smul_eq_mul] |
| 113 | rw [M08.chartMetricDualInverse_pair W.flow T x₀ (z := (s, q s)) (hmem hs)] |
| 114 | ring |
| 115 | change G.spacetime.horizontalMetric.inner (R.curve s) |
| 116 | (M14HorizontalCovariantDerivative G R.curve C P E s) Z + |
| 117 | 2 * s * horizontalRicci G.leafwise (R.curve s) (P s) Z = _ at hgeom |
| 118 | dsimp only [φ] at hgeom |
| 119 | change _ = G.spacetime.horizontalMetric.inner _ _ _ at hmetric |
| 120 | change M08.chartActionMetric W.flow T x₀ (s, q s) d w = _ at hmetric |
| 121 | change M08.timeWithinFDeriv C (extChartAt (𝓡 n) x₀).target |
| 122 | (M08.chartActionMetric W.flow T x₀) (s, q s) (v s) w = _ at htimePair |
| 123 | linarith |
| 124 | refine ⟨P, ⟨hac, hsub, hP, E, hpaired⟩, ?_⟩ |
| 125 | have hP₀ := hPcoord t₀ ht₀ |
| 126 | rw [hv₀'] at hP₀ |
| 127 | exact eq_of_heq (hP₀.trans hv₀.symm) |
| 128 | |
| 129 | end PoincareMT.M14 |