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.Topology.CompactOpen |
| 2 | |
| 3 | /-! |
| 4 | # Bundling a continuous family of paths on its parameter set |
| 5 | |
| 6 | Morgan-Tian Lemma 6.18, pp. 113-114. The compact-open exponential law |
| 7 | turns joint continuity into continuity of the path-valued family. A fixed |
| 8 | fallback path defines the family outside the specified parameter set, |
| 9 | where no continuity or equation is asserted. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set |
| 15 | |
| 16 | namespace PoincareMT.M14 |
| 17 | |
| 18 | variable {P K F : Type*} [TopologicalSpace P] [TopologicalSpace K] [TopologicalSpace F] |
| 19 | |
| 20 | /-- Jointly continuous paths on a parameter set have a continuous |
| 21 | path-valued representative there, the path-space continuity input to |
| 22 | Lemma 6.18, pp. 113-114. -/ |
| 23 | theorem exists_continuousOn_pathFamily {U : Set P} (f : P × K → F) |
| 24 | (hf : ContinuousOn f (U ×ˢ univ)) (fallback : C(K, F)) : |
| 25 | ∃ Φ : P → C(K, F), ContinuousOn Φ U ∧ ∀ p ∈ U, ∀ k, Φ p k = f (p, k) := by |
| 26 | classical |
| 27 | let Φ : P → C(K, F) := fun p => if hp : p ∈ U then |
| 28 | ⟨fun k => f (p, k), hf.comp_continuous (continuous_const.prodMk continuous_id) |
| 29 | (fun _ => ⟨hp, mem_univ _⟩)⟩ else fallback |
| 30 | have heq (p : P) (hp : p ∈ U) (k : K) : Φ p k = f (p, k) := by |
| 31 | simp only [Φ, dif_pos hp, ContinuousMap.coe_mk] |
| 32 | refine ⟨Φ, ContinuousMap.continuousOn_of_continuousOn_uncurry Φ ?_, heq⟩ |
| 33 | exact hf.congr (fun z hz => heq z.1 hz.1 z.2) |
| 34 | |
| 35 | end PoincareMT.M14 |