From 6b649aba925b6f7462da07599fe67ebb12a3460e Mon Sep 17 00:00:00 2001 From: Samuel Mimram Date: Wed, 28 Jul 2004 21:54:47 +0000 Subject: Imported Upstream version 8.0pl1 --- theories/Arith/Min.v | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100755 theories/Arith/Min.v (limited to 'theories/Arith/Min.v') diff --git a/theories/Arith/Min.v b/theories/Arith/Min.v new file mode 100755 index 00000000..912e7ba3 --- /dev/null +++ b/theories/Arith/Min.v @@ -0,0 +1,83 @@ +(************************************************************************) +(* v * The Coq Proof Assistant / The Coq Development Team *) +(* 0 + | S n', O => 0 + | S n', S m' => S (min n' m') + end. + +(** Simplifications of [min] *) + +Lemma min_SS : forall n m, S (min n m) = min (S n) (S m). +Proof. +auto with arith. +Qed. + +Lemma min_comm : forall n m, min n m = min m n. +Proof. +induction n; induction m; simpl in |- *; auto with arith. +Qed. + +(** [min] and [le] *) + +Lemma min_l : forall n m, n <= m -> min n m = n. +Proof. +induction n; induction m; simpl in |- *; auto with arith. +Qed. + +Lemma min_r : forall n m, m <= n -> min n m = m. +Proof. +induction n; induction m; simpl in |- *; auto with arith. +Qed. + +Lemma le_min_l : forall n m, min n m <= n. +Proof. +induction n; intros; simpl in |- *; auto with arith. +elim m; intros; simpl in |- *; auto with arith. +Qed. + +Lemma le_min_r : forall n m, min n m <= m. +Proof. +induction n; simpl in |- *; auto with arith. +induction m; simpl in |- *; auto with arith. +Qed. +Hint Resolve min_l min_r le_min_l le_min_r: arith v62. + +(** [min n m] is equal to [n] or [m] *) + +Lemma min_dec : forall n m, {min n m = n} + {min n m = m}. +Proof. +induction n; induction m; simpl in |- *; auto with arith. +elim (IHn m); intro H; elim H; auto. +Qed. + +Lemma min_case : forall n m (P:nat -> Set), P n -> P m -> P (min n m). +Proof. +induction n; simpl in |- *; auto with arith. +induction m; intros; simpl in |- *; auto with arith. +pattern (min n m) in |- *; apply IHn; auto with arith. +Qed. + +Lemma min_case2 : forall n m (P:nat -> Prop), P n -> P m -> P (min n m). +Proof. +induction n; simpl in |- *; auto with arith. +induction m; intros; simpl in |- *; auto with arith. +pattern (min n m) in |- *; apply IHn; auto with arith. +Qed. \ No newline at end of file -- cgit v1.2.3