aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorherbelin2003-10-22 13:44:29 +0000
committerherbelin2003-10-22 13:44:29 +0000
commit9aeac0df74777ea90f7024326492f8c8570214e0 (patch)
tree1f36bfd6dae4e98256a117ac754f774c18cc4dc8
parentc37e5403c5dc2583bff2f388c528f593c9e08c6c (diff)
Ajout NArithRing
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@4703 85f007b7-540e-0410-9357-904b9bb8a0f7
-rw-r--r--Makefile1
-rw-r--r--contrib/ring/NArithRing.v43
2 files changed, 44 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index be973fe596..69dbf1c107 100644
--- a/Makefile
+++ b/Makefile
@@ -704,6 +704,7 @@ ROMEGAVO=\
RINGVO=\
contrib/ring/ArithRing.vo contrib/ring/Ring_normalize.vo \
contrib/ring/Ring_theory.vo contrib/ring/Ring.vo \
+ contrib/ring/NArithRing.vo \
contrib/ring/ZArithRing.vo contrib/ring/Ring_abstract.vo \
contrib/ring/Quote.vo contrib/ring/Setoid_ring_normalize.vo \
contrib/ring/Setoid_ring.vo contrib/ring/Setoid_ring_theory.vo
diff --git a/contrib/ring/NArithRing.v b/contrib/ring/NArithRing.v
new file mode 100644
index 0000000000..27fd0f9938
--- /dev/null
+++ b/contrib/ring/NArithRing.v
@@ -0,0 +1,43 @@
+(***********************************************************************)
+(* v * The Coq Proof Assistant / The Coq Development Team *)
+(* <O___,, * INRIA-Rocquencourt & LRI-CNRS-Orsay *)
+(* \VV/ *************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(***********************************************************************)
+
+(* $Id$ *)
+
+(* Instantiation of the Ring tactic for the binary natural numbers *)
+
+Require Export ArithRing.
+Require Export ZArith_base.
+Require Eqdep_dec.
+
+Definition Neq := [n,m:entier]
+ Cases (Ncompare n m) of
+ EGAL => true
+ | _ => false
+ end.
+
+Lemma Neq_prop : (n,m:entier)(Is_true (Neq n m)) -> n=m.
+ Intros n m H; Unfold Neq in H.
+ Apply Ncompare_Eq_eq.
+ NewDestruct (Ncompare n m); [Reflexivity | Contradiction | Contradiction ].
+Save.
+
+Definition NTheory : (Semi_Ring_Theory Nplus Nmult (Pos xH) Nul Neq).
+ Split.
+ Apply Nplus_comm.
+ Symmetry; Apply Nplus_assoc_l.
+ Apply Nmult_comm.
+ Symmetry; Apply Nmult_assoc_l.
+ Apply Nplus_0_l.
+ Apply Nmult_1_l.
+ Apply Nmult_0_l.
+ Apply Nmult_Nplus_distr_l.
+ Apply Nplus_reg_l.
+ Apply Neq_prop.
+Save.
+
+Add Semi Ring entier Nplus Nmult (Pos xH) Nul Neq NTheory [Pos Nul xO xI xH].