This journal is in preparation. Submissions are open as a pilot and the editorial board is being formed. Articles marked Demonstration show the format only.
Journal of Machine-Verified MathematicsPeer-reviewed mathematics with machine-checked proofs, for the age of AI

E424/Tools/T12.lean

All files · 131 lines · source at the verified commit

1module
2
3public import E424.ToolDefs
4
5@[expose] public section
6
7/-!
8# Erdős 424: tool T12. Absolute existential constants; Mathlib only.
9-/
10
11set_option linter.style.header false
12open Finset
13
14namespace E424
15
16/-- Schur test for a nonnegative symmetric kernel `K` on `R` with row sums at most `Δ`:
17the weighted form `∑ f r f r' K r r'` is at most `Δ ∑ f r ^ 2`. -/
18theorem T12_schur {ι : Type} (R : Finset ι) (K : ι → ι → ℝ) (Δ : ℝ)
19 (hK0 : ∀ r r', 0 ≤ K r r') (hsymm : ∀ r r', K r r' = K r' r)
20 (hK : ∀ r ∈ R, ∑ r' ∈ R, K r r' ≤ Δ) (f : ι → ℝ) :
21 ∑ r ∈ R, ∑ r' ∈ R, f r * f r' * K r r' ≤ Δ * ∑ r ∈ R, f r ^ 2 := by
22 have key : ∀ r r', 2 * (f r * f r' * K r r') ≤ f r ^ 2 * K r r' + f r' ^ 2 * K r r' := by
23 intro r r'
24 nlinarith [mul_nonneg (sq_nonneg (f r - f r')) (hK0 r r')]
25 have h2 : 2 * ∑ r ∈ R, ∑ r' ∈ R, f r * f r' * K r r' ≤
26 ∑ r ∈ R, ∑ r' ∈ R, (f r ^ 2 * K r r' + f r' ^ 2 * K r r') := by
27 rw [Finset.mul_sum]
28 exact Finset.sum_le_sum fun r _ => by
29 rw [Finset.mul_sum]; exact Finset.sum_le_sum fun r' _ => key r r'
30 have h3 : ∑ r ∈ R, ∑ r' ∈ R, (f r ^ 2 * K r r' + f r' ^ 2 * K r r') =
31 ∑ r ∈ R, f r ^ 2 * ∑ r' ∈ R, K r r' + ∑ r ∈ R, f r ^ 2 * ∑ r' ∈ R, K r' r := by
32 simp only [Finset.sum_add_distrib, Finset.mul_sum]
33 congr 1
34 rw [Finset.sum_comm]
35 have h4 : ∑ r ∈ R, f r ^ 2 * ∑ r' ∈ R, K r r' ≤ Δ * ∑ r ∈ R, f r ^ 2 := by
36 rw [Finset.mul_sum]
37 exact Finset.sum_le_sum fun r hr => by
38 nlinarith [hK r hr, sq_nonneg (f r)]
39 have h5 : ∑ r ∈ R, f r ^ 2 * ∑ r' ∈ R, K r' r ≤ Δ * ∑ r ∈ R, f r ^ 2 := by
40 rw [Finset.mul_sum]
41 exact Finset.sum_le_sum fun r hr => by
42 have : ∑ r' ∈ R, K r' r = ∑ r' ∈ R, K r r' := Finset.sum_congr rfl fun r' _ => hsymm r' r
43 nlinarith [hK r hr, sq_nonneg (f r)]
44 linarith
45
46/-- Duality: the squared norms of the `b`-pairings with the vectors `v r` are bounded by the
47largest row sum `Δ` of the Gram matrix times `‖b‖²`. Proof: with `x r = ⟨b, v r⟩` and
48`y n = ∑ r x r conj(v r n)`, one has `∑ |x r|² = ∑ conj(b n) y n`, `∑ |y n|² ≤ Δ ∑ |x r|²`
49by the Schur test, and Cauchy-Schwarz closes it. -/
50theorem T12_duality (ι : Type) (s : Finset ℕ) (R : Finset ι) (v : ι → ℕ → ℂ) (b : ℕ → ℂ) (Δ : ℝ)
51 (hΔ0 : 0 ≤ Δ) (hΔ : ∀ r ∈ R, ∑ r' ∈ R, ‖∑ n ∈ s, v r n * starRingEnd ℂ (v r' n)‖ ≤ Δ) :
52 ∑ r ∈ R, ‖∑ n ∈ s, b n * v r n‖ ^ 2 ≤ Δ * ∑ n ∈ s, ‖b n‖ ^ 2 := by
53 set x : ι → ℂ := fun r => ∑ n ∈ s, b n * v r n with hx
54 set G : ι → ι → ℂ := fun r r' => ∑ n ∈ s, v r n * starRingEnd ℂ (v r' n) with hG
55 set y : ℕ → ℂ := fun n => ∑ r ∈ R, x r * starRingEnd ℂ (v r n) with hy
56 set S : ℝ := ∑ r ∈ R, ‖x r‖ ^ 2 with hS
57 set B : ℝ := ∑ n ∈ s, ‖b n‖ ^ 2 with hB
58 set Y : ℝ := ∑ n ∈ s, ‖y n‖ ^ 2 with hY
59 -- `↑‖z‖² = z * conj z`
60 have hnorm2 : ∀ z : ℂ, ((‖z‖ ^ 2 : ℝ) : ℂ) = z * starRingEnd ℂ z := by
61 intro z
62 rw [← Complex.normSq_eq_norm_sq, Complex.mul_conj]
63 have hGs : ∀ r r', starRingEnd ℂ (G r r') = G r' r := by
64 intro r r'
65 simp only [hG, map_sum, map_mul, Complex.conj_conj, mul_comm]
66 have hsymm : ∀ r r', ‖G r r'‖ = ‖G r' r‖ := by
67 intro r r'
68 rw [← hGs r r', RCLike.norm_conj]
69 -- Step A: `S = ∑ conj(b n) * y n`
70 have hA : (S : ℂ) = ∑ n ∈ s, starRingEnd ℂ (b n) * y n := by
71 have hxc : ∀ r, ((‖x r‖ ^ 2 : ℝ) : ℂ) = ∑ n ∈ s, starRingEnd ℂ (b n) * (x r * starRingEnd ℂ (v r n)) := by
72 intro r
73 rw [hnorm2, hx]
74 simp only [map_sum, map_mul, Finset.mul_sum]
75 exact Finset.sum_congr rfl fun n _ => by ring
76 rw [hS, Complex.ofReal_sum]
77 simp only [hxc]
78 rw [Finset.sum_comm]
79 refine Finset.sum_congr rfl fun n _ => ?_
80 rw [hy, Finset.mul_sum]
81 -- Step B: `Y = ∑ r r' x r conj(x r') conj(G r r')`
82 have hB' : (Y : ℂ) = ∑ r ∈ R, ∑ r' ∈ R, x r * starRingEnd ℂ (x r') * starRingEnd ℂ (G r r') := by
83 have hyy : ∀ n, ((‖y n‖ ^ 2 : ℝ) : ℂ) = ∑ r ∈ R, ∑ r' ∈ R,
84 x r * starRingEnd ℂ (x r') * (starRingEnd ℂ (v r n) * v r' n) := by
85 intro n
86 rw [hnorm2, hy]
87 simp only [map_sum, map_mul, Finset.sum_mul_sum, Complex.conj_conj]
88 exact Finset.sum_congr rfl fun r _ => Finset.sum_congr rfl fun r' _ => by ring
89 have hconjG : ∀ r r', starRingEnd ℂ (G r r') = ∑ n ∈ s, starRingEnd ℂ (v r n) * v r' n := by
90 intro r r'
91 simp only [hG, map_sum, map_mul, Complex.conj_conj]
92 rw [hY, Complex.ofReal_sum]
93 simp only [hyy]
94 rw [Finset.sum_comm]
95 refine Finset.sum_congr rfl fun r _ => ?_
96 rw [Finset.sum_comm]
97 refine Finset.sum_congr rfl fun r' _ => ?_
98 rw [hconjG, Finset.mul_sum]
99 -- Step C: `Y ≤ Δ S` by the Schur test
100 have hC : Y ≤ Δ * S := by
101 have hZ : Y = (∑ r ∈ R, ∑ r' ∈ R, x r * starRingEnd ℂ (x r') * starRingEnd ℂ (G r r')).re := by
102 rw [← hB']; simp
103 have hschur := T12_schur R (fun r r' => ‖G r r'‖) Δ (fun _ _ => norm_nonneg _) hsymm
104 (fun r hr => hΔ r hr) (fun r => ‖x r‖)
105 have hnorm : ‖∑ r ∈ R, ∑ r' ∈ R, x r * starRingEnd ℂ (x r') * starRingEnd ℂ (G r r')‖
106 ≤ ∑ r ∈ R, ∑ r' ∈ R, ‖x r‖ * ‖x r'‖ * ‖G r r'‖ :=
107 (norm_sum_le _ _).trans (Finset.sum_le_sum fun r _ =>
108 (norm_sum_le _ _).trans (le_of_eq (Finset.sum_congr rfl fun r' _ => by simp)))
109 have hS' : S = ∑ r ∈ R, ‖x r‖ ^ 2 := rfl
110 rw [hZ]
111 exact (Complex.re_le_norm _).trans (hnorm.trans (by rw [hS']; exact hschur))
112 -- Step D: `S ≤ ∑ ‖b n‖ ‖y n‖`
113 have hD : S ≤ ∑ n ∈ s, ‖b n‖ * ‖y n‖ := by
114 have h1 : S = (∑ n ∈ s, starRingEnd ℂ (b n) * y n).re := by
115 rw [← hA]; simp
116 rw [h1]
117 exact (Complex.re_le_norm _).trans ((norm_sum_le _ _).trans
118 (Finset.sum_le_sum fun n _ => by simp))
119 -- Step E: Cauchy-Schwarz, then solve `S² ≤ B Δ S`
120 have hE : (∑ n ∈ s, ‖b n‖ * ‖y n‖) ^ 2 ≤ B * Y :=
121 Finset.sum_mul_sq_le_sq_mul_sq s (fun n => ‖b n‖) (fun n => ‖y n‖)
122 have hS0 : 0 ≤ S := Finset.sum_nonneg fun r _ => sq_nonneg _
123 have hB0 : 0 ≤ B := Finset.sum_nonneg fun n _ => sq_nonneg _
124 have hSS : S ^ 2 ≤ B * Y := le_trans (pow_le_pow_left₀ hS0 hD 2) hE
125 have hBY : B * Y ≤ B * (Δ * S) := mul_le_mul_of_nonneg_left hC hB0
126 rcases hS0.eq_or_lt with h | h
127 · rw [← h]; exact mul_nonneg hΔ0 hB0
128 · exact le_of_mul_le_mul_right (by nlinarith) h
129
130end E424
131