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.Splitting.TimeTransport.Regularity |
| 2 | |
| 3 | /-! |
| 4 | # Smooth terminal Ricci transport |
| 5 | |
| 6 | Terminal-normalized fibrewise Ricci transport has smooth spatial dependence |
| 7 | and is jointly smooth within the closed slab. This supplies the regularity |
| 8 | prerequisite of Cook--Kotschwar, Corollary 4.1, p. 7; preservation of spatial |
| 9 | parallelity is not a consequence of this ODE regularity statement. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open Set Bundle Filter |
| 16 | open scoped Manifold ContDiff Bundle Topology |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.RicciFlow.Splitting |
| 21 | |
| 22 | private theorem linearODE_contDiffOn_terminal |
| 23 | {P G : Type*} [NormedAddCommGroup P] [NormedSpace ℝ P] [FiniteDimensional ℝ P] |
| 24 | [NormedAddCommGroup G] [NormedSpace ℝ G] [CompleteSpace G] |
| 25 | (A : P → ℝ → G →L[ℝ] G) {a b : ℝ} (hab : a ≤ b) |
| 26 | {U : Set P} (hU : IsOpen U) |
| 27 | (hA : ContDiffOn ℝ ∞ (Function.uncurry A) (U ×ˢ Icc a b)) |
| 28 | (Φ : P → ℝ → G) (hterm : ContDiffOn ℝ ∞ (fun p => Φ p b) U) |
| 29 | (hsol : ∀ p ∈ U, ∀ t ∈ Icc a b, |
| 30 | HasDerivWithinAt (Φ p) (A p t (Φ p t)) (Icc a b) t) : |
| 31 | ContDiffOn ℝ ∞ (Function.uncurry Φ) (U ×ˢ Icc a b) := by |
| 32 | let A' : P → ℝ → G →L[ℝ] G := fun p t => -A p (-t) |
| 33 | let Φ' : P → ℝ → G := fun p t => Φ p (-t) |
| 34 | have hmap : MapsTo (fun q : P × ℝ => (q.1, -q.2)) |
| 35 | (U ×ˢ Icc (-b) (-a)) (U ×ˢ Icc a b) := by |
| 36 | intro q hq |
| 37 | exact ⟨hq.1, by constructor <;> linarith [hq.2.1, hq.2.2]⟩ |
| 38 | have hA' : ContDiffOn ℝ ∞ (Function.uncurry A') (U ×ˢ Icc (-b) (-a)) := |
| 39 | (hA.comp (contDiff_fst.prodMk contDiff_snd.neg).contDiffOn hmap).neg |
| 40 | have hterm' : ContDiffOn ℝ ∞ (fun p => Φ' p (-b)) U := by |
| 41 | simpa only [Φ', neg_neg] using hterm |
| 42 | have hsol' : ∀ p ∈ U, ∀ t ∈ Icc (-b) (-a), |
| 43 | HasDerivWithinAt (Φ' p) (A' p t (Φ' p t)) (Icc (-b) (-a)) t := by |
| 44 | intro p hp t ht |
| 45 | have hnt : -t ∈ Icc a b := by constructor <;> linarith [ht.1, ht.2] |
| 46 | have h := (hsol p hp (-t) hnt).scomp t |
| 47 | (hasDerivWithinAt_id t (Icc (-b) (-a))).neg |
| 48 | (show MapsTo (fun s : ℝ => -s) (Icc (-b) (-a)) (Icc a b) from |
| 49 | fun s hs => by constructor <;> linarith [hs.1, hs.2]) |
| 50 | simpa only [Φ', A', Function.comp_def, neg_smul, one_smul, |
| 51 | neg_apply] using h |
| 52 | have h := Frame.linearODE_contDiffOn A' (neg_le_neg hab) hU hA' Φ' hterm' hsol' |
| 53 | have hmap' : MapsTo (fun q : P × ℝ => (q.1, -q.2)) |
| 54 | (U ×ˢ Icc a b) (U ×ˢ Icc (-b) (-a)) := |
| 55 | fun q hq => ⟨hq.1, neg_le_neg hq.2.2, neg_le_neg hq.2.1⟩ |
| 56 | simpa only [Function.comp_def, Function.uncurry_def, Φ', neg_neg] using |
| 57 | h.comp (contDiff_fst.prodMk contDiff_snd.neg).contDiffOn hmap' |
| 58 | |
| 59 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 60 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 61 | {a b : ℝ} |
| 62 | |
| 63 | theorem ricci_transport_contMDiffOn |
| 64 | (hab : a < b) (F : RicciFlow n M (Icc a b)) |
| 65 | (X : ℝ → (x : M) → TangentSpace (𝓡 n) x) |
| 66 | (hXb : ContMDiff (𝓡 n) |
| 67 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ (T% (X b))) |
| 68 | (hode : letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 69 | ⟨(F.metric b).toRiemannianMetric⟩ |
| 70 | ∀ x : M, ∀ t ∈ Icc a b, HasDerivWithinAt (fun s => X s x) |
| 71 | (ricciSharp (F.connection t) x (X t x)) (Icc a b) t) : |
| 72 | ContMDiffOn (𝓘(ℝ, ℝ).prod (𝓡 n)) |
| 73 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 74 | (fun p : ℝ × M => TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) p.2 (X p.1 p.2)) |
| 75 | (Icc a b ×ˢ univ) := by |
| 76 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 77 | ⟨(F.metric b).toRiemannianMetric⟩ |
| 78 | rintro ⟨t, x⟩ ⟨ht, _⟩ |
| 79 | let E := EuclideanSpace ℝ (Fin n) |
| 80 | let e := extChartAt (𝓡 n) x |
| 81 | let v := trivializationAt E (TangentSpace (𝓡 n) : M → Type _) x |
| 82 | let Φ : E → ℝ → E := fun z s => |
| 83 | (v (TotalSpace.mk' E (e.symm z) (X s (e.symm z)))).2 |
| 84 | have hzbase (z : E) (hz : z ∈ e.target) : e.symm z ∈ v.baseSet := by |
| 85 | rw [TangentBundle.trivializationAt_baseSet] |
| 86 | simpa only [e, extChartAt_source] using e.map_target hz |
| 87 | have hterm : ContDiffOn ℝ ∞ (fun z => Φ z b) e.target := by |
| 88 | intro z hz |
| 89 | have h := (v.contMDiffAt_iff (f := T% (X b)) (x₀ := e.symm z) |
| 90 | (show TotalSpace.mk' E (e.symm z) (X b (e.symm z)) ∈ v.source from |
| 91 | hzbase z hz)).mp (hXb (e.symm z)) |>.2 |
| 92 | exact (h.comp_contMDiffWithinAt z (contMDiffOn_extChartAt_symm x z hz)).contDiffWithinAt |
| 93 | have hsol : ∀ z ∈ e.target, ∀ s ∈ Icc a b, |
| 94 | HasDerivWithinAt (Φ z) |
| 95 | (chartRicciCoefficient F x z s (Φ z s)) (Icc a b) s := by |
| 96 | intro z hz s hs |
| 97 | let y := e.symm z |
| 98 | let : NormedAddCommGroup (TangentSpace (𝓡 n) y) := inferInstance |
| 99 | let : NormedSpace ℝ (TangentSpace (𝓡 n) y) := inferInstance |
| 100 | let c := v.continuousLinearEquivAt ℝ y (hzbase z hz) |
| 101 | have hc (r : ℝ) : Φ z r = c (X r y) := by |
| 102 | simp only [c, Trivialization.continuousLinearEquivAt_apply, Φ, y] |
| 103 | have hd := c.hasFDerivAt.comp_hasDerivWithinAt s (hode y s hs) |
| 104 | have heq : chartRicciCoefficient F x z s (Φ z s) = |
| 105 | c (ricciSharp (F.connection s) y (X s y)) := by |
| 106 | dsimp only [chartRicciCoefficient] |
| 107 | rw [ContinuousLinearMap.inCoordinates_eq (hzbase z hz) (hzbase z hz), hc s] |
| 108 | change c (ricciEndomorphism F y s (c.symm (c (X s y)))) = _ |
| 109 | rw [c.symm_apply_apply, ricciEndomorphism_eq_ricciSharp hab F y hs] |
| 110 | rw [heq] |
| 111 | exact hd.congr (fun r _ => hc r) (hc s) |
| 112 | have hchart := linearODE_contDiffOn_terminal (chartRicciCoefficient F x) hab.le |
| 113 | (isOpen_extChartAt_target x) (chartRicciCoefficient_contDiffOn hab F x) Φ hterm hsol |
| 114 | rw [contMDiffWithinAt_totalSpace] |
| 115 | refine ⟨contMDiffWithinAt_snd, ?_⟩ |
| 116 | let S : Set (ℝ × M) := Icc a b ×ˢ e.source |
| 117 | have harg : ContMDiffWithinAt (𝓘(ℝ, ℝ).prod (𝓡 n)) |
| 118 | (𝓘(ℝ, EuclideanSpace ℝ (Fin n)).prod 𝓘(ℝ, ℝ)) ∞ |
| 119 | (fun p : ℝ × M => (e p.2, p.1)) S (t, x) := |
| 120 | ((contMDiffAt_extChartAt (I := 𝓡 n) (x := x)).comp (t, x) |
| 121 | contMDiffAt_snd).contMDiffWithinAt.prodMk contMDiffWithinAt_fst |
| 122 | have hmap : MapsTo (fun p : ℝ × M => (e p.2, p.1)) S (e.target ×ˢ Icc a b) := |
| 123 | fun p hp => ⟨e.map_source hp.2, hp.1⟩ |
| 124 | have hc₀ : ContMDiffWithinAt 𝓘(ℝ, E × ℝ) 𝓘(ℝ, E) ∞ |
| 125 | (Function.uncurry Φ) (e.target ×ˢ Icc a b) (e x, t) := |
| 126 | (hchart (e x, t) ⟨mem_extChartAt_target x, ht⟩).contMDiffWithinAt |
| 127 | have hc : ContMDiffWithinAt (𝓘(ℝ, ℝ).prod (𝓡 n)) 𝓘(ℝ, E) ∞ |
| 128 | ((Function.uncurry Φ) ∘ (fun p : ℝ × M => (e p.2, p.1))) S (t, x) := by |
| 129 | apply hc₀.comp (t, x) (f := fun p : ℝ × M => (e p.2, p.1)) _ hmap |
| 130 | simpa +instances only [← modelWithCornersSelf_prod, chartedSpaceSelf_prod] using harg |
| 131 | have hS : S ∈ 𝓝[Icc a b ×ˢ univ] (t, x) := by |
| 132 | apply mem_nhdsWithin_iff_exists_mem_nhds_inter.mpr |
| 133 | refine ⟨univ ×ˢ e.source, |
| 134 | (isOpen_univ.prod (isOpen_extChartAt_source (I := 𝓡 n) x)).mem_nhds |
| 135 | ⟨mem_univ _, mem_extChartAt_source x⟩, ?_⟩ |
| 136 | intro p hp |
| 137 | exact ⟨hp.2.1, hp.1.2⟩ |
| 138 | apply (hc.mono_of_mem_nhdsWithin hS).congr_of_eventuallyEq |
| 139 | · filter_upwards [hS] with p hp |
| 140 | exact congrArg (fun y => (v (TotalSpace.mk' E y (X p.1 y))).2) |
| 141 | (e.left_inv hp.2).symm |
| 142 | · exact congrArg (fun y => (v (TotalSpace.mk' E y (X t y))).2) |
| 143 | (e.left_inv (mem_extChartAt_source x)).symm |
| 144 | |
| 145 | /-- Smooth terminal data have a Ricci-transported extension smooth through |
| 146 | both endpoints, with their pointwise lengths preserved. -/ |
| 147 | theorem exists_smooth_terminal_ricci_transport_field |
| 148 | (hC : RicciFlowCurvatureTheory.{u}) (hab : a < b) |
| 149 | (F : RicciFlow n M (Icc a b)) |
| 150 | (Xb : (x : M) → TangentSpace (𝓡 n) x) |
| 151 | (hXb : ContMDiff (𝓡 n) |
| 152 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ (T% Xb)) : |
| 153 | ∃ X : ℝ → (x : M) → TangentSpace (𝓡 n) x, |
| 154 | X b = Xb ∧ |
| 155 | ContMDiffOn (𝓘(ℝ, ℝ).prod (𝓡 n)) |
| 156 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 157 | (fun p : ℝ × M => TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) p.2 (X p.1 p.2)) |
| 158 | (Icc a b ×ˢ univ) ∧ |
| 159 | (letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 160 | ⟨(F.metric b).toRiemannianMetric⟩ |
| 161 | ∀ x : M, ∀ t ∈ Icc a b, HasDerivWithinAt (fun s => X s x) |
| 162 | (ricciSharp (F.connection t) x (X t x)) (Icc a b) t) ∧ |
| 163 | ∀ t ∈ Icc a b, ∀ x : M, |
| 164 | (F.metric t).inner x (X t x) (X t x) = (F.metric b).inner x (Xb x) (Xb x) := by |
| 165 | classical |
| 166 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 167 | ⟨(F.metric b).toRiemannianMetric⟩ |
| 168 | choose U hUb hUd hUp hUi using exists_terminal_ricci_transport hC hab F |
| 169 | let X : ℝ → (x : M) → TangentSpace (𝓡 n) x := fun t x => U x t (Xb x) |
| 170 | have hterminal : X b = Xb := by |
| 171 | funext x |
| 172 | change U x b (Xb x) = Xb x |
| 173 | rw [hUb x, ContinuousLinearMap.id_apply] |
| 174 | have hode : ∀ x : M, ∀ t ∈ Icc a b, HasDerivWithinAt (fun s => X s x) |
| 175 | (ricciSharp (F.connection t) x (X t x)) (Icc a b) t := |
| 176 | fun x t ht => hUd x t ht (Xb x) |
| 177 | refine ⟨X, hterminal, ricci_transport_contMDiffOn hab F X ?_ hode, hode, ?_⟩ |
| 178 | · simpa only [hterminal] using hXb |
| 179 | · intro t ht x |
| 180 | exact hUp x t ht (Xb x) (Xb x) |
| 181 | |
| 182 | end PoincareMT.RicciFlow.Splitting |