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

Let `multiset_solver` case split on `x = y`/`x ≠ y` for `multiplicity x {[ y ]}`.

parent d063413c
No related branches found
No related tags found
1 merge request!231Many improvements to `multiset_solver`
......@@ -247,13 +247,15 @@ Ltac multiset_instantiate :=
unless (P y) by assumption; pose proof (H y)
end;
(* Step 3.2: simplify singletons. *)
(* Note that we do not use [repeat case_decide] since that leads to an
exponential explosion in the number of singletons. *)
repeat match goal with
| H : context [multiplicity _ {[ _ ]}] |- _ =>
progress (rewrite ?multiplicity_singleton, ?multiplicity_singleton_ne in H by done)
| |- context [multiplicity _ {[ _ ]}] =>
progress (rewrite ?multiplicity_singleton, ?multiplicity_singleton_ne by done)
| H : context [multiplicity ?x {[ ?y ]}] |- _ =>
first
[progress rewrite ?multiplicity_singleton, ?multiplicity_singleton_ne in H by done
|rewrite multiplicity_singleton' in H; destruct (decide (x = y)); simplify_eq/=]
| |- context [multiplicity ?x {[ ?y ]}] =>
first
[progress rewrite ?multiplicity_singleton, ?multiplicity_singleton_ne by done
|rewrite multiplicity_singleton'; destruct (decide (x = y)); simplify_eq/=]
end.
Ltac multiset_solver := set_solver by (multiset_instantiate; lia).
......@@ -512,10 +514,7 @@ Section more_lemmas.
Proof. rewrite (comm_L ()). apply gmultiset_disj_union_subset_l. Qed.
Lemma gmultiset_elem_of_singleton_subseteq x X : x X {[ x ]} X.
Proof.
split; [|multiset_solver].
intros Hx y. destruct (decide (y = x)); multiset_solver.
Qed.
Proof. multiset_solver. Qed.
Lemma gmultiset_elem_of_subseteq X1 X2 x : x X1 X1 X2 x X2.
Proof. multiset_solver. Qed.
......
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