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.Surgery.StandardCap.Persistence.Analysis.ODE.ODELinearVariation |
| 2 | |
| 3 | /-! |
| 4 | # Compact convergence of all spatial jets of ODE families |
| 5 | |
| 6 | Repeated full linear augmentation proves convergence of each finite |
| 7 | parameter derivative through the endpoints of a fixed time interval. |
| 8 | This supplies the smooth exponential adjustment in Morgan--Tian, |
| 9 | Claim 16.6 and Corollary 16.7, pp. 371-372; see derivation 22. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open Set Filter Metric |
| 16 | open scoped ContDiff Topology |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | /-- Smooth compact convergence of fields and initial data gives uniform |
| 21 | convergence of every spatial solution jet on compact parameter sets and |
| 22 | closed time intervals. Actual field smoothness is needed only at the |
| 23 | actual phase positions. -/ |
| 24 | theorem tendstoUniformlyOn_ode_spatial_jets |
| 25 | (m : ℕ) {E P : Type u} |
| 26 | [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] |
| 27 | [NormedAddCommGroup P] [NormedSpace ℝ P] [FiniteDimensional ℝ P] |
| 28 | {ι : Type*} {l : Filter ι} |
| 29 | {F : ι → E → E} {G : E → E} {γ : ι → P × ℝ → E} {η : P × ℝ → E} |
| 30 | {U K : Set P} {I : Set ℝ} {T : ℝ} |
| 31 | (hU : IsOpen U) (hI : IsOpen I) (hT : 0 ≤ T) (hTI : Icc (0 : ℝ) T ⊆ I) |
| 32 | (hK : IsCompact K) (hKU : K ⊆ U) |
| 33 | (hηsmooth : ContDiffOn ℝ ∞ η (U ×ˢ I)) |
| 34 | (hγsmooth : ∀ᶠ i in l, ContDiffOn ℝ ∞ (γ i) (U ×ˢ I)) |
| 35 | (hγode : ∀ᶠ i in l, ∀ p ∈ U, ∀ t ∈ I, |
| 36 | HasDerivAt (fun s => γ i (p, s)) (F i (γ i (p, t))) t) |
| 37 | (hF : ∀ᶠ i in l, ∀ p ∈ U, ∀ t ∈ I, ContDiffAt ℝ ∞ (F i) (γ i (p, t))) |
| 38 | (hηode : ∀ p ∈ U, ∀ t ∈ I, |
| 39 | HasDerivAt (fun s => η (p, s)) (G (η (p, t))) t) |
| 40 | (hfield : CompactSmoothConvergenceOn F G l univ) |
| 41 | (hinitial : CompactSmoothConvergenceOn (fun i p => γ i (p, 0)) (fun p => η (p, 0)) l U) : |
| 42 | TendstoUniformlyOn |
| 43 | (fun i (z : P × ℝ) => iteratedFDeriv ℝ m (fun p => γ i (p, z.2)) z.1) |
| 44 | (fun z : P × ℝ => iteratedFDeriv ℝ m (fun p => η (p, z.2)) z.1) |
| 45 | l (K ×ˢ Icc (0 : ℝ) T) := by |
| 46 | induction m generalizing E with |
| 47 | | zero => |
| 48 | have hconv := tendstoUniformlyOn_ode_of_compact_model hT |
| 49 | (contDiffOn_univ.mp hfield.smooth |>.of_le (by simp)) hK |
| 50 | (hηsmooth.continuousOn.mono (prod_mono hKU hTI)) |
| 51 | (hγode.mono fun i hi p hp t ht => hi p (hKU hp) t (hTI ht)) |
| 52 | (fun p hp t ht => hηode p (hKU hp) t (hTI ht)) |
| 53 | (fun R => hfield.uniformlyOn (isCompact_closedBall _ R) (subset_univ _)) |
| 54 | (hinitial.uniformlyOn hK hKU) |
| 55 | have hc := (continuousMultilinearCurryFin0 ℝ P E).symm.isometry.uniformContinuous |
| 56 | simpa only [iteratedFDeriv_zero_eq_comp, Function.comp_def] using |
| 57 | hc.comp_tendstoUniformlyOn hconv |
| 58 | | succ m ih => |
| 59 | let X := E × (P →L[ℝ] E) |
| 60 | have hmodel : ContDiffOn ℝ ∞ (linearVariation η) (U ×ˢ I) := by |
| 61 | intro z hz |
| 62 | exact (hηsmooth.contDiffAt ((hU.prod hI).mem_nhds hz)).linearVariation.contDiffWithinAt |
| 63 | have hactual : ∀ᶠ i in l, ContDiffOn ℝ ∞ (linearVariation (γ i)) (U ×ˢ I) := by |
| 64 | filter_upwards [hγsmooth] with i hi |
| 65 | intro z hz |
| 66 | exact (hi.contDiffAt ((hU.prod hI).mem_nhds hz)).linearVariation.contDiffWithinAt |
| 67 | have hmodelODE : ∀ p ∈ U, ∀ t ∈ I, |
| 68 | HasDerivAt (fun s => linearVariation η (p, s)) |
| 69 | (linearVariationalField G (linearVariation η (p, t))) t := by |
| 70 | intro p hp t ht |
| 71 | exact hasDerivAt_linearVariation |
| 72 | (hηsmooth.contDiffAt ((hU.prod hI).mem_nhds ⟨hp, ht⟩)) |
| 73 | ((show ∀ᶠ q in 𝓝 p, q ∈ U from hU.mem_nhds hp).mono |
| 74 | fun q hq => hηode q hq t ht) |
| 75 | ((contDiffOn_univ.mp hfield.smooth).differentiable (by simp) _) |
| 76 | have hactualODE : ∀ᶠ i in l, ∀ p ∈ U, ∀ t ∈ I, |
| 77 | HasDerivAt (fun s => linearVariation (γ i) (p, s)) |
| 78 | (linearVariationalField (F i) (linearVariation (γ i) (p, t))) t := by |
| 79 | filter_upwards [hγsmooth, hγode, hF] with i his hio hif |
| 80 | intro p hp t ht |
| 81 | exact hasDerivAt_linearVariation |
| 82 | (his.contDiffAt ((hU.prod hI).mem_nhds ⟨hp, ht⟩)) |
| 83 | ((show ∀ᶠ q in 𝓝 p, q ∈ U from hU.mem_nhds hp).mono |
| 84 | fun q hq => hio q hq t ht) |
| 85 | ((hif p hp t ht).differentiableAt (by simp)) |
| 86 | have hactualField : ∀ᶠ i in l, ∀ p ∈ U, ∀ t ∈ I, |
| 87 | ContDiffAt ℝ ∞ (linearVariationalField (F i)) (linearVariation (γ i) (p, t)) := by |
| 88 | filter_upwards [hF] with i hi |
| 89 | exact fun p hp t ht => (hi p hp t ht).linearVariationalField |
| 90 | have hconv := ih (E := X) hmodel hactual hactualODE hactualField hmodelODE |
| 91 | hfield.linearVariationalField (hinitial.prodMk hinitial.fderiv) |
| 92 | let L := ContinuousLinearMap.snd ℝ E (P →L[ℝ] E) |
| 93 | have hread : UniformContinuous |
| 94 | (fun J : P [×m]→L[ℝ] X => L.compContinuousMultilinearMap J) := |
| 95 | uniformContinuous_snd.comp |
| 96 | (ContinuousMultilinearMap.prodL ℝ (fun _ : Fin m => P) |
| 97 | E (P →L[ℝ] E)).symm.isometry.uniformContinuous |
| 98 | have hproject := hread.comp_tendstoUniformlyOn hconv |
| 99 | have hderivative : TendstoUniformlyOn |
| 100 | (fun i (z : P × ℝ) => iteratedFDeriv ℝ m |
| 101 | (fderiv ℝ (fun p => γ i (p, z.2))) z.1) |
| 102 | (fun z : P × ℝ => iteratedFDeriv ℝ m |
| 103 | (fderiv ℝ (fun p => η (p, z.2))) z.1) l (K ×ˢ Icc (0 : ℝ) T) := by |
| 104 | apply (hproject.congr ?_).congr_right ?_ |
| 105 | · filter_upwards [hactual] with i hi |
| 106 | intro z hz |
| 107 | have hs := (hi.contDiffAt ((hU.prod hI).mem_nhds ⟨hKU hz.1, hTI hz.2⟩)).comp |
| 108 | z.1 (contDiffAt_id.prodMk contDiffAt_const) |
| 109 | exact (L.iteratedFDeriv_comp_left hs (by exact_mod_cast le_top)).symm |
| 110 | · intro z hz |
| 111 | have hs := (hmodel.contDiffAt ((hU.prod hI).mem_nhds ⟨hKU hz.1, hTI hz.2⟩)).comp |
| 112 | z.1 (contDiffAt_id.prodMk contDiffAt_const) |
| 113 | exact (L.iteratedFDeriv_comp_left hs (by exact_mod_cast le_top)).symm |
| 114 | have hc := (continuousMultilinearCurryRightEquiv' ℝ m P E).symm.isometry.uniformContinuous |
| 115 | simpa only [iteratedFDeriv_succ_eq_comp_right, Function.comp_def] using |
| 116 | hc.comp_tendstoUniformlyOn hderivative |