11Require Import Coq.Lists.List.
2- Require Import Coq.Arith.Lt Coq.Arith.Plus .
2+ Require Import Coq.Arith.PeanoNat .
33
44Set Implicit Arguments .
55Set Strict Implicit .
@@ -14,7 +14,7 @@ Section parametric.
1414 induction A; destruct n; simpl; intros; auto.
1515 { inversion H. }
1616 { inversion H. }
17- { eapply IHA. apply Lt.lt_S_n ; assumption. }
17+ { eapply IHA. apply Nat.succ_lt_mono ; assumption. }
1818 Qed .
1919
2020 Lemma nth_error_app_R : forall (A B : list T) n,
@@ -23,7 +23,7 @@ Section parametric.
2323 Proof .
2424 induction A; destruct n; simpl; intros; auto.
2525 + inversion H.
26- + apply IHA. apply Le.le_S_n ; assumption.
26+ + apply IHA. apply Nat.succ_le_mono ; assumption.
2727 Qed .
2828
2929 Lemma nth_error_weaken : forall ls' (ls : list T) n v,
@@ -45,25 +45,25 @@ Section parametric.
4545 Proof .
4646 clear. induction ls; destruct n; simpl; intros; auto.
4747 + inversion H.
48- + apply IHls. apply Le.le_S_n ; assumption.
48+ + apply IHls. apply Nat.succ_le_mono ; assumption.
4949 Qed .
5050
5151 Lemma nth_error_length : forall (ls ls' : list T) n,
5252 nth_error (ls ++ ls') (n + length ls) = nth_error ls' n.
5353 Proof .
5454 induction ls; simpl; intros.
55- rewrite Plus.plus_0_r . auto.
56- rewrite <- Plus.plus_Snm_nSm .
55+ rewrite Nat.add_0_r . auto.
56+ rewrite <-Nat.add_succ_comm .
5757 simpl. eapply IHls.
5858 Qed .
5959
6060 Theorem nth_error_length_ge : forall T (ls : list T) n,
6161 nth_error ls n = None -> length ls <= n.
6262 Proof .
6363 induction ls; destruct n; simpl in *; auto; simpl in *.
64- + intro. apply Le.le_0_n .
64+ + intro. apply Nat.le_0_l .
6565 + inversion 1.
66- + intros. eapply Le.le_n_S . auto.
66+ + intros. apply ->Nat.succ_le_mono . auto.
6767 Qed .
6868
6969 Lemma nth_error_length_lt : forall {T} (ls : list T) n val,
@@ -72,8 +72,8 @@ Section parametric.
7272 induction ls; destruct n; simpl; intros; auto.
7373 + inversion H.
7474 + inversion H.
75- + apply Lt.lt_0_Sn .
76- + apply Lt.lt_n_S. eauto .
75+ + apply Nat.lt_0_succ .
76+ + apply ->Nat.succ_lt_mono. apply IHls with (1 := H) .
7777 Qed .
7878
7979
0 commit comments