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
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Glen Mével
stdpp
Commits
d4f9072c
Commit
d4f9072c
authored
8 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
More inversion properties for equiv/dist on option.
parent
3df279ee
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/option.v
+9
-4
9 additions, 4 deletions
theories/option.v
with
9 additions
and
4 deletions
theories/option.v
+
9
−
4
View file @
d4f9072c
...
@@ -110,6 +110,7 @@ Instance option_equiv `{Equiv A} : Equiv (option A) := option_Forall2 (≡).
...
@@ -110,6 +110,7 @@ Instance option_equiv `{Equiv A} : Equiv (option A) := option_Forall2 (≡).
Section
setoids
.
Section
setoids
.
Context
`{
Equiv
A
}
`{
!
Equivalence
((
≡
)
:
relation
A
)}
.
Context
`{
Equiv
A
}
`{
!
Equivalence
((
≡
)
:
relation
A
)}
.
Implicit
Types
mx
my
:
option
A
.
Lemma
equiv_option_Forall2
mx
my
:
mx
≡
my
↔
option_Forall2
(
≡
)
mx
my
.
Lemma
equiv_option_Forall2
mx
my
:
mx
≡
my
↔
option_Forall2
(
≡
)
mx
my
.
Proof
.
done
.
Qed
.
Proof
.
done
.
Qed
.
...
@@ -121,14 +122,18 @@ Section setoids.
...
@@ -121,14 +122,18 @@ Section setoids.
Global
Instance
option_leibniz
`{
!
LeibnizEquiv
A
}
:
LeibnizEquiv
(
option
A
)
.
Global
Instance
option_leibniz
`{
!
LeibnizEquiv
A
}
:
LeibnizEquiv
(
option
A
)
.
Proof
.
intros
x
y
;
destruct
1
;
fold_leibniz
;
congruence
.
Qed
.
Proof
.
intros
x
y
;
destruct
1
;
fold_leibniz
;
congruence
.
Qed
.
Lemma
equiv_None
(
mx
:
option
A
)
:
mx
≡
None
↔
mx
=
None
.
Lemma
equiv_None
mx
:
mx
≡
None
↔
mx
=
None
.
Proof
.
split
;
[
by
inversion_clear
1
|
by
intros
->
]
.
Qed
.
Proof
.
split
;
[
by
inversion_clear
1
|
by
intros
->
]
.
Qed
.
Lemma
equiv_Some_inv_l
(
mx
my
:
option
A
)
x
:
Lemma
equiv_Some_inv_l
mx
my
x
:
mx
≡
my
→
mx
=
Some
x
→
∃
y
,
my
=
Some
y
∧
x
≡
y
.
mx
≡
my
→
mx
=
Some
x
→
∃
y
,
my
=
Some
y
∧
x
≡
y
.
Proof
.
destruct
1
;
naive_solver
.
Qed
.
Proof
.
destruct
1
;
naive_solver
.
Qed
.
Lemma
equiv_Some_inv_r
(
mx
my
:
option
A
)
y
:
Lemma
equiv_Some_inv_r
mx
my
y
:
mx
≡
my
→
m
x
=
Some
y
→
∃
x
,
mx
=
Some
x
∧
x
≡
y
.
mx
≡
my
→
m
y
=
Some
y
→
∃
x
,
mx
=
Some
x
∧
x
≡
y
.
Proof
.
destruct
1
;
naive_solver
.
Qed
.
Proof
.
destruct
1
;
naive_solver
.
Qed
.
Lemma
equiv_Some_inv_l'
my
x
:
Some
x
≡
my
→
∃
x'
,
Some
x'
=
my
∧
x
≡
x'
.
Proof
.
intros
?
%
(
equiv_Some_inv_l
_
_
x
);
naive_solver
.
Qed
.
Lemma
equiv_Some_inv_r'
mx
y
:
mx
≡
Some
y
→
∃
y'
,
mx
=
Some
y'
∧
y
≡
y'
.
Proof
.
intros
?
%
(
equiv_Some_inv_r
_
_
y
);
naive_solver
.
Qed
.
Global
Instance
is_Some_proper
:
Proper
((
≡
)
==>
iff
)
(
@
is_Some
A
)
.
Global
Instance
is_Some_proper
:
Proper
((
≡
)
==>
iff
)
(
@
is_Some
A
)
.
Proof
.
inversion_clear
1
;
split
;
eauto
.
Qed
.
Proof
.
inversion_clear
1
;
split
;
eauto
.
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