Oracle computability #
This file defines oracle computability using partial recursive functions.
Main definitions #
Nat.RecursiveIn O f: A partial functionf : ℕ →. ℕis partial recursive given access to oracles in the setO.RecursiveIn O f: LiftsNat.RecursiveInto partial functions betweenPrimcodabletypes.ComputableIn O f: A total functionf : α → σis computable given access to oracles inO.
Main results #
Nat.Partrec.recursiveIn: Every partial recursive function is recursive in any oracle set.partrec_iff_forall_recursiveIn_singleton: A function is partial recursive iff it is recursive in every singleton oracle set.recursiveIn_empty_iff: Being recursive in the empty set is equivalent to being partial recursive.RecursiveIn.mono: Monotonicity ofRecursiveInwith respect to oracle sets.
Implementation notes #
The type of partial functions recursive in a set of oracles O is the smallest type containing
the constant zero, the successor, left and right projections, each oracle g ∈ O,
and is closed under pairing, composition, primitive recursion, and μ-recursion.
References #
Tags #
Computability, Oracle, Turing Degrees, Reducibility, Equivalence Relation
The type of partial functions recursive in a set of oracles O is the smallest type containing
the constant zero, the successor, left and right projections, each oracle g ∈ O,
and is closed under pairing, composition, primitive recursion, and μ-recursion.
- zero {O : Set (ℕ →. ℕ)} : Nat.RecursiveIn O fun (x : ℕ) => 0
- succ {O : Set (ℕ →. ℕ)} : Nat.RecursiveIn O ↑Nat.succ
- left {O : Set (ℕ →. ℕ)} : Nat.RecursiveIn O fun (n : ℕ) => ↑(some (unpair n).1)
- right {O : Set (ℕ →. ℕ)} : Nat.RecursiveIn O fun (n : ℕ) => ↑(some (unpair n).2)
- oracle {O : Set (ℕ →. ℕ)} (g : ℕ →. ℕ) : g ∈ O → Nat.RecursiveIn O g
- pair {O : Set (ℕ →. ℕ)} {f h : ℕ →. ℕ} (hf : Nat.RecursiveIn O f) (hh : Nat.RecursiveIn O h) : Nat.RecursiveIn O fun (n : ℕ) => Nat.pair <$> f n <*> h n
- comp {O : Set (ℕ →. ℕ)} {f h : ℕ →. ℕ} (hf : Nat.RecursiveIn O f) (hh : Nat.RecursiveIn O h) : Nat.RecursiveIn O fun (n : ℕ) => h n >>= f
- prec {O : Set (ℕ →. ℕ)} {f h : ℕ →. ℕ} (hf : Nat.RecursiveIn O f) (hh : Nat.RecursiveIn O h) : Nat.RecursiveIn O fun (p : ℕ) => match unpair p with | (a, n) => Nat.rec (f a) (fun (y : ℕ) (IH : Part ℕ) => do let i ← IH h (Nat.pair a (Nat.pair y i))) n
- rfind {O : Set (ℕ →. ℕ)} {f : ℕ →. ℕ} (hf : Nat.RecursiveIn O f) : Nat.RecursiveIn O fun (a : ℕ) => Nat.rfind fun (n : ℕ) => (fun (m : ℕ) => decide (m = 0)) <$> f (Nat.pair a n)
Instances For
A partial function f : α →. σ between Primcodable types is recursive in a set of oracles
O if its encoding as a function ℕ →. ℕ is Nat.RecursiveIn O.
Equations
- RecursiveIn O f = Nat.RecursiveIn O fun (n : ℕ) => (↑(Encodable.decode n)).bind fun (a : α) => Part.map Encodable.encode (f a)
Instances For
A binary partial function is recursive in O if the curried form is.
Equations
- RecursiveIn₂ O f = RecursiveIn O fun (p : α × β) => f p.1 p.2
Instances For
A total function is computable in O if its constant lift is recursive in O.
Equations
- ComputableIn O f = RecursiveIn O fun (a : α) => Part.some (f a)
Instances For
A binary total function is computable in O.
Equations
- ComputableIn₂ O f = ComputableIn O fun (p : α × β) => f p.1 p.2
Instances For
If every element of O is Nat.RecursiveIn O', then any function which is
Nat.RecursiveIn O is also Nat.RecursiveIn O'.
If every function in O is partial recursive,
then a function which is Nat.RecursiveIn O is also partial recursive.
If a function is partial recursive, then it is recursive in every partial function.
If a partial function is partial recursive, then it is RecursiveIn any oracle set.
If every element of O is RecursiveIn O', then any function which is
RecursiveIn O is also RecursiveIn O'.
Monotonicity of RecursiveIn with respect to oracle sets.
If every function in O is partial recursive,
then a function which is RecursiveIn O is also partial recursive.
If a function is recursive in a constant partial function, then it is partial recursive.
A partial function f is partial recursive if and only if it is recursive in
every partial function g.