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.Endpoint.StripFrontier |
| 2 | |
| 3 | /-! Either actual inward endpoint cut selects the side of a graph strip, |
| 4 | including strips ending at a straight join. No smooth joined arc is used. |
| 5 | |
| 6 | Morgan--Tian context: Claim 19.40, printed pp. 470-471, within Proposition 19.35, |
| 7 | pp. 467-481. These project constructions supply the actual collar and straight-join |
| 8 | geometry for the regional Gauss--Bonnet argument. |
| 9 | -/ |
| 10 | |
| 11 | noncomputable section |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open Set Filter |
| 16 | open scoped Topology ContDiff |
| 17 | open Poincare.Topology.Plane.Curves |
| 18 | |
| 19 | namespace PoincareMT |
| 20 | |
| 21 | /-- An actual inward endpoint ray supplies a positive-height point of the same graph strip |
| 22 | in the open region. Source: |
| 23 | `proof-work/tasks/M64/derivations/2026-09-27-finite-corner-assembly.md`, Section 4. -/ |
| 24 | theorem m64Intrinsic_graph_strip_inward_endpoint_point |
| 25 | (L : (ℝ × ℝ) ≃L[ℝ] AnnulusCoordinates) |
| 26 | {X : Set ℝ} (hX : IsOpen X) {f : ℝ → ℝ} (hf : ContDiffOn ℝ ∞ f X) |
| 27 | {a b ua wa ub wb rho : ℝ} (P : TransverseGraphCuts f a b ua wa ub wb) |
| 28 | (hrho : 0 < rho) (right : Bool) {U : Set AnnulusCoordinates} |
| 29 | (hray : ∀ᶠ r in 𝓝[>] (0 : ℝ), |
| 30 | L (if right then (b, f b) else (a, f a)) + |
| 31 | r • L (if right then (ub, wb) else (ua, wa)) ∈ U) : |
| 32 | ∃ z ∈ Ioo (0 : ℝ) rho, |
| 33 | P.linearCoordinates L hX hf (if right then 1 else 0, z) ∈ U := by |
| 34 | cases right |
| 35 | · obtain ⟨epsilon, hepsilon, hcut⟩ := |
| 36 | P.left.exists_small_positive_parameters (lt_min hrho P.radius_pos) |
| 37 | have hsmall : ∀ᶠ r in 𝓝[>] (0 : ℝ), r ∈ Ioo (0 : ℝ) epsilon := |
| 38 | Ioo_mem_nhdsGT hepsilon |
| 39 | obtain ⟨r, hr, hrU⟩ := (hsmall.and hray).exists |
| 40 | have hrcut := hcut r hr |
| 41 | have hz : P.left.parameter r ∈ Ioo (-P.radius) P.radius := |
| 42 | ⟨by linarith [hrcut.2.1, P.radius_pos], hrcut.2.2.trans_le (min_le_right _ _)⟩ |
| 43 | refine ⟨P.left.parameter r, |
| 44 | ⟨hrcut.2.1, hrcut.2.2.trans_le (min_le_left _ _)⟩, ?_⟩ |
| 45 | simp only [Bool.false_eq_true, if_false] |
| 46 | rw [P.linearCoordinates_left L hX hf hz, P.left.parameter.left_inv hrcut.1] |
| 47 | exact hrU |
| 48 | · obtain ⟨epsilon, hepsilon, hcut⟩ := |
| 49 | P.right.exists_small_positive_parameters (lt_min hrho P.radius_pos) |
| 50 | have hsmall : ∀ᶠ r in 𝓝[>] (0 : ℝ), r ∈ Ioo (0 : ℝ) epsilon := |
| 51 | Ioo_mem_nhdsGT hepsilon |
| 52 | obtain ⟨r, hr, hrU⟩ := (hsmall.and hray).exists |
| 53 | have hrcut := hcut r hr |
| 54 | have hz : P.right.parameter r ∈ Ioo (-P.radius) P.radius := |
| 55 | ⟨by linarith [hrcut.2.1, P.radius_pos], hrcut.2.2.trans_le (min_le_right _ _)⟩ |
| 56 | refine ⟨P.right.parameter r, |
| 57 | ⟨hrcut.2.1, hrcut.2.2.trans_le (min_le_left _ _)⟩, ?_⟩ |
| 58 | simp only [if_true] |
| 59 | rw [P.linearCoordinates_right L hX hf hz, P.right.parameter.left_inv hrcut.1] |
| 60 | exact hrU |
| 61 | |
| 62 | /-- Connectedness propagates an occupied positive point across the closed half-strip when |
| 63 | its only frontier contacts are on the zero-height axis. Source: |
| 64 | `proof-work/tasks/M64/derivations/2026-09-27-finite-corner-assembly.md`, Section 4. -/ |
| 65 | theorem m64Intrinsic_closed_half_strip_inside |
| 66 | {U : Set AnnulusCoordinates} (hU : IsOpen U) |
| 67 | (S : OpenPartialHomeomorph (ℝ × ℝ) AnnulusCoordinates) {rho : ℝ} (hrho : 0 < rho) |
| 68 | (hstrip : ∀ t ∈ Icc (0 : ℝ) 1, ∀ z : ℝ, |z| < rho → |
| 69 | (t, z) ∈ S.source ∧ (S (t, z) ∈ frontier U ↔ z = 0)) |
| 70 | (hpoint : ∃ t ∈ Icc (0 : ℝ) 1, ∃ z ∈ Ioo (0 : ℝ) rho, S (t, z) ∈ U) : |
| 71 | ∀ t ∈ Icc (0 : ℝ) 1, ∀ z ∈ Icc (0 : ℝ) (rho / 2), |
| 72 | (t, z) ∈ S.source ∧ S (t, z) ∈ closure U ∧ (0 < z → S (t, z) ∈ U) := by |
| 73 | let Q := Icc (0 : ℝ) 1 ×ˢ Ioo (0 : ℝ) rho |
| 74 | have hQ : Q ⊆ S.source := fun q hq => |
| 75 | (hstrip q.1 hq.1 q.2 (by simpa only [abs_of_pos hq.2.1] using hq.2.2)).1 |
| 76 | have hconn : IsPreconnected (S '' Q) := |
| 77 | (isPreconnected_Icc.prod isPreconnected_Ioo).image S (S.continuousOn.mono hQ) |
| 78 | obtain ⟨t, ht, z, hz, hp⟩ := hpoint |
| 79 | have hsub : S '' Q ⊆ U := hconn.subset_of_closure_inter_subset hU |
| 80 | ⟨S (t, z), ⟨(t, z), ⟨ht, hz⟩, rfl⟩, hp⟩ (by |
| 81 | rintro p ⟨hp, q, hq, rfl⟩ |
| 82 | by_contra hn |
| 83 | have hpf : S q ∈ frontier U := ⟨hp, by simpa only [hU.interior_eq] using hn⟩ |
| 84 | exact hq.2.1.ne' ((hstrip q.1 hq.1 q.2 |
| 85 | (by simpa only [abs_of_pos hq.2.1] using hq.2.2)).2.mp hpf)) |
| 86 | intro t ht z hz |
| 87 | have hzr : z < rho := hz.2.trans_lt (half_lt_self hrho) |
| 88 | have hzabs : |z| < rho := by simpa only [abs_of_nonneg hz.1] using hzr |
| 89 | have hpos : 0 < z → S (t, z) ∈ U := fun hp => hsub ⟨(t, z), ⟨ht, hp, hzr⟩, rfl⟩ |
| 90 | refine ⟨(hstrip t ht z hzabs).1, ?_, hpos⟩ |
| 91 | rcases hz.1.eq_or_lt with hz0 | hp |
| 92 | · exact frontier_subset_closure ((hstrip t ht z hzabs).2.mpr hz0.symm) |
| 93 | · exact subset_closure (hpos hp) |
| 94 | |
| 95 | end PoincareMT |