Skip to content
Snippets Groups Projects
Commit e72da74c authored by Ralf Jung's avatar Ralf Jung
Browse files

apply review and fix and improve proof

parent 6fa72b41
No related branches found
No related tags found
No related merge requests found
...@@ -73,14 +73,16 @@ Section lemmas. ...@@ -73,14 +73,16 @@ Section lemmas.
(q1 + q2 = 1)%Qp (q1 + q2 = 1)%Qp
ghost_var γ q1 a1 -∗ ghost_var γ q2 a2 ==∗ ghost_var γ q1 b ghost_var γ q2 b. ghost_var γ q1 a1 -∗ ghost_var γ q2 a2 ==∗ ghost_var γ q1 b ghost_var γ q2 b.
Proof. Proof.
iIntros (Hq) "[H1 H2]". iIntros (Hq) "H1 H2".
iDestruct (ghost_var_valid_2 with "H1 H2") as %[_ ->]. iDestruct (ghost_var_valid_2 with "H1 H2") as %[_ ->].
iCombine "H1 H2" as "H". rewrite -frac_agree_op Hq. iDestruct (fractional_merge with "H1 H2") as "H". simpl. rewrite Hq.
iMod (ghost_var_update with "H") as "H". iMod (ghost_var_update with "H") as "H".
rewrite -Hq. iApply ghost_var_split. done. rewrite -Hq. iApply ghost_var_split. done.
Qed. Qed.
Lemma ghost_var_update_halves b γ a1 a2 : Lemma ghost_var_update_halves b γ a1 a2 :
ghost_var γ (1/2) a1 -∗ ghost_var γ (1/2) a2 ==∗ ghost_var γ (1/2) b ghost_var γ (1/2) b. ghost_var γ (1/2) a1 -∗
ghost_var γ (1/2) a2 ==∗
ghost_var γ (1/2) b ghost_var γ (1/2) b.
Proof. iApply ghost_var_update_2. apply Qp_half_half. Qed. Proof. iApply ghost_var_update_2. apply Qp_half_half. Qed.
End lemmas. End lemmas.
......
...@@ -38,6 +38,11 @@ Section fractional. ...@@ -38,6 +38,11 @@ Section fractional.
P1 -∗ P2 -∗ P. P1 -∗ P2 -∗ P.
Proof. intros. apply bi.wand_intro_r. by rewrite -(fractional_split P). Qed. Proof. intros. apply bi.wand_intro_r. by rewrite -(fractional_split P). Qed.
Lemma fractional_merge P1 P2 Φ q1 q2 `{!Fractional Φ} :
AsFractional P1 Φ q1 AsFractional P2 Φ q2
P1 -∗ P2 -∗ Φ (q1 + q2)%Qp.
Proof. move=>-[-> _] [-> _]. rewrite fractional. apply bi.wand_intro_r. done. Qed.
Lemma fractional_half P P12 Φ q : Lemma fractional_half P P12 Φ q :
AsFractional P Φ q AsFractional P12 Φ (q/2) AsFractional P Φ q AsFractional P12 Φ (q/2)
P ⊣⊢ P12 P12. P ⊣⊢ P12 P12.
......
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