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.CurveShortening.Comparison.IntrinsicComparison.Return.Side |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Jordan.Corner |
| 3 | |
| 4 | /-! |
| 5 | # Selecting the annular side of two complementary-arc regions |
| 6 | |
| 7 | Containment of the second frontier in the first closed region forces |
| 8 | containment of their bounded domains. A point on the omitted circle arc |
| 9 | then puts the inner disk in the second exterior. |
| 10 | |
| 11 | Morgan--Tian context: Proposition 19.35, printed pp. 467-481. The project derivations |
| 12 | implement its intrinsic normal-geodesic, focusing and retained-length comparison |
| 13 | arguments. |
| 14 | -/ |
| 15 | |
| 16 | noncomputable section |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open Set Metric |
| 20 | open scoped Topology |
| 21 | |
| 22 | namespace PoincareMT |
| 23 | |
| 24 | /-- Nested frontiers force nested bounded Jordan domains. The unbounded exterior decides |
| 25 | which side of the second frontier contains the first exterior. Source: MT Claim 19.41, pp. |
| 26 | 471-472; the nested-region argument is recorded in |
| 27 | `derivations/2026-09-27-short-geodesic-digons.md`, Section 6. -/ |
| 28 | theorem m64Intrinsic_jordan_nested_of_frontier_subset |
| 29 | {U₁ V₁ U₂ V₂ : Set AnnulusCoordinates} |
| 30 | (hU₁ : IsOpen U₁) (hV₁ : IsOpen V₁) (hU₂ : IsOpen U₂) (hV₂ : IsOpen V₂) |
| 31 | (hpV₁ : IsPreconnected V₁) (hbU₂ : Bornology.IsBounded U₂) |
| 32 | (hbV₁ : ¬ Bornology.IsBounded V₁) |
| 33 | (hd₁ : Disjoint U₁ V₁) (hd₂ : Disjoint U₂ V₂) |
| 34 | (hc₁ : U₁ ∪ V₁ = (frontier U₁)ᶜ) |
| 35 | (hc₂ : U₂ ∪ V₂ = (frontier U₂)ᶜ) |
| 36 | (hf₁ : frontier U₁ = frontier V₁) |
| 37 | (hsub : frontier U₂ ⊆ closure U₁) : U₂ ⊆ U₁ := by |
| 38 | have hdcl : Disjoint (closure U₁) V₁ := hd₁.closure_left hV₁ |
| 39 | have hVcover : V₁ ⊆ U₂ ∪ V₂ := by |
| 40 | rw [hc₂] |
| 41 | exact fun x hx hf => disjoint_left.mp hdcl (hsub hf) hx |
| 42 | have hVV : V₁ ⊆ V₂ := by |
| 43 | rcases hpV₁.subset_or_subset hU₂ hV₂ hd₂ hVcover with h | h |
| 44 | · exact False.elim (hbV₁ (hbU₂.subset h)) |
| 45 | · exact h |
| 46 | have hUcl : U₂ ⊆ closure U₁ := by |
| 47 | intro x hx |
| 48 | by_contra hn |
| 49 | have hxf : x ∉ frontier U₁ := fun hf => hn (frontier_subset_closure hf) |
| 50 | have hxcover : x ∈ U₁ ∪ V₁ := by rwa [hc₁] |
| 51 | rcases hxcover with hx₁ | hx₁ |
| 52 | · exact hn (subset_closure hx₁) |
| 53 | · exact disjoint_left.mp hd₂ hx (hVV hx₁) |
| 54 | calc |
| 55 | U₂ = interior U₂ := hU₂.interior_eq.symm |
| 56 | _ ⊆ interior (closure U₁) := interior_mono hUcl |
| 57 | _ = U₁ := (m64Intrinsic_jordan_interior_closure hU₁ hV₁ hd₁ hf₁).1 |
| 58 | |
| 59 | /-- If two Jordan frontiers differ only on the inner circle and the first has a circle point |
| 60 | omitted by the second, at least one bounded region is entirely in the annulus. Neither |
| 61 | region is assumed to exclude the inner disk. Source: MT Claim 19.41, pp. 471-472; the |
| 62 | nested-region argument is recorded in `derivations/2026-09-27-short-geodesic-digons.md`, |
| 63 | Section 6. -/ |
| 64 | theorem m64Intrinsic_one_of_two_regions_is_annular |
| 65 | {U₁ V₁ U₂ V₂ : Set AnnulusCoordinates} |
| 66 | (hU₁ : IsOpen U₁) (hV₁ : IsOpen V₁) (hU₂ : IsOpen U₂) (hV₂ : IsOpen V₂) |
| 67 | (hpV₁ : IsPreconnected V₁) (hbU₂ : Bornology.IsBounded U₂) |
| 68 | (hbV₁ : ¬ Bornology.IsBounded V₁) |
| 69 | (hd₁ : Disjoint U₁ V₁) (hd₂ : Disjoint U₂ V₂) |
| 70 | (hc₁ : U₁ ∪ V₁ = (frontier U₁)ᶜ) |
| 71 | (hc₂ : U₂ ∪ V₂ = (frontier U₂)ᶜ) |
| 72 | (hf₁ : frontier U₁ = frontier V₁) |
| 73 | (hcompact₁ : IsCompact (closure U₁)) (hcompact₂ : IsCompact (closure U₂)) |
| 74 | (htrace₁ : frontier U₁ ⊆ standardAnnulusDomain) |
| 75 | (htrace₂ : frontier U₂ ⊆ standardAnnulusDomain) |
| 76 | (hshared : frontier U₂ ⊆ frontier U₁ ∪ closedBall (0 : AnnulusCoordinates) 1) |
| 77 | {p : AnnulusCoordinates} (hp : ‖p‖ = 1) |
| 78 | (hp₁ : p ∈ frontier U₁) (hp₂ : p ∉ frontier U₂) : |
| 79 | closure U₁ ⊆ standardAnnulusDomain ∨ closure U₂ ⊆ standardAnnulusDomain := by |
| 80 | rcases m64Intrinsic_jordan_annulus_dichotomy hU₁ hV₁ hd₁ hc₁ rfl hcompact₁ |
| 81 | htrace₁ with h | hball |
| 82 | · exact Or.inl h |
| 83 | right |
| 84 | have hclosedBall : closedBall (0 : AnnulusCoordinates) 1 ⊆ closure U₁ := by |
| 85 | rw [← closure_ball (0 : AnnulusCoordinates) (by norm_num : (1 : ℝ) ≠ 0)] |
| 86 | exact closure_mono hball |
| 87 | have hfrontsub : frontier U₂ ⊆ closure U₁ := |
| 88 | hshared.trans (union_subset frontier_subset_closure hclosedBall) |
| 89 | have hUU := m64Intrinsic_jordan_nested_of_frontier_subset hU₁ hV₁ hU₂ hV₂ |
| 90 | hpV₁ hbU₂ hbV₁ hd₁ hd₂ hc₁ hc₂ hf₁ hfrontsub |
| 91 | have hpnot : p ∉ U₁ := by simpa only [hU₁.interior_eq] using hp₁.2 |
| 92 | have hpV₂ : p ∈ V₂ := by |
| 93 | have hpc : p ∈ U₂ ∪ V₂ := by rwa [hc₂] |
| 94 | exact hpc.resolve_left (fun h => hpnot (hUU h)) |
| 95 | have hpball : p ∈ closure (ball (0 : AnnulusCoordinates) 1) := by |
| 96 | rw [closure_ball (0 : AnnulusCoordinates) (by norm_num : (1 : ℝ) ≠ 0)] |
| 97 | simp only [mem_closedBall, dist_zero_right, hp, le_refl] |
| 98 | obtain ⟨x, hxV₂, hxball⟩ := mem_closure_iff.mp hpball V₂ hV₂ hpV₂ |
| 99 | have hballcover : ball (0 : AnnulusCoordinates) 1 ⊆ U₂ ∪ V₂ := by |
| 100 | rw [hc₂] |
| 101 | intro z hz hf |
| 102 | have hz' : ‖z‖ < 1 := by simpa only [mem_ball, dist_zero_right] using hz |
| 103 | exact not_lt_of_ge (htrace₂ hf).1 hz' |
| 104 | have hballV₂ : ball (0 : AnnulusCoordinates) 1 ⊆ V₂ := by |
| 105 | rcases (convex_ball (0 : AnnulusCoordinates) (1 : ℝ)).isPreconnected.subset_or_subset |
| 106 | hU₂ hV₂ hd₂ hballcover with h | h |
| 107 | · exact False.elim (disjoint_left.mp hd₂ (h hxball) hxV₂) |
| 108 | · exact h |
| 109 | apply m64Intrinsic_jordan_closure_subset_annulus hcompact₂ ?_ htrace₂ |
| 110 | exact fun hzero => disjoint_left.mp (hd₂.closure_left hV₂) hzero |
| 111 | (hballV₂ (mem_ball_self zero_lt_one)) |
| 112 | |
| 113 | end PoincareMT |