Documentation

LeanPool.Sensitivity.Defs

Boolean Function Definitions #

Core definitions for Boolean functions on the hypercube Fin n → Bool, including bit flips, sensitivity, and local sensitivity.

Main definitions #

@[reducible, inline]

A Boolean function on n variables, viewed as a map (Fin n → Bool) → Bool.

Equations
Instances For
    def LeanPoolSensitivity.flipBit {n : } (x : Fin nBool) (i : Fin n) :
    Fin nBool

    Flip the i-th bit of an input x : Fin n → Bool, leaving all other coordinates fixed.

    Equations
    Instances For
      @[simp]
      theorem LeanPoolSensitivity.flipBit_apply_same {n : } (x : Fin nBool) (i : Fin n) :
      flipBit x i i = !x i
      @[simp]
      theorem LeanPoolSensitivity.flipBit_apply_ne {n : } (x : Fin nBool) (i : Fin n) {j : Fin n} (h : j i) :
      flipBit x i j = x j
      @[simp]
      theorem LeanPoolSensitivity.flipBit_flipBit_same {n : } (x : Fin nBool) (i : Fin n) :
      flipBit (flipBit x i) i = x
      theorem LeanPoolSensitivity.flipBit_ne_self {n : } (x : Fin nBool) (i : Fin n) :
      flipBit x i x

      flipBit x i is never equal to x itself: the i-th coordinate differs.

      Different coordinates produce different bit flips of x.

      def LeanPoolSensitivity.BoolFun.sensitiveAt {n : } (f : BoolFun n) (x : Fin nBool) (i : Fin n) :

      f is sensitive at input x in coordinate i when flipping bit i changes the value of f.

      Equations
      Instances For

        The local sensitivity of f at input x: number of coordinates i at which f is sensitive.

        Equations
        Instances For
          noncomputable def LeanPoolSensitivity.BoolFun.sensitivity {n : } (f : BoolFun n) :

          The sensitivity of f: the maximum of f.localSensitivity x over all inputs x.

          Equations
          Instances For

            The sensitivity of any Boolean function on n variables is at most n.

            The local sensitivity at any specific input is bounded above by the sensitivity of f.

            def LeanPoolSensitivity.flipCoords {n : } (x : Fin nBool) (S : Finset (Fin n)) :
            Fin nBool

            Flip all bits whose index lies in the finite set S, leaving the remaining coordinates fixed.

            Equations
            Instances For