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 PoincareLib.Geometry.RicciFlow.Surgery.Induction.Noncollapse.StableSet.RegularImage.SliceInverse |
| 2 | |
| 3 | /-! |
| 4 | # Finite inverse capture near a compact regular fiber |
| 5 | |
| 6 | Morgan--Tian Corollary 6.67 and Claim 6.69, pp. 139-140. |
| 7 | A finite subcover of a compact endpoint fiber supplies inverse sources. |
| 8 | The image of the remaining compact set is closed and misses the selected |
| 9 | endpoint. One common target neighborhood therefore captures all nearby |
| 10 | members of the compact family in these finitely many inverse sources. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set |
| 16 | |
| 17 | universe u v |
| 18 | |
| 19 | namespace PoincareMT.Proofs.M46 |
| 20 | |
| 21 | /-- Compact fiber capture supplies finitely many local inverse branches |
| 22 | on one target neighborhood, as used in Corollary 6.67, p. 140. -/ |
| 23 | theorem finite_inverse_fiber_capture |
| 24 | {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y] |
| 25 | [T2Space X] [T2Space Y] {f : X → Y} {B : Set X} |
| 26 | (hB : IsCompact B) (hf : ContinuousOn f B) (q : Y) |
| 27 | (e : {z : X // z ∈ B ∧ f z = q} → OpenPartialHomeomorph X Y) |
| 28 | (hsource : ∀ z, z.val ∈ (e z).source) |
| 29 | (hvalue : ∀ z, EqOn (e z) f (e z).source) : |
| 30 | ∃ J : Finset {z : X // z ∈ B ∧ f z = q}, |
| 31 | ∃ V : Set Y, IsOpen V ∧ q ∈ V ∧ |
| 32 | (∀ i ∈ J, V ⊆ (e i).target) ∧ |
| 33 | ∀ z ∈ B, f z ∈ V → ∃ i ∈ J, z ∈ (e i).source := by |
| 34 | classical |
| 35 | let : T1Space Y := T2Space.t1Space |
| 36 | let K : Set X := {z | z ∈ B ∧ f z = q} |
| 37 | have hKclosed : IsClosed K := by |
| 38 | change IsClosed (B ∩ f ⁻¹' {q}) |
| 39 | exact hf.preimage_isClosed_of_isClosed hB.isClosed isClosed_singleton |
| 40 | have hK : IsCompact K := hB.of_isClosed_subset hKclosed (fun _ hz => hz.1) |
| 41 | obtain ⟨J, hcover⟩ := hK.elim_finite_subcover (fun i : K => (e i).source) |
| 42 | (fun i => (e i).open_source) (by |
| 43 | intro z hz |
| 44 | exact mem_iUnion.mpr ⟨⟨z, hz⟩, hsource ⟨z, hz⟩⟩) |
| 45 | let U := ⋃ i ∈ J, (e i).source |
| 46 | have hU : IsOpen U := isOpen_iUnion (fun i => isOpen_iUnion (fun _ => (e i).open_source)) |
| 47 | have hbad : IsClosed (f '' (B \ U)) := |
| 48 | ((hB.diff hU).image_of_continuousOn (hf.mono sdiff_subset)).isClosed |
| 49 | let V := (f '' (B \ U))ᶜ ∩ ⋂ i ∈ J, (e i).target |
| 50 | have hV : IsOpen V := hbad.isOpen_compl.inter |
| 51 | (isOpen_biInter_finset (fun i _ => (e i).open_target)) |
| 52 | have hqV : q ∈ V := by |
| 53 | constructor |
| 54 | · rintro ⟨z, hz, heq⟩ |
| 55 | exact hz.2 (hcover ⟨hz.1, heq⟩) |
| 56 | · apply mem_iInter.mpr |
| 57 | intro i |
| 58 | apply mem_iInter.mpr |
| 59 | intro _ |
| 60 | have htarget := (e i).map_source (hsource i) |
| 61 | rwa [hvalue i (hsource i), i.property.2] at htarget |
| 62 | refine ⟨J, V, hV, hqV, ?_, ?_⟩ |
| 63 | · intro i hi z hz |
| 64 | exact mem_iInter.mp (mem_iInter.mp hz.2 i) hi |
| 65 | · intro z hz htarget |
| 66 | have hzU : z ∈ U := by |
| 67 | by_contra hnot |
| 68 | exact htarget.1 ⟨z, ⟨hz, hnot⟩, rfl⟩ |
| 69 | obtain ⟨i, hi⟩ := mem_iUnion.mp hzU |
| 70 | obtain ⟨hiJ, hiSource⟩ := mem_iUnion.mp hi |
| 71 | exact ⟨i, hiJ, hiSource⟩ |
| 72 | |
| 73 | end PoincareMT.Proofs.M46 |