Notation "@ 'sval'" := (@proj1_sig) (at level 10, format "@ 'sval'").Notation id := (fun x => x).Definition id_head T u x : T := let: tt := u in x.Definition explicit_id_key := tt.Notation idfun := (id_head tt).Definition phant_id T1 T2 v1 v2 := phantom T1 v1 -> phantom T2 v2.Definition tag := projS1.Definition tagged : forall w, T_(tag w) := @projS2 I [eta T_].Definition Tagged x := @existS I [eta T_] i x.Definition tag2 (w : @sigT2 I T_ U_) := let: existT2 i _ _ := w in i.Definition tagged2 w : T_(tag2 w) := let: existT2 _ x _ := w in x.Definition tagged2' w : U_(tag2 w) := let: existT2 _ _ y := w in y.Definition Tagged2 x y := @existS2 I [eta T_] [eta U_] i x y.Coercion tag_of_tag2 I T_ U_ (w : @sigT2 I T_ U_) :=
  Tagged (fun i => T_ i * U_ i)%type (tagged2 w, tagged2' w).

Lemma all_tag2 I T U V : (forall i : I, {y : T i & U i y & V i y}) -> {f : forall i, T i & forall i, U i (f i) & forall i, V i (f i)}.