(******************************************  Copied From Coq.Logic.JMeq.  No longer involving JMeq_eq, which is potentially inconsistenty with homotopy type theory.  TODO: let reflexivity, symmetry and transitivity work again.  ******************************************)
Definition JMeq {A:Type} (x:A) {B:Type} (y: B): Prop :=
{H: @eq Type A B | @eq_rect Type A (fun T: Type => T) x B H = y}.
Hint Resolve JMeq_refl.
Hint Immediate JMeq_sym.
(** [JMeq] is equivalent to [eq_dep Type (fun X => X)] *)
(** [eq_dep U P p x q y] is strictly finer than [JMeq (P p) x (P q) y] *)

Lemma eq_dep_JMeq :
forall (U: Type) (P: U -> Type) p x q y, eq_dep U P p x q y -> JMeq x y.