(************************************************************************)
(*         *      The Rocq Prover / The Rocq Development Team           *)
(*  v      *         Copyright INRIA, CNRS and contributors             *)
(* <O___,, * (see version control and CREDITS file for authors & dates) *)
(*   \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.
#[global]
Hint Resolve JMeq_refl : core.
Definition JMeq_hom {A : Type} (x y : A) := JMeq x y.
Register JMeq_hom as core.JMeq.hom.

Lemma JMeq_sym : forall (A B:Type) (x:A) (y:B), JMeq x y -> JMeq y x.
#[global]
Hint Immediate JMeq_sym : core.