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.Tube.SourceGeometry.Limits.SourceSelectedCrossingHeight |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.SourceGeometry.Geometry.SourceMatchingHighNeckSeparation |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.SourceGeometry.Ends.SourceTubeTerminalScalar |
| 5 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.PartialLimits.RegularSets.EmbeddingInverse |
| 6 | |
| 7 | /-! |
| 8 | # The crossing height on the actual retained source family |
| 9 | |
| 10 | A single compact stage closure connects the original base to the fresh |
| 11 | center. Uniform scalar estimates exclude every matching high neck from |
| 12 | that connector and both low necks before the selected node is chosen. |
| 13 | The actual node then supplies the third sphere and the crossing height. |
| 14 | Source: Morgan--Tian Claim 10.8, p. 254; M28 derivation 124. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | set_option backward.isDefEq.respectTransparency false |
| 19 | |
| 20 | open Set Filter |
| 21 | open scoped Manifold ContDiff Topology |
| 22 | |
| 23 | universe u |
| 24 | |
| 25 | namespace PoincareMT.M28.CounterexampleNeckFamily |
| 26 | |
| 27 | set_option maxHeartbeats 8000000 in |
| 28 | -- The common tail precedes the selected high node and every crossing point. |
| 29 | /-- The actual source family produces the crossing height in the |
| 30 | disjoint-sphere case. Only the retained initial graph's base and side |
| 31 | labels are inputs; all connector and high-node exclusions are produced. |
| 32 | Source: Claim 10.8, p. 254; M28 derivation 124. -/ |
| 33 | theorem exists_retained_source_crossing_height_accuracy : |
| 34 | ∃ epsilon0 : ℝ, 0 < epsilon0 ∧ epsilon0 ≤ (1 / 200 : ℝ) ∧ |
| 35 | ∀ {epsilon C A : ℝ} |
| 36 | {E : ∀ n : ℕ, SameTimeCounterexample.{u} epsilon C A |
| 37 | ((n : ℝ) + 1) ((n : ℝ) + 1)} |
| 38 | (H : CounterexampleNeckFamily E) (W : CriticalBallSourcePacket H), |
| 39 | epsilon ≤ epsilon0 → |
| 40 | ∀ (G : RegularPointedMetricConvergence |
| 41 | (fun k => H.tubeCriticalMetric W.tube W.radius (W.high_index k)) |
| 42 | (fun k => H.tubeCriticalBase W.tube W.radius W.radius_pos (W.high_index k))), |
| 43 | letI := G.limitCarrier.topologicalSpace |
| 44 | letI := G.limitCarrier.chartedSpace |
| 45 | letI := G.limitCarrier.isManifold |
| 46 | ∀ (_D0 : LeviCivitaData G.limitMetric) (q : G.limitCarrier.carrier) |
| 47 | (sigma : ℕ → ℕ), StrictMono sigma → |
| 48 | ∀ (J : ∀ k, EpsilonNeck |
| 49 | ((E (W.high_index (G.subsequence (sigma k)) + H.shift)).flow.metric |
| 50 | (E (W.high_index (G.subsequence (sigma k)) + H.shift)).time)), |
| 51 | (∀ k, (J k).epsilon = epsilon) → |
| 52 | (∀ k, (J k).center = (G.embedding (sigma k) q).val.val) → |
| 53 | ∀ (f : ℕ → UnitTwoSphere → ℝ), |
| 54 | (∀ k, ContMDiff (𝓡 2) 𝓘(ℝ, ℝ) ∞ (f k)) → |
| 55 | (∀ k z, |f k z| < epsilon⁻¹ / 32) → |
| 56 | (∀ᶠ k in atTop, |
| 57 | (H.tubeBase W.tube (W.high_index (G.subsequence (sigma k)))).val ∈ |
| 58 | range (fun z => |
| 59 | ((W.tube (W.high_index (G.subsequence (sigma k)))).list.node 0).2.coordinate_map |
| 60 | (z, f k z)) ∧ |
| 61 | (J k).center ∉ |
| 62 | ((W.tube (W.high_index (G.subsequence (sigma k)))).list.node 0).2.belowGraph_m28 |
| 63 | (f k)) → |
| 64 | ∀ᶠ k in atTop, |
| 65 | Disjoint (range (fun z => |
| 66 | ((W.tube (W.high_index (G.subsequence (sigma k)))).list.node 0).2.coordinate_map |
| 67 | (z, f k z))) (J k).central_sphere → |
| 68 | (∀ y ∈ (J k).central_sphere, y ∉ |
| 69 | ((W.tube (W.high_index (G.subsequence (sigma k)))).list.node 0).2.belowGraph_m28 |
| 70 | (f k)) ∧ |
| 71 | ∃ height : (W.tube (W.high_index (G.subsequence (sigma k)))).carrierOpen → ℝ, |
| 72 | Continuous height ∧ |
| 73 | (∀ y, height y = 0 ↔ y.val ∈ (J k).central_sphere) ∧ |
| 74 | height (H.tubeBase W.tube |
| 75 | (W.high_index (G.subsequence (sigma k)))) < 0 ∧ |
| 76 | 0 < height (W.high_point (G.subsequence (sigma k))) := by |
| 77 | classical |
| 78 | obtain ⟨epsilonI, hIpos, _, hheight⟩ := exists_source_selected_crossing_height_accuracy.{u} |
| 79 | obtain ⟨epsilonS, hSpos, hSsmall, hseparate⟩ := |
| 80 | exists_matching_high_neck_separation_accuracy.{u} |
| 81 | obtain ⟨epsilonK, hKpos, _, hcompact⟩ := |
| 82 | exists_matching_high_neck_compact_exclusion_accuracy.{u} |
| 83 | obtain ⟨epsilonT, hTpos, _, hterminal⟩ := exists_source_terminal_neck_exclusion_accuracy.{u} |
| 84 | refine ⟨min epsilonI (min epsilonS (min epsilonK epsilonT)), |
| 85 | lt_min hIpos (lt_min hSpos (lt_min hKpos hTpos)), |
| 86 | ((min_le_right _ _).trans (min_le_left _ _)).trans hSsmall, ?_⟩ |
| 87 | intro epsilon C A E H W hepsilon G |
| 88 | let := G.limitCarrier.topologicalSpace |
| 89 | let := G.limitCarrier.chartedSpace |
| 90 | let := G.limitCarrier.isManifold |
| 91 | intro D0 q sigma hsigma J heps hcenter f hf hbound hlabels |
| 92 | have hepsI : epsilon ≤ epsilonI := hepsilon.trans (min_le_left _ _) |
| 93 | have hepsS : epsilon ≤ epsilonS := |
| 94 | hepsilon.trans ((min_le_right _ _).trans (min_le_left _ _)) |
| 95 | have hepsK : epsilon ≤ epsilonK := |
| 96 | hepsilon.trans ((min_le_right _ _).trans ((min_le_right _ _).trans (min_le_left _ _))) |
| 97 | have hepsT : epsilon ≤ epsilonT := |
| 98 | hepsilon.trans ((min_le_right _ _).trans ((min_le_right _ _).trans (min_le_right _ _))) |
| 99 | let nu := fun k => W.high_index (G.subsequence (sigma k)) |
| 100 | have hnu : StrictMono nu := W.high_index_strictMono.comp |
| 101 | (G.subsequence_strictMono.comp hsigma) |
| 102 | obtain ⟨j, hjq⟩ : ∃ j, q ∈ G.exhaustion j := by |
| 103 | have hq : q ∈ ⋃ j, G.exhaustion j := by rw [G.exhaustion_covers]; exact mem_univ _ |
| 104 | exact mem_iUnion.mp hq |
| 105 | let K0 := closure (G.exhaustion j) |
| 106 | have hK0 : IsCompact K0 := G.exhaustion_compactClosure j |
| 107 | have hKconn : IsPreconnected K0 := (G.exhaustion_connected j).isPreconnected.closure |
| 108 | have hmono : Monotone G.exhaustion := monotone_nat_of_le_succ |
| 109 | (fun j => subset_closure.trans (G.exhaustion_step j)) |
| 110 | have hsep := hseparate H W hepsS G D0 q sigma hsigma J heps hcenter |
| 111 | have hcomp := hcompact H W G D0 K0 hK0 sigma hsigma |
| 112 | obtain ⟨B, _, hB⟩ := H.exists_eventual_compact_normalized_raw_scalar_bound |
| 113 | W.tube W.radius W.radius_pos W.high_index G D0 {q} isCompact_singleton |
| 114 | have hcenterB : ∀ᶠ k in atTop, |
| 115 | (H.normalizedSliceConnection (nu k)).scalarCurvature (J k).center ≤ B := by |
| 116 | filter_upwards [hsigma.tendsto_atTop.eventually hB] with k hk |
| 117 | rw [hcenter] |
| 118 | exact (le_abs_self _).trans (hk q (mem_singleton q)) |
| 119 | have hterm := hterminal H W.tube hepsT nu hnu J heps B hcenterB |
| 120 | filter_upwards [hsep, hcomp, hterm, hlabels, |
| 121 | hsigma.tendsto_atTop.eventually (eventually_ge_atTop (j + 1))] |
| 122 | with k hksep hkcomp hkterm hklabels hkstage |
| 123 | intro hSC |
| 124 | let T := W.tube (nu k) |
| 125 | have hcenterT : (J k).center ∈ (T.carrierOpen : Set _) := by |
| 126 | rw [hcenter] |
| 127 | exact (G.embedding (sigma k) q).val.property |
| 128 | have hpT : (W.high_point (G.subsequence (sigma k))).val ∈ |
| 129 | (T.carrierOpen : Set _) := (W.high_point (G.subsequence (sigma k))).property |
| 130 | rw [T.carrier_eq_iUnion_nodes] at hpT |
| 131 | obtain ⟨i, hi, hp⟩ := mem_iUnion₂.mp hpT |
| 132 | let P := (T.list.node (i : ℤ)).2 |
| 133 | have hactive : (i : ℤ) ∈ T.list.active := by |
| 134 | have hi' := Finset.mem_range.mp hi |
| 135 | change 0 ≤ (i : ℤ) ∧ (i : ℤ) ≤ (T.list.nodes.length : ℤ) - 1 |
| 136 | omega |
| 137 | have hepsP : P.epsilon = epsilon := T.list.node_epsilon hactive |
| 138 | obtain ⟨hP0, hPJ⟩ := hksep P (hepsP.trans_le hepsS) hp |
| 139 | have hPK0 := hkcomp P (hepsP.trans_le hepsK) hp |
| 140 | let K : Set T.carrierOpen := (fun x => (G.embedding (sigma k) x).val) '' K0 |
| 141 | have hKstage : K0 ⊆ G.exhaustion (sigma k) := |
| 142 | (G.exhaustion_step j).trans (hmono hkstage) |
| 143 | have hmap : ContinuousOn (G.embedding (sigma k)) K0 := by |
| 144 | intro x hx |
| 145 | exact (G.embedding_smooth (sigma k) ⟨x, hKstage hx⟩).contMDiffAt.continuousAt.continuousWithinAt |
| 146 | have hK : IsPreconnected K := hKconn.image _ |
| 147 | (continuous_subtype_val.comp_continuousOn hmap) |
| 148 | have hbK : H.tubeBase W.tube (nu k) ∈ K := by |
| 149 | refine ⟨G.base, subset_closure (G.base_in_exhaustion j), ?_⟩ |
| 150 | change (G.embedding (sigma k) G.base).val = H.tubeBase W.tube (nu k) |
| 151 | rw [G.base_preserving] |
| 152 | rfl |
| 153 | have hqK : (⟨(J k).center, hcenterT⟩ : T.carrierOpen) ∈ K := by |
| 154 | refine ⟨q, subset_closure hjq, ?_⟩ |
| 155 | exact Subtype.ext (hcenter k).symm |
| 156 | have hPK : Disjoint P.carrier ((Subtype.val : T.carrierOpen → _) '' K) := by |
| 157 | apply Set.disjoint_left.mpr |
| 158 | rintro _ hxP ⟨y, hy, rfl⟩ |
| 159 | obtain ⟨z, hz, rfl⟩ := hy |
| 160 | exact Set.disjoint_left.mp hPK0 hxP ⟨z, hz, rfl⟩ |
| 161 | exact hheight T hepsI (f k) (hf k) (hbound k) (J k) (heps k) hcenterT |
| 162 | hklabels.2 hkterm hSC i (Finset.mem_range.mp hi) hP0 hPJ |
| 163 | (H.tubeBase W.tube (nu k)) (W.high_point (G.subsequence (sigma k))) |
| 164 | hklabels.1 hp K hK hbK hqK hPK |
| 165 | |
| 166 | end PoincareMT.M28.CounterexampleNeckFamily |