(************************************************************************)
(*         *      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)         *)
(************************************************************************)
Set Implicit Arguments.
(** * Keys and datas used in the future MMaps *)
Module KeyDecidableType(D:DecidableType).
Local Open Scope signature_scope.
Local Notation key := D.t.
Definition eqk {elt} : relation (key*elt) := D.eq @@1.
Definition eqke {elt} : relation (key*elt) := D.eq * Logic.eq.
#[global]
Hint Unfold eqk eqke : core.
(** eqk, eqke are equalities *)
#[global]
Instance eqk_equiv {elt} : Equivalence (@eqk elt) := _.
#[global]
Instance eqke_equiv {elt} : Equivalence (@eqke elt) := _.
(** eqke is stricter than eqk *)
#[global]
Instance eqke_eqk {elt} : subrelation (@eqke elt) (@eqk elt).
#[global]
Hint Resolve InA_eqke_eqk : core.

Lemma InA_eqk {elt} p q (m:list (key*elt)) :
eqk p q -> InA eqk p m -> InA eqk q m.