Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jonas Kastberg
iris
Commits
664a8754
Commit
664a8754
authored
Jan 06, 2017
by
Robbert Krebbers
Browse files
Merge branch 'list_renaming_stuff'
parents
05b53000
ddf8ef49
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
theories/algebra/cmra_big_op.v
View file @
664a8754
...
...
@@ -101,9 +101,9 @@ Proof.
-
by
trans
(
big_op
xs2
).
Qed
.
Lemma
big_op_
contains
xs
ys
:
xs
`
contains
`
ys
→
[
⋅
]
xs
≼
[
⋅
]
ys
.
Lemma
big_op_
submseteq
xs
ys
:
xs
⊆
+
ys
→
[
⋅
]
xs
≼
[
⋅
]
ys
.
Proof
.
intros
[
xs'
->]%
contains
_Permutation
.
intros
[
xs'
->]%
submseteq
_Permutation
.
rewrite
big_op_app
;
apply
cmra_included_l
.
Qed
.
...
...
@@ -158,9 +158,9 @@ Section list.
Lemma
big_opL_permutation
(
f
:
A
→
M
)
l1
l2
:
l1
≡
ₚ
l2
→
([
⋅
list
]
x
∈
l1
,
f
x
)
≡
([
⋅
list
]
x
∈
l2
,
f
x
).
Proof
.
intros
Hl
.
by
rewrite
/
big_opL
!
imap_const
Hl
.
Qed
.
Lemma
big_opL_
contains
(
f
:
A
→
M
)
l1
l2
:
l1
`
contains
`
l2
→
([
⋅
list
]
x
∈
l1
,
f
x
)
≼
([
⋅
list
]
x
∈
l2
,
f
x
).
Proof
.
intros
Hl
.
apply
big_op_
contains
.
rewrite
!
imap_const
.
by
rewrite
->
Hl
.
Qed
.
Lemma
big_opL_
submseteq
(
f
:
A
→
M
)
l1
l2
:
l1
⊆
+
l2
→
([
⋅
list
]
x
∈
l1
,
f
x
)
≼
([
⋅
list
]
x
∈
l2
,
f
x
).
Proof
.
intros
Hl
.
apply
big_op_
submseteq
.
rewrite
!
imap_const
.
by
rewrite
->
Hl
.
Qed
.
Global
Instance
big_opL_ne
l
n
:
Proper
(
pointwise_relation
_
(
pointwise_relation
_
(
dist
n
))
==>
(
dist
n
))
...
...
@@ -230,7 +230,7 @@ Section gmap.
([
⋅
map
]
k
↦
x
∈
m1
,
f
k
x
)
≼
[
⋅
map
]
k
↦
x
∈
m2
,
g
k
x
.
Proof
.
intros
Hm
Hf
.
trans
([
⋅
map
]
k
↦
x
∈
m2
,
f
k
x
).
-
by
apply
big_op_
contains
,
fmap_contains
,
map_to_list_
contains
.
-
by
apply
big_op_
submseteq
,
fmap_submseteq
,
map_to_list_
submseteq
.
-
apply
big_opM_forall
;
apply
_
||
auto
.
Qed
.
Lemma
big_opM_ext
f
g
m
:
...
...
@@ -345,7 +345,7 @@ Section gset.
([
⋅
set
]
x
∈
X
,
f
x
)
≼
[
⋅
set
]
x
∈
Y
,
g
x
.
Proof
.
intros
HX
Hf
.
trans
([
⋅
set
]
x
∈
Y
,
f
x
).
-
by
apply
big_op_
contains
,
fmap_contains
,
elements_
contains
.
-
by
apply
big_op_
submseteq
,
fmap_submseteq
,
elements_
submseteq
.
-
apply
big_opS_forall
;
apply
_
||
auto
.
Qed
.
Lemma
big_opS_ext
f
g
X
:
...
...
@@ -446,7 +446,7 @@ Section gmultiset.
([
⋅
mset
]
x
∈
X
,
f
x
)
≼
[
⋅
mset
]
x
∈
Y
,
g
x
.
Proof
.
intros
HX
Hf
.
trans
([
⋅
mset
]
x
∈
Y
,
f
x
).
-
by
apply
big_op_
contains
,
fmap_contains
,
gmultiset_elements_
contains
.
-
by
apply
big_op_
submseteq
,
fmap_submseteq
,
gmultiset_elements_
submseteq
.
-
apply
big_opMS_forall
;
apply
_
||
auto
.
Qed
.
Lemma
big_opMS_ext
f
g
X
:
...
...
theories/algebra/cmra_tactics.v
View file @
664a8754
...
...
@@ -29,9 +29,9 @@ Module ra_reflection. Section ra_reflection.
by
rewrite
fmap_app
IH1
IH2
big_op_app
.
Qed
.
Lemma
flatten_correct
Σ
e1
e2
:
flatten
e1
`
contains
`
flatten
e2
→
eval
Σ
e1
≼
eval
Σ
e2
.
flatten
e1
⊆
+
flatten
e2
→
eval
Σ
e1
≼
eval
Σ
e2
.
Proof
.
by
intros
He
;
rewrite
!
eval_flatten
;
apply
big_op_
contains
;
rewrite
->
He
.
by
intros
He
;
rewrite
!
eval_flatten
;
apply
big_op_
submseteq
;
rewrite
->
He
.
Qed
.
Class
Quote
(
Σ
1
Σ
2
:
list
A
)
(
l
:
A
)
(
e
:
expr
)
:
=
{}.
...
...
theories/base_logic/big_op.v
View file @
664a8754
...
...
@@ -133,8 +133,8 @@ Proof. by induction 1 as [|P Q Ps Qs HPQ ? IH]; rewrite /= ?HPQ ?IH. Qed.
Lemma
big_sep_app
Ps
Qs
:
[
∗
]
(
Ps
++
Qs
)
⊣
⊢
[
∗
]
Ps
∗
[
∗
]
Qs
.
Proof
.
by
rewrite
big_op_app
.
Qed
.
Lemma
big_sep_
contains
Ps
Qs
:
Qs
`
contains
`
Ps
→
[
∗
]
Ps
⊢
[
∗
]
Qs
.
Proof
.
intros
.
apply
uPred_included
.
by
apply
:
big_op_
contains
.
Qed
.
Lemma
big_sep_
submseteq
Ps
Qs
:
Qs
⊆
+
Ps
→
[
∗
]
Ps
⊢
[
∗
]
Qs
.
Proof
.
intros
.
apply
uPred_included
.
by
apply
:
big_op_
submseteq
.
Qed
.
Lemma
big_sep_elem_of
Ps
P
:
P
∈
Ps
→
[
∗
]
Ps
⊢
P
.
Proof
.
intros
.
apply
uPred_included
.
by
apply
:
big_sep_elem_of
.
Qed
.
Lemma
big_sep_elem_of_acc
Ps
P
:
P
∈
Ps
→
[
∗
]
Ps
⊢
P
∗
(
P
-
∗
[
∗
]
Ps
).
...
...
@@ -220,9 +220,9 @@ Section list.
(
∀
k
y
,
l
!!
k
=
Some
y
→
Φ
k
y
⊣
⊢
Ψ
k
y
)
→
([
∗
list
]
k
↦
y
∈
l
,
Φ
k
y
)
⊣
⊢
([
∗
list
]
k
↦
y
∈
l
,
Ψ
k
y
).
Proof
.
apply
big_opL_proper
.
Qed
.
Lemma
big_sepL_
contains
(
Φ
:
A
→
uPred
M
)
l1
l2
:
l1
`
contains
`
l2
→
([
∗
list
]
y
∈
l2
,
Φ
y
)
⊢
[
∗
list
]
y
∈
l1
,
Φ
y
.
Proof
.
intros
?.
apply
uPred_included
.
by
apply
:
big_opL_
contains
.
Qed
.
Lemma
big_sepL_
submseteq
(
Φ
:
A
→
uPred
M
)
l1
l2
:
l1
⊆
+
l2
→
([
∗
list
]
y
∈
l2
,
Φ
y
)
⊢
[
∗
list
]
y
∈
l1
,
Φ
y
.
Proof
.
intros
?.
apply
uPred_included
.
by
apply
:
big_opL_
submseteq
.
Qed
.
Global
Instance
big_sepL_mono'
l
:
Proper
(
pointwise_relation
_
(
pointwise_relation
_
(
⊢
))
==>
(
⊢
))
...
...
@@ -353,8 +353,8 @@ Section gmap.
([
∗
map
]
k
↦
x
∈
m1
,
Φ
k
x
)
⊢
[
∗
map
]
k
↦
x
∈
m2
,
Ψ
k
x
.
Proof
.
intros
Hm
H
Φ
.
trans
([
∗
map
]
k
↦
x
∈
m2
,
Φ
k
x
)%
I
.
-
apply
uPred_included
.
apply
:
big_op_
contains
.
by
apply
fmap_
contains
,
map_to_list_
contains
.
-
apply
uPred_included
.
apply
:
big_op_
submseteq
.
by
apply
fmap_
submseteq
,
map_to_list_
submseteq
.
-
apply
big_opM_forall
;
apply
_
||
auto
.
Qed
.
Lemma
big_sepM_proper
Φ
Ψ
m
:
...
...
@@ -517,8 +517,8 @@ Section gset.
([
∗
set
]
x
∈
X
,
Φ
x
)
⊢
[
∗
set
]
x
∈
Y
,
Ψ
x
.
Proof
.
intros
HX
H
Φ
.
trans
([
∗
set
]
x
∈
Y
,
Φ
x
)%
I
.
-
apply
uPred_included
.
apply
:
big_op_
contains
.
by
apply
fmap_
contains
,
elements_
contains
.
-
apply
uPred_included
.
apply
:
big_op_
submseteq
.
by
apply
fmap_
submseteq
,
elements_
submseteq
.
-
apply
big_opS_forall
;
apply
_
||
auto
.
Qed
.
Lemma
big_sepS_proper
Φ
Ψ
X
:
...
...
@@ -666,8 +666,8 @@ Section gmultiset.
([
∗
mset
]
x
∈
X
,
Φ
x
)
⊢
[
∗
mset
]
x
∈
Y
,
Ψ
x
.
Proof
.
intros
HX
H
Φ
.
trans
([
∗
mset
]
x
∈
Y
,
Φ
x
)%
I
.
-
apply
uPred_included
.
apply
:
big_op_
contains
.
by
apply
fmap_
contains
,
gmultiset_elements_
contains
.
-
apply
uPred_included
.
apply
:
big_op_
submseteq
.
by
apply
fmap_
submseteq
,
gmultiset_elements_
submseteq
.
-
apply
big_opMS_forall
;
apply
_
||
auto
.
Qed
.
Lemma
big_sepMS_proper
Φ
Ψ
X
:
...
...
theories/base_logic/tactics.v
View file @
664a8754
...
...
@@ -30,9 +30,9 @@ Module uPred_reflection. Section uPred_reflection.
rewrite
/=
?right_id
?fmap_app
?big_sep_app
?IH1
?IH2
//.
Qed
.
Lemma
flatten_entails
Σ
e1
e2
:
flatten
e2
`
contains
`
flatten
e1
→
eval
Σ
e1
⊢
eval
Σ
e2
.
flatten
e2
⊆
+
flatten
e1
→
eval
Σ
e1
⊢
eval
Σ
e2
.
Proof
.
intros
.
rewrite
!
eval_flatten
.
by
apply
big_sep_
contains
,
fmap_contains
.
intros
.
rewrite
!
eval_flatten
.
by
apply
big_sep_
submseteq
,
fmap_submseteq
.
Qed
.
Lemma
flatten_equiv
Σ
e1
e2
:
flatten
e2
≡
ₚ
flatten
e1
→
eval
Σ
e1
⊣
⊢
eval
Σ
e2
.
...
...
theories/prelude/fin_collections.v
View file @
664a8754
...
...
@@ -69,9 +69,9 @@ Proof.
apply
Permutation_singleton
.
by
rewrite
<-(
right_id
∅
(
∪
)
{[
x
]}),
elements_union_singleton
,
elements_empty
by
set_solver
.
Qed
.
Lemma
elements_
contains
X
Y
:
X
⊆
Y
→
elements
X
`
contains
`
elements
Y
.
Lemma
elements_
submseteq
X
Y
:
X
⊆
Y
→
elements
X
⊆
+
elements
Y
.
Proof
.
intros
;
apply
NoDup_
contains
;
auto
using
NoDup_elements
.
intros
;
apply
NoDup_
submseteq
;
auto
using
NoDup_elements
.
intros
x
.
rewrite
!
elem_of_elements
;
auto
.
Qed
.
...
...
theories/prelude/fin_maps.v
View file @
664a8754
...
...
@@ -699,10 +699,10 @@ Proof.
by
rewrite
map_to_list_insert
,
map_to_list_empty
by
auto
using
lookup_empty
.
Qed
.
Lemma
map_to_list_
contains
{
A
}
(
m1
m2
:
M
A
)
:
m1
⊆
m2
→
map_to_list
m1
`
contains
`
map_to_list
m2
.
Lemma
map_to_list_
submseteq
{
A
}
(
m1
m2
:
M
A
)
:
m1
⊆
m2
→
map_to_list
m1
⊆
+
map_to_list
m2
.
Proof
.
intros
;
apply
NoDup_
contains
;
auto
using
NoDup_map_to_list
.
intros
;
apply
NoDup_
submseteq
;
auto
using
NoDup_map_to_list
.
intros
[
i
x
].
rewrite
!
elem_of_map_to_list
;
eauto
using
lookup_weaken
.
Qed
.
Lemma
map_to_list_fmap
{
A
B
}
(
f
:
A
→
B
)
m
:
...
...
theories/prelude/finite.v
View file @
664a8754
...
...
@@ -107,17 +107,17 @@ Proof.
unfold
card
;
intros
.
destruct
finA
as
[[|
x
?]
??]
;
simpl
in
*
;
[
exfalso
;
lia
|].
constructor
;
exact
x
.
Qed
.
Lemma
finite_inj_
contains
`
{
finA
:
Finite
A
}
`
{
finB
:
Finite
B
}
(
f
:
A
→
B
)
`
{!
Inj
(=)
(=)
f
}
:
f
<$>
enum
A
`
contains
`
enum
B
.
Lemma
finite_inj_
submseteq
`
{
finA
:
Finite
A
}
`
{
finB
:
Finite
B
}
(
f
:
A
→
B
)
`
{!
Inj
(=)
(=)
f
}
:
f
<$>
enum
A
⊆
+
enum
B
.
Proof
.
intros
.
destruct
finA
,
finB
.
apply
NoDup_
contains
;
auto
using
NoDup_fmap_2
.
intros
.
destruct
finA
,
finB
.
apply
NoDup_
submseteq
;
auto
using
NoDup_fmap_2
.
Qed
.
Lemma
finite_inj_Permutation
`
{
Finite
A
}
`
{
Finite
B
}
(
f
:
A
→
B
)
`
{!
Inj
(=)
(=)
f
}
:
card
A
=
card
B
→
f
<$>
enum
A
≡
ₚ
enum
B
.
Proof
.
intros
.
apply
contains
_Permutation_length_eq
.
intros
.
apply
submseteq
_Permutation_length_eq
.
-
by
rewrite
fmap_length
.
-
by
apply
finite_inj_
contains
.
-
by
apply
finite_inj_
submseteq
.
Qed
.
Lemma
finite_inj_surj
`
{
Finite
A
}
`
{
Finite
B
}
(
f
:
A
→
B
)
`
{!
Inj
(=)
(=)
f
}
:
card
A
=
card
B
→
Surj
(=)
f
.
...
...
@@ -144,7 +144,7 @@ Proof.
destruct
(
finite_surj
A
B
)
as
(
g
&?)
;
auto
with
lia
.
destruct
(
surj_cancel
g
)
as
(
f
&?).
exists
f
.
apply
cancel_inj
.
-
intros
[
f
?].
unfold
card
.
rewrite
<-(
fmap_length
f
).
by
apply
contains
_length
,
(
finite_inj_
contains
f
).
by
apply
submseteq
_length
,
(
finite_inj_
submseteq
f
).
Qed
.
Lemma
finite_bijective
A
`
{
Finite
A
}
B
`
{
Finite
B
}
:
card
A
=
card
B
↔
∃
f
:
A
→
B
,
Inj
(=)
(=)
f
∧
Surj
(=)
f
.
...
...
theories/prelude/gmultiset.v
View file @
664a8754
...
...
@@ -345,14 +345,14 @@ Proof.
Qed
.
(* Mononicity *)
Lemma
gmultiset_elements_
contains
X
Y
:
X
⊆
Y
→
elements
X
`
contains
`
elements
Y
.
Lemma
gmultiset_elements_
submseteq
X
Y
:
X
⊆
Y
→
elements
X
⊆
+
elements
Y
.
Proof
.
intros
->%
gmultiset_union_difference
.
rewrite
gmultiset_elements_union
.
by
apply
contains
_inserts_r
.
by
apply
submseteq
_inserts_r
.
Qed
.
Lemma
gmultiset_subseteq_size
X
Y
:
X
⊆
Y
→
size
X
≤
size
Y
.
Proof
.
intros
.
by
apply
contains
_length
,
gmultiset_elements_
contains
.
Qed
.
Proof
.
intros
.
by
apply
submseteq
_length
,
gmultiset_elements_
submseteq
.
Qed
.
Lemma
gmultiset_subset_size
X
Y
:
X
⊂
Y
→
size
X
<
size
Y
.
Proof
.
...
...
theories/prelude/list.v
View file @
664a8754
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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