Closure properties of computable predicates #
Mathlib's ComputablePred p states that p has a computable Boolean indicator. Mathlib proves
closure under negation (ComputablePred.not); this file adds closure under conjunction,
disjunction, implication, composition with computable functions, comparisons of computable
natural-number functions, and bounded quantification. The bounded quantifiers are the computable
analogues of Mathlib's PrimrecPred.forall_lt and PrimrecPred.exists_lt: a bound computed from
the parameter, over a predicate decidable in the parameter and the bound variable together.
Unbounded existential quantification of a computable predicate gives an r.e. predicate
(ComputablePred.rePred_exists), and r.e. predicates are closed under substitution of computable
functions (REPred.comp). A predicate is r.e. exactly when it is the domain of a code of
Nat.Partrec.Code, evaluated at the encoded argument (rePred_iff_exists_code).
The generic form of an incompleteness argument: if p is not r.e., then every r.e. predicate that
implies p misses a point of p (REPred.exists_not_of_not_rePred), and every decidable relation
P a b ("b is a proof of a") that is sound for p leaves a point of p without a proof
(ComputablePred.exists_forall_not_of_not_rePred). The variants
REPred.exists_not_of_not_exists_rePred_iff and
ComputablePred.exists_forall_not_of_not_exists_rePred_iff only assume that no r.e. predicate
agrees with p on a domain D, and find the point in D.
Main results #
ComputablePred.and,ComputablePred.or,ComputablePred.imp: Boolean closure.ComputablePred.comp: substitution of a computable function.ComputablePred.nat_le,ComputablePred.nat_lt: comparisons of computable functions.ComputablePred.forall_lt,ComputablePred.exists_lt: bounded quantification.ComputablePred.exists_mem_list: existential quantification over a computable list.ComputablePred.rePred_exists: unbounded existential quantification gives an r.e. predicate.REPred.comp: substitution of a computable function into an r.e. predicate.REPred.exists_not_of_not_rePred,REPred.exists_not_of_not_exists_rePred_iff: an r.e. predicate that implies a non-r.e. predicate misses one of its points.ComputablePred.exists_forall_not_of_not_rePred,ComputablePred.exists_forall_not_of_not_exists_rePred_iff: a decidable proof relation that is sound for a non-r.e. predicate is incomplete.rePred_iff_exists_code: r.e. predicates are the domains of codes.
Computable predicates are closed under conjunction.
Computable predicates are closed under disjunction.
Computable predicates are closed under implication.
Substituting a computable function into a computable predicate gives a computable predicate.
Comparing two computable natural-number functions with ≤ is computable.
Comparing two computable natural-number functions with < is computable.
Bounded universal quantification preserves computability: if p a i is computable in
(a, i) and the bound f a is computable, then ∀ i < f a, p a i is computable.
Bounded existential quantification preserves computability: if p a i is computable in
(a, i) and the bound f a is computable, then ∃ i < f a, p a i is computable.
Existential quantification over the members of a list preserves computability: if p a b is
computable in (a, b) and the list f a is computable, then ∃ b ∈ f a, p a b is computable.
This is the computable analogue of Mathlib's PrimrecRel.exists_mem_list.
Unbounded existential quantification of a computable predicate is r.e.: search for a witness
by Nat.rfind over the codes of β.
Substituting a computable function into an r.e. predicate gives an r.e. predicate.
An r.e. predicate that implies a non-r.e. one misses a point, relative to a domain. If no
r.e. predicate agrees with p on D, then every r.e. S that implies p misses some point of D
where p holds.
An r.e. predicate that implies a non-r.e. one misses a point. If p is not r.e., every
r.e. S that implies p misses some point where p holds.
A sound decidable proof relation for a non-r.e. predicate is incomplete, relative to a
domain. If no r.e. predicate agrees with p on D, and P a b ("b is a proof of a") is
decidable and only points of p have proofs, then some point of D where p holds has no
proof.
A sound decidable proof relation for a non-r.e. predicate is incomplete. If p is not
r.e., and P a b ("b is a proof of a") is decidable and only points of p have proofs, then
some point where p holds has no proof.
A predicate is r.e. exactly when it is the domain of a code: p a holds iff the code c
halts on encode a.