Commit 65ab1289 authored by Robbert Krebbers's avatar Robbert Krebbers
Browse files

Rename simplify_equality like tactics.

simplify_equality        => simplify_eq
simplify_equality'       => simplify_eq/=
simplify_map_equality    => simplify_map_eq
simplify_map_equality'   => simplify_map_eq/=
simplify_option_equality => simplify_option_eq
simplify_list_equality   => simplify_list_eq
f_equal'                 => f_equal/=

The /= suffixes (meaning: do simpl) are inspired by ssreflect.
parent 8e636f20
...@@ -54,7 +54,7 @@ Global Instance auth_timeless (x : auth A) : ...@@ -54,7 +54,7 @@ Global Instance auth_timeless (x : auth A) :
Timeless (authoritative x) Timeless (own x) Timeless x. Timeless (authoritative x) Timeless (own x) Timeless x.
Proof. by intros ?? [??] [??]; split; simpl in *; apply (timeless _). Qed. Proof. by intros ?? [??] [??]; split; simpl in *; apply (timeless _). Qed.
Global Instance auth_leibniz : LeibnizEquiv A LeibnizEquiv (auth A). Global Instance auth_leibniz : LeibnizEquiv A LeibnizEquiv (auth A).
Proof. by intros ? [??] [??] [??]; f_equal'; apply leibniz_equiv. Qed. Proof. by intros ? [??] [??] [??]; f_equal/=; apply leibniz_equiv. Qed.
End cofe. End cofe.
Arguments authC : clear implicits. Arguments authC : clear implicits.
......
...@@ -29,13 +29,13 @@ Hint Extern 0 (_ ≡{_}≡ _) => symmetry; assumption. ...@@ -29,13 +29,13 @@ Hint Extern 0 (_ ≡{_}≡ _) => symmetry; assumption.
Tactic Notation "cofe_subst" ident(x) := Tactic Notation "cofe_subst" ident(x) :=
repeat match goal with repeat match goal with
| _ => progress simplify_equality' | _ => progress simplify_eq/=
| H:@dist ?A ?d ?n x _ |- _ => setoid_subst_aux (@dist A d n) x | H:@dist ?A ?d ?n x _ |- _ => setoid_subst_aux (@dist A d n) x
| H:@dist ?A ?d ?n _ x |- _ => symmetry in H;setoid_subst_aux (@dist A d n) x | H:@dist ?A ?d ?n _ x |- _ => symmetry in H;setoid_subst_aux (@dist A d n) x
end. end.
Tactic Notation "cofe_subst" := Tactic Notation "cofe_subst" :=
repeat match goal with repeat match goal with
| _ => progress simplify_equality' | _ => progress simplify_eq/=
| H:@dist ?A ?d ?n ?x _ |- _ => setoid_subst_aux (@dist A d n) x | H:@dist ?A ?d ?n ?x _ |- _ => setoid_subst_aux (@dist A d n) x
| H:@dist ?A ?d ?n _ ?x |- _ => symmetry in H;setoid_subst_aux (@dist A d n) x | H:@dist ?A ?d ?n _ ?x |- _ => symmetry in H;setoid_subst_aux (@dist A d n) x
end. end.
......
...@@ -115,15 +115,15 @@ Proof. by assert (k = j) by lia; subst; rewrite !coerce_id. Qed. ...@@ -115,15 +115,15 @@ Proof. by assert (k = j) by lia; subst; rewrite !coerce_id. Qed.
Lemma gg_gg {k i i1 i2 j} (H1 : k = i + j) (H2 : k = i2 + (i1 + j)) (x : A k) : Lemma gg_gg {k i i1 i2 j} (H1 : k = i + j) (H2 : k = i2 + (i1 + j)) (x : A k) :
gg i (coerce H1 x) = gg i1 (gg i2 (coerce H2 x)). gg i (coerce H1 x) = gg i1 (gg i2 (coerce H2 x)).
Proof. Proof.
assert (i = i2 + i1) by lia; simplify_equality'. revert j x H1. assert (i = i2 + i1) by lia; simplify_eq/=. revert j x H1.
induction i2 as [|i2 IH]; intros j X H1; simplify_equality'; induction i2 as [|i2 IH]; intros j X H1; simplify_eq/=;
[by rewrite coerce_id|by rewrite g_coerce IH]. [by rewrite coerce_id|by rewrite g_coerce IH].
Qed. Qed.
Lemma ff_ff {k i i1 i2 j} (H1 : i + k = j) (H2 : i1 + (i2 + k) = j) (x : A k) : Lemma ff_ff {k i i1 i2 j} (H1 : i + k = j) (H2 : i1 + (i2 + k) = j) (x : A k) :
coerce H1 (ff i x) = coerce H2 (ff i1 (ff i2 x)). coerce H1 (ff i x) = coerce H2 (ff i1 (ff i2 x)).
Proof. Proof.
assert (i = i1 + i2) by lia; simplify_equality'. assert (i = i1 + i2) by lia; simplify_eq/=.
induction i1 as [|i1 IH]; simplify_equality'; induction i1 as [|i1 IH]; simplify_eq/=;
[by rewrite coerce_id|by rewrite coerce_f IH]. [by rewrite coerce_id|by rewrite coerce_f IH].
Qed. Qed.
...@@ -159,7 +159,7 @@ Proof. ...@@ -159,7 +159,7 @@ Proof.
- assert (H : S k = S (k - i) + (0 + i)) by lia; rewrite (gg_gg _ H) /=. - assert (H : S k = S (k - i) + (0 + i)) by lia; rewrite (gg_gg _ H) /=.
by erewrite g_coerce, gf, coerce_proper by done. by erewrite g_coerce, gf, coerce_proper by done.
- assert (S k = 0 + (0 + i)) as H by lia. - assert (S k = 0 + (0 + i)) as H by lia.
rewrite (gg_gg _ H); simplify_equality'. rewrite (gg_gg _ H); simplify_eq/=.
by rewrite (ff_ff _ (eq_refl (1 + (0 + k)))). by rewrite (ff_ff _ (eq_refl (1 + (0 + k)))).
- exfalso; lia. - exfalso; lia.
- assert (H : (i - S k) + (1 + k) = i) by lia; rewrite (ff_ff _ H) /=. - assert (H : (i - S k) + (1 + k) = i) by lia; rewrite (ff_ff _ H) /=.
......
...@@ -40,7 +40,7 @@ Program Definition excl_chain ...@@ -40,7 +40,7 @@ Program Definition excl_chain
{| chain_car n := match c n return _ with Excl y => y | _ => x end |}. {| chain_car n := match c n return _ with Excl y => y | _ => x end |}.
Next Obligation. Next Obligation.
intros c x ? n [|i] ?; [omega|]; simpl. intros c x ? n [|i] ?; [omega|]; simpl.
destruct (c 1) eqn:?; simplify_equality'. destruct (c 1) eqn:?; simplify_eq/=.
by feed inversion (chain_cauchy c n (S i)). by feed inversion (chain_cauchy c n (S i)).
Qed. Qed.
Instance excl_compl : Compl (excl A) := λ c, Instance excl_compl : Compl (excl A) := λ c,
...@@ -60,13 +60,13 @@ Proof. ...@@ -60,13 +60,13 @@ Proof.
- by inversion_clear 1; constructor; apply dist_S. - by inversion_clear 1; constructor; apply dist_S.
- intros c n; unfold compl, excl_compl. - intros c n; unfold compl, excl_compl.
destruct (Some_dec (maybe Excl (c 1))) as [[x Hx]|]. destruct (Some_dec (maybe Excl (c 1))) as [[x Hx]|].
{ assert (c 1 = Excl x) by (by destruct (c 1); simplify_equality'). { assert (c 1 = Excl x) by (by destruct (c 1); simplify_eq/=).
assert ( y, c (S n) = Excl y) as [y Hy]. assert ( y, c (S n) = Excl y) as [y Hy].
{ feed inversion (chain_cauchy c 0 (S n)); eauto with lia congruence. } { feed inversion (chain_cauchy c 0 (S n)); eauto with lia congruence. }
rewrite Hy; constructor. rewrite Hy; constructor.
by rewrite (conv_compl (excl_chain c x Hx) n) /= Hy. } by rewrite (conv_compl (excl_chain c x Hx) n) /= Hy. }
feed inversion (chain_cauchy c 0 (S n)); first lia; feed inversion (chain_cauchy c 0 (S n)); first lia;
constructor; destruct (c 1); simplify_equality'. constructor; destruct (c 1); simplify_eq/=.
Qed. Qed.
Canonical Structure exclC : cofeT := CofeT excl_cofe_mixin. Canonical Structure exclC : cofeT := CofeT excl_cofe_mixin.
......
...@@ -43,12 +43,12 @@ Global Instance alter_ne f k n : ...@@ -43,12 +43,12 @@ Global Instance alter_ne f k n :
Proper (dist n ==> dist n) f Proper (dist n ==> dist n) (alter f k). Proper (dist n ==> dist n) f Proper (dist n ==> dist n) (alter f k).
Proof. Proof.
intros ? m m' Hm k'. intros ? m m' Hm k'.
by destruct (decide (k = k')); simplify_map_equality; rewrite (Hm k'). by destruct (decide (k = k')); simplify_map_eq; rewrite (Hm k').
Qed. Qed.
Global Instance insert_ne i n : Global Instance insert_ne i n :
Proper (dist n ==> dist n ==> dist n) (insert (M:=gmap K A) i). Proper (dist n ==> dist n ==> dist n) (insert (M:=gmap K A) i).
Proof. Proof.
intros x y ? m m' ? j; destruct (decide (i = j)); simplify_map_equality; intros x y ? m m' ? j; destruct (decide (i = j)); simplify_map_eq;
[by constructor|by apply lookup_ne]. [by constructor|by apply lookup_ne].
Qed. Qed.
Global Instance singleton_ne i n : Global Instance singleton_ne i n :
...@@ -57,7 +57,7 @@ Proof. by intros ???; apply insert_ne. Qed. ...@@ -57,7 +57,7 @@ Proof. by intros ???; apply insert_ne. Qed.
Global Instance delete_ne i n : Global Instance delete_ne i n :
Proper (dist n ==> dist n) (delete (M:=gmap K A) i). Proper (dist n ==> dist n) (delete (M:=gmap K A) i).
Proof. Proof.
intros m m' ? j; destruct (decide (i = j)); simplify_map_equality; intros m m' ? j; destruct (decide (i = j)); simplify_map_eq;
[by constructor|by apply lookup_ne]. [by constructor|by apply lookup_ne].
Qed. Qed.
...@@ -79,7 +79,7 @@ Qed. ...@@ -79,7 +79,7 @@ Qed.
Global Instance map_insert_timeless m i x : Global Instance map_insert_timeless m i x :
Timeless x Timeless m Timeless (<[i:=x]>m). Timeless x Timeless m Timeless (<[i:=x]>m).
Proof. Proof.
intros ?? m' Hm j; destruct (decide (i = j)); simplify_map_equality. intros ?? m' Hm j; destruct (decide (i = j)); simplify_map_eq.
{ by apply (timeless _); rewrite -Hm lookup_insert. } { by apply (timeless _); rewrite -Hm lookup_insert. }
by apply (timeless _); rewrite -Hm lookup_insert_ne. by apply (timeless _); rewrite -Hm lookup_insert_ne.
Qed. Qed.
...@@ -193,13 +193,13 @@ Proof. by move=> /(_ i) Hm Hi; move:Hm; rewrite Hi. Qed. ...@@ -193,13 +193,13 @@ Proof. by move=> /(_ i) Hm Hi; move:Hm; rewrite Hi. Qed.
Lemma map_lookup_valid m i x : m m !! i Some x x. Lemma map_lookup_valid m i x : m m !! i Some x x.
Proof. move=>Hm Hi n. move:(Hm n i). by rewrite Hi. Qed. Proof. move=>Hm Hi n. move:(Hm n i). by rewrite Hi. Qed.
Lemma map_insert_validN n m i x : {n} x {n} m {n} <[i:=x]>m. Lemma map_insert_validN n m i x : {n} x {n} m {n} <[i:=x]>m.
Proof. by intros ?? j; destruct (decide (i = j)); simplify_map_equality. Qed. Proof. by intros ?? j; destruct (decide (i = j)); simplify_map_eq. Qed.
Lemma map_insert_valid m i x : x m <[i:=x]>m. Lemma map_insert_valid m i x : x m <[i:=x]>m.
Proof. intros ?? n j; apply map_insert_validN; auto. Qed. Proof. intros ?? n j; apply map_insert_validN; auto. Qed.
Lemma map_singleton_validN n i x : {n} ({[ i := x ]} : gmap K A) {n} x. Lemma map_singleton_validN n i x : {n} ({[ i := x ]} : gmap K A) {n} x.
Proof. Proof.
split; [|by intros; apply map_insert_validN, cmra_empty_valid]. split; [|by intros; apply map_insert_validN, cmra_empty_valid].
by move=>/(_ i); simplify_map_equality. by move=>/(_ i); simplify_map_eq.
Qed. Qed.
Lemma map_singleton_valid i x : ({[ i := x ]} : gmap K A) x. Lemma map_singleton_valid i x : ({[ i := x ]} : gmap K A) x.
Proof. split; intros ? n; eapply map_singleton_validN; eauto. Qed. Proof. split; intros ? n; eapply map_singleton_validN; eauto. Qed.
...@@ -234,7 +234,7 @@ Proof. ...@@ -234,7 +234,7 @@ Proof.
destruct (m' !! i) as [y|]; destruct (m' !! i) as [y|];
[exists (x y)|exists x]; eauto using cmra_included_l. [exists (x y)|exists x]; eauto using cmra_included_l.
- intros (y&Hi&?); rewrite map_includedN_spec=>j. - intros (y&Hi&?); rewrite map_includedN_spec=>j.
destruct (decide (i = j)); simplify_map_equality. destruct (decide (i = j)); simplify_map_eq.
+ by rewrite Hi; apply Some_Some_includedN, cmra_included_includedN. + by rewrite Hi; apply Some_Some_includedN, cmra_included_includedN.
+ apply None_includedN. + apply None_includedN.
Qed. Qed.
...@@ -250,10 +250,10 @@ Lemma map_insert_updateP (P : A → Prop) (Q : gmap K A → Prop) m i x : ...@@ -250,10 +250,10 @@ Lemma map_insert_updateP (P : A → Prop) (Q : gmap K A → Prop) m i x :
Proof. Proof.
intros Hx%option_updateP' HP mf n Hm. intros Hx%option_updateP' HP mf n Hm.
destruct (Hx (mf !! i) n) as ([y|]&?&?); try done. destruct (Hx (mf !! i) n) as ([y|]&?&?); try done.
{ by generalize (Hm i); rewrite lookup_op; simplify_map_equality. } { by generalize (Hm i); rewrite lookup_op; simplify_map_eq. }
exists (<[i:=y]> m); split; first by auto. exists (<[i:=y]> m); split; first by auto.
intros j; move: (Hm j)=>{Hm}; rewrite !lookup_op=>Hm. intros j; move: (Hm j)=>{Hm}; rewrite !lookup_op=>Hm.
destruct (decide (i = j)); simplify_map_equality'; auto. destruct (decide (i = j)); simplify_map_eq/=; auto.
Qed. Qed.
Lemma map_insert_updateP' (P : A Prop) m i x : Lemma map_insert_updateP' (P : A Prop) m i x :
x ~~>: P <[i:=x]>m ~~>: λ m', y, m' = <[i:=y]>m P y. x ~~>: P <[i:=x]>m ~~>: λ m', y, m' = <[i:=y]>m P y.
......
...@@ -13,7 +13,7 @@ Program Definition option_chain ...@@ -13,7 +13,7 @@ Program Definition option_chain
{| chain_car n := from_option x (c n) |}. {| chain_car n := from_option x (c n) |}.
Next Obligation. Next Obligation.
intros c x ? n [|i] ?; [omega|]; simpl. intros c x ? n [|i] ?; [omega|]; simpl.
destruct (c 1) eqn:?; simplify_equality'. destruct (c 1) eqn:?; simplify_eq/=.
by feed inversion (chain_cauchy c n (S i)). by feed inversion (chain_cauchy c n (S i)).
Qed. Qed.
Instance option_compl : Compl (option A) := λ c, Instance option_compl : Compl (option A) := λ c,
......
...@@ -355,7 +355,7 @@ Lemma sts_update_frag S1 S2 T : ...@@ -355,7 +355,7 @@ Lemma sts_update_frag S1 S2 T :
closed S2 T S1 S2 sts_frag S1 T ~~> sts_frag S2 T. closed S2 T S1 S2 sts_frag S1 T ~~> sts_frag S2 T.
Proof. Proof.
rewrite /sts_frag=> HS Hcl. apply validity_update. rewrite /sts_frag=> HS Hcl. apply validity_update.
inversion 3 as [|? S ? Tf|]; simplify_equality'. inversion 3 as [|? S ? Tf|]; simplify_eq/=.
- split; first done. constructor; [solve_elem_of|done]. - split; first done. constructor; [solve_elem_of|done].
- split; first done. constructor; solve_elem_of. - split; first done. constructor; solve_elem_of.
Qed. Qed.
......
...@@ -239,18 +239,18 @@ Inductive prim_step ...@@ -239,18 +239,18 @@ Inductive prim_step
(** Basic properties about the language *) (** Basic properties about the language *)
Lemma to_of_val v : to_val (of_val v) = Some v. Lemma to_of_val v : to_val (of_val v) = Some v.
Proof. by induction v; simplify_option_equality. Qed. Proof. by induction v; simplify_option_eq. Qed.
Lemma of_to_val e v : to_val e = Some v of_val v = e. Lemma of_to_val e v : to_val e = Some v of_val v = e.
Proof. Proof.
revert v; induction e; intros; simplify_option_equality; auto with f_equal. revert v; induction e; intros; simplify_option_eq; auto with f_equal.
Qed. Qed.
Instance: Inj (=) (=) of_val. Instance: Inj (=) (=) of_val.
Proof. by intros ?? Hv; apply (inj Some); rewrite -!to_of_val Hv. Qed. Proof. by intros ?? Hv; apply (inj Some); rewrite -!to_of_val Hv. Qed.
Instance fill_item_inj Ki : Inj (=) (=) (fill_item Ki). Instance fill_item_inj Ki : Inj (=) (=) (fill_item Ki).
Proof. destruct Ki; intros ???; simplify_equality'; auto with f_equal. Qed. Proof. destruct Ki; intros ???; simplify_eq/=; auto with f_equal. Qed.
Instance ectx_fill_inj K : Inj (=) (=) (fill K). Instance ectx_fill_inj K : Inj (=) (=) (fill K).
Proof. red; induction K as [|Ki K IH]; naive_solver. Qed. Proof. red; induction K as [|Ki K IH]; naive_solver. Qed.
...@@ -261,7 +261,7 @@ Proof. revert e; induction K1; simpl; auto with f_equal. Qed. ...@@ -261,7 +261,7 @@ Proof. revert e; induction K1; simpl; auto with f_equal. Qed.
Lemma fill_val K e : is_Some (to_val (fill K e)) is_Some (to_val e). Lemma fill_val K e : is_Some (to_val (fill K e)) is_Some (to_val e).
Proof. Proof.
intros [v' Hv']; revert v' Hv'. intros [v' Hv']; revert v' Hv'.
induction K as [|[]]; intros; simplify_option_equality; eauto. induction K as [|[]]; intros; simplify_option_eq; eauto.
Qed. Qed.
Lemma fill_not_val K e : to_val e = None to_val (fill K e) = None. Lemma fill_not_val K e : to_val e = None to_val (fill K e) = None.
...@@ -297,13 +297,13 @@ Qed. ...@@ -297,13 +297,13 @@ Qed.
Lemma head_ctx_step_val Ki e σ1 e2 σ2 ef : Lemma head_ctx_step_val Ki e σ1 e2 σ2 ef :
head_step (fill_item Ki e) σ1 e2 σ2 ef is_Some (to_val e). head_step (fill_item Ki e) σ1 e2 σ2 ef is_Some (to_val e).
Proof. destruct Ki; inversion_clear 1; simplify_option_equality; eauto. Qed. Proof. destruct Ki; inversion_clear 1; simplify_option_eq; eauto. Qed.
Lemma fill_item_no_val_inj Ki1 Ki2 e1 e2 : Lemma fill_item_no_val_inj Ki1 Ki2 e1 e2 :
to_val e1 = None to_val e2 = None to_val e1 = None to_val e2 = None
fill_item Ki1 e1 = fill_item Ki2 e2 Ki1 = Ki2. fill_item Ki1 e1 = fill_item Ki2 e2 Ki1 = Ki2.
Proof. Proof.
destruct Ki1, Ki2; intros; try discriminate; simplify_equality'; destruct Ki1, Ki2; intros; try discriminate; simplify_eq/=;
repeat match goal with repeat match goal with
| H : to_val (of_val _) = None |- _ => by rewrite to_of_val in H | H : to_val (of_val _) = None |- _ => by rewrite to_of_val in H
end; auto. end; auto.
...@@ -318,7 +318,7 @@ Lemma step_by_val K K' e1 e1' σ1 e2 σ2 ef : ...@@ -318,7 +318,7 @@ Lemma step_by_val K K' e1 e1' σ1 e2 σ2 ef :
Proof. Proof.
intros Hfill Hred Hnval; revert K' Hfill. intros Hfill Hred Hnval; revert K' Hfill.
induction K as [|Ki K IH]; simpl; intros K' Hfill; auto using prefix_of_nil. induction K as [|Ki K IH]; simpl; intros K' Hfill; auto using prefix_of_nil.
destruct K' as [|Ki' K']; simplify_equality'. destruct K' as [|Ki' K']; simplify_eq/=.
{ exfalso; apply (eq_None_not_Some (to_val (fill K e1))); { exfalso; apply (eq_None_not_Some (to_val (fill K e1)));
eauto using fill_not_val, head_ctx_step_val. } eauto using fill_not_val, head_ctx_step_val. }
cut (Ki = Ki'); [naive_solver eauto using prefix_of_cons|]. cut (Ki = Ki'); [naive_solver eauto using prefix_of_cons|].
......
...@@ -102,14 +102,14 @@ Arguments of_val : simpl never. ...@@ -102,14 +102,14 @@ Arguments of_val : simpl never.
Lemma gsubst_None e x v : gsubst_go e x (of_val v) = None e = subst e x v. Lemma gsubst_None e x v : gsubst_go e x (of_val v) = None e = subst e x v.
Proof. Proof.
induction e; simpl; unfold gsubst_lift; intros; induction e; simpl; unfold gsubst_lift; intros;
repeat (simplify_option_equality || case_match); f_equal; auto. repeat (simplify_option_eq || case_match); f_equal; auto.
Qed. Qed.
Lemma gsubst_correct e x v : gsubst e x (of_val v) = subst e x v. Lemma gsubst_correct e x v : gsubst e x (of_val v) = subst e x v.
Proof. Proof.
unfold gsubst; destruct (gsubst_go e x (of_val v)) as [e'|] eqn:He; simpl; unfold gsubst; destruct (gsubst_go e x (of_val v)) as [e'|] eqn:He; simpl;
last by apply gsubst_None. last by apply gsubst_None.
revert e' He; induction e; simpl; unfold gsubst_lift; intros; revert e' He; induction e; simpl; unfold gsubst_lift; intros;
repeat (simplify_option_equality || case_match); repeat (simplify_option_eq || case_match);
f_equal; auto using gsubst_None. f_equal; auto using gsubst_None.
Qed. Qed.
......
...@@ -10,7 +10,7 @@ to conversions from and to values, and finite map operations. This tactic is ...@@ -10,7 +10,7 @@ to conversions from and to values, and finite map operations. This tactic is
slightly ad-hoc and tuned for proving our lifting lemmas. *) slightly ad-hoc and tuned for proving our lifting lemmas. *)
Ltac inv_step := Ltac inv_step :=
repeat match goal with repeat match goal with
| _ => progress simplify_map_equality' (* simplify memory stuff *) | _ => progress simplify_map_eq/= (* simplify memory stuff *)
| H : to_val _ = Some _ |- _ => apply of_to_val in H | H : to_val _ = Some _ |- _ => apply of_to_val in H
| H : context [to_val (of_val _)] |- _ => rewrite to_of_val in H | H : context [to_val (of_val _)] |- _ => rewrite to_of_val in H
| H : prim_step _ _ _ _ _ |- _ => destruct H; subst | H : prim_step _ _ _ _ _ |- _ => destruct H; subst
......
...@@ -120,7 +120,7 @@ Lemma elem_to_Pset_singleton p q : e_of p (coPset_singleton_raw q) ↔ p = q. ...@@ -120,7 +120,7 @@ Lemma elem_to_Pset_singleton p q : e_of p (coPset_singleton_raw q) ↔ p = q.
Proof. Proof.
split; [|by intros <-; induction p; simpl; rewrite ?coPset_elem_of_node]. split; [|by intros <-; induction p; simpl; rewrite ?coPset_elem_of_node].
by revert q; induction p; intros [?|?|]; simpl; by revert q; induction p; intros [?|?|]; simpl;
rewrite ?coPset_elem_of_node; intros; f_equal'; auto. rewrite ?coPset_elem_of_node; intros; f_equal/=; auto.
Qed. Qed.
Lemma elem_to_Pset_union t1 t2 p : e_of p (t1 t2) = e_of p t1 || e_of p t2. Lemma elem_to_Pset_union t1 t2 p : e_of p (t1 t2) = e_of p t1 || e_of p t2.
Proof. Proof.
...@@ -226,13 +226,13 @@ Definition coPpick (X : coPset) : positive := from_option 1 (coPpick_raw (`X)). ...@@ -226,13 +226,13 @@ Definition coPpick (X : coPset) : positive := from_option 1 (coPpick_raw (`X)).
Lemma coPpick_raw_elem_of t i : coPpick_raw t = Some i e_of i t. Lemma coPpick_raw_elem_of t i : coPpick_raw t = Some i e_of i t.
Proof. Proof.
revert i; induction t as [[]|[] l ? r]; intros i ?; simplify_equality'; auto. revert i; induction t as [[]|[] l ? r]; intros i ?; simplify_eq/=; auto.
destruct (coPpick_raw l); simplify_option_equality; auto. destruct (coPpick_raw l); simplify_option_eq; auto.
Qed. Qed.
Lemma coPpick_raw_None t : coPpick_raw t = None coPset_finite t. Lemma coPpick_raw_None t : coPpick_raw t = None coPset_finite t.
Proof. Proof.
induction t as [[]|[] l ? r]; intros i; simplify_equality'; auto. induction t as [[]|[] l ? r]; intros i; simplify_eq/=; auto.
destruct (coPpick_raw l); simplify_option_equality; auto. destruct (coPpick_raw l); simplify_option_eq; auto.
Qed. Qed.
Lemma coPpick_elem_of X : ¬set_finite X coPpick X X. Lemma coPpick_elem_of X : ¬set_finite X coPpick X X.
Proof. Proof.
......
...@@ -359,9 +359,9 @@ Section collection_ops. ...@@ -359,9 +359,9 @@ Section collection_ops.
- revert x. induction Xs; simpl; intros x HXs; [eexists [], x; intuition|]. - revert x. induction Xs; simpl; intros x HXs; [eexists [], x; intuition|].
rewrite elem_of_intersection_with in HXs; destruct HXs as (x1&x2&?&?&?). rewrite elem_of_intersection_with in HXs; destruct HXs as (x1&x2&?&?&?).
destruct (IHXs x2) as (xs & y & hy & ? & ?); trivial. destruct (IHXs x2) as (xs & y & hy & ? & ?); trivial.
eexists (x1 :: xs), y. intuition (simplify_option_equality; auto). eexists (x1 :: xs), y. intuition (simplify_option_eq; auto).
- intros (xs & y & Hxs & ? & Hx). revert x Hx. - intros (xs & y & Hxs & ? & Hx). revert x Hx.
induction Hxs; intros; simplify_option_equality; [done |]. induction Hxs; intros; simplify_option_eq; [done |].
rewrite elem_of_intersection_with. naive_solver. rewrite elem_of_intersection_with. naive_solver.
Qed. Qed.
...@@ -371,7 +371,7 @@ Section collection_ops. ...@@ -371,7 +371,7 @@ Section collection_ops.
( x y z, Q x P y f x y = Some z P z) ( x y z, Q x P y f x y = Some z P z)
x, x intersection_with_list f Y Xs P x. x, x intersection_with_list f Y Xs P x.
Proof. Proof.
intros HY HXs Hf. induction Xs; simplify_option_equality; [done |]. intros HY HXs Hf. induction Xs; simplify_option_eq; [done |].
intros x Hx. rewrite elem_of_intersection_with in Hx. intros x Hx. rewrite elem_of_intersection_with in Hx.
decompose_Forall. destruct Hx as (? & ? & ? & ? & ?). eauto. decompose_Forall. destruct Hx as (? & ? & ? & ? & ?). eauto.
Qed. Qed.
...@@ -490,7 +490,7 @@ Section fresh. ...@@ -490,7 +490,7 @@ Section fresh.
Global Instance fresh_list_proper: Global Instance fresh_list_proper:
Proper ((=) ==> () ==> (=)) (fresh_list (C:=C)). Proper ((=) ==> () ==> (=)) (fresh_list (C:=C)).
Proof. Proof.
intros ? n ->. induction n as [|n IH]; intros ?? E; f_equal'; [by rewrite E|]. intros ? n ->. induction n as [|n IH]; intros ?? E; f_equal/=; [by rewrite E|].
apply IH. by rewrite E. apply IH. by rewrite E.
Qed. Qed.
...@@ -585,7 +585,7 @@ Section collection_monad. ...@@ -585,7 +585,7 @@ Section collection_monad.
Forall (λ x, y, y g x f y = x) l k mapM g l fmap f k = l. Forall (λ x, y, y g x f y = x) l k mapM g l fmap f k = l.
Proof. Proof.
intros Hl. revert k. induction Hl; simpl; intros; intros Hl. revert k. induction Hl; simpl; intros;
decompose_elem_of; f_equal'; auto. decompose_elem_of; f_equal/=; auto.
Qed. Qed.
Lemma elem_of_mapM_Forall {A B} (f : A M B) (P : B Prop) l k : Lemma elem_of_mapM_Forall {A B} (f : A M B) (P : B Prop) l k :
l mapM f k Forall (λ x, y, y f x P y) k Forall P l. l mapM f k Forall (λ x, y, y f x P y) k Forall P l.
......
...@@ -149,18 +149,18 @@ Fixpoint prod_decode_snd (p : positive) : option positive := ...@@ -149,18 +149,18 @@ Fixpoint prod_decode_snd (p : positive) : option positive :=
Lemma prod_decode_encode_fst p q : prod_decode_fst (prod_encode p q) = Some p. Lemma prod_decode_encode_fst p q : prod_decode_fst (prod_encode p q) = Some p.
Proof. Proof.
assert ( p, prod_decode_fst (prod_encode_fst p) = Some p). assert ( p, prod_decode_fst (prod_encode_fst p) = Some p).
{ intros p'. by induction p'; simplify_option_equality. } { intros p'. by induction p'; simplify_option_eq. }
assert ( p, prod_decode_fst (prod_encode_snd p) = None). assert ( p, prod_decode_fst (prod_encode_snd p) = None).
{ intros p'. by induction p'; simplify_option_equality. } { intros p'. by induction p'; simplify_option_eq. }
revert q. by induction p; intros [?|?|]; simplify_option_equality. revert q. by induction p; intros [?|?|]; simplify_option_eq.
Qed. Qed.
Lemma prod_decode_encode_snd p q : prod_decode_snd (prod_encode p q) = Some q. Lemma prod_decode_encode_snd p q : prod_decode_snd (prod_encode p q) = Some q.
Proof. Proof.
assert ( p, prod_decode_snd (prod_encode_snd p) = Some p). assert ( p, prod_decode_snd (prod_encode_snd p) = Some p).
{ intros p'. by induction p'; simplify_option_equality. } { intros p'. by induction p'; simplify_option_eq. }
assert ( p, prod_decode_snd (prod_encode_fst p) = None). assert ( p, prod_decode_snd (prod_encode_fst p) = None).
{ intros p'. by induction p'; simplify_option_equality. } { intros p'. by induction p'; simplify_option_eq. }
revert q. by induction p; intros [?|?|]; simplify_option_equality. revert q. by induction p; intros [?|?|]; simplify_option_eq.
Qed.