Section Dependent_Equality.
Variable U : Type.
Variable P : U -> Type.
(** Dependent equality *)
Inductive eq_dep (p:U) (x:P p) : forall q:U, P q -> Prop :=
eq_dep_intro : eq_dep p x p x.
Hint Constructors eq_dep: core.
Proof eq_dep_intro.
Hint Immediate eq_dep_sym: core.
Scheme eq_indd := Induction for eq Sort Prop.
(** Equivalent definition of dependent equality as a dependent pair of equalities *)
Inductive eq_dep1 (p:U) (x:P p) (q:U) (y:P q) : Prop :=
eq_dep1_intro : forall h:q = p, x = rew h in y -> eq_dep1 p x q y.
End Dependent_Equality.
Arguments eq_dep  [U P] p x q _.
Arguments eq_dep1 [U P] p x q y.
(** Dependent equality is equivalent to equality on dependent pairs *)
Notation equiv_eqex_eqdep := eq_sigT_iff_eq_dep (only parsing). (* Compat *)
(** Dependent equality is equivalent to a dependent pair of equalities *)
Set Implicit Arguments.

Lemma eq_sigT_sig_eq : forall X P (x1 x2:X) H1 H2, existT P x1 H1 = existT P x2 H2 <->
{H:x1=x2 | rew H in H1 = H2}.