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
3518251c
Verified
Commit
3518251c
authored
2 years ago
by
Dorian Lesbre
Browse files
Options
Downloads
Patches
Plain Diff
Instances
parent
03fc76af
No related branches found
No related tags found
1 merge request
!444
Add images (codomains) to finite maps
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
stdpp/fin_map_img.v
+13
-0
13 additions, 0 deletions
stdpp/fin_map_img.v
stdpp/gmap.v
+6
-1
6 additions, 1 deletion
stdpp/gmap.v
with
19 additions
and
1 deletion
stdpp/fin_map_img.v
+
13
−
0
View file @
3518251c
...
...
@@ -273,3 +273,16 @@ Section fin_map_img.
Global
Instance
set_unfold_img_empty
i
:
SetUnfoldElemOf
i
(
img
(
∅:
M
A
))
False
.
Proof
.
constructor
.
by
rewrite
img_empty
,
elem_of_empty
.
Qed
.
End
fin_map_img
.
Global
Instance
fin_map_img
K
A
M
D
`{
FinMapToList
K
A
M
,
Singleton
A
D
,
Empty
D
,
Union
D
}
:
Img
M
D
:=
map_to_set
(
fun
_
a
=>
a
)
.
Global
Instance
fin_map_img_spec
K
A
M
D
`{
HFinMap
:
FinMap
K
M
}
`{
HFinSet
:
FinSet
A
D
}
:
FinMapImg
K
A
M
D
.
Proof
.
split
;
[
exact
HFinMap
|
apply
fin_set_set
|]
.
unfold
img
,
fin_map_img
.
intros
m
v
.
rewrite
elem_of_map_to_set
.
split
.
-
intros
[
k
[
v'
[
mk_v'
v'_v
]]]
.
exists
k
.
rewrite
v'_v
in
mk_v'
.
exact
mk_v'
.
-
intros
[
k
mk_v
]
.
exists
k
.
exists
v
.
split
;
[
exact
mk_v
|
reflexivity
]
.
Qed
.
This diff is collapsed.
Click to expand it.
stdpp/gmap.v
+
6
−
1
View file @
3518251c
...
...
@@ -9,7 +9,7 @@ To compute concrete results, you need to both:
[gmap]/[gset], does not contain proofs, say via [map_to_list] or [!!]; and
- use [vm_compute] to run the computation, because it ignores opacity.
*)
From
stdpp
Require
Export
countable
infinite
fin_maps
fin_map_dom
.
From
stdpp
Require
Export
countable
infinite
fin_maps
fin_map_dom
fin_map_img
.
From
stdpp
Require
Import
pmap
mapset
propset
.
From
stdpp
Require
Import
options
.
...
...
@@ -282,6 +282,11 @@ Section gset.
pose
proof
(
mapset_dom_spec
(
M
:=
gmap
K
))
as
[??
Hdom
];
split
;
auto
.
intros
A
m
.
specialize
(
Hdom
A
m
)
.
by
destruct
m
.
Qed
.
Global
Instance
gmap_img
`{
Countable
A
}
:
Img
(
gmap
A
K
)
(
gset
K
)
:=
fin_map_img
A
K
(
gmap
A
K
)
(
gset
K
)
.
Global
Instance
gset_img_spec
`{
Countable
A
}
:
FinMapImg
A
K
(
gmap
A
)
(
gset
K
)
:=
fin_map_img_spec
A
K
(
gmap
A
)
(
gset
K
)
.
(** If you are looking for a lemma showing that [gset] is extensional, see
[sets.set_eq]. *)
...
...
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