Ltac InvBooleans :=
  match goal with
  | [ H: _ && _ = true |- _ ] =>
      destruct (andb_prop _ _ H); clear H; InvBooleans
  | [ H: _ || _ = false |- _ ] =>
      destruct (orb_false_elim _ _ H); clear H; InvBooleans
  | [ H: proj_sumbool ?x = true |- _ ] =>
      generalize (proj_sumbool_true _ H); clear H; intro; InvBooleans
  | _ => idtac
  end.

(* Specifications: *)
Lemma dec_eq_true: forall (x: A) (ifso ifnot: B), (if dec_eq x x then ifso else ifnot) = ifso.
Lemma dec_eq_false: forall (x y: A) (ifso ifnot: B), x <> y -> (if dec_eq x y then ifso else ifnot) = ifnot.
Lemma dec_eq_sym: forall (x y: A) (ifso ifnot: B), (if dec_eq x y then ifso else ifnot) = (if dec_eq y x then ifso else ifnot).
Lemma pred_dec_true: forall (a b: A), P -> (if dec then a else b) = a.
Lemma pred_dec_false: forall (a b: A), ~P -> (if dec then a else b) = b.
Lemma dec_eq_true: forall (x: A) (ifso ifnot: B), (if dec_eq x x then ifso else ifnot) = ifso.
Lemma dec_eq_false: forall (x y: A) (ifso ifnot: B), x <> y -> (if dec_eq x y then ifso else ifnot) = ifnot.
Lemma dec_eq_sym: forall (x y: A) (ifso ifnot: B), (if dec_eq x y then ifso else ifnot) = (if dec_eq y x then ifso else ifnot).
Lemma pred_dec_true: forall (a b: A), P -> (if dec then a else b) = a.
Lemma pred_dec_false: forall (a b: A), ~P -> (if dec then a else b) = b.