Skip to content
Snippets Groups Projects
Commit b20fd842 authored by Robbert Krebbers's avatar Robbert Krebbers
Browse files

Only one direction of assoc and comm for separating conjunction is needed.

parent 467c44e4
No related branches found
No related tags found
No related merge requests found
...@@ -821,26 +821,25 @@ Proof. ...@@ -821,26 +821,25 @@ Proof.
split; intros n' x ? (x1&x2&?&?&?); exists x1,x2; cofe_subst x; split; intros n' x ? (x1&x2&?&?&?); exists x1,x2; cofe_subst x;
eauto 7 using cmra_validN_op_l, cmra_validN_op_r, uPred_in_entails. eauto 7 using cmra_validN_op_l, cmra_validN_op_r, uPred_in_entails.
Qed. Qed.
Global Instance True_sep : LeftId (⊣⊢) True%I (@uPred_sep M). Lemma True_sep_1 P : P True P.
Proof. Proof.
intros P; unseal; split=> n x Hvalid; split. unseal; split; intros n x ??. exists (core x), x. by rewrite cmra_core_l.
- intros (x1&x2&?&_&?); cofe_subst; eauto using uPred_mono, cmra_includedN_r.
- by intros ?; exists (core x), x; rewrite cmra_core_l.
Qed. Qed.
Global Instance sep_comm : Comm (⊣⊢) (@uPred_sep M). Lemma True_sep_2 P : True P P.
Proof. Proof.
by intros P Q; unseal; split=> n x ?; split; unseal; split; intros n x ? (x1&x2&?&_&?); cofe_subst;
intros (x1&x2&?&?&?); exists x2, x1; rewrite (comm op). eauto using uPred_mono, cmra_includedN_r.
Qed. Qed.
Global Instance sep_assoc : Assoc (⊣⊢) (@uPred_sep M). Lemma sep_comm' P Q : P Q Q P.
Proof.
unseal; split; intros n x ? (x1&x2&?&?&?); exists x2, x1; by rewrite (comm op).
Qed.
Lemma sep_assoc' P Q R : (P Q) R P (Q R).
Proof. Proof.
intros P Q R; unseal; split=> n x ?; split. unseal; split; intros n x ? (x1&x2&Hx&(y1&y2&Hy&?&?)&?).
- intros (x1&x2&Hx&?&y1&y2&Hy&?&?); exists (x1 y1), y2; split_and?; auto. exists y1, (y2 x2); split_and?; auto.
+ by rewrite -(assoc op) -Hy -Hx. + by rewrite (assoc op) -Hy -Hx.
+ by exists x1, y1. + by exists y2, x2.
- intros (x1&x2&Hx&(y1&y2&Hy&?&?)&?); exists y1, (y2 x2); split_and?; auto.
+ by rewrite (assoc op) -Hy -Hx.
+ by exists y2, x2.
Qed. Qed.
Lemma wand_intro_r P Q R : (P Q R) P Q -★ R. Lemma wand_intro_r P Q R : (P Q R) P Q -★ R.
Proof. Proof.
...@@ -872,6 +871,15 @@ Qed. ...@@ -872,6 +871,15 @@ Qed.
Global Instance wand_mono' : Proper (flip () ==> () ==> ()) (@uPred_wand M). Global Instance wand_mono' : Proper (flip () ==> () ==> ()) (@uPred_wand M).
Proof. by intros P P' HP Q Q' HQ; apply wand_mono. Qed. Proof. by intros P P' HP Q Q' HQ; apply wand_mono. Qed.
Global Instance sep_comm : Comm (⊣⊢) (@uPred_sep M).
Proof. intros P Q; apply (anti_symm _); auto using sep_comm'. Qed.
Global Instance sep_assoc : Assoc (⊣⊢) (@uPred_sep M).
Proof.
intros P Q R; apply (anti_symm _); auto using sep_assoc'.
by rewrite !(comm _ P) !(comm _ _ R) sep_assoc'.
Qed.
Global Instance True_sep : LeftId (⊣⊢) True%I (@uPred_sep M).
Proof. intros P; apply (anti_symm _); auto using True_sep_1, True_sep_2. Qed.
Global Instance sep_True : RightId (⊣⊢) True%I (@uPred_sep M). Global Instance sep_True : RightId (⊣⊢) True%I (@uPred_sep M).
Proof. by intros P; rewrite comm left_id. Qed. Proof. by intros P; rewrite comm left_id. Qed.
Lemma sep_elim_l P Q : P Q P. Lemma sep_elim_l P Q : P Q P.
......
...@@ -289,8 +289,8 @@ Furthermore, we have the usual $\eta$ and $\beta$ laws for projections, $\lambda ...@@ -289,8 +289,8 @@ Furthermore, we have the usual $\eta$ and $\beta$ laws for projections, $\lambda
\begin{mathpar} \begin{mathpar}
\begin{array}{rMcMl} \begin{array}{rMcMl}
\TRUE * \prop &\provesIff& \prop \\ \TRUE * \prop &\provesIff& \prop \\
\prop * \propB &\provesIff& \propB * \prop \\ \prop * \propB &\proves& \propB * \prop \\
(\prop * \propB) * \propC &\provesIff& \prop * (\propB * \propC) (\prop * \propB) * \propC &\proves& \prop * (\propB * \propC)
\end{array} \end{array}
\and \and
\infer[$*$-mono] \infer[$*$-mono]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment