(************************************************************************)
(*         *   The Coq Proof Assistant / The Coq Development Team       *)
(*  v      *   INRIA, CNRS and contributors - Copyright 1999-2018       *)
(* <O___,, *       (see CREDITS file for the list of authors)           *)
(*   \VV/  **************************************************************)
(*    //   *    This file is distributed under the terms of the         *)
(*         *     GNU Lesser General Public License Version 2.1          *)
(*         *     (see LICENSE file for the text of the license)         *)
(************************************************************************)
(** John Major's Equality as proposed by Conor McBride  Reference:  [McBride] Elimination with a Motive, Proceedings of TYPES 2000, LNCS 2277, pp 197-216, 2002.  *)
Set Implicit Arguments.
Unset Elimination Schemes.
Inductive JMeq (A:Type) (x:A) : forall B:Type, B -> Prop :=
JMeq_refl : JMeq x x.
Set Elimination Schemes.
Arguments JMeq_refl {A x} , [A] x.
Register JMeq as core.JMeq.type.
Register JMeq_refl as core.JMeq.refl.
Hint Resolve JMeq_refl : core.
Definition JMeq_hom {A : Type} (x y : A) := JMeq x y.
Register JMeq_hom as core.JMeq.hom.
Hint Immediate JMeq_sym : core.
Register JMeq_sym as core.JMeq.sym.
Register JMeq_trans as core.JMeq.trans.
Register JMeq_ind as core.JMeq.ind.

Lemma JMeq_rect_r : forall (A:Type) (x:A) (P:A -> Type),
P x -> forall y, JMeq y x -> P y.