Documentation

CslibFrontier.Foundations.Computability.RecursiveInContinuous

Continuity on Baire space as relative computability #

A map F : (ℕ → ℕ) → (ℕ → ℕ) on Baire space, with the product topology of discrete ℕ, 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 all x and n. This file proves that the total maps computable relative to some oracle are exactly the continuous ones (Nat.RecursiveIn.Code.continuous_iff_exists_code).

Main definitions #

Main results #

Implementation notes #

The statements take a total map with values in ℕ → ℕ in curried form, (ℕ → ℕ) → ℕ → ℕ, and compare it with code evaluation entry by entry. Partial maps, the definition of a map computable relative to an oracle, closure under composition and the effective form of the continuity theorem are in CslibFrontier.Foundations.Computability.RecursiveInStream.

References #

theorem Partrec.join_coe (f g : ℕ → ℕ) :
join ↑f ↑g = ↑fun (n : ℕ) => bif n.bodd then 2 * g n.div2 + 1 else 2 * f n.div2

The join of two total functions is total.

theorem Nat.RecursiveIn.Code.continuous_iff_forall_exists_cylinder {F : (ℕ → ℕ) → ℕ → ℕ} :
Continuous F ↔ ∀ (x : ℕ → ℕ) (n : ℕ), ∃ (k : ℕ), ∀ y ∈ PiNat.cylinder x k, F y n = F x n

A map on Baire space is continuous if and only if each output entry depends only on a finite prefix of the input.

Two inputs have the same prefix of length k exactly when one lies in the cylinder of length k around the other.

structure Nat.RecursiveIn.Code.IsAssociate (α : ℕ → ℕ) (F : (ℕ → ℕ) → ℕ → ℕ) :

α is an associate of the total map F on Baire space, in Kleene's sense of a neighbourhood function: α answers the query ⟨n, σ⟩ for a finite sequence σ, every input x has a prefix on which the answer for n is nonzero, and every nonzero answer on a prefix of x is F x n + 1.

theorem Nat.RecursiveIn.Code.exists_code_isAssociate :
∃ (e : Code), ∀ (F : (ℕ → ℕ) → ℕ → ℕ) (α : ℕ → ℕ), IsAssociate α F → ∀ (x : ℕ → ℕ) (n : ℕ), eval (Partrec.join ↑α ↑x) e n = Part.some (F x n)

Maps with an associate are computable through one fixed code. A single oracle code e computes every total map F on Baire space relative to the join of an associate α of F with the input: F x n = Φₑ^{α ⊕ x}(n). The code searches for the least k such that α answers the prefix of length k of x with a nonzero value.

theorem Nat.RecursiveIn.Code.exists_code_continuous :
∃ (e : Code), ∀ (F : (ℕ → ℕ) → ℕ → ℕ), Continuous F → ∃ (p : ℕ → ℕ), ∀ (x : ℕ → ℕ) (n : ℕ), eval (Partrec.join ↑p ↑x) e n = Part.some (F x n)

Continuous maps are computable through one fixed code. A single oracle code e computes every continuous map F on Baire space relative to the join of an oracle p encoding F with the input: F x n = Φₑ^{p ⊕ x}(n).

theorem Nat.RecursiveIn.Code.exists_cylinder_of_mem_eval_join {p x : ℕ → ℕ} {c : Code} {n v : ℕ} (h : v ∈ eval (Partrec.join ↑p ↑x) c n) :
∃ (N : ℕ), ∀ y ∈ PiNat.cylinder x N, v ∈ eval (Partrec.join ↑p ↑y) c n

The use principle for a joined input. A convergent computation relative to p ⊕ x converges to the same value relative to p ⊕ y for every y in some cylinder around x.

theorem Nat.RecursiveIn.Code.continuous_of_eval {F : (ℕ → ℕ) → ℕ → ℕ} {p : ℕ → ℕ} {c : Code} (h : ∀ (x : ℕ → ℕ) (n : ℕ), eval (Partrec.join ↑p ↑x) c n = Part.some (F x n)) :

Computable maps are continuous. A total map on Baire space that one code computes relative to the join of a fixed oracle p with the input is continuous.

theorem Nat.RecursiveIn.Code.continuous_iff_exists_code {F : (ℕ → ℕ) → ℕ → ℕ} :
Continuous F ↔ ∃ (p : ℕ → ℕ) (c : Code), ∀ (x : ℕ → ℕ) (n : ℕ), eval (Partrec.join ↑p ↑x) c n = Part.some (F x n)

The continuity theorem. A total map on Baire space is continuous if and only if it is computable relative to some oracle: some code computes it from the join of the oracle with the input.