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.Limit.CoordinateTime |
| 2 | import PoincareLib.Analysis.Calculus.SpatialJets |
| 3 | import Mathlib.Topology.UniformSpace.UniformConvergence |
| 4 | |
| 5 | /-! |
| 6 | # Spatial and time derivatives from scalar spacetime metric jets |
| 7 | |
| 8 | Joint smoothness of the actual metric family makes the chart coefficients |
| 9 | smooth. Restriction of their spacetime derivatives to spatial and time |
| 10 | directions supplies the hypotheses for the Ricci-flow limit equation. |
| 11 | |
| 12 | Reference: Morgan--Tian, Proposition 5.14, pp. 90--91. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open scoped Manifold ContDiff Bundle Topology |
| 19 | open Set Filter Bundle |
| 20 | |
| 21 | namespace PoincareMT.RiemannianMetric |
| 22 | |
| 23 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 25 | |
| 26 | private theorem contDiffAt_family_pullback_inner |
| 27 | {J : Set ℝ} {g : ℝ → RiemannianMetric n M} |
| 28 | (hg : IsSmoothFamilyOn g J) |
| 29 | {f : ℝ × EuclideanSpace ℝ (Fin n) → M} |
| 30 | {p : ℝ × EuclideanSpace ℝ (Fin n)} (hJ : J ∈ 𝓝 p.1) |
| 31 | (hf : ContMDiffAt 𝓘(ℝ, ℝ × EuclideanSpace ℝ (Fin n)) (𝓡 n) ∞ f p) |
| 32 | (v w : ℝ × EuclideanSpace ℝ (Fin n)) : |
| 33 | ContDiffAt ℝ ∞ (fun z => (g z.1).inner (f z) |
| 34 | (mfderiv 𝓘(ℝ, ℝ × EuclideanSpace ℝ (Fin n)) (𝓡 n) f z v) |
| 35 | (mfderiv 𝓘(ℝ, ℝ × EuclideanSpace ℝ (Fin n)) (𝓡 n) f z w)) p := by |
| 36 | have hdom : J ×ˢ (univ : Set M) ∈ 𝓝 (p.1, f p) := |
| 37 | prod_mem_nhds hJ Filter.univ_mem |
| 38 | have hfst : ContMDiffAt 𝓘(ℝ, ℝ × EuclideanSpace ℝ (Fin n)) 𝓘(ℝ, ℝ) ∞ |
| 39 | (fun z : ℝ × EuclideanSpace ℝ (Fin n) => z.1) p := |
| 40 | contDiffAt_fst.contMDiffAt |
| 41 | have hmetric := (hg.contMDiffAt hdom).comp p (hfst.prodMk hf) |
| 42 | have h := hmetric.clm_bundle_apply₂ (F₃ := ℝ) (E₃ := Bundle.Trivial M ℝ) |
| 43 | (contMDiffAt_mfderiv_const_vector hf v) (contMDiffAt_mfderiv_const_vector hf w) |
| 44 | have hh := (Bundle.contMDiffAt_totalSpace.mp h).2 |
| 45 | simp at hh |
| 46 | convert! contMDiffAt_iff_contDiffAt.mp hh using 1 |
| 47 | |
| 48 | /-- Actual scalar chart coefficients of a smooth metric family are jointly |
| 49 | smooth on the open spacetime chart domain. -/ |
| 50 | theorem IsSmoothFamilyOn.contDiffAt_spacetime_chart_coefficient |
| 51 | {J : Set ℝ} {g : ℝ → RiemannianMetric n M} |
| 52 | (hg : IsSmoothFamilyOn g J) (hJ : IsOpen J) (q : M) |
| 53 | {p : ℝ × EuclideanSpace ℝ (Fin n)} (ht : p.1 ∈ J) |
| 54 | (hp : p.2 ∈ (extChartAt (𝓡 n) q).target) (a b : Fin n) : |
| 55 | ContDiffAt ℝ ∞ (fun z : ℝ × EuclideanSpace ℝ (Fin n) => |
| 56 | (g z.1).pullbackCoefficients (extChartAt (𝓡 n) q).symm z.2 |
| 57 | (EuclideanSpace.basisFun (Fin n) ℝ a) |
| 58 | (EuclideanSpace.basisFun (Fin n) ℝ b)) p := by |
| 59 | let c := extChartAt (𝓡 n) q |
| 60 | let f : ℝ × EuclideanSpace ℝ (Fin n) → M := fun z => c.symm z.2 |
| 61 | have hf {z : ℝ × EuclideanSpace ℝ (Fin n)} (hz : z.2 ∈ c.target) : |
| 62 | ContMDiffAt 𝓘(ℝ, ℝ × EuclideanSpace ℝ (Fin n)) (𝓡 n) ∞ f z := by |
| 63 | have hc := (contMDiffWithinAt_extChartAt_symm_target (n := ∞) q hz).contMDiffAt |
| 64 | (extChartAt_target_mem_nhds' hz) |
| 65 | exact hc.comp z contDiffAt_snd.contMDiffAt |
| 66 | apply (contDiffAt_family_pullback_inner hg (hJ.mem_nhds ht) |
| 67 | (hf hp) (0, EuclideanSpace.basisFun (Fin n) ℝ a) |
| 68 | (0, EuclideanSpace.basisFun (Fin n) ℝ b)).congr_of_eventuallyEq |
| 69 | filter_upwards [continuousAt_snd.preimage_mem_nhds (extChartAt_target_mem_nhds' hp)] |
| 70 | with z hz |
| 71 | have ha := mfderiv_slice_apply ((hf hz).mdifferentiableAt (by simp)) |
| 72 | (EuclideanSpace.basisFun (Fin n) ℝ a) |
| 73 | have hb := mfderiv_slice_apply ((hf hz).mdifferentiableAt (by simp)) |
| 74 | (EuclideanSpace.basisFun (Fin n) ℝ b) |
| 75 | rw [← ha, ← hb] |
| 76 | rfl |
| 77 | |
| 78 | private theorem tendsto_spatial_slice_jet |
| 79 | {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 80 | {α : Type*} {l : Filter α} {fseq : α → ℝ × E → ℝ} {f : ℝ × E → ℝ} |
| 81 | {t : ℝ} {x : E} (hseq : ∀ k, ContDiffAt ℝ ∞ (fseq k) (t, x)) |
| 82 | (hf : ContDiffAt ℝ ∞ f (t, x)) (r : ℕ) |
| 83 | (h : Tendsto (fun k => iteratedFDeriv ℝ r (fseq k) (t, x)) l |
| 84 | (𝓝 (iteratedFDeriv ℝ r f (t, x)))) : |
| 85 | Tendsto (fun k => iteratedFDeriv ℝ r (fun y => fseq k (t, y)) x) l |
| 86 | (𝓝 (iteratedFDeriv ℝ r (fun y => f (t, y)) x)) := by |
| 87 | let P := ContinuousMultilinearMap.compContinuousLinearMapL |
| 88 | (𝕜 := ℝ) (F := ℝ) (fun _ : Fin r => ContinuousLinearMap.inr ℝ ℝ E) |
| 89 | have hs (F : ℝ × E → ℝ) (hF : ContDiffAt ℝ ∞ F (t, x)) : |
| 90 | iteratedFDeriv ℝ r (fun y => F (t, y)) x = P (iteratedFDeriv ℝ r F (t, x)) := by |
| 91 | ext v |
| 92 | exact Poincare.Analysis.iteratedFDeriv_spatial_slice F hF r v |
| 93 | simpa only [hs _ hf, hs _ (hseq _), Function.comp_def] using |
| 94 | P.continuous.continuousAt.tendsto.comp h |
| 95 | |
| 96 | private theorem deriv_time_slice_eq |
| 97 | {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 98 | {f : ℝ × E → ℝ} {t : ℝ} {x : E} |
| 99 | (hf : ContDiffAt ℝ ∞ f (t, x)) : |
| 100 | deriv (fun s => f (s, x)) t = |
| 101 | iteratedFDeriv ℝ 1 f (t, x) (fun _ => (1, 0)) := by |
| 102 | have hs : HasDerivAt (fun s : ℝ => (s, x)) (1, 0) t := |
| 103 | (hasDerivAt_id t).prodMk (hasDerivAt_const t x) |
| 104 | simpa only [Function.comp_def, iteratedFDeriv_one_apply] using |
| 105 | ((hf.differentiableAt (by simp)).hasFDerivAt.comp_hasDerivAt t hs).deriv |
| 106 | |
| 107 | /-- Pointwise full spacetime scalar jets supply both spatial jets and the |
| 108 | actual time derivatives of the scalar coordinate coefficients. -/ |
| 109 | theorem spatial_and_time_jets_of_spacetime_jets |
| 110 | {α : Type*} {l : Filter α} {J : Set ℝ} |
| 111 | (gseq : α → ℝ → RiemannianMetric n M) (g : ℝ → RiemannianMetric n M) |
| 112 | (hseq : ∀ k, IsSmoothFamilyOn (gseq k) J) (hg : IsSmoothFamilyOn g J) |
| 113 | (hJ : IsOpen J) {t : ℝ} (ht : t ∈ J) (x : M) |
| 114 | (h : ∀ r : ℕ, r ≤ 2 → ∀ a b : Fin n, |
| 115 | Tendsto (fun k => iteratedFDeriv ℝ r |
| 116 | (fun z : ℝ × EuclideanSpace ℝ (Fin n) => |
| 117 | (gseq k z.1).pullbackCoefficients (extChartAt (𝓡 n) x).symm z.2 |
| 118 | (EuclideanSpace.basisFun (Fin n) ℝ a) |
| 119 | (EuclideanSpace.basisFun (Fin n) ℝ b)) (t, extChartAt (𝓡 n) x x)) l |
| 120 | (𝓝 (iteratedFDeriv ℝ r |
| 121 | (fun z : ℝ × EuclideanSpace ℝ (Fin n) => |
| 122 | (g z.1).pullbackCoefficients (extChartAt (𝓡 n) x).symm z.2 |
| 123 | (EuclideanSpace.basisFun (Fin n) ℝ a) |
| 124 | (EuclideanSpace.basisFun (Fin n) ℝ b)) (t, extChartAt (𝓡 n) x x)))) : |
| 125 | (∀ r : ℕ, r ≤ 2 → ∀ a b : Fin n, |
| 126 | Tendsto (fun k => iteratedFDeriv ℝ r |
| 127 | (fun y => (gseq k t).pullbackCoefficients (extChartAt (𝓡 n) x).symm y |
| 128 | (EuclideanSpace.basisFun (Fin n) ℝ a) |
| 129 | (EuclideanSpace.basisFun (Fin n) ℝ b)) (extChartAt (𝓡 n) x x)) l |
| 130 | (𝓝 (iteratedFDeriv ℝ r |
| 131 | (fun y => (g t).pullbackCoefficients (extChartAt (𝓡 n) x).symm y |
| 132 | (EuclideanSpace.basisFun (Fin n) ℝ a) |
| 133 | (EuclideanSpace.basisFun (Fin n) ℝ b)) (extChartAt (𝓡 n) x x)))) ∧ |
| 134 | (∀ a b : Fin n, |
| 135 | Tendsto (fun k => deriv (fun s => (gseq k s).pullbackCoefficients |
| 136 | (extChartAt (𝓡 n) x).symm (extChartAt (𝓡 n) x x) |
| 137 | (EuclideanSpace.basisFun (Fin n) ℝ a) |
| 138 | (EuclideanSpace.basisFun (Fin n) ℝ b)) t) l |
| 139 | (𝓝 (deriv (fun s => (g s).pullbackCoefficients |
| 140 | (extChartAt (𝓡 n) x).symm (extChartAt (𝓡 n) x x) |
| 141 | (EuclideanSpace.basisFun (Fin n) ℝ a) |
| 142 | (EuclideanSpace.basisFun (Fin n) ℝ b)) t))) := by |
| 143 | have hreg (G : ℝ → RiemannianMetric n M) (hG : IsSmoothFamilyOn G J) |
| 144 | (a b : Fin n) := hG.contDiffAt_spacetime_chart_coefficient hJ x |
| 145 | (p := (t, extChartAt (𝓡 n) x x)) ht |
| 146 | (mem_extChartAt_target x) a b |
| 147 | constructor |
| 148 | · intro r hr a b |
| 149 | exact tendsto_spatial_slice_jet (fun k => hreg (gseq k) (hseq k) a b) |
| 150 | (hreg g hg a b) r (h r hr a b) |
| 151 | · intro a b |
| 152 | have h' := (continuous_eval_const (fun _ : Fin 1 => |
| 153 | (1, (0 : EuclideanSpace ℝ (Fin n))))).continuousAt.tendsto.comp (h 1 (by omega) a b) |
| 154 | simpa only [Function.comp_def, ← deriv_time_slice_eq (hreg g hg a b), |
| 155 | ← deriv_time_slice_eq (hreg (gseq _) (hseq _) a b)] using h' |
| 156 | |
| 157 | /-- Compact-uniform convergence of a scalar jet implies convergence at every |
| 158 | interior point, by taking the singleton compact set. -/ |
| 159 | theorem tendsto_spacetime_jet_of_compact_uniform |
| 160 | {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 161 | {α : Type*} {l : Filter α} {fseq : α → E → ℝ} {f : E → ℝ} |
| 162 | {S : Set E} (r : ℕ) |
| 163 | (h : ∀ K : Set E, IsCompact K → K ⊆ S → |
| 164 | TendstoUniformlyOn (fun k y => iteratedFDeriv ℝ r (fseq k) y) |
| 165 | (fun y => iteratedFDeriv ℝ r f y) l K) |
| 166 | {p : E} (hp : p ∈ S) : |
| 167 | Tendsto (fun k => iteratedFDeriv ℝ r (fseq k) p) l |
| 168 | (𝓝 (iteratedFDeriv ℝ r f p)) := |
| 169 | (h {p} isCompact_singleton (singleton_subset_iff.mpr hp)).tendsto_at (mem_singleton p) |
| 170 | |
| 171 | end PoincareMT.RiemannianMetric |