Documentation

CslibFrontier.Computability.Circuit.Arithmetic.Separation.Curvature.WindowMean

Means over large windows #

The price argument of VP ≠ VNP over every field [Ant26] (module Nc.Cat.Mean) averages functions on two sheets of ℤ² over windows: for every n the window has two sheets (Bool), 0 ≤ i < n² and 0 ≤ k < n. A window function f : WindowFn is one function f n for every n. Its mean is the limit of the means over the n-th window along a fixed free ultrafilter (Mathlib's hyperfilter ℕ), which exists for bounded functions. The result is a positive linear functional on bounded window functions that is invariant under translations and satisfies the inequality of Cauchy and Schwarz.

Main definitions #

Main results #

@[reducible, inline]

Functions on two sheets of ℤ², one for every window size n.

The n-th window: two sheets, 0 ≤ i < n², 0 ≤ k < n.

noncomputable def Cslib.Circuits.Arithmetic.Separation.windowAvg (n : ℕ) (f : Bool → ℤ → ℤ → ℝ) :

The mean over the n-th window, as Finset.expect.

theorem Cslib.Circuits.Arithmetic.Separation.mem_window {n : ℕ} {b : Bool} {i k : ℕ} :
(b, i, k) ∈ window n ↔ i < n ^ 2 ∧ k < n
theorem Cslib.Circuits.Arithmetic.Separation.windowAvg_eq_sum (n : ℕ) (f : Bool → ℤ → ℤ → ℝ) :
windowAvg n f = (∑ b : Bool, ∑ i ∈ Finset.range (n ^ 2), ∑ k ∈ Finset.range n, f b ↑i ↑k) / (2 * ↑n ^ 3)

The window mean as a normalized sum, for the telescoping arguments.

theorem Cslib.Circuits.Arithmetic.Separation.WindowFn.Bounded.shift {f : WindowFn} (hf : f.Bounded) (a c : ℤ) :
Bounded fun (n : ℕ) (b : Bool) (i k : ℤ) => f n b (i + a) (k + c)
theorem Cslib.Circuits.Arithmetic.Separation.windowAvg_mono {n : ℕ} {f g : Bool → ℤ → ℤ → ℝ} (h : ∀ (b : Bool), ∀ i < n ^ 2, ∀ k < n, f b ↑i ↑k ≤ g b ↑i ↑k) :
theorem Cslib.Circuits.Arithmetic.Separation.windowAvg_const {n : ℕ} (hn : n ≠ 0) (c : ℝ) :
(windowAvg n fun (x : Bool) (x_1 x_2 : ℤ) => c) = c
theorem Cslib.Circuits.Arithmetic.Separation.windowAvg_mul_sq_le (n : ℕ) (f g : Bool → ℤ → ℤ → ℝ) :
windowAvg n (f * g) ^ 2 ≤ windowAvg n (f * f) * windowAvg n (g * g)

The inequality of Cauchy and Schwarz over one window.

theorem Cslib.Circuits.Arithmetic.Separation.abs_windowAvg_le {n : ℕ} {f : Bool → ℤ → ℤ → ℝ} {C : ℝ} (h : ∀ (b : Bool) (i k : ℤ), |f b i k| ≤ C) :

The mean of a window function over large windows: the limit of the window means along hyperfilter ℕ. For bounded functions the limit exists (WindowFn.tendsto_mean).

theorem Cslib.Circuits.Arithmetic.Separation.WindowFn.mean_const (c : ℝ) :
(mean fun (x : ℕ) (x_1 : Bool) (x_2 x_3 : ℤ) => c) = c
theorem Cslib.Circuits.Arithmetic.Separation.WindowFn.mean_mono {f g : WindowFn} (hf : f.Bounded) (hg : g.Bounded) (h : ∀ᶠ (n : ℕ) in Filter.atTop, ∀ (b : Bool), ∀ i < n ^ 2, ∀ k < n, f n b ↑i ↑k ≤ g n b ↑i ↑k) :
theorem Cslib.Circuits.Arithmetic.Separation.WindowFn.mean_le {f g : WindowFn} (hf : f.Bounded) (hg : g.Bounded) (h : ∀ (n : ℕ) (b : Bool) (i k : ℤ), f n b i k ≤ g n b i k) :
theorem Cslib.Circuits.Arithmetic.Separation.WindowFn.mean_nonneg {f : WindowFn} (hf : f.Bounded) (h : ∀ (n : ℕ) (b : Bool) (i k : ℤ), 0 ≤ f n b i k) :
0 ≤ f.mean

Translations #

theorem Cslib.Circuits.Arithmetic.Separation.WindowFn.mean_shift_left {f : WindowFn} (hf : f.Bounded) (a : ℤ) :
(mean fun (n : ℕ) (b : Bool) (i k : ℤ) => f n b (i + a) k) = f.mean
theorem Cslib.Circuits.Arithmetic.Separation.WindowFn.mean_shift_right {f : WindowFn} (hf : f.Bounded) (a : ℤ) :
(mean fun (n : ℕ) (b : Bool) (i k : ℤ) => f n b i (k + a)) = f.mean
theorem Cslib.Circuits.Arithmetic.Separation.WindowFn.mean_shift {f : WindowFn} (hf : f.Bounded) (a c : ℤ) :
(mean fun (n : ℕ) (b : Bool) (i k : ℤ) => f n b (i + a) (k + c)) = f.mean

The mean is invariant under translations.

theorem Cslib.Circuits.Arithmetic.Separation.WindowFn.le_mean_tele {F : WindowFn} (hX : Bounded fun (n : ℕ) (b : Bool) (i k : ℤ) => ↑n ^ 2 * (F n b (i + 1) k - F n b i k)) {c : ℕ → ℝ} {c₀ : ℝ} (hc : Filter.Tendsto c Filter.atTop (nhds c₀)) (h : ∀ᶠ (n : ℕ) in Filter.atTop, ∀ k < n, c n ≤ ∑ b : Bool, (F n b ↑(n ^ 2) ↑k - F n b 0 ↑k)) :
c₀ / 2 ≤ mean fun (n : ℕ) (b : Bool) (i k : ℤ) => ↑n ^ 2 * (F n b (i + 1) k - F n b i k)

A telescoping sum: the mean of the scaled differences n² (F(i+1) − F(i)) is at least c₀/2 when the differences across the window, summed over both sheets, are eventually at least c n → c₀.

theorem Cslib.Circuits.Arithmetic.Separation.WindowFn.mean_steps {F : WindowFn} (hX : Bounded fun (n : ℕ) (b : Bool) (i k : ℤ) => ↑n ^ 2 * (F n b (i + 1) k - F n b i k)) (S : ℕ) :
(Bounded fun (n : ℕ) (b : Bool) (i k : ℤ) => ↑n ^ 2 * (F n b (i + ↑S) k - F n b i k)) ∧ (mean fun (n : ℕ) (b : Bool) (i k : ℤ) => ↑n ^ 2 * (F n b (i + ↑S) k - F n b i k)) = ↑S * mean fun (n : ℕ) (b : Bool) (i k : ℤ) => ↑n ^ 2 * (F n b (i + 1) k - F n b i k)

Many steps of a telescoping sum: the scaled differences over S steps are bounded and have S times the mean of one step.

Cauchy and Schwarz #

The root of the mean square.

The inequality of Cauchy and Schwarz: windowAvg_mul_sq_le passes to the limit.

theorem Cslib.Circuits.Arithmetic.Separation.WindowFn.rms_mono {f g : WindowFn} (hf : f.Bounded) (hg : g.Bounded) (h0 : ∀ (n : ℕ) (b : Bool) (i k : ℤ), 0 ≤ f n b i k) (h : ∀ᶠ (n : ℕ) in Filter.atTop, ∀ (b : Bool), ∀ i < n ^ 2, ∀ k < n, f n b ↑i ↑k ≤ g n b ↑i ↑k) :
f.rms ≤ g.rms

The inequality of Minkowski.

theorem Cslib.Circuits.Arithmetic.Separation.WindowFn.rms_shift {f : WindowFn} (hf : f.Bounded) (a c : ℤ) :
(rms fun (n : ℕ) (b : Bool) (i k : ℤ) => f n b (i + a) (k + c)) = f.rms