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.Differential |
| 2 | import PoincareLib.Geometry.Manifold.VectorField.Product |
| 3 | import PoincareLib.Geometry.Spacetime.Horizontal.TimeBracket |
| 4 | |
| 5 | /-! Time brackets in moving gauges, including interval endpoints. -/ |
| 6 | |
| 7 | set_option autoImplicit false |
| 8 | set_option backward.isDefEq.respectTransparency false |
| 9 | |
| 10 | open scoped Manifold ContDiff Bundle Topology |
| 11 | open Set Filter Bundle |
| 12 | |
| 13 | universe u v |
| 14 | |
| 15 | namespace PoincareMT |
| 16 | |
| 17 | noncomputable section |
| 18 | |
| 19 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 20 | {I K : SpacetimeInterval} {F : GeneralizedFlowSpacetime n X time I} |
| 21 | {T : SmoothSpacetimeInterval K} {C : Type v} [TopologicalSpace C] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) C] [IsManifold (𝓡 n) ∞ C] |
| 23 | |
| 24 | theorem movingGauge_mfderiv_isInvertible (e : MovingSpacetimeGauge F T C) |
| 25 | (p : T.Point × C) : |
| 26 | (mfderiv (spacetimeModel n) (spacetimeModel n) e.toSpacetime p).IsInvertible := by |
| 27 | let L : SpacetimeModelVector n →L[ℝ] SpacetimeModelVector n := |
| 28 | mfderiv (spacetimeModel n) (spacetimeModel n) e.toSpacetime p |
| 29 | have hL : Function.Bijective L := |
| 30 | ⟨e.differential_injective p, |
| 31 | (LinearMap.injective_iff_surjective (f := L.toLinearMap)).mp |
| 32 | (e.differential_injective p)⟩ |
| 33 | exact ⟨ContinuousLinearEquiv.ofBijective L |
| 34 | (LinearMap.ker_eq_bot.mpr hL.1) (LinearMap.range_eq_top.mpr hL.2), rfl⟩ |
| 35 | |
| 36 | theorem movingGauge_mfderiv_spatial (e : MovingSpacetimeGauge F T C) |
| 37 | (G : MovingSpacetimeGaugeGeometry e) (t : T.Point) (x : C) |
| 38 | (v : TangentSpace (𝓡 n) x) : |
| 39 | mfderiv (spacetimeModel n) (spacetimeModel n) e.toSpacetime (t, x) (0, v) = |
| 40 | (G.spatialTangentEquiv t x v).val := by |
| 41 | let : NormedAddCommGroup (TangentSpace (𝓡∂ 1) t) := |
| 42 | inferInstanceAs (NormedAddCommGroup (EuclideanSpace ℝ (Fin 1))) |
| 43 | let : NormedSpace ℝ (TangentSpace (𝓡∂ 1) t) := |
| 44 | inferInstanceAs (NormedSpace ℝ (EuclideanSpace ℝ (Fin 1))) |
| 45 | let : NormedAddCommGroup (TangentSpace (𝓡 n) x) := |
| 46 | inferInstanceAs (NormedAddCommGroup (EuclideanSpace ℝ (Fin n))) |
| 47 | let : NormedSpace ℝ (TangentSpace (𝓡 n) x) := |
| 48 | inferInstanceAs (NormedSpace ℝ (EuclideanSpace ℝ (Fin n))) |
| 49 | let : NormedAddCommGroup |
| 50 | (TangentSpace (spacetimeModel n) (e.toSpacetime (t, x))) := |
| 51 | inferInstanceAs (NormedAddCommGroup (SpacetimeModelVector n)) |
| 52 | let : NormedSpace ℝ |
| 53 | (TangentSpace (spacetimeModel n) (e.toSpacetime (t, x))) := |
| 54 | inferInstanceAs (NormedSpace ℝ (SpacetimeModelVector n)) |
| 55 | have h := mfderiv_prod_eq_add_apply (p := (t, x)) |
| 56 | (e.smooth.mdifferentiableAt (by simp)) (v := (0, v)) |
| 57 | simpa only [map_zero, zero_add, G.spatialTangentEquiv_eq] using h |
| 58 | |
| 59 | theorem movingGauge_mpullback_timeVector (e : MovingSpacetimeGauge F T C) |
| 60 | (G : MovingSpacetimeGaugeGeometry e) : |
| 61 | VectorField.mpullback (spacetimeModel n) (spacetimeModel n) e.toSpacetime |
| 62 | (show (p : F.Point) → TangentSpace (spacetimeModel n) p from F.timeVector) = |
| 63 | fun p : T.Point × C => (T.positiveTangent p.1, movingGaugeDrift G p.1 p.2) := by |
| 64 | funext p |
| 65 | rw [VectorField.mpullback_apply, |
| 66 | ← movingGauge_time_vector_eq e G p.1 p.2] |
| 67 | exact (movingGauge_mfderiv_isInvertible e p).inverse_apply_self _ |
| 68 | |
| 69 | theorem movingGauge_mpullback_horizontalSection (e : MovingSpacetimeGauge F T C) |
| 70 | (G : MovingSpacetimeGaugeGeometry e) (V : HorizontalSection F) : |
| 71 | VectorField.mpullback (spacetimeModel n) (spacetimeModel n) e.toSpacetime |
| 72 | (horizontalSectionVectorField F V) = |
| 73 | fun p : T.Point × C => (0, pullbackHorizontalSection G V p.1 p.2) := by |
| 74 | funext p |
| 75 | have h := movingGauge_mfderiv_spatial e G p.1 p.2 |
| 76 | (pullbackHorizontalSection G V p.1 p.2) |
| 77 | simp only [pullbackHorizontalSection, ContinuousLinearEquiv.apply_symm_apply] at h |
| 78 | rw [VectorField.mpullback_apply] |
| 79 | change (mfderiv (spacetimeModel n) (spacetimeModel n) e.toSpacetime p).inverse |
| 80 | (V (e.toSpacetime p)).val = _ |
| 81 | rw [← h] |
| 82 | exact (movingGauge_mfderiv_isInvertible e p).inverse_apply_self _ |
| 83 | |
| 84 | theorem movingGauge_liftedDrift_smooth |
| 85 | (e : MovingSpacetimeGauge F T C) (G : MovingSpacetimeGaugeGeometry e) : |
| 86 | ContMDiff (spacetimeModel n) (spacetimeModel n).tangent ∞ |
| 87 | (fun p : T.Point × C => (⟨p, (T.positiveTangent p.1, movingGaugeDrift G p.1 p.2)⟩ : |
| 88 | TangentBundle (spacetimeModel n) (T.Point × C))) := by |
| 89 | let : ChartedSpace (ModelProd (EuclideanHalfSpace 1) |
| 90 | (EuclideanSpace ℝ (Fin n))) F.Point := F.chartedSpace |
| 91 | let : IsManifold (spacetimeModel n) ∞ F.Point := F.isManifold |
| 92 | let : ChartedSpace (EuclideanHalfSpace 1) T.Point := T.chartedSpace |
| 93 | let : IsManifold (𝓡∂ 1) ∞ T.Point := T.isManifold |
| 94 | have hs := F.timeVector_smooth.mpullback_vectorField e.smooth |
| 95 | (movingGauge_mfderiv_isInvertible e) (by simp) |
| 96 | simpa only [movingGauge_mpullback_timeVector e G] using hs |
| 97 | |
| 98 | theorem movingGauge_liftedSection_smoothAt |
| 99 | (e : MovingSpacetimeGauge F T C) (G : MovingSpacetimeGaugeGeometry e) |
| 100 | (V : HorizontalSection F) (O : Set F.Point) (hO : IsOpen O) |
| 101 | (hV : IsSmoothHorizontalSectionOn F V O) (p : T.Point × C) |
| 102 | (hp : e.toSpacetime p ∈ O) : |
| 103 | ContMDiffAt (spacetimeModel n) (spacetimeModel n).tangent ∞ |
| 104 | (fun q : T.Point × C => (⟨q, (0, pullbackHorizontalSection G V q.1 q.2)⟩ : |
| 105 | TangentBundle (spacetimeModel n) (T.Point × C))) p := by |
| 106 | let : ChartedSpace (ModelProd (EuclideanHalfSpace 1) |
| 107 | (EuclideanSpace ℝ (Fin n))) F.Point := F.chartedSpace |
| 108 | let : IsManifold (spacetimeModel n) ∞ F.Point := F.isManifold |
| 109 | let : ChartedSpace (EuclideanHalfSpace 1) T.Point := T.chartedSpace |
| 110 | let : IsManifold (𝓡∂ 1) ∞ T.Point := T.isManifold |
| 111 | have hs := (hV.contMDiffOn_vectorField.contMDiffAt (hO.mem_nhds hp)).mpullback_vectorField_preimage |
| 112 | (e.smooth p) (movingGauge_mfderiv_isInvertible e p) (by simp) |
| 113 | simpa only [movingGauge_mpullback_horizontalSection e G V] using hs |
| 114 | |
| 115 | theorem movingGauge_pullbackHorizontalSection_smoothAt |
| 116 | (e : MovingSpacetimeGauge F T C) (G : MovingSpacetimeGaugeGeometry e) |
| 117 | (V : HorizontalSection F) (O : Set F.Point) (hO : IsOpen O) |
| 118 | (hV : IsSmoothHorizontalSectionOn F V O) (p : T.Point × C) |
| 119 | (hp : e.toSpacetime p ∈ O) : |
| 120 | ContMDiffAt (spacetimeModel n) |
| 121 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 122 | (fun q : T.Point × C => Bundle.TotalSpace.mk' |
| 123 | (EuclideanSpace ℝ (Fin n)) q.2 (pullbackHorizontalSection G V q.1 q.2)) p := by |
| 124 | let : ChartedSpace (ModelProd (EuclideanHalfSpace 1) |
| 125 | (EuclideanSpace ℝ (Fin n))) F.Point := F.chartedSpace |
| 126 | let : IsManifold (spacetimeModel n) ∞ F.Point := F.isManifold |
| 127 | let : ChartedSpace (EuclideanHalfSpace 1) T.Point := T.chartedSpace |
| 128 | let : IsManifold (𝓡∂ 1) ∞ T.Point := T.isManifold |
| 129 | have hs := movingGauge_liftedSection_smoothAt e G V O hO hV p hp |
| 130 | have hproj := (contMDiff_equivTangentBundleProd |
| 131 | (I := 𝓡∂ 1) (M := T.Point) (I' := 𝓡 n) (M' := C) (n := ∞)).snd |
| 132 | exact (hproj.contMDiffAt.comp p hs) |
| 133 | |
| 134 | theorem movingGauge_horizontalTimeBracket_pullback |
| 135 | (e : MovingSpacetimeGauge F T C) (G : MovingSpacetimeGaugeGeometry e) |
| 136 | (V : HorizontalSection F) (O : Set F.Point) (hO : IsOpen O) |
| 137 | (hV : IsSmoothHorizontalSectionOn F V O) (t : T.Point) (x : C) |
| 138 | (hp : e.toSpacetime (t, x) ∈ O) : |
| 139 | (0, (G.spatialTangentEquiv t x).symm |
| 140 | (horizontalTimeBracket F V (e.toSpacetime (t, x)))) = |
| 141 | VectorField.mlieBracket (spacetimeModel n) |
| 142 | (fun p : T.Point × C => (T.positiveTangent p.1, movingGaugeDrift G p.1 p.2)) |
| 143 | (fun p : T.Point × C => (0, pullbackHorizontalSection G V p.1 p.2)) (t, x) := by |
| 144 | let : ChartedSpace (ModelProd (EuclideanHalfSpace 1) |
| 145 | (EuclideanSpace ℝ (Fin n))) F.Point := F.chartedSpace |
| 146 | let : IsManifold (spacetimeModel n) ∞ F.Point := F.isManifold |
| 147 | let : ChartedSpace (EuclideanHalfSpace 1) T.Point := T.chartedSpace |
| 148 | let : IsManifold (𝓡∂ 1) ∞ T.Point := T.isManifold |
| 149 | let : IsManifold (spacetimeModel n) (minSmoothness ℝ 2) (T.Point × C) := by |
| 150 | simp only [minSmoothness_of_isRCLikeNormedField, spacetimeModel] |
| 151 | infer_instance |
| 152 | let : IsManifold (spacetimeModel n) (minSmoothness ℝ 2) F.Point := by |
| 153 | simp only [minSmoothness_of_isRCLikeNormedField] |
| 154 | infer_instance |
| 155 | have hb := VectorField.mpullback_mlieBracket |
| 156 | ((F.timeVector_smooth (e.toSpacetime (t, x))).mdifferentiableAt (by simp)) |
| 157 | ((hV.contMDiffOn_vectorField.contMDiffAt (hO.mem_nhds hp)).mdifferentiableAt (by simp)) |
| 158 | (e.smooth (t, x)) (by simp only [minSmoothness_of_isRCLikeNormedField]; exact WithTop.coe_le_coe.mpr le_top) |
| 159 | rw [movingGauge_mpullback_timeVector e G, |
| 160 | movingGauge_mpullback_horizontalSection e G V] at hb |
| 161 | rw [VectorField.mpullback_apply, ← horizontalTimeBracket_val hO hV hp] at hb |
| 162 | have hs := movingGauge_mfderiv_spatial e G t x |
| 163 | ((G.spatialTangentEquiv t x).symm (horizontalTimeBracket F V (e.toSpacetime (t, x)))) |
| 164 | simp only [ContinuousLinearEquiv.apply_symm_apply] at hs |
| 165 | rw [← hs] at hb |
| 166 | simpa only [ContinuousLinearEquiv.apply_symm_apply, |
| 167 | (movingGauge_mfderiv_isInvertible e (t, x)).inverse_apply_self] using hb |
| 168 | |
| 169 | theorem movingGauge_drift_bracket_eq |
| 170 | (e : MovingSpacetimeGauge F T C) (G : MovingSpacetimeGaugeGeometry e) |
| 171 | (c : MetricLeviCivitaFamily G.metric) |
| 172 | (hW : ContMDiff (spacetimeModel n) |
| 173 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 174 | (fun q : T.Point × C => Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) |
| 175 | q.2 (movingGaugeDrift G q.1 q.2))) |
| 176 | (V : HorizontalSection F) (O : Set F.Point) (hO : IsOpen O) |
| 177 | (hV : IsSmoothHorizontalSectionOn F V O) (t : T.Point) (x : C) |
| 178 | (hp : e.toSpacetime (t, x) ∈ O) : |
| 179 | VectorField.mlieBracket (𝓡 n) (movingGaugeDrift G t) |
| 180 | (pullbackHorizontalSection G V t) x = |
| 181 | (c t.val).connection (pullbackHorizontalSection G V t) x (movingGaugeDrift G t x) - |
| 182 | (c t.val).connection (movingGaugeDrift G t) x (pullbackHorizontalSection G V t x) := by |
| 183 | let : ChartedSpace (EuclideanHalfSpace 1) T.Point := T.chartedSpace |
| 184 | let : IsManifold (𝓡∂ 1) ∞ T.Point := T.isManifold |
| 185 | apply ((c t.val).connection.torsion_eq_zero_iff.mp (c t.val).torsion_eq_zero _ _).symm |
| 186 | · exact ((hW (t, x)).comp x (contMDiffAt_const.prodMk contMDiffAt_id)).mdifferentiableAt |
| 187 | (by simp) |
| 188 | · exact ((movingGauge_pullbackHorizontalSection_smoothAt e G V O hO hV (t, x) hp).comp x |
| 189 | (contMDiffAt_const.prodMk contMDiffAt_id)).mdifferentiableAt (by simp) |
| 190 | |
| 191 | theorem movingGaugeSectionTimeDerivative_eq_model |
| 192 | (e : MovingSpacetimeGauge F T C) (G : MovingSpacetimeGaugeGeometry e) |
| 193 | (V : HorizontalSection F) (O : Set F.Point) (hO : IsOpen O) |
| 194 | (hV : IsSmoothHorizontalSectionOn F V O) (t : T.Point) (x : C) |
| 195 | (hp : e.toSpacetime (t, x) ∈ O) : |
| 196 | movingGaugeSectionTimeDerivative G V t x = |
| 197 | mfderiv (𝓡∂ 1) (𝓡 n) |
| 198 | (fun s : T.Point => (show EuclideanSpace ℝ (Fin n) from pullbackHorizontalSection G V s x)) |
| 199 | t (T.positiveTangent t) := by |
| 200 | let : ChartedSpace (EuclideanHalfSpace 1) T.Point := T.chartedSpace |
| 201 | let : IsManifold (𝓡∂ 1) ∞ T.Point := T.isManifold |
| 202 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : C → Type _) := |
| 203 | ⟨(G.metric t.val).toRiemannianMetric⟩ |
| 204 | let L : TangentSpace (𝓡 n) x ≃L[ℝ] EuclideanSpace ℝ (Fin n) := |
| 205 | (trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) x).continuousLinearEquivAt |
| 206 | ℝ x (mem_baseSet_trivializationAt _ _ x) |
| 207 | have hL (w : TangentSpace (𝓡 n) x) : L w = (show EuclideanSpace ℝ (Fin n) from w) := by |
| 208 | dsimp only [L] |
| 209 | rw [Trivialization.coe_continuousLinearEquivAt_eq, |
| 210 | TangentBundle.continuousLinearMapAt_trivializationAt (mem_chart_source _ x), |
| 211 | mfderiv_extChartAt_self] |
| 212 | rfl |
| 213 | have hLsymm (w : EuclideanSpace ℝ (Fin n)) : L.symm w = (show TangentSpace (𝓡 n) x from w) := by |
| 214 | simpa only [ContinuousLinearEquiv.apply_symm_apply] using (hL (L.symm w)).symm |
| 215 | have hs := (movingGauge_pullbackHorizontalSection_smoothAt e G V O hO hV (t, x) hp).comp t |
| 216 | (contMDiffAt_id.prodMk contMDiffAt_const) |
| 217 | have hraw : ContMDiffAt (𝓡∂ 1) (𝓡 n) ∞ |
| 218 | (fun s : T.Point => (show EuclideanSpace ℝ (Fin n) from pullbackHorizontalSection G V s x)) t := by |
| 219 | have hc := (Bundle.contMDiffAt_totalSpace.mp hs).2 |
| 220 | change ContMDiffAt (𝓡∂ 1) (𝓡 n) ∞ |
| 221 | (fun s : T.Point => L (pullbackHorizontalSection G V s x)) t at hc |
| 222 | simpa only [hL] using hc |
| 223 | have hcomp := mfderiv_comp_apply (x := t) |
| 224 | L.symm.differentiableAt.mdifferentiableAt |
| 225 | (hraw.mdifferentiableAt (by simp)) (T.positiveTangent t) |
| 226 | have hfun : L.symm ∘ |
| 227 | (fun s : T.Point => (show EuclideanSpace ℝ (Fin n) from pullbackHorizontalSection G V s x)) = |
| 228 | (fun s : T.Point => pullbackHorizontalSection G V s x) := by |
| 229 | funext s |
| 230 | exact hLsymm _ |
| 231 | rw [hfun, mfderiv_eq_fderiv, L.symm.fderiv] at hcomp |
| 232 | change mfderiv (𝓡∂ 1) 𝓘(ℝ, TangentSpace (𝓡 n) x) |
| 233 | (fun s : T.Point => pullbackHorizontalSection G V s x) t (T.positiveTangent t) = |
| 234 | L.symm (mfderiv (𝓡∂ 1) (𝓡 n) |
| 235 | (fun s : T.Point => (show EuclideanSpace ℝ (Fin n) from pullbackHorizontalSection G V s x)) |
| 236 | t (T.positiveTangent t)) at hcomp |
| 237 | rw [hLsymm] at hcomp |
| 238 | exact hcomp |
| 239 | |
| 240 | theorem movingGauge_horizontalTimeBracket_eq |
| 241 | (e : MovingSpacetimeGauge F T C) (G : MovingSpacetimeGaugeGeometry e) |
| 242 | (c : MetricLeviCivitaFamily G.metric) |
| 243 | (hW : ContMDiff (spacetimeModel n) |
| 244 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 245 | (fun q : T.Point × C => Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) |
| 246 | q.2 (movingGaugeDrift G q.1 q.2))) |
| 247 | (V : HorizontalSection F) (O : Set F.Point) (hO : IsOpen O) |
| 248 | (hV : IsSmoothHorizontalSectionOn F V O) (t : T.Point) (x : C) |
| 249 | (hp : e.toSpacetime (t, x) ∈ O) : |
| 250 | horizontalTimeBracket F V (e.toSpacetime (t, x)) = |
| 251 | G.spatialTangentEquiv t x |
| 252 | (movingGaugeSectionTimeDerivative G V t x + |
| 253 | (c t.val).connection (pullbackHorizontalSection G V t) x (movingGaugeDrift G t x) - |
| 254 | (c t.val).connection (movingGaugeDrift G t) x (pullbackHorizontalSection G V t x)) := by |
| 255 | let : ChartedSpace (EuclideanHalfSpace 1) T.Point := T.chartedSpace |
| 256 | let : IsManifold (𝓡∂ 1) ∞ T.Point := T.isManifold |
| 257 | have hb := congrArg Prod.snd (movingGauge_horizontalTimeBracket_pullback e G V O hO hV t x hp) |
| 258 | have hs := Poincare.Manifold.VectorField.mlieBracket_prod_snd T.positiveTangent (movingGaugeDrift G) |
| 259 | (pullbackHorizontalSection G V) (t, x) |
| 260 | (movingGauge_liftedDrift_smooth e G (t, x)) |
| 261 | (movingGauge_liftedSection_smoothAt e G V O hO hV (t, x) hp) |
| 262 | apply (G.spatialTangentEquiv t x).symm.injective |
| 263 | rw [ContinuousLinearEquiv.symm_apply_apply] |
| 264 | have h := hb.trans hs |
| 265 | rw [← movingGaugeSectionTimeDerivative_eq_model e G V O hO hV t x hp, |
| 266 | movingGauge_drift_bracket_eq e G c hW V O hO hV t x hp] at h |
| 267 | simpa only [add_sub_assoc] using h |
| 268 | |
| 269 | end |
| 270 | |
| 271 | end PoincareMT |