Primitive recursive evaluator for oracle computations #
This file proves that structural recursion on Nat.RecursiveIn.Code (Code.primrec_recOn',
Code.primrec_recOn) and the stage-bounded oracle evaluator Nat.RecursiveIn.Code.evaln
(Code.primrec_evaln) are primitive recursive.
It adapts the strong-recursion table argument of Mathlib/Computability/PartrecCode.lean
(Apache 2.0, by Mario Carneiro) from Nat.Partrec.Code to Nat.RecursiveIn.Code. Relative to
that proof, Code.primrec_recOn' adds the oracle constructor at Gödel number 4 (shifting the
composite constructors to n + 5), and G carries the finite oracle prefix σ : List ℕ as an
extra parameter of the strong recursion so that the oracle branch looks up σ[n]?.
Main results #
Nat.RecursiveIn.Code.encodeCode_lt_pair,Nat.RecursiveIn.Code.encodeCode_lt_comp,Nat.RecursiveIn.Code.encodeCode_lt_prec,Nat.RecursiveIn.Code.encodeCode_lt_rfind': code encodings of immediate subcodes are strictly smaller than those of the composite code.Nat.RecursiveIn.Code.primrec_recOn',Nat.RecursiveIn.Code.primrec_recOn: structural recursion onNat.RecursiveIn.Codeis primitive recursive.Nat.RecursiveIn.Code.primrec_evaln: stage-bounded oracle evaluationCode.evalnis primitive recursive in(σ, (k, c), n).
References #
- Adapted from
Mathlib/Computability/PartrecCode.lean(Apache 2.0, by Mario Carneiro). - S. C. Kleene and E. L. Post, The upper semi-lattice of degrees of recursive unsolvability
- R. I. Soare, Recursively Enumerable Sets and Degrees
The subcodes of Code.pair cf cg have strictly smaller Gödel numbers than pair cf cg.
The subcodes of Code.comp cf cg have strictly smaller Gödel numbers than comp cf cg.
The subcodes of Code.prec cf cg have strictly smaller Gödel numbers than prec cf cg.
The subcode of Code.rfind' cf has a strictly smaller Gödel number than rfind' cf.
Structural recursion on Nat.RecursiveIn.Code with tupled branch functions is primitive
recursive. Adapted from Nat.Partrec.Code.primrec_recOn' with an additional oracle branch.
Structural recursion on Nat.RecursiveIn.Code with curried branch functions is primitive
recursive. Adapted from Nat.Partrec.Code.primrec_recOn with an additional oracle branch.