diff options
author | 2013-05-08 18:03:54 +0200 | |
---|---|---|
committer | 2013-05-08 18:03:54 +0200 | |
commit | db38bb4ad9aff74576d3b7f00028d48f0447d5bd (patch) | |
tree | 09dafc3e5c7361d3a28e93677eadd2b7237d4f9f /theories/Arith/Minus.v | |
parent | 6e34b272d789455a9be589e27ad3a998cf25496b (diff) | |
parent | 499a11a45b5711d4eaabe84a80f0ad3ae539d500 (diff) |
Merge branch 'experimental/upstream' into upstream
Diffstat (limited to 'theories/Arith/Minus.v')
-rw-r--r-- | theories/Arith/Minus.v | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/theories/Arith/Minus.v b/theories/Arith/Minus.v index 1b36f236..48024331 100644 --- a/theories/Arith/Minus.v +++ b/theories/Arith/Minus.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 *) (************************************************************************) -(*i $Id: Minus.v 14641 2011-11-06 11:59:10Z herbelin $ i*) - (** [minus] (difference between two natural numbers) is defined in [Init/Peano.v] as: << Fixpoint minus (n m:nat) : nat := @@ -23,7 +21,7 @@ where "n - m" := (minus n m) : nat_scope. Require Import Lt. Require Import Le. -Open Local Scope nat_scope. +Local Open Scope nat_scope. Implicit Types m n p : nat. @@ -31,7 +29,7 @@ Implicit Types m n p : nat. Lemma minus_n_O : forall n, n = n - 0. Proof. - induction n; simpl in |- *; auto with arith. + induction n; simpl; auto with arith. Qed. Hint Resolve minus_n_O: arith v62. @@ -39,21 +37,21 @@ Hint Resolve minus_n_O: arith v62. Lemma minus_Sn_m : forall n m, m <= n -> S (n - m) = S n - m. Proof. - intros n m Le; pattern m, n in |- *; apply le_elim_rel; simpl in |- *; + intros n m Le; pattern m, n; apply le_elim_rel; simpl; auto with arith. Qed. Hint Resolve minus_Sn_m: arith v62. Theorem pred_of_minus : forall n, pred n = n - 1. Proof. - intro x; induction x; simpl in |- *; auto with arith. + intro x; induction x; simpl; auto with arith. Qed. (** * Diagonal *) Lemma minus_diag : forall n, n - n = 0. Proof. - induction n; simpl in |- *; auto with arith. + induction n; simpl; auto with arith. Qed. Lemma minus_diag_reverse : forall n, 0 = n - n. @@ -68,7 +66,7 @@ Notation minus_n_n := minus_diag_reverse. Lemma minus_plus_simpl_l_reverse : forall n m p, n - m = p + n - (p + m). Proof. - induction p; simpl in |- *; auto with arith. + induction p; simpl; auto with arith. Qed. Hint Resolve minus_plus_simpl_l_reverse: arith v62. @@ -76,7 +74,7 @@ Hint Resolve minus_plus_simpl_l_reverse: arith v62. Lemma plus_minus : forall n m p, n = m + p -> p = n - m. Proof. - intros n m p; pattern m, n in |- *; apply nat_double_ind; simpl in |- *; + intros n m p; pattern m, n; apply nat_double_ind; simpl; intros. replace (n0 - 0) with n0; auto with arith. absurd (0 = S (n0 + p)); auto with arith. @@ -85,20 +83,20 @@ Qed. Hint Immediate plus_minus: arith v62. Lemma minus_plus : forall n m, n + m - n = m. - symmetry in |- *; auto with arith. + symmetry ; auto with arith. Qed. Hint Resolve minus_plus: arith v62. Lemma le_plus_minus : forall n m, n <= m -> m = n + (m - n). Proof. - intros n m Le; pattern n, m in |- *; apply le_elim_rel; simpl in |- *; + intros n m Le; pattern n, m; apply le_elim_rel; simpl; auto with arith. Qed. Hint Resolve le_plus_minus: arith v62. Lemma le_plus_minus_r : forall n m, n <= m -> n + (m - n) = m. Proof. - symmetry in |- *; auto with arith. + symmetry ; auto with arith. Qed. Hint Resolve le_plus_minus_r: arith v62. @@ -134,7 +132,7 @@ Qed. Lemma lt_minus : forall n m, m <= n -> 0 < m -> n - m < n. Proof. - intros n m Le; pattern m, n in |- *; apply le_elim_rel; simpl in |- *; + intros n m Le; pattern m, n; apply le_elim_rel; simpl; auto using le_minus with arith. intros; absurd (0 < 0); auto with arith. Qed. @@ -142,7 +140,7 @@ Hint Resolve lt_minus: arith v62. Lemma lt_O_minus_lt : forall n m, 0 < n - m -> m < n. Proof. - intros n m; pattern n, m in |- *; apply nat_double_ind; simpl in |- *; + intros n m; pattern n, m; apply nat_double_ind; simpl; auto with arith. intros; absurd (0 < 0); trivial with arith. Qed. @@ -150,9 +148,9 @@ Hint Immediate lt_O_minus_lt: arith v62. Theorem not_le_minus_0 : forall n m, ~ m <= n -> n - m = 0. Proof. - intros y x; pattern y, x in |- *; apply nat_double_ind; - [ simpl in |- *; trivial with arith + intros y x; pattern y, x; apply nat_double_ind; + [ simpl; trivial with arith | intros n H; absurd (0 <= S n); [ assumption | apply le_O_n ] - | simpl in |- *; intros n m H1 H2; apply H1; unfold not in |- *; intros H3; + | simpl; intros n m H1 H2; apply H1; unfold not; intros H3; apply H2; apply le_n_S; assumption ]. Qed. |