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
65ddd0da
Commit
65ddd0da
authored
4 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
prove map_size_delete, map_size_insert_Some, map_to_list_delete
parent
3ae73218
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!208
prove map_size_delete, map_size_insert_Some, map_to_list_delete
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/fin_maps.v
+20
-0
20 additions, 0 deletions
theories/fin_maps.v
with
20 additions
and
0 deletions
theories/fin_maps.v
+
20
−
0
View file @
65ddd0da
...
...
@@ -878,6 +878,16 @@ Proof.
apply
Permutation_singleton
.
unfold
singletonM
,
map_singleton
.
by
rewrite
map_to_list_insert
,
map_to_list_empty
by
eauto
using
lookup_empty
.
Qed
.
Lemma
map_to_list_delete
{
A
}
(
m
:
M
A
)
i
x
:
m
!!
i
=
Some
x
→
(
i
,
x
)
::
map_to_list
(
delete
i
m
)
≡
ₚ
map_to_list
m
.
Proof
.
intros
Hmi
.
apply
list_to_map_inj
;
csimpl
.
-
constructor
;
[|
by
auto
using
NoDup_fst_map_to_list
]
.
rewrite
elem_of_list_fmap
.
intros
[[??]
[?
Hlookup
]];
subst
;
simpl
in
*.
rewrite
elem_of_map_to_list
,
lookup_delete
in
Hlookup
.
congruence
.
-
apply
NoDup_fst_map_to_list
.
-
rewrite
!
list_to_map_to_list
.
rewrite
insert_delete
,
insert_id
;
done
.
Qed
.
Lemma
map_to_list_submseteq
{
A
}
(
m1
m2
:
M
A
)
:
m1
⊆
m2
→
map_to_list
m1
⊆+
map_to_list
m2
.
...
...
@@ -1019,6 +1029,16 @@ Proof. unfold size, map_size. by rewrite map_to_list_singleton. Qed.
Lemma
map_size_insert
{
A
}
i
x
(
m
:
M
A
)
:
m
!!
i
=
None
→
size
(
<
[
i
:=
x
]
>
m
)
=
S
(
size
m
)
.
Proof
.
intros
.
unfold
size
,
map_size
.
by
rewrite
map_to_list_insert
.
Qed
.
Lemma
map_size_delete
{
A
}
i
(
m
:
M
A
)
:
is_Some
(
m
!!
i
)
→
size
m
=
S
(
size
(
delete
i
m
))
.
Proof
.
intros
[??]
.
unfold
size
,
map_size
.
by
rewrite
<-
map_to_list_delete
.
Qed
.
Lemma
map_size_insert_Some
{
A
}
i
x
(
m
:
M
A
)
:
is_Some
(
m
!!
i
)
→
size
(
<
[
i
:=
x
]
>
m
)
=
size
m
.
Proof
.
intros
.
rewrite
<-
insert_delete
,
map_size_insert
,
<-
map_size_delete
;
[
done
..|]
.
rewrite
lookup_delete
.
done
.
Qed
.
Lemma
map_size_fmap
{
A
B
}
(
f
:
A
->
B
)
(
m
:
M
A
)
:
size
(
f
<$>
m
)
=
size
m
.
Proof
.
intros
.
unfold
size
,
map_size
.
by
rewrite
map_to_list_fmap
,
fmap_length
.
Qed
.
...
...
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