From fc2613e871dffffa788d90044a81598f671d0a3b Mon Sep 17 00:00:00 2001 From: letouzey Date: Thu, 5 Jul 2012 16:56:16 +0000 Subject: ZArith + other : favor the use of modern names instead of compat notations - For instance, refl_equal --> eq_refl - Npos, Zpos, Zneg now admit more uniform qualified aliases N.pos, Z.pos, Z.neg. - A new module BinInt.Pos2Z with results about injections from positive to Z - A result about Z.pow pushed in the generic layer - Zmult_le_compat_{r,l} --> Z.mul_le_mono_nonneg_{r,l} - Using tactic Z.le_elim instead of Zle_lt_or_eq - Some cleanup in ring, field, micromega (use of "Equivalence", "Proper" ...) - Some adaptions in QArith (for instance changed Qpower.Qpower_decomp) - In ZMake and ZMake, functor parameters are now named NN and ZZ instead of N and Z for avoiding confusions git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@15515 85f007b7-540e-0410-9357-904b9bb8a0f7 --- test-suite/micromega/example.v | 10 +++++----- test-suite/micromega/square.v | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'test-suite/micromega') diff --git a/test-suite/micromega/example.v b/test-suite/micromega/example.v index f5a953566..4a1231b35 100644 --- a/test-suite/micromega/example.v +++ b/test-suite/micromega/example.v @@ -77,13 +77,13 @@ Definition rbound2 (C:Z -> Z -> Z) : Prop := Lemma bounded_drift : forall s t p q C D, s <= t /\ correct p t /\ correct q t /\ rbound1 C /\ rbound2 C /\ rbound1 D /\ rbound2 D -> - Zabs (C p t - D q t) <= Zabs (C p s - D q s) + 2 * rho * (t- s). + Z.abs (C p t - D q t) <= Z.abs (C p s - D q s) + 2 * rho * (t- s). Proof. intros. - generalize (Zabs_eq (C p t - D q t)). - generalize (Zabs_non_eq (C p t - D q t)). - generalize (Zabs_eq (C p s -D q s)). - generalize (Zabs_non_eq (C p s - D q s)). + generalize (Z.abs_eq (C p t - D q t)). + generalize (Z.abs_neq (C p t - D q t)). + generalize (Z.abs_eq (C p s -D q s)). + generalize (Z.abs_neq (C p s - D q s)). unfold rbound2 in H. unfold rbound1 in H. intuition. diff --git a/test-suite/micromega/square.v b/test-suite/micromega/square.v index 4c00ffe4a..6fa547358 100644 --- a/test-suite/micromega/square.v +++ b/test-suite/micromega/square.v @@ -9,17 +9,17 @@ Require Import ZArith Zwf Psatz QArith. Open Scope Z_scope. -Lemma Zabs_square : forall x, (Zabs x)^2 = x^2. +Lemma Z.abs_square : forall x, (Z.abs x)^2 = x^2. Proof. intros ; case (Zabs_dec x) ; intros ; psatz Z 2. Qed. -Hint Resolve Zabs_pos Zabs_square. +Hint Resolve Z.abs_nonneg Z.abs_square. Lemma integer_statement : ~exists n, exists p, n^2 = 2*p^2 /\ n <> 0. Proof. -intros [n [p [Heq Hnz]]]; pose (n' := Zabs n); pose (p':=Zabs p). -assert (facts : 0 <= Zabs n /\ 0 <= Zabs p /\ Zabs n^2=n^2 - /\ Zabs p^2 = p^2) by auto. +intros [n [p [Heq Hnz]]]; pose (n' := Z.abs n); pose (p':=Z.abs p). +assert (facts : 0 <= Z.abs n /\ 0 <= Z.abs p /\ Z.abs n^2=n^2 + /\ Z.abs p^2 = p^2) by auto. assert (H : (0 < n' /\ 0 <= p' /\ n' ^2 = 2* p' ^2)) by (destruct facts as [Hf1 [Hf2 [Hf3 Hf4]]]; unfold n', p' ; psatz Z 2). generalize p' H; elim n' using (well_founded_ind (Zwf_well_founded 0)); clear. @@ -35,7 +35,7 @@ Lemma QnumZpower : forall x : Q, Qnum (x ^ 2)%Q = ((Qnum x) ^ 2) %Z. Proof. intros. destruct x. - cbv beta iota zeta delta - [Zmult]. + cbv beta iota zeta delta - [Z.mul]. ring. Qed. @@ -45,15 +45,15 @@ Proof. intros. destruct x. simpl. - unfold Zpower_pos. + unfold Z.pow_pos. simpl. - rewrite Pmult_1_r. + rewrite Pos.mul_1_r. reflexivity. Qed. Theorem sqrt2_not_rational : ~exists x:Q, x^2==2#1. Proof. - unfold Qeq; intros [x]; simpl (Qden (2#1)); rewrite Zmult_1_r. + unfold Qeq; intros [x]; simpl (Qden (2#1)); rewrite Z.mul_1_r. intros HQeq. assert (Heq : (Qnum x ^ 2 = 2 * ' Qden x ^ 2%Q)%Z) by (rewrite QnumZpower in HQeq ; rewrite QdenZpower in HQeq ; auto). -- cgit v1.2.3