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
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Glen Mével
stdpp
Commits
44722ee1
Commit
44722ee1
authored
9 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Sets over A as A -> bool.
parent
7be66314
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
theories/bsets.v
+35
-0
35 additions, 0 deletions
theories/bsets.v
theories/collections.v
+1
-1
1 addition, 1 deletion
theories/collections.v
with
36 additions
and
1 deletion
theories/bsets.v
0 → 100644
+
35
−
0
View file @
44722ee1
(* Copyright (c) 2012-2015, Robbert Krebbers. *)
(* This file is distributed under the terms of the BSD license. *)
(** This file implements bsets as functions into Prop. *)
Require
Export
prelude
.
prelude
.
Record
bset
(
A
:
Type
)
:
Type
:=
mkBSet
{
bset_car
:
A
→
bool
}
.
Arguments
mkBSet
{_}
_
.
Arguments
bset_car
{_}
_
_
.
Definition
bset_all
{
A
}
:
bset
A
:=
mkBSet
(
λ
_,
true
)
.
Instance
bset_empty
{
A
}
:
Empty
(
bset
A
)
:=
mkBSet
(
λ
_,
false
)
.
Instance
bset_singleton
{
A
}
`{
∀
x
y
:
A
,
Decision
(
x
=
y
)}
:
Singleton
A
(
bset
A
)
:=
λ
x
,
mkBSet
(
λ
y
,
bool_decide
(
y
=
x
))
.
Instance
bset_elem_of
{
A
}
:
ElemOf
A
(
bset
A
)
:=
λ
x
X
,
bset_car
X
x
.
Instance
bset_union
{
A
}
:
Union
(
bset
A
)
:=
λ
X1
X2
,
mkBSet
(
λ
x
,
bset_car
X1
x
||
bset_car
X2
x
)
.
Instance
bset_intersection
{
A
}
:
Intersection
(
bset
A
)
:=
λ
X1
X2
,
mkBSet
(
λ
x
,
bset_car
X1
x
&&
bset_car
X2
x
)
.
Instance
bset_difference
{
A
}
:
Difference
(
bset
A
)
:=
λ
X1
X2
,
mkBSet
(
λ
x
,
bset_car
X1
x
&&
negb
(
bset_car
X2
x
))
.
Instance
bset_collection
{
A
}
`{
∀
x
y
:
A
,
Decision
(
x
=
y
)}
:
Collection
A
(
bset
A
)
.
Proof
.
split
;
[
split
|
|]
.
*
by
intros
x
?
.
*
by
intros
x
y
;
rewrite
<-
(
bool_decide_spec
(
x
=
y
))
.
*
split
.
apply
orb_prop_elim
.
apply
orb_prop_intro
.
*
split
.
apply
andb_prop_elim
.
apply
andb_prop_intro
.
*
intros
X
Y
x
;
unfold
elem_of
,
bset_elem_of
;
simpl
.
destruct
(
bset_car
X
x
),
(
bset_car
Y
x
);
simpl
;
tauto
.
Qed
.
Instance
bset_elem_of_dec
{
A
}
x
(
X
:
bset
A
)
:
Decision
(
x
∈
X
)
:=
_
.
Typeclasses
Opaque
bset_elem_of
.
Global
Opaque
bset_empty
bset_singleton
bset_union
bset_intersection
bset_difference
.
This diff is collapsed.
Click to expand it.
theories/collections.v
+
1
−
1
View file @
44722ee1
...
...
@@ -313,7 +313,7 @@ Section collection.
End
leibniz
.
Section
dec
.
Context
`{
∀
X
Y
:
C
,
Decision
(
X
⊆
Y
)}
.
Context
`{
∀
(
x
:
A
)
(
X
:
C
)
,
Decision
(
x
∈
X
)}
.
Lemma
not_elem_of_intersection
x
X
Y
:
x
∉
X
∩
Y
↔
x
∉
X
∨
x
∉
Y
.
Proof
.
rewrite
elem_of_intersection
.
destruct
(
decide
(
x
∈
X
));
tauto
.
Qed
.
Lemma
not_elem_of_difference
x
X
Y
:
x
∉
X
∖
Y
↔
x
∉
X
∨
x
∈
Y
.
...
...
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