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.

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

    An encoding plus a guarantee of finiteness of the alphabet.

    Instances For
      instance Computability.Γ.fintype {α : Type u} (e : FinEncoding α) :
      Equations

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

        Instances For

          The natural inclusion of bool in Γ'.

          Equations
            Instances For

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

              Equations
                Instances For

                  An encoding function of the positive binary numbers in bool.

                  Equations
                    Instances For

                      An encoding function of the binary numbers in bool.

                      Equations
                        Instances For

                          An encoding function of ℕ in bool.

                          Equations
                            Instances For

                              A decoding function from List Bool to the positive binary numbers.

                              Equations
                                Instances For

                                  A decoding function from List Bool to the binary numbers.

                                  Equations
                                    Instances For

                                      A decoding function from List Bool to ℕ.

                                      Equations
                                        Instances For

                                          A binary encoding of ℕ in bool.

                                          Equations
                                            Instances For

                                              A binary fin_encoding of ℕ in bool.

                                              Equations
                                                Instances For

                                                  A binary encoding of ℕ in Γ'.

                                                  Equations
                                                    Instances For

                                                      A binary FinEncoding of ℕ in Γ'.

                                                      Equations
                                                        Instances For

                                                          A unary encoding function of ℕ in bool.

                                                          Equations
                                                            Instances For

                                                              A unary decoding function from List Bool to ℕ.

                                                              Equations
                                                                Instances For

                                                                  A unary fin_encoding of ℕ.

                                                                  Equations
                                                                    Instances For

                                                                      An encoding function of bool in bool.

                                                                      Equations
                                                                        Instances For

                                                                          A decoding function from List Bool to bool.

                                                                          Equations
                                                                            Instances For

                                                                              A fin_encoding of bool in bool.

                                                                              Equations
                                                                                Instances For