Canonical option_eqMixin := EqMixin opt_eqP.
Canonical option_eqType := Eval hnf in EqType (option T) option_eqMixin.
End OptionEqType.
Arguments opt_eq {T} !u !v.
Section TaggedAs.
Variables (I : eqType) (T_ : I -> Type).
Implicit Types u v : {i : I & T_ i}.
Definition tagged_as u v :=
if tag u =P tag v is ReflectT eq_uv then
eq_rect_r T_ (tagged v) eq_uv
else tagged u.

(* Specifications: *)
Lemma tagged_asE u x : tagged_as u (Tagged T_ x) = x.
End TaggedAs.