Documentation

Cslib.Computability.QueryComplexity.Defs

Boolean functions on the hypercube #

A Boolean function is a map {0,1}ⁿ → {0,1}, shared across the library as Cslib.BooleanFunction on Cslib.BitString n. This file sets up block flips, which are the moves of sensitivity and block sensitivity, and partial assignments. The complexity measures are built in Measures.lean.

Main definitions #

References #

Flipping blocks of bits #

x with every coordinate of B flipped.

Instances For
    theorem Cslib.BitString.flipBlock_eq_piecewise {n : ℕ} (B : Finset (Fin n)) (x : BitString n) :
    flipBlock B x = B.piecewise (fun (j : Fin n) => !x j) x

    Flipping B splices the negation of x into x on B.

    @[simp]
    theorem Cslib.BitString.flipBlock_apply_of_mem {n : ℕ} {B : Finset (Fin n)} {x : BitString n} {j : Fin n} (h : j ∈ B) :
    flipBlock B x j = !x j
    @[simp]
    theorem Cslib.BitString.flipBlock_apply_of_notMem {n : ℕ} {B : Finset (Fin n)} {x : BitString n} {j : Fin n} (h : j ∉ B) :
    flipBlock B x j = x j
    @[simp]

    Flipping no coordinates does nothing.

    @[simp]
    theorem Cslib.BitString.flipBlock_flipBlock {n : ℕ} (B : Finset (Fin n)) (x : BitString n) :

    Flipping the same block twice does nothing.

    Flipping a block is an involution.

    @[simp]

    Flipping the block {i} is flipping the single bit i.

    theorem Cslib.BitString.flipBlock_erase {n : ℕ} {B : Finset (Fin n)} {i : Fin n} (hi : i ∈ B) (x : BitString n) :
    flipBlock (B.erase i) x = Function.update (flipBlock B x) i (x i)

    Flipping B \ {i} is flipping B and then restoring bit i ∈ B.

    @[reducible, inline]

    A block: a set of coordinates.

    Instances For

      Partial assignments #

      @[reducible, inline]

      C i = some b fixes coordinate i to b; C i = none leaves it free.

      Instances For

        The coordinates the partial assignment fixes.

        Instances For
          @[simp]

          A coordinate lies in the support if and only if the partial assignment fixes it.

          How many coordinates the partial assignment fixes.

          Instances For

            x agrees with C when it matches C on every fixed coordinate.

            Instances For
              @[instance_reducible]

              The total assignment reading off every coordinate of x.

              Instances For
                @[simp]

                A total assignment read off x is agreed with by x alone.

                @[simp]

                Reading off the whole input fixes all n coordinates.

                The partial assignment reading off x on the coordinates only in S.

                Instances For
                  @[simp]
                  theorem Cslib.QueryComplexity.agrees_restrict_iff {n : ℕ} {x y : BitString n} {S : Finset (Fin n)} :
                  Agrees (restrict x S) y ↔ ∀ i ∈ S, y i = x i

                  An input agrees with restrict x S if and only if it matches x on S.

                  @[simp]

                  restrict x S fixes exactly the coordinates in S.

                  A partial assignment consistent with x is x restricted to its support.