Boolean Function Definitions #
Core definitions for Boolean functions on the hypercube Fin n → Bool,
including sensitivity.
@[reducible, inline]
A Boolean function on n variables.
Equations
- Sensitivity.BoolFun n = ((Fin n → Bool) → Bool)
Instances For
Flip the i-th bit of an input.
Equations
- Sensitivity.flipBit x i = Function.update x i !x i
Instances For
Whether f is sensitive at input x in coordinate i.
Equations
- f.sensitiveAt x i = (f (Sensitivity.flipBit x i) ≠ f x)
Instances For
instance
Sensitivity.instDecidableSensitiveAt
{n : ℕ}
(f : BoolFun n)
(x : Fin n → Bool)
(i : Fin n)
:
Decidable (f.sensitiveAt x i)
Equations
- Sensitivity.instDecidableSensitiveAt f x i = inferInstanceAs (Decidable (f (Sensitivity.flipBit x i) ≠ f x))
The local sensitivity of f at input x: number of sensitive coordinates.
Equations
- f.localSensitivity x = {i : Fin n | f.sensitiveAt x i}.card
Instances For
The sensitivity of f: maximum local sensitivity over all inputs.
Equations
- f.sensitivity = Finset.univ.sup fun (x : Fin n → Bool) => f.localSensitivity x
Instances For
The sensitivity is at most n.
theorem
Sensitivity.BoolFun.localSensitivity_le_sensitivity
{n : ℕ}
(f : BoolFun n)
(x : Fin n → Bool)
:
The local sensitivity is at most the sensitivity.