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
S
stdpp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
49
Issues
49
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Iris
stdpp
Commits
cac96811
Commit
cac96811
authored
Aug 02, 2016
by
Robbert Krebbers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sets of sequences of natural numbers.
parent
bcaf2016
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
theories/collections.v
theories/collections.v
+35
-0
No files found.
theories/collections.v
View file @
cac96811
...
...
@@ -948,3 +948,38 @@ Section more_finite.
intros
x
?
;
destruct
(
decide
(
x
∈
Y
))
;
rewrite
elem_of_app
;
set_solver
.
Qed
.
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
.
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