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
William Mansky
Iris
Commits
9fc48e66
Commit
9fc48e66
authored
9 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Indexed products as COFE and CMRA.
parent
52ab8de2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modures/cmra.v
+46
-0
46 additions, 0 deletions
modures/cmra.v
modures/cofe.v
+35
-2
35 additions, 2 deletions
modures/cofe.v
with
81 additions
and
2 deletions
modures/cmra.v
+
46
−
0
View file @
9fc48e66
...
...
@@ -527,3 +527,49 @@ Definition prodRA_map {A A' B B' : cmraT}
CofeMor
(
prod_map
f
g
:
prodRA
A
B
→
prodRA
A'
B'
)
.
Instance
prodRA_map_ne
{
A
A'
B
B'
}
n
:
Proper
(
dist
n
==>
dist
n
==>
dist
n
)
(
@
prodRA_map
A
A'
B
B'
)
:=
prodC_map_ne
n
.
(** ** Indexed product *)
Section
iprod_cmra
.
Context
{
A
}
{
B
:
A
→
cmraT
}
.
Instance
iprod_op
:
Op
(
iprod
B
)
:=
λ
f
g
x
,
f
x
⋅
g
x
.
Instance
iprod_unit
:
Unit
(
iprod
B
)
:=
λ
f
x
,
unit
(
f
x
)
.
Instance
iprod_validN
:
ValidN
(
iprod
B
)
:=
λ
n
f
,
∀
x
,
✓
{
n
}
(
f
x
)
.
Instance
iprod_minus
:
Minus
(
iprod
B
)
:=
λ
f
g
x
,
f
x
⩪
g
x
.
Lemma
iprod_includedN_spec
(
f
g
:
iprod
B
)
n
:
f
≼
{
n
}
g
↔
∀
x
,
f
x
≼
{
n
}
g
x
.
Proof
.
split
.
*
by
intros
[
h
Hh
]
x
;
exists
(
h
x
);
rewrite
/
op
/
iprod_op
(
Hh
x
)
.
*
intros
Hh
;
exists
(
g
⩪
f
)=>
x
;
specialize
(
Hh
x
)
.
by
rewrite
/
op
/
iprod_op
/
minus
/
iprod_minus
cmra_op_minus
.
Qed
.
Definition
iprod_cmra_mixin
:
CMRAMixin
(
iprod
B
)
.
Proof
.
split
.
*
by
intros
n
f1
f2
f3
Hf
x
;
rewrite
/
op
/
iprod_op
(
Hf
x
)
.
*
by
intros
n
f1
f2
Hf
x
;
rewrite
/
unit
/
iprod_unit
(
Hf
x
)
.
*
by
intros
n
f1
f2
Hf
?
x
;
rewrite
-
(
Hf
x
)
.
*
by
intros
n
f
f'
Hf
g
g'
Hg
i
;
rewrite
/
minus
/
iprod_minus
(
Hf
i
)
(
Hg
i
)
.
*
by
intros
f
x
.
*
intros
n
f
Hf
x
;
apply
cmra_validN_S
,
Hf
.
*
by
intros
f1
f2
f3
x
;
rewrite
/
op
/
iprod_op
associative
.
*
by
intros
f1
f2
x
;
rewrite
/
op
/
iprod_op
commutative
.
*
by
intros
f
x
;
rewrite
/
op
/
iprod_op
/
unit
/
iprod_unit
cmra_unit_l
.
*
by
intros
f
x
;
rewrite
/
unit
/
iprod_unit
cmra_unit_idempotent
.
*
intros
n
f1
f2
;
rewrite
!
iprod_includedN_spec
=>
Hf
x
.
by
rewrite
/
unit
/
iprod_unit
;
apply
cmra_unit_preservingN
,
Hf
.
*
intros
n
f1
f2
Hf
x
;
apply
cmra_validN_op_l
with
(
f2
x
),
Hf
.
*
intros
n
f1
f2
;
rewrite
iprod_includedN_spec
=>
Hf
x
.
by
rewrite
/
op
/
iprod_op
/
minus
/
iprod_minus
cmra_op_minus
;
try
apply
Hf
.
Qed
.
Definition
iprod_cmra_extend_mixin
:
CMRAExtendMixin
(
iprod
B
)
.
Proof
.
intros
n
f
f1
f2
Hf
Hf12
.
set
(
g
x
:=
cmra_extend_op
n
(
f
x
)
(
f1
x
)
(
f2
x
)
(
Hf
x
)
(
Hf12
x
))
.
exists
((
λ
x
,
(
proj1_sig
(
g
x
)).
1
),
(
λ
x
,
(
proj1_sig
(
g
x
)).
2
))
.
split_ands
;
intros
x
;
apply
(
proj2_sig
(
g
x
))
.
Qed
.
Canonical
Structure
iprodRA
:
cmraT
:=
CMRAT
iprod_cofe_mixin
iprod_cmra_mixin
iprod_cmra_extend_mixin
.
End
iprod_cmra
.
Arguments
iprodRA
:
clear
implicits
.
This diff is collapsed.
Click to expand it.
modures/cofe.v
+
35
−
2
View file @
9fc48e66
...
...
@@ -195,8 +195,8 @@ Section cofe_mor.
Definition
cofe_mor_cofe_mixin
:
CofeMixin
(
cofeMor
A
B
)
.
Proof
.
split
.
*
intros
X
Y
;
split
;
[
intros
H
XY
n
k
;
apply
equiv_dist
,
H
XY
|]
.
intros
H
XY
k
;
apply
equiv_dist
;
intros
n
;
apply
H
XY
.
*
intros
f
g
;
split
;
[
intros
H
fg
n
k
;
apply
equiv_dist
,
H
fg
|]
.
intros
H
fg
k
;
apply
equiv_dist
;
intros
n
;
apply
H
fg
.
*
intros
n
;
split
.
+
by
intros
f
x
.
+
by
intros
f
g
?
x
.
...
...
@@ -367,3 +367,36 @@ Definition laterC_map {A B} (f : A -n> B) : laterC A -n> laterC B :=
CofeMor
(
later_map
f
)
.
Instance
laterC_map_contractive
(
A
B
:
cofeT
)
:
Contractive
(
@
laterC_map
A
B
)
.
Proof
.
intros
n
f
g
Hf
n'
;
apply
Hf
.
Qed
.
(** Indexed product *)
(** Need to put this in a definition to make canonical structures to work. *)
Definition
iprod
{
A
}
(
B
:
A
→
cofeT
)
:=
∀
x
,
B
x
.
Section
iprod_cofe
.
Context
{
A
}
{
B
:
A
→
cofeT
}
.
Instance
iprod_equiv
:
Equiv
(
iprod
B
)
:=
λ
f
g
,
∀
x
,
f
x
≡
g
x
.
Instance
iprod_dist
:
Dist
(
iprod
B
)
:=
λ
n
f
g
,
∀
x
,
f
x
=
{
n
}
=
g
x
.
Program
Definition
iprod_chain
(
c
:
chain
(
iprod
B
))
(
x
:
A
)
:
chain
(
B
x
)
:=
{|
chain_car
n
:=
c
n
x
|}
.
Next
Obligation
.
by
intros
c
x
n
i
?;
apply
(
chain_cauchy
c
)
.
Qed
.
Program
Instance
iprod_compl
:
Compl
(
iprod
B
)
:=
λ
c
x
,
compl
(
iprod_chain
c
x
)
.
Definition
iprod_cofe_mixin
:
CofeMixin
(
iprod
B
)
.
Proof
.
split
.
*
intros
f
g
;
split
;
[
intros
Hfg
n
k
;
apply
equiv_dist
,
Hfg
|]
.
intros
Hfg
k
;
apply
equiv_dist
;
intros
n
;
apply
Hfg
.
*
intros
n
;
split
.
+
by
intros
f
x
.
+
by
intros
f
g
?
x
.
+
by
intros
f
g
h
??
x
;
transitivity
(
g
x
)
.
*
intros
n
f
g
Hfg
x
;
apply
dist_S
,
Hfg
.
*
by
intros
f
g
x
.
*
intros
c
n
x
.
rewrite
/
compl
/
iprod_compl
(
conv_compl
(
iprod_chain
c
x
)
n
)
.
apply
(
chain_cauchy
c
);
lia
.
Qed
.
Canonical
Structure
iprodC
:
cofeT
:=
CofeT
iprod_cofe_mixin
.
End
iprod_cofe
.
Arguments
iprodC
:
clear
implicits
.
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