diff options
author | letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2010-02-09 17:45:06 +0000 |
---|---|---|
committer | letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2010-02-09 17:45:06 +0000 |
commit | c4b5c7ebd6f316bb53e1a53f94c367f4f0129dae (patch) | |
tree | c7c1c9e7f381923ab04b0ba01a14d803e2b3eb71 /theories/Arith | |
parent | bf90d39cec401f5daad2eb26c915ceba65e1a5cc (diff) |
Numbers: properties of min/max with respect to 0,S,P,add,sub,mul
With these properties, we can kill Arith/MinMax, NArith/Nminmax,
and leave ZArith/Zminmax as a compatibility file only. Now
the instanciations NPeano.Nat, NBinary.N, ZBinary.Z, BigZ, BigN
contains all theses facts.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12718 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'theories/Arith')
-rw-r--r-- | theories/Arith/Max.v | 21 | ||||
-rw-r--r-- | theories/Arith/Min.v | 15 | ||||
-rw-r--r-- | theories/Arith/MinMax.v | 62 | ||||
-rw-r--r-- | theories/Arith/vo.itarget | 1 |
4 files changed, 20 insertions, 79 deletions
diff --git a/theories/Arith/Max.v b/theories/Arith/Max.v index e49251a71..036b47ba2 100644 --- a/theories/Arith/Max.v +++ b/theories/Arith/Max.v @@ -8,21 +8,20 @@ (*i $Id$ i*) -(** THIS FILE IS DEPRECATED. Use [NPeano] and [MinMax] instead. *) +(** THIS FILE IS DEPRECATED. Use [NPeano.Nat] instead. *) Require Import NPeano. -Require Export MinMax. Local Open Scope nat_scope. Implicit Types m n p : nat. Notation max := NPeano.max (only parsing). -Definition max_0_l := max_0_l. -Definition max_0_r := max_0_r. -Definition succ_max_distr := succ_max_distr. -Definition plus_max_distr_l := plus_max_distr_l. -Definition plus_max_distr_r := plus_max_distr_r. +Definition max_0_l := Nat.max_0_l. +Definition max_0_r := Nat.max_0_r. +Definition succ_max_distr := Nat.succ_max_distr. +Definition plus_max_distr_l := Nat.add_max_distr_l. +Definition plus_max_distr_r := Nat.add_max_distr_r. Definition max_case_strong := Nat.max_case_strong. Definition max_spec := Nat.max_spec. Definition max_dec := Nat.max_dec. @@ -41,5 +40,11 @@ Definition max_lub := Nat.max_lub. (* begin hide *) (* Compatibility *) Notation max_case2 := max_case (only parsing). -Notation max_SS := succ_max_distr (only parsing). +Notation max_SS := Nat.succ_max_distr (only parsing). (* end hide *) + +Hint Resolve + Nat.max_l Nat.max_r Nat.le_max_l Nat.le_max_r : arith v62. + +Hint Resolve + Nat.min_l Nat.min_r Nat.le_min_l Nat.le_min_r : arith v62. diff --git a/theories/Arith/Min.v b/theories/Arith/Min.v index 44060b56c..521285a08 100644 --- a/theories/Arith/Min.v +++ b/theories/Arith/Min.v @@ -8,21 +8,20 @@ (*i $Id$ i*) -(** THIS FILE IS DEPRECATED. Use [NPeano] and [MinMax] instead. *) +(** THIS FILE IS DEPRECATED. Use [NPeano.Nat] instead. *) Require Import NPeano. -Require Export MinMax. Open Local Scope nat_scope. Implicit Types m n p : nat. Notation min := NPeano.min (only parsing). -Definition min_0_l := min_0_l. -Definition min_0_r := min_0_r. -Definition succ_min_distr := succ_min_distr. -Definition plus_min_distr_l := plus_min_distr_l. -Definition plus_min_distr_r := plus_min_distr_r. +Definition min_0_l := Nat.min_0_l. +Definition min_0_r := Nat.min_0_r. +Definition succ_min_distr := Nat.succ_min_distr. +Definition plus_min_distr_l := Nat.add_min_distr_l. +Definition plus_min_distr_r := Nat.add_min_distr_r. Definition min_case_strong := Nat.min_case_strong. Definition min_spec := Nat.min_spec. Definition min_dec := Nat.min_dec. @@ -41,5 +40,5 @@ Definition min_glb := Nat.min_glb. (* begin hide *) (* Compatibility *) Notation min_case2 := min_case (only parsing). -Notation min_SS := succ_min_distr (only parsing). +Notation min_SS := Nat.succ_min_distr (only parsing). (* end hide *)
\ No newline at end of file diff --git a/theories/Arith/MinMax.v b/theories/Arith/MinMax.v deleted file mode 100644 index 9ce43ab8c..000000000 --- a/theories/Arith/MinMax.v +++ /dev/null @@ -1,62 +0,0 @@ -(************************************************************************) -(* 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 *) -(************************************************************************) - -Require Import Orders NPeano. - -(** The Definition of maximum and minimum of two natural numbers - is now in NPeano, as well as generic properties. *) - -(** * Properties specific to the [nat] domain *) - -(** Simplifications *) - -Lemma max_0_l : forall n, max 0 n = n. -Proof. reflexivity. Qed. - -Lemma max_0_r : forall n, max n 0 = n. -Proof. destruct n; auto. Qed. - -Lemma min_0_l : forall n, min 0 n = 0. -Proof. reflexivity. Qed. - -Lemma min_0_r : forall n, min n 0 = 0. -Proof. destruct n; auto. Qed. - -(** Compatibilities (consequences of monotonicity) *) - -Lemma succ_max_distr : forall n m, S (max n m) = max (S n) (S m). -Proof. auto. Qed. - -Lemma succ_min_distr : forall n m, S (min n m) = min (S n) (S m). -Proof. auto. Qed. - -Lemma plus_max_distr_l : forall n m p, max (p + n) (p + m) = p + max n m. -Proof. -intros. apply Nat.max_monotone. repeat red; auto with arith. -Qed. - -Lemma plus_max_distr_r : forall n m p, max (n + p) (m + p) = max n m + p. -Proof. -intros. apply Nat.max_monotone with (f:=fun x => x + p). -repeat red; auto with arith. -Qed. - -Lemma plus_min_distr_l : forall n m p, min (p + n) (p + m) = p + min n m. -Proof. -intros. apply Nat.min_monotone. repeat red; auto with arith. -Qed. - -Lemma plus_min_distr_r : forall n m p, min (n + p) (m + p) = min n m + p. -Proof. -intros. apply Nat.min_monotone with (f:=fun x => x + p). -repeat red; auto with arith. -Qed. - -Hint Resolve - Nat.max_l Nat.max_r Nat.le_max_l Nat.le_max_r - Nat.min_l Nat.min_r Nat.le_min_l Nat.le_min_r : arith v62. diff --git a/theories/Arith/vo.itarget b/theories/Arith/vo.itarget index d8bff0ab9..0b6564e15 100644 --- a/theories/Arith/vo.itarget +++ b/theories/Arith/vo.itarget @@ -19,4 +19,3 @@ Mult.vo Peano_dec.vo Plus.vo Wf_nat.vo -MinMax.vo |