Documentation

Marginis.Miller2022

Effectivizing Lusin’s Theorem #

RUSSELL MILLER

The paper discusses Turing degrees among other things. Here we formalize Turing reducibility (Degrees of unsolvability).

(Mathlib has a reduce.lean file that can be reconciled with this.)

This file introduces many-one reducibility (mapping reducibility) and proves its basic properties.

We work with a couple of classes of functions:

We show over mon₁ that the degrees are not rigid, using complementation.

Over monₘ we show that the degrees form an upper semilattice and has an automorphism that simply swaps ⊥ := ⟦∅⟧ₘ and ⊤ := ⟦ℕ⟧ₘ.

The halting problem K is defined in this context and its basic degree-theoretic properties established.

structure mon :

An arbitrary monoid.

  • func : ()Prop

    The functions under consideration (computable, primitive recursive, hyperarithmetic, etc.)

  • id : self.func id
  • comp : ∀ {f g : }, self.func fself.func gself.func (f g)
theorem mon.id (self : mon) :
self.func id
theorem mon.comp (self : mon) {f : } {g : } :
self.func fself.func gself.func (f g)

The unit monoid consists of id only. The corresponding degree structure has equality as its equivalence.

Equations
def inlFun :

Embedding on the left over ℕ.

Equations
def inrFun :

Embedding on the right over ℕ.

Equations
structure mon₁extends mon :

A monoid in which we can prove ⊕ is an upper bound, even if not the least one.

  • func : ()Prop
  • id : self.func id
  • comp : ∀ {f g : }, self.func fself.func gself.func (f g)
  • inl : self.func inlFun
  • inr : self.func inrFun
theorem mon₁.inl (self : mon₁) :
self.func inlFun
theorem mon₁.inr (self : mon₁) :
self.func inrFun

The injective functions ca be used in defining 1-degrees, 𝓓₁.

Equations
def m_reducible {m : mon} (A : Bool) (B : Bool) :

Mapping (many-one) reducibility.

Equations
Instances For
instance instFintypeForallFinBool_marginis (u : ) (n : ) :
Fintype (Fin (u n)Bool)
Equations
instance instFintypeForallForallFinBool_marginis (u : ) (n : ) :
Fintype ((Fin (u n)Bool)Bool)
Equations
instance instPrimcodableForallFinBool_marginis_1 (u : ) (n : ) :
Primcodable (Fin (u n)Bool)
Equations
Equations
Equations
Equations
def turing_reducible (A : Bool) (B : Bool) :
Equations
def get_part (σ : List Bool) (k : ) :
Equations
def getlist' (β : Part Bool) (l : ) (h : ∀ (k : Fin l), β k Part.none) :
Equations
inductive Partrec_in {A : →. } :
def Computable_in (f : ) (g : ) :
Equations
def T_reducible (A : Bool) (B : Bool) :
Equations
inductive use_bound {A : } :
( →. )Prop

∀ B, B ≤ₜ C → (∀ A, A ≤ₜ B → A ≤ₜ C).

def T_equivalent (A : Bool) (B : Bool) :
Equations
instance 𝓓_setoid :
Equations

The Turing degree 0 contains all computable sets, but by definition it is just the Turing degree of ∅.

Equations
instance blah :
Equations
  • One or more equations did not get rendered due to their size.
theorem encode_decode (k : ) :
Encodable.encode (Encodable.decode k) = if k < 4 then k.succ else 0
def m_equivalent {m : mon} (A : Bool) (B : Bool) :

A ≡ₘ B ↔ A ≤ₘ B and B ≤ₘ A.

Equations

A ≤ₘ B iff A is many-one reducible to B.

Equations

A ≡ₘ B iff A is many-one equivalent to B.

Equations
theorem m_refl {m : mon} :
Reflexive m_reducible

m-reducibility is reflexive.

theorem m_trans {m : mon} :
Transitive m_reducible

m-reducibility is transitive.

instance instTransForallNatBoolM_reducible {m : mon} :
Trans m_reducible m_reducible m_reducible

To do calc proofs with m-reducibility we create a Trans instance.

Equations
  • instTransForallNatBoolM_reducible = { trans := }
theorem m_equiv_refl {m : mon} :
Reflexive m_equivalent

Many-one equivalence is reflexive.

theorem m_equiv_trans {m : mon} :
Transitive m_equivalent

Many-one equivalence is transitive.

theorem m_equiv_symm {m : mon} :
Symmetric m_equivalent

Many-one equivalence is symmetric.

theorem m_equiv_equiv {m : mon} :
Equivalence m_equivalent

Many-one equivalence.

@[reducible, inline]
abbrev 𝓓setoid {m : mon} :

The degree structure 𝓓ₘ, using quotients #

Quot is like Quotient when the relation is not necessarily an equivalence. We could do: def 𝓓ₘ' := Quot m_equivalent

Equations
  • 𝓓setoid = { r := m_equivalent, iseqv := }
@[reducible, inline]
abbrev 𝓓 {m : mon} :

The many-one degrees.

Equations
Instances For
theorem upper_cones_eq {m : mon} (A : Bool) (B : Bool) (h : A ≡ₘ B) :

Equivalent reals have equal upper cones.

theorem degrees_eq {m : mon} (A : Bool) (B : Bool) (h : A ≡ₘ B) :

Equivalent reals have equal degrees.

def le_m' {m : mon} (A : Bool) (b : 𝓓) :

As an auxiliary notion, we define [A]ₘ ≤ b to mean that the degree of A is below the degree b.

Equations
def le_m {m : mon} (a : 𝓓) (b : 𝓓) :

The ordering of the m-degrees.

Equations
theorem le_m_refl {m : mon} :

The ordering of m-degrees is reflexive.

theorem le_m_trans {m : mon} :

The ordering of m-degrees is transitive.

m-reducibility is a preorder.

Equations

For example 𝓓₁ is a partial order (if not a semilattice).

Equations
instance instZero𝓓 {m : mon} :
Zero 𝓓

The nontrivial computable sets form the m-degree 0.

Equations
  • instZero𝓓 = { zero := fun (k : ) => if k = 0 then true else false }
instance instBot𝓓 {m : mon} :
Bot 𝓓

The degree ⟦∅⟧ₘ = ⊤.

Equations
  • instBot𝓓 = { bot := fun (x : ) => false }
instance instTop𝓓 {m : mon} :
Top 𝓓

The degree ⟦ℕ⟧ₘ = ⊤.

Equations
  • instTop𝓓 = { top := fun (x : ) => true }
def join (A : Bool) (B : Bool) (k : ) :

The recursive join A ⊕ B. #

(However, the symbol ⊕ has a different meaning in Lean.) It is really a shuffle or ♯ (backslash sha).

Equations
  • (A B) k = if Even k then A (k / 2) else B (k / 2)

Make sure ♯ binds stronger than ≤ₘ.

Equations
theorem join_inl (A : Bool) (B : Bool) (k : ) :
(A B) (inlFun k) = A k

Join works as desired on the left.

theorem join_inr (A : Bool) (B : Bool) (k : ) :
(A B) (inrFun k) = B k

Join works as desired on the right.

theorem join_left {m : mon₁} (A : Bool) (B : Bool) :
A ≤ₘ A B

A ≤ₘ A ⊕ B.

theorem join_right {m : mon₁} (A : Bool) (B : Bool) :
B ≤ₘ A B

B ≤ₘ A ⊕ B.

noncomputable def botSwap {m : mon} :
𝓓𝓓

A map on 𝓓ₘ that swaps ∅ and ℕ.

Equations
theorem botSwap_inj {m : mon} :

Swapping ∅ and ℕ is injective on 𝓓ₘ.

theorem botSwap_surj {m : mon} :

Swapping ∅ and ℕ is surjective on 𝓓ₘ.

theorem emp_not_below {m : mon} :

In 𝓓ₘ, ⊥ is not below ⊤.

theorem univ_not_below {m : mon} :

In 𝓓ₘ, ⊤ is not below ⊥.

theorem emp_min {m : mon} (a : 𝓓) (h : a ) :
a =

In 𝓓ₘ, ⊥ is a minimal element.

theorem univ_min {m : mon} (a : 𝓓) (h : a ) :
a =

In 𝓓ₘ, ⊤ is a minimal element.

def automorphism {α : Type} [PartialOrder α] (π : αα) :

An automorphism of a partial order is a bijection that preserves and reflects the order.

Equations
def cpl :
(Bool)Bool

The complement map on ℕ → Bool.

Equations
def complementMap {m : mon} :
𝓓𝓓

The complement map on 𝓓ₘ.

Equations

In 𝓓ₘ, ⊥ ≠ ⊤.

theorem botSwapNontrivial {m : mon} :
botSwap id

The (⊥,⊤) swap map is not the identity.

def rigid (α : Type) [PartialOrder α] :

A partial order is rigid if there are no nontrivial automorphisms.

Equations
theorem half_primrec :
Primrec fun (k : ) => k / 2

Dividing-by-two is primitive recursive.

theorem primrec_even_equiv :
PrimrecPred fun (k : ) => k / 2 * 2 = k

An arithmetical characterization of "Even" is primitive recursive.

theorem even_div_two (a : ) :
a / 2 * 2 = a Even a

Characterizing "Even" arithmetically.

"Even" is a primitive recursive predicate.

theorem primrec_join {f₁ : } {f₂ : } (hf₁ : Primrec f₁) (hf₂ : Primrec f₂) :
Primrec fun (k : ) => if Even k then f₁ (k / 2) else f₂ (k / 2)

The usual join of functions on ℕ is primitive recursive.

theorem computable_join {f₁ : } {f₂ : } (hf₁ : Computable f₁) (hf₂ : Computable f₂) :
Computable fun (k : ) => if Even k then f₁ (k / 2) else f₂ (k / 2)

The usual join of functions on ℕ is computable.

theorem getHasIte {m : mon₁} (hasIte₂ : ∀ {f₁ f₂ : }, m.func f₁m.func f₂m.func fun (k : ) => if Even k then f₁ (k / 2) else f₂ (k / 2)) (f : ) :
m.func fm.func fun (k : ) => if Even k then f (k / 2) * 2 else k

An auxiliary lemma for proving that the join A₀ ⊕ A₁ is monotone in A₀ within the context of the monoid class mon₁.

def joinFun (f₁ : ) (f₂ : ) (k : ) :

Coding two functions into one.

Equations
structure monₘextends mon₁ :

Requirement for a semilattice like 𝓓ₘ.

  • func : ()Prop
  • id : self.func id
  • comp : ∀ {f g : }, self.func fself.func gself.func (f g)
  • inl : self.func inlFun
  • inr : self.func inrFun
  • join : ∀ {f₁ f₂ : }, self.func f₁self.func f₂self.func (joinFun f₁ f₂)
  • const : ∀ (c : ), self.func fun (x : ) => c
theorem monₘ.join (self : monₘ) {f₁ : } {f₂ : } :
self.func f₁self.func f₂self.func (joinFun f₁ f₂)
theorem monₘ.const (self : monₘ) (c : ) :
self.func fun (x : ) => c
structure monₜₜextends monₘ :
theorem monₜₜ.ttrefl (self : monₜₜ) :
self.func fun (n : ) => Encodable.encode ((Denumerable.ofNat ((k : ) × (Fin k.succBool)) n).snd (Denumerable.ofNat ((k : ) × (Fin k.succBool)) n).fst)
def tt_reducible (A : Bool) (B : Bool) :
Equations
  • One or more equations did not get rendered due to their size.

The computable functions satisfy the requirement for a semilattice like 𝓓ₘ.

Equations

The primitive recursive functions satisfy the requirement for a semilattice like 𝓓ₘ.

Equations

The all-monoid, which will give us only three degrees, ⊥, ⊤ and 0.

Equations
theorem join_le_join {m : monₘ} {A₀ : Bool} {A₁ : Bool} (h : A₀ ≤ₘ A₁) (B : Bool) :
A₀ B ≤ₘ A₁ B

The join A₀ ⊕ A₁ is monotone in A₀.

theorem join_le {m : monₘ} {A : Bool} {B : Bool} {C : Bool} (h₁ : A ≤ₘ C) (h₂ : B ≤ₘ C) :
A B ≤ₘ C

The join is bounded by each upper bound.

def join' {m : monₘ} (A : Bool) (b : Quot m_equivalent) :
Quot m_equivalent

The m-degree [A]ₘ ⊔ b.

Equations

𝓓ₘ is a join-semilattice.

Equations
theorem emp_univ {m : monₘ} (B : Bool) (h_2 : ¬B = fun (x : ) => false) :
fun (x : ) => true B

This is false for 1-degrees. However, the complementing automorphism works there.

theorem univ_emp {m : monₘ} (B : Bool) (h_2 : B ) :
B

In the m-degrees, if ⟦B⟧ ≠ ⊤ then ⊥ ≤ ⟦B⟧.

theorem complementMapIsNontrivial {m : mon} :
complementMap id

The complement map is not the identity map of 𝓓ₘ.

theorem complementMap_surjective {m : mon} :
Function.Surjective complementMap

The complement map is a surjective map of 𝓓ₘ.

theorem complementMap_injective {m : mon} :
Function.Injective complementMap

The complement map is an injective map of 𝓓ₘ.

theorem complementMapIsAuto {m : mon} :
automorphism complementMap

The complement map is an automorphism of 𝓓ₘ.

theorem notrigid {m : mon} :
¬rigid 𝓓

𝓓ₘ is not rigid.

theorem botSwapIsAuto {m : monₘ} :
automorphism botSwap

Over a rich enough monoid, botSwap is an automorphism.

theorem emp_lt_zero {m : monₘ} :
< 0

In 𝓓ₘ, the degree of ∅ is less than 0.

theorem zero_one_m {E : monₘ} {b : Bool} (A : Bool) :
(A fun (x : ) => b) (fun (x : ) => !b) ≤ₘ A

∅ and ℕ are the minimal elements of 𝓓ₘ.

noncomputable def φ {e : Nat.Partrec.Code} :
Bool

The eth r.e. set

Equations
noncomputable def K :
Bool

Defining the halting set K as {e | φₑ(0)↓}. (There are other possible, essentially equivalent, definitions.)

Equations
theorem K_re :
RePred fun (k : ) => K k = true

The halting set K is r.e.

theorem Kbar_not_re :
¬RePred fun (k : ) => (!K k) = true

The complement of the halting set K is not r.e.

theorem Kbar_not_computable :
¬Computable fun (k : ) => !K k

The complement of the halting set K is not computable.

The halting set K is not computable.

Equations
theorem compute_closed_m_downward (A : Bool) (B : Bool) (h : Computable B) (h₀ : A ≤ₘ B) :

If B is computable and A ≤ₘ B then A is computable.

theorem re_closed_m_downward {A : Bool} {B : Bool} (h : RePred fun (k : ) => B k = true) (h₀ : A ≤ₘ B) :
RePred fun (k : ) => A k = true

If B is r.e. and A ≤ₘ B then A is r.e.

theorem Kbar_not_below_K :
¬(fun (k : ) => decide ((!K k) = true)) ≤ₘ K

The complement of K is not m-reducible to K.