Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Felipe Cerqueira
rtproofs
Commits
577cf47e
Commit
577cf47e
authored
May 13, 2016
by
Felipe Cerqueira
Browse files
Add lemmas about partial map
parent
49bd9141
Changes
1
Hide whitespace changes
Inline
Sidebyside
Showing
1 changed file
with
36 additions
and
1 deletion
+36
1
util/list.v
util/list.v
+36
1
No files found.
util/list.v
View file @
577cf47e
...
...
@@ 238,4 +238,39 @@ Lemma nth_or_none_nth :
by
intros
n
x
x0
SOME
;
destruct
n
;
simpl
in
*
;
[
by
inversion
SOME

by
apply
IHl
].
Qed
.
End
NthOrNone
.
\ No newline at end of file
End
NthOrNone
.
Section
PartialMap
.
Lemma
pmap_inj_in_uniq
{
T
T
'
:
eqType
}
(
s
:
seq
T
)
(
f
:
T
>
option
T
'
)
:
{
in
s
&
,
ssrfun
.
injective
f
}
>
uniq
s
>
uniq
(
pmap
f
s
).
Proof
.
intros
INJ
UNIQ
;
red
in
INJ
.
induction
s
;
first
by
done
.
simpl
in
*
;
unfold
ssrfun
.
Option
.
apply
.
move:
UNIQ
=>
/
andP
[
NOTIN
UNIQ
].
feed
IHs
.
by
ins
;
apply
INJ
;
try
(
by
rewrite
in_cons
;
apply
/
orP
;
right
).
specialize
(
IHs
UNIQ
).
destruct
(
f
a
)
eqn
:
F
;
simpl
;
last
by
done
.
rewrite
IHs
andbT
mem_pmap

F
.
apply
/
mapP
;
move
=>
[
a
'
IN
'
EQ
].
exploit
(
INJ
a
a
'
);
try
(
by
done
).
by
rewrite
in_cons
;
apply
/
orP
;
left
.
by
rewrite
in_cons
;
apply
/
orP
;
right
.
by
intros
EQ
'
;
subst
;
rewrite
IN
'
in
NOTIN
.
Qed
.
Lemma
pmap_inj_uniq
{
T
T
'
:
eqType
}
(
s
:
seq
T
)
(
f
:
T
>
option
T
'
)
:
ssrfun
.
injective
f
>
uniq
s
>
uniq
(
pmap
f
s
).
Proof
.
intros
INJ
UNIQ
.
apply
pmap_inj_in_uniq
;
last
by
done
.
by
red
;
ins
;
apply
INJ
.
Qed
.
End
PartialMap
.
\ No newline at end of file
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