Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
Iris
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rodolphe Lepigre
Iris
Commits
c1f41d83
Commit
c1f41d83
authored
Mar 04, 2016
by
Robbert Krebbers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
List inclusion in terms of list membership.
parent
56c307ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
prelude/collections.v
prelude/collections.v
+4
-0
prelude/list.v
prelude/list.v
+9
-0
No files found.
prelude/collections.v
View file @
c1f41d83
...
@@ -324,6 +324,10 @@ Section list_unfold.
...
@@ -324,6 +324,10 @@ Section list_unfold.
intros
??
;
constructor
.
intros
??
;
constructor
.
by
rewrite
elem_of_app
,
(
set_unfold
(
x
∈
l
)
P
),
(
set_unfold
(
x
∈
k
)
Q
).
by
rewrite
elem_of_app
,
(
set_unfold
(
x
∈
l
)
P
),
(
set_unfold
(
x
∈
k
)
Q
).
Qed
.
Qed
.
Global
Instance
set_unfold_included
l
k
(
P
Q
:
A
→
Prop
)
:
(
∀
x
,
SetUnfold
(
x
∈
l
)
(
P
x
))
→
(
∀
x
,
SetUnfold
(
x
∈
k
)
(
Q
x
))
→
SetUnfold
(
l
`
included
`
k
)
(
∀
x
,
P
x
→
Q
x
).
Proof
.
by
constructor
;
unfold
included
;
set_unfold
.
Qed
.
End
list_unfold
.
End
list_unfold
.
(** * Guard *)
(** * Guard *)
...
...
prelude/list.v
View file @
c1f41d83
...
@@ -282,6 +282,9 @@ Inductive Forall3 {A B C} (P : A → B → C → Prop) :
...
@@ -282,6 +282,9 @@ Inductive Forall3 {A B C} (P : A → B → C → Prop) :
P x y z → Forall3 P l k k' → Forall3 P (x :: l) (y :: k) (z :: k').
P x y z → Forall3 P l k k' → Forall3 P (x :: l) (y :: k) (z :: k').
(** Set operations on lists *)
(** Set operations on lists *)
Definition included {A} (l1 l2 : list A) := ∀ x, x ∈ l1 → x ∈ l2.
Infix "`included`" := included (at level 70) : C_scope.
Section list_set.
Section list_set.
Context {A} {dec : ∀ x y : A, Decision (x = y)}.
Context {A} {dec : ∀ x y : A, Decision (x = y)}.
Global Instance elem_of_list_dec {dec : ∀ x y : A, Decision (x = y)}
Global Instance elem_of_list_dec {dec : ∀ x y : A, Decision (x = y)}
...
@@ -2017,6 +2020,12 @@ Section contains_dec.
...
@@ -2017,6 +2020,12 @@ Section contains_dec.
abstract (rewrite Permutation_alt; tauto).
abstract (rewrite Permutation_alt; tauto).
Defined.
Defined.
End contains_dec.
End contains_dec.
(** ** Properties of [included] *)
Global Instance included_preorder : PreOrder (@included A).
Proof. split; firstorder. Qed.
Lemma included_nil l : [] `included` l.
Proof. intros x. by rewrite elem_of_nil. Qed.
End more_general_properties.
End more_general_properties.
(** ** Properties of the [Forall] and [Exists] predicate *)
(** ** Properties of the [Forall] and [Exists] predicate *)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment