Lemma 2.3 (Kraft), second statement — lengths satisfying are realized by an instantaneous code
ProvedFuchsThesis.Coding.lemma_2_3_existenceinformation-theoryp2o-gran-per-chapterp2o-plan-bookp2o-strengthenedp2o-v1source-coding
Let be messages and let be integers satisfying the Kraft inequality
Then there is a binary instantaneous (prefix-free) code for whose codeword for has length exactly , for every .
Together with the first statement of Lemma 2.3 (every instantaneous code satisfies the Kraft inequality), this characterizes the length profiles of instantaneous codes. It is what turns the lengths of (2.141) into an actual code in the proof of the upper bound of Theorem 2.8.
Note that the inequality forces every (a single term with already exceeds ), and is possible only for a single message, whose codeword is then empty.
Differences from the source:
- generalization: integers listed in increasing order → any family of integers indexed by the messages, in no order; reason: the order is only a labelling, and every family can be relabelled increasingly, so the statement specializes to the source's.
- encoding: messages → an arbitrary finite type; reason: Lean convention, every finite type is a relabelling of .
Preamble
import Mathlib import Definitions.Def_FuchsThesis_Coding_IsInstantaneous
Formal statement
namespace FuchsThesis.Coding
/-- Fuchs, *Distinguishability and Accessible Information in Quantum Theory*,
arXiv:quant-ph/9601020v1, Lemma 2.3 (Kraft), second statement, p.37 (PDF p.46): "for any set of
integers `k₁ ≤ k₂ ≤ ⋯ ≤ kₙ` satisfying this inequality [`∑ 2^{−kᵢ} ≤ 1`, (2.134)], there exists a
instantaneous code with these as codeword lengths."
**Formalization Note.** The messages form an arbitrary finite type `ι` and the integers are a
family `k : ι → ℤ`; no ordering is imposed (the source's `k₁ ≤ ⋯ ≤ kₙ` is a labelling, and every
family can be relabelled in increasing order). The Kraft sum is taken in `ℝ` with integer powers
`2 ^ (−kᵢ)`. Negative integers are not excluded by hypothesis: a single term with `kᵢ < 0` already
exceeds `1`. A zero length is allowed (the empty codeword, possible only when `ι` has one
element). -/
theorem lemma_2_3_existence {ι : Type*} [Fintype ι] (k : ι → ℤ)
(hK : ∑ i, (2 : ℝ) ^ (-(k i)) ≤ 1) :
∃ c : ι → List Bool, IsInstantaneous c ∧ ∀ i, ((c i).length : ℤ) = k i := by sorry
end FuchsThesis.Coding
Source
Fuchs, Distinguishability and Accessible Information in Quantum Theory, arXiv:quant-ph/9601020v1, Lemma 2.3 (Kraft), second statement, p.37 (PDF p.46); proof on p.39 (PDF p.48)
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.