diff options
author | herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2003-10-22 13:44:29 +0000 |
---|---|---|
committer | herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2003-10-22 13:44:29 +0000 |
commit | 9aeac0df74777ea90f7024326492f8c8570214e0 (patch) | |
tree | 1f36bfd6dae4e98256a117ac754f774c18cc4dc8 /contrib/ring/NArithRing.v | |
parent | c37e5403c5dc2583bff2f388c528f593c9e08c6c (diff) |
Ajout NArithRing
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@4703 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'contrib/ring/NArithRing.v')
-rw-r--r-- | contrib/ring/NArithRing.v | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/contrib/ring/NArithRing.v b/contrib/ring/NArithRing.v new file mode 100644 index 000000000..27fd0f993 --- /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]. |