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 | import Mathlib.Geometry.Manifold.Diffeomorph |
| 4 | /-! # Canonical identification of iterated and simultaneous fibers -/ |
| 5 | |
| 6 | set_option autoImplicit false |
| 7 | set_option backward.isDefEq.respectTransparency false |
| 8 | open Set Function TopologicalSpace |
| 9 | open Poincare.Geometry.Manifold.RegularLevel |
| 10 | open scoped Manifold ContDiff Topology |
| 11 | |
| 12 | namespace Poincare.Geometry.Manifold.RegularFiber |
| 13 | |
| 14 | /-- Forget the extra subtype wrappers when a level is taken inside a simultaneous fiber. -/ |
| 15 | def iteratedOpenFiberEquiv {M : Type*} [TopologicalSpace M] {k : ℕ} |
| 16 | (f : M → Fin k → ℝ) (φ : M → ℝ) (U : Opens M) |
| 17 | (c : Fin k → ℝ) (t : ℝ) : |
| 18 | openLevelSet (φ ∘ openFiberIncl f U c) ⊤ t ≃ |
| 19 | openFiber (fun y => Fin.cons (α := fun _ : Fin (k + 1) => ℝ) (φ y) (f y)) U |
| 20 | (Fin.cons t c) where |
| 21 | toFun x := ⟨(x.val.val : U), by |
| 22 | funext i |
| 23 | exact Fin.cases x.property (fun j => congrFun x.val.val.property j) i⟩ |
| 24 | invFun x := ⟨⟨⟨x.val, by |
| 25 | funext i |
| 26 | exact congrFun x.property i.succ⟩, trivial⟩, congrFun x.property 0⟩ |
| 27 | left_inv x := rfl |
| 28 | right_inv x := rfl |
| 29 | |
| 30 | @[simp] theorem openFiberIncl_iteratedOpenFiberEquiv |
| 31 | {M : Type*} [TopologicalSpace M] {k : ℕ} |
| 32 | (f : M → Fin k → ℝ) (φ : M → ℝ) (U : Opens M) |
| 33 | (c : Fin k → ℝ) (t : ℝ) |
| 34 | (x : openLevelSet (φ ∘ openFiberIncl f U c) ⊤ t) : |
| 35 | openFiberIncl (fun y => Fin.cons (α := fun _ : Fin (k + 1) => ℝ) (φ y) (f y)) U |
| 36 | (Fin.cons t c) (iteratedOpenFiberEquiv f φ U c t x) = |
| 37 | openFiberIncl f U c (openLevelIncl (φ ∘ openFiberIncl f U c) ⊤ t x) := rfl |
| 38 | |
| 39 | end Poincare.Geometry.Manifold.RegularFiber |
| 40 |