This project formalizes oracle-relative computability and the theory of Turing degrees in Lean. We define a model of relative computability via partial recursive functions, and build a framework for expressing and proving properties of Turing reducibility, Turing equivalence, jump operators, and recursively enumerable sets.
Defines our model of relative computability:
RecursiveIn O f: the functionfis computable relative to oracles in the setO.- Generalizations:
RecursiveIn',RecursiveIn₂,ComputableIn,ComputableIn₂for functions betweenPrimcodabletypes. - Lifting functions using
Primcodableencoding. - Universal oracle machine
evaloand its correctness.
- Gödels numbering for partial recursive functions with oracle sets indexed by a
Primcodabletype. - Implements
encodeCodeo,decodeCodeofor universal simulation. - Proves:
RecursiveIn (range g) f ↔ ∃ c, evalo g c = f.
Builds Turing reducibility and degree structure:
f ≤ᵀ g:fis Turing reducible tog.f ≡ᵀ g: Turing equivalence.TuringDegree: equivalence classes ofℕ →. ℕunder≡ᵀ.- Defines
turingJoin(f ⊕ g) as the least upper bound. - Join lemmas:
left_le_join:f ≤ᵀ f ⊕ gright_le_join:g ≤ᵀ f ⊕ gjoin_le:f ⊕ g ≤ᵀ hiff ≤ᵀ handg ≤ᵀ h
- Partial order instance for
TuringDegree.
Defines the jump operator:
f⌜ := λ n => evalo (λ _ => f) (decodeCodeo n) njumpSet A: Halting problem relative to a decidable setA.- Theorems (in progress):
f ≤ᵀ f⌜¬(f⌜ ≤ᵀ f)A ∈ re(f) ↔ A ≤₁ f⌜- If
A ∈ re(f)andf ≤ᵀ hthenA ∈ re(h) g ≤ᵀ f ↔ g⌜ ≤ᵀ f⌜g ≡ᵀ f ↔ g⌜ ≡ᵀ f⌜
Defines the automorphism group of the Turing degrees:
TuringDegree.automorphismGroup := OrderAut TuringDegree- Group structure via
OrderIso. Countableinstance is stated (sorry).
Defines the classical arithmetical hierarchy using oracle-relative computability.
arithJumpBase n: then-fold jump of the empty oraclearithJumpSet n: the set∅⁽ⁿ⁾, i.e., the domain ofarithJumpBase ndecidableIn O A:Ais decidable relative to oracle setOSigma0 n A:AisΣ⁰ₙ— r.e. inarithJumpBase (n - 1)(decidable ifn = 0)Pi0 n A,Delta0 n A: complements and intersections ofΣ⁰ₙ
Includes notations Σ⁰_, Π⁰_, Δ⁰_. Defines K := arithJumpSet 1 as the halting set.
- Prove the jump theorems (see
Jump.lean). - Complete
compileAux_soundandcompileAux_completeproofs. - Prove
encodeCodeo ∘ decodeCodeo = id. - Show that the Turing degrees form an upper semilattice.
- Prove countability of
TuringDegree.automorphismGroup. - Explore structure theore of the automorphism group
- Formalize a finite injury priority argument (e.g. Kleene–Post theorem).
- Complexity theory
- Mario Carneiro. Formalizing Computability Theory via Partial Recursive Functions, arXiv:1810.08380, 2018.
- Piergiorgio Odifreddi. Classical Recursion Theory, Vol. I. PDF