|
8 | 8 |
|
9 | 9 | (*i $Id: List.v 10999 2008-05-27 15:55:22Z letouzey $ i*)
|
10 | 10 |
|
11 |
| -Require Import Le Gt Minus Min Bool. |
| 11 | +Require Import Arith Bool. |
12 | 12 |
|
13 | 13 | Set Implicit Arguments.
|
14 | 14 |
|
@@ -566,7 +566,7 @@ Section Elts.
|
566 | 566 | Theorem count_occ_In : forall (l : list A) (x : A), In x l <-> count_occ l x > 0.
|
567 | 567 | Proof.
|
568 | 568 | induction l as [|y l].
|
569 |
| - simpl; intros; split; [destruct 1 | apply gt_irrefl]. |
| 569 | + simpl; intros; split; [destruct 1 | apply Nat.lt_irrefl]. |
570 | 570 | simpl. intro x; destruct (eqA_dec y x) as [Heq|Hneq].
|
571 | 571 | rewrite Heq; intuition.
|
572 | 572 | pose (IHl x). intuition.
|
@@ -695,16 +695,13 @@ Section ListOps.
|
695 | 695 | simpl (rev (a :: l)).
|
696 | 696 | simpl (length (a :: l) - S n).
|
697 | 697 | inversion H.
|
698 |
| - rewrite <- minus_n_n; simpl. |
| 698 | + rewrite Nat.sub_diag; simpl. |
699 | 699 | rewrite <- rev_length.
|
700 | 700 | rewrite app_nth2; auto.
|
701 |
| - rewrite <- minus_n_n; auto. |
702 |
| - rewrite app_nth1; auto. |
703 |
| - rewrite (minus_plus_simpl_l_reverse (length l) n 1). |
704 |
| - replace (1 + length l) with (S (length l)); auto with arith. |
705 |
| - rewrite <- minus_Sn_m; [|auto with arith]. |
706 |
| - apply IHl ; auto with arith. |
707 |
| - rewrite rev_length; auto. |
| 701 | + rewrite Nat.sub_diag; auto. |
| 702 | + rewrite app_nth1 by (rewrite rev_length; exact H1). |
| 703 | + rewrite <-Nat.sub_succ, Nat.sub_succ_l by (exact H1). |
| 704 | + apply IHl; exact H1. |
708 | 705 | Qed.
|
709 | 706 |
|
710 | 707 |
|
@@ -1551,7 +1548,7 @@ Section length_order.
|
1551 | 1548 | Proof.
|
1552 | 1549 | unfold lel in |- *; intros.
|
1553 | 1550 | now_show (length l <= length n).
|
1554 |
| - apply le_trans with (length m); auto with arith. |
| 1551 | + apply Nat.le_trans with (length m); auto with arith. |
1555 | 1552 | Qed.
|
1556 | 1553 |
|
1557 | 1554 | Lemma lel_cons_cons : lel l m -> lel (a :: l) (b :: m).
|
|
0 commit comments