equal
deleted
inserted
replaced
237 |
237 |
238 lemma t_eq_imp_bij_func: |
238 lemma t_eq_imp_bij_func: |
239 assumes "t xs = t ys" |
239 assumes "t xs = t ys" |
240 shows "\<exists>f. bij_betw f {..<length xs} {..<length ys} \<and> (\<forall>i<length xs. xs ! i = ys ! (f i))" |
240 shows "\<exists>f. bij_betw f {..<length xs} {..<length ys} \<and> (\<forall>i<length xs. xs ! i = ys ! (f i))" |
241 proof - |
241 proof - |
242 have "count (multiset_of xs) = count (multiset_of ys)" |
242 have "count (mset xs) = count (mset ys)" |
243 using assms by (simp add: fun_eq_iff count_multiset_of t_def) |
243 using assms by (simp add: fun_eq_iff count_mset t_def) |
244 then have "xs <~~> ys" unfolding multiset_of_eq_perm count_inject . |
244 then have "xs <~~> ys" unfolding mset_eq_perm count_inject . |
245 then show ?thesis by (rule permutation_Ex_bij) |
245 then show ?thesis by (rule permutation_Ex_bij) |
246 qed |
246 qed |
247 |
247 |
248 lemma \<P>_k: assumes "k \<in> keys" shows "\<P>(fst) {k} = K k" |
248 lemma \<P>_k: assumes "k \<in> keys" shows "\<P>(fst) {k} = K k" |
249 proof - |
249 proof - |