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.Graph.StripFrontier |
| 2 | |
| 3 | /-! |
| 4 | # Full frontier charts along one arc of a piecewise smooth boundary |
| 5 | |
| 6 | Compact tails and the other boundary arcs are removed from a scalar graph |
| 7 | neighborhood. The original oblique strip map is retained, so the physical |
| 8 | endpoint cuts agree with the cuts of the adjacent cells. |
| 9 | |
| 10 | Morgan--Tian context: Proposition 19.35, printed pp. 467-481. These project |
| 11 | Jordan-region constructions supply the actual domains, boundary charts and finite |
| 12 | faces used in its regional Gauss--Bonnet arguments. |
| 13 | -/ |
| 14 | |
| 15 | noncomputable section |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set Filter |
| 20 | open scoped Topology ContDiff |
| 21 | open Poincare.Topology.Plane.Curves |
| 22 | |
| 23 | namespace PoincareMT |
| 24 | |
| 25 | /-- A supplied graph for a compact subarc describes the entire nearby boundary, even when |
| 26 | the rest of that boundary has corners. Source: |
| 27 | `proof-work/tasks/M64/reviews/2026-09-27-intrinsic-inward-strips-review.md`, round_1, check |
| 28 | 19. -/ |
| 29 | theorem m64Intrinsic_arc_graph_neighborhood_of_interval |
| 30 | {gamma : ℝ → AnnulusCoordinates} (hg : Continuous gamma) {A B a b : ℝ} |
| 31 | (hinj : InjOn gamma (Icc A B)) (_hab : a ≤ b) (ha : A < a) (hb : b < B) |
| 32 | {K : Set AnnulusCoordinates} (hK : IsCompact K) |
| 33 | (havoid : ∀ t ∈ Icc a b, gamma t ∉ K) |
| 34 | (L : AnnulusCoordinates ≃L[ℝ] (ℝ × ℝ)) |
| 35 | (G : OpenPartialHomeomorph ℝ ℝ) {f : ℝ → ℝ} |
| 36 | (hI : Icc a b ⊆ G.source) |
| 37 | (hgraph : ∀ t ∈ G.source, L (gamma t) = (G t, f (G t))) : |
| 38 | ∃ W : Set AnnulusCoordinates, IsOpen W ∧ gamma '' Icc a b ⊆ W ∧ |
| 39 | ∀ z ∈ W, z ∈ gamma '' Icc A B ∪ K ↔ (L z).2 = f (L z).1 := by |
| 40 | let tail := gamma '' (Icc A B \ G.source) |
| 41 | have htail : IsClosed tail := |
| 42 | ((isCompact_Icc.diff G.open_source).image hg).isClosed |
| 43 | let W := (fun z : AnnulusCoordinates => (L z).1) ⁻¹' |
| 44 | (G.target ∩ G.symm ⁻¹' Ioo A B) \ (tail ∪ K) |
| 45 | have hW : IsOpen W := |
| 46 | ((G.symm.isOpen_inter_preimage isOpen_Ioo).preimage L.continuous.fst).sdiff |
| 47 | (htail.union hK.isClosed) |
| 48 | refine ⟨W, hW, ?_, ?_⟩ |
| 49 | · rintro _ ⟨t, ht, rfl⟩ |
| 50 | have htG := hI ht |
| 51 | have htAB : t ∈ Icc A B := ⟨ha.le.trans ht.1, ht.2.trans hb.le⟩ |
| 52 | refine ⟨?_, ?_⟩ |
| 53 | · change (L (gamma t)).1 ∈ G.target ∧ G.symm (L (gamma t)).1 ∈ Ioo A B |
| 54 | rw [hgraph t htG, G.left_inv htG] |
| 55 | exact ⟨G.map_source htG, ha.trans_le ht.1, ht.2.trans_lt hb⟩ |
| 56 | · rintro (⟨s, hs, hst⟩ | htk) |
| 57 | · exact hs.2 ((hinj hs.1 htAB hst) ▸ htG) |
| 58 | · exact havoid t ht htk |
| 59 | · intro z hz |
| 60 | have hzG : (L z).1 ∈ G.target := hz.1.1 |
| 61 | have hzAB : G.symm (L z).1 ∈ Ioo A B := hz.1.2 |
| 62 | constructor |
| 63 | · rintro (⟨s, hs, hsz⟩ | hzK) |
| 64 | · have hsG : s ∈ G.source := by |
| 65 | by_contra hn |
| 66 | exact hz.2 (Or.inl ⟨s, ⟨hs, hn⟩, hsz⟩) |
| 67 | rw [← hsz, hgraph s hsG] |
| 68 | · exact False.elim (hz.2 (Or.inr hzK)) |
| 69 | · intro heq |
| 70 | refine Or.inl ⟨G.symm (L z).1, Ioo_subset_Icc_self hzAB, ?_⟩ |
| 71 | apply L.injective |
| 72 | rw [hgraph _ (G.map_target hzG), G.right_inv hzG] |
| 73 | exact Prod.ext rfl heq.symm |
| 74 | |
| 75 | set_option maxHeartbeats 800000 in |
| 76 | -- Composing and restricting the two smooth partial inverses is expensive. |
| 77 | /-- An actual oblique graph strip has a smooth restricted chart whose zero height is |
| 78 | precisely the whole piecewise smooth frontier. Source: |
| 79 | `proof-work/tasks/M64/reviews/2026-09-27-intrinsic-inward-strips-review.md`, round_1, check |
| 80 | 19. -/ |
| 81 | theorem m64Intrinsic_exists_arc_graph_strip_frontier_chart |
| 82 | {gamma : ℝ → AnnulusCoordinates} (hg : Continuous gamma) {A B a b : ℝ} |
| 83 | (hinj : InjOn gamma (Icc A B)) (hab : a < b) (ha : A < a) (hb : b < B) |
| 84 | {K : Set AnnulusCoordinates} (hK : IsCompact K) |
| 85 | (havoid : ∀ t ∈ Icc a b, gamma t ∉ K) |
| 86 | (L : AnnulusCoordinates ≃L[ℝ] (ℝ × ℝ)) |
| 87 | (G : OpenPartialHomeomorph ℝ ℝ) {f : ℝ → ℝ} |
| 88 | (hf : ContDiffOn ℝ ∞ f G.target) |
| 89 | (hI : Icc a b ⊆ G.source) (hmono : StrictMonoOn G G.source) |
| 90 | (hgraph : ∀ t ∈ G.source, L (gamma t) = (G t, f (G t))) |
| 91 | (himage : G '' Icc a b = Icc (G a) (G b)) |
| 92 | (htarget : Icc (G a) (G b) ⊆ G.target) |
| 93 | {ua wa ub wb : ℝ} (P : TransverseGraphCuts f (G a) (G b) ua wa ub wb) : |
| 94 | ∃ delta > 0, ∃ H : OpenPartialHomeomorph (ℝ × ℝ) AnnulusCoordinates, |
| 95 | Icc (0 : ℝ) 1 ×ˢ Ioo (-delta) delta ⊆ H.source ∧ |
| 96 | (∀ q, H q = P.linearCoordinates L.symm G.open_target hf q) ∧ |
| 97 | ContDiffOn ℝ ∞ H H.source ∧ ContDiffOn ℝ ∞ H.symm H.target ∧ |
| 98 | ∀ q ∈ H.source, H q ∈ gamma '' Icc A B ∪ K ↔ q.2 = 0 := by |
| 99 | obtain ⟨W, hW, hcover, hlocal⟩ := m64Intrinsic_arc_graph_neighborhood_of_interval |
| 100 | hg hinj hab.le ha hb hK havoid L G hI hgraph |
| 101 | let F := P.linearCoordinates L.symm G.open_target hf |
| 102 | have hGab : G a < G b := hmono (hI (left_mem_Icc.mpr hab.le)) |
| 103 | (hI (right_mem_Icc.mpr hab.le)) hab |
| 104 | have haxis := m64Intrinsic_graph_strip_axis_image L G hf hI hGab.le hgraph himage P |
| 105 | let V := F.source ∩ F ⁻¹' W |
| 106 | have hV : IsOpen V := F.isOpen_inter_preimage hW |
| 107 | let H := F.restrOpen V hV |
| 108 | have haxisH (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : (t, (0 : ℝ)) ∈ H.source := by |
| 109 | have hs := P.linearCoordinates_axis_mem_source L.symm G.open_target hf hGab htarget ht |
| 110 | refine ⟨hs, hs, hcover ?_⟩ |
| 111 | rw [← haxis] |
| 112 | exact ⟨t, ht, rfl⟩ |
| 113 | obtain ⟨delta, hdelta, hstrip⟩ := exists_strip_source_width H haxisH |
| 114 | have hFi : ContDiffOn ℝ ∞ F.symm F.target := |
| 115 | (P.smooth_coordinates_symm G.open_target hf).comp L.contDiff.contDiffOn |
| 116 | (fun _ hz => hz.2) |
| 117 | refine ⟨delta, hdelta, H, hstrip, fun _ => rfl, |
| 118 | (P.smooth_linearCoordinates L.symm G.open_target hf).mono inter_subset_left, |
| 119 | hFi.mono inter_subset_left, ?_⟩ |
| 120 | intro q hq |
| 121 | change F q ∈ gamma '' Icc A B ∪ K ↔ q.2 = 0 |
| 122 | rw [hlocal _ hq.2.2, P.linearCoordinates_apply, P.coordinates_apply, |
| 123 | L.apply_symm_apply] |
| 124 | change f _ + q.2 = f _ ↔ q.2 = 0 |
| 125 | exact add_eq_left |
| 126 | |
| 127 | end PoincareMT |