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.Manifold.PartitionOfUnity.CompactSupport |
| 2 | import PoincareLib.Topology.Maps.ProperRestriction |
| 3 | |
| 4 | /-! |
| 5 | # Proper localization of a smooth level band |
| 6 | |
| 7 | Two actual compactly supported smooth cutoffs localize an approximation to |
| 8 | a continuous reference function. The inner cutoff removes low levels and the outer |
| 9 | cutoff replaces high levels by a constant above the target band. The resulting |
| 10 | function agrees locally with the original function on the core, and every |
| 11 | point in the target band belongs to that core. Compact support of the outer |
| 12 | cutoff supplies properness of the restriction to the target band. |
| 13 | -/ |
| 14 | |
| 15 | noncomputable section |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set Filter |
| 20 | open scoped Manifold ContDiff Topology |
| 21 | |
| 22 | namespace PoincareMT |
| 23 | |
| 24 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] [T3Space M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 26 | |
| 27 | /-- A smooth approximation on a sufficiently separated annulus admits a |
| 28 | proper localization of its target band, retaining the original smooth germ |
| 29 | throughout the core. Only two compact sublevels of the reference are needed. -/ |
| 30 | theorem exists_contMDiff_proper_band_localization |
| 31 | (d : M → ℝ) (hd : Continuous d) {u : M → ℝ} |
| 32 | (hu : ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ u) |
| 33 | {r0 r1 R0 R1 a b ε : ℝ} |
| 34 | (hr : r0 < r1) (hcore : r1 < R0) (hR : R0 < R1) |
| 35 | (ha : 0 < a) (_hab : a < b) (hinner : r1 + ε < a) (houter : b < R0 - ε) |
| 36 | (hcompact0 : IsCompact {x | d x ≤ r0}) (hcompactR0 : IsCompact {x | d x ≤ R0}) |
| 37 | (herr : ∀ x, r0 ≤ d x → d x ≤ R1 → |u x - d x| ≤ ε) : |
| 38 | ∃ f : M → ℝ, ∃ K : Set M, |
| 39 | ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ f ∧ IsCompact K ∧ f ⁻¹' Ioo a b ⊆ K ∧ |
| 40 | (∀ x, r1 < d x → d x < R0 → f =ᶠ[𝓝 x] u) ∧ |
| 41 | (∀ x, f x ∈ Ioo a b → r1 < d x ∧ d x < R0 ∧ f =ᶠ[𝓝 x] u) ∧ |
| 42 | IsProperMap ((Ioo a b).restrictPreimage f) := by |
| 43 | obtain ⟨ψ, hψ, hψcompact, hψsupport, hψbounds, hψone⟩ := |
| 44 | exists_contMDiff_cutoff_of_isCompact (n := n) hcompact0 |
| 45 | (isOpen_lt hd continuous_const) (fun x hx => hx.trans_lt hr) |
| 46 | obtain ⟨θ, hθ, hθcompact, hθsupport, hθbounds, hθone⟩ := |
| 47 | exists_contMDiff_cutoff_of_isCompact (n := n) hcompactR0 |
| 48 | (isOpen_lt hd continuous_const) (fun x hx => hx.trans_lt hR) |
| 49 | let Q := b + 1 |
| 50 | let f : M → ℝ := fun x => θ x * (1 - ψ x) * u x + (1 - θ x) * Q |
| 51 | have hf : ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ f := |
| 52 | ((hθ.mul (contMDiff_const.sub hψ)).mul hu).add |
| 53 | ((contMDiff_const.sub hθ).mul contMDiff_const) |
| 54 | have hQ : b < Q := by dsimp only [Q]; linarith |
| 55 | have hψzero (x : M) (hx : r1 ≤ d x) : ψ x = 0 := by |
| 56 | apply image_eq_zero_of_notMem_tsupport |
| 57 | intro hxs |
| 58 | exact (hψsupport hxs).not_ge hx |
| 59 | have hlow (x : M) (hx : d x ≤ r1) : f x < a := by |
| 60 | have hθx : θ x = 1 := (hθone x (hx.trans hcore.le)).self_of_nhds |
| 61 | have heq : f x = (1 - ψ x) * u x := by simp only [f, hθx]; ring |
| 62 | rw [heq] |
| 63 | by_cases hx0 : d x ≤ r0 |
| 64 | · have hψx : ψ x = 1 := (hψone x hx0).self_of_nhds |
| 65 | simpa only [hψx, sub_self, zero_mul] using ha |
| 66 | · have hx0' : r0 ≤ d x := (lt_of_not_ge hx0).le |
| 67 | have he := (abs_le.mp (herr x hx0' (hx.trans (hcore.le.trans hR.le)))).2 |
| 68 | have hub : u x < a := by linarith |
| 69 | have hp := hψbounds x |
| 70 | by_cases hu0 : u x ≤ 0 |
| 71 | · have hprod := mul_nonpos_of_nonneg_of_nonpos (sub_nonneg.mpr hp.2) hu0 |
| 72 | linarith |
| 73 | · have hu0' : 0 ≤ u x := (lt_of_not_ge hu0).le |
| 74 | have hprod := mul_nonneg hp.1 hu0' |
| 75 | nlinarith |
| 76 | have hhigh (x : M) (hx : R0 ≤ d x) : b < f x := by |
| 77 | have hψx : ψ x = 0 := hψzero x (hcore.le.trans hx) |
| 78 | have heq : f x = θ x * u x + (1 - θ x) * Q := by simp only [f, hψx]; ring |
| 79 | rw [heq] |
| 80 | by_cases hxR : d x < R1 |
| 81 | · have he := (abs_le.mp (herr x (hr.le.trans (hcore.le.trans hx)) hxR.le)).1 |
| 82 | have hbu : b < u x := by linarith |
| 83 | have hmin : b < min (u x) Q := lt_min hbu hQ |
| 84 | have hleft := mul_le_mul_of_nonneg_left (min_le_left (u x) Q) (hθbounds x).1 |
| 85 | have hright := mul_le_mul_of_nonneg_left (min_le_right (u x) Q) |
| 86 | (sub_nonneg.mpr (hθbounds x).2) |
| 87 | nlinarith |
| 88 | · have hθx : θ x = 0 := image_eq_zero_of_notMem_tsupport |
| 89 | (fun hxs => hxR (hθsupport hxs)) |
| 90 | simpa only [hθx, zero_mul, sub_zero, one_mul, zero_add] using hQ |
| 91 | have hagree (x : M) (hx1 : r1 < d x) (hx0 : d x < R0) : f =ᶠ[𝓝 x] u := by |
| 92 | have hxs : x ∉ tsupport ψ := fun hx => (hψsupport hx).not_ge hx1.le |
| 93 | filter_upwards [notMem_tsupport_iff_eventuallyEq.mp hxs, hθone x hx0.le] with y hyψ hyθ |
| 94 | simp only [Pi.zero_apply] at hyψ |
| 95 | simp only [Pi.one_apply] at hyθ |
| 96 | simp only [f, hyψ, hyθ, sub_zero, one_mul, sub_self, zero_mul, add_zero] |
| 97 | have hband (x : M) (hx : f x ∈ Ioo a b) : |
| 98 | r1 < d x ∧ d x < R0 ∧ f =ᶠ[𝓝 x] u := by |
| 99 | have hx1 : r1 < d x := by |
| 100 | by_contra h |
| 101 | have hl := hlow x (le_of_not_gt h) |
| 102 | linarith [hx.1] |
| 103 | have hx0 : d x < R0 := by |
| 104 | by_contra h |
| 105 | have hh := hhigh x (le_of_not_gt h) |
| 106 | linarith [hx.2] |
| 107 | exact ⟨hx1, hx0, hagree x hx1 hx0⟩ |
| 108 | have hcontained : f ⁻¹' Ioo a b ⊆ tsupport θ := by |
| 109 | intro x hx |
| 110 | by_contra hxs |
| 111 | have hθx : θ x = 0 := image_eq_zero_of_notMem_tsupport hxs |
| 112 | have hfx : f x = Q := by simp only [f, hθx, zero_mul, sub_zero, one_mul, zero_add] |
| 113 | have hxb : f x < b := hx.2 |
| 114 | rw [hfx] at hxb |
| 115 | linarith |
| 116 | exact ⟨f, tsupport θ, hf, hθcompact, hcontained, hagree, hband, |
| 117 | Poincare.isProperMap_real_restrictPreimage_of_isCompact hf.continuous (Ioo a b) |
| 118 | hθcompact hcontained⟩ |
| 119 | |
| 120 | end PoincareMT |