Documentation

CslibFrontier.Foundations.Data.BitString.Agree

Words agreeing off a set of positions #

The words ι → Bool agreeing with a word x outside a set F of positions are free exactly on F, so there are 2 ^ |F| of them (BitString.card_filter_forall_notMem_eq). This is the case β = Bool, P = Fᶜ of Fintype.card_filter_forall_mem_eq. Words that pairwise agree on F all agree on F with one of them, so there are at most 2 ^ (|ι| - |F|) of them (BitString.card_le_of_forall_agree).

Main results #

theorem Cslib.BitString.card_filter_forall_notMem_eq {ι : Type u_1} [Fintype ι] [DecidableEq ι] (F : Finset ι) (x : ι → Bool) [DecidablePred fun (y : ι → Bool) => ∀ i ∉ F, y i = x i] :
{y : ι → Bool | ∀ i ∉ F, y i = x i}.card = 2 ^ F.card

The words agreeing with x outside F number 2 ^ |F|.

theorem Cslib.BitString.card_le_of_forall_agree {ι : Type u_1} [Fintype ι] {S : Finset (ι → Bool)} {F : Finset ι} (h : ∀ x ∈ S, ∀ y ∈ S, ∀ i ∈ F, x i = y i) :

Words that pairwise agree on F number at most 2 ^ (|ι| - |F|): they all agree on F with one of them.