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.Surgery.Comparison.Extension.Data |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Comparison.Extension.Retained |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.Comparison.Distance.CompactConvergence |
| 4 | import PoincareLib.Geometry.RicciFlow.Surgery.Comparison.Distance.LocalEmbedding |
| 5 | /-! |
| 6 | # Proposition 15.12: the late near-unit distance bound |
| 7 | |
| 8 | Morgan--Tian Proposition 15.12, p. 365, and Claim 18.22, p. 433, as |
| 9 | specified by the 2026-09-18 repair contract. One fixed locally prescribed |
| 10 | extension is controlled by compact regular metric convergence. Confined |
| 11 | path bounds on the gluing cover give the global bound for the actual |
| 12 | parent and child metrics. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set Filter |
| 18 | open scoped Manifold ContDiff Bundle ENNReal Topology |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.SurgeryComparison |
| 23 | |
| 24 | variable {g₀ : StandardInitialMetric} {D : RepairedSurgeryFlowData.{u} g₀} |
| 25 | {T : ℝ} {hT : T ∈ D.flow.surgery_times} |
| 26 | [Nonempty (D.flow.slice T).carrier] |
| 27 | (I : RepairedComparisonMapInput D T hT) |
| 28 | |
| 29 | local notation "E" => D.flow.event T hT |
| 30 | |
| 31 | /-- The actual limit identification composed with the parent inclusion is |
| 32 | smooth at every regular point, as used in Proposition 15.12, p. 365. -/ |
| 33 | theorem comparisonLimit_contMDiffAt {x : I.parent.carrier.carrier} |
| 34 | (hx : I.parent.inclusion x ∈ (E).regular_limit) : |
| 35 | ContMDiffAt (𝓡 3) (𝓡 3) ∞ |
| 36 | ((E).limit_identify.map ∘ I.parent.inclusion) x := by |
| 37 | exact (((E).limit_identify.map_smooth _ hx).contMDiffAt |
| 38 | ((E).regular_limit_open.mem_nhds hx)).comp x (I.parent.inclusion_smooth x) |
| 39 | |
| 40 | /-- Transport the compact quadratic comparison to the literal parent |
| 41 | metric using its recorded pullback. Proposition 15.12, p. 365. -/ |
| 42 | theorem comparisonLimit_metric_le |
| 43 | (t : Set.Ico (E).tMinus T) {C : ℝ} {K : Set (D.flow.slice (E).tMinus).carrier} |
| 44 | (hK : K ⊆ (E).regular_limit) |
| 45 | (hmetric : ∀ z ∈ K, ∀ w : TangentSpace (𝓡 3) z, |
| 46 | (E).limit_metric.inner ((E).limit_identify.map z) |
| 47 | (mfderiv (𝓡 3) (𝓡 3) (E).limit_identify.map z w) |
| 48 | (mfderiv (𝓡 3) (𝓡 3) (E).limit_identify.map z w) ≤ |
| 49 | C ^ 2 * ((E).pre_flow.metric t.1).inner z w w) |
| 50 | {x : I.parent.carrier.carrier} (hx : I.parent.inclusion x ∈ K) |
| 51 | (v : TangentSpace (𝓡 3) x) : |
| 52 | (E).limit_metric.inner (((E).limit_identify.map ∘ I.parent.inclusion) x) |
| 53 | (mfderiv (𝓡 3) (𝓡 3) ((E).limit_identify.map ∘ I.parent.inclusion) x v) |
| 54 | (mfderiv (𝓡 3) (𝓡 3) ((E).limit_identify.map ∘ I.parent.inclusion) x v) ≤ |
| 55 | C ^ 2 * (I.parent_metric t.1).inner x v v := by |
| 56 | have hreg := hK hx |
| 57 | have hmap := ((E).limit_identify.map_smooth _ hreg).contMDiffAt |
| 58 | ((E).regular_limit_open.mem_nhds hreg) |
| 59 | rw [mfderiv_comp x (hmap.mdifferentiableAt (by simp)) |
| 60 | (I.parent.inclusion_smooth.mdifferentiable (by simp) x)] |
| 61 | change (E).limit_metric.inner ((E).limit_identify.map (I.parent.inclusion x)) |
| 62 | (mfderiv (𝓡 3) (𝓡 3) (E).limit_identify.map (I.parent.inclusion x) |
| 63 | (mfderiv (𝓡 3) (𝓡 3) I.parent.inclusion x v)) |
| 64 | (mfderiv (𝓡 3) (𝓡 3) (E).limit_identify.map (I.parent.inclusion x) |
| 65 | (mfderiv (𝓡 3) (𝓡 3) I.parent.inclusion x v)) ≤ _ |
| 66 | have hb := hmetric _ hx (mfderiv (𝓡 3) (𝓡 3) I.parent.inclusion x v) |
| 67 | rwa [I.parent_pullback t] at hb |
| 68 | |
| 69 | /-- A uniform quadratic comparison on the compact control set gives the |
| 70 | global distance bound for the fixed extension. The proof uses only local |
| 71 | path estimates on its three types of neighborhoods, following the repair |
| 72 | of Proposition 15.12 used by Claim 18.22, Morgan--Tian p. 433. -/ |
| 73 | theorem comparisonExtension_edist_le (G : ComparisonExtension I) |
| 74 | (t : Set.Ico (E).tMinus T) {C : ℝ} (hC : 0 < C) |
| 75 | (hmetric : ∀ z ∈ G.control, ∀ w : TangentSpace (𝓡 3) z, |
| 76 | (E).limit_metric.inner ((E).limit_identify.map z) |
| 77 | (mfderiv (𝓡 3) (𝓡 3) (E).limit_identify.map z w) |
| 78 | (mfderiv (𝓡 3) (𝓡 3) (E).limit_identify.map z w) ≤ |
| 79 | C ^ 2 * ((E).pre_flow.metric t.1).inner z w w) |
| 80 | (x y : I.parent.carrier.carrier) : |
| 81 | I.child_metric.edist (G.map x) (G.map y) ≤ |
| 82 | ENNReal.ofReal C * (I.parent_metric t.1).edist x y := by |
| 83 | choose U hU hxU hlocal using G.local_model |
| 84 | apply metric_edist_le_mul_of_open_cover (I.parent_metric t.1) I.child_metric |
| 85 | U hU (fun z => ⟨z, hxU z⟩) G.map hC |
| 86 | intro j γ a b hab hγ hγU |
| 87 | rcases hlocal j with ⟨z, heq⟩ | ⟨hcontrol, hret | ⟨i, hchild, hneck, heq⟩⟩ |
| 88 | · rw [heq (hγU ⟨le_rfl, hab⟩), heq (hγU ⟨hab, le_rfl⟩), |
| 89 | MetricSurgery.metric_edist_self] |
| 90 | exact zero_le |
| 91 | · apply edist_comp_le_mul_pathELength (I.parent_metric t.1) I.child_metric hC |
| 92 | (fun z hz => ((extension_retained_smooth I G.retained_agreement) z |
| 93 | (hret hz)).contMDiffAt (I.retained_open.mem_nhds (hret hz))) |
| 94 | (fun z hz v => ?_) hab hγ hγU |
| 95 | rw [extension_retained_metric I G.retained_agreement z (hret hz)] |
| 96 | have hb := hmetric _ (hcontrol hz) |
| 97 | (mfderiv (𝓡 3) (𝓡 3) I.parent.inclusion z v) |
| 98 | rwa [I.parent_pullback t] at hb |
| 99 | · rw [heq (hγU ⟨le_rfl, hab⟩), heq (hγU ⟨hab, le_rfl⟩)] |
| 100 | exact edist_comp_le_mul_pathELength_of_intrinsic_bound |
| 101 | (I.parent_metric t.1) (E).limit_metric I.child_metric |
| 102 | (f := (E).limit_identify.map ∘ I.parent.inclusion) |
| 103 | (c := localChildEmbedding E i I.child ∘ ((E).local_result i).collapse) hC |
| 104 | (fun z hz => comparisonLimit_contMDiffAt I (G.control_regular (hcontrol hz))) |
| 105 | (fun z hz v => comparisonLimit_metric_le I t G.control_regular hmetric |
| 106 | (hcontrol hz) v) hneck |
| 107 | (fun z hz w hw => localChildCollapse_edist_le E i I.child hchild |
| 108 | I.child_metric I.child_pullback z hz w hw) hab hγ hγU |
| 109 | |
| 110 | /-- Compact regular convergence chooses only the late time interval; the |
| 111 | map and its local formulas were fixed before eta. This is the near-unit |
| 112 | estimate used in Claim 18.22, Morgan--Tian p. 433. -/ |
| 113 | theorem comparisonExtension_late_lipschitz (G : ComparisonExtension I) |
| 114 | (eta : ℝ) (heta : 0 < eta) : |
| 115 | ∃ d : ℝ, 0 < d ∧ d ≤ T - (E).tMinus ∧ |
| 116 | ∀ t : ℝ, T - d < t → t < T → ∀ x y, |
| 117 | I.child_metric.edist (G.map x) (G.map y) ≤ |
| 118 | ENNReal.ofReal (1 + eta) * (I.parent_metric t).edist x y := by |
| 119 | have hC : 0 < 1 + eta := by linarith |
| 120 | have hsq : 1 < (1 + eta) ^ 2 := by nlinarith [sq_nonneg eta] |
| 121 | have hlim := metricLimit_eventually_compact_comparison (E).limit_identify |
| 122 | (E).regular_limit_open (E).metric_converges G.control_compact G.control_regular hsq |
| 123 | obtain ⟨s, hs, hbound⟩ := mem_nhdsLT_iff_exists_Ioo_subset.mp hlim |
| 124 | let d := min (T - s) (T - (E).tMinus) |
| 125 | have hd : 0 < d := lt_min (sub_pos.mpr hs) (sub_pos.mpr (E).tMinus_lt) |
| 126 | have hds : d ≤ T - s := min_le_left _ _ |
| 127 | have hdt : d ≤ T - (E).tMinus := min_le_right _ _ |
| 128 | refine ⟨d, hd, hdt, ?_⟩ |
| 129 | intro t ht htT x y |
| 130 | have htpre : (E).tMinus ≤ t := by linarith |
| 131 | have hts : s < t := by linarith |
| 132 | exact comparisonExtension_edist_le I G ⟨t, htpre, htT⟩ hC (hbound ⟨hts, htT⟩) x y |
| 133 | |
| 134 | /-- Assemble all geometric and metric fields from the constructed fixed |
| 135 | extension. Proposition 15.12, p. 365, with the near-unit distance clause |
| 136 | of Claim 18.22, p. 433, and the 2026-09-18 repair contract. -/ |
| 137 | noncomputable def comparisonConclusionOfExtension (G : ComparisonExtension I) : |
| 138 | RepairedComparisonMapConclusion I where |
| 139 | map := G.map |
| 140 | target_basepoint := G.map I.parent.basepoint |
| 141 | based := rfl |
| 142 | retained_agreement := G.retained_agreement |
| 143 | retained_open := I.retained_open |
| 144 | retained_target_open := extension_retained_target_open I G.retained_agreement |
| 145 | retained_smooth := extension_retained_smooth I G.retained_agreement |
| 146 | retained_metric := extension_retained_metric I G.retained_agreement |
| 147 | distance_window := T - (E).tMinus |
| 148 | distance_window_pos := sub_pos.mpr (E).tMinus_lt |
| 149 | distance_window_le := le_rfl |
| 150 | outside_image_in_caps := G.outside_image_in_caps |
| 151 | late_lipschitz := comparisonExtension_late_lipschitz I G |
| 152 | |
| 153 | end PoincareMT.SurgeryComparison |