Blocks of bit strings and finite tuples #
A tuple of m * k entries (in particular, a BitString (m * k)) is read as m consecutive
blocks of k entries through finProdFinEquiv: entry j of block i is entry
finProdFinEquiv (i, j) of the tuple (BitString.block). Cutting a tuple into its blocks is an
equivalence (Fin (m * k) → α) ≃ (Fin m → Fin k → α) (BitString.blocksEquiv). The positions of
the blocks (BitString.blockBits) are pairwise disjoint, and gluing two tuples along the
positions of one block takes that block from the first tuple and every other block from the second
(BitString.block_piecewise).
Main definitions #
Cslib.BitString.block: thei-th block ofkentries of a tuple ofm * kentries.Cslib.BitString.blocksEquiv: cutting a tuple into its blocks; its inverse reads entrypof the tuple in its block (BitString.blocksEquiv_symm_apply). The simp lemmasBitString.block_blocksEquiv_symmandBitString.blocksEquiv_symm_blockstate the two inverse laws withblock.Cslib.BitString.blockBits: the positions of the entries of a block.Cslib.BitString.listBlock: a block of a list (BitString.listBlock_ofFn,BitString.listBlock_flatMap).
Main results #
Cslib.BitString.pairwiseDisjoint_blockBits: blocks occupy disjoint positions.Cslib.BitString.block_piecewise: gluing two tuples along one block.Cslib.BitString.ofFn_blocksEquiv_symm: concatenating blocks concatenates their lists.
Entry j of block i is entry finProdFinEquiv (i, j) of the tuple.
blocksEquiv cuts a tuple into its blocks with block.
Cutting the concatenation of blocks into its blocks recovers them.
Concatenating the blocks of a tuple recovers it. Equiv.symm_apply_apply does not fire after
blocksEquiv_apply has rewritten blocksEquiv x to block x.
A position lies in block i exactly when its block index under finProdFinEquiv is i.
Distinct blocks occupy disjoint positions.