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
4a6a4028
Commit
4a6a4028
authored
3 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Organize setoid instances for maps better.
parent
fa2e2822
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/fin_maps.v
+11
-8
11 additions, 8 deletions
theories/fin_maps.v
with
11 additions
and
8 deletions
theories/fin_maps.v
+
11
−
8
View file @
4a6a4028
...
...
@@ -166,6 +166,12 @@ Context `{FinMap K M}.
Section
setoid
.
Context
`{
Equiv
A
}
.
Lemma
map_equiv_empty
(
m
:
M
A
)
:
m
≡
∅
↔
m
=
∅.
Proof
.
split
;
[
intros
Hm
;
apply
map_eq
;
intros
i
|
intros
->
]
.
-
generalize
(
Hm
i
)
.
by
rewrite
lookup_empty
,
equiv_None
.
-
intros
?
.
rewrite
lookup_empty
;
constructor
.
Qed
.
Lemma
map_equiv_lookup_l
(
m1
m2
:
M
A
)
i
x
:
m1
≡
m2
→
m1
!!
i
=
Some
x
→
∃
y
,
m2
!!
i
=
Some
y
∧
x
≡
y
.
Proof
.
generalize
(
equiv_Some_inv_l
(
m1
!!
i
)
(
m2
!!
i
)
x
);
naive_solver
.
Qed
.
...
...
@@ -177,6 +183,9 @@ Section setoid.
-
by
intros
m1
m2
?
i
.
-
by
intros
m1
m2
m3
??
i
;
trans
(
m2
!!
i
)
.
Qed
.
Global
Instance
map_leibniz
`{
!
LeibnizEquiv
A
}
:
LeibnizEquiv
(
M
A
)
.
Proof
.
intros
m1
m2
Hm
;
apply
map_eq
;
intros
i
.
apply
leibniz_equiv
,
Hm
.
Qed
.
Global
Instance
lookup_proper
(
i
:
K
)
:
Proper
((
≡@
{
M
A
})
==>
(
≡
))
(
lookup
i
)
.
Proof
.
by
intros
m1
m2
Hm
.
Qed
.
Global
Instance
lookup_total_proper
(
i
:
K
)
`{
!
Inhabited
A
}
:
...
...
@@ -209,6 +218,7 @@ Section setoid.
intros
??
Hf
;
apply
partial_alter_proper
.
by
destruct
1
;
constructor
;
apply
Hf
.
Qed
.
Lemma
merge_ext
`{
Equiv
B
,
Equiv
C
}
(
f
g
:
option
A
→
option
B
→
option
C
)
`{
!
DiagNone
f
,
!
DiagNone
g
}
:
((
≡
)
==>
(
≡
)
==>
(
≡
))
%
signature
f
g
→
...
...
@@ -222,14 +232,7 @@ Section setoid.
intros
??
Hf
??
Hm1
??
Hm2
i
;
apply
(
merge_ext
_
_);
auto
.
by
do
2
destruct
1
;
first
[
apply
Hf
|
constructor
]
.
Qed
.
Global
Instance
map_leibniz
`{
!
LeibnizEquiv
A
}
:
LeibnizEquiv
(
M
A
)
.
Proof
.
intros
m1
m2
Hm
;
apply
map_eq
;
intros
i
.
apply
leibniz_equiv
,
Hm
.
Qed
.
Lemma
map_equiv_empty
(
m
:
M
A
)
:
m
≡
∅
↔
m
=
∅.
Proof
.
split
;
[
intros
Hm
;
apply
map_eq
;
intros
i
|
intros
->
]
.
-
generalize
(
Hm
i
)
.
by
rewrite
lookup_empty
,
equiv_None
.
-
intros
?
.
rewrite
lookup_empty
;
constructor
.
Qed
.
Global
Instance
map_fmap_proper
`{
Equiv
B
}
(
f
:
A
→
B
)
:
Proper
((
≡
)
==>
(
≡
))
f
→
Proper
((
≡
)
==>
(
≡@
{
M
_}))
(
fmap
f
)
.
Proof
.
...
...
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