Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simon Spies
stdpp
Commits
2e1b8a41
Commit
2e1b8a41
authored
Sep 03, 2014
by
Robbert Krebbers
Browse files
Misc lemmas on option.
parent
fe9771cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
theories/option.v
View file @
2e1b8a41
...
...
@@ -32,6 +32,10 @@ Definition from_option {A} (a : A) (x : option A) : A :=
data type. This theorem is useful to prove that two options are the same. *)
Lemma
option_eq
{
A
}
(
x
y
:
option
A
)
:
x
=
y
↔
∀
a
,
x
=
Some
a
↔
y
=
Some
a
.
Proof
.
split
;
[
by
intros
;
by
subst
|].
destruct
x
,
y
;
naive_solver
.
Qed
.
Lemma
option_eq_1
{
A
}
(
x
y
:
option
A
)
a
:
x
=
y
→
x
=
Some
a
→
y
=
Some
a
.
Proof
.
congruence
.
Qed
.
Lemma
option_eq_1_alt
{
A
}
(
x
y
:
option
A
)
a
:
x
=
y
→
y
=
Some
a
→
x
=
Some
a
.
Proof
.
congruence
.
Qed
.
Definition
is_Some
{
A
}
(
x
:
option
A
)
:
=
∃
y
,
x
=
Some
y
.
Lemma
mk_is_Some
{
A
}
(
x
:
option
A
)
y
:
x
=
Some
y
→
is_Some
x
.
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment