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
      @[implicit_reducible]
      instance Computability.Γ.fintype {α : Type u} (e : FinEncoding α) :
      Equations

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

      Instances For
        def Computability.instDecidableEqΓ'.decEq (x✝ x✝¹ : Γ') :
        Decidable (x✝ = x✝¹)
        Equations
        Instances For

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

          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 binary numbers.

                Equations
                Instances For

                  A decoding function from List Bool to .

                  Equations
                  Instances For

                    A binary Encoding of in Bool.

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

                      A binary Encoding of in Γ'.

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

                        A unary decoding function from List Bool to .

                        Equations
                        Instances For

                          A unary FinEncoding of in Bool.

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

                            An encoding function of Bool in Bool.

                            Equations
                            Instances For

                              A decoding function from List Bool to Bool.

                              Equations
                              Instances For

                                A FinEncoding of Bool in Bool.

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

                                  A FinEncoding of a List α in (finite) alphabet α, encoded directly.

                                  Equations
                                  Instances For
                                    def Computability.finEncodingPair {α : Type u_1} {β : Type u_2} (ea : FinEncoding α) (eb : FinEncoding β) :
                                    FinEncoding (α × β)

                                    Given FinEncoding of α and β, constructs a FinEncoding of α × β by concatenating the encodings, mapping the symbols from the first encoding with Sum.inl and those from the second with Sum.inr.

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