The areas / V32. Logic, model theory and computability
Mathlib.Computability.RE
21 declarations. Mathlib docs · Source
theorem Nat.Partrec.merge' E1 #
∀ {f g : ℕ →. ℕ},
Nat.Partrec f →
Nat.Partrec g → ∃ h, Nat.Partrec h ∧ ∀ (a : ℕ), (∀ x ∈ h a, x ∈ f a ∨ x ∈ g a) ∧ ((h a).Dom ↔ (f a).Dom ∨ (g a).Dom)
theorem Partrec.merge' E1 #
∀ {α : Type u_1} {σ : Type u_4} [inst : Primcodable α] [inst_1 : Primcodable σ] {f g : α →. σ},
Partrec f →
Partrec g → ∃ k, Partrec k ∧ ∀ (a : α), (∀ x ∈ k a, x ∈ f a ∨ x ∈ g a) ∧ ((k a).Dom ↔ (f a).Dom ∨ (g a).Dom)
theorem Partrec.merge E1 #
∀ {α : Type u_1} {σ : Type u_4} [inst : Primcodable α] [inst_1 : Primcodable σ] {f g : α →. σ},
Partrec f →
Partrec g →
(∀ (a : α), ∀ x ∈ f a, ∀ y ∈ g a, x = y) → ∃ k, Partrec k ∧ ∀ (a : α) (x : σ), x ∈ k a ↔ x ∈ f a ∨ x ∈ g a
theorem Partrec.cond E1 #
∀ {α : Type u_1} {σ : Type u_4} [inst : Primcodable α] [inst_1 : Primcodable σ] {c : α → Bool} {f g : α →. σ},
Computable c → Partrec f → Partrec g → Partrec fun a ↦ bif c a then f a else g a
theorem Partrec.sumCasesOn E1 #
∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {σ : Type u_4} [inst : Primcodable α] [inst_1 : Primcodable β]
[inst_2 : Primcodable γ] [inst_3 : Primcodable σ] {f : α → β ⊕ γ} {g : α → β →. σ} {h : α → γ →. σ},
Computable f → Partrec₂ g → Partrec₂ h → Partrec fun a ↦ Sum.casesOn (f a) (g a) (h a)
def ComputablePred E1 #
{α : Type u_1} → [Primcodable α] → (α → Prop) → Prop
A computable predicate is one whose indicator function is computable.
theorem ComputablePred.decide E1 #
∀ {α : Type u_1} [inst : Primcodable α] {p : α → Prop} [inst_1 : DecidablePred p],
ComputablePred p → Computable fun a ↦ decide (p a)
theorem Computable.computablePred E1 #
∀ {α : Type u_1} [inst : Primcodable α] {p : α → Prop} [inst_1 : DecidablePred p],
(Computable fun a ↦ decide (p a)) → ComputablePred p
theorem computablePred_iff_computable_decide E1 #
∀ {α : Type u_1} [inst : Primcodable α] {p : α → Prop} [inst_1 : DecidablePred p],
ComputablePred p ↔ Computable fun a ↦ decide (p a)
theorem PrimrecPred.computablePred E1 #
∀ {α : Type u_1} [inst : Primcodable α] {p : α → Prop}, PrimrecPred p → ComputablePred p
def REPred E1 #
{α : Type u_1} → [Primcodable α] → (α → Prop) → Prop
A recursively enumerable predicate is one which is the domain of a computable partial function.
theorem REPred.of_eq E0 #
∀ {α : Type u_1} [inst : Primcodable α] {p q : α → Prop}, REPred p → (∀ (a : α), p a ↔ q a) → REPred q
theorem Partrec.dom_re E1 #
∀ {α : Type u_1} {β : Type u_2} [inst : Primcodable α] [inst_1 : Primcodable β] {f : α →. β},
Partrec f → REPred fun a ↦ (f a).Dom
theorem ComputablePred.of_eq E0 #
∀ {α : Type u_1} [inst : Primcodable α] {p q : α → Prop}, ComputablePred p → (∀ (a : α), p a ↔ q a) → ComputablePred q
theorem Computable.find E1 #
∀ {α : Type u_1} [inst : Primcodable α] {P : α → ℕ → Prop} [inst_1 : DecidableRel P],
(ComputablePred fun p ↦ P p.1 p.2) → ∀ (hP_ex : ∀ (x : α), ∃ n, P x n), Computable fun x ↦ Nat.find ⋯
If P is computable, and if for every x there exists an n such that P x n holds,
then the function mapping x to the minimal such n (using Nat.find) is computable.
This formally bridges Partrec.rfind with total unbounded search.
theorem ComputablePred.computable_iff E0 #
∀ {α : Type u_1} [inst : Primcodable α] {p : α → Prop}, ComputablePred p ↔ ∃ f, Computable f ∧ p = fun a ↦ f a = true
theorem ComputablePred.not E1 #
∀ {α : Type u_1} [inst : Primcodable α] {p : α → Prop}, ComputablePred p → ComputablePred fun a ↦ ¬p a
theorem ComputablePred.ite E1 #
∀ {f₁ f₂ : ℕ → ℕ},
Computable f₁ →
Computable f₂ →
∀ {c : ℕ → Prop} [inst : DecidablePred c], ComputablePred c → Computable fun k ↦ if c k then f₁ k else f₂ k
The computable functions are closed under if-then-else definitions with computable predicates.
theorem ComputablePred.to_re E1 #
∀ {α : Type u_1} [inst : Primcodable α] {p : α → Prop}, ComputablePred p → REPred p
theorem ComputablePred.computable_iff_re_compl_re E1 #
∀ {α : Type u_1} [inst : Primcodable α] {p : α → Prop} [DecidablePred p],
ComputablePred p ↔ REPred p ∧ REPred fun a ↦ ¬p a
theorem ComputablePred.computable_iff_re_compl_re' E1 #
∀ {α : Type u_1} [inst : Primcodable α] {p : α → Prop}, ComputablePred p ↔ REPred p ∧ REPred fun a ↦ ¬p a