Documentation

CslibFrontier.Foundations.Data.Code.RadialDecoding

Deterministic decoding ties under radial noise #

A uniform message is encoded and corrupted by independent additive binary noise. If the noise mass depends only on its Hamming weight, every nearest message has the same joint mass with a fixed received word. Consequently any deterministic nearest decoder succeeds with probability 1 / |T(y)|, conditional on receiving y and the sent message belonging to the tie set T(y). The joint-mass identity is valid even when that conditioning event has probability zero.

Messages are indexed by a finite type M. For a finite code C, take M = C and the subtype inclusion as encoder. More generally an injective encoder identifies uniform messages with uniform codewords; injectivity is not needed for the message-count formulation proved here.

This is the deterministic part of HQC v5.1, §6.1.5, Lemma 6.2 (p. 60). The radial-noise premise is explicit. No property of actual HQC noise, Reed–Solomon block independence, concrete decoder, decoding-failure rate or cryptographic security is established here.

Main definitions #

Main results #

References #

def Cslib.BitString.IsRadial {ι : Type} [Fintype ι] (ν : PMF (ι → Bool)) :

The noise mass depends only on its Hamming weight. This does not assert independence of individual noise coordinates.

noncomputable def Cslib.BitString.additiveNoiseJoint {ι M : Type} (E : M → ι → Bool) (prior : PMF M) (ν : PMF (ι → Bool)) :
PMF ((ι → Bool) × M)

Independently draw a message and a noise vector, returning the received word together with its transmitted message. The first marginal is the received-word law.

theorem Cslib.BitString.additiveNoiseJoint_apply {ι M : Type} (E : M → ι → Bool) (prior : PMF M) (ν : PMF (ι → Bool)) (y : ι → Bool) (m : M) :
(additiveNoiseJoint E prior ν) (y, m) = prior m * ν (E m + y)

The joint mass factors as prior times the mass of the unique compatible noise vector.

theorem Cslib.BitString.additiveNoiseJoint_eq_of_mem_nearestMessages {ι M : Type} [Fintype ι] [Fintype M] [Nonempty M] (E : M → ι → Bool) {ν : PMF (ι → Bool)} (hν : IsRadial ν) (y : ι → Bool) {m m' : M} (hm : m ∈ nearestMessages E y) (hm' : m' ∈ nearestMessages E y) :

Under a uniform prior, radial noise assigns equal joint masses to nearest messages.

theorem Cslib.BitString.nearestMessages_event_eq_sum {ι M : Type} [Fintype ι] [Fintype M] (E : M → ι → Bool) (prior : PMF M) (ν : PMF (ι → Bool)) (y : ι → Bool) :
(additiveNoiseJoint E prior ν).toOuterMeasure {p : (ι → Bool) × M | p.1 = y ∧ p.2 ∈ nearestMessages E y} = ∑ m ∈ nearestMessages E y, (additiveNoiseJoint E prior ν) (y, m)

The nearest-message event at a fixed received word is the sum of its joint masses.

theorem Cslib.BitString.nearestMessages_card_mul_joint {ι M : Type} [Fintype ι] [Fintype M] [Nonempty M] (E : M → ι → Bool) {D : (ι → Bool) → M} (hD : IsNearestDecoder E D) {ν : PMF (ι → Bool)} (hν : IsRadial ν) (y : ι → Bool) :

The null-event-safe tie law. The number of nearest messages times the joint success mass is the probability of receiving y with the transmitted message among the nearest ones. In particular this identity does not divide by a possibly zero event probability.

theorem Cslib.BitString.nearestMessages_conditional_success {ι M : Type} [Fintype ι] [Fintype M] [Nonempty M] (E : M → ι → Bool) {D : (ι → Bool) → M} (hD : IsNearestDecoder E D) {ν : PMF (ι → Bool)} (hν : IsRadial ν) (y : ι → Bool) (hpos : (additiveNoiseJoint E (Probability.PMF.uniformOfFintype M) ν).toOuterMeasure {p : (ι → Bool) × M | p.1 = y ∧ p.2 ∈ nearestMessages E y} ≠ 0) :

At a positive-probability tie event, the conditional success probability is the reciprocal of the number of nearest messages. The numerator is the joint event Y = y and D(y) = m; because the decoder returns a nearest message, success implies membership in the tie set.

theorem Cslib.BitString.twoWayTie_failure_eq_half {ι M : Type} [Fintype ι] [Fintype M] [Nonempty M] (E : M → ι → Bool) {D : (ι → Bool) → M} (hD : IsNearestDecoder E D) {ν : PMF (ι → Bool)} (hν : IsRadial ν) (r : ℕ) :

Two-way ties cause exactly half errors at each noise weight. The noise vector is recovered from the joint outcome as E m + y. No positive-mass premise is needed.