forked from readablesystems/cs260r-17
-
Notifications
You must be signed in to change notification settings - Fork 0
/
l06.v
39 lines (32 loc) · 893 Bytes
/
l06.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Require Import Arith.
Require Import Omega.
Require Import Recdef.
Require Import List.
Require Import Program.Tactics.
Import ListNotations.
Section Lecture6.
(* True iff the list’s elements are in decreasing order *)
Inductive Dec : list nat -> Prop :=
| DNil : Dec []
| DCons : forall a l,
(forall b, In b l -> a <= b) ->
Dec l ->
Dec (a :: l).
Hint Constructors Dec.
(* True iff the list’s elements are in INcreasing order *)
Inductive Inc : list nat -> Prop :=
| INil : Inc []
| ICons : forall a l,
(forall b, In b l -> b <= a) ->
Inc l ->
Inc (a :: l).
Hint Constructors Inc.
(* A fact about appending increasing lists *)
Lemma Inc_app xs ys:
Inc xs -> Inc ys ->
(forall x y, In x xs -> In y ys -> y <= x) ->
Inc (xs ++ ys).
Admitted.
Lemma Dec_rev xs: Dec (rev xs) -> Inc xs.
Abort.
End Lecture6.