Commit 2ba2ba1e authored by Robbert Krebbers's avatar Robbert Krebbers

Notations <absorb>, <affine> and <pers>.

parent edc37245
......@@ -16,8 +16,7 @@ Notation "P ⊢ Q" := (bi_entails (PROP:=uPredI M) P%I Q%I).
Notation "P ⊣⊢ Q" := (equiv (A:=uPredI M) P%I Q%I).
(* Own and valid derived *)
Lemma persistently_cmra_valid_1 {A : cmraT} (a : A) :
a bi_persistently ( a : uPred M).
Lemma persistently_cmra_valid_1 {A : cmraT} (a : A) : a <pers> ( a : uPred M).
Proof. by rewrite {1}plainly_cmra_valid_1 plainly_elim_persistently. Qed.
Lemma affinely_persistently_ownM (a : M) : CoreId a uPred_ownM a uPred_ownM a.
Proof.
......
......@@ -457,21 +457,21 @@ Proof.
- (* (P ⊢ Q -∗ R) → P ∗ Q ⊢ R *)
intros P Q R. unseal=> HPQR. split; intros n x ? (?&?&?&?&?). ofe_subst.
eapply HPQR; eauto using cmra_validN_op_l.
- (* (P ⊢ Q) → bi_persistently P ⊢ bi_persistently Q *)
- (* (P ⊢ Q) → <pers> P ⊢ <pers> Q *)
intros P QR HP. unseal; split=> n x ? /=. by apply HP, cmra_core_validN.
- (* bi_persistently P ⊢ bi_persistently (bi_persistently P) *)
- (* <pers> P ⊢ <pers> <pers> P *)
intros P. unseal; split=> n x ?? /=. by rewrite cmra_core_idemp.
- (* P ⊢ bi_persistently emp (ADMISSIBLE) *)
- (* P ⊢ <pers> emp (ADMISSIBLE) *)
by unseal.
- (* (∀ a, bi_persistently (Ψ a)) ⊢ bi_persistently (∀ a, Ψ a) *)
- (* (∀ a, <pers> (Ψ a)) ⊢ <pers> (∀ a, Ψ a) *)
by unseal.
- (* bi_persistently (∃ a, Ψ a) ⊢ ∃ a, bi_persistently (Ψ a) *)
- (* <pers> (∃ a, Ψ a) ⊢ ∃ a, <pers> (Ψ a) *)
by unseal.
- (* bi_persistently P ∗ Q ⊢ bi_persistently P (ADMISSIBLE) *)
- (* <pers> P ∗ Q ⊢ <pers> P (ADMISSIBLE) *)
intros P Q. move: (uPred_persistently P)=> P'.
unseal; split; intros n x ? (x1&x2&?&?&_); ofe_subst;
eauto using uPred_mono, cmra_includedN_l.
- (* bi_persistently P ∧ Q ⊢ P ∗ Q *)
- (* <pers> P ∧ Q ⊢ P ∗ Q *)
intros P Q. unseal; split=> n x ? [??]; simpl in *.
exists (core x), x; rewrite ?cmra_core_l; auto.
Qed.
......@@ -523,9 +523,9 @@ Proof.
- (* ▷ P ∗ ▷ Q ⊢ ▷ (P ∗ Q) *)
intros P Q. unseal; split=> -[|n] x ? /=; [done|intros (x1&x2&Hx&?&?)].
exists x1, x2; eauto using dist_S.
- (* ▷ bi_persistently P ⊢ bi_persistently (▷ P) *)
- (* ▷ <pers> P ⊢ <pers> ▷ P *)
by unseal.
- (* bi_persistently (▷ P) ⊢ ▷ bi_persistently P *)
- (* <pers> ▷ P ⊢ ▷ <pers> P *)
by unseal.
- (* ▷ P ⊢ ▷ False ∨ (▷ False → P) *)
intros P. unseal; split=> -[|n] x ? /= HP; [by left|right].
......@@ -552,13 +552,13 @@ Proof.
unseal; split=> n' x; split; apply HP; eauto using @ucmra_unit_validN.
- (* (P ⊢ Q) → ■ P ⊢ ■ Q *)
intros P QR HP. unseal; split=> n x ? /=. by apply HP, ucmra_unit_validN.
- (* ■ P ⊢ bi_persistently P *)
- (* ■ P ⊢ <pers> P *)
unseal; split; simpl; eauto using uPred_mono, @ucmra_unit_leastN.
- (* ■ P ⊢ ■ ■ P *)
unseal; split=> n x ?? //.
- (* (∀ a, ■ (Ψ a)) ⊢ ■ (∀ a, Ψ a) *)
by unseal.
- (* (■ P → bi_persistently Q) ⊢ bi_persistently (■ P → Q) *)
- (* (■ P → <pers> Q) ⊢ <pers> (■ P → Q) *)
unseal; split=> /= n x ? HPQ n' x' ????.
eapply uPred_mono with n' (core x)=>//; [|by apply cmra_included_includedN].
apply (HPQ n' x); eauto using cmra_validN_le.
......@@ -665,8 +665,7 @@ Proof.
by rewrite (assoc op _ z1) -(comm op z1) (assoc op z1)
-(assoc op _ a2) (comm op z1) -Hy1 -Hy2.
Qed.
Lemma persistently_ownM_core (a : M) :
uPred_ownM a bi_persistently (uPred_ownM (core a)).
Lemma persistently_ownM_core (a : M) : uPred_ownM a <pers> uPred_ownM (core a).
Proof.
rewrite /bi_persistently /=. unseal.
split=> n x Hx /=. by apply cmra_core_monoN.
......
......@@ -127,8 +127,7 @@ Section sep_list.
Proof. auto using and_intro, big_sepL_mono, and_elim_l, and_elim_r. Qed.
Lemma big_sepL_persistently `{BiAffine PROP} Φ l :
bi_persistently ([ list] kx l, Φ k x)
[ list] kx l, bi_persistently (Φ k x).
<pers> ([ list] kx l, Φ k x) [ list] kx l, <pers> (Φ k x).
Proof. apply (big_opL_commute _). Qed.
Lemma big_sepL_forall `{BiAffine PROP} Φ l :
......@@ -266,8 +265,7 @@ Section and_list.
Proof. auto using and_intro, big_andL_mono, and_elim_l, and_elim_r. Qed.
Lemma big_andL_persistently Φ l :
bi_persistently ([ list] kx l, Φ k x)
[ list] kx l, bi_persistently (Φ k x).
<pers> ([ list] kx l, Φ k x) [ list] kx l, <pers> (Φ k x).
Proof. apply (big_opL_commute _). Qed.
Lemma big_andL_forall `{BiAffine PROP} Φ l :
......@@ -398,8 +396,7 @@ Section gmap.
Proof. auto using and_intro, big_sepM_mono, and_elim_l, and_elim_r. Qed.
Lemma big_sepM_persistently `{BiAffine PROP} Φ m :
(bi_persistently ([ map] kx m, Φ k x))
([ map] kx m, bi_persistently (Φ k x)).
(<pers> ([ map] kx m, Φ k x)) ([ map] kx m, <pers> (Φ k x)).
Proof. apply (big_opM_commute _). Qed.
Lemma big_sepM_forall `{BiAffine PROP} Φ m :
......@@ -564,7 +561,7 @@ Section gset.
Proof. auto using and_intro, big_sepS_mono, and_elim_l, and_elim_r. Qed.
Lemma big_sepS_persistently `{BiAffine PROP} Φ X :
bi_persistently ([ set] y X, Φ y) [ set] y X, bi_persistently (Φ y).
<pers> ([ set] y X, Φ y) [ set] y X, <pers> (Φ y).
Proof. apply (big_opS_commute _). Qed.
Lemma big_sepS_forall `{BiAffine PROP} Φ X :
......@@ -672,8 +669,7 @@ Section gmultiset.
Proof. auto using and_intro, big_sepMS_mono, and_elim_l, and_elim_r. Qed.
Lemma big_sepMS_persistently `{BiAffine PROP} Φ X :
bi_persistently ([ mset] y X, Φ y)
[ mset] y X, bi_persistently (Φ y).
<pers> ([ mset] y X, Φ y) [ mset] y X, <pers> (Φ y).
Proof. apply (big_opMS_commute _). Qed.
Global Instance big_sepMS_empty_persistent Φ :
......
......@@ -13,7 +13,7 @@ Arguments bi_wand_iff {_} _%I _%I : simpl never.
Instance: Params (@bi_wand_iff) 1.
Infix "∗-∗" := bi_wand_iff (at level 95, no associativity) : bi_scope.
Class Persistent {PROP : bi} (P : PROP) := persistent : P bi_persistently P.
Class Persistent {PROP : bi} (P : PROP) := persistent : P <pers> P.
Arguments Persistent {_} _%I : simpl never.
Arguments persistent {_} _%I {_}.
Hint Mode Persistent + ! : typeclass_instances.
......@@ -23,7 +23,10 @@ Definition bi_affinely {PROP : bi} (P : PROP) : PROP := (emp ∧ P)%I.
Arguments bi_affinely {_} _%I : simpl never.
Instance: Params (@bi_affinely) 1.
Typeclasses Opaque bi_affinely.
Notation "□ P" := (bi_affinely (bi_persistently P))%I
Notation "'<affine>' P" := (bi_affinely P)
(at level 20, right associativity) : bi_scope.
Notation "□ P" := (<affine> <pers> P)%I
(at level 20, right associativity) : bi_scope.
Class Affine {PROP : bi} (Q : PROP) := affine : Q emp.
......@@ -36,31 +39,40 @@ Hint Mode BiAffine ! : typeclass_instances.
Existing Instance absorbing_bi | 0.
Class BiPositive (PROP : bi) :=
bi_positive (P Q : PROP) : bi_affinely (P Q) bi_affinely P Q.
bi_positive (P Q : PROP) : <affine> (P Q) <affine> P Q.
Hint Mode BiPositive ! : typeclass_instances.
Definition bi_absorbingly {PROP : bi} (P : PROP) : PROP := (True P)%I.
Arguments bi_absorbingly {_} _%I : simpl never.
Instance: Params (@bi_absorbingly) 1.
Typeclasses Opaque bi_absorbingly.
Notation "'<absorb>' P" := (bi_absorbingly P)
(at level 20, right associativity) : bi_scope.
Class Absorbing {PROP : bi} (P : PROP) := absorbing : bi_absorbingly P P.
Class Absorbing {PROP : bi} (P : PROP) := absorbing : <absorb> P P.
Arguments Absorbing {_} _%I : simpl never.
Arguments absorbing {_} _%I.
Hint Mode Absorbing + ! : typeclass_instances.
Definition bi_persistently_if {PROP : bi} (p : bool) (P : PROP) : PROP :=
(if p then bi_persistently P else P)%I.
(if p then <pers> P else P)%I.
Arguments bi_persistently_if {_} !_ _%I /.
Instance: Params (@bi_persistently_if) 2.
Typeclasses Opaque bi_persistently_if.
Notation "'<pers>?' p P" := (bi_persistently_if p P)
(at level 20, p at level 9, P at level 20,
right associativity, format "'<pers>?' p P") : bi_scope.
Definition bi_affinely_if {PROP : bi} (p : bool) (P : PROP) : PROP :=
(if p then bi_affinely P else P)%I.
(if p then <affine> P else P)%I.
Arguments bi_affinely_if {_} !_ _%I /.
Instance: Params (@bi_affinely_if) 2.
Typeclasses Opaque bi_affinely_if.
Notation "□? p P" := (bi_affinely_if p (bi_persistently_if p P))%I
Notation "'<affine>?' p P" := (bi_affinely_if p P)
(at level 20, p at level 9, P at level 20,
right associativity, format "'<affine>?' p P") : bi_scope.
Notation "□? p P" := (<affine>?p <pers>?p P)%I
(at level 20, p at level 9, P at level 20,
right associativity, format "□? p P") : bi_scope.
......
......@@ -506,56 +506,54 @@ Global Instance affinely_flip_mono' :
Proper (flip () ==> flip ()) (@bi_affinely PROP).
Proof. solve_proper. Qed.
Lemma affinely_elim_emp P : bi_affinely P emp.
Lemma affinely_elim_emp P : <affine> P emp.
Proof. rewrite /bi_affinely; auto. Qed.
Lemma affinely_elim P : bi_affinely P P.
Lemma affinely_elim P : <affine> P P.
Proof. rewrite /bi_affinely; auto. Qed.
Lemma affinely_mono P Q : (P Q) bi_affinely P bi_affinely Q.
Lemma affinely_mono P Q : (P Q) <affine> P <affine> Q.
Proof. by intros ->. Qed.
Lemma affinely_idemp P : bi_affinely (bi_affinely P) bi_affinely P.
Lemma affinely_idemp P : <affine> <affine> P <affine> P.
Proof. by rewrite /bi_affinely assoc idemp. Qed.
Lemma affinely_intro' P Q : (bi_affinely P Q) bi_affinely P bi_affinely Q.
Lemma affinely_intro' P Q : (<affine> P Q) <affine> P <affine> Q.
Proof. intros <-. by rewrite affinely_idemp. Qed.
Lemma affinely_False : bi_affinely False False.
Lemma affinely_False : <affine> False False.
Proof. by rewrite /bi_affinely right_absorb. Qed.
Lemma affinely_emp : bi_affinely emp emp.
Lemma affinely_emp : <affine> emp emp.
Proof. by rewrite /bi_affinely (idemp bi_and). Qed.
Lemma affinely_or P Q : bi_affinely (P Q) bi_affinely P bi_affinely Q.
Lemma affinely_or P Q : <affine> (P Q) <affine> P <affine> Q.
Proof. by rewrite /bi_affinely and_or_l. Qed.
Lemma affinely_and P Q : bi_affinely (P Q) bi_affinely P bi_affinely Q.
Lemma affinely_and P Q : <affine> (P Q) <affine> P <affine> Q.
Proof.
rewrite /bi_affinely -(comm _ P) (assoc _ (_ _)%I) -!(assoc _ P).
by rewrite idemp !assoc (comm _ P).
Qed.
Lemma affinely_sep_2 P Q : bi_affinely P bi_affinely Q bi_affinely (P Q).
Lemma affinely_sep_2 P Q : <affine> P <affine> Q <affine> (P Q).
Proof.
rewrite /bi_affinely. apply and_intro.
- by rewrite !and_elim_l right_id.
- by rewrite !and_elim_r.
Qed.
Lemma affinely_sep `{BiPositive PROP} P Q :
bi_affinely (P Q) bi_affinely P bi_affinely Q.
<affine> (P Q) <affine> P <affine> Q.
Proof.
apply (anti_symm _), affinely_sep_2.
by rewrite -{1}affinely_idemp bi_positive !(comm _ (bi_affinely P)%I) bi_positive.
by rewrite -{1}affinely_idemp bi_positive !(comm _ (<affine> P)%I) bi_positive.
Qed.
Lemma affinely_forall {A} (Φ : A PROP) :
bi_affinely ( a, Φ a) a, bi_affinely (Φ a).
Lemma affinely_forall {A} (Φ : A PROP) : <affine> ( a, Φ a) a, <affine> (Φ a).
Proof. apply forall_intro=> a. by rewrite (forall_elim a). Qed.
Lemma affinely_exist {A} (Φ : A PROP) :
bi_affinely ( a, Φ a) a, bi_affinely (Φ a).
Lemma affinely_exist {A} (Φ : A PROP) : <affine> ( a, Φ a) a, <affine> (Φ a).
Proof. by rewrite /bi_affinely and_exist_l. Qed.
Lemma affinely_True_emp : bi_affinely True bi_affinely emp.
Lemma affinely_True_emp : <affine> True <affine> emp.
Proof. apply (anti_symm _); rewrite /bi_affinely; auto. Qed.
Lemma affinely_and_l P Q : bi_affinely P Q bi_affinely (P Q).
Lemma affinely_and_l P Q : <affine> P Q <affine> (P Q).
Proof. by rewrite /bi_affinely assoc. Qed.
Lemma affinely_and_r P Q : P bi_affinely Q bi_affinely (P Q).
Lemma affinely_and_r P Q : P <affine> Q <affine> (P Q).
Proof. by rewrite /bi_affinely !assoc (comm _ P). Qed.
Lemma affinely_and_lr P Q : bi_affinely P Q P bi_affinely Q.
Lemma affinely_and_lr P Q : <affine> P Q P <affine> Q.
Proof. by rewrite affinely_and_l affinely_and_r. Qed.
(* Properties of the absorbingly modality *)
......@@ -569,50 +567,45 @@ Global Instance absorbingly_flip_mono' :
Proper (flip () ==> flip ()) (@bi_absorbingly PROP).
Proof. solve_proper. Qed.
Lemma absorbingly_intro P : P bi_absorbingly P.
Lemma absorbingly_intro P : P <absorb> P.
Proof. by rewrite /bi_absorbingly -True_sep_2. Qed.
Lemma absorbingly_mono P Q : (P Q) bi_absorbingly P bi_absorbingly Q.
Lemma absorbingly_mono P Q : (P Q) <absorb> P <absorb> Q.
Proof. by intros ->. Qed.
Lemma absorbingly_idemp P : bi_absorbingly (bi_absorbingly P) bi_absorbingly P.
Lemma absorbingly_idemp P : <absorb> <absorb> P <absorb> P.
Proof.
apply (anti_symm _), absorbingly_intro.
rewrite /bi_absorbingly assoc. apply sep_mono; auto.
Qed.
Lemma absorbingly_pure φ : bi_absorbingly φ φ .
Lemma absorbingly_pure φ : <absorb> φ φ .
Proof.
apply (anti_symm _), absorbingly_intro.
apply wand_elim_r', pure_elim'=> ?. apply wand_intro_l; auto.
Qed.
Lemma absorbingly_or P Q :
bi_absorbingly (P Q) bi_absorbingly P bi_absorbingly Q.
Lemma absorbingly_or P Q : <absorb> (P Q) <absorb> P <absorb> Q.
Proof. by rewrite /bi_absorbingly sep_or_l. Qed.
Lemma absorbingly_and P Q :
bi_absorbingly (P Q) bi_absorbingly P bi_absorbingly Q.
Lemma absorbingly_and P Q : <absorb> (P Q) <absorb> P <absorb> Q.
Proof. apply and_intro; apply absorbingly_mono; auto. Qed.
Lemma absorbingly_forall {A} (Φ : A PROP) :
bi_absorbingly ( a, Φ a) a, bi_absorbingly (Φ a).
Lemma absorbingly_forall {A} (Φ : A PROP) : <absorb> ( a, Φ a) a, <absorb> (Φ a).
Proof. apply forall_intro=> a. by rewrite (forall_elim a). Qed.
Lemma absorbingly_exist {A} (Φ : A PROP) :
bi_absorbingly ( a, Φ a) a, bi_absorbingly (Φ a).
Lemma absorbingly_exist {A} (Φ : A PROP) : <absorb> ( a, Φ a) a, <absorb> (Φ a).
Proof. by rewrite /bi_absorbingly sep_exist_l. Qed.
Lemma absorbingly_sep P Q : bi_absorbingly (P Q) bi_absorbingly P bi_absorbingly Q.
Lemma absorbingly_sep P Q : <absorb> (P Q) <absorb> P <absorb> Q.
Proof. by rewrite -{1}absorbingly_idemp /bi_absorbingly !assoc -!(comm _ P) !assoc. Qed.
Lemma absorbingly_True_emp : bi_absorbingly True bi_absorbingly emp.
Lemma absorbingly_True_emp : <absorb> True <absorb> emp.
Proof. by rewrite absorbingly_pure /bi_absorbingly right_id. Qed.
Lemma absorbingly_wand P Q : bi_absorbingly (P - Q) bi_absorbingly P - bi_absorbingly Q.
Lemma absorbingly_wand P Q : <absorb> (P - Q) <absorb> P - <absorb> Q.
Proof. apply wand_intro_l. by rewrite -absorbingly_sep wand_elim_r. Qed.
Lemma absorbingly_sep_l P Q : bi_absorbingly P Q bi_absorbingly (P Q).
Lemma absorbingly_sep_l P Q : <absorb> P Q <absorb> (P Q).
Proof. by rewrite /bi_absorbingly assoc. Qed.
Lemma absorbingly_sep_r P Q : P bi_absorbingly Q bi_absorbingly (P Q).
Lemma absorbingly_sep_r P Q : P <absorb> Q <absorb> (P Q).
Proof. by rewrite /bi_absorbingly !assoc (comm _ P). Qed.
Lemma absorbingly_sep_lr P Q : bi_absorbingly P Q P bi_absorbingly Q.
Lemma absorbingly_sep_lr P Q : <absorb> P Q P <absorb> Q.
Proof. by rewrite absorbingly_sep_l absorbingly_sep_r. Qed.
Lemma affinely_absorbingly `{!BiPositive PROP} P :
bi_affinely (bi_absorbingly P) bi_affinely P.
Lemma affinely_absorbingly `{!BiPositive PROP} P : <affine> <absorb> P <affine> P.
Proof.
apply (anti_symm _), affinely_mono, absorbingly_intro.
by rewrite /bi_absorbingly affinely_sep affinely_True_emp affinely_emp left_id.
......@@ -624,9 +617,9 @@ Proof. solve_proper. Qed.
Global Instance Absorbing_proper : Proper (() ==> iff) (@Absorbing PROP).
Proof. solve_proper. Qed.
Lemma affine_affinely P `{!Affine P} : bi_affinely P P.
Lemma affine_affinely P `{!Affine P} : <affine> P P.
Proof. rewrite /bi_affinely. apply (anti_symm _); auto. Qed.
Lemma absorbing_absorbingly P `{!Absorbing P} : bi_absorbingly P P.
Lemma absorbing_absorbingly P `{!Absorbing P} : <absorb> P P.
Proof. by apply (anti_symm _), absorbingly_intro. Qed.
Lemma True_affine_all_affine P : Affine (True%I : PROP) Affine P.
......@@ -654,7 +647,7 @@ Proof.
apply and_intro; apply: sep_elim_l || apply: sep_elim_r.
Qed.
Lemma affinely_intro P Q `{!Affine P} : (P Q) P bi_affinely Q.
Lemma affinely_intro P Q `{!Affine P} : (P Q) P <affine> Q.
Proof. intros <-. by rewrite affine_affinely. Qed.
Lemma emp_and P `{!Affine P} : emp P P.
......@@ -721,58 +714,51 @@ Global Instance persistently_flip_mono' :
Proper (flip () ==> flip ()) (@bi_persistently PROP).
Proof. intros P Q; apply persistently_mono. Qed.
Lemma absorbingly_persistently P :
bi_absorbingly (bi_persistently P) bi_persistently P.
Lemma absorbingly_persistently P : <absorb> <pers> P <pers> P.
Proof.
apply (anti_symm _), absorbingly_intro.
by rewrite /bi_absorbingly comm persistently_absorbing.
Qed.
Lemma persistently_forall {A} (Ψ : A PROP) :
bi_persistently ( a, Ψ a) a, bi_persistently (Ψ a).
<pers> ( a, Ψ a) a, <pers> (Ψ a).
Proof.
apply (anti_symm _); auto using persistently_forall_2.
apply forall_intro=> x. by rewrite (forall_elim x).
Qed.
Lemma persistently_exist {A} (Ψ : A PROP) :
bi_persistently ( a, Ψ a) a, bi_persistently (Ψ a).
<pers> ( a, Ψ a) a, <pers> (Ψ a).
Proof.
apply (anti_symm _); auto using persistently_exist_1.
apply exist_elim=> x. by rewrite (exist_intro x).
Qed.
Lemma persistently_and P Q :
bi_persistently (P Q) bi_persistently P bi_persistently Q.
Lemma persistently_and P Q : <pers> (P Q) <pers> P <pers> Q.
Proof. rewrite !and_alt persistently_forall. by apply forall_proper=> -[]. Qed.
Lemma persistently_or P Q :
bi_persistently (P Q) bi_persistently P bi_persistently Q.
Lemma persistently_or P Q : <pers> (P Q) <pers> P <pers> Q.
Proof. rewrite !or_alt persistently_exist. by apply exist_proper=> -[]. Qed.
Lemma persistently_impl P Q :
bi_persistently (P Q) bi_persistently P bi_persistently Q.
Lemma persistently_impl P Q : <pers> (P Q) <pers> P <pers> Q.
Proof.
apply impl_intro_l; rewrite -persistently_and.
apply persistently_mono, impl_elim with P; auto.
Qed.
Lemma persistently_True_emp : bi_persistently True bi_persistently emp.
Lemma persistently_True_emp : <pers> True <pers> emp.
Proof. apply (anti_symm _); auto using persistently_emp_intro. Qed.
Lemma persistently_and_emp P :
bi_persistently P bi_persistently (emp P).
Lemma persistently_and_emp P : <pers> P <pers> (emp P).
Proof.
apply (anti_symm ()); last by rewrite and_elim_r.
rewrite persistently_and. apply and_intro; last done.
apply persistently_emp_intro.
Qed.
Lemma persistently_and_sep_elim_emp P Q :
bi_persistently P Q (emp P) Q.
Lemma persistently_and_sep_elim_emp P Q : <pers> P Q (emp P) Q.
Proof.
rewrite persistently_and_emp.
apply persistently_and_sep_elim.
Qed.
Lemma persistently_and_sep_assoc P Q R :
bi_persistently P (Q R) (bi_persistently P Q) R.
Lemma persistently_and_sep_assoc P Q R : <pers> P (Q R) (<pers> P Q) R.
Proof.
apply (anti_symm ()).
- rewrite {1}persistently_idemp_2 persistently_and_sep_elim_emp assoc.
......@@ -783,79 +769,72 @@ Proof.
+ by rewrite and_elim_l persistently_absorbing.
+ by rewrite and_elim_r.
Qed.
Lemma persistently_and_emp_elim P : emp bi_persistently P P.
Lemma persistently_and_emp_elim P : emp <pers> P P.
Proof. by rewrite comm persistently_and_sep_elim_emp right_id and_elim_r. Qed.
Lemma persistently_elim_absorbingly P : bi_persistently P bi_absorbingly P.
Lemma persistently_elim_absorbingly P : <pers> P <absorb> P.
Proof.
rewrite -(right_id True%I _ (bi_persistently _)%I) -{1}(left_id emp%I _ True%I).
rewrite -(right_id True%I _ (<pers> _)%I) -{1}(left_id emp%I _ True%I).
by rewrite persistently_and_sep_assoc (comm bi_and) persistently_and_emp_elim comm.
Qed.
Lemma persistently_elim P `{!Absorbing P} : bi_persistently P P.
Lemma persistently_elim P `{!Absorbing P} : <pers> P P.
Proof. by rewrite persistently_elim_absorbingly absorbing_absorbingly. Qed.
Lemma persistently_idemp_1 P :
bi_persistently (bi_persistently P) bi_persistently P.
Lemma persistently_idemp_1 P : <pers> <pers> P <pers> P.
Proof. by rewrite persistently_elim_absorbingly absorbingly_persistently. Qed.
Lemma persistently_idemp P :
bi_persistently (bi_persistently P) bi_persistently P.
Lemma persistently_idemp P : <pers> <pers> P <pers> P.
Proof. apply (anti_symm _); auto using persistently_idemp_1, persistently_idemp_2. Qed.
Lemma persistently_intro' P Q :
(bi_persistently P Q) bi_persistently P bi_persistently Q.
Lemma persistently_intro' P Q : (<pers> P Q) <pers> P <pers> Q.
Proof. intros <-. apply persistently_idemp_2. Qed.
Lemma persistently_pure φ : bi_persistently ⌜φ⌝ ⌜φ⌝.
Lemma persistently_pure φ : <pers> ⌜φ⌝ ⌜φ⌝.
Proof.
apply (anti_symm _).
{ by rewrite persistently_elim_absorbingly absorbingly_pure. }
apply pure_elim'=> Hφ.
trans ( x : False, bi_persistently True : PROP)%I; [by apply forall_intro|].
trans ( x : False, <pers> True : PROP)%I; [by apply forall_intro|].
rewrite persistently_forall_2. auto using persistently_mono, pure_intro.
Qed.
Lemma persistently_sep_dup P :
bi_persistently P bi_persistently P bi_persistently P.
Lemma persistently_sep_dup P : <pers> P <pers> P <pers> P.
Proof.
apply (anti_symm _).
- rewrite -{1}(idemp bi_and (bi_persistently _)).
by rewrite -{2}(left_id emp%I _ (bi_persistently _))
- rewrite -{1}(idemp bi_and (<pers> _)%I).
by rewrite -{2}(left_id emp%I _ (<pers> _)%I)
persistently_and_sep_assoc and_elim_l.
- by rewrite persistently_absorbing.
Qed.
Lemma persistently_and_sep_l_1 P Q : bi_persistently P Q bi_persistently P Q.
Lemma persistently_and_sep_l_1 P Q : <pers> P Q <pers> P Q.
Proof.
by rewrite -{1}(left_id emp%I _ Q%I) persistently_and_sep_assoc and_elim_l.
Qed.
Lemma persistently_and_sep_r_1 P Q : P bi_persistently Q P bi_persistently Q.
Lemma persistently_and_sep_r_1 P Q : P <pers> Q P <pers> Q.
Proof. by rewrite !(comm _ P) persistently_and_sep_l_1. Qed.
Lemma persistently_and_sep P Q : bi_persistently (P Q) bi_persistently (P Q).
Lemma persistently_and_sep P Q : <pers> (P Q) <pers> (P Q).
Proof.
rewrite persistently_and.
rewrite -{1}persistently_idemp -persistently_and -{1}(left_id emp%I _ Q%I).
by rewrite persistently_and_sep_assoc (comm bi_and) persistently_and_emp_elim.
Qed.
Lemma persistently_affinely P : bi_persistently (bi_affinely P) bi_persistently P.
Lemma persistently_affinely P : <pers> <affine> P <pers> P.
Proof.
by rewrite /bi_affinely persistently_and -persistently_True_emp
persistently_pure left_id.
Qed.
Lemma and_sep_persistently P Q :
bi_persistently P bi_persistently Q bi_persistently P bi_persistently Q.
Lemma and_sep_persistently P Q : <pers> P <pers> Q <pers> P <pers> Q.
Proof.
apply (anti_symm _); auto using persistently_and_sep_l_1.
apply and_intro.
- by rewrite persistently_absorbing.
- by rewrite comm persistently_absorbing.
Qed.
Lemma persistently_sep_2 P Q :
bi_persistently P bi_persistently Q bi_persistently (P Q).
Lemma persistently_sep_2 P Q : <pers> P <pers> Q <pers> (P Q).
Proof. by rewrite -persistently_and_sep persistently_and -and_sep_persistently. Qed.