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 Mathlib.Geometry.Manifold.ContMDiff.Atlas |
| 2 | import Mathlib.Analysis.InnerProductSpace.PiL2 |
| 3 | |
| 4 | /-! |
| 5 | # Local factorization through an actual smooth manifold chart |
| 6 | |
| 7 | A smooth coordinate-source map into an open region factors locally |
| 8 | through an inverse chart whose entire chosen coordinate domain |
| 9 | stays in that region. Used for retained pullbacks in Morgan--Tian, |
| 10 | Proposition 16.5, pp. 374-375; see M44 derivation 61. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Filter |
| 16 | open scoped Manifold ContDiff Topology |
| 17 | |
| 18 | namespace Poincare |
| 19 | |
| 20 | local notation "E" n:max => EuclideanSpace ℝ (Fin n) |
| 21 | |
| 22 | /-- Locally factor a smooth map into an open manifold region |
| 23 | through an inverse coordinate chart remaining inside that region. -/ |
| 24 | theorem exists_smooth_local_chart_factorization |
| 25 | {n : ℕ} {M : Type*} [TopologicalSpace M] [ChartedSpace (E n) M] |
| 26 | [IsManifold 𝓘(ℝ, E n) ∞ M] |
| 27 | {f : E n → M} {V : Set (E n)} {R : Set M} |
| 28 | (hV : IsOpen V) (hR : IsOpen R) |
| 29 | (hf : ContMDiffOn 𝓘(ℝ, E n) 𝓘(ℝ, E n) ∞ f V) (hmap : MapsTo f V R) |
| 30 | {x : E n} (hx : x ∈ V) : |
| 31 | ∃ U W : Set (E n), IsOpen U ∧ IsOpen W ∧ x ∈ W ∧ W ⊆ V ∧ |
| 32 | U ⊆ (extChartAt 𝓘(ℝ, E n) (f x)).target ∧ |
| 33 | (extChartAt 𝓘(ℝ, E n) (f x)).symm '' U ⊆ R ∧ |
| 34 | ∃ k : E n → E n, ContDiffOn ℝ ∞ k W ∧ MapsTo k W U ∧ |
| 35 | ∀ y ∈ W, f y = (extChartAt 𝓘(ℝ, E n) (f x)).symm (k y) := by |
| 36 | let q := f x |
| 37 | let z := extChartAt 𝓘(ℝ, E n) q q |
| 38 | have hz : z ∈ (extChartAt 𝓘(ℝ, E n) q).target := mem_extChartAt_target q |
| 39 | have hinv := (contMDiffOn_extChartAt_symm (I := 𝓘(ℝ, E n)) (n := ∞) q).contMDiffAt |
| 40 | ((isOpen_extChartAt_target q).mem_nhds hz) |
| 41 | have hroot : (extChartAt 𝓘(ℝ, E n) q).symm z = q := extChartAt_to_inv q |
| 42 | have hRpre : (extChartAt 𝓘(ℝ, E n) q).symm ⁻¹' R ∈ 𝓝 z := |
| 43 | hinv.continuousAt.preimage_mem_nhds (hR.mem_nhds (by rw [hroot]; exact hmap hx)) |
| 44 | obtain ⟨epsilon, hepsilon, hball⟩ := Metric.mem_nhds_iff.mp |
| 45 | (inter_mem ((isOpen_extChartAt_target q).mem_nhds hz) hRpre) |
| 46 | let U := Metric.ball z epsilon |
| 47 | have hUT : U ⊆ (extChartAt 𝓘(ℝ, E n) q).target := fun _ hy => (hball hy).1 |
| 48 | have hUR : (extChartAt 𝓘(ℝ, E n) q).symm '' U ⊆ R := by |
| 49 | rintro _ ⟨y, hy, rfl⟩ |
| 50 | exact (hball hy).2 |
| 51 | let k := (extChartAt 𝓘(ℝ, E n) q) ∘ f |
| 52 | have hfx := hf.contMDiffAt (hV.mem_nhds hx) |
| 53 | have hkx : ContMDiffAt 𝓘(ℝ, E n) 𝓘(ℝ, E n) ∞ k x := |
| 54 | (contMDiffAt_extChartAt (I := 𝓘(ℝ, E n)) (x := q)).comp x hfx |
| 55 | have hknhds : k ⁻¹' U ∈ 𝓝 x := hkx.continuousAt.preimage_mem_nhds |
| 56 | (Metric.isOpen_ball.mem_nhds (Metric.mem_ball_self hepsilon)) |
| 57 | have hfnhds : f ⁻¹' (extChartAt 𝓘(ℝ, E n) q).source ∈ 𝓝 x := |
| 58 | hfx.continuousAt.preimage_mem_nhds (extChartAt_source_mem_nhds q) |
| 59 | obtain ⟨delta, hdelta, hsmall⟩ := Metric.mem_nhds_iff.mp |
| 60 | (inter_mem (hV.mem_nhds hx) (inter_mem hfnhds hknhds)) |
| 61 | let W := Metric.ball x delta |
| 62 | have hWV : W ⊆ V := fun _ hy => (hsmall hy).1 |
| 63 | have hfW : MapsTo f W (chartAt (E n) q).source := by |
| 64 | intro y hy |
| 65 | have h := (hsmall hy).2.1 |
| 66 | rwa [extChartAt_source] at h |
| 67 | have hkW : ContDiffOn ℝ ∞ k W := by |
| 68 | apply contMDiffOn_iff_contDiffOn.mp |
| 69 | exact (contMDiffOn_extChartAt (I := 𝓘(ℝ, E n)) (x := q)).comp (hf.mono hWV) hfW |
| 70 | refine ⟨U, W, Metric.isOpen_ball, Metric.isOpen_ball, Metric.mem_ball_self hdelta, |
| 71 | hWV, hUT, hUR, k, hkW, fun _ hy => (hsmall hy).2.2, ?_⟩ |
| 72 | intro y hy |
| 73 | exact ((extChartAt 𝓘(ℝ, E n) q).left_inv ((hsmall hy).2.1)).symm |
| 74 | |
| 75 | end Poincare |