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.Order.Compact |
| 2 | import Mathlib.Topology.Instances.Real.Lemmas |
| 3 | |
| 4 | /-! |
| 5 | # Attainment and continuity from common compact sublevels |
| 6 | |
| 7 | A bounded comparator and a single compact set containing its sublevel |
| 8 | make compact minimization global. The same compact set for a parameter |
| 9 | family gives continuity of the actual spatial infimum. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set |
| 15 | |
| 16 | namespace PoincareMT.ReducedVolume |
| 17 | |
| 18 | variable {X A : Type*} [TopologicalSpace X] [TopologicalSpace A] |
| 19 | |
| 20 | /-- A compact sublevel containing one comparator contains a global minimizer. -/ |
| 21 | theorem exists_global_minimum_of_compact_sublevel {f : X → ℝ} (hf : Continuous f) |
| 22 | {K : Set X} (hK : IsCompact K) {L : ℝ} |
| 23 | (hsub : ∀ x, f x ≤ L → x ∈ K) (hcomp : ∃ x, f x ≤ L) : |
| 24 | ∃ x ∈ K, (∀ y, f x ≤ f y) ∧ f x = sInf (range f) := by |
| 25 | obtain ⟨z, hz⟩ := hcomp |
| 26 | have hzK := hsub z hz |
| 27 | obtain ⟨x, hx, hmin⟩ := hK.exists_isMinOn ⟨z, hzK⟩ hf.continuousOn |
| 28 | have hglobal (y : X) : f x ≤ f y := by |
| 29 | by_cases hy : f y ≤ L |
| 30 | · exact hmin (hsub y hy) |
| 31 | · exact (hmin hzK).trans (hz.trans (le_of_not_ge hy)) |
| 32 | refine ⟨x, hx, hglobal, ?_⟩ |
| 33 | apply Eq.symm |
| 34 | apply IsLeast.csInf_eq |
| 35 | refine ⟨mem_range_self x, ?_⟩ |
| 36 | rintro _ ⟨y, rfl⟩ |
| 37 | exact hglobal y |
| 38 | |
| 39 | /-- A continuous family with one common compact low sublevel has continuous spatial infima. -/ |
| 40 | theorem continuous_sInf_of_compact_sublevels {f : A → X → ℝ} |
| 41 | (hf : Continuous (fun z : A × X ↦ f z.1 z.2)) |
| 42 | {K : Set X} (hK : IsCompact K) {L : ℝ} |
| 43 | (hsub : ∀ a x, f a x ≤ L → x ∈ K) (hcomp : ∀ a, ∃ x, f a x ≤ L) : |
| 44 | Continuous (fun a ↦ sInf (range (f a))) := by |
| 45 | have heq (a : A) : sInf (range (f a)) = sInf (f a '' K) := by |
| 46 | obtain ⟨x, hx, hmin, hval⟩ := exists_global_minimum_of_compact_sublevel (f := f a) |
| 47 | (hf.comp (continuous_const.prodMk continuous_id)) hK (hsub a) (hcomp a) |
| 48 | rw [← hval] |
| 49 | apply Eq.symm |
| 50 | apply IsLeast.csInf_eq |
| 51 | refine ⟨mem_image_of_mem _ hx, ?_⟩ |
| 52 | rintro _ ⟨y, _, rfl⟩ |
| 53 | exact hmin y |
| 54 | simp_rw [heq] |
| 55 | exact hK.continuous_sInf hf |
| 56 | |
| 57 | end PoincareMT.ReducedVolume |