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
fin_encoding_nat_bool
: a binary encoding of ℕ in a simple alphabet.fin_encoding_nat_Γ'
: a binary encoding of ℕ in the alphabet used for TM's.unary_fin_encoding_nat
: a unary encoding of ℕfin_encoding_bool_bool
: an encoding of bool.
- to_encoding : computability.encoding α
- Γ_fin : fintype c.to_encoding.Γ
An encoding plus a guarantee of finiteness of the alphabet.
- blank : computability.Γ'
- bit : bool → computability.Γ'
- bra : computability.Γ'
- ket : computability.Γ'
- comma : computability.Γ'
A standard Turing machine alphabet, consisting of blank,bit0,bit1,bra,ket,comma.
Equations
The natural inclusion of bool in Γ'.
An arbitrary section of the natural inclusion of bool in Γ'.
Equations
- computability.section_Γ'_bool computability.Γ'.comma = arbitrary bool
- computability.section_Γ'_bool computability.Γ'.ket = arbitrary bool
- computability.section_Γ'_bool computability.Γ'.bra = arbitrary bool
- computability.section_Γ'_bool (computability.Γ'.bit b) = b
- computability.section_Γ'_bool computability.Γ'.blank = arbitrary bool
An encoding function of the positive binary numbers in bool.
An encoding function of the binary numbers in bool.
An encoding function of ℕ in bool.
Equations
A decoding function from list bool
to ℕ.
Equations
- computability.decode_nat = λ (l : list bool), ↑(computability.decode_num l)
A binary encoding of ℕ in bool.
Equations
- computability.encoding_nat_bool = {Γ := bool, encode := computability.encode_nat, decode := λ (n : list bool), some (computability.decode_nat n), decode_encode := computability.encoding_nat_bool._proof_1}
A binary fin_encoding of ℕ in bool.
A binary encoding of ℕ in Γ'.
Equations
- computability.encoding_nat_Γ' = {Γ := computability.Γ', encode := λ (x : ℕ), list.map computability.inclusion_bool_Γ' (computability.encode_nat x), decode := λ (x : list computability.Γ'), some (computability.decode_nat (list.map computability.section_Γ'_bool x)), decode_encode := computability.encoding_nat_Γ'._proof_1}
A binary fin_encoding of ℕ in Γ'.
A unary encoding function of ℕ in bool.
Equations
A unary fin_encoding of ℕ.
Equations
- computability.unary_fin_encoding_nat = {to_encoding := {Γ := bool, encode := computability.unary_encode_nat, decode := λ (n : list bool), some (computability.unary_decode_nat n), decode_encode := computability.unary_fin_encoding_nat._proof_1}, Γ_fin := bool.fintype}
An encoding function of bool in bool.
Equations
A fin_encoding of bool in bool.
Equations
- computability.fin_encoding_bool_bool = {to_encoding := {Γ := bool, encode := computability.encode_bool, decode := λ (x : list bool), some (computability.decode_bool x), decode_encode := computability.fin_encoding_bool_bool._proof_1}, Γ_fin := bool.fintype}