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.RegularFiber.OpenSubset |
| 2 | import PoincareLib.Geometry.Manifold.RegularLevel.UniversalProperty |
| 3 | |
| 4 | /-! |
| 5 | # Smooth maps into simultaneous regular fibers |
| 6 | |
| 7 | The constructed fiber atlas has the expected universal property: a map is |
| 8 | smooth precisely when its composition with the ambient inclusion is smooth. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | set_option backward.isDefEq.respectTransparency false |
| 13 | |
| 14 | open Set Function TopologicalSpace |
| 15 | open scoped Manifold ContDiff Topology |
| 16 | |
| 17 | namespace Poincare.Geometry.Manifold.RegularFiber |
| 18 | |
| 19 | variable {m k : ℕ} {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 20 | [FiniteDimensional ℝ E] [Fact (Module.finrank ℝ E = m + k)] |
| 21 | {M : Type*} [TopologicalSpace M] [ChartedSpace E M] [IsManifold 𝓘(ℝ, E) ∞ M] |
| 22 | {E' : Type*} [NormedAddCommGroup E'] [NormedSpace ℝ E'] |
| 23 | {H' : Type*} [TopologicalSpace H'] {J : ModelWithCorners ℝ E' H'} |
| 24 | {N : Type*} [TopologicalSpace N] [ChartedSpace H' N] |
| 25 | {f : M → Fin k → ℝ} |
| 26 | (hf : ContMDiff 𝓘(ℝ, E) 𝓘(ℝ, Fin k → ℝ) ∞ f) (c : Fin k → ℝ) |
| 27 | (hreg : ∀ x : M, f x = c → Surjective (mfderiv 𝓘(ℝ, E) 𝓘(ℝ, Fin k → ℝ) f x)) |
| 28 | |
| 29 | /-- Smoothness into the actual fiber is detected by its ambient inclusion. -/ |
| 30 | theorem contMDiffAt_into_fiber_iff (F : N → (f ⁻¹' {c} : Set M)) (x : N) : |
| 31 | let := fiberChartedSpace (m := m) hf c hreg |
| 32 | ContMDiffAt J (𝓡 m) ∞ F x ↔ |
| 33 | ContMDiffAt J 𝓘(ℝ, E) ∞ (fun y => (F y : M)) x := by |
| 34 | let := fiberChartedSpace (m := m) hf c hreg |
| 35 | constructor |
| 36 | · intro hF |
| 37 | exact (contMDiff_fiber_val hf c hreg (F x)).comp x hF |
| 38 | · intro hF |
| 39 | rw [contMDiffAt_iff_target] |
| 40 | refine ⟨Topology.IsInducing.subtypeVal.continuousAt_iff.mpr hF.continuousAt, ?_⟩ |
| 41 | have hc := (contMDiffOn_adaptedChart (m := m) hf (F x) (hreg (F x) (F x).2)).contMDiffAt |
| 42 | ((adaptedChart (m := m) hf (F x) (hreg (F x) (F x).2)).open_source.mem_nhds |
| 43 | (mem_adaptedChart_source hf (F x) (hreg (F x) (F x).2))) |
| 44 | have hproj := contDiff_snd.contDiffAt.contMDiffAt.comp x (hc.comp x hF) |
| 45 | convert! hproj using 1 |
| 46 | |
| 47 | /-- The same universal property holds for simultaneous fibers in an open region. -/ |
| 48 | theorem contMDiffAt_into_openFiber_iff (U : Opens M) |
| 49 | (hregU : ∀ x ∈ U, Surjective (mfderiv 𝓘(ℝ, E) 𝓘(ℝ, Fin k → ℝ) f x)) |
| 50 | (F : N → openFiber f U c) (x : N) : |
| 51 | let := openFiberChartedSpace (m := m) hf U hregU c |
| 52 | ContMDiffAt J (𝓡 m) ∞ F x ↔ |
| 53 | ContMDiffAt J 𝓘(ℝ, E) ∞ (openFiberIncl f U c ∘ F) x := by |
| 54 | let := openFiberChartedSpace (m := m) hf U hregU c |
| 55 | have h := contMDiffAt_into_fiber_iff (m := m) (J := J) |
| 56 | (hf.comp contMDiff_subtype_val) c |
| 57 | (fun y _ => openFiberRestrict_regular hf U hregU y) F x |
| 58 | exact h.trans (ContMDiffAt.subtypeVal_comp_iff U (fun y => (F y : U)) x).symm |
| 59 | |
| 60 | /-- Smoothness into an open regular fiber on an open source domain. -/ |
| 61 | theorem contMDiffOn_into_openFiber_iff (U : Opens M) |
| 62 | (hregU : ∀ x ∈ U, Surjective (mfderiv 𝓘(ℝ, E) 𝓘(ℝ, Fin k → ℝ) f x)) |
| 63 | (F : N → openFiber f U c) {V : Set N} (hV : IsOpen V) : |
| 64 | let := openFiberChartedSpace (m := m) hf U hregU c |
| 65 | ContMDiffOn J (𝓡 m) ∞ F V ↔ |
| 66 | ContMDiffOn J 𝓘(ℝ, E) ∞ (openFiberIncl f U c ∘ F) V := by |
| 67 | let := openFiberChartedSpace (m := m) hf U hregU c |
| 68 | constructor |
| 69 | · intro hF x hx |
| 70 | exact ((contMDiffAt_into_openFiber_iff hf c U hregU F x).mp |
| 71 | ((hF x hx).contMDiffAt (hV.mem_nhds hx))).contMDiffWithinAt |
| 72 | · intro hF x hx |
| 73 | exact ((contMDiffAt_into_openFiber_iff hf c U hregU F x).mpr |
| 74 | ((hF x hx).contMDiffAt (hV.mem_nhds hx))).contMDiffWithinAt |
| 75 | |
| 76 | end Poincare.Geometry.Manifold.RegularFiber |
| 77 |