The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V32. Logic, model theory and computability

Mathlib.Computability.Halting

5 declarations. Mathlib docs · Source

Computability theory and the halting problem

A universal partial recursive function, Rice's theorem, and the halting problem.

References

  • [Mario Carneiro, Formalizing computability theory via partial recursive functions][carneiro2019]

theorem ComputablePred.rice E3 #

∀ (C : Set (ℕ →. ℕ)),
  (ComputablePred fun c ↦ c.eval ∈ C) → ∀ {f g : ℕ →. ℕ}, Nat.Partrec f → Nat.Partrec g → f ∈ C → g ∈ C

Rice's Theorem

theorem ComputablePred.rice₂ E1 #

∀ (C : Set Nat.Partrec.Code),
  (∀ (cf cg : Nat.Partrec.Code), cf.eval = cg.eval → (cf ∈ C ↔ cg ∈ C)) →
    ((ComputablePred fun c ↦ c ∈ C) ↔ C = ∅ ∨ C = Set.univ)

theorem ComputablePred.halting_problem_re E1 #

∀ (n : ℕ), REPred fun c ↦ (c.eval n).Dom

The Halting problem is recursively enumerable

theorem ComputablePred.halting_problem E3 #

∀ (n : ℕ), ¬ComputablePred fun c ↦ (c.eval n).Dom

The Halting problem is not computable

theorem ComputablePred.halting_problem_not_re E1 #

∀ (n : ℕ), ¬REPred fun c ↦ ¬(c.eval n).Dom