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
Pierre Roux
Iris
Commits
ee535aa2
Commit
ee535aa2
authored
4 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Generalize lemma `big_sepL2_app_inv` and use that to prove `big_sepL2_snoc`.
parent
790f7f33
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
iris/bi/big_op.v
+22
-18
22 additions, 18 deletions
iris/bi/big_op.v
with
22 additions
and
18 deletions
iris/bi/big_op.v
+
22
−
18
View file @
ee535aa2
...
...
@@ -416,32 +416,36 @@ Section sep_list2.
by
rewrite
IH
-
assoc
.
Qed
.
Lemma
big_sepL2_app_inv
Φ
l1
l2
l1'
l2'
:
length
l1
=
length
l1'
→
length
l1
=
length
l1'
∨
length
l2
=
length
l2'
→
([
∗
list
]
k
↦
y1
;
y2
∈
l1
++
l2
;
l1'
++
l2'
,
Φ
k
y1
y2
)
-∗
([
∗
list
]
k
↦
y1
;
y2
∈
l1
;
l1'
,
Φ
k
y1
y2
)
∗
([
∗
list
]
k
↦
y1
;
y2
∈
l2
;
l2'
,
Φ
(
length
l1
+
k
)
%
nat
y1
y2
)
.
Proof
.
revert
Φ
l1'
.
induction
l1
as
[|
x1
l1
IH
]=>
Φ
-
[|
x1'
l1'
]
/
/=
?;
simplify_eq
.
revert
Φ
l1'
.
induction
l1
as
[|
x1
l1
IH
]=>
Φ
-
[|
x1'
l1'
]
/=
Hlen
.
-
by
rewrite
left_id
.
-
by
rewrite
-
assoc
IH
.
-
destruct
Hlen
as
[[
=
]|
Hlen
]
.
rewrite
big_sepL2_length
Hlen
/=
app_length
.
apply
pure_elim'
;
lia
.
-
destruct
Hlen
as
[[
=
]|
Hlen
]
.
rewrite
big_sepL2_length
-
Hlen
/=
app_length
.
apply
pure_elim'
;
lia
.
-
by
rewrite
-
assoc
IH
;
last
lia
.
Qed
.
Lemma
big_sepL2_app_same_length
Φ
l1
l2
l1'
l2'
:
length
l1
=
length
l1'
∨
length
l2
=
length
l2'
→
([
∗
list
]
k
↦
y1
;
y2
∈
l1
++
l2
;
l1'
++
l2'
,
Φ
k
y1
y2
)
⊣⊢
([
∗
list
]
k
↦
y1
;
y2
∈
l1
;
l1'
,
Φ
k
y1
y2
)
∗
([
∗
list
]
k
↦
y1
;
y2
∈
l2
;
l2'
,
Φ
(
length
l1
+
k
)
%
nat
y1
y2
)
.
Proof
.
intros
.
apply
(
anti_symm
_)
.
-
by
apply
big_sepL2_app_inv
.
-
apply
wand_elim_l'
.
apply
big_sepL2_app
.
Qed
.
Lemma
big_sepL2_snoc
Φ
x1
x2
l1
l2
:
([
∗
list
]
k
↦
y1
;
y2
∈
(
l1
++
[
x1
]);(
l2
++
[
x2
]),
Φ
k
y1
y2
)
⊣⊢
([
∗
list
]
k
↦
y1
;
y2
∈
l1
;
l2
,
Φ
k
y1
y2
)
∗
Φ
(
length
l1
)
x1
x2
.
Proof
.
apply
(
anti_symm
(
⊢
));
last
first
.
-
apply
wand_elim_l'
.
rewrite
big_sepL2_app
.
apply
wand_mono
;
last
done
.
rewrite
big_sepL2_singleton
Nat
.
add_0_r
.
done
.
-
rewrite
big_sepL2_app_inv_l
.
apply
exist_elim
=>
l2l
.
apply
exist_elim
=>
l2r
.
apply
pure_elim_l
=>
Hl2
.
apply
(
pure_elim
(
length
[
x1
]
=
length
l2r
))
.
{
rewrite
!
big_sepL2_length
sep_elim_r
.
done
.
}
simpl
.
destruct
l2r
as
[?
l2r
|];
first
done
.
destruct
l2r
as
[|];
last
done
.
intros
_
.
apply
app_inj_tail
in
Hl2
as
[
->
->
]
.
apply
sep_mono_r
.
rewrite
big_sepL2_singleton
Nat
.
add_0_r
.
done
.
([
∗
list
]
k
↦
y1
;
y2
∈
l1
++
[
x1
];
l2
++
[
x2
],
Φ
k
y1
y2
)
⊣⊢
([
∗
list
]
k
↦
y1
;
y2
∈
l1
;
l2
,
Φ
k
y1
y2
)
∗
Φ
(
length
l1
)
x1
x2
.
Proof
.
rewrite
big_sepL2_app_same_length
;
last
by
auto
.
by
rewrite
big_sepL2_singleton
Nat
.
add_0_r
.
Qed
.
(** The lemmas [big_sepL2_mono], [big_sepL2_ne] and [big_sepL2_proper] are more
...
...
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