Documentation

CslibFrontier.Foundations.Combinatorics.Expander.BipartiteTanner

General regular bipartite Tanner codes: distance δ (δ - λ), rate, and shortening #

Given a D-regular bipartite multigraph B : BipartiteRotationMap L R D (retaining parallel edges) and local codes CL CR : Set (D → α), the bipartite Tanner code Cslib.BipartiteTanner.code B CL CR consists of all edge-labelings x : L × D → α whose left and right vertex neighborhoods belong to CL and CR respectively [SS96]. When CL and CR are linear codes, Cslib.BipartiteTanner.submodule B CL CR is a linear subcode; when defined by parity-check matrices HL, HR, Cslib.BipartiteTanner.checkMatrix B HL HR is its explicit parity-check matrix with row weights at most |D|.

Main definitions #

Main results #

References #

def Cslib.BipartiteTanner.leftWord {L : Type u_1} {D : Type u_3} {α : Type u_4} (x : L × D → α) (u : L) :
D → α

The local word at left vertex u: its D incident edge labels.

def Cslib.BipartiteTanner.rightWord {L : Type u_1} {R : Type u_2} {D : Type u_3} {α : Type u_4} (B : BipartiteRotationMap L R D) (x : L × D → α) (v : R) :
D → α

The local word at right vertex v: the D incident edge labels pulled back along B.toRight.symm.

@[simp]
theorem Cslib.BipartiteTanner.rightWord_toRight {L : Type u_1} {R : Type u_2} {D : Type u_3} {α : Type u_4} (B : BipartiteRotationMap L R D) (x : L × D → α) (u : L) (i : D) :
rightWord B x (B.toRight (u, i)).1 (B.toRight (u, i)).2 = x (u, i)

Evaluating rightWord B x at the right dart B.toRight (u, i) recovers x (u, i).

def Cslib.BipartiteTanner.leftWordLinear {L : Type u_1} {D : Type u_3} (S : Type u_5) (M : Type u_6) [Semiring S] [AddCommMonoid M] [Module S M] (u : L) :
(L × D → M) →ₗ[S] D → M

Linear left-word projection at vertex u.

@[simp]
theorem Cslib.BipartiteTanner.leftWordLinear_apply {L : Type u_1} {D : Type u_3} (S : Type u_5) (M : Type u_6) [Semiring S] [AddCommMonoid M] [Module S M] (u : L) (x : L × D → M) :
(leftWordLinear S M u) x = leftWord x u
def Cslib.BipartiteTanner.rightWordLinear {L : Type u_1} {R : Type u_2} {D : Type u_3} (S : Type u_5) (M : Type u_6) [Semiring S] [AddCommMonoid M] [Module S M] (B : BipartiteRotationMap L R D) (v : R) :
(L × D → M) →ₗ[S] D → M

Linear right-word projection at vertex v.

@[simp]
theorem Cslib.BipartiteTanner.rightWordLinear_apply {L : Type u_1} {R : Type u_2} {D : Type u_3} (S : Type u_5) (M : Type u_6) [Semiring S] [AddCommMonoid M] [Module S M] (B : BipartiteRotationMap L R D) (v : R) (x : L × D → M) :
(rightWordLinear S M B v) x = rightWord B x v
def Cslib.BipartiteTanner.code {L : Type u_1} {R : Type u_2} {D : Type u_3} {α : Type u_4} (B : BipartiteRotationMap L R D) (CL CR : Set (D → α)) :
Set (L × D → α)

The bipartite Tanner code of B with local codes CL on the left and CR on the right.

@[simp]
theorem Cslib.BipartiteTanner.mem_code {L : Type u_1} {R : Type u_2} {D : Type u_3} {α : Type u_4} {B : BipartiteRotationMap L R D} {CL CR : Set (D → α)} {x : L × D → α} :
x ∈ code B CL CR ↔ (∀ (u : L), leftWord x u ∈ CL) ∧ ∀ (v : R), rightWord B x v ∈ CR

A word lies in code B CL CR iff every left neighborhood is in CL and every right neighborhood is in CR.

def Cslib.BipartiteTanner.submodule {L : Type u_1} {R : Type u_2} {D : Type u_3} {S : Type u_5} {M : Type u_6} [Semiring S] [AddCommMonoid M] [Module S M] (B : BipartiteRotationMap L R D) (CL CR : Submodule S (D → M)) :
Submodule S (L × D → M)

The linear bipartite Tanner code when CL and CR are submodules of D → M.

@[simp]
theorem Cslib.BipartiteTanner.coe_submodule {L : Type u_1} {R : Type u_2} {D : Type u_3} {S : Type u_5} {M : Type u_6} [Semiring S] [AddCommMonoid M] [Module S M] (B : BipartiteRotationMap L R D) (CL CR : Submodule S (D → M)) :
↑(submodule B CL CR) = code B ↑CL ↑CR

Coercing submodule B CL CR to a set yields code B CL CR.

theorem Cslib.BipartiteTanner.mem_submodule {L : Type u_1} {R : Type u_2} {D : Type u_3} {S : Type u_5} {M : Type u_6} [Semiring S] [AddCommMonoid M] [Module S M] {B : BipartiteRotationMap L R D} {CL CR : Submodule S (D → M)} {x : L × D → M} :
x ∈ submodule B CL CR ↔ (∀ (u : L), leftWord x u ∈ CL) ∧ ∀ (v : R), rightWord B x v ∈ CR

Membership in submodule B CL CR.

theorem Cslib.BipartiteTanner.hammingDist_eq_sum_left {L : Type u_1} {D : Type u_3} {α : Type u_4} [Fintype L] [Fintype D] [DecidableEq α] (x y : L × D → α) :
hammingDist x y = ∑ u : L, hammingDist (leftWord x u) (leftWord y u)

Hamming distance decomposes by left vertices.

theorem Cslib.BipartiteTanner.hammingDist_eq_sum_right {L : Type u_1} {R : Type u_2} {D : Type u_3} {α : Type u_4} [Fintype L] [Fintype R] [Fintype D] [DecidableEq α] (B : BipartiteRotationMap L R D) (x y : L × D → α) :
hammingDist x y = ∑ v : R, hammingDist (rightWord B x v) (rightWord B y v)

Hamming distance decomposes by right vertices.

theorem Cslib.BipartiteTanner.hammingNorm_eq_sum_left {L : Type u_1} {D : Type u_3} {α : Type u_4} [Fintype L] [Fintype D] [Zero α] [DecidableEq α] (x : L × D → α) :
hammingNorm x = ∑ u : L, hammingNorm (leftWord x u)

Hamming weight decomposes by left vertices.

theorem Cslib.BipartiteTanner.hammingNorm_eq_sum_right {L : Type u_1} {R : Type u_2} {D : Type u_3} {α : Type u_4} [Fintype L] [Fintype R] [Fintype D] [Zero α] [DecidableEq α] (B : BipartiteRotationMap L R D) (x : L × D → α) :
hammingNorm x = ∑ v : R, hammingNorm (rightWord B x v)

Hamming weight decomposes by right vertices.

def Cslib.BipartiteTanner.checkMatrix {L : Type u_1} {R : Type u_2} {D : Type u_3} {ιL : Type u_4} {ιR : Type u_5} {α : Type u_6} [DecidableEq L] [DecidableEq R] [Zero α] (B : BipartiteRotationMap L R D) (HL : Matrix ιL D α) (HR : Matrix ιR D α) :
Matrix (L × ιL ⊕ R × ιR) (L × D) α

Parity-check matrix of a bipartite Tanner code from left check matrix HL and right check matrix HR: rows (u, i) on L × ιL check leftWord x u, and rows (v, i) on R × ιR check rightWord B x v.

theorem Cslib.BipartiteTanner.checkMatrix_mulVec_inl {L : Type u_1} {R : Type u_2} {D : Type u_3} {ιL : Type u_4} {ιR : Type u_5} {α : Type u_6} [Fintype L] [Fintype D] [DecidableEq L] [DecidableEq R] [NonUnitalNonAssocSemiring α] (B : BipartiteRotationMap L R D) (HL : Matrix ιL D α) (HR : Matrix ιR D α) (x : L × D → α) (u : L) (i : ιL) :
(checkMatrix B HL HR).mulVec x (Sum.inl (u, i)) = HL.mulVec (leftWord x u) i

Left rows of checkMatrix B HL HR compute HL *ᵥ leftWord x u.

theorem Cslib.BipartiteTanner.checkMatrix_mulVec_inr {L : Type u_1} {R : Type u_2} {D : Type u_3} {ιL : Type u_4} {ιR : Type u_5} {α : Type u_6} [Fintype L] [Finite R] [Fintype D] [DecidableEq L] [DecidableEq R] [NonUnitalNonAssocSemiring α] (B : BipartiteRotationMap L R D) (HL : Matrix ιL D α) (HR : Matrix ιR D α) (x : L × D → α) (v : R) (i : ιR) :
(checkMatrix B HL HR).mulVec x (Sum.inr (v, i)) = HR.mulVec (rightWord B x v) i

Right rows of checkMatrix B HL HR compute HR *ᵥ rightWord B x v.

theorem Cslib.BipartiteTanner.parityCheckCode_checkMatrix {L : Type u_1} {R : Type u_2} {D : Type u_3} {ιL : Type u_4} {ιR : Type u_5} {α : Type u_6} [Fintype L] [Finite R] [Fintype D] [DecidableEq L] [DecidableEq R] [CommRing α] (B : BipartiteRotationMap L R D) (HL : Matrix ιL D α) (HR : Matrix ιR D α) :

The parity-check code of checkMatrix B HL HR is submodule B (parityCheckCode HL) (parityCheckCode HR).

theorem Cslib.BipartiteTanner.hammingNorm_checkMatrix_row_le {L : Type u_1} {R : Type u_2} {D : Type u_3} {ιL : Type u_4} {ιR : Type u_5} {α : Type u_6} [Fintype L] [Fintype D] [DecidableEq L] [DecidableEq R] [Zero α] [DecidableEq α] (B : BipartiteRotationMap L R D) (HL : Matrix ιL D α) (HR : Matrix ιR D α) (r : L × ιL ⊕ R × ιR) :

Every row of checkMatrix B HL HR has Hamming weight at most |D|.

theorem Cslib.BipartiteTanner.hammingNorm_submatrix_row_le {α : Type u_6} {κ : Type u_7} {ι : Type u_8} {ι' : Type u_9} [Fintype ι] [Fintype ι'] [Zero α] [DecidableEq α] (H : Matrix κ ι α) (emb : ι' ↪ ι) (r : κ) :
hammingNorm (H.submatrix id (⇑emb) r) ≤ hammingNorm (H r)

Restricting columns along an embedding emb : ι' ↪ ι cannot increase any row's Hamming weight.

theorem Cslib.BipartiteTanner.rate_submodule_ge {L : Type u_1} {R : Type u_2} {D : Type u_3} {α : Type u_6} [Fintype L] [Finite R] [Fintype D] [CommRing α] [Fintype α] [Nontrivial α] (B : BipartiteRotationMap L R D) (hL : 0 < Fintype.card L) (hD : 0 < Fintype.card D) (CL CR : Submodule α (D → α)) :
Code.rate ↑CL + Code.rate ↑CR - 1 ≤ Code.rate ↑(submodule B CL CR)

Rate lower bound rate CL + rate CR - 1 ≤ rate (submodule B CL CR) for arbitrary finite local linear codes CL and CR over a finite nontrivial commutative ring.

theorem Cslib.BipartiteTanner.one_sub_card_div_card_le_rate_parityCheck {L : Type u_1} {R : Type u_2} {D : Type u_3} {ιL : Type u_4} {ιR : Type u_5} {α : Type u_6} [Fintype L] [Finite R] [Fintype D] [Fintype ιL] [Fintype ιR] [CommRing α] [Fintype α] [Nontrivial α] (B : BipartiteRotationMap L R D) (hL : 0 < Fintype.card L) (hD : 0 < Fintype.card D) (HL : Matrix ιL D α) (HR : Matrix ιR D α) :

Parity-check rate lower bound for bipartite Tanner codes: if HL has |ιL| checks and HR has |ιR| checks over a finite nontrivial commutative ring α, then the Tanner code has rate at least 1 - (|ιL| + |ιR|) / |D|.

theorem Cslib.BipartiteTanner.sqrt_mul_sub_card_le_of_hammingDist {L : Type u_1} {R : Type u_2} {D : Type u_3} {α : Type u_4} [Fintype L] [Fintype R] [Fintype D] (B : BipartiteRotationMap L R D) [Nonempty D] [DecidableEq α] {CL CR : Set (D → α)} {kL kR lam : ℝ} (hkL : 0 ≤ kL) (hkR : 0 ≤ kR) (hCL : ∀ w₁ ∈ CL, ∀ w₂ ∈ CL, w₁ ≠ w₂ → kL ≤ ↑(hammingDist w₁ w₂)) (hCR : ∀ w₁ ∈ CR, ∀ w₂ ∈ CR, w₁ ≠ w₂ → kR ≤ ↑(hammingDist w₁ w₂)) (hlam : B.nontrivialSingularValue ≤ lam) {x y : L × D → α} (hx : x ∈ code B CL CR) (hy : y ∈ code B CL CR) (hxy : x ≠ y) :
√(kL * kR) * (√(kL * kR) - lam * ↑(Fintype.card D)) * ↑(Fintype.card L) ≤ ↑(Fintype.card D) * ↑(hammingDist x y)

Asymmetric bipartite Tanner code distance bound: if distinct words in CL are separated by at least kL ≥ 0 and distinct words in CR are separated by at least kR ≥ 0, and B.nontrivialSingularValue ≤ lam, then any distinct x, y ∈ code B CL CR satisfy √(kL * kR) * (√(kL * kR) - lam * |D|) * |L| ≤ |D| * hammingDist x y.

theorem Cslib.BipartiteTanner.mul_sub_card_le_of_hammingDist {L : Type u_1} {R : Type u_2} {D : Type u_3} {α : Type u_4} [Fintype L] [Fintype R] [Fintype D] (B : BipartiteRotationMap L R D) [Nonempty D] [DecidableEq α] {CL CR : Set (D → α)} {k lam : ℝ} (hk : 0 ≤ k) (hCL : ∀ w₁ ∈ CL, ∀ w₂ ∈ CL, w₁ ≠ w₂ → k ≤ ↑(hammingDist w₁ w₂)) (hCR : ∀ w₁ ∈ CR, ∀ w₂ ∈ CR, w₁ ≠ w₂ → k ≤ ↑(hammingDist w₁ w₂)) (hlam : B.nontrivialSingularValue ≤ lam) {x y : L × D → α} (hx : x ∈ code B CL CR) (hy : y ∈ code B CL CR) (hxy : x ≠ y) :
k * (k - lam * ↑(Fintype.card D)) * ↑(Fintype.card L) ≤ ↑(Fintype.card D) * ↑(hammingDist x y)

Bipartite Tanner code distance bound (threshold form): if distinct local words in CL and CR are separated by at least k ≥ 0 and B.nontrivialSingularValue ≤ lam, then any distinct x, y ∈ code B CL CR satisfy k * (k - lam * |D|) * |L| ≤ |D| * hammingDist x y.

theorem Cslib.BipartiteTanner.relDist_mul_sub_le_hammingDist {L : Type u_1} {R : Type u_2} {D : Type u_3} {α : Type u_4} [Fintype L] [Fintype R] [Fintype D] (B : BipartiteRotationMap L R D) [Nonempty D] [DecidableEq α] {CL CR : Set (D → α)} {δ lam : ℝ} (hδ : 0 ≤ δ) (hCL : ∀ w₁ ∈ CL, ∀ w₂ ∈ CL, w₁ ≠ w₂ → δ * ↑(Fintype.card D) ≤ ↑(hammingDist w₁ w₂)) (hCR : ∀ w₁ ∈ CR, ∀ w₂ ∈ CR, w₁ ≠ w₂ → δ * ↑(Fintype.card D) ≤ ↑(hammingDist w₁ w₂)) (hlam : B.nontrivialSingularValue ≤ lam) {x y : L × D → α} (hx : x ∈ code B CL CR) (hy : y ∈ code B CL CR) (hxy : x ≠ y) :
δ * (δ - lam) * ↑(Fintype.card (L × D)) ≤ ↑(hammingDist x y)

Global relative distance δ (δ - λ) of general d-regular bipartite Tanner codes: if CL and CR have relative distance at least δ ≥ 0 (δ |D| ≤ hammingDist on distinct local codewords) and B.nontrivialSingularValue ≤ lam, then distinct global codewords satisfy δ * (δ - lam) * |L × D| ≤ hammingDist x y.

theorem Cslib.BipartiteTanner.le_minDist_of_relDist {L : Type u_1} {R : Type u_2} {D : Type u_3} {α : Type u_4} [Fintype L] [Fintype R] [Fintype D] (B : BipartiteRotationMap L R D) [Nonempty D] [DecidableEq α] {CL CR : Set (D → α)} {δ lam : ℝ} (hδ : 0 ≤ δ) (hCL : ∀ w₁ ∈ CL, ∀ w₂ ∈ CL, w₁ ≠ w₂ → δ * ↑(Fintype.card D) ≤ ↑(hammingDist w₁ w₂)) (hCR : ∀ w₁ ∈ CR, ∀ w₂ ∈ CR, w₁ ≠ w₂ → δ * ↑(Fintype.card D) ≤ ↑(hammingDist w₁ w₂)) (hlam : B.nontrivialSingularValue ≤ lam) {n : ℕ} (hn : ↑n ≤ δ * (δ - lam) * ↑(Fintype.card (L × D))) :
↑n ≤ Code.minDist (code B CL CR)

Minimum distance minDist (code B CL CR) is at least any integer n ≤ δ * (δ - lam) * |L × D|.

theorem Cslib.BipartiteTanner.relDist_mul_sub_le_hammingNorm_of_submodule {L : Type u_1} {R : Type u_2} {D : Type u_3} {α : Type u_4} [Fintype L] [Fintype R] [Fintype D] (B : BipartiteRotationMap L R D) [Nonempty D] {S : Type u_5} [Ring S] [AddCommGroup α] [Module S α] [DecidableEq α] {CL CR : Submodule S (D → α)} {δ lam : ℝ} (hδ : 0 ≤ δ) (hCL : ∀ w ∈ CL, w ≠ 0 → δ * ↑(Fintype.card D) ≤ ↑(hammingNorm w)) (hCR : ∀ w ∈ CR, w ≠ 0 → δ * ↑(Fintype.card D) ≤ ↑(hammingNorm w)) (hlam : B.nontrivialSingularValue ≤ lam) {x : L × D → α} (hx : x ∈ submodule B CL CR) (hx0 : x ≠ 0) :
δ * (δ - lam) * ↑(Fintype.card (L × D)) ≤ ↑(hammingNorm x)

Minimum-weight bound δ * (δ - lam) * |L × D| ≤ hammingNorm x for nonzero words in a linear bipartite Tanner code submodule B CL CR.

theorem Cslib.BipartiteTanner.relDist_mul_sub_le_hammingNorm_of_submatrix {L : Type u_1} {R : Type u_2} {D : Type u_3} {α : Type u_4} {ιL : Type u_5} {ιR : Type u_6} {ι' : Type u_7} [Fintype L] [Fintype R] [Fintype D] [Fintype ι'] [DecidableEq L] [DecidableEq R] (B : BipartiteRotationMap L R D) [Nonempty D] [CommRing α] [DecidableEq α] (HL : Matrix ιL D α) (HR : Matrix ιR D α) {δ lam : ℝ} (hδ : 0 ≤ δ) (hHL : ∀ (w : D → α), w ≠ 0 → HL.mulVec w = 0 → δ * ↑(Fintype.card D) ≤ ↑(hammingNorm w)) (hHR : ∀ (w : D → α), w ≠ 0 → HR.mulVec w = 0 → δ * ↑(Fintype.card D) ≤ ↑(hammingNorm w)) (hlam : B.nontrivialSingularValue ≤ lam) (emb : ι' ↪ L × D) {z : ι' → α} (hz : ((checkMatrix B HL HR).submatrix id ⇑emb).mulVec z = 0) (hz0 : z ≠ 0) :
δ * (δ - lam) * ↑(Fintype.card (L × D)) ≤ ↑(hammingNorm z)

Distance of a shortened bipartite Tanner parity-check code: every nonzero word z in the kernel of (checkMatrix B HL HR).submatrix id emb has weight at least δ * (δ - lam) * |L × D|.

theorem Cslib.BipartiteTanner.le_minDist_shortenLinear_checkMatrix {L : Type u_1} {R : Type u_2} {D : Type u_3} {α : Type u_4} {ιL : Type u_5} {ιR : Type u_6} {ι' : Type u_7} [Fintype L] [Fintype R] [Fintype D] [Fintype ι'] [DecidableEq L] [DecidableEq R] (B : BipartiteRotationMap L R D) [Nonempty D] [CommRing α] [DecidableEq α] (HL : Matrix ιL D α) (HR : Matrix ιR D α) {δ lam : ℝ} (hδ : 0 ≤ δ) (hHL : ∀ (w : D → α), w ≠ 0 → HL.mulVec w = 0 → δ * ↑(Fintype.card D) ≤ ↑(hammingNorm w)) (hHR : ∀ (w : D → α), w ≠ 0 → HR.mulVec w = 0 → δ * ↑(Fintype.card D) ≤ ↑(hammingNorm w)) (hlam : B.nontrivialSingularValue ≤ lam) (emb : ι' ↪ L × D) {n : ℕ} (hn : ↑n ≤ δ * (δ - lam) * ↑(Fintype.card (L × D))) :

Minimum distance lower bound for the shortened parity-check code Code.shortenLinear (Code.parityCheckCode (checkMatrix B HL HR)) emb.