diff options
author | Samuel Mimram <samuel.mimram@ens-lyon.org> | 2004-07-28 21:54:47 +0000 |
---|---|---|
committer | Samuel Mimram <samuel.mimram@ens-lyon.org> | 2004-07-28 21:54:47 +0000 |
commit | 6b649aba925b6f7462da07599fe67ebb12a3460e (patch) | |
tree | 43656bcaa51164548f3fa14e5b10de5ef1088574 /contrib/ring/NArithRing.v |
Imported Upstream version 8.0pl1upstream/8.0pl1
Diffstat (limited to 'contrib/ring/NArithRing.v')
-rw-r--r-- | contrib/ring/NArithRing.v | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/contrib/ring/NArithRing.v b/contrib/ring/NArithRing.v new file mode 100644 index 00000000..cfec29ce --- /dev/null +++ b/contrib/ring/NArithRing.v @@ -0,0 +1,44 @@ +(************************************************************************) +(* 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: NArithRing.v,v 1.5.2.1 2004/07/16 19:30:13 herbelin Exp $ *) + +(* Instantiation of the Ring tactic for the binary natural numbers *) + +Require Export Ring. +Require Export ZArith_base. +Require Import NArith. +Require Import Eqdep_dec. + +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 Semi Ring N Nplus Nmult 1%N 0%N Neq NTheory [ Npos 0%N xO xI 1%positive ].
\ No newline at end of file |