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.Harnack.Matrix.Evolution.QuadraticReaction |
| 2 | |
| 3 | /-! |
| 4 | # Algebraic perturbations of Hamilton's reaction |
| 5 | |
| 6 | The identity on skew two-form arrays has coefficients one half of the |
| 7 | alternating Kronecker product. These normalizations and reaction bounds are |
| 8 | used in Chow et al., Part II, Lemma 15.24, Section 15.4.5. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open scoped BigOperators |
| 14 | |
| 15 | namespace Poincare.RicciFlow.Harnack |
| 16 | |
| 17 | variable {I : Type*} [DecidableEq I] |
| 18 | |
| 19 | /-- The identity on skew two-form arrays, with the full ordered-pair sum. -/ |
| 20 | noncomputable def twoFormIdentity (a b c d : I) : ℝ := |
| 21 | ((if a = c ∧ b = d then 1 else 0) - (if a = d ∧ b = c then 1 else 0)) / 2 |
| 22 | |
| 23 | lemma twoFormIdentity_skew_first (a b c d : I) : |
| 24 | twoFormIdentity a b c d = -twoFormIdentity b a c d := by |
| 25 | simp only [twoFormIdentity, and_comm] |
| 26 | ring |
| 27 | |
| 28 | lemma twoFormIdentity_skew_last (a b c d : I) : |
| 29 | twoFormIdentity a b c d = -twoFormIdentity a b d c := by |
| 30 | dsimp only [twoFormIdentity] |
| 31 | ring |
| 32 | |
| 33 | lemma twoFormIdentity_pair_swap (a b c d : I) : |
| 34 | twoFormIdentity a b c d = twoFormIdentity c d a b := by |
| 35 | simp only [twoFormIdentity, eq_comm, and_comm] |
| 36 | |
| 37 | lemma twoFormIdentity_bianchi (a b c d : I) : |
| 38 | twoFormIdentity a b c d + twoFormIdentity b c a d + twoFormIdentity c a b d = 0 := by |
| 39 | simp only [twoFormIdentity, eq_comm, and_comm] |
| 40 | ring |
| 41 | |
| 42 | lemma abs_twoFormIdentity_le_one (a b c d : I) : |
| 43 | |twoFormIdentity a b c d| ≤ 1 := by |
| 44 | unfold twoFormIdentity |
| 45 | split_ifs <;> norm_num |
| 46 | |
| 47 | variable [Fintype I] |
| 48 | |
| 49 | lemma twoFormIdentity_contract (U : I → I → ℝ) |
| 50 | (hU : ∀ a b, U a b = -U b a) (a b : I) : |
| 51 | (∑ c, ∑ d, twoFormIdentity a b c d * U c d) = U a b := by |
| 52 | simp only [twoFormIdentity, sub_div, sub_mul, Finset.sum_sub_distrib] |
| 53 | simp only [ite_and, ite_div, zero_div, ite_mul, zero_mul, Finset.sum_ite_irrel, |
| 54 | Finset.sum_ite_eq, Finset.mem_univ, if_true, Finset.sum_const_zero] |
| 55 | rw [hU b a] |
| 56 | ring |
| 57 | |
| 58 | lemma twoFormIdentity_quadratic (U : I → I → ℝ) |
| 59 | (hU : ∀ a b, U a b = -U b a) : |
| 60 | (∑ a, ∑ b, ∑ c, ∑ d, twoFormIdentity a b c d * U a b * U c d) = |
| 61 | ∑ a, ∑ b, (U a b) ^ 2 := by |
| 62 | apply Finset.sum_congr rfl |
| 63 | intro a _ |
| 64 | apply Finset.sum_congr rfl |
| 65 | intro b _ |
| 66 | calc |
| 67 | _ = U a b * ∑ c, ∑ d, twoFormIdentity a b c d * U c d := by |
| 68 | simp only [Finset.mul_sum] |
| 69 | apply Finset.sum_congr rfl |
| 70 | intro c _ |
| 71 | apply Finset.sum_congr rfl |
| 72 | intro d _ |
| 73 | ring |
| 74 | _ = _ := by rw [twoFormIdentity_contract U hU]; ring |
| 75 | |
| 76 | private lemma abs_mul_pair_le (A u v C : ℝ) (hC : 0 ≤ C) (hA : |A| ≤ C) : |
| 77 | |A * u * v| ≤ C / 2 * (u ^ 2 + v ^ 2) := by |
| 78 | have hprod := mul_le_mul_of_nonneg_right hA (abs_nonneg (u * v)) |
| 79 | have hquad : |u * v| ≤ (u ^ 2 + v ^ 2) / 2 := by |
| 80 | rw [abs_mul] |
| 81 | nlinarith only [sq_nonneg (|u| - |v|), sq_abs u, sq_abs v] |
| 82 | have h := mul_le_mul_of_nonneg_left hquad hC |
| 83 | rw [abs_mul, ← mul_assoc] at hprod |
| 84 | rw [abs_mul] at h |
| 85 | simpa only [abs_mul, mul_assoc] using hprod.trans (by nlinarith only [h]) |
| 86 | |
| 87 | private lemma abs_mul_shift_error_le |
| 88 | (r m i d α ψ KR KM : ℝ) |
| 89 | (hα : 0 ≤ α) (hψ : 0 ≤ ψ) (hψone : ψ ≤ 1) |
| 90 | (hKR : 0 ≤ KR) (_hKM : 0 ≤ KM) |
| 91 | (hr : |r| ≤ KR) (hm : |m| ≤ KM) (hi : |i| ≤ 1) (hd : |d| ≤ 1) : |
| 92 | |(r + ψ * i) * (m + α * d) - r * m| ≤ (KR + 1) * α + KM * ψ := by |
| 93 | have hiψ : |ψ * i| ≤ ψ := by |
| 94 | rw [abs_mul, abs_of_nonneg hψ] |
| 95 | simpa only [mul_one] using mul_le_mul_of_nonneg_left hi hψ |
| 96 | have hdα : |α * d| ≤ α := by |
| 97 | rw [abs_mul, abs_of_nonneg hα] |
| 98 | simpa only [mul_one] using mul_le_mul_of_nonneg_left hd hα |
| 99 | have h₁ : |r * (α * d)| ≤ KR * α := by |
| 100 | rw [abs_mul] |
| 101 | exact mul_le_mul hr hdα (abs_nonneg _) hKR |
| 102 | have h₂ : |ψ * i * m| ≤ ψ * KM := by |
| 103 | rw [abs_mul] |
| 104 | exact mul_le_mul hiψ hm (abs_nonneg _) hψ |
| 105 | have h₃ : |ψ * i * (α * d)| ≤ α := by |
| 106 | rw [abs_mul] |
| 107 | exact (mul_le_mul hiψ hdα (abs_nonneg _) hψ).trans |
| 108 | (by nlinarith only [mul_le_mul_of_nonneg_right hψone hα]) |
| 109 | calc |
| 110 | _ = |r * (α * d) + ψ * i * m + ψ * i * (α * d)| := by congr 1; ring |
| 111 | _ ≤ |r * (α * d)| + |ψ * i * m| + |ψ * i * (α * d)| := |
| 112 | by linarith only [abs_add_le (r * (α * d) + ψ * i * m) (ψ * i * (α * d)), |
| 113 | abs_add_le (r * (α * d)) (ψ * i * m)] |
| 114 | _ ≤ _ := by linarith only [h₁, h₂, h₃] |
| 115 | |
| 116 | private lemma abs_curvature_shift_product_error_le |
| 117 | (r s i j ψ K : ℝ) (hψ : 0 ≤ ψ) (hψone : ψ ≤ 1) |
| 118 | (hK : 0 ≤ K) (hr : |r| ≤ K) (hs : |s| ≤ K) |
| 119 | (hi : |i| ≤ 1) (hj : |j| ≤ 1) : |
| 120 | |(r + ψ * i) * (s + ψ * j) - r * s| ≤ ψ * (2 * K + 1) := by |
| 121 | have h := abs_mul_shift_error_le r s i j ψ ψ K K |
| 122 | hψ hψ hψone hK hK hr hs hi hj |
| 123 | nlinarith only [h] |
| 124 | |
| 125 | /-- Replacing the curvature and two-tensor in the `RM` reaction gives an |
| 126 | error linear in the two perturbation parameters. -/ |
| 127 | lemma abs_curvature_twoTensor_replacement_le |
| 128 | (R : I → I → I → I → ℝ) (M : I → I → ℝ) (W : I → ℝ) |
| 129 | (α ψ KR KM : ℝ) (hα : 0 ≤ α) (hψ : 0 ≤ ψ) (hψone : ψ ≤ 1) |
| 130 | (hKR : 0 ≤ KR) (hKM : 0 ≤ KM) |
| 131 | (hR : ∀ a b c d, |R a b c d| ≤ KR) (hM : ∀ a b, |M a b| ≤ KM) : |
| 132 | |(∑ a, ∑ c, ∑ b, ∑ d, |
| 133 | (R a c b d + ψ * twoFormIdentity a c b d) * |
| 134 | (M c d + α * (if c = d then 1 else 0)) * W a * W b) - |
| 135 | (∑ a, ∑ c, ∑ b, ∑ d, R a c b d * M c d * W a * W b)| ≤ |
| 136 | (Fintype.card I : ℝ) ^ 3 * ((KR + 1) * α + KM * ψ) * ∑ a, (W a) ^ 2 := by |
| 137 | let C := (KR + 1) * α + KM * ψ |
| 138 | have hC : 0 ≤ C := by dsimp [C]; positivity |
| 139 | have hentry (a c b d : I) : |
| 140 | |((R a c b d + ψ * twoFormIdentity a c b d) * |
| 141 | (M c d + α * (if c = d then 1 else 0)) - R a c b d * M c d) * W a * W b| ≤ |
| 142 | C / 2 * ((W a) ^ 2 + (W b) ^ 2) := by |
| 143 | apply abs_mul_pair_le _ _ _ C hC |
| 144 | exact abs_mul_shift_error_le _ _ _ _ α ψ KR KM hα hψ hψone hKR hKM |
| 145 | (hR a c b d) (hM c d) (abs_twoFormIdentity_le_one a c b d) |
| 146 | (by split_ifs <;> norm_num) |
| 147 | calc |
| 148 | _ = |∑ a, ∑ c, ∑ b, ∑ d, |
| 149 | ((R a c b d + ψ * twoFormIdentity a c b d) * |
| 150 | (M c d + α * (if c = d then 1 else 0)) - R a c b d * M c d) * W a * W b| := by |
| 151 | simp only [sub_mul, Finset.sum_sub_distrib] |
| 152 | _ ≤ ∑ a, ∑ c, ∑ b, ∑ d, |
| 153 | |((R a c b d + ψ * twoFormIdentity a c b d) * |
| 154 | (M c d + α * (if c = d then 1 else 0)) - R a c b d * M c d) * W a * W b| := by |
| 155 | apply (Finset.abs_sum_le_sum_abs _ _).trans |
| 156 | apply Finset.sum_le_sum |
| 157 | intro a _ |
| 158 | apply (Finset.abs_sum_le_sum_abs _ _).trans |
| 159 | apply Finset.sum_le_sum |
| 160 | intro c _ |
| 161 | apply (Finset.abs_sum_le_sum_abs _ _).trans |
| 162 | apply Finset.sum_le_sum |
| 163 | intro b _ |
| 164 | exact Finset.abs_sum_le_sum_abs _ _ |
| 165 | _ ≤ ∑ a : I, ∑ c : I, ∑ b : I, ∑ d : I, |
| 166 | C / 2 * ((W a) ^ 2 + (W b) ^ 2) := by |
| 167 | exact Finset.sum_le_sum (fun a _ => Finset.sum_le_sum (fun c _ => |
| 168 | Finset.sum_le_sum (fun b _ => Finset.sum_le_sum (fun d _ => hentry a c b d)))) |
| 169 | _ = _ := by |
| 170 | simp only [mul_add, Finset.sum_add_distrib, Finset.sum_const, |
| 171 | Finset.card_univ, nsmul_eq_mul, ← Finset.mul_sum] |
| 172 | dsimp only [C] |
| 173 | ring |
| 174 | |
| 175 | private lemma abs_mixed_shift_term_le |
| 176 | (i p u w ψ K : ℝ) (hψ : 0 ≤ ψ) (hK : 0 ≤ K) |
| 177 | (hi : |i| ≤ 1) (hp : |p| ≤ K) : |
| 178 | |ψ * i * p * u * w| ≤ ψ / 2 * (u ^ 2 + K ^ 2 * w ^ 2) := by |
| 179 | have h := abs_mul_pair_le i u (p * w) 1 (by norm_num) hi |
| 180 | have hp₂ : p ^ 2 ≤ K ^ 2 := by |
| 181 | simpa only [sq_abs] using (sq_le_sq₀ (abs_nonneg _) hK).2 hp |
| 182 | have hpw := mul_le_mul_of_nonneg_right hp₂ (sq_nonneg w) |
| 183 | have hbound : |i * u * (p * w)| ≤ (u ^ 2 + K ^ 2 * w ^ 2) / 2 := by |
| 184 | nlinarith only [h, hpw] |
| 185 | calc |
| 186 | _ = ψ * |i * u * (p * w)| := by |
| 187 | simp only [abs_mul, abs_of_nonneg hψ] |
| 188 | ring |
| 189 | _ ≤ _ := by |
| 190 | have hh := mul_le_mul_of_nonneg_left hbound hψ |
| 191 | nlinarith only [hh] |
| 192 | |
| 193 | /-- The mixed reaction replacement is controlled by Young's inequality with |
| 194 | the three-tensor bound placed entirely in the vector coefficient. -/ |
| 195 | lemma abs_curvature_threeTensor_replacement_le |
| 196 | (R : I → I → I → I → ℝ) (P : I → I → I → ℝ) |
| 197 | (U : I → I → ℝ) (W : I → ℝ) (ψ K : ℝ) |
| 198 | (hψ : 0 ≤ ψ) (hK : 0 ≤ K) (hP : ∀ a b c, |P a b c| ≤ K) : |
| 199 | |(∑ a, ∑ b, ∑ c, ∑ d, ∑ e, |
| 200 | ((R a d b e + ψ * twoFormIdentity a d b e) * P d e c + |
| 201 | (R a d c e + ψ * twoFormIdentity a d c e) * P d b e + |
| 202 | (R b d c e + ψ * twoFormIdentity b d c e) * P a d e) * U a b * W c) - |
| 203 | (∑ a, ∑ b, ∑ c, ∑ d, ∑ e, |
| 204 | (R a d b e * P d e c + R a d c e * P d b e + R b d c e * P a d e) * U a b * W c)| ≤ |
| 205 | 3 / 2 * (Fintype.card I : ℝ) ^ 3 * ψ * (∑ a, ∑ b, (U a b) ^ 2) + |
| 206 | 3 / 2 * (Fintype.card I : ℝ) ^ 4 * ψ * K ^ 2 * ∑ a, (W a) ^ 2 := by |
| 207 | let E := fun a b c d e => |
| 208 | (R a d b e + ψ * twoFormIdentity a d b e) * P d e c + |
| 209 | (R a d c e + ψ * twoFormIdentity a d c e) * P d b e + |
| 210 | (R b d c e + ψ * twoFormIdentity b d c e) * P a d e - |
| 211 | (R a d b e * P d e c + R a d c e * P d b e + R b d c e * P a d e) |
| 212 | have he (a b c d e : I) : |
| 213 | |E a b c d e * U a b * W c| ≤ 3 * ψ / 2 * ((U a b) ^ 2 + K ^ 2 * (W c) ^ 2) := by |
| 214 | have h₁ := abs_mixed_shift_term_le _ _ (U a b) (W c) ψ K hψ hK |
| 215 | (abs_twoFormIdentity_le_one a d b e) (hP d e c) |
| 216 | have h₂ := abs_mixed_shift_term_le _ _ (U a b) (W c) ψ K hψ hK |
| 217 | (abs_twoFormIdentity_le_one a d c e) (hP d b e) |
| 218 | have h₃ := abs_mixed_shift_term_le _ _ (U a b) (W c) ψ K hψ hK |
| 219 | (abs_twoFormIdentity_le_one b d c e) (hP a d e) |
| 220 | have hEq : E a b c d e * U a b * W c = |
| 221 | ψ * twoFormIdentity a d b e * P d e c * U a b * W c + |
| 222 | ψ * twoFormIdentity a d c e * P d b e * U a b * W c + |
| 223 | ψ * twoFormIdentity b d c e * P a d e * U a b * W c := by dsimp [E]; ring |
| 224 | rw [hEq] |
| 225 | exact (abs_add_le _ _).trans (by |
| 226 | have hh := abs_add_le |
| 227 | (ψ * twoFormIdentity a d b e * P d e c * U a b * W c) |
| 228 | (ψ * twoFormIdentity a d c e * P d b e * U a b * W c) |
| 229 | nlinarith only [hh, h₁, h₂, h₃]) |
| 230 | calc |
| 231 | _ = |∑ a, ∑ b, ∑ c, ∑ d, ∑ e, E a b c d e * U a b * W c| := by |
| 232 | simp only [E, sub_mul, Finset.sum_sub_distrib] |
| 233 | _ ≤ ∑ a, ∑ b, ∑ c, ∑ d, ∑ e, |E a b c d e * U a b * W c| := by |
| 234 | apply (Finset.abs_sum_le_sum_abs _ _).trans |
| 235 | apply Finset.sum_le_sum |
| 236 | intro a _ |
| 237 | apply (Finset.abs_sum_le_sum_abs _ _).trans |
| 238 | apply Finset.sum_le_sum |
| 239 | intro b _ |
| 240 | apply (Finset.abs_sum_le_sum_abs _ _).trans |
| 241 | apply Finset.sum_le_sum |
| 242 | intro c _ |
| 243 | apply (Finset.abs_sum_le_sum_abs _ _).trans |
| 244 | apply Finset.sum_le_sum |
| 245 | intro d _ |
| 246 | exact Finset.abs_sum_le_sum_abs _ _ |
| 247 | _ ≤ ∑ a : I, ∑ b : I, ∑ c : I, ∑ d : I, ∑ e : I, |
| 248 | 3 * ψ / 2 * ((U a b) ^ 2 + K ^ 2 * (W c) ^ 2) := by |
| 249 | exact Finset.sum_le_sum (fun a _ => Finset.sum_le_sum (fun b _ => |
| 250 | Finset.sum_le_sum (fun c _ => Finset.sum_le_sum (fun d _ => |
| 251 | Finset.sum_le_sum (fun e _ => he a b c d e))))) |
| 252 | _ = _ := by |
| 253 | simp only [mul_add, Finset.sum_add_distrib, Finset.sum_const, |
| 254 | Finset.card_univ, nsmul_eq_mul, ← Finset.mul_sum] |
| 255 | ring |
| 256 | |
| 257 | private lemma abs_curvatureB_replacement_le |
| 258 | (R : I → I → I → I → ℝ) (ψ K : ℝ) |
| 259 | (hψ : 0 ≤ ψ) (hψone : ψ ≤ 1) (hK : 0 ≤ K) |
| 260 | (hR : ∀ a b c d, |R a b c d| ≤ K) (a b c d : I) : |
| 261 | |(∑ e, ∑ f, (R a e b f + ψ * twoFormIdentity a e b f) * |
| 262 | (R c e d f + ψ * twoFormIdentity c e d f)) - |
| 263 | (∑ e, ∑ f, R a e b f * R c e d f)| ≤ |
| 264 | (Fintype.card I : ℝ) ^ 2 * ψ * (2 * K + 1) := by |
| 265 | rw [← Finset.sum_sub_distrib] |
| 266 | simp_rw [← Finset.sum_sub_distrib] |
| 267 | calc |
| 268 | _ ≤ ∑ e, ∑ f, |(R a e b f + ψ * twoFormIdentity a e b f) * |
| 269 | (R c e d f + ψ * twoFormIdentity c e d f) - R a e b f * R c e d f| := |
| 270 | (Finset.abs_sum_le_sum_abs _ _).trans |
| 271 | (Finset.sum_le_sum (fun e _ => Finset.abs_sum_le_sum_abs _ _)) |
| 272 | _ ≤ ∑ _e : I, ∑ _f : I, ψ * (2 * K + 1) := by |
| 273 | exact Finset.sum_le_sum (fun e _ => Finset.sum_le_sum (fun f _ => |
| 274 | abs_curvature_shift_product_error_le _ _ _ _ ψ K hψ hψone hK |
| 275 | (hR a e b f) (hR c e d f) |
| 276 | (abs_twoFormIdentity_le_one a e b f) (abs_twoFormIdentity_le_one c e d f))) |
| 277 | _ = _ := by simp; ring |
| 278 | |
| 279 | /-- The full curvature-square reaction changes by an error bounded in the |
| 280 | two-form norm. The estimate requires no curvature sign condition. -/ |
| 281 | lemma abs_curvature_reaction_replacement_le |
| 282 | (R : I → I → I → I → ℝ) (U : I → I → ℝ) (ψ K : ℝ) |
| 283 | (hψ : 0 ≤ ψ) (hψone : ψ ≤ 1) (hK : 0 ≤ K) |
| 284 | (hR : ∀ a b c d, |R a b c d| ≤ K) : |
| 285 | let B := fun a b c d => ∑ e, ∑ f, R a e b f * R c e d f |
| 286 | let Bhat := fun a b c d => ∑ e, ∑ f, |
| 287 | (R a e b f + ψ * twoFormIdentity a e b f) * |
| 288 | (R c e d f + ψ * twoFormIdentity c e d f) |
| 289 | |(∑ a, ∑ b, ∑ c, ∑ d, |
| 290 | (Bhat a b c d - Bhat a b d c - Bhat a d b c + Bhat a c b d) * U a b * U c d) - |
| 291 | (∑ a, ∑ b, ∑ c, ∑ d, |
| 292 | (B a b c d - B a b d c - B a d b c + B a c b d) * U a b * U c d)| ≤ |
| 293 | 4 * (Fintype.card I : ℝ) ^ 4 * ψ * (2 * K + 1) * ∑ a, ∑ b, (U a b) ^ 2 := by |
| 294 | dsimp only |
| 295 | let B := fun a b c d => ∑ e, ∑ f, R a e b f * R c e d f |
| 296 | let Bhat := fun a b c d => ∑ e, ∑ f, |
| 297 | (R a e b f + ψ * twoFormIdentity a e b f) * |
| 298 | (R c e d f + ψ * twoFormIdentity c e d f) |
| 299 | let C := (Fintype.card I : ℝ) ^ 2 * ψ * (2 * K + 1) |
| 300 | have hC : 0 ≤ C := by dsimp [C]; positivity |
| 301 | have hb (a b c d : I) : |Bhat a b c d - B a b c d| ≤ C := |
| 302 | abs_curvatureB_replacement_le R ψ K hψ hψone hK hR a b c d |
| 303 | have he (a b c d : I) : |
| 304 | |(Bhat a b c d - Bhat a b d c - Bhat a d b c + Bhat a c b d) - |
| 305 | (B a b c d - B a b d c - B a d b c + B a c b d)| ≤ 4 * C := by |
| 306 | have h₁ := (abs_le.mp (hb a b c d)) |
| 307 | have h₂ := (abs_le.mp (hb a b d c)) |
| 308 | have h₃ := (abs_le.mp (hb a d b c)) |
| 309 | have h₄ := (abs_le.mp (hb a c b d)) |
| 310 | apply abs_le.mpr |
| 311 | constructor <;> linarith only [h₁.1, h₁.2, h₂.1, h₂.2, h₃.1, h₃.2, h₄.1, h₄.2] |
| 312 | change |(∑ a, ∑ b, ∑ c, ∑ d, |
| 313 | (Bhat a b c d - Bhat a b d c - Bhat a d b c + Bhat a c b d) * U a b * U c d) - |
| 314 | (∑ a, ∑ b, ∑ c, ∑ d, |
| 315 | (B a b c d - B a b d c - B a d b c + B a c b d) * U a b * U c d)| ≤ _ |
| 316 | calc |
| 317 | _ = |∑ a, ∑ b, ∑ c, ∑ d, |
| 318 | ((Bhat a b c d - Bhat a b d c - Bhat a d b c + Bhat a c b d) - |
| 319 | (B a b c d - B a b d c - B a d b c + B a c b d)) * U a b * U c d| := by |
| 320 | simp only [sub_mul, Finset.sum_sub_distrib] |
| 321 | _ ≤ ∑ a, ∑ b, ∑ c, ∑ d, |
| 322 | |((Bhat a b c d - Bhat a b d c - Bhat a d b c + Bhat a c b d) - |
| 323 | (B a b c d - B a b d c - B a d b c + B a c b d)) * U a b * U c d| := by |
| 324 | apply (Finset.abs_sum_le_sum_abs _ _).trans |
| 325 | apply Finset.sum_le_sum |
| 326 | intro a _ |
| 327 | apply (Finset.abs_sum_le_sum_abs _ _).trans |
| 328 | apply Finset.sum_le_sum |
| 329 | intro b _ |
| 330 | apply (Finset.abs_sum_le_sum_abs _ _).trans |
| 331 | apply Finset.sum_le_sum |
| 332 | intro c _ |
| 333 | exact Finset.abs_sum_le_sum_abs _ _ |
| 334 | _ ≤ ∑ a : I, ∑ b : I, ∑ c : I, ∑ d : I, |
| 335 | (4 * C) / 2 * ((U a b) ^ 2 + (U c d) ^ 2) := by |
| 336 | exact Finset.sum_le_sum (fun a _ => Finset.sum_le_sum (fun b _ => |
| 337 | Finset.sum_le_sum (fun c _ => Finset.sum_le_sum (fun d _ => |
| 338 | abs_mul_pair_le _ _ _ (4 * C) (by positivity) (he a b c d))))) |
| 339 | _ = _ := by |
| 340 | simp only [mul_add, Finset.sum_add_distrib, Finset.sum_const, |
| 341 | Finset.card_univ, nsmul_eq_mul, ← Finset.mul_sum] |
| 342 | dsimp only [C] |
| 343 | ring |
| 344 | |
| 345 | /-- Hamilton's reaction in the collected tensor-evolution form. -/ |
| 346 | noncomputable def hamiltonCollectedReaction |
| 347 | (R : I → I → I → I → ℝ) (P : I → I → I → ℝ) |
| 348 | (M U : I → I → ℝ) (W : I → ℝ) : ℝ := |
| 349 | let B := fun a b c d => ∑ e, ∑ f, R a e b f * R c e d f |
| 350 | 2 * (∑ a, ∑ c, ∑ b, ∑ d, R a c b d * M c d * W a * W b) - |
| 351 | 2 * (∑ a, ∑ c, ∑ d, ∑ b, P a c d * P b d c * W a * W b) + |
| 352 | (∑ a, ∑ b, ∑ c, ∑ d, P c d a * P c d b * W a * W b) + |
| 353 | 4 * (∑ a, ∑ b, ∑ c, ∑ d, ∑ e, |
| 354 | (R a d b e * P d e c + R a d c e * P d b e + R b d c e * P a d e) * |
| 355 | U a b * W c) + |
| 356 | 2 * (∑ a, ∑ b, ∑ c, ∑ d, |
| 357 | (B a b c d - B a b d c - B a d b c + B a c b d) * U a b * U c d) |
| 358 | |
| 359 | /-- A direct error estimate for replacing `R` by `R + ψ I` and `M` by |
| 360 | `M + α g` in the full collected Hamilton reaction. No positivity of the |
| 361 | original or perturbed block is required. -/ |
| 362 | lemma abs_hamiltonCollectedReaction_replacement_le |
| 363 | (R : I → I → I → I → ℝ) (P : I → I → I → ℝ) |
| 364 | (M U : I → I → ℝ) (W : I → ℝ) |
| 365 | (α ψ KR KP KM : ℝ) (hα : 0 ≤ α) (hψ : 0 ≤ ψ) (hψone : ψ ≤ 1) |
| 366 | (hKR : 0 ≤ KR) (hKP : 0 ≤ KP) (hKM : 0 ≤ KM) |
| 367 | (hR : ∀ a b c d, |R a b c d| ≤ KR) |
| 368 | (hP : ∀ a b c, |P a b c| ≤ KP) (hM : ∀ a b, |M a b| ≤ KM) : |
| 369 | |hamiltonCollectedReaction |
| 370 | (fun a b c d => R a b c d + ψ * twoFormIdentity a b c d) P |
| 371 | (fun a b => M a b + α * (if a = b then 1 else 0)) U W - |
| 372 | hamiltonCollectedReaction R P M U W| ≤ |
| 373 | 2 * (Fintype.card I : ℝ) ^ 3 * (KR + 1) * α * (∑ a, (W a) ^ 2) + |
| 374 | (2 * (Fintype.card I : ℝ) ^ 3 * KM + 6 * (Fintype.card I : ℝ) ^ 4 * KP ^ 2) * |
| 375 | ψ * (∑ a, (W a) ^ 2) + |
| 376 | (6 * (Fintype.card I : ℝ) ^ 3 + 8 * (Fintype.card I : ℝ) ^ 4 * (2 * KR + 1)) * |
| 377 | ψ * (∑ a, ∑ b, (U a b) ^ 2) := by |
| 378 | have h₁ := abs_le.mp (abs_curvature_twoTensor_replacement_le R M W α ψ KR KM |
| 379 | hα hψ hψone hKR hKM hR hM) |
| 380 | have h₂ := abs_le.mp (abs_curvature_threeTensor_replacement_le R P U W ψ KP hψ hKP hP) |
| 381 | have h₃ := abs_le.mp (abs_curvature_reaction_replacement_le R U ψ KR hψ hψone hKR hR) |
| 382 | dsimp only [hamiltonCollectedReaction] at h₁ h₂ h₃ ⊢ |
| 383 | apply abs_le.mpr |
| 384 | constructor <;> nlinarith only [h₁.1, h₁.2, h₂.1, h₂.2, h₃.1, h₃.2] |
| 385 | |
| 386 | /-- Positivity of the perturbed Hamilton block bounds the original reaction |
| 387 | from below by the explicit perturbation errors. -/ |
| 388 | lemma hamiltonCollectedReaction_ge_neg_replacement_error |
| 389 | (R : I → I → I → I → ℝ) (P : I → I → I → ℝ) |
| 390 | (M U : I → I → ℝ) (W : I → ℝ) |
| 391 | (α ψ KR KP KM : ℝ) (hα : 0 ≤ α) (hψ : 0 ≤ ψ) (hψone : ψ ≤ 1) |
| 392 | (hKR : 0 ≤ KR) (hKP : 0 ≤ KP) (hKM : 0 ≤ KM) |
| 393 | (hR : ∀ a b c d, |R a b c d| ≤ KR) |
| 394 | (hPb : ∀ a b c, |P a b c| ≤ KP) (hM : ∀ a b, |M a b| ≤ KM) |
| 395 | (hfirst : ∀ a b c d, R a b c d = -R b a c d) |
| 396 | (hlast : ∀ a b c d, R a b c d = -R a b d c) |
| 397 | (hpair : ∀ a b c d, R a b c d = R c d a b) |
| 398 | (hbianchi : ∀ a b c d, R a b c d + R b c a d + R c a b d = 0) |
| 399 | (hP : ∀ a b c, P a b c = -P b a c) |
| 400 | (hU : ∀ a b, U a b = -U b a) |
| 401 | (hQ : (Matrix.fromBlocks |
| 402 | (fun ac bd : I × I => R ac.1 ac.2 bd.1 bd.2 + |
| 403 | ψ * twoFormIdentity ac.1 ac.2 bd.1 bd.2) |
| 404 | (fun (ac : I × I) d => P ac.1 ac.2 d) |
| 405 | (fun c (bd : I × I) => P bd.1 bd.2 c) |
| 406 | (fun a b => M a b + α * (if a = b then 1 else 0))).PosSemidef) : |
| 407 | -(2 * (Fintype.card I : ℝ) ^ 3 * (KR + 1) * α * (∑ a, (W a) ^ 2) + |
| 408 | (2 * (Fintype.card I : ℝ) ^ 3 * KM + 6 * (Fintype.card I : ℝ) ^ 4 * KP ^ 2) * |
| 409 | ψ * (∑ a, (W a) ^ 2) + |
| 410 | (6 * (Fintype.card I : ℝ) ^ 3 + 8 * (Fintype.card I : ℝ) ^ 4 * (2 * KR + 1)) * |
| 411 | ψ * (∑ a, ∑ b, (U a b) ^ 2)) ≤ hamiltonCollectedReaction R P M U W := by |
| 412 | have hnonneg : 0 ≤ hamiltonCollectedReaction |
| 413 | (fun a b c d => R a b c d + ψ * twoFormIdentity a b c d) P |
| 414 | (fun a b => M a b + α * (if a = b then 1 else 0)) U W := by |
| 415 | apply hamilton_reaction_collected_nonneg _ _ _ _ _ _ _ _ _ hP hU hQ |
| 416 | · intro a b c d |
| 417 | rw [hfirst a b c d, twoFormIdentity_skew_first a b c d] |
| 418 | ring |
| 419 | · intro a b c d |
| 420 | rw [hlast a b c d, twoFormIdentity_skew_last a b c d] |
| 421 | ring |
| 422 | · intro a b c d |
| 423 | rw [hpair a b c d, twoFormIdentity_pair_swap a b c d] |
| 424 | · intro a b c d |
| 425 | have h₁ := hbianchi a b c d |
| 426 | have h₂ := twoFormIdentity_bianchi a b c d |
| 427 | have h₃ := congrArg (fun z : ℝ => ψ * z) h₂ |
| 428 | nlinarith only [h₁, h₃] |
| 429 | have he := abs_le.mp (abs_hamiltonCollectedReaction_replacement_le |
| 430 | R P M U W α ψ KR KP KM hα hψ hψone hKR hKP hKM hR hPb hM) |
| 431 | linarith only [hnonneg, he.2] |
| 432 | |
| 433 | /-- The component bounds with their natural reciprocal-time factors give |
| 434 | the `ψ (1 + τ⁻²)` vector error in the perturbed Harnack argument. -/ |
| 435 | lemma abs_hamiltonCollectedReaction_replacement_le_time_bound |
| 436 | (R : I → I → I → I → ℝ) (P : I → I → I → ℝ) |
| 437 | (M U : I → I → ℝ) (W : I → ℝ) |
| 438 | (α ψ K τ : ℝ) (hα : 0 ≤ α) (hψ : 0 ≤ ψ) (hψone : ψ ≤ 1) |
| 439 | (hK : 0 ≤ K) (hτ : 0 < τ) |
| 440 | (hR : ∀ a b c d, |R a b c d| ≤ K) |
| 441 | (hP : ∀ a b c, |P a b c| ≤ K * τ⁻¹) |
| 442 | (hM : ∀ a b, |M a b| ≤ K * (1 + τ⁻¹)) : |
| 443 | |hamiltonCollectedReaction |
| 444 | (fun a b c d => R a b c d + ψ * twoFormIdentity a b c d) P |
| 445 | (fun a b => M a b + α * (if a = b then 1 else 0)) U W - |
| 446 | hamiltonCollectedReaction R P M U W| ≤ |
| 447 | 2 * (Fintype.card I : ℝ) ^ 3 * (K + 1) * α * (∑ a, (W a) ^ 2) + |
| 448 | (4 * (Fintype.card I : ℝ) ^ 3 * K + 6 * (Fintype.card I : ℝ) ^ 4 * K ^ 2) * |
| 449 | ψ * (1 + (τ⁻¹) ^ 2) * (∑ a, (W a) ^ 2) + |
| 450 | (6 * (Fintype.card I : ℝ) ^ 3 + 8 * (Fintype.card I : ℝ) ^ 4 * (2 * K + 1)) * |
| 451 | ψ * (∑ a, ∑ b, (U a b) ^ 2) := by |
| 452 | have he := abs_hamiltonCollectedReaction_replacement_le R P M U W |
| 453 | α ψ K (K * τ⁻¹) (K * (1 + τ⁻¹)) hα hψ hψone hK |
| 454 | (by positivity) (by positivity) hR hP hM |
| 455 | have htime : 1 + τ⁻¹ ≤ 2 * (1 + (τ⁻¹) ^ 2) := by |
| 456 | nlinarith only [sq_nonneg (τ⁻¹ - 1), sq_nonneg (τ⁻¹)] |
| 457 | have hc₁ := mul_le_mul_of_nonneg_left htime |
| 458 | (show 0 ≤ 2 * (Fintype.card I : ℝ) ^ 3 * K by positivity) |
| 459 | have hc₂ : |
| 460 | 6 * (Fintype.card I : ℝ) ^ 4 * (K * τ⁻¹) ^ 2 ≤ |
| 461 | 6 * (Fintype.card I : ℝ) ^ 4 * K ^ 2 * (1 + (τ⁻¹) ^ 2) := by |
| 462 | nlinarith only [show 0 ≤ 6 * (Fintype.card I : ℝ) ^ 4 * K ^ 2 by positivity] |
| 463 | have hc : |
| 464 | 2 * (Fintype.card I : ℝ) ^ 3 * (K * (1 + τ⁻¹)) + |
| 465 | 6 * (Fintype.card I : ℝ) ^ 4 * (K * τ⁻¹) ^ 2 ≤ |
| 466 | (4 * (Fintype.card I : ℝ) ^ 3 * K + 6 * (Fintype.card I : ℝ) ^ 4 * K ^ 2) * |
| 467 | (1 + (τ⁻¹) ^ 2) := by nlinarith only [hc₁, hc₂] |
| 468 | have hcw := mul_le_mul_of_nonneg_right hc |
| 469 | (show 0 ≤ ψ * (∑ a, (W a) ^ 2) by positivity) |
| 470 | nlinarith only [he, hcw] |
| 471 | |
| 472 | end Poincare.RicciFlow.Harnack |