diff options
Diffstat (limited to 'plugins/ring/LegacyNArithRing.v')
-rw-r--r-- | plugins/ring/LegacyNArithRing.v | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/plugins/ring/LegacyNArithRing.v b/plugins/ring/LegacyNArithRing.v index ae7e62e0..7f1597a1 100644 --- a/plugins/ring/LegacyNArithRing.v +++ b/plugins/ring/LegacyNArithRing.v @@ -1,13 +1,11 @@ (************************************************************************) (* v * The Coq Proof Assistant / The Coq Development Team *) -(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2011 *) +(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2012 *) (* \VV/ **************************************************************) (* // * This file is distributed under the terms of the *) (* * GNU Lesser General Public License Version 2.1 *) (************************************************************************) -(* $Id: LegacyNArithRing.v 14641 2011-11-06 11:59:10Z herbelin $ *) - (* Instantiation of the Ring tactic for the binary natural numbers *) Require Import Bool. @@ -16,7 +14,7 @@ Require Export ZArith_base. Require Import NArith. Require Import Eqdep_dec. -Unboxed Definition Neq (n m:N) := +Definition Neq (n m:N) := match (n ?= m)%N with | Datatypes.Eq => true | _ => false @@ -24,23 +22,22 @@ Unboxed Definition Neq (n m:N) := 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. + apply N.compare_eq. destruct (n ?= m)%N; [ reflexivity | contradiction | contradiction ]. Qed. -Definition NTheory : Semi_Ring_Theory Nplus Nmult 1%N 0%N Neq. +Definition NTheory : Semi_Ring_Theory N.add N.mul 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 N.add_comm. + apply N.add_assoc. + apply N.mul_comm. + apply N.mul_assoc. + apply N.add_0_l. + apply N.mul_1_l. + apply N.mul_0_l. + apply N.mul_add_distr_r. apply Neq_prop. Qed. Add Legacy Semi Ring - N Nplus Nmult 1%N 0%N Neq NTheory [ Npos 0%N xO xI 1%positive ]. + N N.add N.mul 1%N 0%N Neq NTheory [ Npos 0%N xO xI 1%positive ]. |