Section sum_eqb.
Variable X Y : Type.
Variable eqb__X : X -> X -> bool.
Variable spec__X : forall x y, reflect (x = y) (eqb__X x y).
Variable eqb__Y : Y -> Y -> bool.
Variable spec__Y : forall x y, reflect (x = y) (eqb__Y x y).
Definition sum_eqb (A B : X + Y) :=
match A,B with
| inl a,inl b => eqb__X a b
| inr a,inr b => eqb__Y a b
| _,_ => false
end.

Lemma sum_eqb_spec A B : reflect (A = B) (sum_eqb A B).