Set Implicit Arguments.
Class Dec (P: Prop) := dec: {P} + {~P}.
Arguments dec _ {_}.
Class Dec1 {X} (p: X -> Prop) := dec1: forall x, Dec (p x).
Arguments dec1 {_} _ {_}.
Class Dec2 {X Y} (p: X -> Y -> Prop) :=  dec2: forall x, Dec1 (p x).
Arguments dec2 {_} {_} _ {_}.
Instance dec_conj P Q: Dec P -> Dec Q -> Dec (P /\ Q).
Instance dec_disj P Q: Dec P -> Dec Q -> Dec (P \/ Q).
Instance dec_imp P Q: Dec P -> Dec Q -> Dec (P -> Q).
Instance dec_iff P Q: Dec P -> Dec Q -> Dec (P <-> Q).
Instance dec_neg P: Dec P -> Dec (~ P).

Lemma iff_dec P Q: Q <-> P -> Dec P -> Dec Q.