Documentation

CslibFrontier.Foundations.Data.BitString.BlockPower

Cartesian powers of sets of blocks #

The m-th Cartesian power of a finite set S of tuples of k entries, as a set of tuples of m * k entries (Cslib.BitString.blockPower): the tuples whose m blocks of k entries (Cslib.BitString.block) all lie in S. It has #S ^ m elements (Cslib.BitString.card_blockPower), as cutting a tuple into its blocks is an equivalence (Cslib.BitString.blocksEquiv). Raising a set to a power before hashing it turns an approximation of its size within a constant factor into one within a factor that tends to 1, the amplification used in approximate counting.

Main definitions #

Main results #

def Cslib.BitString.blockPower {α : Type u_1} {k : ℕ} (S : Finset (Fin k → α)) (m : ℕ) :
Finset (Fin (m * k) → α)

The m-th Cartesian power of a set S of tuples of k entries: the tuples of m * k entries whose m blocks all lie in S.

@[simp]
theorem Cslib.BitString.mem_blockPower {α : Type u_1} {m k : ℕ} {S : Finset (Fin k → α)} {x : Fin (m * k) → α} :
x ∈ blockPower S m ↔ ∀ (i : Fin m), block x i ∈ S

A tuple lies in the m-th power of S exactly when each of its blocks lies in S.

@[simp]
theorem Cslib.BitString.card_blockPower {α : Type u_1} {k : ℕ} (S : Finset (Fin k → α)) (m : ℕ) :
(blockPower S m).card = S.card ^ m

The m-th power of S has #S ^ m elements.

theorem Cslib.BitString.blockPower_eq_empty_iff {α : Type u_1} {m k : ℕ} {S : Finset (Fin k → α)} (hm : m ≠ 0) :

The power of the empty set with at least one block is empty.