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.Gauge.SectionTransport.TimeBracket |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.Gauge.SliceGeometry |
| 3 | import PoincareLib.Geometry.Riemannian.Connection.Pullback |
| 4 | import PoincareLib.Geometry.Spacetime.Horizontal.Restriction |
| 5 | |
| 6 | /-! |
| 7 | # Section transport through a moving gauge |
| 8 | |
| 9 | The actual time velocity of a smooth gauge is a smooth tangent field. The |
| 10 | spatial slice local isometry then transports the retained Levi-Civita |
| 11 | connection, and the horizontal projection/time-vector identities identify the |
| 12 | remaining time term. |
| 13 | |
| 14 | Source: Morgan--Tian, Definition 1.4, pp. 5--7, and Definitions 3.34--3.38, |
| 15 | Remark 3.37, pp. 59--61. |
| 16 | -/ |
| 17 | |
| 18 | set_option autoImplicit false |
| 19 | set_option backward.isDefEq.respectTransparency false |
| 20 | |
| 21 | open Set Filter Bundle |
| 22 | open scoped Manifold ContDiff Bundle Topology |
| 23 | |
| 24 | universe u v |
| 25 | |
| 26 | namespace PoincareMT |
| 27 | |
| 28 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 29 | {I K : SpacetimeInterval} {F : GeneralizedFlowSpacetime n X time I} |
| 30 | {S : ∀ s : ℝ, SpacetimeSliceGeometry F s} |
| 31 | {T : SmoothSpacetimeInterval K} {C : Type v} [TopologicalSpace C] |
| 32 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) C] [IsManifold (𝓡 n) ∞ C] |
| 33 | {e : MovingSpacetimeGauge F T C} |
| 34 | |
| 35 | /-- The three section-transport fields in a moving-gauge calculus. -/ |
| 36 | structure MovingGaugeSectionTransportFields |
| 37 | (D : LeafwiseLeviCivitaFamily F S) |
| 38 | (G : MovingSpacetimeGaugeGeometry e) |
| 39 | (c : MetricLeviCivitaFamily G.metric) : Prop where |
| 40 | drift_smooth : ContMDiff (spacetimeModel n) |
| 41 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 42 | (fun p : T.Point × C ↦ Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) |
| 43 | (E := (TangentSpace (𝓡 n) : C → Type _)) p.2 (movingGaugeDrift G p.1 p.2)) |
| 44 | leafwise_derivative_eq : ∀ (V : HorizontalSection F) (O : Set F.Point), |
| 45 | IsOpen O → IsSmoothHorizontalSectionOn F V O → |
| 46 | ∀ (t : T.Point) (x : C), e.toSpacetime (t, x) ∈ O → |
| 47 | ∀ u : TangentSpace (𝓡 n) x, |
| 48 | rawLeafwiseCovariantDerivative D V (e.toSpacetime (t, x)) |
| 49 | (G.spatialTangentEquiv t x u) = |
| 50 | G.spatialTangentEquiv t x |
| 51 | ((c t.val).connection (pullbackHorizontalSection G V t) x u) |
| 52 | horizontal_derivative_eq : ∀ (V : HorizontalSection F) (O : Set F.Point), |
| 53 | IsOpen O → IsSmoothHorizontalSectionOn F V O → |
| 54 | ∀ (t : T.Point) (x : C), e.toSpacetime (t, x) ∈ O → |
| 55 | ∀ (a : ℝ) (u : TangentSpace (𝓡 n) x), |
| 56 | rawHorizontalCovariantDerivative D V (e.toSpacetime (t, x)) |
| 57 | (mfderiv (spacetimeModel n) (spacetimeModel n) e.toSpacetime (t, x) |
| 58 | (a • T.positiveTangent t, u)) = |
| 59 | G.spatialTangentEquiv t x |
| 60 | (a • movingGaugeSectionTimeDerivative G V t x + |
| 61 | (c t.val).connection (pullbackHorizontalSection G V t) x u - |
| 62 | a • (c t.val).connection (movingGaugeDrift G t) x |
| 63 | (pullbackHorizontalSection G V t x)) |
| 64 | |
| 65 | private theorem movingGauge_drift_smooth |
| 66 | (G : MovingSpacetimeGaugeGeometry e) : |
| 67 | ContMDiff (spacetimeModel n) |
| 68 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 69 | (fun p : T.Point × C ↦ Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) |
| 70 | (E := (TangentSpace (𝓡 n) : C → Type _)) p.2 (movingGaugeDrift G p.1 p.2)) := by |
| 71 | let : ChartedSpace (EuclideanHalfSpace 1) T.Point := T.chartedSpace |
| 72 | let : IsManifold (𝓡∂ 1) ∞ T.Point := T.isManifold |
| 73 | have hproj := (contMDiff_equivTangentBundleProd |
| 74 | (I := 𝓡∂ 1) (M := T.Point) (I' := 𝓡 n) (M' := C) (n := ∞)).snd |
| 75 | exact hproj.comp (movingGauge_liftedDrift_smooth e G) |
| 76 | |
| 77 | private theorem rawLeafwiseCovariantDerivative_eq_slice |
| 78 | (D : LeafwiseLeviCivitaFamily F S) (V : HorizontalSection F) |
| 79 | (p : F.Point) {s : ℝ} (hs : F.timeFunction p = s) (w : F.Horizontal p) : |
| 80 | rawLeafwiseCovariantDerivative D V p w = |
| 81 | (S s).tangentEquiv ⟨p, hs⟩ |
| 82 | ((D.sliceConnection s).connection (restrictHorizontalSection S s V) ⟨p, hs⟩ |
| 83 | (((S s).tangentEquiv ⟨p, hs⟩).symm w)) := by |
| 84 | subst s |
| 85 | rfl |
| 86 | |
| 87 | private theorem movingGauge_leafwise_derivative_eq |
| 88 | (D : LeafwiseLeviCivitaFamily F S) |
| 89 | (G : MovingSpacetimeGaugeGeometry e) |
| 90 | (c : MetricLeviCivitaFamily G.metric) |
| 91 | (V : HorizontalSection F) (O : Set F.Point) |
| 92 | (hO : IsOpen O) (hV : IsSmoothHorizontalSectionOn F V O) |
| 93 | (t : T.Point) (x : C) (hx : e.toSpacetime (t, x) ∈ O) |
| 94 | (u : TangentSpace (𝓡 n) x) : |
| 95 | rawLeafwiseCovariantDerivative D V (e.toSpacetime (t, x)) |
| 96 | (G.spatialTangentEquiv t x u) = |
| 97 | G.spatialTangentEquiv t x |
| 98 | ((c t.val).connection (pullbackHorizontalSection G V t) x u) := by |
| 99 | let f := movingGaugeSliceMap e S t |
| 100 | have hlocal := movingGaugeSliceMap_localDiffeomorph e S G t |
| 101 | have hinv (y : C) : (mfderiv (𝓡 n) (𝓡 n) f y).IsInvertible := by |
| 102 | change (mfderiv (𝓡 n) (𝓡 n) (movingGaugeSliceMap e S t) y).IsInvertible |
| 103 | rw [← hlocal.mfderivToContinuousLinearEquiv_coe (by simp) y] |
| 104 | exact ContinuousLinearMap.isInvertible_equiv |
| 105 | have hpull : VectorField.mpullback (𝓡 n) (𝓡 n) f |
| 106 | (restrictHorizontalSection S t.val V) = pullbackHorizontalSection G V t := by |
| 107 | funext y |
| 108 | apply (G.spatialTangentEquiv t y).injective |
| 109 | rw [← movingGaugeSliceMap_tangent_eq e S G t y] |
| 110 | change (S t.val).tangentEquiv (f y) |
| 111 | (mfderiv (𝓡 n) (𝓡 n) f y |
| 112 | ((mfderiv (𝓡 n) (𝓡 n) f y).inverse |
| 113 | (restrictHorizontalSection S t.val V (f y)))) = _ |
| 114 | rw [(hinv y).self_apply_inverse] |
| 115 | simp only [restrictHorizontalSection, pullbackHorizontalSection, |
| 116 | ContinuousLinearEquiv.apply_symm_apply] |
| 117 | rfl |
| 118 | have hmetric : ∀ᶠ y in 𝓝 x, ∀ a b : TangentSpace (𝓡 n) y, |
| 119 | (G.metric t.val).inner y a b = |
| 120 | (S t.val).metricOnPoints.inner (f y) |
| 121 | (mfderiv (𝓡 n) (𝓡 n) f y a) (mfderiv (𝓡 n) (𝓡 n) f y b) := by |
| 122 | exact Filter.Eventually.of_forall fun y a b => |
| 123 | ((movingGaugeSliceGeometryFields (S := S) e G).slice_metric_eq t y a b).symm |
| 124 | have hY := (S t.val).restrictHorizontalSection_differentiableAt V (f x) |
| 125 | ((hV.contMDiffAt (hO.mem_nhds hx)).mdifferentiableAt (by simp)) |
| 126 | have hconn := (c t.val).connection_mpullback_of_metric_pullback |
| 127 | (D.sliceConnection t.val) (hlocal.contMDiff x) |
| 128 | (Filter.Eventually.of_forall hinv) hmetric hY u |
| 129 | change (c t.val).connection |
| 130 | (VectorField.mpullback (𝓡 n) (𝓡 n) f (restrictHorizontalSection S t.val V)) x u = |
| 131 | (mfderiv (𝓡 n) (𝓡 n) f x).inverse |
| 132 | ((D.sliceConnection t.val).connection (restrictHorizontalSection S t.val V) (f x) |
| 133 | (mfderiv (𝓡 n) (𝓡 n) f x u)) at hconn |
| 134 | rw [hpull] at hconn |
| 135 | rw [rawLeafwiseCovariantDerivative_eq_slice D V _ (e.time_eq (t, x))] |
| 136 | rw [hconn, ← movingGaugeSliceMap_tangent_eq e S G t x] |
| 137 | change (S t.val).tangentEquiv (f x) |
| 138 | ((D.sliceConnection t.val).connection (restrictHorizontalSection S t.val V) (f x) |
| 139 | (((S t.val).tangentEquiv (f x)).symm |
| 140 | ((S t.val).tangentEquiv (f x) (mfderiv (𝓡 n) (𝓡 n) f x u)))) = _ |
| 141 | rw [ContinuousLinearEquiv.symm_apply_apply] |
| 142 | rw [← movingGaugeSliceMap_tangent_eq e S G t x] |
| 143 | exact congrArg ((S t.val).tangentEquiv (f x)) |
| 144 | ((hinv x).self_apply_inverse _).symm |
| 145 | |
| 146 | private theorem movingGauge_time_coefficient |
| 147 | (e : MovingSpacetimeGauge F T C) (t : T.Point) (x : C) |
| 148 | (a : ℝ) (u : TangentSpace (𝓡 n) x) : |
| 149 | (mfderiv (spacetimeModel n) 𝓘(ℝ) F.timeFunction (e.toSpacetime (t, x))) |
| 150 | (mfderiv (spacetimeModel n) (spacetimeModel n) e.toSpacetime (t, x) |
| 151 | (a • T.positiveTangent t, u)) = a := by |
| 152 | let : ChartedSpace (ModelProd (EuclideanHalfSpace 1) |
| 153 | (EuclideanSpace ℝ (Fin n))) F.Point := F.chartedSpace |
| 154 | let : IsManifold (spacetimeModel n) ∞ F.Point := F.isManifold |
| 155 | let : ChartedSpace (EuclideanHalfSpace 1) T.Point := T.chartedSpace |
| 156 | let : IsManifold (𝓡∂ 1) ∞ T.Point := T.isManifold |
| 157 | change (mfderiv (spacetimeModel n) 𝓘(ℝ) time (e.toSpacetime (t, x))) |
| 158 | (mfderiv (spacetimeModel n) (spacetimeModel n) e.toSpacetime (t, x) |
| 159 | (a • T.positiveTangent t, u)) = a |
| 160 | have hcomp := mfderiv_comp_apply (x := (t, x)) |
| 161 | (F.time_smooth.mdifferentiableAt (by simp)) |
| 162 | (e.smooth.mdifferentiableAt (by simp)) (a • T.positiveTangent t, u) |
| 163 | have heq : time ∘ e.toSpacetime = |
| 164 | (Subtype.val : T.Point → ℝ) ∘ Prod.fst := funext e.time_eq |
| 165 | rw [heq] at hcomp |
| 166 | rw [← hcomp, mfderiv_comp_apply (x := (t, x)) |
| 167 | (T.inclusion_smooth.mdifferentiableAt (by simp)) |
| 168 | (mdifferentiableAt_fst (I := 𝓡∂ 1) (I' := 𝓡 n))] |
| 169 | simp only [mfderiv_fst] |
| 170 | change (mfderiv (𝓡∂ 1) 𝓘(ℝ) (Subtype.val : T.Point → ℝ) t) |
| 171 | (a • T.positiveTangent t) = a |
| 172 | rw [map_smul] |
| 173 | rw [← T.inclusionDerivative_eq] |
| 174 | change a • ((T.inclusionDerivative t) ((T.inclusionDerivative t).symm 1)) = a |
| 175 | rw [ContinuousLinearEquiv.apply_symm_apply] |
| 176 | simp |
| 177 | |
| 178 | /-- Construct the exact three section-transport fields from the retained slice |
| 179 | and gauge connections, with local section regularity and included endpoints. -/ |
| 180 | theorem movingGaugeSectionTransportFields |
| 181 | (D : LeafwiseLeviCivitaFamily F S) |
| 182 | (e : MovingSpacetimeGauge F T C) |
| 183 | (G : MovingSpacetimeGaugeGeometry e) |
| 184 | (c : MetricLeviCivitaFamily G.metric) : |
| 185 | MovingGaugeSectionTransportFields D G c := by |
| 186 | refine ⟨movingGauge_drift_smooth G, |
| 187 | movingGauge_leafwise_derivative_eq D G c, ?_⟩ |
| 188 | intro V O hO hV t x hx a u |
| 189 | have hbracket := movingGauge_horizontalTimeBracket_eq e G c |
| 190 | (movingGauge_drift_smooth G) V O hO hV t x hx |
| 191 | change rawLeafwiseCovariantDerivative D V (e.toSpacetime (t, x)) |
| 192 | (F.horizontalProjection (e.toSpacetime (t, x)) |
| 193 | (mfderiv (spacetimeModel n) (spacetimeModel n) e.toSpacetime (t, x) |
| 194 | (a • T.positiveTangent t, u))) + |
| 195 | (show ℝ from mfderiv (spacetimeModel n) 𝓘(ℝ) F.timeFunction |
| 196 | (e.toSpacetime (t, x)) |
| 197 | (mfderiv (spacetimeModel n) (spacetimeModel n) e.toSpacetime (t, x) |
| 198 | (a • T.positiveTangent t, u))) • |
| 199 | horizontalTimeBracket F V (e.toSpacetime (t, x)) = _ |
| 200 | rw [movingGauge_projection_eq e G, movingGauge_time_coefficient e, |
| 201 | movingGauge_leafwise_derivative_eq D G c V O hO hV t x hx, hbracket] |
| 202 | rw [← map_smul, ← map_add] |
| 203 | apply (G.spatialTangentEquiv t x).congr_arg |
| 204 | rw [map_sub, map_smul, smul_sub, smul_add] |
| 205 | abel |
| 206 | |
| 207 | end PoincareMT |