Documentation

CslibFrontier.Probability.BitString.BinarySymmetricChannel.Achievability

Shannon's coding theorem for the binary symmetric channel: achievability #

Random codes achieve every rate below the capacity 1 - h₂(p) of the binary symmetric channel BSC_p, for 0 ≤ p < 1 / 2, where h₂(p) = Real.binEntropy p / Real.log 2 is the binary entropy in bits: the positive part of Shannon's noisy-channel coding theorem for BSC_p Shannon, Theorem 11 Guruswami, Rudra and Sudan, Theorem 6.3.1(1).

The proof follows Guruswami, Rudra and Sudan, Section 6.3.2. A nearest codeword decoder errs on the message m only if the noise flips more than r bits, or some other codeword lies within distance r of the received word. Over a uniformly random codebook the second event has probability at most (|M| - 1) |B(n, r)| / 2 ^ n by the union bound, where |B(n, r)| = ∑_{j ≤ r} C(n, j) is the volume of a Hamming ball. So the average error over random codebooks and messages is at most T + (|M| - 1) |B(n, r)| / 2 ^ n, where T is the binomial upper tail ∑_{r < k ≤ n} C(n, k) p ^ k (1 - p) ^ (n - k) (Cslib.BitString.expect_expect_decodingError_le). Some codebook with 2 K codewords is at least as good as the average, and by Markov's inequality at least K of its messages have error bound at most twice the average; keeping them gives a code with K codewords whose maximal error is at most 2 (T + (2 K - 1) |B(n, r)| / 2 ^ n) for every nearest codeword decoder (Cslib.BitString.exists_code_decodingError_le; Claim 6.3.3 of the source).

For the asymptotic statement take r = ⌊ρ n⌋ with p < ρ < 1 / 2 and R < 1 - h₂(ρ). Hoeffding's inequality bounds T by exp (-2 (ρ - p) ^ 2 n) and the entropy bound Cslib.sum_choose_le_exp_mul_binEntropy bounds |B(n, r)| by exp (n h(ρ)), so codes with 2 ^ ⌈R n⌉₊ codewords have maximal error at most 10 exp (-δ n) for an explicit δ > 0 (Cslib.BitString.exists_pos_forall_exists_code_decodingError_le_exp) and hence at most any ε > 0 for all large n (Cslib.BitString.eventually_exists_code_decodingError_le).

The theorems cover nearest codeword (maximum-likelihood) decoders only. They prove the achievability half of the theorem for BSC_p. The converses (rates above 1 - h₂(p) fail) are in CslibFrontier.Probability.BitString.BinarySymmetricChannel.Converse and CslibFrontier.Probability.BitString.BinarySymmetricChannel.StrongConverse; general discrete memoryless channels and explicit or efficiently decodable capacity-achieving codes are not formalized here.

Main results #

References #

The random-coding argument #

theorem Cslib.BitString.exists_code_decodingError_le {ι : Type u_1} [Fintype ι] (p : ↑unitInterval) (r K : ℕ) :
∃ (E : Fin K → ι → Bool), ∀ (D : (ι → Bool) → Fin K), IsNearestDecoder E D → ∀ (k : Fin K), decodingError p E D k ≤ 2 * (∑ j ∈ Finset.range (Fintype.card ι + 1) with r < j, ↑((Fintype.card ι).choose j) * ↑p ^ j * (1 - ↑p) ^ (Fintype.card ι - j) + (↑(2 * K - 1) * ∑ j ∈ Finset.range (r + 1), ↑((Fintype.card ι).choose j)) / 2 ^ Fintype.card ι)

Achievability for the binary symmetric channel, finite form (random coding with expurgation) Guruswami, Rudra and Sudan, Section 6.3.2 and Claim 6.3.3: for every radius r there is a code with K codewords of length n on which every nearest codeword decoder has maximal error probability at most 2 (T + (2 K - 1) |B(n, r)| / 2 ^ n), where T = ∑_{r < k ≤ n} C(n, k) p ^ k (1 - p) ^ (n - k) is the probability that more than r bits flip and |B(n, r)| = ∑_{j ≤ r} C(n, j) is the volume of a Hamming ball of radius r.

theorem Cslib.BitString.expect_expect_decodingError_le {ι : Type u_1} [Fintype ι] [DecidableEq ι] {M : Type u_2} [Fintype M] [DecidableEq M] [Nonempty M] (p : ↑unitInterval) (r : ℕ) (D : (M → ι → Bool) → (ι → Bool) → M) (hD : ∀ (E : M → ι → Bool), IsNearestDecoder E (D E)) :
(Finset.univ.expect fun (E : M → ι → Bool) => Finset.univ.expect fun (m : M) => decodingError p E (D E) m) ≤ ∑ j ∈ Finset.range (Fintype.card ι + 1) with r < j, ↑((Fintype.card ι).choose j) * ↑p ^ j * (1 - ↑p) ^ (Fintype.card ι - j) + (↑(Fintype.card M - 1) * ∑ j ∈ Finset.range (r + 1), ↑((Fintype.card ι).choose j)) / 2 ^ Fintype.card ι

The random-coding bound [Guruswami, Rudra and Sudan, Section 6.3.2] [GRS19]: over a uniformly random codebook E : M → (ι → Bool) and a uniformly random message, the error probability of nearest codeword decoding averages at most T + (|M| - 1) |B(n, r)| / 2 ^ n, where T is the probability that more than r bits flip. The decoder D E may depend on the codebook.

theorem Cslib.BitString.exists_pos_forall_exists_code_decodingError_le_exp (p : ↑unitInterval) (hp : ↑p < 1 / 2) {R : ℝ} (hR : R < 1 - Real.binEntropy ↑p / Real.log 2) :
∃ δ > 0, ∀ (n : ℕ), ∃ (E : Fin (2 ^ ⌈R * ↑n⌉₊) → BitString n), ∀ (D : (Fin n → Bool) → Fin (2 ^ ⌈R * ↑n⌉₊)), IsNearestDecoder E D → ∀ (k : Fin (2 ^ ⌈R * ↑n⌉₊)), decodingError p E D k ≤ 10 * Real.exp (-(δ * ↑n))

Shannon's noisy-channel coding theorem for the binary symmetric channel, achievability Shannon, Theorem 11 Guruswami, Rudra and Sudan, Theorem 6.3.1(1): let 0 ≤ p < 1 / 2 and let R be a rate below the capacity 1 - h₂(p), where h₂(p) = Real.binEntropy p / log 2 is the binary entropy in bits. There is δ > 0 such that for every length n some code with 2 ^ ⌈R n⌉₊ codewords of length n has maximal error probability at most 10 exp (-δ n) under every nearest-codeword (maximum-likelihood) decoder.

theorem Cslib.BitString.exists_pos_forall_exists_isNearestDecoder_decodingError_le_exp (p : ↑unitInterval) (hp : ↑p < 1 / 2) {R : ℝ} (hR : R < 1 - Real.binEntropy ↑p / Real.log 2) :
∃ δ > 0, ∀ (n : ℕ), ∃ (E : Fin (2 ^ ⌈R * ↑n⌉₊) → BitString n) (D : BitString n → Fin (2 ^ ⌈R * ↑n⌉₊)), IsNearestDecoder E D ∧ ∀ (k : Fin (2 ^ ⌈R * ↑n⌉₊)), decodingError p E D k ≤ 10 * Real.exp (-(δ * ↑n))

Shannon's noisy-channel coding theorem for the binary symmetric channel, achievability, in the encoder–decoder form of Guruswami, Rudra and Sudan, Theorem 6.3.1(1): for 0 ≤ p < 1 / 2 and every rate R < 1 - h₂(p) there is δ > 0 such that for every length n some encoder E with 2 ^ ⌈R n⌉₊ codewords and a nearest-codeword decoder D for it have maximal error probability at most 10 exp (-δ n).

theorem Cslib.BitString.eventually_exists_code_decodingError_le (p : ↑unitInterval) (hp : ↑p < 1 / 2) {R : ℝ} (hR : R < 1 - Real.binEntropy ↑p / Real.log 2) {ε : ℝ} (hε : 0 < ε) :
∀ᶠ (n : ℕ) in Filter.atTop, ∃ (E : Fin (2 ^ ⌈R * ↑n⌉₊) → BitString n), ∀ (D : (Fin n → Bool) → Fin (2 ^ ⌈R * ↑n⌉₊)), IsNearestDecoder E D → ∀ (k : Fin (2 ^ ⌈R * ↑n⌉₊)), decodingError p E D k ≤ ε

Shannon's noisy-channel coding theorem for the binary symmetric channel, achievability, in its asymptotic form: for 0 ≤ p < 1 / 2, every rate R < 1 - h₂(p) and every ε > 0, for all sufficiently large n some code with 2 ^ ⌈R n⌉₊ codewords of length n has maximal error probability at most ε under every nearest-codeword decoder.