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.

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