InformationTheory.Shannon.Huffman.KraftSum
Kraft inequality for Huffman code lengths #
The Kraft sum of the Huffman codeword-length function equals 1 exactly, hence the lengths
satisfy the binary Kraft inequality and a prefix-free code realising them exists. The auxiliary
constancy lemma huffmanLengthAux_const_on_group (depth is constant on each group) is shared with
the cost-level recurrence in ExpectedLength.
Main statements #
huffmanLength_kraft_eq_one— the Kraft sum equals1exactly.huffmanLength_kraft_le_one— the Kraft inequality holds.exists_huffman_prefix_code— a prefix-free binary code of the Huffman lengths exists.
Kraft inequality: auxiliary lemmas (constancy and invariants) #
InformationTheory.Shannon.Huffman.huffmanLengthAux_const_on_group
sourceUsed by
InformationTheory.Shannon.Huffman.kraftPerGroup
sourcePer-group Kraft sum: ∑_p (∑_{a ∈ p.1} 2^(-huffmanLengthAux s a)) / p.1.card.
By huffmanLengthAux_const_on_group this equals ∑_p 2^(-depth(p)).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Used by
InformationTheory.Shannon.Huffman.kraftPerGroup_eq_card_of_base
sourceUsed by
InformationTheory.Shannon.Huffman.huffmanStep_orig_decomp
sourceUsed by
InformationTheory.Shannon.Huffman.huffmanLengthAux_step_merged
sourcehuffmanLengthAux s a = huffmanLengthAux s'' a + 1 for a ∈ x1.1 ∪ x2.1.
Used by
InformationTheory.Shannon.Huffman.huffmanLengthAux_step_other
sourcehuffmanLengthAux s a = huffmanLengthAux s'' a for a ∉ x1.1 ∪ x2.1.
Used by
InformationTheory.Shannon.Huffman.huffmanLengthAux_step_eq_on_other_group
sourceUsed by
InformationTheory.Shannon.Huffman.kraftPerGroup_step
sourceUsed by
InformationTheory.Shannon.Huffman.kraftPerGroup_eq_one
sourceUsed by
InformationTheory.Shannon.Huffman.kraftPerGroup_initMultiset_eq_kraft
sourceUsed by
InformationTheory.Shannon.Huffman.huffmanLength_kraft_eq_one
sourceThe Kraft sum of huffmanLength P equals 1.
Used by
InformationTheory.Shannon.Huffman.huffmanLength_kraft_le_one
sourcehuffmanLength P satisfies the binary Kraft inequality (in fact with equality).
Used by
InformationTheory.Shannon.Huffman.exists_huffman_prefix_code
sourceA prefix-free binary code realising the huffmanLength P exists.