Kleene's first model relative to an oracle #
For a total oracle f : ℕ → ℕ, the pca K₁ᶠ on ℕ applies e to n by evaluating the oracle
code with index e at n relative to f: e ⬝ n = eval f (ofNat Nat.RecursiveIn.Code e) n.
It is built by PartialCombinatoryAlgebra.ofSmn from the oracle-uniform s-m-n theorem
(Nat.RecursiveIn.Code.curry) and the universal oracle code
(Nat.RecursiveIn.Code.exists_universal).
The combinators do not depend on the oracle (kleeneOneRel_k, kleeneOneRel_s): k and s are
indices of oracle codes that run the same program against every oracle, so a realizer built from
them in K₁ᶠ is the same number for every f.
Main definitions #
Cslib.PartialCombinatoryAlgebra.kleeneOneRel: Kleene's first model relative to a total oracle.
Main results #
Cslib.PartialCombinatoryAlgebra.kleeneOneRel_app: application is evaluation of oracle codes.Cslib.PartialCombinatoryAlgebra.kleeneOneRel_k,Cslib.PartialCombinatoryAlgebra.kleeneOneRel_s: the combinators are the same for all oracles.
Implementation notes #
The oracle is total because the construction uses the universal code for total oracles,
Nat.RecursiveIn.Code.exists_universal. The universal code for partial oracles,
Nat.RecursiveIn.Code.exists_universal_partial, would allow partial oracles. Mathlib's
numbering of Nat.Partrec.Code and the numbering of Nat.RecursiveIn.Code differ (the latter has
the extra atomic code oracle), so K₁ = kleeneOne is not literally K₁ᶠ for a computable f.
References #
- J. van Oosten, Realizability: An Introduction to its Categorical Side, Chapter 1 (relativized Kleene's first model; the section number is to be checked).
Kleene's first model relative to the total oracle f: the pca on ℕ in which e ⬝ n is
the value at n of the oracle code with index e, evaluated relative to f.
Application in K₁ᶠ is evaluation of oracle codes relative to f.
The combinator k of K₁ᶠ does not depend on the oracle.
The combinator s of K₁ᶠ does not depend on the oracle.