Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Iris
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
Terraform modules
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
Simcha van Collem
Iris
Commits
9460ce23
Commit
9460ce23
authored
9 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Identity and composition laws for excl and auth functor.
parent
a50d7b04
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modures/auth.v
+7
-0
7 additions, 0 deletions
modures/auth.v
modures/excl.v
+5
-0
5 additions, 0 deletions
modures/excl.v
with
12 additions
and
0 deletions
modures/auth.v
+
7
−
0
View file @
9460ce23
...
@@ -3,6 +3,7 @@ Local Arguments valid _ _ !_ /.
...
@@ -3,6 +3,7 @@ Local Arguments valid _ _ !_ /.
Local
Arguments
validN
_
_
_
!
_
/.
Local
Arguments
validN
_
_
_
!
_
/.
Record
auth
(
A
:
Type
)
:
Type
:=
Auth
{
authoritative
:
excl
A
;
own
:
A
}
.
Record
auth
(
A
:
Type
)
:
Type
:=
Auth
{
authoritative
:
excl
A
;
own
:
A
}
.
Add
Printing
Constructor
auth
.
Arguments
Auth
{_}
_
_
.
Arguments
Auth
{_}
_
_
.
Arguments
authoritative
{_}
_
.
Arguments
authoritative
{_}
_
.
Arguments
own
{_}
_
.
Arguments
own
{_}
_
.
...
@@ -151,6 +152,12 @@ Arguments authRA : clear implicits.
...
@@ -151,6 +152,12 @@ Arguments authRA : clear implicits.
(* Functor *)
(* Functor *)
Instance
auth_fmap
:
FMap
auth
:=
λ
A
B
f
x
,
Instance
auth_fmap
:
FMap
auth
:=
λ
A
B
f
x
,
Auth
(
f
<$>
authoritative
x
)
(
f
(
own
x
))
.
Auth
(
f
<$>
authoritative
x
)
(
f
(
own
x
))
.
Arguments
auth_fmap
_
_
_
!
_
/.
Lemma
auth_fmap_id
{
A
}
(
x
:
auth
A
)
:
id
<$>
x
=
x
.
Proof
.
by
destruct
x
;
rewrite
/=
excl_fmap_id
.
Qed
.
Lemma
excl_fmap_compose
{
A
B
C
}
(
f
:
A
→
B
)
(
g
:
B
→
C
)
(
x
:
auth
A
)
:
g
∘
f
<$>
x
=
g
<$>
f
<$>
x
.
Proof
.
by
destruct
x
;
rewrite
/=
excl_fmap_compose
.
Qed
.
Instance
auth_fmap_cmra_ne
{
A
B
:
cmraT
}
n
:
Instance
auth_fmap_cmra_ne
{
A
B
:
cmraT
}
n
:
Proper
((
dist
n
==>
dist
n
)
==>
dist
n
==>
dist
n
)
(
@
fmap
auth
_
A
B
)
.
Proper
((
dist
n
==>
dist
n
)
==>
dist
n
==>
dist
n
)
(
@
fmap
auth
_
A
B
)
.
Proof
.
Proof
.
...
...
This diff is collapsed.
Click to expand it.
modures/excl.v
+
5
−
0
View file @
9460ce23
...
@@ -156,6 +156,11 @@ Instance excl_fmap : FMap excl := λ A B f x,
...
@@ -156,6 +156,11 @@ Instance excl_fmap : FMap excl := λ A B f x,
match
x
with
match
x
with
|
Excl
a
=>
Excl
(
f
a
)
|
ExclUnit
=>
ExclUnit
|
ExclBot
=>
ExclBot
|
Excl
a
=>
Excl
(
f
a
)
|
ExclUnit
=>
ExclUnit
|
ExclBot
=>
ExclBot
end
.
end
.
Lemma
excl_fmap_id
{
A
}
(
x
:
excl
A
)
:
id
<$>
x
=
x
.
Proof
.
by
destruct
x
.
Qed
.
Lemma
excl_fmap_compose
{
A
B
C
}
(
f
:
A
→
B
)
(
g
:
B
→
C
)
(
x
:
excl
A
)
:
g
∘
f
<$>
x
=
g
<$>
f
<$>
x
.
Proof
.
by
destruct
x
.
Qed
.
Instance
excl_fmap_cmra_ne
{
A
B
:
cofeT
}
n
:
Instance
excl_fmap_cmra_ne
{
A
B
:
cofeT
}
n
:
Proper
((
dist
n
==>
dist
n
)
==>
dist
n
==>
dist
n
)
(
@
fmap
excl
_
A
B
)
.
Proper
((
dist
n
==>
dist
n
)
==>
dist
n
==>
dist
n
)
(
@
fmap
excl
_
A
B
)
.
Proof
.
by
intros
f
f'
Hf
;
destruct
1
;
constructor
;
apply
Hf
.
Qed
.
Proof
.
by
intros
f
f'
Hf
;
destruct
1
;
constructor
;
apply
Hf
.
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