Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
Iris
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Simon Friis Vindum
Iris
Commits
11f9d567
Commit
11f9d567
authored
Jun 11, 2020
by
Ralf Jung
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'robbert/loeb_weak' into 'master'
Factor out lemma `löb_weak`. See merge request
iris/iris!459
parents
ada31c02
b57797ee
Changes
6
Hide whitespace changes
Inline
Sidebyside
Showing
6 changed files
with
66 additions
and
33 deletions
+66
33
theories/base_logic/bi.v
theories/base_logic/bi.v
+1
1
theories/bi/derived_connectives.v
theories/bi/derived_connectives.v
+13
7
theories/bi/derived_laws_later.v
theories/bi/derived_laws_later.v
+47
18
theories/bi/interface.v
theories/bi/interface.v
+2
2
theories/bi/monpred.v
theories/bi/monpred.v
+2
4
theories/si_logic/bi.v
theories/si_logic/bi.v
+1
1
No files found.
theories/base_logic/bi.v
View file @
11f9d567
...
...
@@ 89,7 +89,7 @@ Canonical Structure uPredI (M : ucmraT) : bi :=
bi_bi_mixin
:
=
uPred_bi_mixin
M
;
bi_bi_later_mixin
:
=
uPred_bi_later_mixin
M
}.
Instance
uPred_later_contractive
{
M
}
:
Contractive
(
bi_later
(
PROP
:
=
uPredI
M
)
).
Instance
uPred_later_contractive
{
M
}
:
BiLaterContractive
(
uPredI
M
).
Proof
.
apply
later_contractive
.
Qed
.
Lemma
uPred_internal_eq_mixin
M
:
BiInternalEqMixin
(
uPredI
M
)
(@
uPred_internal_eq
M
).
...
...
theories/bi/derived_connectives.v
View file @
11f9d567
...
...
@@ 117,12 +117,18 @@ Arguments bi_wandM {_} !_%I _%I /.
Notation
"mP ∗? Q"
:
=
(
bi_wandM
mP
Q
)
(
at
level
99
,
Q
at
level
200
,
right
associativity
)
:
bi_scope
.
(** This class is required for the [iLöb] tactic. For most logics this class
should not be inhabited directly, but the instance [Contractive (▷) → BiLöb PROP]
in [derived_laws_later] should be used. A direct instance of the class is useful
when considering a BI logic with a discrete OFE, instead of a OFE that takes
stepindexing of the logic in account.*)
(** The class [BiLöb] is required for the [iLöb] tactic. However, for most BI
logics [BiLaterContractive] should be used, which gives an instance of [BiLöb]
automatically (see [derived_laws_later]). A direct instance of [BiLöb] is useful
when considering a BI logic with a discrete OFE, instead of an OFE that takes
stepindexing of the logic in account.
The internal/"strong" version of Löb [(▷ P → P) ⊢ P] is derivable from [BiLöb].
It is provided by the lemma [löb] in [derived_laws_later]. *)
Class
BiL
ö
b
(
PROP
:
bi
)
:
=
l
ö
b
(
P
:
PROP
)
:
(
▷
P
→
P
)
⊢
P
.
l
ö
b
_weak
(
P
:
PROP
)
:
(
▷
P
⊢
P
)
→
(
True
⊢
P
)
.
Hint
Mode
BiL
ö
b
!
:
typeclass_instances
.
Arguments
l
ö
b
{
_
_
}
_
.
Arguments
l
ö
b_weak
{
_
_
}
_
_
.
Notation
BiLaterContractive
PROP
:
=
(
Contractive
(
bi_later
(
PROP
:
=
PROP
)))
(
only
parsing
).
theories/bi/derived_laws_later.v
View file @
11f9d567
...
...
@@ 84,23 +84,31 @@ Proof. intros. by rewrite /Persistent later_persistently {1}(persistent P). Qed
Global
Instance
later_absorbing
P
:
Absorbing
P
→
Absorbing
(
▷
P
).
Proof
.
intros
?.
by
rewrite
/
Absorbing

later_absorbingly
absorbing
.
Qed
.
(* Proof following https://en.wikipedia.org/wiki/L%C3%B6b's_theorem#Proof_of_L%C3%B6b's_theorem.
Their [Ψ] is called [Q] in our proof. *)
Global
Instance
later_contractive_bi_l
ö
b
:
Contractive
(
bi_later
(
PROP
:
=
PROP
))
→
BiL
ö
b
PROP
.
(** * Alternatives to Löb induction *)
(** We prove relations between the following statements:
1. [Contractive (▷)], later is contractive as expressed by [BiLaterContractive].
2. [(▷ P ⊢ P) → (True ⊢ P)], the external/"weak" of Löb as expressed by [BiLöb].
3. [(▷ P → P) ⊢ P], the internal version/"strong" of Löb.
4. [□ (□ ▷ P ∗ P) ⊢ P], an internal version of Löb with magic wand instead of
implication.
5. [□ (▷ P ∗ P) ⊢ P], a weaker version of the former statement, which does not
make the induction hypothesis intuitionistic.
We prove that:
 (1) implies (2) in all BI logics (lemma [later_contractive_bi_löb]).
 (2) and (3) are logically equivalent in all BI logics (lemma [löb_alt_strong]).
 (2) implies (4) and (5) in all BI logics (lemmas [löb_wand_intuitionistically]
and [löb_wand]).
 (5) and (2) are logically equivalent in affine BI logics (lemma [löb_alt_wand]).
In particular, this gives that (2), (3), (4) and (5) are logically equivalent in
affine BI logics such as Iris. *)
Lemma
l
ö
b
`
{!
BiL
ö
b
PROP
}
P
:
(
▷
P
→
P
)
⊢
P
.
Proof
.
intros
.
assert
(
∀
P
,
(
▷
P
⊢
P
)
→
(
True
⊢
P
))
as
weak_l
ö
b
.
{
intros
P
.
pose
(
fl
ö
b_pre
(
P
Q
:
PROP
)
:
=
(
▷
Q
→
P
)%
I
).
assert
(
∀
P
,
Contractive
(
fl
ö
b_pre
P
))
by
solve_contractive
.
set
(
Q
:
=
fixpoint
(
fl
ö
b_pre
P
)).
assert
(
Q
⊣
⊢
(
▷
Q
→
P
))
as
HQ
by
(
exact
:
fixpoint_unfold
).
intros
HP
.
rewrite

HP
.
assert
(
▷
Q
⊢
P
)
as
HQP
.
{
rewrite

HP
.
rewrite
(
idemp
(
∧
)
(
▷
Q
))%
I
{
2
}(
later_intro
(
▷
Q
))%
I
.
by
rewrite
{
1
}
HQ
{
1
}
later_impl
impl_elim_l
.
}
rewrite

HQP
HQ

2
!
later_intro
.
apply
(
entails_impl_True
_
P
).
done
.
}
intros
P
.
apply
entails_impl_True
,
weak_l
ö
b
.
apply
impl_intro_r
.
apply
entails_impl_True
,
l
ö
b_weak
.
apply
impl_intro_r
.
rewrite
{
2
}(
idemp
(
∧
)
(
▷
P
→
P
))%
I
.
rewrite
{
2
}(
later_intro
(
▷
P
→
P
))%
I
.
rewrite
later_impl
.
...
...
@@ 108,6 +116,26 @@ Proof.
rewrite
impl_elim_r
.
done
.
Qed
.
Lemma
l
ö
b_alt_strong
:
BiL
ö
b
PROP
↔
∀
P
,
(
▷
P
→
P
)
⊢
P
.
Proof
.
split
;
intros
HL
ö
b
P
.
apply
l
ö
b
.
by
intros
>%
entails_impl_True
.
Qed
.
(** Proof following https://en.wikipedia.org/wiki/L%C3%B6b's_theorem#Proof_of_L%C3%B6b's_theorem.
Their [Ψ] is called [Q] in our proof. *)
Global
Instance
later_contractive_bi_l
ö
b
:
BiLaterContractive
PROP
→
BiL
ö
b
PROP
.
Proof
.
intros
=>
P
.
pose
(
fl
ö
b_pre
(
P
Q
:
PROP
)
:
=
(
▷
Q
→
P
)%
I
).
assert
(
∀
P
,
Contractive
(
fl
ö
b_pre
P
))
by
solve_contractive
.
set
(
Q
:
=
fixpoint
(
fl
ö
b_pre
P
)).
assert
(
Q
⊣
⊢
(
▷
Q
→
P
))
as
HQ
by
(
exact
:
fixpoint_unfold
).
intros
HP
.
rewrite

HP
.
assert
(
▷
Q
⊢
P
)
as
HQP
.
{
rewrite

HP
.
rewrite
(
idemp
(
∧
)
(
▷
Q
))%
I
{
2
}(
later_intro
(
▷
Q
))%
I
.
by
rewrite
{
1
}
HQ
{
1
}
later_impl
impl_elim_l
.
}
rewrite

HQP
HQ

2
!
later_intro
.
apply
(
entails_impl_True
_
P
).
done
.
Qed
.
Lemma
l
ö
b_wand_intuitionistically
`
{!
BiL
ö
b
PROP
}
P
:
□
(
□
▷
P

∗
P
)
⊢
P
.
Proof
.
rewrite
{
3
}(
intuitionistically_elim
P
)
(
l
ö
b
(
□
P
)%
I
).
apply
impl_intro_l
.
...
...
@@ 123,9 +151,10 @@ Qed.
(** The proof of the righttoleft direction relies on the BI being affine. It
is unclear how to generalize the lemma or proof to support nonaffine BIs. *)
Lemma
l
ö
b_alt
`
{!
BiAffine
PROP
}
:
BiL
ö
b
PROP
↔
∀
P
,
□
(
▷
P

∗
P
)
⊢
P
.
Lemma
l
ö
b_alt
_wand
`
{!
BiAffine
PROP
}
:
BiL
ö
b
PROP
↔
∀
P
,
□
(
▷
P

∗
P
)
⊢
P
.
Proof
.
split
;
intros
Hl
ö
b
P
;
[
by
apply
l
ö
b_wand
].
split
;
intros
Hl
ö
b
;
[
by
apply
l
ö
b_wand
].
apply
l
ö
b_alt_strong
=>
P
.
rewrite
bi
.
impl_alt
.
apply
bi
.
exist_elim
=>
R
.
apply
impl_elim_r'
.
rewrite
(
Hl
ö
b
(
R
→
P
)%
I
)

intuitionistically_into_persistently
.
apply
intuitionistically_intro'
,
wand_intro_l
,
impl_intro_l
.
...
...
theories/bi/interface.v
View file @
11f9d567
...
...
@@ 120,8 +120,8 @@ Section bi_mixin.
For non stepindexed BIs the later modality can simply be defined as the
identity function, as the Löb axiom or contractiveness of later is not part of
[BiLaterMixin]. For stepindexed BIs one should separately prove an instance
of the class [BiL
öb PROP] or [Contractive (▷)
]. (Note that there is an
instance [
Contractive (▷)
→ BiLöb PROP] in [derived_laws_later].)
of the class [BiL
aterContractive PROP] or [BiLöb PROP
]. (Note that there is an
instance [
BiLaterContractive PROP
→ BiLöb PROP] in [derived_laws_later].)
For non stepindexed BIs one can get a "free" instance of [BiLaterMixin] using
the smart constructor [bi_later_mixin_id] below. *)
...
...
theories/bi/monpred.v
View file @
11f9d567
...
...
@@ 401,12 +401,10 @@ Global Instance monPred_in_flip_mono : Proper ((⊑) ==> flip (⊢)) (@monPred_i
Proof
.
solve_proper
.
Qed
.
Global
Instance
monPred_later_contractive
:
Contractive
(
bi_later
(
PROP
:
=
PROP
))
→
Contractive
(
bi_later
(
PROP
:
=
monPredI
))
.
BiLaterContractive
PROP
→
BiLaterContractive
monPredI
.
Proof
.
unseal
=>
?
n
P
Q
HPQ
.
split
=>
i
/=.
f_contractive
.
apply
HPQ
.
Qed
.
Global
Instance
monPred_bi_l
ö
b
:
BiL
ö
b
PROP
→
BiL
ö
b
monPredI
.
Proof
.
split
=>
i
.
unseal
.
by
rewrite
(
bi
.
forall_elim
i
)
bi
.
pure_True
//
left_id
l
ö
b
.
Qed
.
Proof
.
rewrite
{
2
}/
BiL
ö
b
;
unseal
=>
?
P
HP
;
split
=>
i
/=.
apply
l
ö
b_weak
,
HP
.
Qed
.
Global
Instance
monPred_bi_positive
:
BiPositive
PROP
→
BiPositive
monPredI
.
Proof
.
split
=>
?.
unseal
.
apply
bi_positive
.
Qed
.
Global
Instance
monPred_bi_affine
:
BiAffine
PROP
→
BiAffine
monPredI
.
...
...
theories/si_logic/bi.v
View file @
11f9d567
...
...
@@ 115,7 +115,7 @@ Canonical Structure siPropI : bi :=
{
bi_ofe_mixin
:
=
ofe_mixin_of
siProp
;
bi_bi_mixin
:
=
siProp_bi_mixin
;
bi_bi_later_mixin
:
=
siProp_bi_later_mixin
}.
Instance
siProp_later_contractive
:
Contractive
(
bi_later
(
PROP
:
=
siPropI
))
.
Instance
siProp_later_contractive
:
BiLaterContractive
siPropI
.
Proof
.
apply
later_contractive
.
Qed
.
Lemma
siProp_internal_eq_mixin
:
BiInternalEqMixin
siPropI
(@
siProp_internal_eq
).
...
...
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