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.Pullback.SpatialDifferential |
| 2 | import PoincareLib.Geometry.Riemannian.Connection.MetricDuality |
| 3 | |
| 4 | /-! |
| 5 | # Spatial pullback metrics of moving gauges |
| 6 | |
| 7 | The horizontal metric pulls back through the actual spatial differential to |
| 8 | a smooth positive metric at each time in the gauge interval. |
| 9 | |
| 10 | Source: Morgan-Tian, Definitions 3.34-3.38, pp. 59-61. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open scoped Manifold ContDiff Bundle Topology |
| 17 | open Bundle Set Filter |
| 18 | |
| 19 | universe u v |
| 20 | |
| 21 | namespace PoincareMT.MovingSpacetimeGauge |
| 22 | |
| 23 | noncomputable section |
| 24 | |
| 25 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 26 | {I K : SpacetimeInterval} {F : GeneralizedFlowSpacetime n X time I} |
| 27 | {T : SmoothSpacetimeInterval K} {C : Type v} [TopologicalSpace C] |
| 28 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) C] [IsManifold (𝓡 n) ∞ C] |
| 29 | |
| 30 | def spatialMetricForm (e : MovingSpacetimeGauge F T C) (t : T.Point) (x : C) : |
| 31 | TangentSpace (𝓡 n) x →L[ℝ] TangentSpace (𝓡 n) x →L[ℝ] ℝ := by |
| 32 | letI : NormedAddCommGroup (TangentSpace (𝓡 n) x) := |
| 33 | inferInstanceAs (NormedAddCommGroup (EuclideanSpace ℝ (Fin n))) |
| 34 | letI : NormedSpace ℝ (TangentSpace (𝓡 n) x) := |
| 35 | inferInstanceAs (NormedSpace ℝ (EuclideanSpace ℝ (Fin n))) |
| 36 | letI : NormedAddCommGroup (TangentSpace (spacetimeModel n) (e.toSpacetime (t, x))) := |
| 37 | inferInstanceAs (NormedAddCommGroup (SpacetimeModelVector n)) |
| 38 | letI : NormedSpace ℝ (TangentSpace (spacetimeModel n) (e.toSpacetime (t, x))) := |
| 39 | inferInstanceAs (NormedSpace ℝ (SpacetimeModelVector n)) |
| 40 | letI : NormedAddCommGroup (F.Horizontal (e.toSpacetime (t, x))) := |
| 41 | Submodule.normedAddCommGroup _ |
| 42 | letI : NormedSpace ℝ (F.Horizontal (e.toSpacetime (t, x))) := |
| 43 | Submodule.normedSpace _ |
| 44 | exact (F.horizontalMetric.inner (e.toSpacetime (t, x))).bilinearComp |
| 45 | (e.spatialDifferential t x) (e.spatialDifferential t x) |
| 46 | |
| 47 | theorem spatialDifferential_apply_smoothAt (e : MovingSpacetimeGauge F T C) |
| 48 | (t : T.Point) {V : (x : C) → TangentSpace (𝓡 n) x} {x : C} |
| 49 | (hV : ContMDiffAt (𝓡 n) ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 50 | (fun y => TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) y (V y)) x) : |
| 51 | ContMDiffAt (𝓡 n) ((spacetimeModel n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 52 | (fun y => TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (E := F.Horizontal) |
| 53 | (e.toSpacetime (t, y)) (e.spatialDifferential t y (V y))) x := by |
| 54 | have he : ContMDiff (𝓡 n) (spacetimeModel n) ∞ |
| 55 | (fun y => e.toSpacetime (t, y)) := |
| 56 | e.smooth.comp (contMDiff_const.prodMk contMDiff_id) |
| 57 | have hd : ContMDiffAt (𝓡 n) |
| 58 | ((spacetimeModel n).prod 𝓘(ℝ, SpacetimeModelVector n)) ∞ |
| 59 | (fun y => TotalSpace.mk' (SpacetimeModelVector n) |
| 60 | (E := (TangentSpace (spacetimeModel n) : F.Point → Type _)) |
| 61 | (e.toSpacetime (t, y)) |
| 62 | (mfderiv (𝓡 n) (spacetimeModel n) (fun z => e.toSpacetime (t, z)) y (V y))) x := |
| 63 | ((he x).mfderiv_const (m := ∞) (by simp)).clm_apply_of_inCoordinates |
| 64 | (b₁ := id) (b₂ := fun y : C => e.toSpacetime (t, y)) hV (he x) |
| 65 | have hp : ContMDiff |
| 66 | ((spacetimeModel n).prod 𝓘(ℝ, SpacetimeModelVector n)) |
| 67 | ((spacetimeModel n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 68 | (fun w : TangentBundle (spacetimeModel n) F.Point => |
| 69 | TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (E := F.Horizontal) w.proj |
| 70 | (F.horizontalProjection w.proj w.2)) := F.horizontalProjection_smooth |
| 71 | apply ((hp _).comp x hd).congr_of_eventuallyEq |
| 72 | exact Eventually.of_forall fun y => rfl |
| 73 | |
| 74 | theorem spatialMetricForm_smooth (e : MovingSpacetimeGauge F T C) (t : T.Point) : |
| 75 | ContMDiff (𝓡 n) ((𝓡 n).prod 𝓘(ℝ, |
| 76 | EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ)) ∞ |
| 77 | (fun x => TotalSpace.mk' |
| 78 | (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) |
| 79 | x (e.spatialMetricForm t x)) := by |
| 80 | intro x |
| 81 | rw [contMDiffAt_hom_bundle] |
| 82 | refine ⟨contMDiffAt_id, ?_⟩ |
| 83 | apply contMDiffAt_clm_of_apply |
| 84 | intro v |
| 85 | apply contMDiffAt_clm_of_apply |
| 86 | intro w |
| 87 | let E := EuclideanSpace ℝ (Fin n) |
| 88 | let a := trivializationAt E (TangentSpace (𝓡 n) : C → Type _) x |
| 89 | have hx : x ∈ a.baseSet := FiberBundle.mem_baseSet_trivializationAt _ _ _ |
| 90 | have hfield (z : E) : ContMDiffAt (𝓡 n) ((𝓡 n).prod 𝓘(ℝ, E)) ∞ |
| 91 | (fun y : C => TotalSpace.mk' E y (a.symmL ℝ y z)) x := by |
| 92 | have hc : ContMDiffAt (𝓡 n) ((𝓡 n).prod 𝓘(ℝ, E)) ∞ |
| 93 | (fun y : C => TotalSpace.mk' E (E := Bundle.Trivial C E) y z) x := by |
| 94 | rw [contMDiffAt_totalSpace] |
| 95 | exact ⟨contMDiffAt_id, by simpa using contMDiffAt_const (c := z)⟩ |
| 96 | exact (a.contMDiffAt_symmL (IB := 𝓡 n) (n := ∞) hx).clm_bundle_apply hc |
| 97 | have he : ContMDiff (𝓡 n) (spacetimeModel n) ∞ |
| 98 | (fun y => e.toSpacetime (t, y)) := |
| 99 | e.smooth.comp (contMDiff_const.prodMk contMDiff_id) |
| 100 | have h := ((F.horizontalMetric.contMDiff _).comp x (he x)).clm_bundle_apply₂ |
| 101 | (F₃ := ℝ) (E₃ := Bundle.Trivial F.Point ℝ) |
| 102 | (e.spatialDifferential_apply_smoothAt t (hfield v)) |
| 103 | (e.spatialDifferential_apply_smoothAt t (hfield w)) |
| 104 | have hh := (contMDiffAt_totalSpace.mp h).2 |
| 105 | apply hh.congr_of_eventuallyEq |
| 106 | filter_upwards [a.open_baseSet.mem_nhds hx] with y hy |
| 107 | rw [inCoordinates_apply_eq₂ (E₃ := Bundle.Trivial C ℝ) hy hy (by simp)] |
| 108 | simp only [Bundle.Trivial.eq_trivialization, Bundle.Trivial.linearMapAt_trivialization, |
| 109 | LinearMap.id_coe, id_eq, spatialMetricForm, ContinuousLinearMap.bilinearComp_apply] |
| 110 | change F.horizontalMetric.inner _ (e.spatialDifferential t y (a.symm y v)) |
| 111 | (e.spatialDifferential t y (a.symm y w)) = |
| 112 | F.horizontalMetric.inner _ (e.spatialDifferential t y (a.symmL ℝ y v)) |
| 113 | (e.spatialDifferential t y (a.symmL ℝ y w)) |
| 114 | rw [a.symmL_apply hy, a.symmL_apply hy] |
| 115 | |
| 116 | def spatialMetric (e : MovingSpacetimeGauge F T C) (t : T.Point) : |
| 117 | RiemannianMetric n C where |
| 118 | inner := e.spatialMetricForm t |
| 119 | symm x v w := F.horizontalMetric.symm _ _ _ |
| 120 | pos x v hv := F.horizontalMetric.pos _ _ (fun h => |
| 121 | hv (e.spatialDifferential_injective t x (h.trans (map_zero _).symm))) |
| 122 | isVonNBounded x := by |
| 123 | have h := (F.horizontalMetric.isVonNBounded (e.toSpacetime (t, x))).image |
| 124 | (e.spatialTangentEquiv t x).symm.toContinuousLinearMap |
| 125 | apply h.subset |
| 126 | intro v hv |
| 127 | exact ⟨e.spatialTangentEquiv t x v, hv, |
| 128 | (e.spatialTangentEquiv t x).symm_apply_apply v⟩ |
| 129 | contMDiff := e.spatialMetricForm_smooth t |
| 130 | |
| 131 | theorem spatialMetric_inner (e : MovingSpacetimeGauge F T C) (t : T.Point) |
| 132 | (x : C) (v w : TangentSpace (𝓡 n) x) : |
| 133 | (e.spatialMetric t).inner x v w = |
| 134 | F.horizontalMetric.inner (e.toSpacetime (t, x)) |
| 135 | (e.spatialTangentEquiv t x v) (e.spatialTangentEquiv t x w) := rfl |
| 136 | |
| 137 | end |
| 138 | |
| 139 | end PoincareMT.MovingSpacetimeGauge |