coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Chris Dams <chris.dams.nl AT gmail.com>
- To: coq-club <coq-club AT inria.fr>
- Subject: [Coq-Club] How to use Notations inside of Modules?
- Date: Thu, 25 Dec 2014 10:17:53 +0100
Hello all,
Any hints?
Chris
Require Import NArith.
Delimit Scope ord_scope with ord.
Module Type OrderedType.
Axiom S: Set.
Axiom lt: S -> S -> Prop.
Axiom lt_trans: forall i j k: S, lt i j -> lt j k -> lt i k.
End OrderedType.
Module OrderedTypeFacts (M: OrderedType).
Definition gt (i j: M.S) := M.lt j i.
Notation "i < j" := (M.lt i j): ord_scope.
Notation "i > j" := (gt i j): ord_scope.
(* Here my axiom is fine, no probs using the notation *)
Axiom int32_lt_to_gt:
forall i j: M.S,
(i < j)%ord ->
(j > i)%ord.
End OrderedTypeFacts.
Definition int32: Set
:= { n: N | (n < 2^32)%N }.
Inductive int32_lt: int32 -> int32 -> Prop
:= mk_int32_lt:
forall i j: N,
forall H1: (i < 2^32)%N,
forall H2: (j < 2^32)%N,
(i < j)%N ->
int32_lt (exist _ i H1) (exist _ j H2).
Theorem int32_lt_trans:
forall i j k: int32,
int32_lt i j ->
int32_lt j k ->
int32_lt i k.
Proof.
intros [i H1] [j H2] [k H3] H4 H5.
inversion H4 as [l m H6 H7 H8 H9 H10].
inversion H5 as [n p H11 H12 H13 H14 H15].
apply mk_int32_lt.
apply Nlt_trans with (m := j); assumption.
Qed.
Module int32_OrderedType <: OrderedType.
Definition S := int32.
Definition lt := int32_lt.
Definition lt_trans := int32_lt_trans.
End int32_OrderedType.
Module int32 := OrderedTypeFacts int32_OrderedType.
Axiom int32_lt_to_gt:
forall i j: int32,
(i < j)%ord ->
(j > i)%ord.
forall i j: int32,
(i < j)%ord ->
(j > i)%ord.
- [Coq-Club] How to use Notations inside of Modules?, Chris Dams, 12/25/2014
- RE: [Coq-Club] How to use Notations inside of Modules?, Perce Strop, 12/25/2014
- Re: [Coq-Club] How to use Notations inside of Modules?, Chris Dams, 12/28/2014
- RE: [Coq-Club] How to use Notations inside of Modules?, Perce Strop, 12/28/2014
- Re: [Coq-Club] How to use Notations inside of Modules?, Chris Dams, 12/29/2014
- RE: [Coq-Club] How to use Notations inside of Modules?, Perce Strop, 12/28/2014
- Re: [Coq-Club] How to use Notations inside of Modules?, Chris Dams, 12/28/2014
- RE: [Coq-Club] How to use Notations inside of Modules?, Perce Strop, 12/25/2014
Archive powered by MHonArc 2.6.18.