Documentation

LeanPool.Computability.TuringDegree

Turing Reducibility and Turing Degrees #

This file defines Turing reducibility and Turing equivalence in terms of oracle computability, as well as the notion of Turing degrees as equivalence classes under mutual reducibility.

Main Definitions #

Notation #

Implementation Notes #

We define TuringDegree as the Antisymmetrization of the preorder of partial functions under Turing reducibility. This gives a concrete representation of degrees as equivalence classes.

References #

Tags #

Computability, Turing Degrees, Reducibility, Equivalence Relation

@[reducible, inline]

f is Turing reducible to g if f is partial recursive given access to the oracle g

Equations
Instances For
    @[reducible, inline]

    f is Turing equivalent to g if f is reducible to g and g is reducible to f.

    Equations
    Instances For

      f is Turing reducible to g if f is partial recursive given access to the oracle g

      Equations
      Instances For

        f is Turing equivalent to g if f is reducible to g and g is reducible to f.

        Equations
        Instances For

          Instance declaring that RecursiveIn is a preorder.

          @[reducible, inline]

          Turing degrees are the equivalence classes of partial functions under Turing equivalence.

          Equations
          Instances For

            Turing join on partial functions #

            We define the join (f ⊕ g) by coding answers from f as even numbers and answers from g as odd numbers:

            The Turing join f ⊕ g: answers from f are coded as even numbers and answers from g as odd numbers.

            Equations
            Instances For

              The Turing join f ⊕ g: answers from f are coded as even numbers and answers from g as odd numbers.

              Equations
              Instances For
                @[simp]
                theorem Computability.turingJoin_even (f g : →. ) (n : ) :
                (f g) (2 * n) = Part.map (fun (y : ) => 2 * y) (f n)
                @[simp]
                theorem Computability.turingJoin_odd (f g : →. ) (n : ) :
                (f g) (2 * n + 1) = Part.map (fun (y : ) => 2 * y + 1) (g n)
                theorem Computability.RecursiveIn_cond_const {O : Set ( →. )} {c : Bool} {f : →. } (hc : Computable c) (hf : RecursiveIn O f) (k : ) :
                RecursiveIn O fun (n : ) => bif c n then f n else Part.some k

                The equality test on pairs: returns 0 if the two components are equal and 1 otherwise.

                Equations
                Instances For
                  theorem Computability.eq01_rfind_some (n : ) :
                  (Nat.rfind fun (k : ) => (fun (m : ) => decide (m = 0)) <$> (Nat.pair <$> Part.some n <*> Part.some k >>= eq01)) = Part.some n
                  theorem Computability.eq01_rfind (v : Part ) :
                  (Nat.rfind fun (k : ) => (fun (m : ) => decide (m = 0)) <$> (Nat.pair <$> v <*> Part.some k >>= eq01)) = v
                  theorem Computability.RecursiveIn_cond_core_rfind {O : Set ( →. )} {c : Bool} {f g : →. } (hc : Computable c) (hf : RecursiveIn O f) (hg : RecursiveIn O g) :
                  ∃ (cmp : →. ), RecursiveIn O cmp (fun (n : ) => Nat.rfind fun (k : ) => (fun (m : ) => decide (m = 0)) <$> cmp (Nat.pair n k)) = fun (n : ) => bif c n then f n else g n
                  theorem Computability.RecursiveIn_cond {O : Set ( →. )} {c : Bool} {f g : →. } (hc : Computable c) (hf : RecursiveIn O f) (hg : RecursiveIn O g) :
                  RecursiveIn O fun (n : ) => bif c n then f n else g n

                  Semilattice Structure on Turing Degrees #

                  We show that turingJoin respects Turing equivalence and lifts to a supremum operation on TuringDegree, making it a SemilatticeSup.

                  theorem Computability.TuringDegree.join_mono {f f' g g' : →. } (hf : TuringReducible f f') (hg : TuringReducible g g') :
                  TuringReducible (f g) (f' g')

                  The Turing join respects Turing reducibility: if f ≤ᵀ f' and g ≤ᵀ g', then f ⊕ g ≤ᵀ f' ⊕ g'.

                  theorem Computability.TuringDegree.join_congr {f f' g g' : →. } (hf : TuringEquivalent f f') (hg : TuringEquivalent g g') :
                  TuringEquivalent (f g) (f' g')

                  The Turing join respects Turing equivalence.

                  theorem Computability.TuringDegree.sup_le {a b c : TuringDegree} (ha : a c) (hb : b c) :
                  a.sup b c
                  @[implicit_reducible]
                  Equations
                  • One or more equations did not get rendered due to their size.
                  @[simp]

                  The sup on Turing degrees agrees with the Turing join on representatives.