Documentation

Mathlib.Computability.Encoding

Encodings #

This file contains the definition of a (finite) encoding, a map from a type to strings in an alphabet, used in defining computability by Turing machines. It also contains several examples:

Examples #

structure Computability.Encoding (α : Type u) :
Type (max u (v + 1))

An encoding of a type in a certain alphabet, together with a decoding.

  • Γ : Type v

    The alphabet of the encoding

  • encode : αList self.Γ

    The encoding function

  • decode : List self.ΓOption α

    The decoding function

  • decode_encode (x : α) : self.decode (self.encode x) = some x

    Decoding and encoding are inverses of each other.

structure Computability.FinEncoding (α : Type u) extends Computability.Encoding α :
Type (max 1 u)

An encoding plus a guarantee of finiteness of the alphabet.

A standard Turing machine alphabet, consisting of blank,bit0,bit1,bra,ket,comma.

An arbitrary section of the natural inclusion of bool in Γ'.

Equations
@[deprecated Computability.sectionΓ'Bool_inclusionBoolΓ' (since := "2025-01-21")]

An encoding function of ℕ in bool.

Equations

A decoding function from List Bool to the binary numbers.

Equations

A decoding function from List Bool to ℕ.

Equations

A binary encoding of ℕ in bool.

Equations
  • One or more equations did not get rendered due to their size.

A binary encoding of ℕ in Γ'.

Equations
  • One or more equations did not get rendered due to their size.

A unary decoding function from List Bool to ℕ.

Equations

A unary fin_encoding of ℕ.

Equations
  • One or more equations did not get rendered due to their size.

An encoding function of bool in bool.

Equations

A decoding function from List Bool to bool.

Equations

A fin_encoding of bool in bool.

Equations
  • One or more equations did not get rendered due to their size.