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.AlgebraicTopology.HomotopyGroup.LoopSpace.Comparison.LocalChartApproximation |
| 2 | |
| 3 | /-! |
| 4 | # Finite chart approximation with one fixed value |
| 5 | |
| 6 | Successive replacements have summable error, retain smoothness already |
| 7 | obtained, and fix the full inverse image of the chosen value. Compact bump |
| 8 | supports give a tolerance preserving every remaining chart condition. |
| 9 | Source: the finite-chart derivation for MT Claim 18.16, printed p. 430. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set Filter Function |
| 15 | open scoped Manifold ContDiff Topology |
| 16 | |
| 17 | namespace PoincareMT.Proofs.M59 |
| 18 | |
| 19 | variable {E H X F K M : Type*} |
| 20 | [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] |
| 21 | [TopologicalSpace H] (I : ModelWithCorners ℝ E H) |
| 22 | [TopologicalSpace X] [ChartedSpace H X] [IsManifold I ∞ X] |
| 23 | [T2Space X] [NormalSpace X] [SigmaCompactSpace X] |
| 24 | [NormedAddCommGroup F] [NormedSpace ℝ F] [TopologicalSpace K] |
| 25 | (J : ModelWithCorners ℝ F K) [J.Boundaryless] |
| 26 | [MetricSpace M] [ChartedSpace K M] [IsManifold J ∞ M] |
| 27 | |
| 28 | omit [IsManifold I ∞ X] [NormalSpace X] [SigmaCompactSpace X] |
| 29 | [J.Boundaryless] [IsManifold J ∞ M] in |
| 30 | /-- Finitely many compact bump supports give one error tolerance preserving |
| 31 | all chart-source conditions. Source: MT Claim 18.16, p. 430, approximation. -/ |
| 32 | theorem exists_finite_chart_tolerance |
| 33 | (L : List ((Σ x : X, SmoothBumpFunction I x) × M)) (f : X → M) (hf : Continuous f) |
| 34 | (hL : ∀ a ∈ L, ∀ x ∈ tsupport a.1.2, f x ∈ (extChartAt J a.2).source) : |
| 35 | ∃ delta > 0, ∀ g : X → M, (∀ x, dist (g x) (f x) < delta) → |
| 36 | ∀ a ∈ L, ∀ x ∈ tsupport a.1.2, g x ∈ (extChartAt J a.2).source := by |
| 37 | induction L with |
| 38 | | nil => exact ⟨1, zero_lt_one, fun _ _ _ h => False.elim (List.not_mem_nil h)⟩ |
| 39 | | cons a L ih => |
| 40 | obtain ⟨d, hd, hrest⟩ := ih (fun c hc => hL c (List.mem_cons_of_mem _ hc)) |
| 41 | have hcompact := a.1.2.hasCompactSupport.image hf |
| 42 | have hsubset : f '' tsupport a.1.2 ⊆ (extChartAt J a.2).source := by |
| 43 | rintro _ ⟨x, hx, rfl⟩ |
| 44 | exact hL a (List.mem_cons_self) x hx |
| 45 | obtain ⟨e, he, hnear⟩ := hcompact.exists_thickening_subset_open |
| 46 | (isOpen_extChartAt_source a.2) hsubset |
| 47 | refine ⟨min d e, lt_min hd he, ?_⟩ |
| 48 | intro g hg c hc x hx |
| 49 | rcases List.mem_cons.mp hc with rfl | hc |
| 50 | · exact hnear (Metric.mem_thickening_iff.mpr |
| 51 | ⟨f x, ⟨x, hx, rfl⟩, (hg x).trans_le (min_le_right _ _)⟩) |
| 52 | · exact hrest g (fun x => (hg x).trans_le (min_le_left _ _)) c hc x hx |
| 53 | |
| 54 | /-- Finitely many supported coordinate replacements make the map smooth |
| 55 | on every plateau, with prescribed error and one fixed value. |
| 56 | Source: MT Claim 18.16, p. 430, finite-chart approximation derivation. -/ |
| 57 | theorem exists_finite_chart_approximation |
| 58 | (L : List ((Σ x : X, SmoothBumpFunction I x) × M)) |
| 59 | (f : X → M) (hf : Continuous f) |
| 60 | (hL : ∀ a ∈ L, ∀ x ∈ tsupport a.1.2, f x ∈ (extChartAt J a.2).source) |
| 61 | (p : M) {epsilon : ℝ} (he : 0 < epsilon) : |
| 62 | ∃ g : X → M, Continuous g ∧ (∀ x, dist (g x) (f x) < epsilon) ∧ |
| 63 | (∀ x, f x = p → g x = p) ∧ |
| 64 | (∀ x, ContMDiffAt I J ∞ f x → ContMDiffAt I J ∞ g x) ∧ |
| 65 | ∀ a ∈ L, ∀ x, (a.1.2 : X → ℝ) =ᶠ[𝓝 x] 1 → ContMDiffAt I J ∞ g x := by |
| 66 | induction L generalizing f epsilon with |
| 67 | | nil => |
| 68 | exact ⟨f, hf, fun x => by simpa only [dist_self] using he, |
| 69 | fun _ h => h, fun _ h => h, fun _ h => False.elim (List.not_mem_nil h)⟩ |
| 70 | | cons a L ih => |
| 71 | obtain ⟨delta, hd, htolerance⟩ := exists_finite_chart_tolerance I J L f hf |
| 72 | (fun c hc => hL c (List.mem_cons_of_mem _ hc)) |
| 73 | obtain ⟨g, hg, hgf, hgp, hgs, hga⟩ := exists_local_chart_approximation I J a.2 a.1.2 |
| 74 | a.1.2.contMDiff a.1.2.hasCompactSupport (fun _ => a.1.2.mem_Icc) f hf |
| 75 | (hL a List.mem_cons_self) p (lt_min (half_pos he) hd) |
| 76 | have hgL : ∀ c ∈ L, ∀ x ∈ tsupport c.1.2, g x ∈ (extChartAt J c.2).source := |
| 77 | htolerance g (fun x => (hgf x).trans_le (min_le_right _ _)) |
| 78 | obtain ⟨k, hk, hkg, hkp, hks, hkL⟩ := ih g hg hgL (half_pos he) |
| 79 | refine ⟨k, hk, ?_, fun x hx => hkp x (hgp x hx), |
| 80 | fun x hx => hks x (hgs x hx), ?_⟩ |
| 81 | · intro x |
| 82 | have hsum := add_lt_add (hkg x) ((hgf x).trans_le (min_le_left _ _)) |
| 83 | have hdist := (dist_triangle (k x) (g x) (f x)).trans_lt hsum |
| 84 | simpa only [add_halves] using hdist |
| 85 | · intro c hc x hx |
| 86 | rcases List.mem_cons.mp hc with rfl | hc |
| 87 | · exact hks x (hga x hx) |
| 88 | · exact hkL c hc x hx |
| 89 | |
| 90 | /-- Every continuous manifold-valued map admits a smooth approximation near |
| 91 | a prescribed compact set, with arbitrary uniform error and one fixed value. |
| 92 | Source: the based approximation for MT Claim 18.16, printed p. 430. -/ |
| 93 | theorem exists_compact_manifold_approximation |
| 94 | (f : X → M) (hf : Continuous f) {S : Set X} (hS : IsCompact S) |
| 95 | (p : M) {epsilon : ℝ} (he : 0 < epsilon) : |
| 96 | ∃ g : X → M, Continuous g ∧ (∀ x, dist (g x) (f x) < epsilon) ∧ |
| 97 | (∀ x, f x = p → g x = p) ∧ ∀ x ∈ S, ContMDiffAt I J ∞ g x := by |
| 98 | classical |
| 99 | have hb : ∀ x : X, ∃ b : SmoothBumpFunction I x, |
| 100 | ∀ y ∈ tsupport b, f y ∈ (extChartAt J (f x)).source := by |
| 101 | intro x |
| 102 | have hsource : f ⁻¹' (extChartAt J (f x)).source ∈ 𝓝 x := |
| 103 | hf.continuousAt ((isOpen_extChartAt_source (f x)).mem_nhds (mem_extChartAt_source (f x))) |
| 104 | obtain ⟨b, _, hb⟩ := (SmoothBumpFunction.nhds_basis_tsupport (I := I) x).mem_iff.mp hsource |
| 105 | exact ⟨b, hb⟩ |
| 106 | choose b hb using hb |
| 107 | let U : X → Set X := fun x => interior {y | b x y = 1} |
| 108 | have hcover : S ⊆ ⋃ x, U x := by |
| 109 | intro x _ |
| 110 | exact mem_iUnion.mpr ⟨x, mem_interior_iff_mem_nhds.mpr (b x).eventuallyEq_one⟩ |
| 111 | obtain ⟨s, hs⟩ := hS.elim_finite_subcover U (fun _ => isOpen_interior) hcover |
| 112 | let L : List ((Σ x : X, SmoothBumpFunction I x) × M) := |
| 113 | s.toList.map (fun x => (⟨x, b x⟩, f x)) |
| 114 | have hL : ∀ a ∈ L, ∀ x ∈ tsupport a.1.2, f x ∈ (extChartAt J a.2).source := by |
| 115 | intro a ha |
| 116 | obtain ⟨x, _, rfl⟩ := List.mem_map.mp ha |
| 117 | exact hb x |
| 118 | obtain ⟨g, hg, herr, hfix, _, hsmooth⟩ := exists_finite_chart_approximation I J L f hf hL p he |
| 119 | refine ⟨g, hg, herr, hfix, ?_⟩ |
| 120 | intro x hx |
| 121 | obtain ⟨c, hc, hcx⟩ := mem_iUnion₂.mp (hs hx) |
| 122 | exact hsmooth (⟨c, b c⟩, f c) |
| 123 | (List.mem_map.mpr ⟨c, Finset.mem_toList.mpr hc, rfl⟩) x |
| 124 | (mem_interior_iff_mem_nhds.mp hcx) |
| 125 | |
| 126 | end PoincareMT.Proofs.M59 |