Documentation

Complexity.Computability.Circuit.Arithmetic.Word

Words #

The words of Limaye, Srinivasan and Tavenas [LimayeSrinivasanTavenas2021, §2, p. 6]. A word is a tuple w : Fin d → ℤ. Its variables X(w) (WordVar w) form d blocks, block i having 2 ^ |w i| variables labelled by the bit strings of length |w i|, here the numbers below 2 ^ |w i|; a choice of one variable in every block (WordChoice w) is a set-multilinear monomial on all blocks. The blocks with 0 ≤ w i are positive (wordPos w, LST's P_w), the others negative (wordNeg w, LST's N_w). A word is b-unbiased (IsUnbiased w b) when every prefix sum has absolute value at most b.

The proof of LST Lemma 13 (§4, p. 10) builds an unbiased word greedily over an alphabet {a, -k}: the next letter is a when the sum of the letters so far is at most 0, and -k otherwise (greedyWord). It is k-unbiased when 0 ≤ a ≤ k (isUnbiased_greedyWord). The proof of LST Lemma 15 (§5, p. 12) uses this word with a = ⌊k / √2⌋.

Main definitions #

Main results #

References #

Variables and blocks #

@[reducible, inline]

The variables X(w) of a word w: block i has 2 ^ |w i| variables, labelled by the numbers below 2 ^ |w i|, that is, by the bit strings of length |w i|.

Instances For
    @[reducible, inline]

    A choice of one variable in every block of X(w): a set-multilinear monomial.

    Instances For

      The blocks of w whose signed length satisfies p.

      Instances For
        @[reducible, inline]
        abbrev Cslib.Circuits.Arithmetic.wordPos {d : ℕ} (w : Fin d → ℤ) :

        The positive blocks P_w = {i | 0 ≤ w i} of a word.

        Instances For
          @[reducible, inline]
          abbrev Cslib.Circuits.Arithmetic.wordNeg {d : ℕ} (w : Fin d → ℤ) :

          The negative blocks N_w = {i | w i < 0} of a word.

          Instances For
            @[simp]
            theorem Cslib.Circuits.Arithmetic.mem_wordBlocks {d : ℕ} {w : Fin d → ℤ} {p : ℤ → Prop} [DecidablePred p] {i : Fin d} :
            i ∈ wordBlocks w p ↔ p (w i)

            A block belongs to wordBlocks w p exactly when its signed length satisfies p.

            The negative blocks are the blocks that are not positive.

            Unbiased words #

            A word is b-unbiased when every prefix sum ∑ i < t, w i has absolute value at most b (LST §2, p. 6).

            Instances For

              The greedy word (LST, proof of Lemma 13) #

              The prefix sums of the greedy word over the alphabet {a, -k}: start at 0, then add a when the current sum is at most 0, and add -k otherwise.

              Instances For

                The greedy word of length d over the alphabet {a, -k} (LST, proof of Lemma 13, p. 10; used with a = ⌊k / √2⌋ in the proof of Lemma 15, p. 12): its i-th letter is a if the sum of the earlier letters is at most 0, and -k otherwise.

                Instances For
                  theorem Cslib.Circuits.Arithmetic.greedyWord_eq_or {d : ℕ} (a k : ℤ) (i : Fin d) :
                  greedyWord a k d i = a ∨ greedyWord a k d i = -k

                  Every letter of the greedy word is a or -k.

                  theorem Cslib.Circuits.Arithmetic.sum_filter_greedyWord {d : ℕ} (a k : ℤ) {t : ℕ} (ht : t ≤ d) :
                  ∑ i : Fin d with ↑i < t, greedyWord a k d i = greedyPrefix a k t

                  The prefix sums of the greedy word are the values of greedyPrefix.

                  theorem Cslib.Circuits.Arithmetic.greedyPrefix_mem_Icc {a k : ℤ} (ha : 0 ≤ a) (hk : 0 ≤ k) (t : ℕ) :

                  The prefix sums of the greedy word stay in [-k, a] when 0 ≤ a and 0 ≤ k.

                  theorem Cslib.Circuits.Arithmetic.isUnbiased_greedyWord {d : ℕ} {a : ℤ} {k : ℕ} (ha : 0 ≤ a) (hak : a ≤ ↑k) :
                  IsUnbiased (greedyWord a (↑k) d) k

                  The greedy word is k-unbiased (LST, proof of Lemma 13): if 0 ≤ a ≤ k, every prefix sum of the greedy word over {a, -k} has absolute value at most k.