(** * Shallow equivalence *)
(** Equality under [observe]:  [[ observing eq t1 t2 <-> t1.(observe) = t2.(observe) ]]  We actually define a more general relation transformer [observing] to lift arbitrary relations through [observe]. *)
(* begin hide *)
Classes.RelationClasses
Classes.Morphisms
Setoids.Setoid
Relations.Relations
JMeq.
(* end hide *)

(* This exists in the stdlib as [ProofIrrelevance.inj_pair2], but we reprove it to not depend on proof irrelevance (we use axiom [JMeq.JMeq_eq] instead) *)
Lemma inj_pair2 :
forall (U : Type) (P : U -> Type) (p : U) (x y : P p),
existT P p x = existT P p y -> x = y.