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.Continuous.DependenceEmbeddedJets |
| 2 | import PoincareLib.Geometry.CurveShortening.Ramp.Analysis.Periodic.SmoothApproximation |
| 3 | |
| 4 | /-! |
| 5 | # Compact metric image of actual initial jets |
| 6 | |
| 7 | The compact image of the three actual embedded jets supplies a metric |
| 8 | parameter space without imposing a metric on the original family. |
| 9 | MT2007 Claim 19.1, p. 437, and Lemma 19.17, pp. 449-450; |
| 10 | `2026-09-23-compact-initial-jet-image.md`. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff |
| 18 | |
| 19 | universe u v w |
| 20 | |
| 21 | namespace PoincareMT.M63 |
| 22 | |
| 23 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 25 | {ι : Type v} [Fintype ι] {Z : Type w} [TopologicalSpace Z] |
| 26 | |
| 27 | local notation "W" => EuclideanSpace ℝ ι |
| 28 | local notation "Y" => C(AddCircle curvePeriod, (W × W) × W) |
| 29 | |
| 30 | /-- The compact image of the actual C2 jets retains canonical immersed |
| 31 | curves, genuine derivative witnesses and the original family exactly. |
| 32 | MT2007 Claim 19.1, p. 437; compact initial-jet image derivation. -/ |
| 33 | theorem exists_compact_initialJet_image [CompactSpace Z] |
| 34 | (gamma : Z → ℝ → M) |
| 35 | (hperiod : ∀ z, Function.Periodic (gamma z) curvePeriod) |
| 36 | (hC2 : ∀ z, ContMDiff 𝓘(ℝ, ℝ) (𝓡 n) 2 (gamma z)) |
| 37 | (himm : ∀ z x, curveVelocity (n := n) (gamma z) x ≠ 0) |
| 38 | {e : M → W} (he : ContMDiff (𝓡 n) 𝓘(ℝ, W) ∞ e) |
| 39 | {ρ : W → M} (hρe : ∀ p, ρ (e p) = p) |
| 40 | (hzero : Continuous (fun z : Z × ℝ => e (gamma z.1 z.2))) |
| 41 | (hfirst : Continuous (fun z : Z × ℝ => |
| 42 | deriv (fun y => e (gamma z.1 y)) z.2)) |
| 43 | (hsecond : Continuous (fun z : Z × ℝ => |
| 44 | deriv (deriv (fun y => e (gamma z.1 y))) z.2)) : |
| 45 | ∃ J : C(Z, Y), |
| 46 | IsCompact (range (J : Z → Y)) ∧ |
| 47 | (∀ z (x : ℝ), J z (x : AddCircle curvePeriod) = |
| 48 | ((e (gamma z x), deriv (fun y => e (gamma z y)) x), |
| 49 | deriv (deriv (fun y => e (gamma z y))) x)) ∧ |
| 50 | let K := range (J : Z → Y) |
| 51 | let gammaK : K → ℝ → M := fun k x => |
| 52 | ρ ((k.1 (x : AddCircle curvePeriod)).1.1) |
| 53 | (∀ k : K, |
| 54 | Function.Periodic (gammaK k) curvePeriod ∧ |
| 55 | ContMDiff 𝓘(ℝ, ℝ) (𝓡 n) 2 (gammaK k) ∧ |
| 56 | (∀ x, curveVelocity (n := n) (gammaK k) x ≠ 0) ∧ |
| 57 | (∀ x, e (gammaK k x) = (k.1 (x : AddCircle curvePeriod)).1.1) ∧ |
| 58 | (∀ x : ℝ, HasDerivAt (fun y : ℝ => e (gammaK k y)) |
| 59 | (k.1 (x : AddCircle curvePeriod)).1.2 x) ∧ |
| 60 | (∀ x : ℝ, HasDerivAt (deriv (fun y : ℝ => e (gammaK k y))) |
| 61 | (k.1 (x : AddCircle curvePeriod)).2 x) ∧ |
| 62 | (∀ x, deriv (fun y : ℝ => e (gammaK k y)) x = |
| 63 | (k.1 (x : AddCircle curvePeriod)).1.2) ∧ |
| 64 | (∀ x, deriv (deriv (fun y : ℝ => e (gammaK k y))) x = |
| 65 | (k.1 (x : AddCircle curvePeriod)).2)) ∧ |
| 66 | Continuous (fun p : K × ℝ => e (gammaK p.1 p.2)) ∧ |
| 67 | Continuous (fun p : K × ℝ => deriv (fun y => e (gammaK p.1 y)) p.2) ∧ |
| 68 | Continuous (fun p : K × ℝ => |
| 69 | deriv (deriv (fun y => e (gammaK p.1 y))) p.2) ∧ |
| 70 | (∀ z (x : ℝ), gammaK (⟨J z, mem_range_self z⟩ : K) x = gamma z x) := by |
| 71 | classical |
| 72 | let : Fact (0 < curvePeriod) := ⟨by unfold curvePeriod; positivity⟩ |
| 73 | let f : Z → ℝ → W := fun z x => e (gamma z x) |
| 74 | have hf (z : Z) : ContDiff ℝ 2 (f z) := |
| 75 | ((he.of_le (ENat.natCast_le_of_coe_top_le_withTop le_rfl 2)).comp (hC2 z)).contDiff |
| 76 | have hfper (z : Z) : Function.Periodic (f z) curvePeriod := |
| 77 | fun x => congrArg e (hperiod z x) |
| 78 | have hpper (z : Z) : Function.Periodic (deriv (f z)) curvePeriod := |
| 79 | (hfper z).deriv_of_differentiable ((hf z).differentiable (by norm_num)) |
| 80 | have hrper (z : Z) : Function.Periodic (deriv (deriv (f z))) curvePeriod := |
| 81 | (hpper z).deriv_of_differentiable |
| 82 | (((hf z).deriv' (n := 1)).differentiable (by norm_num)) |
| 83 | let q : Z → ℝ → (W × W) × W := fun z x => |
| 84 | ((f z x, deriv (f z) x), deriv (deriv (f z)) x) |
| 85 | have hq : Continuous (fun z : Z × ℝ => q z.1 z.2) := |
| 86 | (hzero.prodMk hfirst).prodMk hsecond |
| 87 | have hqper (z : Z) : Function.Periodic (q z) curvePeriod := fun x => |
| 88 | Prod.ext (Prod.ext (hfper z x) (hpper z x)) (hrper z x) |
| 89 | let J0 : Z → Y := fun z => ⟨(hqper z).lift, |
| 90 | (QuotientAddGroup.isQuotientMap_mk |
| 91 | (AddSubgroup.zmultiples curvePeriod)).continuous_iff.mpr |
| 92 | (hq.comp (continuous_const.prodMk continuous_id))⟩ |
| 93 | have hrep0 (z : Z) (x : ℝ) : J0 z (x : AddCircle curvePeriod) = q z x := by |
| 94 | change (hqper z).lift (x : AddCircle curvePeriod) = q z x |
| 95 | exact Function.Periodic.lift_coe (hqper z) x |
| 96 | have hJ0 : Continuous J0 := by |
| 97 | apply ContinuousMap.continuous_of_continuous_uncurry |
| 98 | have hquot : IsOpenQuotientMap |
| 99 | (fun z : Z × ℝ => (z.1, (z.2 : AddCircle curvePeriod))) := |
| 100 | IsOpenQuotientMap.id.prodMap QuotientAddGroup.isOpenQuotientMap_mk |
| 101 | apply hquot.continuous_comp_iff.mp |
| 102 | simpa only [Function.comp_def, Function.uncurry, hrep0] using hq |
| 103 | let J : C(Z, Y) := ⟨J0, hJ0⟩ |
| 104 | have hrep (z : Z) (x : ℝ) : J z (x : AddCircle curvePeriod) = |
| 105 | ((e (gamma z x), deriv (fun y => e (gamma z y)) x), |
| 106 | deriv (deriv (fun y => e (gamma z y))) x) := hrep0 z x |
| 107 | let K := range (J : Z → Y) |
| 108 | let gammaK : K → ℝ → M := fun k x => |
| 109 | ρ ((k.1 (x : AddCircle curvePeriod)).1.1) |
| 110 | have hdata (k : K) : |
| 111 | Function.Periodic (gammaK k) curvePeriod ∧ |
| 112 | ContMDiff 𝓘(ℝ, ℝ) (𝓡 n) 2 (gammaK k) ∧ |
| 113 | (∀ x, curveVelocity (n := n) (gammaK k) x ≠ 0) ∧ |
| 114 | (∀ x, e (gammaK k x) = (k.1 (x : AddCircle curvePeriod)).1.1) ∧ |
| 115 | (∀ x : ℝ, HasDerivAt (fun y : ℝ => e (gammaK k y)) |
| 116 | (k.1 (x : AddCircle curvePeriod)).1.2 x) ∧ |
| 117 | (∀ x : ℝ, HasDerivAt (deriv (fun y : ℝ => e (gammaK k y))) |
| 118 | (k.1 (x : AddCircle curvePeriod)).2 x) ∧ |
| 119 | (∀ x, deriv (fun y : ℝ => e (gammaK k y)) x = |
| 120 | (k.1 (x : AddCircle curvePeriod)).1.2) ∧ |
| 121 | (∀ x, deriv (deriv (fun y : ℝ => e (gammaK k y))) x = |
| 122 | (k.1 (x : AddCircle curvePeriod)).2) := by |
| 123 | obtain ⟨z, hz⟩ := k.2 |
| 124 | have hk : gammaK k = gamma z := by |
| 125 | funext x |
| 126 | change ρ ((k.1 (x : AddCircle curvePeriod)).1.1) = gamma z x |
| 127 | rw [← hz, hrep] |
| 128 | exact hρe _ |
| 129 | have hd (x : ℝ) : HasDerivAt (fun y : ℝ => e (gammaK k y)) |
| 130 | (k.1 (x : AddCircle curvePeriod)).1.2 x := by |
| 131 | rw [hk, ← hz, hrep] |
| 132 | exact ((hf z).differentiable (by norm_num) x).hasDerivAt |
| 133 | have hdd (x : ℝ) : HasDerivAt (deriv (fun y : ℝ => e (gammaK k y))) |
| 134 | (k.1 (x : AddCircle curvePeriod)).2 x := by |
| 135 | rw [hk, ← hz, hrep] |
| 136 | exact (((hf z).deriv' (n := 1)).differentiable (by norm_num) x).hasDerivAt |
| 137 | refine ⟨hk.symm ▸ hperiod z, hk.symm ▸ hC2 z, ?_, ?_, hd, hdd, |
| 138 | fun x => (hd x).deriv, fun x => (hdd x).deriv⟩ |
| 139 | · exact hk.symm ▸ himm z |
| 140 | · intro x |
| 141 | rw [hk, ← hz, hrep] |
| 142 | have heval : Continuous |
| 143 | (fun p : K × ℝ => p.1.1 (p.2 : AddCircle curvePeriod)) := |
| 144 | (continuous_subtype_val.comp continuous_fst).eval |
| 145 | ((AddCircle.continuous_mk' curvePeriod).comp continuous_snd) |
| 146 | refine ⟨J, isCompact_range J.continuous, hrep, hdata, ?_, ?_, ?_, ?_⟩ |
| 147 | · exact heval.fst.fst.congr (fun p => ((hdata p.1).2.2.2.1 p.2).symm) |
| 148 | · exact heval.fst.snd.congr (fun p => ((hdata p.1).2.2.2.2.2.2.1 p.2).symm) |
| 149 | · exact heval.snd.congr (fun p => ((hdata p.1).2.2.2.2.2.2.2 p.2).symm) |
| 150 | · intro z x |
| 151 | change ρ ((J z (x : AddCircle curvePeriod)).1.1) = gamma z x |
| 152 | rw [hrep] |
| 153 | exact hρe _ |
| 154 | |
| 155 | end PoincareMT.M63 |