Documentation

CslibFrontier.Foundations.Computability.KleenePost

The Kleene–Post theorem: incomparable Turing degrees #

Kleene and Post showed that the Turing degrees are not linearly ordered: there are sets A and B of natural numbers with A ≰ᵀ B and B ≰ᵀ A. This file proves it by the finite extension method. Two finite binary strings σ and τ are built in stages. At stage 2e + 1 the string σ is extended by one bit so that the oracle code e relative to any extension of τ cannot compute the characteristic function of A at the position of the new bit. Either some extension of τ makes the computation converge, in which case τ is extended to it and the bit is chosen to disagree with the output, or no extension does, in which case the computation diverges for every oracle extending τ. Stage 2e + 2 is symmetric. The stage-bounded evaluator Nat.RecursiveIn.Code.evaln turns the first alternative into a statement about finite strings, and its soundness and completeness (the use principle) carry the conclusion to the limit sets.

This proves the incomparability statement of Kleene–Post. The construction is noncomputable here: it decides by classical choice whether some extension forces convergence. The bound A, B ≤ᵀ ∅′ from the source, which holds because this question is Σ₁ and hence decided by ∅′, is proved in CslibFrontier.Foundations.Computability.KleenePostJump (kleene_post_below_jump).

Main results #

References #

A finite binary string, read as a finite oracle prefix with values in {0, 1}.

Converting a finite binary string to its {0, 1}-valued prefix is primitive recursive.

Converting the first M bits of a Boolean sequence via bits agrees with prefixOf.

@[reducible, inline]

Stage bound p.2.1 in a halting witness (σ, k, y).

@[reducible, inline]

Output value p.2.2 in a halting witness (σ, k, y).

Some extension of the finite string τ makes the code c converge on x at some stage. The witness packs the extension, the stage and the output.

Predicate stating that e decodes to a halting witness (σ, k, y) for c on x extending τ.

Instances For
    @[instance_reducible]
    theorem Nat.RecursiveIn.KleenePost.Halts_iff_exists_haltsPred (c : Code) (τ : List Bool) (x : ℕ) :
    Halts c τ x ↔ ∃ (e : ℕ), haltsPred c τ x e
    noncomputable def Nat.RecursiveIn.KleenePost.step (c : Code) (σ τ : List Bool) :

    One finite-extension step against the code c: extend σ by one bit at position σ.length, and extend τ to force convergence of c at that position when possible.

    theorem Nat.RecursiveIn.KleenePost.step_fst (c : Code) (σ τ : List Bool) :
    ∃ (b : Bool), (step c σ τ).1 = σ ++ [b]
    theorem Nat.RecursiveIn.KleenePost.step_snd (c : Code) (σ τ : List Bool) :
    τ <+: (step c σ τ).2

    The finite string σ is an initial segment of the Bool sequence a.

    theorem Nat.RecursiveIn.KleenePost.step_spec {c : Code} {σ τ : List Bool} {a b : ℕ → Bool} (hσ : Agrees (step c σ τ).1 a) (hτ : Agrees (step c σ τ).2 b) :
    Code.eval (↑fun (n : ℕ) => (b n).toNat) c ≠ ↑fun (n : ℕ) => (a n).toNat

    The diagonalization step: if a extends the first output of step c σ τ and b extends the second, then c relative to b does not compute a.

    The finite-extension construction. Stage 2e + 1 extends the first string against code e, and stage 2e + 2 extends the second string against code e.

    theorem Nat.RecursiveIn.KleenePost.stage_succ_prefix (s : ℕ) :
    (stage s).1 <+: (stage (s + 1)).1 ∧ (stage s).2 <+: (stage (s + 1)).2
    theorem Nat.RecursiveIn.KleenePost.stage_prefix {s t : ℕ} (h : s ≤ t) :
    (stage s).1 <+: (stage t).1 ∧ (stage s).2 <+: (stage t).2
    noncomputable def Nat.RecursiveIn.KleenePost.limA (n : ℕ) :

    The first limit sequence: its value at n is fixed by stage 2 * n + 2.

    noncomputable def Nat.RecursiveIn.KleenePost.limB (n : ℕ) :

    The second limit sequence: its value at n is fixed by stage 2 * n + 2.

    theorem Nat.RecursiveIn.KleenePost.agrees_of_prefix {f : ℕ → List Bool} {idx : ℕ → ℕ} (hpref : ∀ {s t : ℕ}, s ≤ t → f s <+: f t) (hlen : ∀ (i : ℕ), i < (f (idx i)).length) (s : ℕ) :
    Agrees (f s) fun (n : ℕ) => (f (idx n)).getD n false

    Every stage of a prefix-monotone chain of binary strings agrees with the limit sequence extracted at indices idx i whenever i < (f (idx i)).length.

    theorem Nat.RecursiveIn.KleenePost.indicator_eq (a : ℕ → Bool) :
    {n : ℕ | a n = true}.indicator 1 = fun (n : ℕ) => (a n).toNat

    Kleene–Post theorem (incomparability part): there are sets A and B of natural numbers whose characteristic functions are Turing incomparable, A ≰ᵀ B and B ≰ᵀ A. The sets are built by finite extension; the bound A, B ≤ᵀ ∅′ of the source is not part of this statement.

    theorem TuringDegree.exists_incomparable :
    ∃ (d₁ : TuringDegree) (d₂ : TuringDegree), ¬d₁ ≤ d₂ ∧ ¬d₂ ≤ d₁

    The Turing degrees are not linearly ordered: some two degrees are incomparable.