# HG changeset patch # User desharna # Date 1681390443 -7200 # Node ID 52e753197496da78f603bdd7fafe1c56d93462e6 # Parent 9137085647ee50178efaee7c46ab0b8ab179a3c5 added lemmas multpHO_repeat_mset_repeat_mset[simp] and multpHO_double_double[simp] diff -r 9137085647ee -r 52e753197496 NEWS --- a/NEWS Thu Apr 13 09:53:37 2023 +0200 +++ b/NEWS Thu Apr 13 14:54:03 2023 +0200 @@ -246,8 +246,10 @@ irreflp_on_multpHO[simp] multpDM_mono_strong multpDM_plus_plusI[simp] + multpHO_double_double[simp] multpHO_mono_strong multpHO_plus_plus[simp] + multpHO_repeat_mset_repeat_mset[simp] strict_subset_implies_multpDM strict_subset_implies_multpHO totalp_multpDM diff -r 9137085647ee -r 52e753197496 src/HOL/Library/Multiset_Order.thy --- a/src/HOL/Library/Multiset_Order.thy Thu Apr 13 09:53:37 2023 +0200 +++ b/src/HOL/Library/Multiset_Order.thy Thu Apr 13 14:54:03 2023 +0200 @@ -489,6 +489,47 @@ by (meson less_eq_multiset_def mset_lt_single_right_iff) +subsubsection \Simplifications\ + +lemma multp\<^sub>H\<^sub>O_repeat_mset_repeat_mset[simp]: + assumes "n \ 0" + shows "multp\<^sub>H\<^sub>O R (repeat_mset n A) (repeat_mset n B) \ multp\<^sub>H\<^sub>O R A B" +proof (rule iffI) + assume hyp: "multp\<^sub>H\<^sub>O R (repeat_mset n A) (repeat_mset n B)" + hence + 1: "repeat_mset n A \ repeat_mset n B" and + 2: "\y. n * count B y < n * count A y \ (\x. R y x \ n * count A x < n * count B x)" + by (simp_all add: multp\<^sub>H\<^sub>O_def) + + from 1 \n \ 0\ have "A \ B" + by auto + + moreover from 2 \n \ 0\ have "\y. count B y < count A y \ (\x. R y x \ count A x < count B x)" + by auto + + ultimately show "multp\<^sub>H\<^sub>O R A B" + by (simp add: multp\<^sub>H\<^sub>O_def) +next + assume "multp\<^sub>H\<^sub>O R A B" + hence 1: "A \ B" and 2: "\y. count B y < count A y \ (\x. R y x \ count A x < count B x)" + by (simp_all add: multp\<^sub>H\<^sub>O_def) + + from 1 have "repeat_mset n A \ repeat_mset n B" + by (simp add: assms repeat_mset_cancel1) + + moreover from 2 have "\y. n * count B y < n * count A y \ + (\x. R y x \ n * count A x < n * count B x)" + by auto + + ultimately show "multp\<^sub>H\<^sub>O R (repeat_mset n A) (repeat_mset n B)" + by (simp add: multp\<^sub>H\<^sub>O_def) +qed + +lemma multp\<^sub>H\<^sub>O_double_double[simp]: "multp\<^sub>H\<^sub>O R (A + A) (B + B) \ multp\<^sub>H\<^sub>O R A B" + using multp\<^sub>H\<^sub>O_repeat_mset_repeat_mset[of 2] + by (simp add: numeral_Bit0) + + subsection \Simprocs\ lemma mset_le_add_iff1: