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.Induction.Noncollapse.StableSet.Seed.CylinderMetricSlab |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Induction.Noncollapse.StableSet.Seed.CylinderMetricLimit |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.Induction.Noncollapse.Assembly.FiniteEventInduction |
| 4 | |
| 5 | /-! |
| 6 | # One metric comparison through the retained seed cylinder |
| 7 | |
| 8 | Morgan--Tian Claim 16.27, p. 393. Ordinary exponential comparison and |
| 9 | the actual retained metric limit propagate with one elapsed-time factor |
| 10 | through the finite set of surgeries. A short subcylinder therefore has |
| 11 | factor-two quadratic comparison with its terminal metric. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set Filter |
| 18 | open scoped Manifold ContDiff Bundle Topology |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.Proofs.M46 |
| 23 | |
| 24 | attribute [local instance] normedAddCommGroupTangentSpaceVectorSpace |
| 25 | normedSpaceTangentSpaceVectorSpace |
| 26 | |
| 27 | variable {F : SurgeryFlowData.{u}} {C : GeneralizedSliceCarrier.{u}} |
| 28 | {origin c : ℝ} {U : Set C.carrier} |
| 29 | |
| 30 | /-- The full retained cylinder has the ordinary elapsed-time metric |
| 31 | factor. Its proof uses no bound on the number or spacing of surgeries. -/ |
| 32 | theorem cylinderQuadratic_exp_bounds |
| 33 | (P : M44CapPersistencePredecessors.{u}) (hpinch : SurgeryFlowPinched F) |
| 34 | (e : SurgeryFlowCylinder F C origin 1 (Icc c 0) U) (hU : IsOpen U) |
| 35 | {x : C.carrier} (hx : x ∈ U) (v : TangentSpace (𝓡 3) x) |
| 36 | {a b K : ℝ} (ha : a ∈ Icc c 0) (hb : b ∈ Icc c 0) (hab : a ≤ b) |
| 37 | (hRm : ∀ t (ht : t ∈ Icc a b), |
| 38 | (F.connection (origin + t / 1)).curvatureTensorNorm |
| 39 | (e.forward t (e.interval_connected.out ha hb ht) x) ≤ K) : |
| 40 | Real.exp (-(6 * K) * (b - a)) * cylinderQuadratic e x v a ≤ |
| 41 | cylinderQuadratic e x v b ∧ |
| 42 | cylinderQuadratic e x v b ≤ |
| 43 | Real.exp ((6 * K) * (b - a)) * cylinderQuadratic e x v a := by |
| 44 | let events : Set ℝ := (fun t : ℝ => origin + t / 1) ⁻¹' F.surgery_times |
| 45 | have htime : Icc (origin + a / 1) (origin + b / 1) ⊆ F.time_domain := |
| 46 | F.time_domain_interval.out (e.time_subset (mem_image_of_mem _ ha)) |
| 47 | (e.time_subset (mem_image_of_mem _ hb)) |
| 48 | have hfinite : (events ∩ Ioc a b).Finite := by |
| 49 | have hf := F.surgery_times_finite_on_compact isCompact_Icc htime |
| 50 | have hinj : Function.Injective (fun t : ℝ => origin + t / 1) := by |
| 51 | intro s t h |
| 52 | simpa only [div_one, add_left_cancel_iff] using h |
| 53 | apply (hf.preimage hinj.injOn).subset |
| 54 | intro t ht |
| 55 | refine ⟨ht.1, ?_⟩ |
| 56 | simp only [mem_Icc, div_one] |
| 57 | constructor <;> linarith [ht.2.1, ht.2.2] |
| 58 | let Q (t : ℝ) : Prop := |
| 59 | Real.exp (-(6 * K) * (t - a)) * cylinderQuadratic e x v a ≤ |
| 60 | cylinderQuadratic e x v t ∧ |
| 61 | cylinderQuadratic e x v t ≤ |
| 62 | Real.exp ((6 * K) * (t - a)) * cylinderQuadratic e x v a |
| 63 | have hfactor (k s t : ℝ) : Real.exp (k * (t - a)) = |
| 64 | Real.exp (k * (t - s)) * Real.exp (k * (s - a)) := by |
| 65 | rw [← Real.exp_add] |
| 66 | congr 1 |
| 67 | ring |
| 68 | apply finite_event_forward_induction hab hfinite Q (by simp [Q]) |
| 69 | · intro s hs t ht hst hfree hQs |
| 70 | rcases hst.eq_or_lt with rfl | hst |
| 71 | · exact hQs |
| 72 | have hsI := e.interval_connected.out ha hb hs |
| 73 | have htI := e.interval_connected.out ha hb ht |
| 74 | have hphysical : Disjoint F.surgery_times (Ioc (origin + s / 1) (origin + t / 1)) := by |
| 75 | apply Set.disjoint_left.mpr |
| 76 | intro z hz hzt |
| 77 | have hp : z - origin ∈ Ioc s t := by |
| 78 | simp only [div_one] at hzt |
| 79 | constructor <;> linarith [hzt.1, hzt.2] |
| 80 | apply Set.disjoint_left.mp hfree _ hp |
| 81 | simpa only [events, mem_preimage, div_one, add_sub_cancel] using hz |
| 82 | have hbounds := cylinderQuadratic_exp_bounds_on_slab e hU hx v hsI htI hst hphysical |
| 83 | (fun z hz => hRm z ⟨hs.1.trans hz.1, hz.2.trans ht.2⟩) |
| 84 | constructor |
| 85 | · calc |
| 86 | _ = Real.exp (-(6 * K) * (t - s)) * |
| 87 | (Real.exp (-(6 * K) * (s - a)) * cylinderQuadratic e x v a) := by |
| 88 | rw [hfactor (-(6 * K)) s t, mul_assoc] |
| 89 | _ ≤ Real.exp (-(6 * K) * (t - s)) * cylinderQuadratic e x v s := |
| 90 | mul_le_mul_of_nonneg_left hQs.1 (Real.exp_pos _).le |
| 91 | _ ≤ _ := hbounds.1 |
| 92 | · calc |
| 93 | _ ≤ Real.exp ((6 * K) * (t - s)) * cylinderQuadratic e x v s := hbounds.2 |
| 94 | _ ≤ Real.exp ((6 * K) * (t - s)) * |
| 95 | (Real.exp ((6 * K) * (s - a)) * cylinderQuadratic e x v a) := |
| 96 | mul_le_mul_of_nonneg_left hQs.2 (Real.exp_pos _).le |
| 97 | _ = _ := by rw [hfactor (6 * K) s t]; ring |
| 98 | · intro t ht hbefore |
| 99 | have hlimit := cylinderQuadratic_tendsto_left_at_surgery P hpinch e hU hx v |
| 100 | (show t ∈ Ioc c 0 from ⟨ha.1.trans_lt ht.2.1, ht.2.2.trans hb.2⟩) ht.1 |
| 101 | have hneg : Continuous (fun s : ℝ => Real.exp (-(6 * K) * (s - a)) * |
| 102 | cylinderQuadratic e x v a) := by fun_prop |
| 103 | have hpos : Continuous (fun s : ℝ => Real.exp ((6 * K) * (s - a)) * |
| 104 | cylinderQuadratic e x v a) := by fun_prop |
| 105 | constructor |
| 106 | · apply le_of_tendsto_of_tendsto |
| 107 | (hneg.continuousAt.mono_left nhdsWithin_le_nhds) hlimit |
| 108 | filter_upwards [Ico_mem_nhdsLT ht.2.1] with s hs |
| 109 | exact (hbefore s hs).1 |
| 110 | · apply le_of_tendsto_of_tendsto hlimit |
| 111 | (hpos.continuousAt.mono_left nhdsWithin_le_nhds) |
| 112 | filter_upwards [Ico_mem_nhdsLT ht.2.1] with s hs |
| 113 | exact (hbefore s hs).2 |
| 114 | |
| 115 | /-- A fixed short duration gives factor-two comparison with the actual |
| 116 | terminal metric. The duration is independent of the surgery count. -/ |
| 117 | theorem cylinderQuadratic_half_le_and_le_double |
| 118 | (P : M44CapPersistencePredecessors.{u}) (hpinch : SurgeryFlowPinched F) |
| 119 | (e : SurgeryFlowCylinder F C origin 1 (Icc c 0) U) (hU : IsOpen U) |
| 120 | {x : C.carrier} (hx : x ∈ U) (v : TangentSpace (𝓡 3) x) |
| 121 | {K s : ℝ} (hs : s ∈ Icc c 0) |
| 122 | (hshort : 6 * K * (-s) ≤ 1 / 2) |
| 123 | (hRm : ∀ t (ht : t ∈ Icc c 0), |
| 124 | (F.connection (origin + t / 1)).curvatureTensorNorm (e.forward t ht x) ≤ K) : |
| 125 | cylinderQuadratic e x v 0 / 2 ≤ cylinderQuadratic e x v s ∧ |
| 126 | cylinderQuadratic e x v s ≤ 2 * cylinderQuadratic e x v 0 := by |
| 127 | have hzero : 0 ∈ Icc c 0 := ⟨hs.1.trans hs.2, le_rfl⟩ |
| 128 | have hbounds := cylinderQuadratic_exp_bounds P hpinch e hU hx v hs hzero hs.2 |
| 129 | (fun t ht => hRm t ⟨hs.1.trans ht.1, ht.2⟩) |
| 130 | have hn (t : ℝ) (ht : t ∈ Icc c 0) : 0 ≤ cylinderQuadratic e x v t := by |
| 131 | rw [cylinderQuadratic_of_mem e x v t ht] |
| 132 | by_cases hv : mfderiv (𝓡 3) (𝓡 3) (e.forward t ht) x v = 0 |
| 133 | · simp [hv] |
| 134 | · exact ((F.metric (origin + t / 1)).pos _ _ hv).le |
| 135 | have hpower : 6 * K * (0 - s) ≤ 1 / 2 := by |
| 136 | simpa only [zero_sub] using hshort |
| 137 | have hexp : Real.exp (6 * K * (0 - s)) ≤ 2 := by |
| 138 | apply (Real.exp_le_exp.mpr hpower).trans |
| 139 | have h := Real.exp_bound_div_one_sub_of_interval (x := (1 : ℝ) / 2) |
| 140 | (by norm_num) (by norm_num) |
| 141 | norm_num at h ⊢ |
| 142 | exact h |
| 143 | have hcancel : Real.exp (6 * K * (0 - s)) * |
| 144 | Real.exp (-(6 * K) * (0 - s)) = 1 := by |
| 145 | rw [← Real.exp_add] |
| 146 | rw [show 6 * K * (0 - s) + -(6 * K) * (0 - s) = 0 by ring, Real.exp_zero] |
| 147 | have hback := mul_le_mul_of_nonneg_left hbounds.1 |
| 148 | (Real.exp_pos (6 * K * (0 - s))).le |
| 149 | rw [← mul_assoc, hcancel, one_mul] at hback |
| 150 | constructor |
| 151 | · have h := hbounds.2.trans (mul_le_mul_of_nonneg_right hexp (hn s hs)) |
| 152 | linarith |
| 153 | · exact hback.trans (mul_le_mul_of_nonneg_right hexp (hn 0 hzero)) |
| 154 | |
| 155 | /-- At the physical identity end, the comparison reads the actual |
| 156 | terminal metric, including its actual differential, p. 393. -/ |
| 157 | theorem based_cylinder_metric_comparison_two |
| 158 | (P : M44CapPersistencePredecessors.{u}) (hpinch : SurgeryFlowPinched F) |
| 159 | {U : Set (F.slice origin).carrier} |
| 160 | (e : SurgeryFlowCylinder F (F.slice origin) origin 1 (Icc c 0) U) (hU : IsOpen U) |
| 161 | (hbase : ∀ h y, y ∈ U → HEq (e.forward 0 h y) y) |
| 162 | {x : (F.slice origin).carrier} (hx : x ∈ U) (v : TangentSpace (𝓡 3) x) |
| 163 | {K s : ℝ} (hs : s ∈ Icc c 0) |
| 164 | (hshort : 6 * K * (-s) ≤ 1 / 2) |
| 165 | (hRm : ∀ t (ht : t ∈ Icc c 0), |
| 166 | (F.connection (origin + t / 1)).curvatureTensorNorm (e.forward t ht x) ≤ K) : |
| 167 | (F.metric origin).inner x v v ≤ |
| 168 | 2 * (F.metric (origin + s / 1)).inner (e.forward s hs x) |
| 169 | (mfderiv (𝓡 3) (𝓡 3) (e.forward s hs) x v) |
| 170 | (mfderiv (𝓡 3) (𝓡 3) (e.forward s hs) x v) ∧ |
| 171 | (F.metric (origin + s / 1)).inner (e.forward s hs x) |
| 172 | (mfderiv (𝓡 3) (𝓡 3) (e.forward s hs) x v) |
| 173 | (mfderiv (𝓡 3) (𝓡 3) (e.forward s hs) x v) ≤ |
| 174 | 2 * (F.metric origin).inner x v v := by |
| 175 | classical |
| 176 | have hzero : 0 ∈ Icc c 0 := ⟨hs.1.trans hs.2, le_rfl⟩ |
| 177 | have hidentity : cylinderQuadratic e x v 0 = (F.metric origin).inner x v v := by |
| 178 | simp only [cylinderQuadratic, dif_pos hzero] |
| 179 | rw [surgeryCylinder_pullbackInner_zero hU e hzero (hbase hzero) hx v v, one_mul] |
| 180 | have h := cylinderQuadratic_half_le_and_le_double P hpinch e hU hx v hs hshort hRm |
| 181 | rw [hidentity, cylinderQuadratic_of_mem e x v s hs] at h |
| 182 | exact ⟨by linarith [h.1], h.2⟩ |
| 183 | |
| 184 | end PoincareMT.Proofs.M46 |