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.MeasureTheory.Measure.MeasureSpace |
| 2 | import Mathlib.Topology.ContinuousOn |
| 3 | |
| 4 | /-! |
| 5 | # Open preimages under maps with full-measure image |
| 6 | |
| 7 | Restricting a continuous map on an open domain to an open target set |
| 8 | preserves that target set's measure whenever the original image is full. |
| 9 | This is the measure step in Morgan-Tian Proposition 12.13, pp. 304-306. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set MeasureTheory |
| 15 | |
| 16 | namespace PoincareMT.M34 |
| 17 | |
| 18 | /-- A full-measure image intersects each open target set in the image |
| 19 | of an open subset of the original domain (Proposition 12.13). -/ |
| 20 | theorem exists_open_image_measure_eq {X Y : Type*} |
| 21 | [TopologicalSpace X] [TopologicalSpace Y] [MeasurableSpace Y] |
| 22 | {f : X → Y} {S : Set X} (hS : IsOpen S) (hf : ContinuousOn f S) |
| 23 | (mu : Measure Y) (hfull : mu (f '' S)ᶜ = 0) |
| 24 | {B : Set Y} (hB : IsOpen B) : |
| 25 | ∃ W : Set X, IsOpen W ∧ W ⊆ S ∧ f '' W ⊆ B ∧ mu (f '' W) = mu B := by |
| 26 | refine ⟨S ∩ f ⁻¹' B, hf.isOpen_inter_preimage hS hB, inter_subset_left, ?_, ?_⟩ |
| 27 | · rintro _ ⟨x, hx, rfl⟩ |
| 28 | exact hx.2 |
| 29 | · rw [image_inter_preimage] |
| 30 | exact Measure.measure_inter_eq_of_ae (ae_iff.mpr hfull) |
| 31 | |
| 32 | end PoincareMT.M34 |