Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Joshua Yanovski
iris-coq
Commits
f6909092
Commit
f6909092
authored
Feb 10, 2016
by
Ralf Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change notation of step-indexed equality to ≡{n}≡
parent
fbedbd17
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
82 additions
and
82 deletions
+82
-82
algebra/agree.v
algebra/agree.v
+10
-10
algebra/auth.v
algebra/auth.v
+2
-2
algebra/cmra.v
algebra/cmra.v
+8
-8
algebra/cofe.v
algebra/cofe.v
+22
-22
algebra/cofe_solver.v
algebra/cofe_solver.v
+5
-5
algebra/excl.v
algebra/excl.v
+5
-5
algebra/fin_maps.v
algebra/fin_maps.v
+5
-5
algebra/iprod.v
algebra/iprod.v
+1
-1
algebra/option.v
algebra/option.v
+5
-5
algebra/upred.v
algebra/upred.v
+7
-7
program_logic/ownership.v
program_logic/ownership.v
+2
-2
program_logic/resources.v
program_logic/resources.v
+3
-3
program_logic/weakestpre.v
program_logic/weakestpre.v
+1
-1
program_logic/wsat.v
program_logic/wsat.v
+6
-6
No files found.
algebra/agree.v
View file @
f6909092
...
@@ -16,16 +16,16 @@ Section agree.
...
@@ -16,16 +16,16 @@ Section agree.
Context
{
A
:
cofeT
}
.
Context
{
A
:
cofeT
}
.
Instance
agree_validN
:
ValidN
(
agree
A
)
:=
λ
n
x
,
Instance
agree_validN
:
ValidN
(
agree
A
)
:=
λ
n
x
,
agree_is_valid
x
n
∧
∀
n
'
,
n
'
≤
n
→
x
n
'
=
{
n
'
}
=
x
n
.
agree_is_valid
x
n
∧
∀
n
'
,
n
'
≤
n
→
x
n
'
≡
{
n
'
}
≡
x
n
.
Lemma
agree_valid_le
(
x
:
agree
A
)
n
n
'
:
Lemma
agree_valid_le
(
x
:
agree
A
)
n
n
'
:
agree_is_valid
x
n
→
n
'
≤
n
→
agree_is_valid
x
n
'
.
agree_is_valid
x
n
→
n
'
≤
n
→
agree_is_valid
x
n
'
.
Proof
.
induction
2
;
eauto
using
agree_valid_S
.
Qed
.
Proof
.
induction
2
;
eauto
using
agree_valid_S
.
Qed
.
Instance
agree_equiv
:
Equiv
(
agree
A
)
:=
λ
x
y
,
Instance
agree_equiv
:
Equiv
(
agree
A
)
:=
λ
x
y
,
(
∀
n
,
agree_is_valid
x
n
↔
agree_is_valid
y
n
)
∧
(
∀
n
,
agree_is_valid
x
n
↔
agree_is_valid
y
n
)
∧
(
∀
n
,
agree_is_valid
x
n
→
x
n
=
{
n
}
=
y
n
).
(
∀
n
,
agree_is_valid
x
n
→
x
n
≡
{
n
}
≡
y
n
).
Instance
agree_dist
:
Dist
(
agree
A
)
:=
λ
n
x
y
,
Instance
agree_dist
:
Dist
(
agree
A
)
:=
λ
n
x
y
,
(
∀
n
'
,
n
'
≤
n
→
agree_is_valid
x
n
'
↔
agree_is_valid
y
n
'
)
∧
(
∀
n
'
,
n
'
≤
n
→
agree_is_valid
x
n
'
↔
agree_is_valid
y
n
'
)
∧
(
∀
n
'
,
n
'
≤
n
→
agree_is_valid
x
n
'
→
x
n
'
=
{
n
'
}
=
y
n
'
).
(
∀
n
'
,
n
'
≤
n
→
agree_is_valid
x
n
'
→
x
n
'
≡
{
n
'
}
≡
y
n
'
).
Program
Instance
agree_compl
:
Compl
(
agree
A
)
:=
λ
c
,
Program
Instance
agree_compl
:
Compl
(
agree
A
)
:=
λ
c
,
{|
agree_car
n
:=
c
n
n
;
agree_is_valid
n
:=
agree_is_valid
(
c
n
)
n
|}
.
{|
agree_car
n
:=
c
n
n
;
agree_is_valid
n
:=
agree_is_valid
(
c
n
)
n
|}
.
Next
Obligation
.
intros
;
apply
agree_valid_0
.
Qed
.
Next
Obligation
.
intros
;
apply
agree_valid_0
.
Qed
.
...
@@ -51,14 +51,14 @@ Proof.
...
@@ -51,14 +51,14 @@ Proof.
Qed
.
Qed
.
Canonical
Structure
agreeC
:=
CofeT
agree_cofe_mixin
.
Canonical
Structure
agreeC
:=
CofeT
agree_cofe_mixin
.
Lemma
agree_car_ne
(
x
y
:
agree
A
)
n
:
✓
{
n
}
x
→
x
=
{
n
}
=
y
→
x
n
=
{
n
}
=
y
n
.
Lemma
agree_car_ne
(
x
y
:
agree
A
)
n
:
✓
{
n
}
x
→
x
≡
{
n
}
≡
y
→
x
n
≡
{
n
}
≡
y
n
.
Proof
.
by
intros
[
??
]
Hxy
;
apply
Hxy
.
Qed
.
Proof
.
by
intros
[
??
]
Hxy
;
apply
Hxy
.
Qed
.
Lemma
agree_cauchy
(
x
:
agree
A
)
n
i
:
✓
{
n
}
x
→
i
≤
n
→
x
i
=
{
i
}
=
x
n
.
Lemma
agree_cauchy
(
x
:
agree
A
)
n
i
:
✓
{
n
}
x
→
i
≤
n
→
x
i
≡
{
i
}
≡
x
n
.
Proof
.
by
intros
[
?
Hx
];
apply
Hx
.
Qed
.
Proof
.
by
intros
[
?
Hx
];
apply
Hx
.
Qed
.
Program
Instance
agree_op
:
Op
(
agree
A
)
:=
λ
x
y
,
Program
Instance
agree_op
:
Op
(
agree
A
)
:=
λ
x
y
,
{|
agree_car
:=
x
;
{|
agree_car
:=
x
;
agree_is_valid
n
:=
agree_is_valid
x
n
∧
agree_is_valid
y
n
∧
x
=
{
n
}
=
y
|}
.
agree_is_valid
n
:=
agree_is_valid
x
n
∧
agree_is_valid
y
n
∧
x
≡
{
n
}
≡
y
|}
.
Next
Obligation
.
by
intros
;
simpl
;
split_ands
;
try
apply
agree_valid_0
.
Qed
.
Next
Obligation
.
by
intros
;
simpl
;
split_ands
;
try
apply
agree_valid_0
.
Qed
.
Next
Obligation
.
naive_solver
eauto
using
agree_valid_S
,
dist_S
.
Qed
.
Next
Obligation
.
naive_solver
eauto
using
agree_valid_S
,
dist_S
.
Qed
.
Instance
agree_unit
:
Unit
(
agree
A
)
:=
id
.
Instance
agree_unit
:
Unit
(
agree
A
)
:=
id
.
...
@@ -91,7 +91,7 @@ Proof.
...
@@ -91,7 +91,7 @@ Proof.
repeat
match
goal
with
H
:
agree_is_valid
_
_
|-
_
=>
clear
H
end
;
repeat
match
goal
with
H
:
agree_is_valid
_
_
|-
_
=>
clear
H
end
;
by
cofe_subst
;
rewrite
!
agree_idempotent
.
by
cofe_subst
;
rewrite
!
agree_idempotent
.
Qed
.
Qed
.
Lemma
agree_includedN
(
x
y
:
agree
A
)
n
:
x
≼
{
n
}
y
↔
y
=
{
n
}
=
x
⋅
y
.
Lemma
agree_includedN
(
x
y
:
agree
A
)
n
:
x
≼
{
n
}
y
↔
y
≡
{
n
}
≡
x
⋅
y
.
Proof
.
Proof
.
split
;
[
|
by
intros
?
;
exists
y
].
split
;
[
|
by
intros
?
;
exists
y
].
by
intros
[
z
Hz
];
rewrite
Hz
(
associative
_
)
agree_idempotent
.
by
intros
[
z
Hz
];
rewrite
Hz
(
associative
_
)
agree_idempotent
.
...
@@ -109,9 +109,9 @@ Proof.
...
@@ -109,9 +109,9 @@ Proof.
*
by
intros
x
y
n
[(
?&?&?
)
?
].
*
by
intros
x
y
n
[(
?&?&?
)
?
].
*
by
intros
x
y
n
;
rewrite
agree_includedN
.
*
by
intros
x
y
n
;
rewrite
agree_includedN
.
Qed
.
Qed
.
Lemma
agree_op_inv
(
x1
x2
:
agree
A
)
n
:
✓
{
n
}
(
x1
⋅
x2
)
→
x1
=
{
n
}
=
x2
.
Lemma
agree_op_inv
(
x1
x2
:
agree
A
)
n
:
✓
{
n
}
(
x1
⋅
x2
)
→
x1
≡
{
n
}
≡
x2
.
Proof
.
intros
Hxy
;
apply
Hxy
.
Qed
.
Proof
.
intros
Hxy
;
apply
Hxy
.
Qed
.
Lemma
agree_valid_includedN
(
x
y
:
agree
A
)
n
:
✓
{
n
}
y
→
x
≼
{
n
}
y
→
x
=
{
n
}
=
y
.
Lemma
agree_valid_includedN
(
x
y
:
agree
A
)
n
:
✓
{
n
}
y
→
x
≼
{
n
}
y
→
x
≡
{
n
}
≡
y
.
Proof
.
Proof
.
move
=>
Hval
[
z
Hy
];
move
:
Hval
;
rewrite
Hy
.
move
=>
Hval
[
z
Hy
];
move
:
Hval
;
rewrite
Hy
.
by
move
=>
/
agree_op_inv
->
;
rewrite
agree_idempotent
.
by
move
=>
/
agree_op_inv
->
;
rewrite
agree_idempotent
.
...
@@ -133,7 +133,7 @@ Proof. intros x1 x2 Hx; split; naive_solver eauto using @dist_le. Qed.
...
@@ -133,7 +133,7 @@ Proof. intros x1 x2 Hx; split; naive_solver eauto using @dist_le. Qed.
Global
Instance
to_agree_proper
:
Proper
((
≡
)
==>
(
≡
))
to_agree
:=
ne_proper
_.
Global
Instance
to_agree_proper
:
Proper
((
≡
)
==>
(
≡
))
to_agree
:=
ne_proper
_.
Global
Instance
to_agree_inj
n
:
Injective
(
dist
n
)
(
dist
n
)
(
to_agree
).
Global
Instance
to_agree_inj
n
:
Injective
(
dist
n
)
(
dist
n
)
(
to_agree
).
Proof
.
by
intros
x
y
[
_
Hxy
];
apply
Hxy
.
Qed
.
Proof
.
by
intros
x
y
[
_
Hxy
];
apply
Hxy
.
Qed
.
Lemma
to_agree_car
n
(
x
:
agree
A
)
:
✓
{
n
}
x
→
to_agree
(
x
n
)
=
{
n
}
=
x
.
Lemma
to_agree_car
n
(
x
:
agree
A
)
:
✓
{
n
}
x
→
to_agree
(
x
n
)
≡
{
n
}
≡
x
.
Proof
.
intros
[
??
];
split
;
naive_solver
eauto
using
agree_valid_le
.
Qed
.
Proof
.
intros
[
??
];
split
;
naive_solver
eauto
using
agree_valid_le
.
Qed
.
End
agree
.
End
agree
.
...
...
algebra/auth.v
View file @
f6909092
...
@@ -19,7 +19,7 @@ Implicit Types x y : auth A.
...
@@ -19,7 +19,7 @@ Implicit Types x y : auth A.
Instance
auth_equiv
:
Equiv
(
auth
A
)
:=
λ
x
y
,
Instance
auth_equiv
:
Equiv
(
auth
A
)
:=
λ
x
y
,
authoritative
x
≡
authoritative
y
∧
own
x
≡
own
y
.
authoritative
x
≡
authoritative
y
∧
own
x
≡
own
y
.
Instance
auth_dist
:
Dist
(
auth
A
)
:=
λ
n
x
y
,
Instance
auth_dist
:
Dist
(
auth
A
)
:=
λ
n
x
y
,
authoritative
x
=
{
n
}
=
authoritative
y
∧
own
x
=
{
n
}
=
own
y
.
authoritative
x
≡
{
n
}
≡
authoritative
y
∧
own
x
≡
{
n
}
≡
own
y
.
Global
Instance
Auth_ne
:
Proper
(
dist
n
==>
dist
n
==>
dist
n
)
(
@
Auth
A
).
Global
Instance
Auth_ne
:
Proper
(
dist
n
==>
dist
n
==>
dist
n
)
(
@
Auth
A
).
Proof
.
by
split
.
Qed
.
Proof
.
by
split
.
Qed
.
...
@@ -148,7 +148,7 @@ Lemma auth_frag_op a b : ◯ (a ⋅ b) ≡ ◯ a ⋅ ◯ b.
...
@@ -148,7 +148,7 @@ Lemma auth_frag_op a b : ◯ (a ⋅ b) ≡ ◯ a ⋅ ◯ b.
Proof
.
done
.
Qed
.
Proof
.
done
.
Qed
.
Lemma
auth_update
a
a
'
b
b
'
:
Lemma
auth_update
a
a
'
b
b
'
:
(
∀
n
af
,
✓
{
S
n
}
a
→
a
=
{
S
n
}
=
a
'
⋅
af
→
b
=
{
S
n
}
=
b
'
⋅
af
∧
✓
{
S
n
}
b
)
→
(
∀
n
af
,
✓
{
S
n
}
a
→
a
≡
{
S
n
}
≡
a
'
⋅
af
→
b
≡
{
S
n
}
≡
b
'
⋅
af
∧
✓
{
S
n
}
b
)
→
●
a
⋅
◯
a
'
~~>
●
b
⋅
◯
b
'
.
●
a
⋅
◯
a
'
~~>
●
b
⋅
◯
b
'
.
Proof
.
Proof
.
move
=>
Hab
[[
?|
|
]
bf1
]
n
// =>-[[bf2 Ha] ?]; do 2 red; simpl in *.
move
=>
Hab
[[
?|
|
]
bf1
]
n
// =>-[[bf2 Ha] ?]; do 2 red; simpl in *.
...
...
algebra/cmra.v
View file @
f6909092
...
@@ -27,7 +27,7 @@ Instance: Params (@valid) 2.
...
@@ -27,7 +27,7 @@ Instance: Params (@valid) 2.
Notation
"✓"
:=
valid
(
at
level
1
).
Notation
"✓"
:=
valid
(
at
level
1
).
Instance
validN_valid
`
{
ValidN
A
}
:
Valid
A
:=
λ
x
,
∀
n
,
✓
{
n
}
x
.
Instance
validN_valid
`
{
ValidN
A
}
:
Valid
A
:=
λ
x
,
∀
n
,
✓
{
n
}
x
.
Definition
includedN
`
{
Dist
A
,
Op
A
}
(
n
:
nat
)
(
x
y
:
A
)
:=
∃
z
,
y
=
{
n
}
=
x
⋅
z
.
Definition
includedN
`
{
Dist
A
,
Op
A
}
(
n
:
nat
)
(
x
y
:
A
)
:=
∃
z
,
y
≡
{
n
}
≡
x
⋅
z
.
Notation
"x ≼{ n } y"
:=
(
includedN
n
x
y
)
Notation
"x ≼{ n } y"
:=
(
includedN
n
x
y
)
(
at
level
70
,
format
"x ≼{ n } y"
)
:
C_scope
.
(
at
level
70
,
format
"x ≼{ n } y"
)
:
C_scope
.
Instance:
Params
(
@
includedN
)
4.
Instance:
Params
(
@
includedN
)
4.
...
@@ -49,11 +49,11 @@ Record CMRAMixin A `{Dist A, Equiv A, Unit A, Op A, ValidN A, Minus A} := {
...
@@ -49,11 +49,11 @@ Record CMRAMixin A `{Dist A, Equiv A, Unit A, Op A, ValidN A, Minus A} := {
mixin_cmra_unit_idempotent
x
:
unit
(
unit
x
)
≡
unit
x
;
mixin_cmra_unit_idempotent
x
:
unit
(
unit
x
)
≡
unit
x
;
mixin_cmra_unit_preservingN
n
x
y
:
x
≼
{
n
}
y
→
unit
x
≼
{
n
}
unit
y
;
mixin_cmra_unit_preservingN
n
x
y
:
x
≼
{
n
}
y
→
unit
x
≼
{
n
}
unit
y
;
mixin_cmra_validN_op_l
n
x
y
:
✓
{
n
}
(
x
⋅
y
)
→
✓
{
n
}
x
;
mixin_cmra_validN_op_l
n
x
y
:
✓
{
n
}
(
x
⋅
y
)
→
✓
{
n
}
x
;
mixin_cmra_op_minus
n
x
y
:
x
≼
{
n
}
y
→
x
⋅
y
⩪
x
=
{
n
}
=
y
mixin_cmra_op_minus
n
x
y
:
x
≼
{
n
}
y
→
x
⋅
y
⩪
x
≡
{
n
}
≡
y
}
.
}
.
Definition
CMRAExtendMixin
A
`
{
Equiv
A
,
Dist
A
,
Op
A
,
ValidN
A
}
:=
∀
n
x
y1
y2
,
Definition
CMRAExtendMixin
A
`
{
Equiv
A
,
Dist
A
,
Op
A
,
ValidN
A
}
:=
∀
n
x
y1
y2
,
✓
{
n
}
x
→
x
=
{
n
}
=
y1
⋅
y2
→
✓
{
n
}
x
→
x
≡
{
n
}
≡
y1
⋅
y2
→
{
z
|
x
≡
z
.1
⋅
z
.2
∧
z
.1
=
{
n
}
=
y1
∧
z
.2
=
{
n
}
=
y2
}
.
{
z
|
x
≡
z
.1
⋅
z
.2
∧
z
.1
≡
{
n
}
≡
y1
∧
z
.2
≡
{
n
}
≡
y2
}
.
(
**
Bundeled
version
*
)
(
**
Bundeled
version
*
)
Structure
cmraT
:=
CMRAT
{
Structure
cmraT
:=
CMRAT
{
...
@@ -115,11 +115,11 @@ Section cmra_mixin.
...
@@ -115,11 +115,11 @@ Section cmra_mixin.
Proof
.
apply
(
mixin_cmra_unit_preservingN
_
(
cmra_mixin
A
)).
Qed
.
Proof
.
apply
(
mixin_cmra_unit_preservingN
_
(
cmra_mixin
A
)).
Qed
.
Lemma
cmra_validN_op_l
n
x
y
:
✓
{
n
}
(
x
⋅
y
)
→
✓
{
n
}
x
.
Lemma
cmra_validN_op_l
n
x
y
:
✓
{
n
}
(
x
⋅
y
)
→
✓
{
n
}
x
.
Proof
.
apply
(
mixin_cmra_validN_op_l
_
(
cmra_mixin
A
)).
Qed
.
Proof
.
apply
(
mixin_cmra_validN_op_l
_
(
cmra_mixin
A
)).
Qed
.
Lemma
cmra_op_minus
n
x
y
:
x
≼
{
n
}
y
→
x
⋅
y
⩪
x
=
{
n
}
=
y
.
Lemma
cmra_op_minus
n
x
y
:
x
≼
{
n
}
y
→
x
⋅
y
⩪
x
≡
{
n
}
≡
y
.
Proof
.
apply
(
mixin_cmra_op_minus
_
(
cmra_mixin
A
)).
Qed
.
Proof
.
apply
(
mixin_cmra_op_minus
_
(
cmra_mixin
A
)).
Qed
.
Lemma
cmra_extend_op
n
x
y1
y2
:
Lemma
cmra_extend_op
n
x
y1
y2
:
✓
{
n
}
x
→
x
=
{
n
}
=
y1
⋅
y2
→
✓
{
n
}
x
→
x
≡
{
n
}
≡
y1
⋅
y2
→
{
z
|
x
≡
z
.1
⋅
z
.2
∧
z
.1
=
{
n
}
=
y1
∧
z
.2
=
{
n
}
=
y2
}
.
{
z
|
x
≡
z
.1
⋅
z
.2
∧
z
.1
≡
{
n
}
≡
y1
∧
z
.2
≡
{
n
}
≡
y2
}
.
Proof
.
apply
(
cmra_extend_mixin
A
).
Qed
.
Proof
.
apply
(
cmra_extend_mixin
A
).
Qed
.
End
cmra_mixin
.
End
cmra_mixin
.
...
@@ -277,7 +277,7 @@ Lemma cmra_preserving_r x y z : x ≼ y → x ⋅ z ≼ y ⋅ z.
...
@@ -277,7 +277,7 @@ Lemma cmra_preserving_r x y z : x ≼ y → x ⋅ z ≼ y ⋅ z.
Proof
.
by
intros
;
rewrite
-!
(
commutative
_
z
);
apply
cmra_preserving_l
.
Qed
.
Proof
.
by
intros
;
rewrite
-!
(
commutative
_
z
);
apply
cmra_preserving_l
.
Qed
.
Lemma
cmra_included_dist_l
x1
x2
x1
'
n
:
Lemma
cmra_included_dist_l
x1
x2
x1
'
n
:
x1
≼
x2
→
x1
'
=
{
n
}
=
x1
→
∃
x2
'
,
x1
'
≼
x2
'
∧
x2
'
=
{
n
}
=
x2
.
x1
≼
x2
→
x1
'
≡
{
n
}
≡
x1
→
∃
x2
'
,
x1
'
≼
x2
'
∧
x2
'
≡
{
n
}
≡
x2
.
Proof
.
Proof
.
intros
[
z
Hx2
]
Hx1
;
exists
(
x1
'
⋅
z
);
split
;
auto
using
cmra_included_l
.
intros
[
z
Hx2
]
Hx1
;
exists
(
x1
'
⋅
z
);
split
;
auto
using
cmra_included_l
.
by
rewrite
Hx1
Hx2
.
by
rewrite
Hx1
Hx2
.
...
...
algebra/cofe.v
View file @
f6909092
...
@@ -3,10 +3,10 @@ Require Export algebra.base.
...
@@ -3,10 +3,10 @@ Require Export algebra.base.
(
**
Unbundeled
version
*
)
(
**
Unbundeled
version
*
)
Class
Dist
A
:=
dist
:
nat
→
relation
A
.
Class
Dist
A
:=
dist
:
nat
→
relation
A
.
Instance:
Params
(
@
dist
)
3.
Instance:
Params
(
@
dist
)
3.
Notation
"x
=
{ n }
=
y"
:=
(
dist
n
x
y
)
Notation
"x
≡
{ n }
≡
y"
:=
(
dist
n
x
y
)
(
at
level
70
,
n
at
next
level
,
format
"x
=
{ n }
=
y"
).
(
at
level
70
,
n
at
next
level
,
format
"x
≡
{ n }
≡
y"
).
Hint
Extern
0
(
?
x
=
{
_
}
=
?
y
)
=>
reflexivity
.
Hint
Extern
0
(
?
x
≡
{
_
}
≡
?
y
)
=>
reflexivity
.
Hint
Extern
0
(
_
=
{
_
}
=
_
)
=>
symmetry
;
assumption
.
Hint
Extern
0
(
_
≡
{
_
}
≡
_
)
=>
symmetry
;
assumption
.
Tactic
Notation
"cofe_subst"
ident
(
x
)
:=
Tactic
Notation
"cofe_subst"
ident
(
x
)
:=
repeat
match
goal
with
repeat
match
goal
with
...
@@ -23,18 +23,18 @@ Tactic Notation "cofe_subst" :=
...
@@ -23,18 +23,18 @@ Tactic Notation "cofe_subst" :=
Record
chain
(
A
:
Type
)
`
{
Dist
A
}
:=
{
Record
chain
(
A
:
Type
)
`
{
Dist
A
}
:=
{
chain_car
:>
nat
→
A
;
chain_car
:>
nat
→
A
;
chain_cauchy
n
i
:
n
≤
i
→
chain_car
n
=
{
n
}
=
chain_car
i
chain_cauchy
n
i
:
n
≤
i
→
chain_car
n
≡
{
n
}
≡
chain_car
i
}
.
}
.
Arguments
chain_car
{
_
_
}
_
_.
Arguments
chain_car
{
_
_
}
_
_.
Arguments
chain_cauchy
{
_
_
}
_
_
_
_.
Arguments
chain_cauchy
{
_
_
}
_
_
_
_.
Class
Compl
A
`
{
Dist
A
}
:=
compl
:
chain
A
→
A
.
Class
Compl
A
`
{
Dist
A
}
:=
compl
:
chain
A
→
A
.
Record
CofeMixin
A
`
{
Equiv
A
,
Compl
A
}
:=
{
Record
CofeMixin
A
`
{
Equiv
A
,
Compl
A
}
:=
{
mixin_equiv_dist
x
y
:
x
≡
y
↔
∀
n
,
x
=
{
n
}
=
y
;
mixin_equiv_dist
x
y
:
x
≡
y
↔
∀
n
,
x
≡
{
n
}
≡
y
;
mixin_dist_equivalence
n
:
Equivalence
(
dist
n
);
mixin_dist_equivalence
n
:
Equivalence
(
dist
n
);
mixin_dist_S
n
x
y
:
x
=
{
S
n
}
=
y
→
x
=
{
n
}
=
y
;
mixin_dist_S
n
x
y
:
x
≡
{
S
n
}
≡
y
→
x
≡
{
n
}
≡
y
;
mixin_dist_0
x
y
:
x
=
{
0
}
=
y
;
mixin_dist_0
x
y
:
x
≡
{
0
}
≡
y
;
mixin_conv_compl
(
c
:
chain
A
)
n
:
compl
c
=
{
n
}
=
c
n
mixin_conv_compl
(
c
:
chain
A
)
n
:
compl
c
≡
{
n
}
≡
c
n
}
.
}
.
Class
Contractive
`
{
Dist
A
,
Dist
B
}
(
f
:
A
->
B
)
:=
Class
Contractive
`
{
Dist
A
,
Dist
B
}
(
f
:
A
->
B
)
:=
contractive
n
:
Proper
(
dist
n
==>
dist
(
S
n
))
f
.
contractive
n
:
Proper
(
dist
n
==>
dist
(
S
n
))
f
.
...
@@ -60,19 +60,19 @@ Arguments cofe_mixin : simpl never.
...
@@ -60,19 +60,19 @@ Arguments cofe_mixin : simpl never.
Section
cofe_mixin
.
Section
cofe_mixin
.
Context
{
A
:
cofeT
}
.
Context
{
A
:
cofeT
}
.
Implicit
Types
x
y
:
A
.
Implicit
Types
x
y
:
A
.
Lemma
equiv_dist
x
y
:
x
≡
y
↔
∀
n
,
x
=
{
n
}
=
y
.
Lemma
equiv_dist
x
y
:
x
≡
y
↔
∀
n
,
x
≡
{
n
}
≡
y
.
Proof
.
apply
(
mixin_equiv_dist
_
(
cofe_mixin
A
)).
Qed
.
Proof
.
apply
(
mixin_equiv_dist
_
(
cofe_mixin
A
)).
Qed
.
Global
Instance
dist_equivalence
n
:
Equivalence
(
@
dist
A
_
n
).
Global
Instance
dist_equivalence
n
:
Equivalence
(
@
dist
A
_
n
).
Proof
.
apply
(
mixin_dist_equivalence
_
(
cofe_mixin
A
)).
Qed
.
Proof
.
apply
(
mixin_dist_equivalence
_
(
cofe_mixin
A
)).
Qed
.
Lemma
dist_S
n
x
y
:
x
=
{
S
n
}
=
y
→
x
=
{
n
}
=
y
.
Lemma
dist_S
n
x
y
:
x
≡
{
S
n
}
≡
y
→
x
≡
{
n
}
≡
y
.
Proof
.
apply
(
mixin_dist_S
_
(
cofe_mixin
A
)).
Qed
.
Proof
.
apply
(
mixin_dist_S
_
(
cofe_mixin
A
)).
Qed
.
Lemma
dist_0
x
y
:
x
=
{
0
}
=
y
.
Lemma
dist_0
x
y
:
x
≡
{
0
}
≡
y
.
Proof
.
apply
(
mixin_dist_0
_
(
cofe_mixin
A
)).
Qed
.
Proof
.
apply
(
mixin_dist_0
_
(
cofe_mixin
A
)).
Qed
.
Lemma
conv_compl
(
c
:
chain
A
)
n
:
compl
c
=
{
n
}
=
c
n
.
Lemma
conv_compl
(
c
:
chain
A
)
n
:
compl
c
≡
{
n
}
≡
c
n
.
Proof
.
apply
(
mixin_conv_compl
_
(
cofe_mixin
A
)).
Qed
.
Proof
.
apply
(
mixin_conv_compl
_
(
cofe_mixin
A
)).
Qed
.
End
cofe_mixin
.
End
cofe_mixin
.
Hint
Extern
0
(
_
=
{
0
}
=
_
)
=>
apply
dist_0
.
Hint
Extern
0
(
_
≡
{
0
}
≡
_
)
=>
apply
dist_0
.
(
**
General
properties
*
)
(
**
General
properties
*
)
Section
cofe
.
Section
cofe
.
...
@@ -97,7 +97,7 @@ Section cofe.
...
@@ -97,7 +97,7 @@ Section cofe.
Qed
.
Qed
.
Global
Instance
dist_proper_2
n
x
:
Proper
((
≡
)
==>
iff
)
(
dist
n
x
).
Global
Instance
dist_proper_2
n
x
:
Proper
((
≡
)
==>
iff
)
(
dist
n
x
).
Proof
.
by
apply
dist_proper
.
Qed
.
Proof
.
by
apply
dist_proper
.
Qed
.
Lemma
dist_le
(
x
y
:
A
)
n
n
'
:
x
=
{
n
}
=
y
→
n
'
≤
n
→
x
=
{
n
'
}
=
y
.
Lemma
dist_le
(
x
y
:
A
)
n
n
'
:
x
≡
{
n
}
≡
y
→
n
'
≤
n
→
x
≡
{
n
'
}
≡
y
.
Proof
.
induction
2
;
eauto
using
dist_S
.
Qed
.
Proof
.
induction
2
;
eauto
using
dist_S
.
Qed
.
Instance
ne_proper
{
B
:
cofeT
}
(
f
:
A
→
B
)
Instance
ne_proper
{
B
:
cofeT
}
(
f
:
A
→
B
)
`
{!
∀
n
,
Proper
(
dist
n
==>
dist
n
)
f
}
:
Proper
((
≡
)
==>
(
≡
))
f
|
100.
`
{!
∀
n
,
Proper
(
dist
n
==>
dist
n
)
f
}
:
Proper
((
≡
)
==>
(
≡
))
f
|
100.
...
@@ -109,7 +109,7 @@ Section cofe.
...
@@ -109,7 +109,7 @@ Section cofe.
unfold
Proper
,
respectful
;
setoid_rewrite
equiv_dist
.
unfold
Proper
,
respectful
;
setoid_rewrite
equiv_dist
.
by
intros
x1
x2
Hx
y1
y2
Hy
n
;
rewrite
(
Hx
n
)
(
Hy
n
).
by
intros
x1
x2
Hx
y1
y2
Hy
n
;
rewrite
(
Hx
n
)
(
Hy
n
).
Qed
.
Qed
.
Lemma
compl_ne
(
c1
c2
:
chain
A
)
n
:
c1
n
=
{
n
}
=
c2
n
→
compl
c1
=
{
n
}
=
compl
c2
.
Lemma
compl_ne
(
c1
c2
:
chain
A
)
n
:
c1
n
≡
{
n
}
≡
c2
n
→
compl
c1
≡
{
n
}
≡
compl
c2
.
Proof
.
intros
.
by
rewrite
(
conv_compl
c1
n
)
(
conv_compl
c2
n
).
Qed
.
Proof
.
intros
.
by
rewrite
(
conv_compl
c1
n
)
(
conv_compl
c2
n
).
Qed
.
Lemma
compl_ext
(
c1
c2
:
chain
A
)
:
(
∀
i
,
c1
i
≡
c2
i
)
→
compl
c1
≡
compl
c2
.
Lemma
compl_ext
(
c1
c2
:
chain
A
)
:
(
∀
i
,
c1
i
≡
c2
i
)
→
compl
c1
≡
compl
c2
.
Proof
.
setoid_rewrite
equiv_dist
;
naive_solver
eauto
using
compl_ne
.
Qed
.
Proof
.
setoid_rewrite
equiv_dist
;
naive_solver
eauto
using
compl_ne
.
Qed
.
...
@@ -127,9 +127,9 @@ Program Definition chain_map `{Dist A, Dist B} (f : A → B)
...
@@ -127,9 +127,9 @@ Program Definition chain_map `{Dist A, Dist B} (f : A → B)
Next
Obligation
.
by
intros
?
A
?
B
f
Hf
c
n
i
?
;
apply
Hf
,
chain_cauchy
.
Qed
.
Next
Obligation
.
by
intros
?
A
?
B
f
Hf
c
n
i
?
;
apply
Hf
,
chain_cauchy
.
Qed
.
(
**
Timeless
elements
*
)
(
**
Timeless
elements
*
)
Class
Timeless
{
A
:
cofeT
}
(
x
:
A
)
:=
timeless
y
:
x
=
{
1
}
=
y
→
x
≡
y
.
Class
Timeless
{
A
:
cofeT
}
(
x
:
A
)
:=
timeless
y
:
x
≡
{
1
}
≡
y
→
x
≡
y
.
Arguments
timeless
{
_
}
_
{
_
}
_
_.
Arguments
timeless
{
_
}
_
{
_
}
_
_.
Lemma
timeless_S
{
A
:
cofeT
}
(
x
y
:
A
)
n
:
Timeless
x
→
x
≡
y
↔
x
=
{
S
n
}
=
y
.
Lemma
timeless_S
{
A
:
cofeT
}
(
x
y
:
A
)
n
:
Timeless
x
→
x
≡
y
↔
x
≡
{
S
n
}
≡
y
.
Proof
.
Proof
.
split
;
intros
;
[
by
apply
equiv_dist
|
].
split
;
intros
;
[
by
apply
equiv_dist
|
].
apply
(
timeless
_
),
dist_le
with
(
S
n
);
auto
with
lia
.
apply
(
timeless
_
),
dist_le
with
(
S
n
);
auto
with
lia
.
...
@@ -154,7 +154,7 @@ Section fixpoint.
...
@@ -154,7 +154,7 @@ Section fixpoint.
by
rewrite
{
1
}
(
chain_cauchy
(
fixpoint_chain
f
)
n
(
S
n
));
last
lia
.
by
rewrite
{
1
}
(
chain_cauchy
(
fixpoint_chain
f
)
n
(
S
n
));
last
lia
.
Qed
.
Qed
.
Lemma
fixpoint_ne
(
g
:
A
→
A
)
`
{!
Contractive
g
}
n
:
Lemma
fixpoint_ne
(
g
:
A
→
A
)
`
{!
Contractive
g
}
n
:
(
∀
z
,
f
z
=
{
n
}
=
g
z
)
→
fixpoint
f
=
{
n
}
=
fixpoint
g
.
(
∀
z
,
f
z
≡
{
n
}
≡
g
z
)
→
fixpoint
f
≡
{
n
}
≡
fixpoint
g
.
Proof
.
Proof
.
intros
Hfg
;
unfold
fixpoint
.
intros
Hfg
;
unfold
fixpoint
.
rewrite
(
conv_compl
(
fixpoint_chain
f
)
n
)
(
conv_compl
(
fixpoint_chain
g
)
n
).
rewrite
(
conv_compl
(
fixpoint_chain
f
)
n
)
(
conv_compl
(
fixpoint_chain
g
)
n
).
...
@@ -181,7 +181,7 @@ Section cofe_mor.
...
@@ -181,7 +181,7 @@ Section cofe_mor.
Global
Instance
cofe_mor_proper
(
f
:
cofeMor
A
B
)
:
Proper
((
≡
)
==>
(
≡
))
f
.
Global
Instance
cofe_mor_proper
(
f
:
cofeMor
A
B
)
:
Proper
((
≡
)
==>
(
≡
))
f
.
Proof
.
apply
ne_proper
,
cofe_mor_ne
.
Qed
.
Proof
.
apply
ne_proper
,
cofe_mor_ne
.
Qed
.
Instance
cofe_mor_equiv
:
Equiv
(
cofeMor
A
B
)
:=
λ
f
g
,
∀
x
,
f
x
≡
g
x
.
Instance
cofe_mor_equiv
:
Equiv
(
cofeMor
A
B
)
:=
λ
f
g
,
∀
x
,
f
x
≡
g
x
.
Instance
cofe_mor_dist
:
Dist
(
cofeMor
A
B
)
:=
λ
n
f
g
,
∀
x
,
f
x
=
{
n
}
=
g
x
.
Instance
cofe_mor_dist
:
Dist
(
cofeMor
A
B
)
:=
λ
n
f
g
,
∀
x
,
f
x
≡
{
n
}
≡
g
x
.
Program
Definition
fun_chain
`
(
c
:
chain
(
cofeMor
A
B
))
(
x
:
A
)
:
chain
B
:=
Program
Definition
fun_chain
`
(
c
:
chain
(
cofeMor
A
B
))
(
x
:
A
)
:
chain
B
:=
{|
chain_car
n
:=
c
n
x
|}
.
{|
chain_car
n
:=
c
n
x
|}
.
Next
Obligation
.
intros
c
x
n
i
?
.
by
apply
(
chain_cauchy
c
).
Qed
.
Next
Obligation
.
intros
c
x
n
i
?
.
by
apply
(
chain_cauchy
c
).
Qed
.
...
@@ -230,7 +230,7 @@ Definition ccompose {A B C}
...
@@ -230,7 +230,7 @@ Definition ccompose {A B C}
Instance:
Params
(
@
ccompose
)
3.
Instance:
Params
(
@
ccompose
)
3.
Infix
"◎"
:=
ccompose
(
at
level
40
,
left
associativity
).
Infix
"◎"
:=
ccompose
(
at
level
40
,
left
associativity
).
Lemma
ccompose_ne
{
A
B
C
}
(
f1
f2
:
B
-
n
>
C
)
(
g1
g2
:
A
-
n
>
B
)
n
:
Lemma
ccompose_ne
{
A
B
C
}
(
f1
f2
:
B
-
n
>
C
)
(
g1
g2
:
A
-
n
>
B
)
n
:
f1
=
{
n
}
=
f2
→
g1
=
{
n
}
=
g2
→
f1
◎
g1
=
{
n
}
=
f2
◎
g2
.
f1
≡
{
n
}
≡
f2
→
g1
≡
{
n
}
≡
g2
→
f1
◎
g1
≡
{
n
}
≡
f2
◎
g2
.
Proof
.
by
intros
Hf
Hg
x
;
rewrite
/=
(
Hg
x
)
(
Hf
(
g2
x
)).
Qed
.
Proof
.
by
intros
Hf
Hg
x
;
rewrite
/=
(
Hg
x
)
(
Hf
(
g2
x
)).
Qed
.
(
**
unit
*
)
(
**
unit
*
)
...
@@ -325,7 +325,7 @@ Section later.
...
@@ -325,7 +325,7 @@ Section later.
Context
{
A
:
cofeT
}
.
Context
{
A
:
cofeT
}
.
Instance
later_equiv
:
Equiv
(
later
A
)
:=
λ
x
y
,
later_car
x
≡
later_car
y
.
Instance
later_equiv
:
Equiv
(
later
A
)
:=
λ
x
y
,
later_car
x
≡
later_car
y
.
Instance
later_dist
:
Dist
(
later
A
)
:=
λ
n
x
y
,
Instance
later_dist
:
Dist
(
later
A
)
:=
λ
n
x
y
,
match
n
with
0
=>
True
|
S
n
=>
later_car
x
=
{
n
}
=
later_car
y
end
.
match
n
with
0
=>
True
|
S
n
=>
later_car
x
≡
{
n
}
≡
later_car
y
end
.
Program
Definition
later_chain
(
c
:
chain
(
later
A
))
:
chain
A
:=
Program
Definition
later_chain
(
c
:
chain
(
later
A
))
:
chain
A
:=
{|
chain_car
n
:=
later_car
(
c
(
S
n
))
|}
.
{|
chain_car
n
:=
later_car
(
c
(
S
n
))
|}
.
Next
Obligation
.
intros
c
n
i
?
;
apply
(
chain_cauchy
c
(
S
n
));
lia
.
Qed
.
Next
Obligation
.
intros
c
n
i
?
;
apply
(
chain_cauchy
c
(
S
n
));
lia
.
Qed
.
...
...
algebra/cofe_solver.v
View file @
f6909092
...
@@ -42,7 +42,7 @@ Proof.
...
@@ -42,7 +42,7 @@ Proof.
induction
k
as
[
|
k
IH
];
simpl
in
*
;
[
by
destruct
x
|
].
induction
k
as
[
|
k
IH
];
simpl
in
*
;
[
by
destruct
x
|
].
rewrite
-
map_comp
-{
2
}
(
map_id
_
_
x
);
by
apply
map_ext
.
rewrite
-
map_comp
-{
2
}
(
map_id
_
_
x
);
by
apply
map_ext
.
Qed
.
Qed
.
Lemma
fg
{
n
k
}
(
x
:
A
(
S
k
))
:
n
≤
k
→
f
(
g
x
)
=
{
n
}
=
x
.
Lemma
fg
{
n
k
}
(
x
:
A
(
S
k
))
:
n
≤
k
→
f
(
g
x
)
≡
{
n
}
≡
x
.
Proof
.
Proof
.
intros
Hnk
;
apply
dist_le
with
k
;
auto
;
clear
Hnk
.
intros
Hnk
;
apply
dist_le
with
k
;
auto
;
clear
Hnk
.
induction
k
as
[
|
k
IH
];
simpl
;
[
apply
dist_0
|
].
induction
k
as
[
|
k
IH
];
simpl
;
[
apply
dist_0
|
].
...
@@ -57,7 +57,7 @@ Record tower := {
...
@@ -57,7 +57,7 @@ Record tower := {
g_tower
k
:
g
(
tower_car
(
S
k
))
≡
tower_car
k
g_tower
k
:
g
(
tower_car
(
S
k
))
≡
tower_car
k
}
.
}
.
Instance
tower_equiv
:
Equiv
tower
:=
λ
X
Y
,
∀
k
,
X
k
≡
Y
k
.
Instance
tower_equiv
:
Equiv
tower
:=
λ
X
Y
,
∀
k
,
X
k
≡
Y
k
.
Instance
tower_dist
:
Dist
tower
:=
λ
n
X
Y
,
∀
k
,
X
k
=
{
n
}
=
Y
k
.
Instance
tower_dist
:
Dist
tower
:=
λ
n
X
Y
,
∀
k
,
X
k
≡
{
n
}
≡
Y
k
.
Program
Definition
tower_chain
(
c
:
chain
tower
)
(
k
:
nat
)
:
chain
(
A
k
)
:=
Program
Definition
tower_chain
(
c
:
chain
tower
)
(
k
:
nat
)
:
chain
(
A
k
)
:=
{|
chain_car
i
:=
c
i
k
|}
.
{|
chain_car
i
:=
c
i
k
|}
.
Next
Obligation
.
intros
c
k
n
i
?
;
apply
(
chain_cauchy
c
n
);
lia
.
Qed
.
Next
Obligation
.
intros
c
k
n
i
?
;
apply
(
chain_cauchy
c
n
);
lia
.
Qed
.
...
@@ -91,9 +91,9 @@ Fixpoint gg {k} (i : nat) : A (i + k) -n> A k :=
...
@@ -91,9 +91,9 @@ Fixpoint gg {k} (i : nat) : A (i + k) -n> A k :=
match
i
with
0
=>
cid
|
S
i
=>
gg
i
◎
g
end
.
match
i
with
0
=>
cid
|
S
i
=>
gg
i
◎
g
end
.
Lemma
ggff
{
k
i
}
(
x
:
A
k
)
:
gg
i
(
ff
i
x
)
≡
x
.
Lemma
ggff
{
k
i
}
(
x
:
A
k
)
:
gg
i
(
ff
i
x
)
≡
x
.
Proof
.
induction
i
as
[
|
i
IH
];
simpl
;
[
done
|
by
rewrite
(
gf
(
ff
i
x
))
IH
].
Qed
.
Proof
.
induction
i
as
[
|
i
IH
];
simpl
;
[
done
|
by
rewrite
(
gf
(
ff
i
x
))
IH
].
Qed
.
Lemma
f_tower
{
n
k
}
(
X
:
tower
)
:
n
≤
k
→
f
(
X
k
)
=
{
n
}
=
X
(
S
k
).
Lemma
f_tower
{
n
k
}
(
X
:
tower
)
:
n
≤
k
→
f
(
X
k
)
≡
{
n
}
≡
X
(
S
k
).
Proof
.
intros
.
by
rewrite
-
(
fg
(
X
(
S
k
)))
// -(g_tower X). Qed.
Proof
.
intros
.
by
rewrite
-
(
fg
(
X
(
S
k
)))
// -(g_tower X). Qed.
Lemma
ff_tower
{
n
}
k
i
(
X
:
tower
)
:
n
≤
k
→
ff
i
(
X
k
)
=
{
n
}
=
X
(
i
+
k
).
Lemma
ff_tower
{
n
}
k
i
(
X
:
tower
)
:
n
≤
k
→
ff
i
(
X
k
)
≡
{
n
}
≡
X
(
i
+
k
).
Proof
.
Proof
.
intros
;
induction
i
as
[
|
i
IH
];
simpl
;
[
done
|
].
intros
;
induction
i
as
[
|
i
IH
];
simpl
;
[
done
|
].
by
rewrite
IH
(
f_tower
X
);
last
lia
.
by
rewrite
IH
(
f_tower
X
);
last
lia
.
...
@@ -170,7 +170,7 @@ Proof.
...
@@ -170,7 +170,7 @@ Proof.
*
assert
(
H
:
(
i
-
S
k
)
+
(
1
+
k
)
=
i
)
by
lia
;
rewrite
(
ff_ff
_
H
)
/=
.
*
assert
(
H
:
(
i
-
S
k
)
+
(
1
+
k
)
=
i
)
by
lia
;
rewrite
(
ff_ff
_
H
)
/=
.
by
erewrite
coerce_proper
by
done
.
by
erewrite
coerce_proper
by
done
.
Qed
.
Qed
.
Lemma
embed_tower
j
n
(
X
:
T
)
:
n
≤
j
→
embed
j
(
X
j
)
=
{
n
}
=
X
.
Lemma
embed_tower
j
n
(
X
:
T
)
:
n
≤
j
→
embed
j
(
X
j
)
≡
{
n
}
≡
X
.
Proof
.
Proof
.
move
=>
Hn
i
;
rewrite
/=
/
embed
'
;
destruct
(
le_lt_dec
i
j
)
as
[
H
|
H
];
simpl
.
move
=>
Hn
i
;
rewrite
/=
/
embed
'
;
destruct
(
le_lt_dec
i
j
)
as
[
H
|
H
];
simpl
.
*
rewrite
-
(
gg_tower
i
(
j
-
i
)
X
).
*
rewrite
-
(
gg_tower
i
(
j
-
i
)
X
).
...
...
algebra/excl.v
View file @
f6909092
...
@@ -23,10 +23,10 @@ Inductive excl_equiv : Equiv (excl A) :=
...
@@ -23,10 +23,10 @@ Inductive excl_equiv : Equiv (excl A) :=
|
ExclBot_equiv
:
ExclBot
≡
ExclBot
.
|
ExclBot_equiv
:
ExclBot
≡
ExclBot
.
Existing
Instance
excl_equiv
.
Existing
Instance
excl_equiv
.
Inductive
excl_dist
`
{
Dist
A
}
:
Dist
(
excl
A
)
:=
Inductive
excl_dist
`
{
Dist
A
}
:
Dist
(
excl
A
)
:=
|
excl_dist_0
(
x
y
:
excl
A
)
:
x
=
{
0
}
=
y
|
excl_dist_0
(
x
y
:
excl
A
)
:
x
≡
{
0
}
≡
y
|
Excl_dist
(
x
y
:
A
)
n
:
x
=
{
n
}
=
y
→
Excl
x
=
{
n
}
=
Excl
y
|
Excl_dist
(
x
y
:
A
)
n
:
x
≡
{
n
}
≡
y
→
Excl
x
≡
{
n
}
≡
Excl
y
|
ExclUnit_dist
n
:
ExclUnit
=
{
n
}
=
ExclUnit
|
ExclUnit_dist
n
:
ExclUnit
≡
{
n
}
≡
ExclUnit
|
ExclBot_dist
n
:
ExclBot
=
{
n
}
=
ExclBot
.
|
ExclBot_dist
n
:
ExclBot
≡
{
n
}
≡
ExclBot
.
Existing
Instance
excl_dist
.
Existing
Instance
excl_dist
.
Global
Instance
Excl_ne
:
Proper
(
dist
n
==>
dist
n
)
(
@
Excl
A
).
Global
Instance
Excl_ne
:
Proper
(
dist
n
==>
dist
n
)
(
@
Excl
A
).
Proof
.
by
constructor
.
Qed
.
Proof
.
by
constructor
.
Qed
.
...
@@ -138,7 +138,7 @@ Lemma excl_validN_inv_l n x y : ✓{S n} (Excl x ⋅ y) → y = ∅.
...
@@ -138,7 +138,7 @@ Lemma excl_validN_inv_l n x y : ✓{S n} (Excl x ⋅ y) → y = ∅.
Proof
.
by
destruct
y
.
Qed
.
Proof
.
by
destruct
y
.
Qed
.
Lemma
excl_validN_inv_r
n
x
y
:
✓
{
S
n
}
(
x
⋅
Excl
y
)
→
x
=
∅
.
Lemma
excl_validN_inv_r
n
x
y
:
✓
{
S
n
}
(
x
⋅
Excl
y
)
→
x
=
∅
.
Proof
.
by
destruct
x
.
Qed
.
Proof
.
by
destruct
x
.
Qed
.
Lemma
Excl_includedN
n
x
y
:
✓
{
n
}
y
→
Excl
x
≼
{
n
}
y
↔
y
=
{
n
}
=
Excl
x
.
Lemma
Excl_includedN
n
x
y
:
✓
{
n
}
y
→
Excl
x
≼
{
n
}
y
↔
y
≡
{
n
}
≡
Excl
x
.
Proof
.
Proof
.
intros
Hvalid
;
split
;
[
destruct
n
as
[
|
n
];
[
done
|
]
|
by
intros
->
].
intros
Hvalid
;
split
;
[
destruct
n
as
[
|
n
];
[
done
|
]
|
by
intros
->
].
by
intros
[
z
?
];
cofe_subst
;
rewrite
(
excl_validN_inv_l
n
x
z
).
by
intros
[
z
?
];
cofe_subst
;
rewrite
(
excl_validN_inv_l
n
x
z
).
...
...
algebra/fin_maps.v
View file @
f6909092
...
@@ -6,7 +6,7 @@ Context `{Countable K} {A : cofeT}.
...
@@ -6,7 +6,7 @@ Context `{Countable K} {A : cofeT}.
Implicit
Types
m
:
gmap
K
A
.
Implicit
Types
m
:
gmap
K
A
.
Instance
map_dist
:
Dist
(
gmap
K
A
)
:=
λ
n
m1
m2
,
Instance
map_dist
:
Dist
(
gmap
K
A
)
:=
λ
n
m1
m2
,
∀
i
,
m1
!!
i
=
{
n
}
=
m2
!!
i
.
∀
i
,
m1
!!
i
≡
{
n
}
≡
m2
!!
i
.
Program
Definition
map_chain
(
c
:
chain
(
gmap
K
A
))
Program
Definition
map_chain
(
c
:
chain
(
gmap
K
A
))
(
k
:
K
)
:
chain
(
option
A
)
:=
{|
chain_car
n
:=
c
n
!!
k
|}
.
(
k
:
K
)
:
chain
(
option
A
)
:=
{|
chain_car
n
:=
c
n
!!
k
|}
.
Next
Obligation
.
by
intros
c
k
n
i
?
;
apply
(
chain_cauchy
c
).
Qed
.
Next
Obligation
.
by
intros
c
k
n
i
?
;
apply
(
chain_cauchy
c
).
Qed
.
...
@@ -60,7 +60,7 @@ Qed.
...
@@ -60,7 +60,7 @@ Qed.
Global
Instance
map_lookup_timeless
m
i
:
Timeless
m
→
Timeless
(
m
!!
i
).
Global
Instance
map_lookup_timeless
m
i
:
Timeless
m
→
Timeless
(
m
!!
i
).
Proof
.
Proof
.
intros
?
[
x
|
]
Hx
;
[
|
by
symmetry
;
apply
(
timeless
_
)].
intros
?
[
x
|
]
Hx
;
[
|
by
symmetry
;
apply
(
timeless
_
)].
assert
(
m
=
{
1
}
=
<
[
i
:=
x
]
>
m
)
assert
(
m
≡
{
1
}
≡
<
[
i
:=
x
]
>
m
)
by
(
by
symmetry
in
Hx
;
inversion
Hx
;
cofe_subst
;
rewrite
insert_id
).
by
(
by
symmetry
in
Hx
;
inversion
Hx
;
cofe_subst
;
rewrite
insert_id
).
by
rewrite
(
timeless
m
(
<
[
i
:=
x
]
>
m
))
// lookup_insert.
by
rewrite
(
timeless
m
(
<
[
i
:=
x
]
>
m
))
// lookup_insert.
Qed
.
Qed
.
...
@@ -132,7 +132,7 @@ Qed.
...
@@ -132,7 +132,7 @@ Qed.
Definition
map_cmra_extend_mixin
:
CMRAExtendMixin
(
gmap
K
A
).
Definition
map_cmra_extend_mixin
:
CMRAExtendMixin
(
gmap
K
A
).
Proof
.
Proof
.
intros
n
m
m1
m2
Hm
Hm12
.
intros
n
m
m1
m2
Hm
Hm12
.
assert
(
∀
i
,
m
!!
i
=
{
n
}
=
m1
!!
i
⋅
m2
!!
i
)
as
Hm12
'
assert
(
∀
i
,
m
!!
i
≡
{
n
}
≡
m1
!!
i
⋅
m2
!!
i
)
as
Hm12
'
by
(
by
intros
i
;
rewrite
-
lookup_op
).
by
(
by
intros
i
;
rewrite
-
lookup_op
).
set
(
f
i
:=
cmra_extend_op
n
(
m
!!
i
)
(
m1
!!
i
)
(
m2
!!
i
)
(
Hm
i
)
(
Hm12
'
i
)).
set
(
f
i
:=
cmra_extend_op
n
(
m
!!
i
)
(
m1
!!
i
)
(
m2
!!
i
)
(
Hm
i
)
(
Hm12
'
i
)).
set
(
f_proj
i
:=
proj1_sig
(
f
i
)).
set
(
f_proj
i
:=
proj1_sig
(
f
i
)).
...
@@ -166,7 +166,7 @@ Implicit Types m : gmap K A.
...
@@ -166,7 +166,7 @@ Implicit Types m : gmap K A.
Implicit
Types
i
:
K
.
Implicit
Types
i
:
K
.
Implicit
Types
a
:
A
.
Implicit
Types
a
:
A
.
Lemma
map_lookup_validN
n
m
i
x
:
✓
{
n
}
m
→
m
!!
i
=
{
n
}
=
Some
x
→
✓
{
n
}
x
.
Lemma
map_lookup_validN
n
m
i
x
:
✓
{
n
}
m
→
m
!!
i
≡
{
n
}
≡
Some
x
→
✓
{
n
}
x
.
Proof
.
by
move
=>
/
(
_
i
)
Hm
Hi
;
move
:
Hm
;
rewrite
Hi
.
Qed
.
Proof
.
by
move
=>
/
(
_
i
)
Hm
Hi
;
move
:
Hm
;
rewrite
Hi
.
Qed
.
Lemma
map_insert_validN
n
m
i
x
:
✓
{
n
}
x
→
✓
{
n
}
m
→
✓
{
n
}
(
<
[
i
:=
x
]
>
m
).
Lemma
map_insert_validN
n
m
i
x
:
✓
{
n
}
x
→
✓
{
n
}
m
→
✓
{
n
}
(
<
[
i
:=
x
]
>
m
).
Proof
.
by
intros
??
j
;
destruct
(
decide
(
i
=
j
));
simplify_map_equality
.
Qed
.
Proof
.
by
intros
??
j
;
destruct
(
decide
(
i
=
j
));
simplify_map_equality
.
Qed
.
...
@@ -201,7 +201,7 @@ Lemma map_op_singleton (i : K) (x y : A) :
...
@@ -201,7 +201,7 @@ Lemma map_op_singleton (i : K) (x y : A) :
Proof
.
by
apply
(
merge_singleton
_
_
_
x
y
).
Qed
.
Proof
.
by
apply
(
merge_singleton
_
_
_
x
y
).
Qed
.
Lemma
singleton_includedN
n
m
i
x
:
Lemma
singleton_includedN
n
m
i
x
:
{
[
i
↦
x
]
}
≼
{
n
}
m
↔
∃
y
,
m
!!
i
=
{
n
}
=
Some
y
∧
x
≼
y
.
{
[
i
↦
x
]
}
≼
{
n
}
m
↔
∃
y
,
m
!!
i
≡
{
n
}
≡
Some
y
∧
x
≼
y
.
(
*
not
m
!!
i
=
Some
y
∧
x
≼
{
n
}
y
to
deal
with
n
=
0
*
)
(
*
not
m
!!
i
=
Some
y
∧
x
≼
{
n
}
y
to
deal
with
n
=
0
*
)
Proof
.
Proof
.
split
.
split
.
...
...
algebra/iprod.v
View file @
f6909092
...
@@ -21,7 +21,7 @@ Section iprod_cofe.
...
@@ -21,7 +21,7 @@ Section iprod_cofe.