Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iris
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Paolo G. Giarrusso
iris
Commits
737e3930
Verified
Commit
737e3930
authored
5 years ago
by
Paolo G. Giarrusso
Browse files
Options
Downloads
Patches
Plain Diff
Test changes
parent
c4116388
Branches
test-bigop-synchanges
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/algebra/big_op.v
+26
-26
26 additions, 26 deletions
theories/algebra/big_op.v
with
26 additions
and
26 deletions
theories/algebra/big_op.v
+
26
−
26
View file @
737e3930
...
...
@@ -28,42 +28,42 @@ Fixpoint big_opL `{Monoid M o} {A} (f : nat → A → M) (xs : list A) : M :=
Instance
:
Params
(
@
big_opL
)
4
:=
{}
.
Arguments
big_opL
{
M
}
o
{_
A
}
_
!
_
/.
Typeclasses
Opaque
big_opL
.
Notation
"'[^' o 'list]' k ↦ x ∈ l , P"
:=
(
big_opL
o
(
λ
k
x
,
P
)
l
)
Notation
"'[
' '
^' o 'list]' k ↦ x ∈ l , P"
:=
(
big_opL
o
(
λ
k
x
,
P
)
l
)
(
at
level
200
,
o
at
level
1
,
l
at
level
10
,
k
,
x
at
level
1
,
right
associativity
,
format
"[^ o list] k ↦ x ∈ l , P"
)
:
stdpp_scope
.
Notation
"'[^' o 'list]' x ∈ l , P"
:=
(
big_opL
o
(
λ
_
x
,
P
)
l
)
format
"[
^ o list] k ↦ x ∈ l , P"
)
:
stdpp_scope
.
Notation
"'[
' '
^' o 'list]' x ∈ l , P"
:=
(
big_opL
o
(
λ
_
x
,
P
)
l
)
(
at
level
200
,
o
at
level
1
,
l
at
level
10
,
x
at
level
1
,
right
associativity
,
format
"[^ o list] x ∈ l , P"
)
:
stdpp_scope
.
format
"[
^ o list] x ∈ l , P"
)
:
stdpp_scope
.
Definition
big_opM
`{
Monoid
M
o
}
`{
Countable
K
}
{
A
}
(
f
:
K
→
A
→
M
)
(
m
:
gmap
K
A
)
:
M
:=
big_opL
o
(
λ
_,
curry
f
)
(
map_to_list
m
)
.
Instance
:
Params
(
@
big_opM
)
7
:=
{}
.
Arguments
big_opM
{
M
}
o
{_
K
_
_
A
}
_
_
:
simpl
never
.
Typeclasses
Opaque
big_opM
.
Notation
"'[^' o 'map]' k ↦ x ∈ m , P"
:=
(
big_opM
o
(
λ
k
x
,
P
)
m
)
Notation
"'[
' '
^' o 'map]' k ↦ x ∈ m , P"
:=
(
big_opM
o
(
λ
k
x
,
P
)
m
)
(
at
level
200
,
o
at
level
1
,
m
at
level
10
,
k
,
x
at
level
1
,
right
associativity
,
format
"[^ o map] k ↦ x ∈ m , P"
)
:
stdpp_scope
.
Notation
"'[^' o 'map]' x ∈ m , P"
:=
(
big_opM
o
(
λ
_
x
,
P
)
m
)
format
"[
^ o map] k ↦ x ∈ m , P"
)
:
stdpp_scope
.
Notation
"'[
' '
^' o 'map]' x ∈ m , P"
:=
(
big_opM
o
(
λ
_
x
,
P
)
m
)
(
at
level
200
,
o
at
level
1
,
m
at
level
10
,
x
at
level
1
,
right
associativity
,
format
"[^ o map] x ∈ m , P"
)
:
stdpp_scope
.
format
"[
^ o map] x ∈ m , P"
)
:
stdpp_scope
.
Definition
big_opS
`{
Monoid
M
o
}
`{
Countable
A
}
(
f
:
A
→
M
)
(
X
:
gset
A
)
:
M
:=
big_opL
o
(
λ
_,
f
)
(
elements
X
)
.
Instance
:
Params
(
@
big_opS
)
6
:=
{}
.
Arguments
big_opS
{
M
}
o
{_
A
_
_}
_
_
:
simpl
never
.
Typeclasses
Opaque
big_opS
.
Notation
"'[^' o 'set]' x ∈ X , P"
:=
(
big_opS
o
(
λ
x
,
P
)
X
)
Notation
"'[
' '
^' o 'set]' x ∈ X , P"
:=
(
big_opS
o
(
λ
x
,
P
)
X
)
(
at
level
200
,
o
at
level
1
,
X
at
level
10
,
x
at
level
1
,
right
associativity
,
format
"[^ o set] x ∈ X , P"
)
:
stdpp_scope
.
format
"[
^ o set] x ∈ X , P"
)
:
stdpp_scope
.
Definition
big_opMS
`{
Monoid
M
o
}
`{
Countable
A
}
(
f
:
A
→
M
)
(
X
:
gmultiset
A
)
:
M
:=
big_opL
o
(
λ
_,
f
)
(
elements
X
)
.
Instance
:
Params
(
@
big_opMS
)
7
:=
{}
.
Arguments
big_opMS
{
M
}
o
{_
A
_
_}
_
_
:
simpl
never
.
Typeclasses
Opaque
big_opMS
.
Notation
"'[^' o 'mset]' x ∈ X , P"
:=
(
big_opMS
o
(
λ
x
,
P
)
X
)
Notation
"'[
' '
^' o 'mset]' x ∈ X , P"
:=
(
big_opMS
o
(
λ
x
,
P
)
X
)
(
at
level
200
,
o
at
level
1
,
X
at
level
10
,
x
at
level
1
,
right
associativity
,
format
"[^ o mset] x ∈ X , P"
)
:
stdpp_scope
.
format
"[
^ o mset] x ∈ X , P"
)
:
stdpp_scope
.
(** * Properties about big ops *)
Section
big_op
.
...
...
@@ -80,7 +80,7 @@ Section list.
Lemma
big_opL_nil
f
:
([
^
o
list
]
k
↦
y
∈
[],
f
k
y
)
=
monoid_unit
.
Proof
.
done
.
Qed
.
Lemma
big_opL_cons
f
x
l
:
([
^
o
list
]
k
↦
y
∈
x
::
l
,
f
k
y
)
=
f
0
x
`
o
`
[
^
o
list
]
k
↦
y
∈
l
,
f
(
S
k
)
y
.
([
^
o
list
]
k
↦
y
∈
x
::
l
,
f
k
y
)
=
f
0
x
`
o
`
(
[
^
o
list
]
k
↦
y
∈
l
,
f
(
S
k
)
y
)
.
Proof
.
done
.
Qed
.
Lemma
big_opL_singleton
f
x
:
([
^
o
list
]
k
↦
y
∈
[
x
],
f
k
y
)
≡
f
0
x
.
Proof
.
by
rewrite
/=
right_id
.
Qed
.
...
...
@@ -106,7 +106,7 @@ Section list.
Lemma
big_opL_ext
f
g
l
:
(
∀
k
y
,
l
!!
k
=
Some
y
→
f
k
y
=
g
k
y
)
→
([
^
o
list
]
k
↦
y
∈
l
,
f
k
y
)
=
[
^
o
list
]
k
↦
y
∈
l
,
g
k
y
.
([
^
o
list
]
k
↦
y
∈
l
,
f
k
y
)
=
(
[
^
o
list
]
k
↦
y
∈
l
,
g
k
y
)
.
Proof
.
apply
big_opL_forall
;
apply
_
.
Qed
.
Lemma
big_opL_proper
f
g
l
:
(
∀
k
y
,
l
!!
k
=
Some
y
→
f
k
y
≡
g
k
y
)
→
...
...
@@ -135,10 +135,10 @@ Section list.
Proof
.
intros
f
f'
Hf
l
?
<-.
apply
big_opL_forall
;
apply
_
||
intros
;
apply
Hf
.
Qed
.
Lemma
big_opL_consZ_l
(
f
:
Z
→
A
→
M
)
x
l
:
([
^
o
list
]
k
↦
y
∈
x
::
l
,
f
k
y
)
=
f
0
x
`
o
`
[
^
o
list
]
k
↦
y
∈
l
,
f
(
1
+
k
)
%
Z
y
.
([
^
o
list
]
k
↦
y
∈
x
::
l
,
f
k
y
)
=
f
0
x
`
o
`
(
[
^
o
list
]
k
↦
y
∈
l
,
f
(
1
+
k
)
%
Z
y
)
.
Proof
.
rewrite
big_opL_cons
.
auto
using
big_opL_ext
with
f_equal
lia
.
Qed
.
Lemma
big_opL_consZ_r
(
f
:
Z
→
A
→
M
)
x
l
:
([
^
o
list
]
k
↦
y
∈
x
::
l
,
f
k
y
)
=
f
0
x
`
o
`
[
^
o
list
]
k
↦
y
∈
l
,
f
(
k
+
1
)
%
Z
y
.
([
^
o
list
]
k
↦
y
∈
x
::
l
,
f
k
y
)
=
f
0
x
`
o
`
(
[
^
o
list
]
k
↦
y
∈
l
,
f
(
k
+
1
)
%
Z
y
)
.
Proof
.
rewrite
big_opL_cons
.
auto
using
big_opL_ext
with
f_equal
lia
.
Qed
.
Lemma
big_opL_fmap
{
B
}
(
h
:
A
→
B
)
(
f
:
nat
→
B
→
M
)
l
:
...
...
@@ -198,12 +198,12 @@ Section gmap.
Lemma
big_opM_insert
f
m
i
x
:
m
!!
i
=
None
→
([
^
o
map
]
k
↦
y
∈
<
[
i
:=
x
]
>
m
,
f
k
y
)
≡
f
i
x
`
o
`
[
^
o
map
]
k
↦
y
∈
m
,
f
k
y
.
([
^
o
map
]
k
↦
y
∈
<
[
i
:=
x
]
>
m
,
f
k
y
)
≡
f
i
x
`
o
`
(
[
^
o
map
]
k
↦
y
∈
m
,
f
k
y
)
.
Proof
.
intros
?
.
by
rewrite
/
big_opM
map_to_list_insert
.
Qed
.
Lemma
big_opM_delete
f
m
i
x
:
m
!!
i
=
Some
x
→
([
^
o
map
]
k
↦
y
∈
m
,
f
k
y
)
≡
f
i
x
`
o
`
[
^
o
map
]
k
↦
y
∈
delete
i
m
,
f
k
y
.
([
^
o
map
]
k
↦
y
∈
m
,
f
k
y
)
≡
f
i
x
`
o
`
(
[
^
o
map
]
k
↦
y
∈
delete
i
m
,
f
k
y
)
.
Proof
.
intros
.
rewrite
-
big_opM_insert
?lookup_delete
//.
by
rewrite
insert_delete
insert_id
.
...
...
@@ -236,7 +236,7 @@ Section gmap.
Lemma
big_opM_fn_insert
{
B
}
(
g
:
K
→
A
→
B
→
M
)
(
f
:
K
→
B
)
m
i
(
x
:
A
)
b
:
m
!!
i
=
None
→
([
^
o
map
]
k
↦
y
∈
<
[
i
:=
x
]
>
m
,
g
k
y
(
<
[
i
:=
b
]
>
f
k
))
≡
g
i
x
b
`
o
`
[
^
o
map
]
k
↦
y
∈
m
,
g
k
y
(
f
k
)
.
≡
g
i
x
b
`
o
`
(
[
^
o
map
]
k
↦
y
∈
m
,
g
k
y
(
f
k
)
)
.
Proof
.
intros
.
rewrite
big_opM_insert
//
fn_lookup_insert
.
f_equiv
;
apply
big_opM_proper
;
auto
=>
k
y
?
.
...
...
@@ -244,7 +244,7 @@ Section gmap.
Qed
.
Lemma
big_opM_fn_insert'
(
f
:
K
→
M
)
m
i
x
P
:
m
!!
i
=
None
→
([
^
o
map
]
k
↦
y
∈
<
[
i
:=
x
]
>
m
,
<
[
i
:=
P
]
>
f
k
)
≡
(
P
`
o
`
[
^
o
map
]
k
↦
y
∈
m
,
f
k
)
.
([
^
o
map
]
k
↦
y
∈
<
[
i
:=
x
]
>
m
,
<
[
i
:=
P
]
>
f
k
)
≡
(
P
`
o
`
(
[
^
o
map
]
k
↦
y
∈
m
,
f
k
)
)
.
Proof
.
apply
(
big_opM_fn_insert
(
λ
_
_,
id
))
.
Qed
.
Lemma
big_opM_union
f
m1
m2
:
...
...
@@ -301,19 +301,19 @@ Section gset.
Proof
.
by
rewrite
/
big_opS
elements_empty
.
Qed
.
Lemma
big_opS_insert
f
X
x
:
x
∉
X
→
([
^
o
set
]
y
∈
{[
x
]}
∪
X
,
f
y
)
≡
(
f
x
`
o
`
[
^
o
set
]
y
∈
X
,
f
y
)
.
x
∉
X
→
([
^
o
set
]
y
∈
{[
x
]}
∪
X
,
f
y
)
≡
(
f
x
`
o
`
(
[
^
o
set
]
y
∈
X
,
f
y
)
)
.
Proof
.
intros
.
by
rewrite
/
big_opS
elements_union_singleton
.
Qed
.
Lemma
big_opS_fn_insert
{
B
}
(
f
:
A
→
B
→
M
)
h
X
x
b
:
x
∉
X
→
([
^
o
set
]
y
∈
{[
x
]}
∪
X
,
f
y
(
<
[
x
:=
b
]
>
h
y
))
≡
f
x
b
`
o
`
[
^
o
set
]
y
∈
X
,
f
y
(
h
y
)
.
≡
f
x
b
`
o
`
(
[
^
o
set
]
y
∈
X
,
f
y
(
h
y
)
)
.
Proof
.
intros
.
rewrite
big_opS_insert
//
fn_lookup_insert
.
f_equiv
;
apply
big_opS_proper
;
auto
=>
y
?
.
by
rewrite
fn_lookup_insert_ne
;
last
set_solver
.
Qed
.
Lemma
big_opS_fn_insert'
f
X
x
P
:
x
∉
X
→
([
^
o
set
]
y
∈
{[
x
]}
∪
X
,
<
[
x
:=
P
]
>
f
y
)
≡
(
P
`
o
`
[
^
o
set
]
y
∈
X
,
f
y
)
.
x
∉
X
→
([
^
o
set
]
y
∈
{[
x
]}
∪
X
,
<
[
x
:=
P
]
>
f
y
)
≡
(
P
`
o
`
(
[
^
o
set
]
y
∈
X
,
f
y
)
)
.
Proof
.
apply
(
big_opS_fn_insert
(
λ
y
,
id
))
.
Qed
.
Lemma
big_opS_union
f
X
Y
:
...
...
@@ -327,7 +327,7 @@ Section gset.
Qed
.
Lemma
big_opS_delete
f
X
x
:
x
∈
X
→
([
^
o
set
]
y
∈
X
,
f
y
)
≡
f
x
`
o
`
[
^
o
set
]
y
∈
X
∖
{[
x
]},
f
y
.
x
∈
X
→
([
^
o
set
]
y
∈
X
,
f
y
)
≡
f
x
`
o
`
(
[
^
o
set
]
y
∈
X
∖
{[
x
]},
f
y
)
.
Proof
.
intros
.
rewrite
-
big_opS_insert
;
last
set_solver
.
by
rewrite
-
union_difference_L
;
last
set_solver
.
...
...
@@ -388,7 +388,7 @@ Section gmultiset.
Proof
.
by
rewrite
/
big_opMS
gmultiset_elements_empty
.
Qed
.
Lemma
big_opMS_disj_union
f
X
Y
:
([
^
o
mset
]
y
∈
X
⊎
Y
,
f
y
)
≡
([
^
o
mset
]
y
∈
X
,
f
y
)
`
o
`
[
^
o
mset
]
y
∈
Y
,
f
y
.
([
^
o
mset
]
y
∈
X
⊎
Y
,
f
y
)
≡
([
^
o
mset
]
y
∈
X
,
f
y
)
`
o
`
(
[
^
o
mset
]
y
∈
Y
,
f
y
)
.
Proof
.
by
rewrite
/
big_opMS
gmultiset_elements_disj_union
big_opL_app
.
Qed
.
Lemma
big_opMS_singleton
f
x
:
([
^
o
mset
]
y
∈
{[
x
]},
f
y
)
≡
f
x
.
...
...
@@ -397,7 +397,7 @@ Section gmultiset.
Qed
.
Lemma
big_opMS_delete
f
X
x
:
x
∈
X
→
([
^
o
mset
]
y
∈
X
,
f
y
)
≡
f
x
`
o
`
[
^
o
mset
]
y
∈
X
∖
{[
x
]},
f
y
.
x
∈
X
→
([
^
o
mset
]
y
∈
X
,
f
y
)
≡
f
x
`
o
`
(
[
^
o
mset
]
y
∈
X
∖
{[
x
]},
f
y
)
.
Proof
.
intros
.
rewrite
-
big_opMS_singleton
-
big_opMS_disj_union
.
by
rewrite
-
gmultiset_disj_union_difference'
.
...
...
This diff is collapsed.
Click to expand it.
Paolo G. Giarrusso
@Blaisorblade
mentioned in issue
iris/iris#273
·
5 years ago
mentioned in issue
iris/iris#273
mentioned in issue iris/iris#273
Toggle commit list
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