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.Intrinsic.C2UnitSpeedExistence |
| 2 | import PoincareLib.Geometry.CurveShortening.Ramp.LocalFlow.Unit.SpeedInitialPeriod |
| 3 | import PoincareLib.Geometry.CurveShortening.Ramp.LocalFlow.Fixed.LabelC2Transport |
| 4 | import PoincareLib.Geometry.CurveShortening.Ramp.Analysis.Compact.EmbeddedRetraction |
| 5 | import Mathlib.Geometry.Manifold.WhitneyEmbedding |
| 6 | |
| 7 | /-! |
| 8 | # Actual intrinsic C2 local existence at the original labels |
| 9 | |
| 10 | Positive C2 arclength labels transport the constructed solution and its |
| 11 | actual intrinsic jets to the prescribed initial curve. MT2007 Claim 19.1, |
| 12 | p. 437, and Lemma 19.24, pp. 454-455; |
| 13 | `2026-09-22-intrinsic-c2-local-existence-assembly.md`, statements 2 and 3. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set |
| 20 | open scoped Manifold ContDiff Bundle intervalIntegral |
| 21 | |
| 22 | universe u v |
| 23 | |
| 24 | namespace PoincareMT.M63 |
| 25 | |
| 26 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] [T2Space M] |
| 27 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 28 | {ι : Type v} [Fintype ι] {a b : ℝ} |
| 29 | |
| 30 | local notation "W" => EuclideanSpace ℝ ι |
| 31 | |
| 32 | /-- The actual retraction construction gives an intrinsic C2 solution |
| 33 | with the exact original initial curve. MT2007 Claim 19.1, p. 437; |
| 34 | intrinsic C2 existence derivation, statement 2. -/ |
| 35 | theorem exists_intrinsic_c2_local_curve_of_retraction |
| 36 | (F : RicciFlow n M (Icc a b)) (hcompact : IsCompact (univ : Set M)) |
| 37 | {e : M → W} (he : ContMDiff (𝓡 n) 𝓘(ℝ, W) ∞ e) |
| 38 | {U : Set W} (hU : IsOpen U) (heU : range e ⊆ U) {ρ : W → M} |
| 39 | (hρ : ContMDiffOn 𝓘(ℝ, W) (𝓡 n) ∞ ρ U) (hρe : ∀ p, ρ (e p) = p) |
| 40 | (gamma : ℝ → M) (hperiod : Function.Periodic gamma curvePeriod) |
| 41 | (hgamma : ContMDiff 𝓘(ℝ, ℝ) (𝓡 n) 2 gamma) |
| 42 | (himm : ∀ x, curveVelocity (n := n) gamma x ≠ 0) : |
| 43 | ∃ T : ℝ, a < T ∧ T < b ∧ ∃ c : ℝ → ℝ → M, |
| 44 | M63C2ShrinkingCurveOn F c (Icc a T) ∧ |
| 45 | (∀ x, c x a = gamma x) ∧ M63IntrinsicRegularityOn F c (Icc a T) := by |
| 46 | let L := ∫ x in (0 : ℝ)..curvePeriod, curveSpeed F (fun y _ => gamma y) a x |
| 47 | obtain ⟨hL, σ, _hσformula, hσ, _hσinv, _hσzero, hσpos, _hσinvpos, hσshift, |
| 48 | _hσinvshift, hper0, hgamma0, himm0, hunit0, _hprincipal0, _hrecover⟩ := |
| 49 | exists_c2_unit_speed_parameter F gamma a hperiod hgamma himm |
| 50 | let κ := L / curvePeriod |
| 51 | have hκ : 0 < κ := div_pos hL Real.two_pi_pos |
| 52 | obtain ⟨S, haS, hSb, d, hd, hd0, hi⟩ := |
| 53 | exists_intrinsic_c2_local_curve_of_unit_initial F hcompact |
| 54 | he hU heU hρ hρe hL hper0 hgamma0 himm0 hunit0 |
| 55 | let phi : ℝ → ℝ := fun x => σ x / κ |
| 56 | have hphi : ContDiff ℝ 2 phi := hσ.div_const κ |
| 57 | have hphipos (x : ℝ) : 0 < deriv phi x := by |
| 58 | have hdphi := ((hσ.differentiable (by norm_num) x).hasDerivAt).div_const κ |
| 59 | rw [hdphi.deriv] |
| 60 | exact div_pos (hσpos x) hκ |
| 61 | have hphishift (x : ℝ) : phi (x + curvePeriod) = phi x + curvePeriod := by |
| 62 | change σ (x + curvePeriod) / κ = σ x / κ + curvePeriod |
| 63 | rw [hσshift, add_div] |
| 64 | congr 1 |
| 65 | dsimp only [κ, L] |
| 66 | field_simp [hL.ne', Real.two_pi_pos.ne'] |
| 67 | have hcancel (x : ℝ) : κ * phi x = σ x := by |
| 68 | dsimp only [phi] |
| 69 | field_simp [hκ.ne'] |
| 70 | let T := (a + S) / 2 |
| 71 | have haT : a < T := by dsimp only [T]; linarith only [haS] |
| 72 | have hTS : T < S := by dsimp only [T]; linarith only [haS] |
| 73 | have hsub : Icc a T ⊆ Icc a S := Icc_subset_Icc_right hTS.le |
| 74 | let c := fun x t => d (phi x) t |
| 75 | have hc : M63C2ShrinkingCurveOn F c (Icc a T) := |
| 76 | c2_restrict (c2ShrinkingCurve_fixedLabel_comp F hd hphi hphipos hphishift) hsub |
| 77 | have hslice (i : ℕ) (t : ℝ) (ht : t ∈ Ioo a S) : |
| 78 | ContMDiff 𝓘(ℝ, ℝ) ((𝓡 n).prod (𝓡 n)) 1 |
| 79 | (fun y => (⟨d y t, m63CurvatureJet F d i t y⟩ : TangentBundle (𝓡 n) M)) := by |
| 80 | intro x |
| 81 | have hm : (x, t) ∈ univ ×ˢ interior (Icc a S) := |
| 82 | ⟨mem_univ _, by simpa only [interior_Icc] using ht⟩ |
| 83 | have hiat := ((hi.interior_jets i) (x, t) hm).contMDiffAt |
| 84 | ((isOpen_univ.prod isOpen_interior).mem_nhds hm) |
| 85 | have hline : ContMDiffAt 𝓘(ℝ, ℝ) 𝓘(ℝ, ℝ × ℝ) 1 (fun y : ℝ => (y, t)) x := |
| 86 | (contDiffAt_id.prodMk contDiffAt_const).contMDiffAt |
| 87 | exact hiat.comp x hline |
| 88 | have hjet (i : ℕ) (t : ℝ) (ht : t ∈ Ioo a S) (x : ℝ) : |
| 89 | m63CurvatureJet F c i t x = m63CurvatureJet F d i t (phi x) := |
| 90 | curvatureJet_comp F d ((hd.spatial_regular t (Ioo_subset_Icc_self ht)).mdifferentiable |
| 91 | (by norm_num)) (hphi.differentiable (by norm_num)) hphipos |
| 92 | (fun y => (unitTangent_contMDiff_of_c2 F d |
| 93 | (hd.spatial_regular t (Ioo_subset_Icc_self ht)) |
| 94 | (hd.immersed t (Ioo_subset_Icc_self ht)) (phi y)).mdifferentiableAt (by norm_num)) |
| 95 | (fun k y => (hslice k t ht (phi y)).mdifferentiableAt (by norm_num)) i x |
| 96 | let B : ℝ × ℝ → ℝ × ℝ := fun z => (phi z.1, z.2) |
| 97 | have hB : ContDiff ℝ 1 B := |
| 98 | ((hphi.of_le (by norm_num)).comp contDiff_fst).prodMk contDiff_snd |
| 99 | have hnew (i : ℕ) : ContMDiffOn 𝓘(ℝ, ℝ × ℝ) ((𝓡 n).prod (𝓡 n)) 1 |
| 100 | (fun z : ℝ × ℝ => |
| 101 | (⟨c z.1 z.2, m63CurvatureJet F c i z.2 z.1⟩ : TangentBundle (𝓡 n) M)) |
| 102 | (univ ×ˢ Ioo a S) := by |
| 103 | have hold := hi.interior_jets i |
| 104 | rw [interior_Icc] at hold |
| 105 | have hcomp := hold.comp (s := univ ×ˢ Ioo a S) (f := B) |
| 106 | hB.contMDiff.contMDiffOn (fun _ hz => ⟨mem_univ _, hz.2⟩) |
| 107 | apply hcomp.congr |
| 108 | intro z hz |
| 109 | change (⟨c z.1 z.2, m63CurvatureJet F c i z.2 z.1⟩ : TangentBundle (𝓡 n) M) = |
| 110 | (⟨c z.1 z.2, m63CurvatureJet F d i z.2 (phi z.1)⟩ : TangentBundle (𝓡 n) M) |
| 111 | rw [hjet i z.2 hz.2 z.1] |
| 112 | refine ⟨T, haT, hTS.trans hSb, c, hc, ?_, ?_⟩ |
| 113 | · intro x |
| 114 | change d (phi x) a = gamma x |
| 115 | rw [hd0] |
| 116 | change gamma (σ.symm (κ * phi x)) = gamma x |
| 117 | rw [hcancel, σ.symm_apply_apply] |
| 118 | · refine { interior_jets := ?_, closed_positive_jets := ?_ } |
| 119 | · intro i |
| 120 | rw [interior_Icc] |
| 121 | exact (hnew i).mono (prod_mono Subset.rfl |
| 122 | (fun _ ht => ⟨ht.1, ht.2.trans hTS⟩)) |
| 123 | · intro tau s hat _hts hslab i |
| 124 | exact (hnew i).continuousOn.mono (prod_mono Subset.rfl |
| 125 | (fun t ht => ⟨hat.trans_le ht.1, (hslab ht).2.trans_lt hTS⟩)) |
| 126 | |
| 127 | /-- Compactness supplies the embedding and retraction for the actual |
| 128 | intrinsic C2 local solution with prescribed labels. MT2007 Claim 19.1, |
| 129 | p. 437; intrinsic C2 existence derivation, statement 3. -/ |
| 130 | theorem exists_intrinsic_c2_local_curve [CompactSpace M] |
| 131 | (F : RicciFlow n M (Icc a b)) (gamma : ℝ → M) |
| 132 | (hperiod : Function.Periodic gamma curvePeriod) |
| 133 | (hgamma : ContMDiff 𝓘(ℝ, ℝ) (𝓡 n) 2 gamma) |
| 134 | (himm : ∀ x, curveVelocity (n := n) gamma x ≠ 0) : |
| 135 | ∃ T : ℝ, a < T ∧ T < b ∧ ∃ c : ℝ → ℝ → M, |
| 136 | M63C2ShrinkingCurveOn F c (Icc a T) ∧ |
| 137 | (∀ x, c x a = gamma x) ∧ M63IntrinsicRegularityOn F c (Icc a T) := by |
| 138 | let : Nonempty M := ⟨gamma 0⟩ |
| 139 | obtain ⟨N, e, he, hemb, hinj⟩ := exists_embedding_euclidean_of_compact (I := 𝓡 n) (M := M) |
| 140 | obtain ⟨U, ρ, hU, heU, hρ, hρe, _hmin, _huniq⟩ := |
| 141 | exists_smooth_compact_embedded_retraction e hemb he hinj |
| 142 | exact exists_intrinsic_c2_local_curve_of_retraction F isCompact_univ |
| 143 | he hU heU hρ hρe gamma hperiod hgamma himm |
| 144 | |
| 145 | end PoincareMT.M63 |