The Turing join and the join semilattice of Turing degrees #
The join f ⊕ g of two partial functions f g : ℕ →. ℕ codes their disjoint union by
parity: on 2 * n it returns f n doubled, and on 2 * n + 1 it returns g n doubled plus one.
Each of f and g is Turing reducible to f ⊕ g, and f ⊕ g is reducible to every h to
which both f and g are reducible. So the join is a least upper bound for ≤ᵀ, and it makes
TuringDegree a join semilattice [KP54], [Soa87].
Main definitions #
Partrec.join, notationf ⊕ g(scoped inPartrec): the join of two partial functions.TuringDegree.sup: the supremum of Turing degrees, induced by the join.
Main results #
left_le_join,right_le_join:f ≤ᵀ f ⊕ gandg ≤ᵀ f ⊕ g.join_le: iff ≤ᵀ handg ≤ᵀ h, thenf ⊕ g ≤ᵀ h.TuringDegree.join_mono,TuringDegree.join_congr: the join respects≤ᵀand≡ᵀ.TuringDegree.instSemilatticeSup: Turing degrees form a join semilattice, with⊔given on representatives by the join (TuringDegree.sup_def).
Implementation notes #
This file is a copy of the additions that the open Mathlib PR 37062 by Tanner Duve,
https://github.com/leanprover-community/mathlib4/pull/37062 ("Turing join and semilattice
structure on Turing degrees", at head 1bac7307b0), makes to Mathlib/Computability/Partrec.lean,
Mathlib/Computability/RecursiveIn.lean and Mathlib/Computability/TuringDegree.lean. It keeps
that PR's declaration names and statements, so that clients switch to Mathlib by changing their
imports. Delete this file when Mathlib PR 37062, or a successor providing the join, lands in the
pinned Mathlib, and point its importers at Mathlib.
The copy differs from the PR in three places, each marked -- vendored: below. The PR proves
that Nat.RecursiveIn is closed under conditionals through an equality test and unbounded search
(Partrec.kronecker, Nat.RecursiveIn.cond'); here the join is instead the sum of two guarded
branches, each guarded by the PR's Nat.RecursiveIn.cond_const, so the equality test is not
copied. The PR's Nat.RecursiveIn.of_primrec and Nat.RecursiveIn.of_partrec restate the pinned
Nat.Primrec.recursiveIn and Nat.Partrec.recursiveIn, which are used instead. On the pinned
Mathlib, f ≤ᵀ g unfolds to the encoded RecursiveIn {g} f rather than Nat.RecursiveIn {g} f,
and RecursiveIn.iff_nat converts between them.
References #
The join of partial functions f and g, coding a disjoint union by parity.
Every function is recursive in the singleton oracle set containing it.
The first function in a two-element oracle set is recursive in that set.
The second function in a two-element oracle set is recursive in that set.
Conditional with a computable guard and constant fallback.
f is Turing reducible to the join f ⊕ g.
g is Turing reducible to the join f ⊕ g.
The join is recursive in the pair of oracles {f, g}.
If f and g are both reducible to h, then their join
is reducible to h.
If f ≤ᵀ f', then f is reducible to any join with f' on the left.
If g ≤ᵀ g', then g is reducible to any join with g' on the right.
The Turing join respects Turing reducibility: if f ≤ᵀ f' and g ≤ᵀ g',
then f ⊕ g ≤ᵀ f' ⊕ g'.
The Turing join respects Turing equivalence.
The supremum operation on Turing degrees, induced by the Turing join.
sup agrees with ⊕ on representatives.
The sup on Turing degrees agrees with the Turing join on representatives.