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
C
coq-stdpp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
David Swasey
coq-stdpp
Commits
532a9ed0
Commit
532a9ed0
authored
Oct 27, 2017
by
Robbert Krebbers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some clean up to Hai's commit.
parent
6f1a23cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
23 deletions
+18
-23
theories/gmap.v
theories/gmap.v
+18
-23
No files found.
theories/gmap.v
View file @
532a9ed0
...
...
@@ -187,35 +187,30 @@ Section curry_uncurry.
apply
map_eq
;
intros
[
i
j
].
by
rewrite
lookup_gmap_curry
,
lookup_gmap_uncurry
.
Qed
.
Lemma
gmap_uncurry_non
empty
(
m
:
gmap
(
K1
*
K2
)
A
)
:
∀
i
x
,
gmap_uncurry
m
!!
i
=
Some
x
→
x
≠
∅
.
Lemma
gmap_uncurry_non
_empty
(
m
:
gmap
(
K1
*
K2
)
A
)
i
x
:
gmap_uncurry
m
!!
i
=
Some
x
→
x
≠
∅
.
Proof
.
apply
(
map_fold_ind
(
λ
mr
m
,
∀
i
x
,
mr
!!
i
=
Some
x
→
x
≠
∅
))
;
[
done
|].
intros
[
i
j
]
x
m12
mr
Hij
IH
i'
x'
.
destruct
(
decide
(
i
=
i'
))
as
[->|]
;
[
rewrite
lookup_partial_alter
|
rewrite
lookup_partial_alter_ne
;
[
apply
IH
|
done
]].
inversion
1
.
apply
insert_non_empty
.
intros
Hm
->.
revert
m
Hm
.
apply
(
map_fold_ind
(
λ
mr
_
,
mr
!!
i
=
Some
∅
→
False
))
;
[
done
|].
intros
[
i'
j
]
x
m
mr
??.
destruct
(
decide
(
i
=
i'
))
as
[->|].
-
rewrite
lookup_partial_alter
.
intros
[=
[]%
insert_non_empty
].
-
by
rewrite
lookup_partial_alter_ne
by
done
.
Qed
.
Lemma
gmap_uncurry_curry_non
empty
(
m
:
gmap
K1
(
gmap
K2
A
))
(
NE
:
∀
i
x
,
m
!!
i
=
Some
x
→
x
≠
∅
)
:
Lemma
gmap_uncurry_curry_non
_empty
(
m
:
gmap
K1
(
gmap
K2
A
))
:
(
∀
i
x
,
m
!!
i
=
Some
x
→
x
≠
∅
)
→
gmap_uncurry
(
gmap_curry
m
)
=
m
.
Proof
.
apply
map_eq
;
intros
i
.
destruct
(
m
!!
i
)
as
[
x'
|]
eqn
:
Eqx'
.
-
destruct
(
gmap_uncurry
(
gmap_curry
m
)
!!
i
)
as
[
x2
|]
eqn
:
Eq2
.
intros
Hne
.
apply
map_eq
;
intros
i
.
destruct
(
m
!!
i
)
as
[
m2
|]
eqn
:
Hm
.
-
destruct
(
gmap_uncurry
(
gmap_curry
m
)
!!
i
)
as
[
m2'
|]
eqn
:
Hcurry
.
+
f_equal
.
apply
map_eq
.
intros
j
.
assert
(
Eq3
:
x'
!!
j
=
(
m
!!
i
:
option
(
gmap
_
_
))
≫
=
(!!
j
)).
{
by
rewrite
Eqx'
.
}
assert
(
Eq4
:
x2
!!
j
=
(
gmap_uncurry
(
gmap_curry
m
)
!!
i
:
option
(
gmap
_
_
))
≫
=
(!!
j
)).
{
by
rewrite
Eq2
.
}
by
rewrite
Eq3
,
<-
lookup_gmap_curry
,
Eq4
,
lookup_gmap_uncurry
.
+
revert
Eq2
.
rewrite
lookup_gmap_uncurry_None
.
setoid_rewrite
lookup_gmap_curry
.
rewrite
Eqx'
.
intros
Eq2
.
exfalso
.
apply
(
NE
_
_
Eqx'
),
map_eq
,
Eq2
.
-
apply
lookup_gmap_uncurry_None
.
intros
j
.
by
rewrite
lookup_gmap_curry
,
Eqx'
.
trans
((
gmap_uncurry
(
gmap_curry
m
)
!!
i
:
option
(
gmap
_
_
))
≫
=
(!!
j
)).
{
by
rewrite
Hcurry
.
}
by
rewrite
lookup_gmap_uncurry
,
lookup_gmap_curry
,
Hm
.
+
rewrite
lookup_gmap_uncurry_None
in
Hcurry
.
exfalso
;
apply
(
Hne
i
m2
),
map_eq
;
[
done
|
intros
j
].
by
rewrite
lookup_empty
,
<-(
Hcurry
j
),
lookup_gmap_curry
,
Hm
.
-
apply
lookup_gmap_uncurry_None
;
intros
j
.
by
rewrite
lookup_gmap_curry
,
Hm
.
Qed
.
End
curry_uncurry
.
...
...
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