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
Iris
Iris
Commits
e2f65bbd
Commit
e2f65bbd
authored
Jan 23, 2020
by
Robbert Krebbers
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'list_singletonM_{lt,gt}' into 'master'
Add several lemmas about list singletons See merge request
!364
parents
75bbf7a2
11138688
Pipeline
#23162
passed with stage
in 17 minutes and 58 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
theories/algebra/list.v
theories/algebra/list.v
+20
-0
No files found.
theories/algebra/list.v
View file @
e2f65bbd
...
...
@@ -368,6 +368,12 @@ Section properties.
Qed
.
Lemma
list_lookup_singletonM
i
x
:
({[
i
:
=
x
]}
:
list
A
)
!!
i
=
Some
x
.
Proof
.
induction
i
;
by
f_equal
/=.
Qed
.
Lemma
list_lookup_singletonM_lt
i
i'
x
:
(
i'
<
i
)%
nat
→
({[
i
:
=
x
]}
:
list
A
)
!!
i'
=
Some
ε
.
Proof
.
move
:
i'
.
induction
i
;
intros
[|
i'
]
;
naive_solver
auto
with
lia
.
Qed
.
Lemma
list_lookup_singletonM_gt
i
i'
x
:
(
i
<
i'
)%
nat
→
({[
i
:
=
x
]}
:
list
A
)
!!
i'
=
None
.
Proof
.
move
:
i'
.
induction
i
;
intros
[|
i'
]
;
naive_solver
auto
with
lia
.
Qed
.
Lemma
list_lookup_singletonM_ne
i
j
x
:
i
≠
j
→
({[
i
:
=
x
]}
:
list
A
)
!!
j
=
None
∨
({[
i
:
=
x
]}
:
list
A
)
!!
j
=
Some
ε
.
...
...
@@ -412,6 +418,20 @@ Section properties.
Lemma
list_singleton_snoc
l
x
:
{[
length
l
:
=
x
]}
⋅
l
≡
l
++
[
x
].
Proof
.
elim
:
l
=>
//=
??
<-.
by
rewrite
left_id
.
Qed
.
Lemma
list_singletonM_included
i
x
l
:
{[
i
:
=
x
]}
≼
l
↔
(
∃
x'
,
l
!!
i
=
Some
x'
∧
x
≼
x'
).
Proof
.
rewrite
list_lookup_included
.
split
.
{
move
/(
_
i
).
rewrite
list_lookup_singletonM
option_included_total
.
naive_solver
.
}
intros
(
y
&
Hi
&?)
j
.
destruct
(
Nat
.
lt_total
j
i
)
as
[?|[->|?]].
-
rewrite
list_lookup_singletonM_lt
//.
destruct
(
lookup_lt_is_Some_2
l
j
)
as
[
z
Hz
].
{
trans
i
;
eauto
using
lookup_lt_Some
.
}
rewrite
Hz
.
by
apply
Some_included_2
,
ucmra_unit_least
.
-
rewrite
list_lookup_singletonM
Hi
.
by
apply
Some_included_2
.
-
rewrite
list_lookup_singletonM_gt
//.
apply
:
ucmra_unit_least
.
Qed
.
(* Update *)
Lemma
list_singleton_updateP
(
P
:
A
→
Prop
)
(
Q
:
list
A
→
Prop
)
x
:
...
...
Write
Preview
Markdown
is supported
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