Documentation

CslibFrontier.Foundations.BooleanAnalysis.PolynomialThreshold

Polynomial threshold functions and Chow's theorem #

A Boolean function f is a polynomial threshold function over a family T of sets if, read as signs F = (-1) ^ f, it is the sign of a real function p on the cube that vanishes nowhere and whose Fourier coefficients vanish outside T (BitString.IsPTFOn); it is a polynomial threshold function of degree at most k if T is the family of sets of at most k coordinates (BitString.IsPTF) O'Donnell, Definition 5.4. "The sign of p" is written 0 < F(x) p(x) for every x.

The book writes f = sgn(p) with sgn(0) = 1, and insists that p vanish nowhere in the proof of Chow's theorem O'Donnell, Theorem 5.1. For degree at most k the two notions agree, since adding a small constant to p removes its zeros without changing its signs or its degree (this equivalence is not proved here); at k = 1 they are the linear threshold functions sgn(a₀ + a₁ x₁ + ⋯ + aₙ xₙ) O'Donnell, Definition 2.5. For a general family T not containing ∅ the constant cannot be adjusted, and IsPTFOn T is strictly narrower than the book's notion: x₁ + x₂ represents a function over {{1}, {2}} that no such p without zeros represents.

Since F p = |p| ≥ G p pointwise for any Boolean G, with equality only where G = F because p vanishes nowhere, Plancherel's identity shows that a polynomial threshold function over T is determined, among all Boolean functions, by its Fourier coefficients on T (Chow's theorem, BitString.IsPTFOn.eq_of_fourierCoeff_eq). For degree at most k this is O'Donnell, Theorems 5.1 and 5.8 (BitString.IsPTF.eq_of_fourierCoeff_eq); for a general family it is a generalization that uses the absence of zeros.

The threshold function Th^n_j, and with it majority, AND, OR and the constants, is the sign of j - 1 / 2 - weight x, so it is a linear threshold function (BitString.isPTF_one_threshold); so is each literal ±χᵢ (BitString.isPTF_one_xor) O'Donnell, Exercise 2.2. Composing with w ↦ z + w ∘ π, which negates the inputs selected by z and identifies those with the same image under π, keeps every output bit of degree at most one, so it preserves polynomial threshold functions of degree at most k (BitString.IsPTF.comp_add_comp), in particular linear threshold functions O'Donnell, Section 5.5.

If F p ≥ 0 everywhere for some nonzero p with Fourier coefficients vanishing outside T, then comparing 𝔼 |p| = ∑_{S ∈ T} F̂(S) p̂(S) with |p̂(S)| ≤ 𝔼 |p| shows that the Fourier coefficients of F on T have absolute values summing to at least one (BitString.one_le_sum_abs_fourierCoeff_of_nonneg_mul) O'Donnell, Theorem 5.10; its proof allows zeros of p, so this covers every representation f = sgn(p) with sgn(0) = 1 and p not identically zero, for every family. The book leaves p ≢ 0 implicit; it is needed, since for T = ∅, p = 0 and the constant F = 1 the sum is zero. The case of all sets is BitString.one_le_sum_abs_fourierCoeff_signVal.

Main definitions #

Main results #

References #

theorem Cslib.BitString.signVal_mul_eq_abs {ι : Type u_1} {f : (ι → Bool) → Bool} {p : (ι → Bool) → ℝ} (hp : ∀ (x : ι → Bool), 0 ≤ signVal (f x) * p x) (x : ι → Bool) :
signVal (f x) * p x = |p x|

Where f, read as signs, times p is nonnegative, it is |p|.

def Cslib.BitString.IsPTFOn {ι : Type u_1} [Fintype ι] [DecidableEq ι] (T : Finset (Finset ι)) (f : (ι → Bool) → Bool) :

f is a polynomial threshold function over the family T of sets: read as signs, it is the sign of a real function p on the cube, vanishing nowhere, whose Fourier coefficients vanish outside T O'Donnell, Definition 5.4. For a family not containing ∅ this is narrower than the book's f = sgn(p) with sgn(0) = 1.

def Cslib.BitString.IsPTF {ι : Type u_1} [Fintype ι] [DecidableEq ι] (k : ℕ) (f : (ι → Bool) → Bool) :

f is a polynomial threshold function of degree at most k: the sign of a real function of Fourier degree at most k that vanishes nowhere O'Donnell, Definition 5.4, equivalently, after adding a small constant, of any real function of degree at most k. At k = 1 these are the linear threshold functions O'Donnell, Definition 2.5.

theorem Cslib.BitString.isPTF_iff {ι : Type u_1} [Fintype ι] [DecidableEq ι] {k : ℕ} {f : (ι → Bool) → Bool} :
IsPTF k f ↔ ∃ (p : (ι → Bool) → ℝ), (∀ (S : Finset ι), k < S.card → fourierCoeff p S = 0) ∧ ∀ (x : ι → Bool), 0 < signVal (f x) * p x

A polynomial threshold function of degree at most k, with the degree bound on the Fourier coefficients.

theorem Cslib.BitString.IsPTFOn.mono {ι : Type u_1} [Fintype ι] [DecidableEq ι] {T U : Finset (Finset ι)} {f : (ι → Bool) → Bool} (hTU : T ⊆ U) (hf : IsPTFOn T f) :

Enlarging the family preserves being a polynomial threshold function.

theorem Cslib.BitString.IsPTF.mono {ι : Type u_1} [Fintype ι] [DecidableEq ι] {k l : ℕ} {f : (ι → Bool) → Bool} (hkl : k ≤ l) (hf : IsPTF k f) :
IsPTF l f

Raising the degree bound preserves being a polynomial threshold function.

theorem Cslib.BitString.IsPTFOn.not {ι : Type u_1} [Fintype ι] [DecidableEq ι] {T : Finset (Finset ι)} {f : (ι → Bool) → Bool} (hf : IsPTFOn T f) :
IsPTFOn T fun (x : ι → Bool) => !f x

The negation of a polynomial threshold function over T is one, the sign of -p.

theorem Cslib.BitString.IsPTF.comp_add_comp {ι : Type u_1} [Fintype ι] [DecidableEq ι] {κ : Type u_2} [Fintype κ] [DecidableEq κ] {k : ℕ} {f : (ι → Bool) → Bool} (hf : IsPTF k f) (z : ι → Bool) (π : ι → κ) :
IsPTF k fun (w : κ → Bool) => f (z + fun (i : ι) => w (π i))

Negating and identifying input variables preserves polynomial threshold functions: if f is a polynomial threshold function of degree at most k, then so is w ↦ f (z + w ∘ π) for every string z of negations and every map π of the coordinates of f to those of w O'Donnell, Section 5.5. Its polynomial is p composed with the same map, each of whose output bits has degree at most one.

Threshold functions are linear threshold functions: Th^n_j holds exactly when j - 1 / 2 - weight x is negative, and the weight has degree one. This covers majority (majority n = Th^n_⌈n/2⌉), AND (threshold n n), OR (threshold n 1) and the constants (threshold n 0 and threshold n (n + 1)) among the examples of O'Donnell, Exercise 2.2; the literals are BitString.isPTF_one_xor.

theorem Cslib.BitString.isPTFOn_of_fourierCoeff_eq_zero {ι : Type u_1} [Fintype ι] [DecidableEq ι] {T : Finset (Finset ι)} {f : (ι → Bool) → Bool} (h : ∀ S ∉ T, fourierCoeff (fun (x : ι → Bool) => signVal (f x)) S = 0) :

A Boolean function whose Fourier coefficients, read as signs, vanish outside T is a polynomial threshold function over T: the sign of itself.

theorem Cslib.BitString.isPTF_one_xor {ι : Type u_1} [Fintype ι] [DecidableEq ι] (b : Bool) (i : ι) :
IsPTF 1 fun (x : ι → Bool) => b ^^ x i

Literals are linear threshold functions: x ↦ b ⊕ x_i, read as signs, is ±χ_i, which has degree one, so it is the sign of itself. With BitString.isPTF_one_threshold this covers all the examples of O'Donnell, Exercise 2.2.

theorem Cslib.BitString.isPTF_card {ι : Type u_1} [Fintype ι] [DecidableEq ι] (f : (ι → Bool) → Bool) :

Every Boolean function on n coordinates is a polynomial threshold function of degree at most n O'Donnell, Section 5.1, after Example 5.5.

theorem Cslib.BitString.expect_mul_eq_sum_of_fourierCoeff_eq_zero {ι : Type u_1} [Fintype ι] [DecidableEq ι] {T : Finset (Finset ι)} {p : (ι → Bool) → ℝ} (hpT : ∀ S ∉ T, fourierCoeff p S = 0) (g : (ι → Bool) → ℝ) :
(Finset.univ.expect fun (x : ι → Bool) => g x * p x) = ∑ S ∈ T, fourierCoeff g S * fourierCoeff p S

Correlating with a function whose Fourier coefficients vanish outside T only involves the coefficients on T.

theorem Cslib.BitString.IsPTFOn.eq_of_fourierCoeff_eq {ι : Type u_1} [Fintype ι] [DecidableEq ι] {T : Finset (Finset ι)} {f g : (ι → Bool) → Bool} (hf : IsPTFOn T f) (hfg : ∀ S ∈ T, fourierCoeff (fun (x : ι → Bool) => signVal (g x)) S = fourierCoeff (fun (x : ι → Bool) => signVal (f x)) S) :
g = f

Chow's theorem: a polynomial threshold function over T is determined, among all Boolean functions, by its Fourier coefficients on T. For the degree-k families this is O'Donnell, Theorems 5.1 and 5.8; for a general family it generalizes them, using that p vanishes nowhere.

theorem Cslib.BitString.IsPTF.eq_of_fourierCoeff_eq {ι : Type u_1} [Fintype ι] [DecidableEq ι] {k : ℕ} {f g : (ι → Bool) → Bool} (hf : IsPTF k f) (hfg : ∀ (S : Finset ι), S.card ≤ k → fourierCoeff (fun (x : ι → Bool) => signVal (g x)) S = fourierCoeff (fun (x : ι → Bool) => signVal (f x)) S) :
g = f

Chow's theorem for polynomial threshold functions of degree at most k: such a function is determined, among all Boolean functions, by its Fourier coefficients of degree at most k; at k = 1, a linear threshold function by its coefficients of degree at most one O'Donnell, Theorems 5.1 and 5.8.

theorem Cslib.BitString.one_le_sum_abs_fourierCoeff_of_nonneg_mul {ι : Type u_1} [Fintype ι] [DecidableEq ι] {T : Finset (Finset ι)} {f : (ι → Bool) → Bool} {p : (ι → Bool) → ℝ} (hpT : ∀ S ∉ T, fourierCoeff p S = 0) (hp₀ : p ≠ 0) (hp : ∀ (x : ι → Bool), 0 ≤ signVal (f x) * p x) :
1 ≤ ∑ S ∈ T, |fourierCoeff (fun (x : ι → Bool) => signVal (f x)) S|

The Fourier coefficients of a polynomial threshold function on its family: if, read as signs, F p ≥ 0 everywhere for a nonzero real p whose Fourier coefficients vanish outside T, then the Fourier coefficients of F on T have absolute values summing to at least one O'Donnell, Theorem 5.10. The function p may vanish somewhere, so this covers the book's f = sgn(p) with sgn(0) = 1 for every family, provided p is not identically zero; the book leaves that assumption implicit, and it is necessary: for T = ∅, p = 0 and the constant F = 1 the sum is zero.

theorem Cslib.BitString.IsPTFOn.one_le_sum_abs_fourierCoeff {ι : Type u_1} [Fintype ι] [DecidableEq ι] {T : Finset (Finset ι)} {f : (ι → Bool) → Bool} (hf : IsPTFOn T f) :
1 ≤ ∑ S ∈ T, |fourierCoeff (fun (x : ι → Bool) => signVal (f x)) S|

The Fourier coefficients of a polynomial threshold function on its family have absolute values summing to at least one O'Donnell, Theorem 5.10.