Documentation

CslibFrontier.Foundations.Data.BitString.OpenSpherePartition

Partitions of the Boolean cube into open Hamming spheres #

When the dimension is 2 ^ r, the Boolean cube partitions into open spheres of radius one. Each sphere contains the neighbors of its center, and does not contain the center itself. The centers are the kernel of a parity-check map whose labels enumerate every r-bit string, including the zero label. The map is the standard Matrix.vecMul, with the coordinate labels as matrix rows. Flipping the coordinate named by an input's syndrome gives its unique center. This is [Lupanov1961Formulas, §4, Lemma 3, printed/PDF p. 8 of the English translation]. The source calls these sets spheres; its definition on p. 7 excludes the center.

Main results #

theorem Cslib.BitString.vecMul_flipOn_singleton {n r : ℕ} (label : Matrix (Fin n) (Fin r) Bool) (x : BitString n) (i : Fin n) :
Matrix.vecMul (flipOn {i} x) label = Matrix.vecMul x label + label i

Flipping coordinate i adds its row label to the parity-check matrix product.

theorem Cslib.BitString.bijective_flipOn_vecMul_zero {n r : ℕ} (label : Fin n ≃ BitString r) :
Function.Bijective fun (p : { c : BitString n // Matrix.vecMul c (Matrix.of fun (i : Fin n) (j : Fin r) => label i j) = 0 } × Fin n) => match (motive := { c : BitString n // Matrix.vecMul c (Matrix.of fun (i : Fin n) (j : Fin r) => label i j) = 0 } × Fin n → Fin n → Bool) p with | (center, i) => flipOn {i} ↑center

The kernel centers of a complete parity-check labeling have disjoint open spheres covering the cube. A center and its flipped coordinate are uniquely determined by the resulting point.

theorem Cslib.BitString.exists_openSpherePartition (r : ℕ) :
∃ (C : Finset (BitString (2 ^ r))), C.card * 2 ^ r = 2 ^ 2 ^ r ∧ Function.Bijective fun (p : ↥C × Fin (2 ^ r)) => match (motive := ↥C × Fin (2 ^ r) → Fin (2 ^ r) → Bool) p with | (center, i) => flipOn {i} ↑center

Lupanov's open-sphere partition. In dimension 2 ^ r, the cube is partitioned into open Hamming spheres of radius one. There are exactly 2 ^ (2 ^ r) / 2 ^ r centers. The bijection records both coverage and disjointness, including the boundary case r = 0.

This is [Lupanov1961Formulas, §4, Lemma 3, printed/PDF p. 8 of the translation].