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.ContinuousOn |
| 2 | import Mathlib.Topology.Compactness.Compact |
| 3 | |
| 4 | /-! |
| 5 | # A uniform parameter neighborhood for a compact relative family |
| 6 | |
| 7 | The compact tube step in Morgan-Tian Proposition 6.30, pp. 118-119. |
| 8 | Continuity on a compact time set times an open parameter set suffices; |
| 9 | the time set need not itself be open. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set Filter |
| 15 | open scoped Topology |
| 16 | |
| 17 | namespace PoincareMT.M14 |
| 18 | |
| 19 | variable {A B C : Type*} [TopologicalSpace A] [TopologicalSpace B] [TopologicalSpace C] |
| 20 | |
| 21 | /-- A continuous compact family staying in an open target at one |
| 22 | parameter stays there throughout one open parameter neighborhood, |
| 23 | the relative compact tube step in Proposition 6.30, pp. 118-119. -/ |
| 24 | theorem exists_open_parameter_tube {K : Set A} {U : Set B} {V : Set C} |
| 25 | {f : A × B → C} (hK : IsCompact K) (hU : IsOpen U) |
| 26 | (hf : ContinuousOn f (K ×ˢ U)) (hV : IsOpen V) |
| 27 | {b : B} (hb : b ∈ U) (hcenter : ∀ a ∈ K, f (a, b) ∈ V) : |
| 28 | ∃ N : Set B, IsOpen N ∧ b ∈ N ∧ N ⊆ U ∧ ∀ a ∈ K, ∀ y ∈ N, f (a, y) ∈ V := by |
| 29 | obtain ⟨Ω, hΩ, heq⟩ := continuousOn_iff'.mp hf V hV |
| 30 | have hΩcenter (a : A) (ha : a ∈ K) : (a, b) ∈ Ω := by |
| 31 | have hz : (a, b) ∈ f ⁻¹' V ∩ (K ×ˢ U) := ⟨hcenter a ha, ha, hb⟩ |
| 32 | rw [heq] at hz |
| 33 | exact hz.1 |
| 34 | have hnear : ∀ᶠ y in 𝓝 b, ∀ a ∈ K, (a, y) ∈ Ω := by |
| 35 | apply hK.eventually_forall_of_forall_eventually |
| 36 | intro a ha |
| 37 | exact (hΩ.preimage continuous_swap).mem_nhds (hΩcenter a ha) |
| 38 | obtain ⟨N, hNsub, hN, hbN⟩ := mem_nhds_iff.mp hnear |
| 39 | refine ⟨N ∩ U, hN.inter hU, ⟨hbN, hb⟩, inter_subset_right, ?_⟩ |
| 40 | intro a ha y hy |
| 41 | have hz : (a, y) ∈ Ω ∩ (K ×ˢ U) := ⟨hNsub hy.1 a ha, ha, hy.2⟩ |
| 42 | rw [← heq] at hz |
| 43 | exact hz.1 |
| 44 | |
| 45 | end PoincareMT.M14 |