Section OptionEq.
Variable T : Type.
Variable EDT : RelDec (@eq T).
(** Specialization for equality **)
Global Instance RelDec_eq_option : RelDec (@eq (option T)) :=
{ rel_dec := fun x y =>
match x , y with
| None , None => true
| Some x , Some y => eq_dec x y
| _ , _ => false
end }.
Variable EDCT : RelDec_Correct EDT.
Global Instance RelDec_Correct_eq_option : RelDec_Correct RelDec_eq_option.
End OptionEq.

Lemma eq_option_eq
: forall T (a b : T) (pf : a = b) (F : _ -> Type) val,
match pf in _ = x return option (F x) with
| eq_refl => val
end = match val with
| None => None
| Some val => Some match pf in _ = x return F x with
| eq_refl => val
end
end.