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
Branches ci/maximedenes/instance-nobody-open-proof
No related tags found
1 merge request!231Many improvements to `multiset_solver`
...@@ -247,13 +247,15 @@ Ltac multiset_instantiate := ...@@ -247,13 +247,15 @@ Ltac multiset_instantiate :=
unless (P y) by assumption; pose proof (H y) unless (P y) by assumption; pose proof (H y)
end; end;
(* Step 3.2: simplify singletons. *) (* 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 repeat match goal with
| H : context [multiplicity _ {[ _ ]}] |- _ => | H : context [multiplicity ?x {[ ?y ]}] |- _ =>
progress (rewrite ?multiplicity_singleton, ?multiplicity_singleton_ne in H by done) first
| |- context [multiplicity _ {[ _ ]}] => [progress rewrite ?multiplicity_singleton, ?multiplicity_singleton_ne in H by done
progress (rewrite ?multiplicity_singleton, ?multiplicity_singleton_ne 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. end.
Ltac multiset_solver := set_solver by (multiset_instantiate; lia). Ltac multiset_solver := set_solver by (multiset_instantiate; lia).
...@@ -512,10 +514,7 @@ Section more_lemmas. ...@@ -512,10 +514,7 @@ Section more_lemmas.
Proof. rewrite (comm_L ()). apply gmultiset_disj_union_subset_l. Qed. Proof. rewrite (comm_L ()). apply gmultiset_disj_union_subset_l. Qed.
Lemma gmultiset_elem_of_singleton_subseteq x X : x X {[ x ]} X. Lemma gmultiset_elem_of_singleton_subseteq x X : x X {[ x ]} X.
Proof. Proof. multiset_solver. Qed.
split; [|multiset_solver].
intros Hx y. destruct (decide (y = x)); multiset_solver.
Qed.
Lemma gmultiset_elem_of_subseteq X1 X2 x : x X1 X1 X2 x X2. Lemma gmultiset_elem_of_subseteq X1 X2 x : x X1 X1 X2 x X2.
Proof. multiset_solver. Qed. 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