Documentation

CslibFrontier.Computability.Circuit.Arithmetic.Separation.Curvature.Window

Windows: clamping, the relative place in a window, and two elementary inequalities #

Helpers for the theorem that prices are nonpositively curved in VP ≠ VNP over every field [Ant26] (module Nc.Cat.Window); nothing here is about prices.

Main definitions #

Main results #

theorem Cslib.Circuits.Arithmetic.Separation.sum_fin_ite_lt {M j : ℕ} (hj : j ≤ M) (x y : ℝ) :
(∑ l : Fin M, if ↑l < j then x else y) = ↑j * x + (↑M - ↑j) * y

Clamping #

Clamping an integer to 0, …, N.

theorem Cslib.Circuits.Arithmetic.Separation.cast_clamp (N : ℕ) (i : ℤ) :
↑(clamp N i) = ↑(Set.projIcc 0 ↑N ⋯ ↑i)

The clamp, cast to ℝ, is Mathlib's projection onto [0, N].

theorem Cslib.Circuits.Arithmetic.Separation.abs_clamp_sub_le (N : ℕ) (i i' : ℤ) :
|↑(clamp N i) - ↑(clamp N i')| ≤ |↑i - ↑i'|

Clamping is 1-Lipschitz, since Set.projIcc is.

theorem Cslib.Circuits.Arithmetic.Separation.clamp_cast {N : ℕ} {i : ℤ} (h0 : 0 ≤ i) (h1 : i ≤ ↑N) :
↑(clamp N i) = ↑i
theorem Cslib.Circuits.Arithmetic.Separation.clamp_window {n T : ℕ} {i k : ℤ} (h0 : 0 ≤ i + k + ↑n) (h1 : i + k + ↑n ≤ ↑n ^ 2 * ↑T) :
↑(clamp (n ^ 2 * T) (i + k + ↑n)) = ↑i + ↑k + ↑n
theorem Cslib.Circuits.Arithmetic.Separation.eventually_large {T : ℕ} (hT : 2 ≤ T) (R : ℕ) :
∀ᶠ (n : ℕ) in Filter.atTop, max n 1 = n ∧ 1 ≤ ↑n ∧ R ≤ n ∧ n ^ 2 + 2 * n ≤ n ^ 2 * T ∧ n ^ 2 + 2 * n ≤ 2 * n ^ 2

What "n large" means for the windows: given T ≥ 2 and R, eventually n ≥ max R 3, which gives the listed inequalities.

The relative place in a window #

The relative place i / n² of a point in the n-th window, clamped to [0, 1].

theorem Cslib.Circuits.Arithmetic.Separation.windowPlace_natCast {n i : ℕ} (hi : i ≤ n ^ 2) (b : Bool) (k : ℤ) :
windowPlace n b (↑i) k = ↑i / ↑n ^ 2

At a point i ∈ [0, n²] of the window, the relative place is i / n².

The relative place has mean 1/2.

Two elementary inequalities #

theorem Cslib.Circuits.Arithmetic.Separation.le_of_second_diff_le {f : ℕ → ℝ} {φ ω : ℝ} (h0 : f 1 + φ ≤ 2 * f 0 + 2 * ω) (h : ∀ (j : ℕ), f (j + 2) + f j ≤ 2 * f (j + 1) + 2 * ω) (A : ℕ) :
f A ≤ f 0 + ↑A * (f 0 - φ + ω) + ↑A ^ 2 * ω

A sequence f with second differences at most 2ω, where φ stands for the value f(−1), satisfies f(A) ≤ f(0) + A(f(0) − φ + ω) + A²ω. For ψ(l) = f(l) − l²ω this says ψ(A) ≤ ψ(0) + A(ψ(0) − ψ(−1)).

theorem Cslib.Circuits.Arithmetic.Separation.sq_le_of_abs_le {n L' L0 r a θ K W : ℝ} (hr0 : 0 ≤ r) (hr2 : 0 ≤ 1 - r) (hr1 : 1 - r ≤ 2 * θ) (ha : 0 ≤ a) (hK : 0 ≤ K) (hZ : n ^ 2 * (L' ^ 2 - L0 ^ 2) ≤ K) (h1 : r * (n ^ 2 * (L' - L0)) + a * L' ≤ W) (h2 : -(r * (n ^ 2 * (L' - L0)) + a * L') ≤ W) :
a ^ 2 * (L' * L') + a * (n ^ 2 * (L' ^ 2 - L0 ^ 2)) - a * (2 * θ * K) ≤ W * W

Squaring |r n²(L' − L) + aL'| ≤ W, with 1 − r ≤ 2θ and n²(L'² − L²) ≤ K: W² ≥ a²L'² + a n²(L'² − L²) − 2aθK.