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

Put `SetUnfoldElemOf` instances together.

parent 3375dd20
No related branches found
No related tags found
1 merge request!231Many improvements to `multiset_solver`
...@@ -133,14 +133,6 @@ Section basic_lemmas. ...@@ -133,14 +133,6 @@ Section basic_lemmas.
Lemma gmultiset_elem_of_disj_union X Y x : x X Y x X x Y. Lemma gmultiset_elem_of_disj_union X Y x : x X Y x X x Y.
Proof. rewrite !elem_of_multiplicity, multiplicity_disj_union. lia. Qed. Proof. rewrite !elem_of_multiplicity, multiplicity_disj_union. lia. Qed.
Global Instance set_unfold_gmultiset_disj_union x X Y P Q :
SetUnfoldElemOf x X P SetUnfoldElemOf x Y Q
SetUnfoldElemOf x (X Y) (P Q).
Proof.
intros ??; constructor. rewrite gmultiset_elem_of_disj_union.
by rewrite <-(set_unfold_elem_of x X P), <-(set_unfold_elem_of x Y Q).
Qed.
End basic_lemmas. End basic_lemmas.
(** * A solver for multisets *) (** * A solver for multisets *)
...@@ -242,9 +234,17 @@ Section multiset_unfold. ...@@ -242,9 +234,17 @@ Section multiset_unfold.
- by apply set_unfold_multiset_subseteq. - by apply set_unfold_multiset_subseteq.
- f_equiv. by apply set_unfold_multiset_subseteq. - f_equiv. by apply set_unfold_multiset_subseteq.
Qed. Qed.
Global Instance set_unfold_multiset_elem_of X x n : Global Instance set_unfold_multiset_elem_of X x n :
MultisetUnfold x X n SetUnfoldElemOf x X (0 < n) | 100. MultisetUnfold x X n SetUnfoldElemOf x X (0 < n) | 100.
Proof. constructor. by rewrite <-(multiset_unfold x X n). Qed. Proof. constructor. by rewrite <-(multiset_unfold x X n). Qed.
Global Instance set_unfold_gmultiset_disj_union x X Y P Q :
SetUnfoldElemOf x X P SetUnfoldElemOf x Y Q
SetUnfoldElemOf x (X Y) (P Q).
Proof.
intros ??; constructor. rewrite gmultiset_elem_of_disj_union.
by rewrite <-(set_unfold_elem_of x X P), <-(set_unfold_elem_of x Y Q).
Qed.
End multiset_unfold. End multiset_unfold.
(** Step 3: instantiate hypotheses *) (** Step 3: instantiate hypotheses *)
......
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