Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
stdpp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Iris
stdpp
Commits
cac96811
Commit
cac96811
authored
8 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Sets of sequences of natural numbers.
parent
bcaf2016
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/collections.v
+35
-0
35 additions, 0 deletions
theories/collections.v
with
35 additions
and
0 deletions
theories/collections.v
+
35
−
0
View file @
cac96811
...
@@ -948,3 +948,38 @@ Section more_finite.
...
@@ -948,3 +948,38 @@ Section more_finite.
intros
x
?;
destruct
(
decide
(
x
∈
Y
));
rewrite
elem_of_app
;
set_solver
.
intros
x
?;
destruct
(
decide
(
x
∈
Y
));
rewrite
elem_of_app
;
set_solver
.
Qed
.
Qed
.
End
more_finite
.
End
more_finite
.
(** Sets of sequences of natural numbers *)
(* The set [seq_seq start len] of natural numbers contains the sequence
[start, start + 1, ..., start + (len-1)]. *)
Fixpoint
seq_set
`{
Singleton
nat
C
,
Union
C
,
Empty
C
}
(
start
len
:
nat
)
:
C
:=
match
len
with
|
O
=>
∅
|
S
len'
=>
{[
start
]}
∪
seq_set
(
S
start
)
len'
end
.
Section
seq_set
.
Context
`{
SimpleCollection
nat
C
}
.
Implicit
Types
start
len
x
:
nat
.
Lemma
elem_of_seq_set
start
len
x
:
x
∈
seq_set
start
len
↔
start
≤
x
<
start
+
len
.
Proof
.
revert
start
.
induction
len
as
[|
len
IH
];
intros
start
;
simpl
.
-
rewrite
elem_of_empty
.
omega
.
-
rewrite
elem_of_union
,
elem_of_singleton
,
IH
.
omega
.
Qed
.
Lemma
seq_set_S_disjoint
start
len
:
{[
start
+
len
]}
⊥
seq_set
start
len
.
Proof
.
intros
x
.
rewrite
elem_of_singleton
,
elem_of_seq_set
.
omega
.
Qed
.
Lemma
seq_set_S_union
start
len
:
seq_set
start
(
C
:=
C
)
(
S
len
)
≡
{[
start
+
len
]}
∪
seq_set
start
len
.
Proof
.
intros
x
.
rewrite
elem_of_union
,
elem_of_singleton
,
!
elem_of_seq_set
.
omega
.
Qed
.
Lemma
seq_set_S_union_L
`{
!
LeibnizEquiv
C
}
start
len
:
seq_set
start
(
S
len
)
=
{[
start
+
len
]}
∪
seq_set
start
len
.
Proof
.
unfold_leibniz
.
apply
seq_set_S_union
.
Qed
.
End
seq_set
.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment