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.Semicontinuity.Basic |
| 2 | import Mathlib.Topology.Compactness.Compact |
| 3 | |
| 4 | /-! |
| 5 | # Lower semicontinuity from compact minimizing lifts |
| 6 | |
| 7 | A continuous cost on a compact parameter set has closed endpoint images |
| 8 | of its sublevels. Local realization of minima then gives lower |
| 9 | semicontinuity. The application constructs the parameter set from M09's |
| 10 | bounded minimizing initial vectors. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open scoped Topology |
| 16 | |
| 17 | namespace PoincareMT.ReducedVolume |
| 18 | |
| 19 | /-- Compact continuous minimizing lifts imply lower semicontinuity at the center. -/ |
| 20 | theorem lowerSemicontinuousAt_of_compact_lifts |
| 21 | {X Y : Type*} [TopologicalSpace X] [T2Space X] [TopologicalSpace Y] |
| 22 | {l : X → ℝ} {x : X} {Q : Set X} (hQ : Q ∈ 𝓝 x) |
| 23 | {K : Set Y} (hK : IsCompact K) {endpoint : Y → X} {cost : Y → ℝ} |
| 24 | (hendpoint : ContinuousOn endpoint K) (hcost : ContinuousOn cost K) |
| 25 | (hrealizes : ∀ z ∈ Q, ∃ w ∈ K, endpoint w = z ∧ cost w = l z) |
| 26 | (hcomparison : ∀ w ∈ K, endpoint w = x → l x ≤ cost w) : |
| 27 | LowerSemicontinuousAt l x := by |
| 28 | intro c hc |
| 29 | let : CompactSpace K := isCompact_iff_compactSpace.mp hK |
| 30 | let S : Set K := {w | cost w ≤ c} |
| 31 | have hS : IsCompact S := |
| 32 | (isClosed_le hcost.domRestrict continuous_const).isCompact |
| 33 | have hclosed : IsClosed ((fun w : K ↦ endpoint w) '' S) := |
| 34 | (hS.image hendpoint.domRestrict).isClosed |
| 35 | have hx : x ∈ ((fun w : K ↦ endpoint w) '' S)ᶜ := by |
| 36 | rintro ⟨w, hw, hwx⟩ |
| 37 | exact (not_le_of_gt hc) ((hcomparison w w.property hwx).trans hw) |
| 38 | filter_upwards [hQ, hclosed.isOpen_compl.mem_nhds hx] with z hz hzoutside |
| 39 | by_contra hzle |
| 40 | obtain ⟨w, hw, hwz, hwl⟩ := hrealizes z hz |
| 41 | apply hzoutside |
| 42 | exact ⟨⟨w, hw⟩, by simpa only [S, Set.mem_ofPred_eq, hwl] using le_of_not_gt hzle, hwz⟩ |
| 43 | |
| 44 | end PoincareMT.ReducedVolume |