From Undecidability.L Require Import L Tactics.LTactics LBool.
(*From Undecidability.L.Complexity Require Import Monotonic UpToC.*)
Class eqbClass X (eqb : X -> X -> bool): Type :=
_eqb_spec : forall (x y:X), reflect (x=y) (eqb x y).
Hint Mode eqbClass + -: typeclass_instances. (* treat argument as input and force evar-freeness*)
Definition eqb X eqb `{H:eqbClass (X:=X) eqb} := eqb.
Arguments eqb {_ _ _}: simpl never.
Instance eqbBool_inst : eqbClass Bool.eqb.

Lemma dec_reflect_remove {P Y} (d:dec P) b (H:reflect P b) (y y' : Y):
(if d then y else y') = (if b then y else y').