Canonical option_eqMixin := EqMixin opt_eqP.Canonical option_eqType := Eval hnf in EqType (option T) option_eqMixin.Implicit Types u v : T1 + T2.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.

Lemma tagged_asE u x : tagged_as u (Tagged T_ x) = x.