Commit 0c4a3e1b authored by Ralf Jung's avatar Ralf Jung
Browse files

more consistent lemma naming

Fixes #177
parent 9ca430f6
...@@ -2,6 +2,13 @@ From iris.bi Require Export derived_connectives. ...@@ -2,6 +2,13 @@ From iris.bi Require Export derived_connectives.
From iris.algebra Require Import monoid. From iris.algebra Require Import monoid.
From stdpp Require Import hlist. From stdpp Require Import hlist.
(** Naming schema for lemmas about modalities:
M1_into_M2: M1 P ⊢ M2 P
M1_M2_elim: M1 (M2 P) ⊣⊢ M1 P
M1_elim_M2: M1 (M2 P) ⊣⊢ M2 P
M1_M2: M1 (M2 P) ⊣⊢ M2 (M1 P)
*)
Module bi. Module bi.
Import interface.bi. Import interface.bi.
Section bi_derived. Section bi_derived.
...@@ -605,7 +612,7 @@ Proof. by rewrite /bi_absorbingly !assoc (comm _ P). Qed. ...@@ -605,7 +612,7 @@ Proof. by rewrite /bi_absorbingly !assoc (comm _ P). Qed.
Lemma absorbingly_sep_lr P Q : <absorb> P Q P <absorb> Q. Lemma absorbingly_sep_lr P Q : <absorb> P Q P <absorb> Q.
Proof. by rewrite absorbingly_sep_l absorbingly_sep_r. Qed. Proof. by rewrite absorbingly_sep_l absorbingly_sep_r. Qed.
Lemma affinely_absorbingly `{!BiPositive PROP} P : <affine> <absorb> P <affine> P. Lemma affinely_absorbingly_elim `{!BiPositive PROP} P : <affine> <absorb> P <affine> P.
Proof. Proof.
apply (anti_symm _), affinely_mono, absorbingly_intro. apply (anti_symm _), affinely_mono, absorbingly_intro.
by rewrite /bi_absorbingly affinely_sep affinely_True_emp affinely_emp left_id. by rewrite /bi_absorbingly affinely_sep affinely_True_emp affinely_emp left_id.
...@@ -714,7 +721,7 @@ Global Instance persistently_flip_mono' : ...@@ -714,7 +721,7 @@ Global Instance persistently_flip_mono' :
Proper (flip () ==> flip ()) (@bi_persistently PROP). Proper (flip () ==> flip ()) (@bi_persistently PROP).
Proof. intros P Q; apply persistently_mono. Qed. Proof. intros P Q; apply persistently_mono. Qed.
Lemma absorbingly_persistently P : <absorb> <pers> P <pers> P. Lemma absorbingly_elim_persistently P : <absorb> <pers> P <pers> P.
Proof. Proof.
apply (anti_symm _), absorbingly_intro. apply (anti_symm _), absorbingly_intro.
by rewrite /bi_absorbingly comm persistently_absorbing. by rewrite /bi_absorbingly comm persistently_absorbing.
...@@ -776,16 +783,16 @@ Proof. ...@@ -776,16 +783,16 @@ Proof.
Qed. Qed.
Lemma persistently_and_emp_elim P : emp <pers> 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. Proof. by rewrite comm persistently_and_sep_elim_emp right_id and_elim_r. Qed.
Lemma persistently_elim_absorbingly P : <pers> P <absorb> P. Lemma persistently_into_absorbingly P : <pers> P <absorb> P.
Proof. Proof.
rewrite -(right_id True%I _ (<pers> _)%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. by rewrite persistently_and_sep_assoc (comm bi_and) persistently_and_emp_elim comm.
Qed. Qed.
Lemma persistently_elim P `{!Absorbing P} : <pers> P P. Lemma persistently_elim P `{!Absorbing P} : <pers> P P.
Proof. by rewrite persistently_elim_absorbingly absorbing_absorbingly. Qed. Proof. by rewrite persistently_into_absorbingly absorbing_absorbingly. Qed.
Lemma persistently_idemp_1 P : <pers> <pers> P <pers> P. Lemma persistently_idemp_1 P : <pers> <pers> P <pers> P.
Proof. by rewrite persistently_elim_absorbingly absorbingly_persistently. Qed. Proof. by rewrite persistently_into_absorbingly absorbingly_elim_persistently. Qed.
Lemma persistently_idemp P : <pers> <pers> P <pers> P. Lemma persistently_idemp P : <pers> <pers> P <pers> P.
Proof. apply (anti_symm _); auto using persistently_idemp_1, persistently_idemp_2. Qed. Proof. apply (anti_symm _); auto using persistently_idemp_1, persistently_idemp_2. Qed.
...@@ -795,7 +802,7 @@ Proof. intros <-. apply persistently_idemp_2. Qed. ...@@ -795,7 +802,7 @@ Proof. intros <-. apply persistently_idemp_2. Qed.
Lemma persistently_pure φ : <pers> ⌜φ⌝ ⌜φ⌝. Lemma persistently_pure φ : <pers> ⌜φ⌝ ⌜φ⌝.
Proof. Proof.
apply (anti_symm _). apply (anti_symm _).
{ by rewrite persistently_elim_absorbingly absorbingly_pure. } { by rewrite persistently_into_absorbingly absorbingly_pure. }
apply pure_elim'=> Hφ. apply pure_elim'=> Hφ.
trans ( x : False, <pers> 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. rewrite persistently_forall_2. auto using persistently_mono, pure_intro.
...@@ -824,7 +831,7 @@ Proof. ...@@ -824,7 +831,7 @@ Proof.
by rewrite persistently_and_sep_assoc (comm bi_and) persistently_and_emp_elim. by rewrite persistently_and_sep_assoc (comm bi_and) persistently_and_emp_elim.
Qed. Qed.
Lemma persistently_affinely P : <pers> <affine> P <pers> P. Lemma persistently_affinely_elim P : <pers> <affine> P <pers> P.
Proof. Proof.
by rewrite /bi_affinely persistently_and -persistently_True_emp by rewrite /bi_affinely persistently_and -persistently_True_emp
persistently_pure left_id. persistently_pure left_id.
...@@ -842,7 +849,7 @@ Proof. by rewrite -persistently_and_sep persistently_and -and_sep_persistently. ...@@ -842,7 +849,7 @@ Proof. by rewrite -persistently_and_sep persistently_and -and_sep_persistently.
Lemma persistently_sep `{BiPositive PROP} P Q : <pers> (P Q) <pers> P <pers> Q. Lemma persistently_sep `{BiPositive PROP} P Q : <pers> (P Q) <pers> P <pers> Q.
Proof. Proof.
apply (anti_symm _); auto using persistently_sep_2. apply (anti_symm _); auto using persistently_sep_2.
rewrite -persistently_affinely affinely_sep -and_sep_persistently. apply and_intro. rewrite -persistently_affinely_elim affinely_sep -and_sep_persistently. apply and_intro.
- by rewrite (affinely_elim_emp Q) right_id affinely_elim. - by rewrite (affinely_elim_emp Q) right_id affinely_elim.
- by rewrite (affinely_elim_emp P) left_id affinely_elim. - by rewrite (affinely_elim_emp P) left_id affinely_elim.
Qed. Qed.
...@@ -858,7 +865,8 @@ Qed. ...@@ -858,7 +865,8 @@ Qed.
Lemma persistently_alt_fixpoint' P : Lemma persistently_alt_fixpoint' P :
<pers> P <affine> P <pers> P. <pers> P <affine> P <pers> P.
Proof. Proof.
rewrite -{1}persistently_affinely {1}persistently_alt_fixpoint persistently_affinely //. rewrite -{1}persistently_affinely_elim {1}persistently_alt_fixpoint
persistently_affinely_elim //.
Qed. Qed.
Lemma persistently_wand P Q : <pers> (P - Q) <pers> P - <pers> Q. Lemma persistently_wand P Q : <pers> (P - Q) <pers> P - <pers> Q.
...@@ -946,7 +954,7 @@ Proof. rewrite /bi_intuitionistically affinely_elim_emp //. Qed. ...@@ -946,7 +954,7 @@ Proof. rewrite /bi_intuitionistically affinely_elim_emp //. Qed.
Lemma intuitionistically_intro' P Q : ( P Q) P Q. Lemma intuitionistically_intro' P Q : ( P Q) P Q.
Proof. Proof.
intros <-. intros <-.
by rewrite /bi_intuitionistically persistently_affinely persistently_idemp. by rewrite /bi_intuitionistically persistently_affinely_elim persistently_idemp.
Qed. Qed.
Lemma intuitionistically_emp : emp emp. Lemma intuitionistically_emp : emp emp.
...@@ -973,11 +981,11 @@ Lemma intuitionistically_sep `{BiPositive PROP} P Q : □ (P ∗ Q) ⊣⊢ □ P ...@@ -973,11 +981,11 @@ Lemma intuitionistically_sep `{BiPositive PROP} P Q : □ (P ∗ Q) ⊣⊢ □ P
Proof. by rewrite /bi_intuitionistically -affinely_sep -persistently_sep. Qed. Proof. by rewrite /bi_intuitionistically -affinely_sep -persistently_sep. Qed.
Lemma intuitionistically_idemp P : P P. Lemma intuitionistically_idemp P : P P.
Proof. by rewrite /bi_intuitionistically persistently_affinely persistently_idemp. Qed. Proof. by rewrite /bi_intuitionistically persistently_affinely_elim persistently_idemp. Qed.
Lemma intuitionistically_persistently_1 P : P <pers> P. Lemma intuitionistically_into_persistently_1 P : P <pers> P.
Proof. rewrite /bi_intuitionistically affinely_elim //. Qed. Proof. rewrite /bi_intuitionistically affinely_elim //. Qed.
Lemma intuitionistically_persistently_persistently P : <pers> P P. Lemma intuitionistically_persistently_elim P : <pers> P P.
Proof. rewrite /bi_intuitionistically persistently_idemp //. Qed. Proof. rewrite /bi_intuitionistically persistently_idemp //. Qed.
Lemma intuitionistic_intuitionistically P : Lemma intuitionistic_intuitionistically P :
...@@ -992,8 +1000,8 @@ Proof. ...@@ -992,8 +1000,8 @@ Proof.
- rewrite and_elim_l //. - rewrite and_elim_l //.
- apply persistently_and_emp_elim. - apply persistently_and_emp_elim.
Qed. Qed.
Lemma intuitionistically_affinely_affinely P : <affine> P P. Lemma intuitionistically_affinely_elim P : <affine> P P.
Proof. rewrite /bi_intuitionistically persistently_affinely //. Qed. Proof. rewrite /bi_intuitionistically persistently_affinely_elim //. Qed.
Lemma persistently_and_intuitionistically_sep_l P Q : <pers> P Q P Q. Lemma persistently_and_intuitionistically_sep_l P Q : <pers> P Q P Q.
Proof. Proof.
...@@ -1038,7 +1046,7 @@ Qed. ...@@ -1038,7 +1046,7 @@ Qed.
Section bi_affine_intuitionistically. Section bi_affine_intuitionistically.
Context `{BiAffine PROP}. Context `{BiAffine PROP}.
Lemma intuitionistically_persistently P : P <pers> P. Lemma intuitionistically_into_persistently P : P <pers> P.
Proof. rewrite /bi_intuitionistically affine_affinely //. Qed. Proof. rewrite /bi_intuitionistically affine_affinely //. Qed.
End bi_affine_intuitionistically. End bi_affine_intuitionistically.
...@@ -1205,10 +1213,11 @@ Proof. intros. rewrite -persistent_and_sep_1; auto. Qed. ...@@ -1205,10 +1213,11 @@ Proof. intros. rewrite -persistent_and_sep_1; auto. Qed.
Lemma persistent_entails_r P Q `{!Persistent Q} : (P Q) P P Q. Lemma persistent_entails_r P Q `{!Persistent Q} : (P Q) P P Q.
Proof. intros. rewrite -persistent_and_sep_1; auto. Qed. Proof. intros. rewrite -persistent_and_sep_1; auto. Qed.
Lemma absorbingly_intuitionistically P : <absorb> P <pers> P. Lemma absorbingly_intuitionistically_into_persistently P :
<absorb> P <pers> P.
Proof. Proof.
apply (anti_symm _). apply (anti_symm _).
- by rewrite intuitionistically_persistently_1 absorbingly_persistently. - by rewrite intuitionistically_into_persistently_1 absorbingly_elim_persistently.
- rewrite -{1}(idemp bi_and (<pers> _)%I) persistently_and_intuitionistically_sep_r. - rewrite -{1}(idemp bi_and (<pers> _)%I) persistently_and_intuitionistically_sep_r.
by rewrite {1} (True_intro (<pers> _)%I). by rewrite {1} (True_intro (<pers> _)%I).
Qed. Qed.
...@@ -1216,13 +1225,13 @@ Qed. ...@@ -1216,13 +1225,13 @@ Qed.
Lemma persistent_absorbingly_affinely_2 P `{!Persistent P} : Lemma persistent_absorbingly_affinely_2 P `{!Persistent P} :
P <absorb> <affine> P. P <absorb> <affine> P.
Proof. Proof.
rewrite {1}(persistent P) -absorbingly_intuitionistically. rewrite {1}(persistent P) -absorbingly_intuitionistically_into_persistently.
by rewrite intuitionistically_affinely. by rewrite intuitionistically_affinely.
Qed. Qed.
Lemma persistent_absorbingly_affinely P `{!Persistent P, !Absorbing P} : Lemma persistent_absorbingly_affinely P `{!Persistent P, !Absorbing P} :
<absorb> <affine> P P. <absorb> <affine> P P.
Proof. Proof.
by rewrite -(persistent_persistently P) absorbingly_intuitionistically. by rewrite -(persistent_persistently P) absorbingly_intuitionistically_into_persistently.
Qed. Qed.
Lemma persistent_and_sep_assoc P `{!Persistent P, !Absorbing P} Q R : Lemma persistent_and_sep_assoc P `{!Persistent P, !Absorbing P} Q R :
...@@ -1309,7 +1318,7 @@ Proof. intros. by rewrite /Absorbing absorbingly_wand !absorbing -absorbingly_in ...@@ -1309,7 +1318,7 @@ Proof. intros. by rewrite /Absorbing absorbingly_wand !absorbing -absorbingly_in
Global Instance absorbingly_absorbing P : Absorbing (<absorb> P). Global Instance absorbingly_absorbing P : Absorbing (<absorb> P).
Proof. rewrite /bi_absorbingly. apply _. Qed. Proof. rewrite /bi_absorbingly. apply _. Qed.
Global Instance persistently_absorbing P : Absorbing (<pers> P). Global Instance persistently_absorbing P : Absorbing (<pers> P).
Proof. by rewrite /Absorbing absorbingly_persistently. Qed. Proof. by rewrite /Absorbing absorbingly_elim_persistently. Qed.
Global Instance persistently_if_absorbing P p : Global Instance persistently_if_absorbing P p :
Absorbing P Absorbing (<pers>?p P). Absorbing P Absorbing (<pers>?p P).
Proof. intros; destruct p; simpl; apply _. Qed. Proof. intros; destruct p; simpl; apply _. Qed.
......
...@@ -121,7 +121,7 @@ Qed. ...@@ -121,7 +121,7 @@ Qed.
Lemma persistently_internal_eq {A : ofeT} (a b : A) : <pers> (a b) a b. Lemma persistently_internal_eq {A : ofeT} (a b : A) : <pers> (a b) a b.
Proof. Proof.
apply (anti_symm ()). apply (anti_symm ()).
{ by rewrite persistently_elim_absorbingly absorbingly_internal_eq. } { by rewrite persistently_into_absorbingly absorbingly_internal_eq. }
apply (internal_eq_rewrite' a b (λ b, <pers> (a b))%I); auto. apply (internal_eq_rewrite' a b (λ b, <pers> (a b))%I); auto.
rewrite -(internal_eq_refl emp%I a). apply persistently_emp_intro. rewrite -(internal_eq_refl emp%I a). apply persistently_emp_intro.
Qed. Qed.
......
...@@ -121,16 +121,16 @@ Proof. intros P Q; apply plainly_mono. Qed. ...@@ -121,16 +121,16 @@ Proof. intros P Q; apply plainly_mono. Qed.
Lemma affinely_plainly_elim P : <affine> P P. Lemma affinely_plainly_elim P : <affine> P P.
Proof. by rewrite plainly_elim_persistently /bi_affinely persistently_and_emp_elim. Qed. Proof. by rewrite plainly_elim_persistently /bi_affinely persistently_and_emp_elim. Qed.
Lemma persistently_plainly P : <pers> P P. Lemma persistently_elim_plainly P : <pers> P P.
Proof. Proof.
apply (anti_symm _). apply (anti_symm _).
- by rewrite persistently_elim_absorbingly /bi_absorbingly comm plainly_absorb. - by rewrite persistently_into_absorbingly /bi_absorbingly comm plainly_absorb.
- by rewrite {1}plainly_idemp_2 plainly_elim_persistently. - by rewrite {1}plainly_idemp_2 plainly_elim_persistently.
Qed. Qed.
Lemma persistently_if_plainly P p : <pers>?p P P. Lemma persistently_if_elim_plainly P p : <pers>?p P P.
Proof. destruct p; last done. exact: persistently_plainly. Qed. Proof. destruct p; last done. exact: persistently_elim_plainly. Qed.
Lemma plainly_persistently P : <pers> P P. Lemma plainly_persistently_elim P : <pers> P P.
Proof. Proof.
apply (anti_symm _). apply (anti_symm _).
- rewrite -{1}(left_id True%I bi_and ( _)%I) (plainly_emp_intro True%I). - rewrite -{1}(left_id True%I bi_and ( _)%I) (plainly_emp_intro True%I).
...@@ -139,22 +139,22 @@ Proof. ...@@ -139,22 +139,22 @@ Proof.
- by rewrite {1}plainly_idemp_2 (plainly_elim_persistently P). - by rewrite {1}plainly_idemp_2 (plainly_elim_persistently P).
Qed. Qed.
Lemma absorbingly_plainly P : <absorb> P P. Lemma absorbingly_elim_plainly P : <absorb> P P.
Proof. by rewrite -(persistently_plainly P) absorbingly_persistently. Qed. Proof. by rewrite -(persistently_elim_plainly P) absorbingly_elim_persistently. Qed.
Lemma plainly_and_sep_elim P Q : P Q - (emp P) Q. Lemma plainly_and_sep_elim P Q : P Q - (emp P) Q.
Proof. by rewrite plainly_elim_persistently persistently_and_sep_elim_emp. Qed. Proof. by rewrite plainly_elim_persistently persistently_and_sep_elim_emp. Qed.
Lemma plainly_and_sep_assoc P Q R : P (Q R) ( P Q) R. Lemma plainly_and_sep_assoc P Q R : P (Q R) ( P Q) R.
Proof. by rewrite -(persistently_plainly P) persistently_and_sep_assoc. Qed. Proof. by rewrite -(persistently_elim_plainly P) persistently_and_sep_assoc. Qed.
Lemma plainly_and_emp_elim P : emp P P. Lemma plainly_and_emp_elim P : emp P P.
Proof. by rewrite plainly_elim_persistently persistently_and_emp_elim. Qed. Proof. by rewrite plainly_elim_persistently persistently_and_emp_elim. Qed.
Lemma plainly_elim_absorbingly P : P <absorb> P. Lemma plainly_into_absorbingly P : P <absorb> P.
Proof. by rewrite plainly_elim_persistently persistently_elim_absorbingly. Qed. Proof. by rewrite plainly_elim_persistently persistently_into_absorbingly. Qed.
Lemma plainly_elim P `{!Absorbing P} : P P. Lemma plainly_elim P `{!Absorbing P} : P P.
Proof. by rewrite plainly_elim_persistently persistently_elim. Qed. Proof. by rewrite plainly_elim_persistently persistently_elim. Qed.
Lemma plainly_idemp_1 P : P P. Lemma plainly_idemp_1 P : P P.
Proof. by rewrite plainly_elim_absorbingly absorbingly_plainly. Qed. Proof. by rewrite plainly_into_absorbingly absorbingly_elim_plainly. Qed.
Lemma plainly_idemp P : P P. Lemma plainly_idemp P : P P.
Proof. apply (anti_symm _); auto using plainly_idemp_1, plainly_idemp_2. Qed. Proof. apply (anti_symm _); auto using plainly_idemp_1, plainly_idemp_2. Qed.
...@@ -213,15 +213,15 @@ Proof. ...@@ -213,15 +213,15 @@ Proof.
by rewrite plainly_and_sep_assoc (comm bi_and) plainly_and_emp_elim. by rewrite plainly_and_sep_assoc (comm bi_and) plainly_and_emp_elim.
Qed. Qed.
Lemma plainly_affinely P : <affine> P P. Lemma plainly_affinely_elim P : <affine> P P.
Proof. by rewrite /bi_affinely plainly_and -plainly_True_emp plainly_pure left_id. Qed. Proof. by rewrite /bi_affinely plainly_and -plainly_True_emp plainly_pure left_id. Qed.
Lemma intuitionistically_plainly_elim P : P - P. Lemma intuitionistically_plainly_elim P : P - P.
Proof. rewrite intuitionistically_affinely plainly_elim_persistently //. Qed. Proof. rewrite intuitionistically_affinely plainly_elim_persistently //. Qed.
Lemma intuitionistically_plainly P : P - P. Lemma intuitionistically_plainly P : P - P.
Proof. Proof.
rewrite /bi_intuitionistically plainly_affinely affinely_elim. rewrite /bi_intuitionistically plainly_affinely_elim affinely_elim.
rewrite persistently_plainly plainly_persistently. done. rewrite persistently_elim_plainly plainly_persistently_elim. done.
Qed. Qed.
Lemma and_sep_plainly P Q : P Q P Q. Lemma and_sep_plainly P Q : P Q P Q.
...@@ -236,7 +236,7 @@ Proof. by rewrite -plainly_and_sep plainly_and -and_sep_plainly. Qed. ...@@ -236,7 +236,7 @@ Proof. by rewrite -plainly_and_sep plainly_and -and_sep_plainly. Qed.
Lemma plainly_sep `{BiPositive PROP} P Q : (P Q) P Q. Lemma plainly_sep `{BiPositive PROP} P Q : (P Q) P Q.
Proof. Proof.
apply (anti_symm _); auto using plainly_sep_2. apply (anti_symm _); auto using plainly_sep_2.
rewrite -(plainly_affinely (_ _)%I) affinely_sep -and_sep_plainly. apply and_intro. rewrite -(plainly_affinely_elim (_ _)%I) affinely_sep -and_sep_plainly. apply and_intro.
- by rewrite (affinely_elim_emp Q) right_id affinely_elim. - by rewrite (affinely_elim_emp Q) right_id affinely_elim.
- by rewrite (affinely_elim_emp P) left_id affinely_elim. - by rewrite (affinely_elim_emp P) left_id affinely_elim.
Qed. Qed.
...@@ -260,7 +260,7 @@ Lemma impl_wand_plainly_2 P Q : (■ P -∗ Q) ⊢ (■ P → Q). ...@@ -260,7 +260,7 @@ Lemma impl_wand_plainly_2 P Q : (■ P -∗ Q) ⊢ (■ P → Q).
Proof. apply impl_intro_l. by rewrite plainly_and_sep_l_1 wand_elim_r. Qed. Proof. apply impl_intro_l. by rewrite plainly_and_sep_l_1 wand_elim_r. Qed.
Lemma impl_wand_affinely_plainly P Q : ( P Q) (<affine> P - Q). Lemma impl_wand_affinely_plainly P Q : ( P Q) (<affine> P - Q).
Proof. by rewrite -(persistently_plainly P) impl_wand_intuitionistically. Qed. Proof. by rewrite -(persistently_elim_plainly P) impl_wand_intuitionistically. Qed.
Lemma persistently_wand_affinely_plainly P Q : Lemma persistently_wand_affinely_plainly P Q :
(<affine> P - <pers> Q) <pers> (<affine> P - Q). (<affine> P - <pers> Q) <pers> (<affine> P - Q).
...@@ -357,11 +357,11 @@ Lemma impl_persistent P Q : ...@@ -357,11 +357,11 @@ Lemma impl_persistent P Q :
Absorbing P Plain P Persistent Q Persistent (P Q). Absorbing P Plain P Persistent Q Persistent (P Q).
Proof. Proof.
intros. by rewrite /Persistent {2}(plain P) -persistently_impl_plainly intros. by rewrite /Persistent {2}(plain P) -persistently_impl_plainly
-(persistent Q) (plainly_elim_absorbingly P) absorbing. -(persistent Q) (plainly_into_absorbingly P) absorbing.
Qed. Qed.
Global Instance plainly_persistent P : Persistent ( P). Global Instance plainly_persistent P : Persistent ( P).
Proof. by rewrite /Persistent persistently_plainly. Qed. Proof. by rewrite /Persistent persistently_elim_plainly. Qed.
Global Instance wand_persistent P Q : Global Instance wand_persistent P Q :
Plain P Persistent Q Absorbing Q Persistent (P - Q). Plain P Persistent Q Absorbing Q Persistent (P - Q).
...@@ -428,7 +428,7 @@ Qed. ...@@ -428,7 +428,7 @@ Qed.
Global Instance impl_plain P Q : Absorbing P Plain P Plain Q Plain (P Q). Global Instance impl_plain P Q : Absorbing P Plain P Plain Q Plain (P Q).
Proof. Proof.
intros. by rewrite /Plain {2}(plain P) -plainly_impl_plainly -(plain Q) intros. by rewrite /Plain {2}(plain P) -plainly_impl_plainly -(plain Q)
(plainly_elim_absorbingly P) absorbing. (plainly_into_absorbingly P) absorbing.
Qed. Qed.
Global Instance wand_plain P Q : Global Instance wand_plain P Q :
Plain P Plain Q Absorbing Q Plain (P - Q). Plain P Plain Q Absorbing Q Plain (P - Q).
...@@ -445,7 +445,7 @@ Global Instance plainly_plain P : Plain (■ P). ...@@ -445,7 +445,7 @@ Global Instance plainly_plain P : Plain (■ P).
Proof. by rewrite /Plain plainly_idemp. Qed. Proof. by rewrite /Plain plainly_idemp. Qed.
Global Instance persistently_plain P : Plain P Plain (<pers> P). Global Instance persistently_plain P : Plain P Plain (<pers> P).
Proof. Proof.
rewrite /Plain=> HP. rewrite {1}HP plainly_persistently persistently_plainly //. rewrite /Plain=> HP. rewrite {1}HP plainly_persistently_elim persistently_elim_plainly //.
Qed. Qed.
Global Instance affinely_plain P : Plain P Plain (<affine> P). Global Instance affinely_plain P : Plain P Plain (<affine> P).
Proof. rewrite /bi_affinely. apply _. Qed. Proof. rewrite /bi_affinely. apply _. Qed.
...@@ -468,7 +468,7 @@ Qed. ...@@ -468,7 +468,7 @@ Qed.
Lemma plainly_alt P : P <affine> P emp. Lemma plainly_alt P : P <affine> P emp.
Proof. Proof.
rewrite -plainly_affinely. apply (anti_symm ()). rewrite -plainly_affinely_elim. apply (anti_symm ()).
- rewrite -prop_ext. apply plainly_mono, and_intro; apply wand_intro_l. - rewrite -prop_ext. apply plainly_mono, and_intro; apply wand_intro_l.
+ by rewrite affinely_elim_emp left_id. + by rewrite affinely_elim_emp left_id.
+ by rewrite left_id. + by rewrite left_id.
......
...@@ -64,13 +64,13 @@ Global Instance from_assumption_persistently_l_true P Q : ...@@ -64,13 +64,13 @@ Global Instance from_assumption_persistently_l_true P Q :
FromAssumption true P Q KnownLFromAssumption true (<pers> P) Q. FromAssumption true P Q KnownLFromAssumption true (<pers> P) Q.
Proof. Proof.
rewrite /KnownLFromAssumption /FromAssumption /= =><-. rewrite /KnownLFromAssumption /FromAssumption /= =><-.
rewrite intuitionistically_persistently_persistently //. rewrite intuitionistically_persistently_elim //.
Qed. Qed.
Global Instance from_assumption_persistently_l_false `{BiAffine PROP} P Q : Global Instance from_assumption_persistently_l_false `{BiAffine PROP} P Q :
FromAssumption true P Q KnownLFromAssumption false (<pers> P) Q. FromAssumption true P Q KnownLFromAssumption false (<pers> P) Q.
Proof. Proof.
rewrite /KnownLFromAssumption /FromAssumption /= =><-. rewrite /KnownLFromAssumption /FromAssumption /= =><-.
by rewrite intuitionistically_persistently. by rewrite intuitionistically_into_persistently.
Qed. Qed.
Global Instance from_assumption_affinely_l_true p P Q : Global Instance from_assumption_affinely_l_true p P Q :
FromAssumption p P Q KnownLFromAssumption p (<affine> P) Q. FromAssumption p P Q KnownLFromAssumption p (<affine> P) Q.
...@@ -195,7 +195,7 @@ Global Instance from_pure_persistently P a φ : ...@@ -195,7 +195,7 @@ Global Instance from_pure_persistently P a φ :
FromPure true P φ FromPure a (<pers> P) φ. FromPure true P φ FromPure a (<pers> P) φ.
Proof. Proof.
rewrite /FromPure=> <- /=. rewrite /FromPure=> <- /=.
by rewrite persistently_affinely affinely_if_elim persistently_pure. by rewrite persistently_affinely_elim affinely_if_elim persistently_pure.
Qed. Qed.
Global Instance from_pure_affinely_true P φ : Global Instance from_pure_affinely_true P φ :
FromPure true P φ FromPure true (<affine> P) φ. FromPure true P φ FromPure true (<affine> P) φ.
...@@ -206,7 +206,7 @@ Proof. rewrite /FromPure /= affine_affinely //. Qed. ...@@ -206,7 +206,7 @@ Proof. rewrite /FromPure /= affine_affinely //. Qed.
Global Instance from_pure_intuitionistically_true P φ : Global Instance from_pure_intuitionistically_true P φ :
FromPure true P φ FromPure true ( P) φ. FromPure true P φ FromPure true ( P) φ.
Proof. Proof.
rewrite /FromPure=><- /=. rewrite intuitionistically_affinely_affinely. rewrite /FromPure=><- /=. rewrite intuitionistically_affinely_elim.
rewrite {1}(persistent ⌜φ⌝%I) //. rewrite {1}(persistent ⌜φ⌝%I) //.
Qed. Qed.
...@@ -233,7 +233,7 @@ Proof. ...@@ -233,7 +233,7 @@ Proof.
rewrite /IntoPersistent /= =><-. rewrite /IntoPersistent /= =><-.
destruct p; simpl; destruct p; simpl;
eauto using persistently_mono, intuitionistically_elim, eauto using persistently_mono, intuitionistically_elim,
intuitionistically_persistently_1. intuitionistically_into_persistently_1.
Qed. Qed.
Global Instance into_persistent_embed `{BiEmbed PROP PROP'} p P Q : Global Instance into_persistent_embed `{BiEmbed PROP PROP'} p P Q :
IntoPersistent p P Q IntoPersistent p P Q | 0. IntoPersistent p P Q IntoPersistent p P Q | 0.
...@@ -259,7 +259,9 @@ Global Instance from_modal_intuitionistically P : ...@@ -259,7 +259,9 @@ Global Instance from_modal_intuitionistically P :
Proof. by rewrite /FromModal. Qed. Proof. by rewrite /FromModal. Qed.
Global Instance from_modal_intuitionistically_affine_bi P : Global Instance from_modal_intuitionistically_affine_bi P :
BiAffine PROP FromModal modality_persistently ( P) ( P) P | 0. BiAffine PROP FromModal modality_persistently ( P) ( P) P | 0.
Proof. intros. by rewrite /FromModal /= intuitionistically_persistently. Qed. Proof.
intros. by rewrite /FromModal /= intuitionistically_into_persistently.
Qed.
Global Instance from_modal_absorbingly P : Global Instance from_modal_absorbingly P :
FromModal modality_id (<absorb> P) (<absorb> P) P. FromModal modality_id (<absorb> P) (<absorb> P) P.
...@@ -356,7 +358,7 @@ Global Instance into_wand_intuitionistically p q R P Q : ...@@ -356,7 +358,7 @@ Global Instance into_wand_intuitionistically p q R P Q :
Proof. by rewrite /IntoWand intuitionistically_elim. Qed. Proof. by rewrite /IntoWand intuitionistically_elim. Qed.
Global Instance into_wand_persistently_true q R P Q : Global Instance into_wand_persistently_true q R P Q :
IntoWand true q R P Q IntoWand true q (<pers> R) P Q. IntoWand true q R P Q IntoWand true q (<pers> R) P Q.
Proof. by rewrite /IntoWand /= intuitionistically_persistently_persistently. Qed. Proof. by rewrite /IntoWand /= intuitionistically_persistently_elim. Qed.
Global Instance into_wand_persistently_false q R P Q :