Documentation

Complexitylib.Algebraic.LowerBound.Cutwidth.SingleCut

The single-cut criterion #

Split the wires of a circuit, its inputs and its gates, into a set S and its complement. Let i be the number of inputs in S, let A = forward p S be the signals computed in S and read outside S, and let B = backward p S be the signals computed outside S and read in S. A signal is the value of one wire, counted once however many gates read it.

The single-cut criterion (card_accepting_le, card_accepting_lt). If a single-output circuit computes a K-rectangle-free function f, then for every such split |f⁻¹(1)| ≤ (K - 1) (2 ^ (i + |B|) + 2 ^ (n - i + |A|)) < K (2 ^ (i + |B|) + 2 ^ (n - i + |A|)). With at least 2 ^ (n - 2) accepted inputs this gives n ≤ max (i + |B|) (n - i + |A|) + ⌈log₂ K⌉ + 2 (le_max_add_clog), hence max (i + |B|) (n - i + |A|) > n - log₂ K - 3 (sub_logb_lt_max).

The proof fixes the values (a, b) of the forward and backward signals (the boundary key). Two facts hold for every signature and value type:

A rectangle with a side below K has at most K - 1 times its other side many points, and summing over the keys gives the criterion.

The structural results are stated for programs with any number of outputs, any signature, and any value type, so they apply equally to multi-output circuits: an output carried by a wire in S is a function of the left part on each fibre, and an output carried by a wire outside S is a function of the right part.

As a remark connecting to orderings (exists_prefix_le), every injective ranking of the wires has a prefix containing half of the inputs, so some prefix is crossed by at least ⌊n/2⌋ - ⌈log₂ K⌉ - 2 signals.

Cut and paste, and determination #

theorem Algebraic.Cutwidth.SingleCut.trace_mix {σ : Signature} {n s : ℕ} {U : Type u_1} (p : Program σ n s) (I : Interpretation σ U) {S : Finset (Wire n s)} {x x' : Fin n → U} (hfwd : ∀ w ∈ forward p S, p.trace I x w = p.trace I x' w) (hbwd : ∀ w ∈ backward p S, p.trace I x w = p.trace I x' w) (w : Wire n s) :
p.trace I (mix S x x') w = if w ∈ S then p.trace I x w else p.trace I x' w

Cut and paste. If two inputs agree on the forward and backward signals of S, the mixed input has the values of the first input on S and of the second outside S.

theorem Algebraic.Cutwidth.SingleCut.trace_eq_of_agree_backward {σ : Signature} {n s : ℕ} {U : Type u_1} (p : Program σ n s) (I : Interpretation σ U) {S : Finset (Wire n s)} {x x' : Fin n → U} (hin : ∀ j ∈ inputsIn S, x j = x' j) (hbwd : ∀ w ∈ backward p S, p.trace I x w = p.trace I x' w) (w : Wire n s) :
w ∈ S → p.trace I x w = p.trace I x' w

Determination. The inputs placed in S and the backward signal values determine every value on S.

theorem Algebraic.Cutwidth.SingleCut.trace_eq_of_agree_forward {σ : Signature} {n s : ℕ} {U : Type u_1} (p : Program σ n s) (I : Interpretation σ U) {S : Finset (Wire n s)} {x x' : Fin n → U} (hin : ∀ j ∉ inputsIn S, x j = x' j) (hfwd : ∀ w ∈ forward p S, p.trace I x w = p.trace I x' w) (w : Wire n s) :
w ∉ S → p.trace I x w = p.trace I x' w

Determination outside the cut. The inputs placed outside S and the forward signal values determine every value outside S.

theorem Algebraic.Cutwidth.SingleCut.agree_forward_of_boundaryKey_eq {σ : Signature} {n s : ℕ} {U : Type u_1} {p : Program σ n s} {I : Interpretation σ U} {S : Finset (Wire n s)} {x x' : Fin n → U} (h : boundaryKey p I S x = boundaryKey p I S x') (w : Wire n s) :
w ∈ forward p S → p.trace I x w = p.trace I x' w

Equal boundary keys mean agreement on the forward signals.

theorem Algebraic.Cutwidth.SingleCut.agree_backward_of_boundaryKey_eq {σ : Signature} {n s : ℕ} {U : Type u_1} {p : Program σ n s} {I : Interpretation σ U} {S : Finset (Wire n s)} {x x' : Fin n → U} (h : boundaryKey p I S x = boundaryKey p I S x') (w : Wire n s) :
w ∈ backward p S → p.trace I x w = p.trace I x' w

Equal boundary keys mean agreement on the backward signals.

theorem Algebraic.Cutwidth.SingleCut.boundaryKey_mix {σ : Signature} {n s : ℕ} {U : Type u_1} (p : Program σ n s) (I : Interpretation σ U) {S : Finset (Wire n s)} {x x' : Fin n → U} (h : boundaryKey p I S x = boundaryKey p I S x') :
boundaryKey p I S (mix S x x') = boundaryKey p I S x

Mixing two inputs with equal boundary keys keeps the key.

theorem Algebraic.Cutwidth.SingleCut.boundaryKey_eq_of_leftPart_eq {σ : Signature} {n s : ℕ} {U : Type u_1} (p : Program σ n s) (I : Interpretation σ U) {S : Finset (Wire n s)} {x x' : Fin n → U} (hl : leftPart S x = leftPart S x') (hb : (boundaryKey p I S x).2 = (boundaryKey p I S x').2) :
boundaryKey p I S x = boundaryKey p I S x'

Left parts and backward values determine the key. Two inputs with the same left part and the same backward values have the same forward values.

theorem Algebraic.Cutwidth.SingleCut.boundaryKey_eq_of_rightPart_eq {σ : Signature} {n s : ℕ} {U : Type u_1} (p : Program σ n s) (I : Interpretation σ U) {S : Finset (Wire n s)} {x x' : Fin n → U} (hr : rightPart S x = rightPart S x') (ha : (boundaryKey p I S x).1 = (boundaryKey p I S x').1) :
boundaryKey p I S x = boundaryKey p I S x'

Right parts and forward values determine the key. Two inputs with the same right part and the same forward values have the same backward values.

Product fibres and partition bounds #

@[simp]
theorem Algebraic.Cutwidth.SingleCut.leftPart_mix {n s : ℕ} {U : Type u_1} {S : Finset (Wire n s)} (x x' : Fin n → U) :
leftPart S (mix S x x') = leftPart S x
@[simp]
theorem Algebraic.Cutwidth.SingleCut.rightPart_mix {n s : ℕ} {U : Type u_1} {S : Finset (Wire n s)} (x x' : Fin n → U) :
rightPart S (mix S x x') = rightPart S x'
theorem Algebraic.Cutwidth.SingleCut.eq_of_leftPart_eq_of_rightPart_eq {n s : ℕ} {U : Type u_1} {S : Finset (Wire n s)} {x x' : Fin n → U} (hl : leftPart S x = leftPart S x') (hr : rightPart S x = rightPart S x') :
x = x'

An input is determined by its left and right parts.

theorem Algebraic.Cutwidth.SingleCut.mix_mem_filter {σ : Signature} {n s : ℕ} {U : Type u_1} (p : Program σ n s) (I : Interpretation σ U) {S : Finset (Wire n s)} [DecidableEq U] {Z : Finset (Fin n → U)} (hZ : ∀ x ∈ Z, ∀ x' ∈ Z, boundaryKey p I S x = boundaryKey p I S x' → mix S x x' ∈ Z) {κ : (↥(forward p S) → U) × (↥(backward p S) → U)} {x x' : Fin n → U} (hx : x ∈ {x ∈ Z | boundaryKey p I S x = κ}) (hx' : x' ∈ {x ∈ Z | boundaryKey p I S x = κ}) :
mix S x x' ∈ {x ∈ Z | boundaryKey p I S x = κ}

Fibres are closed under mixing. If Z is closed under mixing inputs with equal keys, so is the set of members of Z with a given key.

theorem Algebraic.Cutwidth.SingleCut.card_filter_boundaryKey_eq {σ : Signature} {n s : ℕ} {U : Type u_1} (p : Program σ n s) (I : Interpretation σ U) {S : Finset (Wire n s)} [DecidableEq U] {Z : Finset (Fin n → U)} (hZ : ∀ x ∈ Z, ∀ x' ∈ Z, boundaryKey p I S x = boundaryKey p I S x' → mix S x x' ∈ Z) (κ : (↥(forward p S) → U) × (↥(backward p S) → U)) :
{x ∈ Z | boundaryKey p I S x = κ}.card = (leftParts p I S Z κ).card * (rightParts p I S Z κ).card

Product fibres. If Z is closed under mixing inputs with equal keys (for example all inputs, or the inputs on which an output wire carries a fixed value), the members of Z with a given key are in bijection with the product of their left and right parts.

theorem Algebraic.Cutwidth.SingleCut.card_image_boundaryKey_le {σ : Signature} {n s : ℕ} {U : Type u_1} (p : Program σ n s) (I : Interpretation σ U) (S : Finset (Wire n s)) [DecidableEq U] (Z : Finset (Fin n → U)) [Fintype U] :

There are at most |U| ^ (|A| + |B|) boundary keys.

theorem Algebraic.Cutwidth.SingleCut.sum_card_leftParts_le {σ : Signature} {n s : ℕ} {U : Type u_1} (p : Program σ n s) (I : Interpretation σ U) (S : Finset (Wire n s)) [DecidableEq U] (Z : Finset (Fin n → U)) [Fintype U] :
∑ κ ∈ Finset.image (boundaryKey p I S) Z, (leftParts p I S Z κ).card ≤ Fintype.card U ^ ((inputsIn S).card + (backward p S).card)

For a fixed backward part, the left parts partition the left inputs. Summed over the keys realized in Z, the left parts number at most |U| ^ (i + |B|).

theorem Algebraic.Cutwidth.SingleCut.sum_card_rightParts_le {σ : Signature} {n s : ℕ} {U : Type u_1} (p : Program σ n s) (I : Interpretation σ U) (S : Finset (Wire n s)) [DecidableEq U] (Z : Finset (Fin n → U)) [Fintype U] :
∑ κ ∈ Finset.image (boundaryKey p I S) Z, (rightParts p I S Z κ).card ≤ Fintype.card U ^ (n - (inputsIn S).card + (forward p S).card)

For a fixed forward part, the right parts partition the right inputs. Summed over the keys realized in Z, the right parts number at most |U| ^ (n - i + |A|).

The criterion #

theorem Algebraic.Cutwidth.SingleCut.card_accepting_le_of_trace {σ : Signature} {n s : ℕ} {f : Cslib.BooleanFunction n} {K : ℕ} (p : Program σ n s) (I : Interpretation σ Bool) (out : Wire n s) (hf : ∀ (x : Cslib.BitString n), f x = p.trace I x out) (hrect : RectangleFree f K) (S : Finset (Wire n s)) :
(accepting f).card ≤ (K - 1) * (2 ^ ((inputsIn S).card + (backward p S).card) + 2 ^ (n - (inputsIn S).card + (forward p S).card))

The single-cut criterion for a wire. If the wire out of a program carries a K-rectangle-free function f, then for every set S of wires, |f⁻¹(1)| ≤ (K - 1) (2 ^ (i + |B|) + 2 ^ (n - i + |A|)).

theorem Algebraic.Cutwidth.SingleCut.card_accepting_le {σ : Signature} {n : ℕ} {f : Cslib.BooleanFunction n} {K : ℕ} {c : Circuit σ n 1} {I : Interpretation σ Bool} (hc : c.Computes I fun (x : Fin n → Bool) (x_1 : Fin 1) => f x) (hrect : RectangleFree f K) (S : Finset (Wire n c.size)) :
(accepting f).card ≤ (K - 1) * (2 ^ ((inputsIn S).card + (backward c.program S).card) + 2 ^ (n - (inputsIn S).card + (forward c.program S).card))

The single-cut criterion. If a single-output circuit computes a K-rectangle-free function f, then for every set S of its wires, with i inputs in S, forward signals A = forward c.program S and backward signals B = backward c.program S, |f⁻¹(1)| ≤ (K - 1) (2 ^ (i + |B|) + 2 ^ (n - i + |A|)).

theorem Algebraic.Cutwidth.SingleCut.card_accepting_lt {σ : Signature} {n : ℕ} {f : Cslib.BooleanFunction n} {K : ℕ} {c : Circuit σ n 1} {I : Interpretation σ Bool} (hc : c.Computes I fun (x : Fin n → Bool) (x_1 : Fin 1) => f x) (hrect : RectangleFree f K) (S : Finset (Wire n c.size)) :
(accepting f).card < K * (2 ^ ((inputsIn S).card + (backward c.program S).card) + 2 ^ (n - (inputsIn S).card + (forward c.program S).card))

The single-cut criterion, strict form. |f⁻¹(1)| < K (2 ^ (i + |B|) + 2 ^ (n - i + |A|)).

theorem Algebraic.Cutwidth.SingleCut.le_max_add_clog {σ : Signature} {n : ℕ} {f : Cslib.BooleanFunction n} {K : ℕ} {c : Circuit σ n 1} {I : Interpretation σ Bool} (hc : c.Computes I fun (x : Fin n → Bool) (x_1 : Fin 1) => f x) (hrect : RectangleFree f K) (hacc : 2 ^ (n - 2) ≤ (accepting f).card) (S : Finset (Wire n c.size)) :

The single-cut corollary. If a single-output circuit computes a K-rectangle-free function with at least 2 ^ (n - 2) accepted inputs, then every set S of its wires has n ≤ max (i + |B|) (n - i + |A|) + ⌈log₂ K⌉ + 2.

theorem Algebraic.Cutwidth.SingleCut.sub_logb_lt_max {σ : Signature} {n : ℕ} {f : Cslib.BooleanFunction n} {K : ℕ} {c : Circuit σ n 1} {I : Interpretation σ Bool} (hc : c.Computes I fun (x : Fin n → Bool) (x_1 : Fin 1) => f x) (hrect : RectangleFree f K) (hacc : 2 ^ (n - 2) ≤ (accepting f).card) (S : Finset (Wire n c.size)) :
↑n - Real.logb 2 ↑K - 3 < ↑(max ((inputsIn S).card + (backward c.program S).card) (n - (inputsIn S).card + (forward c.program S).card))

The single-cut corollary, real form. Under the hypotheses of le_max_add_clog, max (i + |B|) (n - i + |A|) > n - log₂ K - 3.

theorem Algebraic.Cutwidth.SingleCut.exists_prefix_le {σ : Signature} {n : ℕ} {f : Cslib.BooleanFunction n} {K : ℕ} {c : Circuit σ n 1} {I : Interpretation σ Bool} (hc : c.Computes I fun (x : Fin n → Bool) (x_1 : Fin 1) => f x) (hrect : RectangleFree f K) (hacc : 2 ^ (n - 2) ≤ (accepting f).card) (rank : Wire n c.size → ℕ) (hrank : Function.Injective rank) :
∃ (t : ℕ), n / 2 ≤ (forward c.program {w : Wire n c.size | rank w < t}).card + (backward c.program {w : Wire n c.size | rank w < t}).card + Nat.clog 2 K + 2

Every ordering has a heavily crossed prefix. Under the hypotheses of le_max_add_clog, every injective ranking of the wires has a prefix, the wires ranked below some t, crossed by at least ⌊n/2⌋ - ⌈log₂ K⌉ - 2 signals: the prefix containing exactly ⌊n/2⌋ inputs would otherwise violate the criterion.