(** Propagation rules for decisions *)
Fact dec_transfer P Q :
P <-> Q -> dec P -> dec Q.
Instance bool_dec (b: bool) :
dec b.
Instance True_dec :
dec True.
Instance False_dec :
dec False.
Instance impl_dec (X Y : Prop) :
dec X -> dec Y -> dec (X -> Y).
Instance and_dec (X Y : Prop) :
dec X -> dec Y -> dec (X /\ Y).
Instance or_dec (X Y : Prop) :
dec X -> dec Y -> dec (X \/ Y).
(* Coq standard modules make "not" and "iff" opaque for type class inference, can be seen with Print HintDb typeclass_instances. *)
Instance not_dec (X : Prop) :
dec X -> dec (~ X).
Instance iff_dec (X Y : Prop) :
dec X -> dec Y -> dec (X <-> Y).
(** ** Discrete types *)
Notation "'eq_dec' X" := (forall x y : X, dec (x=y)) (at level 70).
Structure eqType := EqType {
eqType_X :> Type;
eqType_dec : eq_dec eqType_X }.
Arguments EqType X {_} : rename.
Canonical Structure eqType_CS X (A: eq_dec X) := EqType X.
Existing Instance eqType_dec.
Instance unit_eq_dec :
eq_dec unit.
Instance bool_eq_dec :
eq_dec bool.
Instance True_eq_dec:
eq_dec True.
Instance False_eq_dec:
eq_dec False.
Export ListNotations.
Notation "x 'el' A" := (In x A) (at level 70).
Notation "A <<= B" := (incl A B) (at level 70).
Notation "| A |" := (length A) (at level 65).
Definition equi X (A B : list X) : Prop := incl A B /\ incl B A.
Notation "A === B" := (equi A B) (at level 70).
Hint Unfold equi.
Hint Extern 4 =>
match goal with
|[ H: ?x el nil |- _ ] => destruct H
end.
(** ** Lists *)
(* Register additional simplification rules with autorewrite / simpl_list *)
(* Print Rewrite HintDb list. *)
Hint Rewrite <- app_assoc : list.
Hint Rewrite rev_app_distr map_app prod_length : list.

Lemma list_cycle  (X : Type) (A : list X) x :
x::A <> A.