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.CanonicalInduction.Component.ComponentEstimateStrictHistory |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Component.ComponentEstimateFrontierLimits |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.Induction.ComponentInputs |
| 4 | import PoincareLib.Geometry.Riemannian.Coordinates.Transitions |
| 5 | |
| 6 | /-! |
| 7 | # Metric comparison on an actual whole-component cylinder |
| 8 | |
| 9 | Ordinary comparison on the strict history gives one elapsed-time factor. |
| 10 | The terminal based identity and literal tangent maps transfer it to the |
| 11 | ambient source, and ordinary right continuity includes the first time. |
| 12 | Source: Lemma 3.15, p. 42, used in the induction on pp. 402-405. |
| 13 | See `proof-work/tasks/M47/derivations/component-frontier.md`, Stage F2. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set |
| 20 | open scoped Manifold ContDiff Bundle Topology |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT.M47 |
| 25 | |
| 26 | /-- The actual cylinder differential has quadratic factor at most two |
| 27 | relative to its actual terminal identity, including the first time. |
| 28 | The curvature bound is the stopped internal input; Lemma 3.15, p. 42. -/ |
| 29 | theorem component_cylinder_quadratic_le_two |
| 30 | (P : M47Predecessors.{u}) (PA : M47ComponentAnalyticPredecessors.{u}) |
| 31 | {F : SurgeryFlowData.{u}} {origin a K : ℝ} (ha : a < 0) (hK : 0 ≤ K) |
| 32 | (U : TopologicalSpace.Opens (F.slice origin).carrier) |
| 33 | (hne : (U : Set (F.slice origin).carrier).Nonempty) |
| 34 | (e : SurgeryFlowCylinder F (F.slice origin) origin 1 (Icc a 0) U) |
| 35 | (he : ∀ hs x, x ∈ U → HEq (e.forward 0 hs x) x) |
| 36 | (hshort : 6 * K * (-a) ≤ 1 / 2) |
| 37 | (hcurvature : ∀ s : ℝ, ∀ hs : s ∈ Ioc a 0, ∀ x ∈ U, |
| 38 | (F.connection (origin + s / 1)).curvatureTensorNorm |
| 39 | (e.forward s ⟨hs.1.le, hs.2⟩ x) ≤ K) : |
| 40 | ∀ s : ℝ, ∀ hs : s ∈ Icc a 0, ∀ x ∈ U, ∀ v : TangentSpace (𝓡 3) x, |
| 41 | e.pullbackInner s hs x v v ≤ 2 * (F.metric origin).inner x v v := by |
| 42 | obtain ⟨G, hread⟩ := exists_component_strict_ordinary_history P ha U hne e |
| 43 | have hterminal (z : U) (v w : TangentSpace (𝓡 3) z) : |
| 44 | (G.metric origin).inner z v w = (F.metric origin).inner z.val |
| 45 | (mfderiv (𝓡 3) (𝓡 3) (Subtype.val : U → (F.slice origin).carrier) z v) |
| 46 | (mfderiv (𝓡 3) (𝓡 3) (Subtype.val : U → (F.slice origin).carrier) z w) := by |
| 47 | have hfunctions : |
| 48 | (⟨origin + 0 / 1, fun y : U => e.forward 0 ⟨ha.le, le_rfl⟩ y.val⟩ : |
| 49 | (t : ℝ) × (U → (F.slice t).carrier)) = |
| 50 | ⟨origin, (Subtype.val : U → (F.slice origin).carrier)⟩ := by |
| 51 | apply Sigma.ext (by simp) |
| 52 | apply Function.hfunext rfl |
| 53 | intro y y' hyy |
| 54 | cases hyy |
| 55 | exact he _ y.val y.property |
| 56 | have hpull := congrArg (fun p : (t : ℝ) × (U → (F.slice t).carrier) => |
| 57 | (F.metric p.1).inner (p.2 z) |
| 58 | (mfderiv (𝓡 3) (𝓡 3) p.2 z v) (mfderiv (𝓡 3) (𝓡 3) p.2 z w)) hfunctions |
| 59 | exact (congrArg (fun t => (G.metric t).inner z v w) |
| 60 | (show origin + 0 / 1 = origin by simp)).symm.trans |
| 61 | ((((hread 0 ⟨ha, le_rfl⟩ z).1 v w).symm).trans hpull) |
| 62 | have hstrict (s : ℝ) (hs : s ∈ Ioc a 0) (x : (F.slice origin).carrier) (hx : x ∈ U) |
| 63 | (v : TangentSpace (𝓡 3) x) : |
| 64 | e.pullbackInner s ⟨hs.1.le, hs.2⟩ x v v ≤ 2 * (F.metric origin).inner x v v := by |
| 65 | have hstart : origin + s / 1 ∈ Ioc (origin + a) origin := by |
| 66 | simp only [div_one] |
| 67 | constructor <;> linarith [hs.1, hs.2] |
| 68 | have hend : origin ∈ Ioc (origin + a) origin := ⟨by linarith, le_rfl⟩ |
| 69 | have htime : origin + s / 1 ≤ origin := hstart.2 |
| 70 | have hbound : ∀ t ∈ Icc (origin + s / 1) origin, ∀ z : U, |
| 71 | (G.connection t).curvatureTensorNorm z ≤ K := by |
| 72 | intro t ht z |
| 73 | have hparam : t - origin ∈ Ioc a 0 := by |
| 74 | simp only [div_one] at ht |
| 75 | constructor <;> linarith [ht.1, ht.2, hs.1] |
| 76 | have hc : origin + (t - origin) / 1 = t := by simp only [div_one, add_sub_cancel] |
| 77 | have hnorm : (G.connection t).curvatureTensorNorm z = |
| 78 | (F.connection (origin + (t - origin) / 1)).curvatureTensorNorm |
| 79 | (e.forward (t - origin) ⟨hparam.1.le, hparam.2⟩ z.val) := |
| 80 | (congrArg (fun u => (G.connection u).curvatureTensorNorm z) hc).symm.trans |
| 81 | (hread (t - origin) hparam z).2.2 |
| 82 | exact hnorm.trans_le (hcurvature (t - origin) hparam z.val z.property) |
| 83 | let z : U := ⟨x, hx⟩ |
| 84 | obtain ⟨w, hw⟩ := ((G.metric origin).mfderiv_bijective_of_pullback_eq |
| 85 | (F.metric origin) z (fun v w => (hterminal z v w).symm)).2 v |
| 86 | have hcomparison := (PA.metric_comparison U (Ioc (origin + a) origin) G |
| 87 | (origin + s / 1) origin K hstart hend htime hK hbound z w).1 |
| 88 | let lambda := 6 * K * (origin - (origin + s / 1)) |
| 89 | have hlambda : lambda ≤ 1 / 2 := by |
| 90 | have h := mul_le_mul_of_nonneg_left (show -s ≤ -a by linarith [hs.1]) |
| 91 | (mul_nonneg (by norm_num : (0 : ℝ) ≤ 6) hK) |
| 92 | dsimp only [lambda] |
| 93 | simp only [div_one] |
| 94 | nlinarith [hshort] |
| 95 | have hexp : Real.exp lambda ≤ 2 := by |
| 96 | apply (Real.exp_le_exp.mpr hlambda).trans |
| 97 | have h := Real.exp_bound_div_one_sub_of_interval (x := (1 : ℝ) / 2) |
| 98 | (by norm_num) (by norm_num) |
| 99 | norm_num at h ⊢ |
| 100 | exact h |
| 101 | have hcancel : Real.exp lambda * |
| 102 | Real.exp (-2 * (3 : ℝ) * K * (origin - (origin + s / 1))) = 1 := by |
| 103 | rw [← Real.exp_add] |
| 104 | rw [show lambda + -2 * (3 : ℝ) * K * (origin - (origin + s / 1)) = 0 by |
| 105 | dsimp only [lambda]; ring, Real.exp_zero] |
| 106 | have hback := mul_le_mul_of_nonneg_left hcomparison (Real.exp_pos lambda).le |
| 107 | rw [← mul_assoc, hcancel, one_mul] at hback |
| 108 | have hnonneg : 0 ≤ (G.metric origin).inner z w w := by |
| 109 | by_cases hw0 : w = 0 |
| 110 | · simp [hw0] |
| 111 | · exact ((G.metric origin).pos z w hw0).le |
| 112 | have hGbound := hback.trans (mul_le_mul_of_nonneg_right hexp hnonneg) |
| 113 | have hf := ((e.forward_smooth s ⟨hs.1.le, hs.2⟩ x hx).contMDiffAt |
| 114 | (U.isOpen.mem_nhds hx)).mdifferentiableAt (by simp) |
| 115 | have hd := mfderiv_comp z hf |
| 116 | ((contMDiff_subtype_val (n := ∞) z).mdifferentiableAt (by simp)) |
| 117 | change mfderiv (𝓡 3) (𝓡 3) |
| 118 | (fun y : U => e.forward s ⟨hs.1.le, hs.2⟩ y.val) z = _ at hd |
| 119 | have hpull := (hread s hs z).1 w w |
| 120 | rw [hd] at hpull |
| 121 | simp only [ContinuousLinearMap.comp_apply] at hpull |
| 122 | rw [hw] at hpull |
| 123 | have hterminalValue : (G.metric origin).inner z w w = (F.metric origin).inner x v v := by |
| 124 | rw [hterminal, hw] |
| 125 | have hpullValue : e.pullbackInner s ⟨hs.1.le, hs.2⟩ x v v = |
| 126 | (G.metric (origin + s / 1)).inner z w w := by |
| 127 | simpa only [SurgeryFlowCylinder.pullbackInner, one_mul] using hpull |
| 128 | exact hpullValue.trans_le (hGbound.trans_eq (congrArg (fun r : ℝ => 2 * r) hterminalValue)) |
| 129 | intro s hs x hx v |
| 130 | rcases lt_or_eq_of_le hs.1 with has | rfl |
| 131 | · exact hstrict s ⟨has, hs.2⟩ x hx v |
| 132 | · exact component_cylinder_quadratic_le_at_left e U.isOpen ha hx v |
| 133 | (fun r hr => hstrict r hr x hx v) |
| 134 | |
| 135 | end PoincareMT.M47 |