diff options
author | 2006-09-26 12:13:06 +0000 | |
---|---|---|
committer | 2006-09-26 12:13:06 +0000 | |
commit | 4aec8fda1161953cf929b4e282eea9b672ab4058 (patch) | |
tree | eea4b8ab24fdea8fb05206b1764ce1ed3c752d72 /contrib/ring/LegacyNArithRing.v | |
parent | 351a500eada776832ac9b09657e42f5d6cd7210f (diff) |
commit de field + renommages
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@9179 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'contrib/ring/LegacyNArithRing.v')
-rw-r--r-- | contrib/ring/LegacyNArithRing.v | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/contrib/ring/LegacyNArithRing.v b/contrib/ring/LegacyNArithRing.v new file mode 100644 index 000000000..ee9fb3761 --- /dev/null +++ b/contrib/ring/LegacyNArithRing.v @@ -0,0 +1,46 @@ +(************************************************************************) +(* v * The Coq Proof Assistant / The Coq Development Team *) +(* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *) +(* \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 Import Bool. +Require Export LegacyRing. +Require Export ZArith_base. +Require Import NArith. +Require Import Eqdep_dec. + +Unboxed Definition Neq (n m:N) := + match (n ?= m)%N with + | Datatypes.Eq => true + | _ => false + end. + +Lemma Neq_prop : forall n m:N, Is_true (Neq n m) -> n = m. + intros n m H; unfold Neq in H. + apply Ncompare_Eq_eq. + destruct (n ?= m)%N; [ reflexivity | contradiction | contradiction ]. +Qed. + +Definition NTheory : Semi_Ring_Theory Nplus Nmult 1%N 0%N Neq. + split. + apply Nplus_comm. + apply Nplus_assoc. + apply Nmult_comm. + apply Nmult_assoc. + apply Nplus_0_l. + apply Nmult_1_l. + apply Nmult_0_l. + apply Nmult_plus_distr_r. +(* apply Nplus_reg_l.*) + apply Neq_prop. +Qed. + +Add Legacy Semi Ring + N Nplus Nmult 1%N 0%N Neq NTheory [ Npos 0%N xO xI 1%positive ]. |