Flipping bits #
BitString.flipOn T x flips the bits of the Boolean vector x at the positions in T. Flipping
one bit is Function.update x i (!x i) (BitString.flipOn_singleton), and flipping twice at the
same positions changes nothing (BitString.flipOn_flipOn). Flips are the moves of sensitivity and
block sensitivity, and they span the subcubes of the Boolean cube.
Sensitivity and certificate measures use CSLib's Computability.QueryComplexity.Measures.
An input x of a Boolean function g is isolated when flipping any one of its bits changes the
value of g (BitString.isolatedInputs). A formula in disjunctive normal form needs a term for
each isolated true input, and parity has only isolated inputs.
Main definitions #
Cslib.BitString.flipOn: flip the bits at a set of positions.Cslib.BitString.isolatedInputs: the isolated inputs of a Boolean function with a given value.
Main results #
Cslib.BitString.flipOn_apply: coordinatewise evaluation offlipOn.Cslib.BitString.flipOn_congr_decidableEq:flipOnis independent of theDecidableEqinstance.Cslib.BitString.flipOn_singleton,Cslib.BitString.flipOn_singleton_self,Cslib.BitString.flipOn_singleton_of_ne: flipping one bit.Cslib.BitString.flipOn_flipOn,Cslib.BitString.flipOn_involutive: flipping is an involution.Cslib.BitString.flipOn_insert: flippinginsert i Tfori ∉ T.Cslib.BitString.flipOn_false: flipping the all-falsevector gives the indicator of the set.Cslib.BitString.flipOn_filter_ne: flipping the positions where two vectors differ turns one into the other.Cslib.BitString.flipOn_prod_same,Cslib.BitString.flipOn_prod_of_ne: row projections of a single-coordinate flip on a product index type.Cslib.BitString.flipOn_reindex,Cslib.BitString.flipOn_reindex_singleton: reindexing a flip along an equivalence.Cslib.BitString.eq_of_singleton_invariant: a function invariant under all single-coordinate flips is constant.
References #
- N. Nisan, CREW PRAMs and decision trees
- Adapted in part from OpenAI's formalization [OAI26b] at revision adc7f1241b42e322a6451854ab7e4b4c146bf78a (file lean/OAI/Combinatorics/Sensitivity/Basic.lean), via the complexitylib port [Sch26e] at revision add0aca8ee0d71e68969f2cb45cf91554a50f787.
Flip the bits of x at the positions in T.
Instances For
flipOn is independent of the DecidableEq instance.
At a position outside T, flipOn T x has the bit of x.
Flipping at no positions changes nothing.
Flipping one bit.
Flipping twice at the same positions changes nothing.
Flipping at a fixed set of positions is an involution.
Flipping {i} negates bit i.
Flipping {i} leaves every bit j ≠ i unchanged.
Flipping the bits of the all-false vector in T gives the indicator of T.
Flipping x at the positions where x and y differ gives y.
On a product index type κ × ι, row j of flipOn {(j, i)} x is row j of x with
coordinate i flipped.
On a product index type κ × ι, every row k ≠ j of flipOn {(j, i)} x is row k of x.
Pulling back along e the input x with the image block B.map e.toEmbedding flipped gives
the pullback fun i => x (e i) with B flipped.
Singleton case of flipOn_reindex: pulling back flipOn {e i} x along e gives the
pullback of x with i flipped.
The isolated inputs of g with value b: the inputs x with g x = b at which flipping
any one bit changes the value of g.
Instances For
x is an isolated input of g with value b exactly when g x = b and flipping any one bit
of x gives the value !b.
The isolated inputs of the negation of g with value b are those of g with value !b.