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.CurveShortening.Ramp.LocalFlow.C2.TraceGaugeCurvatureLp |
| 2 | import PoincareLib.Geometry.CurveShortening.Ramp.CurveEstimates.Relabeling.Scalars |
| 3 | import PoincareLib.Geometry.CurveShortening.Ramp.Analysis.Periodic.SmoothApproximation |
| 4 | import Mathlib.Topology.ContinuousMap.Compact |
| 5 | |
| 6 | /-! |
| 7 | # Actual initial pushed-curvature convergence |
| 8 | |
| 9 | Uniform initial three-jet convergence passes through the actual affine |
| 10 | curvature formula and positive fixed period conversion. |
| 11 | MT2007 Claim 19.1, p. 437; Lemma 19.6, pp. 441-442; |
| 12 | `2026-09-22-c2-normal-curvature-limit-assembly.md`, statement 1. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set Filter |
| 19 | open scoped Manifold ContDiff Bundle Topology |
| 20 | |
| 21 | universe u v |
| 22 | |
| 23 | namespace PoincareMT.M63 |
| 24 | |
| 25 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 27 | {ι : Type v} [Fintype ι] {a b L : ℝ} [Fact (0 < L)] |
| 28 | |
| 29 | local notation "W" => EuclideanSpace ℝ ι |
| 30 | |
| 31 | /-- Actual C2 three-jet convergence gives convergence of the actual |
| 32 | initial pushed curvature in the fixed parameter-period norm. |
| 33 | MT2007 Claim 19.1, p. 437; normal curvature assembly, statement 1. -/ |
| 34 | theorem exists_uniform_initial_embeddedCurvature_limit |
| 35 | (F : RicciFlow n M (Icc a b)) (ha : a ∈ Icc a b) |
| 36 | {e : M → W} (he : ContMDiff (𝓡 n) 𝓘(ℝ, W) ∞ e) |
| 37 | {U : Set W} (hU : IsOpen U) (heU : range e ⊆ U) {ρ : W → M} |
| 38 | (hρ : ContMDiffOn 𝓘(ℝ, W) (𝓡 n) ∞ ρ U) (hρe : ∀ p, ρ (e p) = p) |
| 39 | {f : ℝ → W} (hf : ContDiff ℝ 2 f) (hfp : Function.Periodic f L) |
| 40 | (fn : ℕ → ℝ → W) (hfn : ∀ j, ContDiff ℝ 2 (fn j)) |
| 41 | (hfnp : ∀ j, Function.Periodic (fn j) L) |
| 42 | (hfguard : ∀ x, f x ∈ U ∧ |
| 43 | mfderiv 𝓘(ℝ, W) (𝓡 n) ρ (f x) (deriv f x) ≠ 0) |
| 44 | (hfnguard : ∀ j x, fn j x ∈ U ∧ |
| 45 | mfderiv 𝓘(ℝ, W) (𝓡 n) ρ (fn j x) (deriv (fn j) x) ≠ 0) |
| 46 | (hfnfixed : ∀ j x, fn j x = e (ρ (fn j x))) |
| 47 | (hconv : ∀ eps > 0, ∃ N : ℕ, ∀ j ≥ N, ∀ x, |
| 48 | ‖fn j x - f x‖ < eps ∧ ‖deriv (fn j) x - deriv f x‖ < eps ∧ |
| 49 | ‖deriv (deriv (fn j)) x - deriv (deriv f) x‖ < eps) : |
| 50 | let κ := L / curvePeriod |
| 51 | ∃ (Hn : ℕ → C(AddCircle curvePeriod, W)) (h0 : C(AddCircle curvePeriod, W)), |
| 52 | Tendsto Hn atTop (𝓝 h0) ∧ |
| 53 | (∀ j (x : ℝ), Hn j (x : AddCircle curvePeriod) = |
| 54 | mfderiv (𝓡 n) 𝓘(ℝ, W) e (ρ (fn j (κ * x))) |
| 55 | (m62CurvatureVector F (fun y (_ : ℝ) => ρ (fn j (κ * y))) a x)) ∧ |
| 56 | ∀ x : ℝ, h0 (x : AddCircle curvePeriod) = |
| 57 | mfderiv (𝓡 n) 𝓘(ℝ, W) e (ρ (f (κ * x))) |
| 58 | (m62CurvatureVector F (fun y (_ : ℝ) => ρ (f (κ * y))) a x) := by |
| 59 | classical |
| 60 | let : Fact (0 < curvePeriod) := ⟨by unfold curvePeriod; positivity⟩ |
| 61 | let κ := L / curvePeriod |
| 62 | have hκ : 0 < κ := div_pos (Fact.out : 0 < L) (Fact.out : 0 < curvePeriod) |
| 63 | have hfpoint (x : ℝ) : Tendsto (fun j => fn j x) atTop (𝓝 (f x)) := by |
| 64 | apply Metric.tendsto_atTop.mpr |
| 65 | intro eps heps |
| 66 | obtain ⟨N, hN⟩ := hconv eps heps |
| 67 | exact ⟨N, fun j hj => by simpa only [dist_eq_norm] using (hN j hj x).1⟩ |
| 68 | have hffixed (x : ℝ) : f x = e (ρ (f x)) := by |
| 69 | have hmap : ContinuousAt (fun z : W => e (ρ z)) (f x) := |
| 70 | he.continuous.continuousAt.comp |
| 71 | ((hρ.contMDiffAt (hU.mem_nhds (hfguard x).1)).continuousAt) |
| 72 | have hpost := hmap.tendsto.comp (hfpoint x) |
| 73 | have heq : (fun j => e (ρ (fn j x))) = fun j => fn j x := |
| 74 | funext fun j => (hfnfixed j x).symm |
| 75 | rw [Function.comp_def, heq] at hpost |
| 76 | exact tendsto_nhds_unique (hfpoint x) hpost |
| 77 | let Ω : Set (W × W) := {z | z.1 ∈ U ∧ mfderiv 𝓘(ℝ, W) (𝓡 n) ρ z.1 z.2 ≠ 0} |
| 78 | let α := fun z : W × W => ambientCurvePrincipal F ρ a z.1 z.2 |
| 79 | let β := fun z : W × W => ambientCurveLower F e ρ a z.1 z.2 |
| 80 | let lam : W × W → W →L[ℝ] ℝ := fun z => (1 / 2 : ℝ) • |
| 81 | (fderiv ℝ α z).comp (ContinuousLinearMap.inr ℝ W W) |
| 82 | let η := fun z : W × W => fderiv ℝ α z (z.2, 0) / 2 |
| 83 | let C : W × W → W →L[ℝ] W := |
| 84 | fun z => α z • ContinuousLinearMap.id ℝ W + (lam z).smulRight z.2 |
| 85 | let d : W × W → W := fun z => β z + η z • z.2 |
| 86 | obtain ⟨_hLam, _hη, hC, hd, hformula⟩ := |
| 87 | ambientCurve_curvature_label_affine F he hU heU hρ hρe ha |
| 88 | let D : Set ((W × W) × W) := {z | z.1 ∈ Ω} |
| 89 | let Phi : (W × W) × W → W := fun z => C z.1 z.2 + d z.1 |
| 90 | have hPhi : ContinuousOn Phi D := |
| 91 | ((hC.comp continuous_fst.continuousOn (fun _ hz => hz)).clm_apply |
| 92 | continuousOn_snd).add (hd.comp continuous_fst.continuousOn (fun _ hz => hz)) |
| 93 | let liftJet (g : ℝ → W) (hg : ContDiff ℝ 2 g) (hp : Function.Periodic g L) : |
| 94 | C(AddCircle L, (W × W) × W) := by |
| 95 | have hg1 : ContDiff ℝ 1 (deriv g) := hg.deriv' (n := 1) |
| 96 | have hp1 := hp.deriv_of_differentiable (hg.differentiable (by norm_num)) |
| 97 | have hp2 := hp1.deriv_of_differentiable (hg1.differentiable (by norm_num)) |
| 98 | have hper : Function.Periodic (fun x => ((g x, deriv g x), deriv (deriv g) x)) L := by |
| 99 | intro x |
| 100 | simp only [hp x, hp1 x, hp2 x] |
| 101 | exact ⟨hper.lift, |
| 102 | (QuotientAddGroup.isQuotientMap_mk (AddSubgroup.zmultiples L)).continuous_iff.mpr |
| 103 | ((hg.continuous.prodMk hg1.continuous).prodMk hg1.continuous_deriv_one)⟩ |
| 104 | let J0 := liftJet f hf hfp |
| 105 | let J := fun j => liftJet (fn j) (hfn j) (hfnp j) |
| 106 | have hJ : Tendsto J atTop (𝓝 J0) := by |
| 107 | apply Metric.tendsto_atTop.mpr |
| 108 | intro eps heps |
| 109 | obtain ⟨N, hN⟩ := hconv (eps / 2) (by positivity) |
| 110 | refine ⟨N, fun j hj => ?_⟩ |
| 111 | have hnorm : ‖J j - J0‖ ≤ eps / 2 := by |
| 112 | apply (ContinuousMap.norm_le _ (by positivity)).mpr |
| 113 | intro z |
| 114 | obtain ⟨x, rfl⟩ := QuotientAddGroup.mk_surjective z |
| 115 | change max (max ‖fn j x - f x‖ ‖deriv (fn j) x - deriv f x‖) |
| 116 | ‖deriv (deriv (fn j)) x - deriv (deriv f) x‖ ≤ eps / 2 |
| 117 | exact max_le (max_le (hN j hj x).1.le (hN j hj x).2.1.le) (hN j hj x).2.2.le |
| 118 | simpa only [dist_eq_norm] using hnorm.trans_lt (by linarith) |
| 119 | have hJmem (j : ℕ) (z : AddCircle L) : J j z ∈ D := by |
| 120 | obtain ⟨x, rfl⟩ := QuotientAddGroup.mk_surjective z |
| 121 | exact hfnguard j x |
| 122 | have hJ0mem (z : AddCircle L) : J0 z ∈ D := by |
| 123 | obtain ⟨x, rfl⟩ := QuotientAddGroup.mk_surjective z |
| 124 | exact hfguard x |
| 125 | let J' (j : ℕ) : C(AddCircle L, D) := |
| 126 | ⟨fun z => ⟨J j z, hJmem j z⟩, (J j).continuous.subtype_mk _⟩ |
| 127 | let J0' : C(AddCircle L, D) := |
| 128 | ⟨fun z => ⟨J0 z, hJ0mem z⟩, J0.continuous.subtype_mk _⟩ |
| 129 | let inc : C(D, (W × W) × W) := ⟨Subtype.val, continuous_subtype_val⟩ |
| 130 | have hJ' : Tendsto J' atTop (𝓝 J0') := by |
| 131 | apply (inc.isEmbedding_postcomp Topology.IsEmbedding.subtypeVal).tendsto_nhds_iff.mpr |
| 132 | exact hJ |
| 133 | let PhiD : C(D, W) := ⟨fun z => Phi z, continuousOn_iff_continuous_domRestrict.mp hPhi⟩ |
| 134 | let G := fun j => PhiD.comp (J' j) |
| 135 | let g0 := PhiD.comp J0' |
| 136 | have hG : Tendsto G atTop (𝓝 g0) := |
| 137 | (PhiD.continuous_postcomp.tendsto J0').comp hJ' |
| 138 | let scaleH := AddCircle.homeomorphAddCircle curvePeriod L |
| 139 | (Fact.out : 0 < curvePeriod).ne' (Fact.out : 0 < L).ne' |
| 140 | let scale : C(AddCircle curvePeriod, AddCircle L) := ⟨scaleH, scaleH.continuous⟩ |
| 141 | have hscale (x : ℝ) : scale (x : AddCircle curvePeriod) = ((κ * x : ℝ) : AddCircle L) := by |
| 142 | change ((x * (curvePeriod⁻¹ * L) : ℝ) : AddCircle L) = _ |
| 143 | congr 1 |
| 144 | dsimp only [κ] |
| 145 | ring |
| 146 | have hgeom (g : ℝ → W) (hg : ContDiff ℝ 2 g) |
| 147 | (hguard : ∀ x, g x ∈ U ∧ mfderiv 𝓘(ℝ, W) (𝓡 n) ρ (g x) (deriv g x) ≠ 0) |
| 148 | (hfixed : ∀ x, g x = e (ρ (g x))) (x : ℝ) : |
| 149 | mfderiv (𝓡 n) 𝓘(ℝ, W) e (ρ (g (κ * x))) |
| 150 | (m62CurvatureVector F (fun y (_ : ℝ) => ρ (g (κ * y))) a x) = |
| 151 | Phi ((g (κ * x), deriv g (κ * x)), deriv (deriv g) (κ * x)) := by |
| 152 | let c := fun y (_ : ℝ) => ρ (g y) |
| 153 | have hc : ContMDiff 𝓘(ℝ, ℝ) (𝓡 n) 2 (fun y => c y a) := |
| 154 | (hρ.of_le (ENat.natCast_le_of_coe_top_le_withTop le_rfl 2)).comp_contMDiff |
| 155 | hg.contMDiff (fun y => (hguard y).1) |
| 156 | have hvel (y : ℝ) : curveVelocity (n := n) (fun z => c z a) y = |
| 157 | mfderiv 𝓘(ℝ, W) (𝓡 n) ρ (g y) (deriv g y) := by |
| 158 | change (mfderiv 𝓘(ℝ, ℝ) (𝓡 n) (ρ ∘ g) y) 1 = _ |
| 159 | erw [mfderiv_comp y |
| 160 | ((hρ.contMDiffAt (hU.mem_nhds (hguard y).1)).mdifferentiableAt (by simp)) |
| 161 | ((hg.contMDiff y).mdifferentiableAt (by norm_num)), |
| 162 | ContinuousLinearMap.comp_apply, mfderiv_eq_fderiv] |
| 163 | rfl |
| 164 | have himm (y : ℝ) : curveVelocity (n := n) (fun z => c z a) y ≠ 0 := by |
| 165 | rw [hvel] |
| 166 | exact (hguard y).2 |
| 167 | have hS := unitTangent_contMDiff_of_c2 F c (t := a) hc himm |
| 168 | have hlin (y : ℝ) : HasDerivAt (fun z : ℝ => κ * z) κ y := by |
| 169 | simpa +instances only [id_eq, mul_one] using! (hasDerivAt_id y).const_mul κ |
| 170 | have hcurv := curvatureVector_comp F c (hc.mdifferentiable (by norm_num)) |
| 171 | (fun y => (hlin y).differentiableAt) (fun y => by rw [(hlin y).deriv]; exact hκ) |
| 172 | ((hS (κ * x)).mdifferentiableAt (by norm_num)) (x := x) |
| 173 | change mfderiv (𝓡 n) 𝓘(ℝ, W) e (c (κ * x) a) |
| 174 | (m62CurvatureVector F (fun y s => c (κ * y) s) a x) = _ |
| 175 | rw [hcurv] |
| 176 | exact (hformula g hg hguard hfixed (κ * x)).2 |
| 177 | refine ⟨fun j => (G j).comp scale, g0.comp scale, |
| 178 | (scale.continuous_precomp.tendsto g0).comp hG, ?_, ?_⟩ |
| 179 | · intro j x |
| 180 | change G j (scale (x : AddCircle curvePeriod)) = _ |
| 181 | rw [hscale] |
| 182 | exact (hgeom (fn j) (hfn j) (hfnguard j) (hfnfixed j) x).symm |
| 183 | · intro x |
| 184 | change g0 (scale (x : AddCircle curvePeriod)) = _ |
| 185 | rw [hscale] |
| 186 | exact (hgeom f hf hfguard hffixed x).symm |
| 187 | |
| 188 | end PoincareMT.M63 |