Support subsets of list-represented bit strings #
Views word : List Bool as its support subset {i : Fin n | ofList n word i = true} via
Cslib.BitString.ofList, padding short lists with false and ignoring indices ≥ n.
Main definitions #
Cslib.BitString.supportOfList: support subset{i : Fin n | ofList n word i = true}.
Main results #
Cslib.BitString.mem_supportOfList,Cslib.BitString.supportOfList_ofFn_decide,Cslib.BitString.ofFn_decide_mem_supportOfList,Cslib.BitString.supportOfList_injective_of_length,Cslib.BitString.card_supportOfList_of_length: membership, round-trips, injectivity, and card.
@[simp]
Coordinate i : Fin n lies in supportOfList n word iff word.getD i.val false = true.
theorem Cslib.BitString.ofFn_decide_mem_supportOfList {n : ℕ} {word : List Bool} (hw : word.length = n) :
On words of length n, List.ofFn (fun i => decide (i ∈ supportOfList n word)) is word.
theorem Cslib.BitString.supportOfList_injective_of_length {n : ℕ} {w₁ w₂ : List Bool} (hw₁ : w₁.length = n) (hw₂ : w₂.length = n) (heq : supportOfList n w₁ = supportOfList n w₂) :
On words of exact length n, supportOfList n is injective.