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.AncientKappa.Compactness.Boundedness.Projective.Collar |
| 2 | |
| 3 | /-! |
| 4 | # Collars of projective height graphs |
| 5 | |
| 6 | An antipodally invariant graph in a projective cylinder is compact and |
| 7 | connected and has a product collar through the original cylinder covering. |
| 8 | Compactness of the sphere supplies a uniform width for vertical translation. |
| 9 | -/ |
| 10 | |
| 11 | noncomputable section |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open Set |
| 16 | open scoped Topology |
| 17 | |
| 18 | namespace PoincareMT |
| 19 | |
| 20 | /-- A continuous antipodally invariant graph inside a projective cylinder |
| 21 | has an actual open product collar with the original covering-map formula. -/ |
| 22 | theorem exists_projectiveHeightGraph_collar |
| 23 | {M : Type*} [TopologicalSpace M] (f : RoundCylinderSpace → M) {s : ℝ} |
| 24 | (hf : IsLocalHomeomorphOn f (univ ×ˢ Ioo (-s) s)) |
| 25 | (hfiber : ∀ z ∈ univ ×ˢ Ioo (-s) s, ∀ w ∈ univ ×ˢ Ioo (-s) s, |
| 26 | f z = f w ↔ w = z ∨ w = (-z.1, z.2)) |
| 27 | (u : UnitTwoSphere → ℝ) (hu : Continuous u) |
| 28 | (heven : ∀ q, u (-q) = u q) (hbound : ∀ q, |u q| < s) : |
| 29 | IsCompact (range (fun q : UnitTwoSphere => f (q, u q))) ∧ |
| 30 | IsConnected (range (fun q : UnitTwoSphere => f (q, u q))) ∧ |
| 31 | ∃ (δ : ℝ) (hδ : 0 < δ) (W : Set M), IsOpen W ∧ |
| 32 | W ⊆ f '' (univ ×ˢ Ioo (-s) s) ∧ |
| 33 | ∃ e : (RealProjectiveTwo × Ioo (-δ) δ) ≃ₜ W, |
| 34 | (∀ (q : UnitTwoSphere) (t : Ioo (-δ) δ), |
| 35 | (e (Quotient.mk realProjectiveTwoSetoid q, t)).val = f (q, u q + t.val)) ∧ |
| 36 | range (fun q : RealProjectiveTwo => |
| 37 | (e (q, ⟨0, neg_lt_zero.mpr hδ, hδ⟩)).val) = |
| 38 | range (fun q : UnitTwoSphere => f (q, u q)) := by |
| 39 | have hc : Continuous (fun q : UnitTwoSphere => f (q, u q)) := |
| 40 | hf.continuousOn.comp_continuous (continuous_id.prodMk hu) |
| 41 | (fun q => ⟨mem_univ q, abs_lt.mp (hbound q)⟩) |
| 42 | refine ⟨isCompact_range hc, isConnected_range hc, ?_⟩ |
| 43 | obtain ⟨q₀, _, hmax⟩ := isCompact_univ.exists_isMaxOn |
| 44 | (Set.univ_nonempty : (univ : Set UnitTwoSphere).Nonempty) hu.abs.continuousOn |
| 45 | let δ := (s - |u q₀|) / 2 |
| 46 | have hδ : 0 < δ := half_pos (sub_pos.mpr (hbound q₀)) |
| 47 | have hshift (q : UnitTwoSphere) {t : ℝ} (ht : t ∈ Ioo (-δ) δ) : |
| 48 | u q + t ∈ Ioo (-s) s := by |
| 49 | have hq : |u q| ≤ |u q₀| := hmax (mem_univ q) |
| 50 | have hq₀ := hbound q₀ |
| 51 | have huq := abs_le.mp hq |
| 52 | dsimp [δ] at ht |
| 53 | constructor <;> linarith [ht.1, ht.2, huq.1, huq.2] |
| 54 | let T : RoundCylinderSpace ≃ₜ RoundCylinderSpace := { |
| 55 | toFun := fun z => (z.1, u z.1 + z.2) |
| 56 | invFun := fun z => (z.1, z.2 - u z.1) |
| 57 | left_inv := by intro z; simp |
| 58 | right_inv := by intro z; simp |
| 59 | continuous_toFun := continuous_fst.prodMk ((hu.comp continuous_fst).add continuous_snd) |
| 60 | continuous_invFun := continuous_fst.prodMk (continuous_snd.sub (hu.comp continuous_fst)) } |
| 61 | have hfT : IsLocalHomeomorphOn (f ∘ T) (univ ×ˢ Ioo (-δ) δ) := |
| 62 | hf.comp T.isLocalHomeomorph.isLocalHomeomorphOn |
| 63 | (fun z hz => ⟨mem_univ _, hshift z.1 hz.2⟩) |
| 64 | have hfiberT : ∀ z ∈ univ ×ˢ Ioo (-δ) δ, ∀ w ∈ univ ×ˢ Ioo (-δ) δ, |
| 65 | (f ∘ T) z = (f ∘ T) w ↔ w = z ∨ w = (-z.1, z.2) := by |
| 66 | intro z hz w hw |
| 67 | rw [Function.comp_apply, Function.comp_apply, |
| 68 | hfiber (T z) ⟨mem_univ _, hshift z.1 hz.2⟩ |
| 69 | (T w) ⟨mem_univ _, hshift w.1 hw.2⟩] |
| 70 | constructor |
| 71 | · rintro (heq | heq) |
| 72 | · exact Or.inl (T.injective heq) |
| 73 | · right |
| 74 | have hq : w.1 = -z.1 := congrArg Prod.fst heq |
| 75 | have ht : u w.1 + w.2 = u z.1 + z.2 := congrArg Prod.snd heq |
| 76 | rw [hq, heven] at ht |
| 77 | exact Prod.ext hq (add_left_cancel ht) |
| 78 | · rintro (rfl | rfl) |
| 79 | · exact Or.inl rfl |
| 80 | · exact Or.inr (Prod.ext rfl (by change u (-z.1) + z.2 = u z.1 + z.2; rw [heven])) |
| 81 | obtain ⟨hW, e, he⟩ := exists_projectiveCylinderSlab_homeomorph (f ∘ T) hfT hfiberT |
| 82 | refine ⟨δ, hδ, (f ∘ T) '' (univ ×ˢ Ioo (-δ) δ), hW, ?_, e, he, ?_⟩ |
| 83 | · rintro x ⟨z, hz, rfl⟩ |
| 84 | exact ⟨T z, ⟨mem_univ _, hshift z.1 hz.2⟩, rfl⟩ |
| 85 | · ext x |
| 86 | constructor |
| 87 | · rintro ⟨q, rfl⟩ |
| 88 | obtain ⟨q, rfl⟩ := Quotient.mk_surjective q |
| 89 | refine ⟨q, ?_⟩ |
| 90 | have h := (he q ⟨0, neg_lt_zero.mpr hδ, hδ⟩).symm |
| 91 | change f (q, u q + 0) = _ at h |
| 92 | simpa only [add_zero] using h |
| 93 | · rintro ⟨q, rfl⟩ |
| 94 | refine ⟨Quotient.mk realProjectiveTwoSetoid q, ?_⟩ |
| 95 | have h := he q ⟨0, neg_lt_zero.mpr hδ, hδ⟩ |
| 96 | change _ = f (q, u q + 0) at h |
| 97 | simpa only [add_zero] using h |
| 98 | |
| 99 | end PoincareMT |