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.Generalized.BoundedDistance.GeometryImports |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Analysis.Geometry.ExitPrefixRemainder |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.SourceGeometry.Ends.SourceTubeEndTails |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.SourceGeometry.InitialGeometry.SourceInitialGraphSide |
| 5 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.NeckGeometry.NeckSlabRegularity |
| 6 | |
| 7 | /-! |
| 8 | # Short paths on the positive side stay in the actual source tube |
| 9 | |
| 10 | An exit avoiding the last neck must approach the first end. The original |
| 11 | graph frontier forces a preceding graph crossing, and the sharp centered |
| 12 | axial-ball bound contradicts the total path length. Source: Morgan--Tian |
| 13 | Claim 10.8, p. 254; M28 derivation 115. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set |
| 20 | open scoped Manifold ContDiff Topology ENNReal Bundle |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT.M28.SourceTubeData |
| 25 | |
| 26 | variable {epsilon C A D0 D : ℝ} |
| 27 | {E : SameTimeCounterexample.{u} epsilon C A D0 D} |
| 28 | {S : CounterexampleNeckSegment E} |
| 29 | |
| 30 | /-- A short path starting above the actual initial graph cannot leave |
| 31 | the source tube while it avoids the closed terminal carrier. The graph |
| 32 | and compact middle are the retained source objects. Source: Claim 10.8, |
| 33 | p. 254; M28 derivation 115. -/ |
| 34 | theorem short_path_mapsTo_of_terminal_avoidance (T : SourceTubeData S) |
| 35 | (hsmall : epsilon ≤ (1 / 1000 : ℝ)) (f : UnitTwoSphere → ℝ) |
| 36 | (hf : Continuous f) (hbound : ∀ q, |f q| < epsilon⁻¹ / 32) |
| 37 | {gamma : ℝ → (E.flow.slice E.time).carrier} |
| 38 | (hgamma : ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 3) 1 gamma (Icc (0 : ℝ) 1)) |
| 39 | (h0 : gamma 0 ∈ (T.carrierOpen : Set _)) |
| 40 | (hside : gamma 0 ∉ (T.list.node 0).2.belowGraph_m28 f) |
| 41 | (havoid : ∀ t ∈ Icc (0 : ℝ) 1, gamma t ∉ |
| 42 | closure ((T.list.node ((T.list.nodes.length - 1 : ℕ) : ℤ)).2.carrier)) |
| 43 | (hshort : (E.flow.metric E.time).pathELength gamma 0 1 < |
| 44 | ENNReal.ofReal (((T.list.node 0).2.scale * Real.sqrt (1 - epsilon)) * |
| 45 | (27 * epsilon⁻¹ / 32))) : |
| 46 | MapsTo gamma (Icc (0 : ℝ) 1) (T.carrierOpen : Set _) := by |
| 47 | let N := (T.list.node 0).2 |
| 48 | have hlen : 0 < T.list.nodes.length := List.length_pos_iff.mpr T.list.nonempty |
| 49 | have heps : N.epsilon = epsilon := T.list.node_epsilon (by |
| 50 | change 0 ≤ (0 : ℤ) ∧ (0 : ℤ) ≤ (T.list.nodes.length : ℤ) - 1 |
| 51 | constructor <;> omega) |
| 52 | have hepspos : 0 < epsilon := heps ▸ N.epsilon_pos |
| 53 | have hA : 0 < epsilon⁻¹ := inv_pos.mpr hepspos |
| 54 | obtain ⟨hK, hKV⟩ := T.coreUnion_compact_subset (by norm_num : (7 / 8 : ℝ) < 1) |
| 55 | have hcover : (T.carrierOpen : Set _) ⊆ T.coreUnion (7 / 8) ∪ |
| 56 | N.region (-epsilon⁻¹) (-((7 / 8 : ℝ) * epsilon⁻¹)) ∪ |
| 57 | closure ((T.list.node ((T.list.nodes.length - 1 : ℕ) : ℤ)).2.carrier) := by |
| 58 | intro x hx |
| 59 | rcases T.subset_coreUnion_end_tails hsmall (by norm_num : (3 / 4 : ℝ) ≤ 7 / 8) |
| 60 | hx with (hk | hf') | hl |
| 61 | · exact Or.inl (Or.inl hk) |
| 62 | · exact Or.inl (Or.inr hf') |
| 63 | · exact Or.inr (subset_closure hl.1) |
| 64 | by_contra hexit |
| 65 | obtain ⟨s, hs, htail, hprefix⟩ := |
| 66 | hgamma.continuousOn.exists_prefix_in_remainder_of_exit |
| 67 | (F := N.region (-epsilon⁻¹) (-((7 / 8 : ℝ) * epsilon⁻¹))) T.carrierOpen.isOpen |
| 68 | hK.isClosed hKV isClosed_closure hcover |
| 69 | h0 havoid hexit |
| 70 | · have hsF : gamma s ∈ N.belowGraph_m28 f := by |
| 71 | refine ⟨htail.1, ?_⟩ |
| 72 | have hb := (abs_lt.mp (hbound (N.coordinate_inverse (gamma s)).1)).1 |
| 73 | linarith only [htail.2.2, hb, hA] |
| 74 | have hconn := isPreconnected_Icc.image gamma |
| 75 | (hgamma.continuousOn.mono (Icc_subset_Icc le_rfl hs.2)) |
| 76 | obtain ⟨y, ⟨t, ht, rfl⟩, hfront⟩ := hconn.exists_mem_frontier_of_mem_of_notMem |
| 77 | ⟨s, right_mem_Icc.mpr hs.1, rfl⟩ hsF ⟨0, left_mem_Icc.mpr hs.1, rfl⟩ hside |
| 78 | have hgraph : gamma t ∈ range (fun q => N.coordinate_map (q, f q)) := |
| 79 | (T.initial_graph_negative_region f hf hbound).2.1 ▸ ⟨hfront, hprefix ht⟩ |
| 80 | obtain ⟨q, hq⟩ := hgraph |
| 81 | have hdom : f q ∈ Ioo (-N.epsilon⁻¹) N.epsilon⁻¹ := by |
| 82 | rw [heps] |
| 83 | have hb := abs_lt.mp (hbound q) |
| 84 | constructor <;> linarith [hb.1, hb.2] |
| 85 | have htN : gamma t ∈ N.carrier := |
| 86 | hq ▸ N.coordinate_map_mem_of_axial (q, f q) hdom |
| 87 | have htheight : (N.coordinate_inverse (gamma t)).2 = f q := by |
| 88 | rw [← hq, N.coordinate_inverse_coordinate_map_of_axial (q, f q) hdom] |
| 89 | have hmargin : 27 * epsilon⁻¹ / 32 < |
| 90 | N.epsilon⁻¹ - |(N.coordinate_inverse (gamma t)).2| := by |
| 91 | rw [heps, htheight] |
| 92 | linarith [hbound q] |
| 93 | have hnot : gamma s ∉ N.region |
| 94 | ((N.coordinate_inverse (gamma t)).2 - 27 * epsilon⁻¹ / 32) |
| 95 | ((N.coordinate_inverse (gamma t)).2 + 27 * epsilon⁻¹ / 32) := by |
| 96 | intro hh |
| 97 | rw [htheight] at hh |
| 98 | have hb := (abs_lt.mp (hbound q)).1 |
| 99 | linarith only [hh.2.1, htail.2.2, hb] |
| 100 | have hfar : ENNReal.ofReal ((N.scale * Real.sqrt (1 - N.epsilon)) * |
| 101 | (27 * epsilon⁻¹ / 32)) ≤ |
| 102 | (E.flow.metric E.time).edist (gamma t) (gamma s) := by |
| 103 | apply le_of_not_gt |
| 104 | intro hnear |
| 105 | exact hnot (N.ball_subset_centered_region htN (by positivity) hmargin hnear) |
| 106 | let : Bundle.RiemannianBundle |
| 107 | (TangentSpace (𝓡 3) : (E.flow.slice E.time).carrier → Type _) := |
| 108 | ⟨(E.flow.metric E.time).toRiemannianMetric⟩ |
| 109 | have hlength : (E.flow.metric E.time).edist (gamma t) (gamma s) ≤ |
| 110 | (E.flow.metric E.time).pathELength gamma 0 1 := |
| 111 | (Manifold.riemannianEDist_le_pathELength |
| 112 | (hgamma.mono (Icc_subset_Icc ht.1 hs.2)) rfl rfl ht.2).trans |
| 113 | (Manifold.pathELength_mono ht.1 hs.2) |
| 114 | rw [heps] at hfar |
| 115 | exact (not_lt_of_ge (hfar.trans hlength)) hshort |
| 116 | |
| 117 | end PoincareMT.M28.SourceTubeData |