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.Joined.InwardPropagation |
| 2 | |
| 3 | /-! The two original arcs at a regular straight join have one common |
| 4 | inward normal sign. Source: MT Claim 19.40, pp. 470-471; |
| 5 | joined-orientation derivation, Section 3. -/ |
| 6 | |
| 7 | noncomputable section |
| 8 | set_option autoImplicit false |
| 9 | set_option backward.isDefEq.respectTransparency false |
| 10 | |
| 11 | open Set Filter |
| 12 | open scoped Topology ContDiff |
| 13 | open Poincare.Topology.Plane.Curves |
| 14 | |
| 15 | namespace PoincareMT |
| 16 | |
| 17 | /-- The actual Jordan domains choose a common inward sign on the two separately smooth arcs. |
| 18 | Disjointness of the domains excludes mismatched signs after propagation through their common |
| 19 | physical cut. Source: |
| 20 | `proof-work/tasks/M64/derivations/2026-09-27-joined-orientation-and-attachments.md`, Section |
| 21 | 3. -/ |
| 22 | theorem m64Intrinsic_exists_straight_join_inward_sign |
| 23 | {alpha beta : ℝ → AnnulusCoordinates} |
| 24 | (ha : ContDiff ℝ ∞ alpha) (hb : ContDiff ℝ ∞ beta) |
| 25 | {A0 A B B1 c : ℝ} (haA : A0 < A) (hBb : B < B1) (hc : 0 < c) |
| 26 | (hai : InjOn alpha (Icc A0 A)) (hbi : InjOn beta (Icc B B1)) |
| 27 | (hend : alpha A = beta B) (hreg : deriv alpha A ≠ 0) |
| 28 | (htan : deriv beta B = c • deriv alpha A) |
| 29 | (hmeet : ∀ s ∈ Icc A0 A, ∀ t ∈ Icc B B1, |
| 30 | alpha s = beta t → s = A ∧ t = B) |
| 31 | (hregularA : ∀ t ∈ Ioo A0 A, deriv alpha t ≠ 0) |
| 32 | (hregularB : ∀ t ∈ Ioo B B1, deriv beta t ≠ 0) |
| 33 | {K U V : Set AnnulusCoordinates} (hK : IsCompact K) (hpK : alpha A ∉ K) |
| 34 | (havoidA : ∀ t ∈ Ioo A0 A, alpha t ∉ K) |
| 35 | (havoidB : ∀ t ∈ Ioo B B1, beta t ∉ K) |
| 36 | (hU : IsOpen U) (hV : IsOpen V) (hUV : Disjoint U V) |
| 37 | (hfront : frontier U = alpha '' Icc A0 A ∪ beta '' Icc B B1 ∪ K) |
| 38 | (hfV : frontier V = frontier U) : |
| 39 | ∃ sigma : ℝ, (sigma = 1 ∨ sigma = -1) ∧ |
| 40 | (∀ t ∈ Ioo A0 A, ∀ᶠ r in 𝓝[>] (0 : ℝ), |
| 41 | alpha t + r • (sigma • quarterTurn (deriv alpha t)) ∈ U) ∧ |
| 42 | ∀ t ∈ Ioo B B1, ∀ᶠ r in 𝓝[>] (0 : ℝ), |
| 43 | beta t + r • (sigma • quarterTurn (deriv beta t)) ∈ U := by |
| 44 | have hKA : IsCompact (beta '' Icc B B1 ∪ K) := |
| 45 | (isCompact_Icc.image hb.continuous).union hK |
| 46 | have hKB : IsCompact (alpha '' Icc A0 A ∪ K) := |
| 47 | (isCompact_Icc.image ha.continuous).union hK |
| 48 | have havoidA' (s : ℝ) (hs : s ∈ Ioo A0 A) : alpha s ∉ beta '' Icc B B1 ∪ K := by |
| 49 | rintro (⟨t, ht, heq⟩ | hp) |
| 50 | · exact hs.2.ne (hmeet s (Ioo_subset_Icc_self hs) t ht heq.symm).1 |
| 51 | · exact havoidA s hs hp |
| 52 | have havoidB' (t : ℝ) (ht : t ∈ Ioo B B1) : beta t ∉ alpha '' Icc A0 A ∪ K := by |
| 53 | rintro (⟨s, hs, heq⟩ | hp) |
| 54 | · exact ht.1.ne' (hmeet s hs t (Ioo_subset_Icc_self ht) heq).2 |
| 55 | · exact havoidB t ht hp |
| 56 | have hfrontA : frontier U = alpha '' Icc A0 A ∪ (beta '' Icc B B1 ∪ K) := by |
| 57 | rw [hfront, union_assoc] |
| 58 | have hfrontB : frontier U = beta '' Icc B B1 ∪ (alpha '' Icc A0 A ∪ K) := by |
| 59 | rw [hfront] |
| 60 | ac_rfl |
| 61 | obtain ⟨sigma, hsigma, hrayA⟩ := m64Intrinsic_exists_global_arc_inward_sign |
| 62 | ha haA hai hregularA hKA havoidA' hU hV hUV hfrontA hfV |
| 63 | rcases hsigma with rfl | rfl |
| 64 | · have hrayA' : ∀ t ∈ Ioo A0 A, ∀ᶠ r in 𝓝[>] (0 : ℝ), |
| 65 | alpha t + r • quarterTurn (deriv alpha t) ∈ U := by |
| 66 | simpa only [one_smul] using hrayA |
| 67 | refine ⟨1, Or.inl rfl, hrayA, ?_⟩ |
| 68 | simpa only [one_smul] using m64Intrinsic_straight_join_inward_propagation |
| 69 | ha hb haA hBb hc hai hbi hend hreg htan hmeet hregularA hregularB |
| 70 | hK hpK havoidB hU hV hUV hfront hfV hrayA' |
| 71 | · obtain ⟨tau, htau, hrayAV⟩ := m64Intrinsic_exists_global_arc_inward_sign |
| 72 | ha haA hai hregularA hKA havoidA' hV hU hUV.symm (hfV.trans hfrontA) hfV.symm |
| 73 | have hrayAV' : ∀ t ∈ Ioo A0 A, ∀ᶠ r in 𝓝[>] (0 : ℝ), |
| 74 | alpha t + r • quarterTurn (deriv alpha t) ∈ V := by |
| 75 | rcases htau with rfl | rfl |
| 76 | · simpa only [one_smul] using hrayAV |
| 77 | · exfalso |
| 78 | have hp : (A0 + A) / 2 ∈ Ioo A0 A := ⟨by linarith, by linarith⟩ |
| 79 | obtain ⟨r, hrU, hrV⟩ := ((hrayA _ hp).and (hrayAV _ hp)).exists |
| 80 | exact disjoint_left.mp hUV hrU hrV |
| 81 | have hrayBV := m64Intrinsic_straight_join_inward_propagation |
| 82 | ha hb haA hBb hc hai hbi hend hreg htan hmeet hregularA hregularB |
| 83 | hK hpK havoidB hV hU hUV.symm (hfV.trans hfront) hfV.symm hrayAV' |
| 84 | obtain ⟨tauB, htauB, hrayBU⟩ := m64Intrinsic_exists_global_arc_inward_sign |
| 85 | hb hBb hbi hregularB hKB havoidB' hU hV hUV hfrontB hfV |
| 86 | rcases htauB with rfl | rfl |
| 87 | · exfalso |
| 88 | have hp : (B + B1) / 2 ∈ Ioo B B1 := ⟨by linarith, by linarith⟩ |
| 89 | obtain ⟨r, hrU, hrV⟩ := ((hrayBU _ hp).and (hrayBV _ hp)).exists |
| 90 | exact disjoint_left.mp hUV (by simpa only [one_smul] using hrU) hrV |
| 91 | · exact ⟨-1, Or.inr rfl, hrayA, hrayBU⟩ |
| 92 | |
| 93 | end PoincareMT |