Documentation

Mathlib.InformationTheory.Coding.UniquelyDecodable

Uniquely Decodable Codes #

This file defines uniquely decodable codes and proves basic properties.

Main definitions #

Main results #

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

Equations
Instances For
    @[deprecated InformationTheory.IsUniquelyDecodable (since := "2026-08-16")]

    Alias of InformationTheory.IsUniquelyDecodable.


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

    Equations
    Instances For

      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.

      @[deprecated InformationTheory.IsUniquelyDecodable.epsilon_not_mem (since := "2026-08-16")]

      Alias of InformationTheory.IsUniquelyDecodable.epsilon_not_mem.


      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 {α : Type u_1} {S : Set (List α)} (h : IsUniquelyDecodable S) :
      Function.Injective fun (L : { L : List (List α) // ∀ (x : List α), x Lx S }) => (↑L).flatten
      @[deprecated InformationTheory.IsUniquelyDecodable.flatten_injective (since := "2026-08-16")]
      theorem InformationTheory.UniquelyDecodable.flatten_injective {α : Type u_1} {S : Set (List α)} (h : IsUniquelyDecodable S) :
      Function.Injective fun (L : { L : List (List α) // ∀ (x : List α), x Lx S }) => (↑L).flatten

      Alias of InformationTheory.IsUniquelyDecodable.flatten_injective.