Library Coq.Logic.Decidable
Properties of decidable propositions
Definition decidable (
P:
Prop) :=
P \/ ~ P.
Theorem dec_not_not :
forall P:
Prop,
decidable P -> (
~ P ->
False) ->
P.
Theorem dec_True :
decidable True.
Theorem dec_False :
decidable False.
Theorem dec_or :
forall A B:
Prop,
decidable A ->
decidable B ->
decidable (
A \/ B).
Theorem dec_and :
forall A B:
Prop,
decidable A ->
decidable B ->
decidable (
A /\ B).
Theorem dec_not :
forall A:
Prop,
decidable A ->
decidable (
~ A).
Theorem dec_imp :
forall A B:
Prop,
decidable A ->
decidable B ->
decidable (
A ->
B).
Theorem dec_iff :
forall A B:
Prop,
decidable A ->
decidable B ->
decidable (
A<->B).
Theorem not_not :
forall P:
Prop,
decidable P ->
~ ~ P ->
P.
Theorem not_or :
forall A B:
Prop,
~ (A \/ B) ->
~ A /\ ~ B.
Theorem not_and :
forall A B:
Prop,
decidable A ->
~ (A /\ B) ->
~ A \/ ~ B.
Theorem not_imp :
forall A B:
Prop,
decidable A ->
~ (A ->
B) ->
A /\ ~ B.
Theorem imp_simp :
forall A B:
Prop,
decidable A -> (
A ->
B) ->
~ A \/ B.
Theorem not_iff :
forall A B:
Prop,
decidable A ->
decidable B ->
~ (A <-> B) ->
(A /\ ~ B) \/ (~ A /\ B).
Results formulated with iff, used in FSetDecide.
Negation are expanded since it is unclear whether setoid rewrite
will always perform conversion.
We begin with lemmas that, when read from left to right,
can be understood as ways to eliminate uses of
not.
Moving Negations Around:
We have four lemmas that, when read from left to right,
describe how to push negations toward the leaves of a
proposition and, when read from right to left, describe
how to pull negations toward the top of a proposition.
With the following hint database, we can leverage auto to check
decidability of propositions.
solve_decidable using lib will solve goals about the
decidability of a proposition, assisted by an auxiliary
database of lemmas. The database is intended to contain
lemmas stating the decidability of base propositions,
(e.g., the decidability of equality on a particular
inductive type).
Tactic Notation "solve_decidable" "using"
ident(
db) :=
match goal with
| |-
decidable _ =>
solve [
auto 100
with decidable_prop db ]
end.
Tactic Notation "solve_decidable" :=
solve_decidable using core.