The areas / V32. Logic, model theory and computability
Mathlib.Computability.Reduce
76 declarations. Mathlib docs · Source
Strong reducibility and degrees.
This file defines the notions of computable many-one reduction and one-one reduction between sets, and shows that the corresponding degrees form a semilattice.
Notation
This file uses the local notation ⊕' for Sum.elim to denote the disjoint union of two degrees.
References
- [Robert Soare, Recursively enumerable sets and degrees][soare1987]
Tags
computability, reducibility, reduction
def ManyOneReducible E1 #
{α : Type u_1} → {β : Type u_2} → [Primcodable α] → [Primcodable β] → (α → Prop) → (β → Prop) → Prop
p is many-one reducible to q if there is a computable function translating questions about p
to questions about q.
def «term_≤₀_» E1 #
Lean.TrailingParserDescr
p is many-one reducible to q if there is a computable function translating questions about p
to questions about q.
theorem ManyOneReducible.mk E1 #
∀ {α : Type u_1} {β : Type u_2} [inst : Primcodable α] [inst_1 : Primcodable β] {f : α → β} (q : β → Prop),
Computable f → (fun a ↦ q (f a)) ≤₀ q
theorem manyOneReducible_refl E1 #
∀ {α : Type u_1} [inst : Primcodable α] (p : α → Prop), p ≤₀ p
theorem ManyOneReducible.trans E1 #
∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Primcodable α] [inst_1 : Primcodable β] [inst_2 : Primcodable γ]
{p : α → Prop} {q : β → Prop} {r : γ → Prop}, p ≤₀ q → q ≤₀ r → p ≤₀ r
instance stdRefl_manyOneReducible E0 #
∀ {α : Type u_1} [inst : Primcodable α], Std.Refl ManyOneReducible
instance isTrans_manyOneReducible E0 #
∀ {α : Type u_1} [inst : Primcodable α], IsTrans (α → Prop) ManyOneReducible
def OneOneReducible E1 #
{α : Type u_1} → {β : Type u_2} → [Primcodable α] → [Primcodable β] → (α → Prop) → (β → Prop) → Prop
p is one-one reducible to q if there is an injective computable function translating questions
about p to questions about q.
def «term_≤₁_» E1 #
Lean.TrailingParserDescr
p is one-one reducible to q if there is an injective computable function translating questions
about p to questions about q.
theorem OneOneReducible.mk E1 #
∀ {α : Type u_1} {β : Type u_2} [inst : Primcodable α] [inst_1 : Primcodable β] {f : α → β} (q : β → Prop),
Computable f → Function.Injective f → (fun a ↦ q (f a)) ≤₁ q
theorem oneOneReducible_refl E1 #
∀ {α : Type u_1} [inst : Primcodable α] (p : α → Prop), p ≤₁ p
theorem OneOneReducible.trans E1 #
∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Primcodable α] [inst_1 : Primcodable β] [inst_2 : Primcodable γ]
{p : α → Prop} {q : β → Prop} {r : γ → Prop}, p ≤₁ q → q ≤₁ r → p ≤₁ r
theorem OneOneReducible.to_many_one E1 #
∀ {α : Type u_1} {β : Type u_2} [inst : Primcodable α] [inst_1 : Primcodable β] {p : α → Prop} {q : β → Prop},
p ≤₁ q → p ≤₀ q
theorem OneOneReducible.of_equiv E1 #
∀ {α : Type u_1} {β : Type u_2} [inst : Primcodable α] [inst_1 : Primcodable β] {e : α ≃ β} (q : β → Prop),
Computable ⇑e → (q ∘ ⇑e) ≤₁ q
theorem OneOneReducible.of_equiv_symm E1 #
∀ {α : Type u_1} {β : Type u_2} [inst : Primcodable α] [inst_1 : Primcodable β] {e : α ≃ β} (q : β → Prop),
Computable ⇑e.symm → q ≤₁ (q ∘ ⇑e)
instance stdRefl_oneOneReducible E0 #
∀ {α : Type u_1} [inst : Primcodable α], Std.Refl OneOneReducible
instance isTrans_oneOneReducible E0 #
∀ {α : Type u_1} [inst : Primcodable α], IsTrans (α → Prop) OneOneReducible
theorem ComputablePred.computable_of_manyOneReducible E1 #
∀ {α : Type u_1} {β : Type u_2} [inst : Primcodable α] [inst_1 : Primcodable β] {p : α → Prop} {q : β → Prop},
p ≤₀ q → ComputablePred q → ComputablePred p
theorem ComputablePred.computable_of_oneOneReducible E1 #
∀ {α : Type u_1} {β : Type u_2} [inst : Primcodable α] [inst_1 : Primcodable β] {p : α → Prop} {q : β → Prop},
p ≤₁ q → ComputablePred q → ComputablePred p
def ManyOneEquiv E1 #
{α : Type u_1} → {β : Type u_2} → [Primcodable α] → [Primcodable β] → (α → Prop) → (β → Prop) → Prop
p and q are many-one equivalent if each one is many-one reducible to the other.
def OneOneEquiv E1 #
{α : Type u_1} → {β : Type u_2} → [Primcodable α] → [Primcodable β] → (α → Prop) → (β → Prop) → Prop
p and q are one-one equivalent if each one is one-one reducible to the other.
theorem manyOneEquiv_refl E1 #
∀ {α : Type u_1} [inst : Primcodable α] (p : α → Prop), ManyOneEquiv p p
theorem ManyOneEquiv.symm E1 #
∀ {α : Type u_1} {β : Type u_2} [inst : Primcodable α] [inst_1 : Primcodable β] {p : α → Prop} {q : β → Prop},
ManyOneEquiv p q → ManyOneEquiv q p
theorem ManyOneEquiv.trans E1 #
∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Primcodable α] [inst_1 : Primcodable β] [inst_2 : Primcodable γ]
{p : α → Prop} {q : β → Prop} {r : γ → Prop}, ManyOneEquiv p q → ManyOneEquiv q r → ManyOneEquiv p r
theorem equivalence_of_manyOneEquiv E1 #
∀ {α : Type u_1} [inst : Primcodable α], Equivalence ManyOneEquiv
theorem oneOneEquiv_refl E1 #
∀ {α : Type u_1} [inst : Primcodable α] (p : α → Prop), OneOneEquiv p p
theorem OneOneEquiv.symm E1 #
∀ {α : Type u_1} {β : Type u_2} [inst : Primcodable α] [inst_1 : Primcodable β] {p : α → Prop} {q : β → Prop},
OneOneEquiv p q → OneOneEquiv q p
theorem OneOneEquiv.trans E1 #
∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Primcodable α] [inst_1 : Primcodable β] [inst_2 : Primcodable γ]
{p : α → Prop} {q : β → Prop} {r : γ → Prop}, OneOneEquiv p q → OneOneEquiv q r → OneOneEquiv p r
theorem equivalence_of_oneOneEquiv E1 #
∀ {α : Type u_1} [inst : Primcodable α], Equivalence OneOneEquiv
theorem OneOneEquiv.to_many_one E1 #
∀ {α : Type u_1} {β : Type u_2} [inst : Primcodable α] [inst_1 : Primcodable β] {p : α → Prop} {q : β → Prop},
OneOneEquiv p q → ManyOneEquiv p q
def Equiv.Computable E1 #
{α : Type u_1} → {β : Type u_2} → [Primcodable α] → [Primcodable β] → α ≃ β → Prop
a computable bijection
theorem Equiv.Computable.symm E1 #
∀ {α : Type u_1} {β : Type u_2} [inst : Primcodable α] [inst_1 : Primcodable β] {e : α ≃ β},
e.Computable → e.symm.Computable
theorem Equiv.Computable.trans E1 #
∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Primcodable α] [inst_1 : Primcodable β] [inst_2 : Primcodable γ]
{e₁ : α ≃ β} {e₂ : β ≃ γ}, e₁.Computable → e₂.Computable → (e₁.trans e₂).Computable
theorem Computable.eqv E1 #
∀ (α : Type u_1) [inst : Denumerable α], (Denumerable.eqv α).Computable
theorem Computable.equiv₂ E1 #
∀ (α : Type u_1) (β : Type u_2) [inst : Denumerable α] [inst_1 : Denumerable β], (Denumerable.equiv₂ α β).Computable
theorem OneOneEquiv.of_equiv E1 #
∀ {α : Type u_1} {β : Type u_2} [inst : Primcodable α] [inst_1 : Primcodable β] {e : α ≃ β},
e.Computable → ∀ {p : β → Prop}, OneOneEquiv (p ∘ ⇑e) p
theorem ManyOneEquiv.of_equiv E1 #
∀ {α : Type u_1} {β : Type u_2} [inst : Primcodable α] [inst_1 : Primcodable β] {e : α ≃ β},
e.Computable → ∀ {p : β → Prop}, ManyOneEquiv (p ∘ ⇑e) p
theorem ManyOneEquiv.le_congr_left E1 #
∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Primcodable α] [inst_1 : Primcodable β] [inst_2 : Primcodable γ]
{p : α → Prop} {q : β → Prop} {r : γ → Prop}, ManyOneEquiv p q → (p ≤₀ r ↔ q ≤₀ r)
theorem ManyOneEquiv.le_congr_right E1 #
∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Primcodable α] [inst_1 : Primcodable β] [inst_2 : Primcodable γ]
{p : α → Prop} {q : β → Prop} {r : γ → Prop}, ManyOneEquiv q r → (p ≤₀ q ↔ p ≤₀ r)
theorem OneOneEquiv.le_congr_left E1 #
∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Primcodable α] [inst_1 : Primcodable β] [inst_2 : Primcodable γ]
{p : α → Prop} {q : β → Prop} {r : γ → Prop}, OneOneEquiv p q → (p ≤₁ r ↔ q ≤₁ r)
theorem OneOneEquiv.le_congr_right E1 #
∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Primcodable α] [inst_1 : Primcodable β] [inst_2 : Primcodable γ]
{p : α → Prop} {q : β → Prop} {r : γ → Prop}, OneOneEquiv q r → (p ≤₁ q ↔ p ≤₁ r)
theorem ManyOneEquiv.congr_left E1 #
∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Primcodable α] [inst_1 : Primcodable β] [inst_2 : Primcodable γ]
{p : α → Prop} {q : β → Prop} {r : γ → Prop}, ManyOneEquiv p q → (ManyOneEquiv p r ↔ ManyOneEquiv q r)
theorem ManyOneEquiv.congr_right E1 #
∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Primcodable α] [inst_1 : Primcodable β] [inst_2 : Primcodable γ]
{p : α → Prop} {q : β → Prop} {r : γ → Prop}, ManyOneEquiv q r → (ManyOneEquiv p q ↔ ManyOneEquiv p r)
theorem OneOneEquiv.congr_left E1 #
∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Primcodable α] [inst_1 : Primcodable β] [inst_2 : Primcodable γ]
{p : α → Prop} {q : β → Prop} {r : γ → Prop}, OneOneEquiv p q → (OneOneEquiv p r ↔ OneOneEquiv q r)
theorem OneOneEquiv.congr_right E1 #
∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Primcodable α] [inst_1 : Primcodable β] [inst_2 : Primcodable γ]
{p : α → Prop} {q : β → Prop} {r : γ → Prop}, OneOneEquiv q r → (OneOneEquiv p q ↔ OneOneEquiv p r)
theorem ULower.down_computable E0 #
∀ {α : Type u_1} [inst : Primcodable α], (ULower.equiv α).Computable
theorem manyOneEquiv_up E1 #
∀ {α : Type u_1} [inst : Primcodable α] {p : α → Prop}, ManyOneEquiv (p ∘ ULower.up) p
theorem OneOneReducible.disjoin_left E1 #
∀ {α : Type u_1} {β : Type u_2} [inst : Primcodable α] [inst_1 : Primcodable β] {p : α → Prop} {q : β → Prop},
p ≤₁ Sum.elim p q
theorem OneOneReducible.disjoin_right E1 #
∀ {α : Type u_1} {β : Type u_2} [inst : Primcodable α] [inst_1 : Primcodable β] {p : α → Prop} {q : β → Prop},
q ≤₁ Sum.elim p q
theorem disjoin_manyOneReducible E1 #
∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Primcodable α] [inst_1 : Primcodable β] [inst_2 : Primcodable γ]
{p : α → Prop} {q : β → Prop} {r : γ → Prop}, p ≤₀ r → q ≤₀ r → Sum.elim p q ≤₀ r
theorem disjoin_le E1 #
∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Primcodable α] [inst_1 : Primcodable β] [inst_2 : Primcodable γ]
{p : α → Prop} {q : β → Prop} {r : γ → Prop}, Sum.elim p q ≤₀ r ↔ p ≤₀ r ∧ q ≤₀ r
def toNat E1 #
{α : Type u} → [Primcodable α] → [Inhabited α] → Set α → Set ℕ
Computable and injective mapping of predicates to sets of natural numbers.
theorem toNat_nat E0 #
∀ (p : Set ℕ), toNat p = p
theorem toNat_manyOneReducible E0 #
∀ {α : Type u} [inst : Primcodable α] [inst_1 : Inhabited α] {p : Set α}, (fun x ↦ x ∈ toNat p) ≤₀ fun x ↦ x ∈ p
theorem manyOneReducible_toNat E0 #
∀ {α : Type u} [inst : Primcodable α] [inst_1 : Inhabited α] {p : Set α}, (fun x ↦ x ∈ p) ≤₀ fun x ↦ x ∈ toNat p
theorem manyOneReducible_toNat_toNat E0 #
∀ {α : Type u} [inst : Primcodable α] [inst_1 : Inhabited α] {β : Type v} [inst_2 : Primcodable β]
[inst_3 : Inhabited β] {p : Set α} {q : Set β},
((fun x ↦ x ∈ toNat p) ≤₀ fun x ↦ x ∈ toNat q) ↔ (fun x ↦ x ∈ p) ≤₀ fun x ↦ x ∈ q
theorem toNat_manyOneEquiv E0 #
∀ {α : Type u} [inst : Primcodable α] [inst_1 : Inhabited α] {p : Set α},
ManyOneEquiv (fun x ↦ x ∈ toNat p) fun x ↦ x ∈ p
theorem manyOneEquiv_toNat E0 #
∀ {α : Type u} [inst : Primcodable α] [inst_1 : Inhabited α] {β : Type v} [inst_2 : Primcodable β]
[inst_3 : Inhabited β] (p : Set α) (q : Set β),
(ManyOneEquiv (fun x ↦ x ∈ toNat p) fun x ↦ x ∈ toNat q) ↔ ManyOneEquiv (fun x ↦ x ∈ p) fun x ↦ x ∈ q
def ManyOneDegree E1 #
Type
A many-one degree is an equivalence class of sets up to many-one equivalence.
def ManyOneDegree.of E1 #
{α : Type u} → [Primcodable α] → [Inhabited α] → Set α → ManyOneDegree
The many-one degree of a set on a primcodable type.
theorem ManyOneDegree.ind_on E1 #
∀ {C : ManyOneDegree → Prop} (d : ManyOneDegree), (∀ (p : Set ℕ), C (ManyOneDegree.of p)) → C d
abbrev ManyOneDegree.liftOn E1 #
{φ : Sort u_1} →
ManyOneDegree → (f : Set ℕ → φ) → (∀ (p q : Set ℕ), (ManyOneEquiv (fun x ↦ x ∈ p) fun x ↦ x ∈ q) → f p = f q) → φ
Lifts a function on sets of natural numbers to many-one degrees.
theorem ManyOneDegree.liftOn_eq E0 #
∀ {φ : Sort u_1} (p : Set ℕ) (f : Set ℕ → φ)
(h : ∀ (p q : Set ℕ), (ManyOneEquiv (fun x ↦ x ∈ p) fun x ↦ x ∈ q) → f p = f q), (ManyOneDegree.of p).liftOn f h = f p
def ManyOneDegree.liftOn₂ E1 #
{φ : Sort u_1} →
ManyOneDegree →
ManyOneDegree →
(f : Set ℕ → Set ℕ → φ) →
(∀ (p₁ p₂ q₁ q₂ : Set ℕ),
(ManyOneEquiv (fun x ↦ x ∈ p₁) fun x ↦ x ∈ p₂) →
(ManyOneEquiv (fun x ↦ x ∈ q₁) fun x ↦ x ∈ q₂) → f p₁ q₁ = f p₂ q₂) →
φ
Lifts a binary function on sets of natural numbers to many-one degrees.
theorem ManyOneDegree.liftOn₂_eq E0 #
∀ {φ : Sort u_1} (p q : Set ℕ) (f : Set ℕ → Set ℕ → φ)
(h :
∀ (p₁ p₂ q₁ q₂ : Set ℕ),
(ManyOneEquiv (fun x ↦ x ∈ p₁) fun x ↦ x ∈ p₂) →
(ManyOneEquiv (fun x ↦ x ∈ q₁) fun x ↦ x ∈ q₂) → f p₁ q₁ = f p₂ q₂),
(ManyOneDegree.of p).liftOn₂ (ManyOneDegree.of q) f h = f p q
theorem ManyOneDegree.of_eq_of E0 #
∀ {α : Type u} [inst : Primcodable α] [inst_1 : Inhabited α] {β : Type v} [inst_2 : Primcodable β]
[inst_3 : Inhabited β] {p : Set α} {q : Set β},
ManyOneDegree.of p = ManyOneDegree.of q ↔ ManyOneEquiv (fun x ↦ x ∈ p) fun x ↦ x ∈ q
instance ManyOneDegree.instInhabited E0 #
Inhabited ManyOneDegree
instance ManyOneDegree.instLE E0 #
LE ManyOneDegree
For many-one degrees d₁ and d₂, d₁ ≤ d₂ if the sets in d₁ are many-one reducible to the
sets in d₂.
theorem ManyOneDegree.of_le_of E0 #
∀ {α : Type u} [inst : Primcodable α] [inst_1 : Inhabited α] {β : Type v} [inst_2 : Primcodable β]
[inst_3 : Inhabited β] {p : Set α} {q : Set β},
ManyOneDegree.of p ≤ ManyOneDegree.of q ↔ (fun x ↦ x ∈ p) ≤₀ fun x ↦ x ∈ q
instance ManyOneDegree.instPartialOrder E0 #
PartialOrder ManyOneDegree
instance ManyOneDegree.instAdd E0 #
Add ManyOneDegree
The join of two degrees, induced by the disjoint union of two underlying sets.
theorem ManyOneDegree.add_of E0 #
∀ {α : Type u} [inst : Primcodable α] [inst_1 : Inhabited α] {β : Type v} [inst_2 : Primcodable β]
[inst_3 : Inhabited β] (p : Set α) (q : Set β),
ManyOneDegree.of {x | Sum.elim (fun x ↦ x ∈ p) (fun x ↦ x ∈ q) x} = ManyOneDegree.of p + ManyOneDegree.of q
theorem ManyOneDegree.add_le E0 #
∀ {d₁ d₂ d₃ : ManyOneDegree}, d₁ + d₂ ≤ d₃ ↔ d₁ ≤ d₃ ∧ d₂ ≤ d₃
theorem ManyOneDegree.le_add_left E0 #
∀ (d₁ d₂ : ManyOneDegree), d₁ ≤ d₁ + d₂
theorem ManyOneDegree.le_add_right E0 #
∀ (d₁ d₂ : ManyOneDegree), d₂ ≤ d₁ + d₂
instance ManyOneDegree.instSemilatticeSup E0 #
SemilatticeSup ManyOneDegree