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.CanonicalGeometry |
| 2 | import Mathlib.Data.Fin.Tuple.Basic |
| 3 | |
| 4 | /-! |
| 5 | # The next finite surgery parameter prefix |
| 6 | |
| 7 | Morgan--Tian, Section 17.2, p. 409, appends the selected radius and |
| 8 | noncollapsing constant and replaces the old last delta cutoff and the new |
| 9 | cutoff by the same smaller value. These are numerical constructions on the |
| 10 | actual prefix and its selected induction outputs, without a global schedule. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | universe u |
| 16 | |
| 17 | namespace PoincareMT |
| 18 | |
| 19 | private theorem antitone_snoc_of_le_last {n : ℕ} {f : Fin (n + 1) → ℝ} |
| 20 | {a : ℝ} (hf : Antitone f) (ha : a ≤ f (Fin.last n)) : |
| 21 | Antitone (Fin.snoc f a) := by |
| 22 | intro j k hjk |
| 23 | cases j using Fin.lastCases with |
| 24 | | last => |
| 25 | have hk : k = Fin.last (n + 1) := le_antisymm (Fin.le_last k) hjk |
| 26 | subst k |
| 27 | exact le_rfl |
| 28 | | cast j => |
| 29 | cases k using Fin.lastCases with |
| 30 | | last => |
| 31 | simpa only [Fin.snoc_castSucc, Fin.snoc_last] using |
| 32 | ha.trans (hf (Fin.le_last j)) |
| 33 | | cast k => |
| 34 | simpa only [Fin.snoc_castSucc] using hf hjk |
| 35 | |
| 36 | private theorem antitone_update_last_of_le {n : ℕ} {f : Fin (n + 1) → ℝ} |
| 37 | {a : ℝ} (hf : Antitone f) (ha : a ≤ f (Fin.last n)) : |
| 38 | Antitone (Function.update f (Fin.last n) a) := by |
| 39 | intro j k hjk |
| 40 | by_cases hk : k = Fin.last n |
| 41 | · subst k |
| 42 | by_cases hj : j = Fin.last n |
| 43 | · subst j |
| 44 | exact le_rfl |
| 45 | · simpa [Function.update, hj] using ha.trans (hf (Fin.le_last j)) |
| 46 | · have hj : j ≠ Fin.last n := by |
| 47 | intro heq |
| 48 | subst j |
| 49 | exact hk (le_antisymm (Fin.le_last k) hjk) |
| 50 | simpa [Function.update, hj, hk] using hf hjk |
| 51 | |
| 52 | namespace SurgeryParameterPrefix |
| 53 | |
| 54 | variable {K : MetricSurgeryConstants} |
| 55 | (p : SurgeryParameterPrefix K) (Q : SurgeryNoncollapseExtension.{u} p) |
| 56 | (R : SurgeryCanonicalExtension p Q) |
| 57 | |
| 58 | theorem nextPrefix_deltaNext_le_last : R.deltaNext ≤ p.Delta (Fin.last p.i) := |
| 59 | R.delta_le_cutoff.trans (Q.cutoff_bounds R.rNext R.r_pos R.r_le_last).2 |
| 60 | |
| 61 | /-- Append the actual M46/M47 choices, tightening the old last delta cutoff |
| 62 | as well as prescribing the new one. The initial seeds are unchanged. -/ |
| 63 | noncomputable def nextPrefix : SurgeryParameterPrefix K where |
| 64 | setup := p.setup |
| 65 | i := p.i + 1 |
| 66 | i_pos := Nat.succ_pos _ |
| 67 | r := Fin.snoc p.r R.rNext |
| 68 | kappa := Fin.snoc p.kappa Q.kappaNew |
| 69 | Delta := Fin.snoc |
| 70 | (Function.update p.Delta (Fin.last p.i) R.deltaNext) R.deltaNext |
| 71 | r_pos := by |
| 72 | intro j |
| 73 | cases j using Fin.lastCases with |
| 74 | | last => simpa only [Fin.snoc_last] using R.r_pos |
| 75 | | cast j => simpa only [Fin.snoc_castSucc] using p.r_pos j |
| 76 | kappa_pos := by |
| 77 | intro j |
| 78 | cases j using Fin.lastCases with |
| 79 | | last => simpa only [Fin.snoc_last] using Q.kappa_pos |
| 80 | | cast j => simpa only [Fin.snoc_castSucc] using p.kappa_pos j |
| 81 | Delta_pos := by |
| 82 | intro j |
| 83 | cases j using Fin.lastCases with |
| 84 | | last => simpa only [Fin.snoc_last] using R.delta_pos |
| 85 | | cast j => |
| 86 | by_cases hj : j = Fin.last p.i |
| 87 | · subst j |
| 88 | simpa using R.delta_pos |
| 89 | · simpa [Function.update, hj] using p.Delta_pos j |
| 90 | r_antitone := antitone_snoc_of_le_last p.r_antitone R.r_le_last |
| 91 | kappa_antitone := antitone_snoc_of_le_last p.kappa_antitone Q.kappa_le_last |
| 92 | Delta_antitone := antitone_snoc_of_le_last |
| 93 | (antitone_update_last_of_le p.Delta_antitone (p.nextPrefix_deltaNext_le_last Q R)) |
| 94 | (by simp) |
| 95 | r_zero := by |
| 96 | change Fin.snoc (α := fun _ => ℝ) p.r R.rNext |
| 97 | (0 : Fin (p.i + 1 + 1)) = p.setup.epsilon |
| 98 | rw [Fin.snoc_apply_zero] |
| 99 | exact p.r_zero |
| 100 | r_le_epsilon := by |
| 101 | intro j |
| 102 | cases j using Fin.lastCases with |
| 103 | | last => |
| 104 | simpa only [Fin.snoc_last] using |
| 105 | R.r_le_last.trans (p.r_le_epsilon (Fin.last p.i)) |
| 106 | | cast j => simpa only [Fin.snoc_castSucc] using p.r_le_epsilon j |
| 107 | Delta_le_setup := by |
| 108 | have hdelta : R.deltaNext ≤ K.delta₀ := |
| 109 | (p.nextPrefix_deltaNext_le_last Q R).trans (p.Delta_le_setup (Fin.last p.i)) |
| 110 | intro j |
| 111 | cases j using Fin.lastCases with |
| 112 | | last => simpa only [Fin.snoc_last] using hdelta |
| 113 | | cast j => |
| 114 | by_cases hj : j = Fin.last p.i |
| 115 | · subst j |
| 116 | simpa using hdelta |
| 117 | · simpa [Function.update, hj] using p.Delta_le_setup j |
| 118 | |
| 119 | @[simp] theorem nextPrefix_setup : (p.nextPrefix Q R).setup = p.setup := rfl |
| 120 | |
| 121 | @[simp] theorem nextPrefix_i : (p.nextPrefix Q R).i = p.i + 1 := rfl |
| 122 | |
| 123 | @[simp] theorem nextPrefix_r_castSucc (j : Fin (p.i + 1)) : |
| 124 | (p.nextPrefix Q R).r j.castSucc = p.r j := by |
| 125 | change Fin.snoc (α := fun _ => ℝ) p.r R.rNext j.castSucc = p.r j |
| 126 | exact Fin.snoc_castSucc (α := fun _ => ℝ) R.rNext p.r j |
| 127 | |
| 128 | @[simp] theorem nextPrefix_kappa_castSucc (j : Fin (p.i + 1)) : |
| 129 | (p.nextPrefix Q R).kappa j.castSucc = p.kappa j := by |
| 130 | change Fin.snoc (α := fun _ => ℝ) p.kappa Q.kappaNew j.castSucc = p.kappa j |
| 131 | exact Fin.snoc_castSucc (α := fun _ => ℝ) Q.kappaNew p.kappa j |
| 132 | |
| 133 | theorem nextPrefix_Delta_castSucc (j : Fin (p.i + 1)) : |
| 134 | (p.nextPrefix Q R).Delta j.castSucc = |
| 135 | Function.update p.Delta (Fin.last p.i) R.deltaNext j := by |
| 136 | change Fin.snoc (α := fun _ => ℝ) |
| 137 | (Function.update p.Delta (Fin.last p.i) R.deltaNext) |
| 138 | R.deltaNext j.castSucc = _ |
| 139 | exact Fin.snoc_castSucc (α := fun _ => ℝ) R.deltaNext _ j |
| 140 | |
| 141 | theorem nextPrefix_Delta_castSucc_of_lt (j : Fin (p.i + 1)) (hj : j.val < p.i) : |
| 142 | (p.nextPrefix Q R).Delta j.castSucc = p.Delta j := by |
| 143 | have hne : j ≠ Fin.last p.i := by |
| 144 | intro heq |
| 145 | have hval := congrArg Fin.val heq |
| 146 | exact (Nat.ne_of_lt hj) hval |
| 147 | simp [nextPrefix_Delta_castSucc, Function.update, hne] |
| 148 | |
| 149 | @[simp] theorem nextPrefix_Delta_penultimate : |
| 150 | (p.nextPrefix Q R).Delta (Fin.last p.i).castSucc = R.deltaNext := by |
| 151 | simp [nextPrefix_Delta_castSucc] |
| 152 | |
| 153 | @[simp] theorem nextPrefix_r_last : |
| 154 | (p.nextPrefix Q R).r (Fin.last (p.i + 1)) = R.rNext := by |
| 155 | change Fin.snoc (α := fun _ => ℝ) p.r R.rNext (Fin.last (p.i + 1)) = R.rNext |
| 156 | exact Fin.snoc_last (α := fun _ => ℝ) R.rNext p.r |
| 157 | |
| 158 | @[simp] theorem nextPrefix_kappa_last : |
| 159 | (p.nextPrefix Q R).kappa (Fin.last (p.i + 1)) = Q.kappaNew := by |
| 160 | change Fin.snoc (α := fun _ => ℝ) p.kappa Q.kappaNew |
| 161 | (Fin.last (p.i + 1)) = Q.kappaNew |
| 162 | exact Fin.snoc_last (α := fun _ => ℝ) Q.kappaNew p.kappa |
| 163 | |
| 164 | @[simp] theorem nextPrefix_Delta_last : |
| 165 | (p.nextPrefix Q R).Delta (Fin.last (p.i + 1)) = R.deltaNext := by |
| 166 | change Fin.snoc (α := fun _ => ℝ) |
| 167 | (Function.update p.Delta (Fin.last p.i) R.deltaNext) |
| 168 | R.deltaNext (Fin.last (p.i + 1)) = R.deltaNext |
| 169 | exact Fin.snoc_last (α := fun _ => ℝ) R.deltaNext _ |
| 170 | |
| 171 | theorem nextPrefix_Delta_castSucc_le (j : Fin (p.i + 1)) : |
| 172 | (p.nextPrefix Q R).Delta j.castSucc ≤ p.Delta j := by |
| 173 | by_cases hj : j = Fin.last p.i |
| 174 | · subst j |
| 175 | simpa using p.nextPrefix_deltaNext_le_last Q R |
| 176 | · simp [nextPrefix_Delta_castSucc, Function.update, hj] |
| 177 | |
| 178 | @[simp] theorem nextPrefix_r_zero : (p.nextPrefix Q R).r 0 = p.r 0 := by |
| 179 | change Fin.snoc (α := fun _ => ℝ) p.r R.rNext |
| 180 | (0 : Fin (p.i + 1 + 1)) = p.r 0 |
| 181 | exact Fin.snoc_apply_zero (α := fun _ => ℝ) R.rNext p.r |
| 182 | |
| 183 | @[simp] theorem nextPrefix_kappa_zero : |
| 184 | (p.nextPrefix Q R).kappa 0 = p.kappa 0 := by |
| 185 | change Fin.snoc (α := fun _ => ℝ) p.kappa Q.kappaNew |
| 186 | (0 : Fin (p.i + 1 + 1)) = p.kappa 0 |
| 187 | exact Fin.snoc_apply_zero (α := fun _ => ℝ) Q.kappaNew p.kappa |
| 188 | |
| 189 | @[simp] theorem nextPrefix_Delta_zero : (p.nextPrefix Q R).Delta 0 = p.Delta 0 := by |
| 190 | change Fin.snoc (α := fun _ => ℝ) |
| 191 | (Function.update p.Delta (Fin.last p.i) R.deltaNext) R.deltaNext |
| 192 | (0 : Fin (p.i + 1 + 1)) = p.Delta 0 |
| 193 | rw [Fin.snoc_apply_zero] |
| 194 | have hne : (0 : Fin (p.i + 1)) ≠ Fin.last p.i := by |
| 195 | intro heq |
| 196 | exact (Nat.ne_of_lt p.i_pos) (congrArg Fin.val heq) |
| 197 | simp [Function.update, hne] |
| 198 | |
| 199 | end SurgeryParameterPrefix |
| 200 | |
| 201 | end PoincareMT |