The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V21. Dynamics, ergodic theory and information theory

Mathlib.InformationTheory.Coding.UniquelyDecodable

3 declarations and 4 deprecated aliases. Mathlib docs · Source

Uniquely Decodable Codes

This file defines uniquely decodable codes and proves basic properties.

Main definitions

  • IsUniquelyDecodable: A set of codewords is uniquely decodable if distinct concatenations of codewords yield distinct strings.

Main results

  • IsUniquelyDecodable.epsilon_notMem: Uniquely decodable codes cannot contain the empty string.
  • IsUniquelyDecodable.flatten_injective: The flatten function is injective on lists of codewords from a uniquely decodable code.

def InformationTheory.IsUniquelyDecodable E3 #

{α : Type u_1} → Set (List α) → Prop

A set of lists is uniquely decodable if distinct concatenations yield distinct strings.

theorem InformationTheory.IsUniquelyDecodable.epsilon_notMem E3 #

∀ {α : Type u_1} {S : Set (List α)}, InformationTheory.IsUniquelyDecodable S → [] ∉ S

If a code is uniquely decodable, it does not contain the empty string.

The empty string can be "decoded" as either zero or two copies of itself, violating unique decodability.

theorem InformationTheory.IsUniquelyDecodable.flatten_injective E3 #

∀ {α : Type u_1} {S : Set (List α)}, InformationTheory.IsUniquelyDecodable S → Function.Injective fun L ↦ (↑L).flatten

Deprecated aliases

NameNew nameSince
InformationTheory.IsUniquelyDecodable.epsilon_not_memInformationTheory.IsUniquelyDecodable.epsilon_notMem2026-09-28
InformationTheory.UniquelyDecodableInformationTheory.IsUniquelyDecodable2026-08-16
InformationTheory.UniquelyDecodable.epsilon_not_memInformationTheory.IsUniquelyDecodable.epsilon_notMem2026-08-16
InformationTheory.UniquelyDecodable.flatten_injectiveInformationTheory.IsUniquelyDecodable.flatten_injective2026-08-16