Type-2 computability on Baire space #
A partial map F : (ℕ → ℕ) →. (ℕ → ℕ) on Baire space is computable relative to the oracle p
when one oracle code c computes every output entry from the join of p with the input:
(F x) n = Φ_c^{p ⊕ x}(n) for every x in the domain of F and every n
(Nat.RecursiveIn.Code.ComputesStream). Nothing is required outside the domain. A map is
computable when it is computable relative to the oracle that is constantly 0, that is, relative
to no information (Nat.RecursiveIn.StreamComputable); equivalently, relative to some computable
oracle.
- Composition. If
ccomputesFanddcomputesGrelative top, then the codestreamComp d c = d.subst (join joinLeft c)computesG ∘ Frelative top: it runsdrelative top ⊕ y, whereyis the output ofcrelative top ⊕ x. The map(d, c) ↦ streamComp d cis primitive recursive. Maps computable relative topand toqcompose to a map computable relative top ⊕ q. - Continuity. By the use principle (
Nat.RecursiveIn.Code.exists_cylinder_of_mem_eval_join), a map computable relative to a total oracle is continuous on its domain. Its code computes it on the set of inputs on which the code converges at every entry, a Gδ set that contains the domain. Conversely, one fixed search code computes every partial map that is continuous on its domain relative to an oracle encoding a neighbourhood function restricted to prefixes extended by points of the domain (Nat.RecursiveIn.Code.exists_code_continuous_get), yielding the full characterizationNat.RecursiveIn.continuous_get_iff_streamComputableInand Gδ extensionNat.RecursiveIn.exists_gδ_extension_of_continuous_get. For total maps, this specializes toContinuous F ↔ ∃ p, StreamComputableIn p F. - The effective form. A total map is computable exactly when it has a computable associate
(
Nat.RecursiveIn.Code.IsAssociate). One direction runs the fixed search code ofNat.RecursiveIn.Code.exists_code_isAssociaterelative to the associate; for the other, the associate answers⟨n, σ⟩withv + 1when the stage-|σ|evaluation of the code against the finite oracle prefixσreturnsv.
Main definitions #
Nat.RecursiveIn.Code.ComputesStream: a code computes a partial map relative to an oracle.Nat.RecursiveIn.Code.evalStream: the partial map that a code computes relative to an oracle.Nat.RecursiveIn.Code.streamComp: the code of a composite.Nat.RecursiveIn.StreamComputableIn,Nat.RecursiveIn.StreamComputable: computability of a partial map relative to an oracle, and without one.
Main results #
Nat.RecursiveIn.Code.ComputesStream.comp,Nat.RecursiveIn.Code.primrec₂_streamComp,Nat.RecursiveIn.StreamComputableIn.comp,Nat.RecursiveIn.StreamComputable.comp: closure under composition, with the composite's code a primitive recursive function of the two codes.Nat.RecursiveIn.StreamComputableIn.of_turingReducible: computability relative toppasses to every oracle that computesp.Nat.RecursiveIn.streamComputable_iff_exists_computable: computability without an oracle is computability relative to a computable oracle.Nat.RecursiveIn.Code.continuous_get_iff_forall_exists_cylinder: continuity of a partial map on its domain as local constancy of each output entry on cylinders.Nat.RecursiveIn.Code.exists_code_continuous_get: one fixed code computes every partial map continuous on its domain relative to an oracle encoding it.Nat.RecursiveIn.StreamComputableIn.continuous_get: a map computable relative to a total oracle is continuous on its domain.Nat.RecursiveIn.Code.isGδ_dom_evalStream: the domain ofevalStreamis a Gδ set.Nat.RecursiveIn.continuous_get_iff_streamComputableIn: the continuity theorem for partial maps.Nat.RecursiveIn.exists_gδ_extension_of_continuous_get: every continuous partial map extends to a computable continuous partial map with a Gδ domain.Nat.RecursiveIn.continuous_iff_streamComputableIn: the continuity theorem for total maps.Nat.RecursiveIn.streamComputable_iff_exists_isAssociate: a total map is computable exactly when it has a computable associate.
Implementation notes #
Oracles are partial functions ℕ →. ℕ, as in Nat.RecursiveIn.Code.eval, so that the oracles
of a composite are joined by Partrec.join. The continuity results take a total oracle, since the
use principle Nat.RecursiveIn.Code.exists_use is stated for total oracles. A total map
F : (ℕ → ℕ) → ℕ → ℕ enters through the coercion to (ℕ → ℕ) →. (ℕ → ℕ), and
Nat.RecursiveIn.Code.computesStream_coe_iff turns ComputesStream into the entrywise equations
of RecursiveInContinuous.
The definition is the relative form of the type-2 machines of Weihrauch: a code reads its input through the oracle and produces its output entry by entry, instead of writing an infinite output tape. The associate is Kleene's neighbourhood function in a form that only asks for consistency on prefixes of each input, not monotonicity in the prefix.
References #
- K. Weihrauch, Computable Analysis: An Introduction: background on type-2 machines, composition, and the continuity of computable functions and their domains.
- S. C. Kleene and R. E. Vesley, The Foundations of Intuitionistic Mathematics: background on neighbourhood functions and associates.
- J. van Oosten, Realizability: An Introduction to its Categorical Side: background on Kleene's second model and its computable submodel.
The code c computes the partial map F on Baire space relative to the oracle p: for
every input x in the domain of F, the code run relative to the join p ⊕ x computes the output
F x entry by entry. Outside the domain of F nothing is required.
A code computes the partial map it evaluates to.
A code computing F converges at every entry on the domain of F, so F is a restriction
of evalStream p c.
For a total map, ComputesStream is the entrywise equation of RecursiveInContinuous.
Composition #
The code of the composite of two maps computed relative to the same oracle p: it runs d
relative to p ⊕ y, where y is the output of c relative to p ⊕ x.
The code of the composite is a primitive recursive function of the two codes.
Closure under composition. If c computes F and d computes G relative to p, then
streamComp d c computes G ∘ F relative to p.
Continuity on the domain #
Computable maps are continuous on their domain, entrywise: each output entry is constant on
the inputs of the domain in some cylinder around x.
The domain of a computation is a Gδ set: the inputs on which a code converges at every entry, relative to a total oracle, form a countable intersection of open sets.
Continuous partial maps are computable through one fixed code. A single oracle code e
computes every partial map F on Baire space that is continuous on its domain, relative to the
join of an oracle p encoding F with the input.
Computability relative to an oracle #
The partial map F on Baire space is computable when some code computes it relative to the
oracle that is constantly 0, that is, without oracle information
(streamComputable_iff_exists_computable).
Computability relative to p passes to every oracle q that computes p.
Closure under composition. Maps computable relative to p and to q compose to a map
computable relative to p ⊕ q.
Closure under composition of computable maps.
Computable maps are continuous on their domain. A map computable relative to a total oracle, restricted to its domain, is continuous.
Gδ extension of continuous partial maps. Every partial map on Baire space that is continuous on its domain extends to a partial map with a Gδ domain that is computable relative to a total oracle and continuous on its extended domain.
The continuity theorem. A total map on Baire space is continuous if and only if it is computable relative to some oracle.
The effective form #
The effective continuity theorem. A total map on Baire space is computable exactly when it has a computable associate.