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.UniversalProperty |
| 2 | import Mathlib.Geometry.Manifold.Diffeomorph |
| 3 | |
| 4 | /-! # Canonical smooth identifications of equal simultaneous fibers -/ |
| 5 | |
| 6 | noncomputable section |
| 7 | set_option autoImplicit false |
| 8 | set_option backward.isDefEq.respectTransparency false |
| 9 | open Set Function TopologicalSpace |
| 10 | open scoped Manifold ContDiff Topology |
| 11 | namespace Poincare.Geometry.Manifold.RegularFiber |
| 12 | |
| 13 | variable {k : ℕ} {M : Type*} [TopologicalSpace M] |
| 14 | {f h : M → Fin k → ℝ} {U V : Opens M} {c d : Fin k → ℝ} |
| 15 | |
| 16 | /-- The ambient identity identifies equal simultaneous fibers as sets. -/ |
| 17 | def openFiberEquivOfEq |
| 18 | (he : ∀ x, (x ∈ U ∧ f x = c) ↔ (x ∈ V ∧ h x = d)) : |
| 19 | openFiber f U c ≃ openFiber h V d where |
| 20 | toFun x := ⟨⟨x.1.1, (he x.1.1).mp ⟨x.1.2, x.2⟩ |>.1⟩, |
| 21 | (he x.1.1).mp ⟨x.1.2, x.2⟩ |>.2⟩ |
| 22 | invFun x := ⟨⟨x.1.1, (he x.1.1).mpr ⟨x.1.2, x.2⟩ |>.1⟩, |
| 23 | (he x.1.1).mpr ⟨x.1.2, x.2⟩ |>.2⟩ |
| 24 | left_inv _ := rfl |
| 25 | right_inv _ := rfl |
| 26 | |
| 27 | @[simp] theorem openFiberIncl_openFiberEquivOfEq |
| 28 | (he : ∀ x, (x ∈ U ∧ f x = c) ↔ (x ∈ V ∧ h x = d)) |
| 29 | (x : openFiber f U c) : |
| 30 | openFiberIncl h V d (openFiberEquivOfEq he x) = openFiberIncl f U c x := rfl |
| 31 | |
| 32 | variable {m : ℕ} {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 33 | [FiniteDimensional ℝ E] [Fact (Module.finrank ℝ E = m+k)] |
| 34 | [ChartedSpace E M] [IsManifold 𝓘(ℝ,E) ∞ M] |
| 35 | (hf : ContMDiff 𝓘(ℝ,E) 𝓘(ℝ,Fin k → ℝ) ∞ f) |
| 36 | (hh : ContMDiff 𝓘(ℝ,E) 𝓘(ℝ,Fin k → ℝ) ∞ h) |
| 37 | (hregf : ∀ x ∈ U, Surjective (mfderiv 𝓘(ℝ,E) 𝓘(ℝ,Fin k → ℝ) f x)) |
| 38 | (hregh : ∀ x ∈ V, Surjective (mfderiv 𝓘(ℝ,E) 𝓘(ℝ,Fin k → ℝ) h x)) |
| 39 | |
| 40 | /-- The ambient identity identifies the actual regular-fiber smooth structures. -/ |
| 41 | def openFiberDiffeomorphOfEq |
| 42 | (he : ∀ x, (x ∈ U ∧ f x = c) ↔ (x ∈ V ∧ h x = d)) : |
| 43 | letI := openFiberChartedSpace (m := m) hf U hregf c |
| 44 | letI := openFiberChartedSpace (m := m) hh V hregh d |
| 45 | openFiber f U c ≃ₘ⟮𝓡 m, 𝓡 m⟯ openFiber h V d := by |
| 46 | letI := openFiberChartedSpace (m := m) hf U hregf c |
| 47 | letI := openFiberChartedSpace (m := m) hh V hregh d |
| 48 | refine { openFiberEquivOfEq he with contMDiff_toFun := ?_, contMDiff_invFun := ?_ } |
| 49 | · intro x |
| 50 | apply (contMDiffAt_into_openFiber_iff (m := m) hh d V hregh |
| 51 | (openFiberEquivOfEq he) x).mpr |
| 52 | exact contMDiff_openFiberIncl (m := m) hf U hregf c x |
| 53 | · intro x |
| 54 | apply (contMDiffAt_into_openFiber_iff (m := m) hf c U hregf |
| 55 | (openFiberEquivOfEq he).symm x).mpr |
| 56 | exact contMDiff_openFiberIncl (m := m) hh V hregh d x |
| 57 | |
| 58 | end Poincare.Geometry.Manifold.RegularFiber |
| 59 |