src/HOL/Library/Permutations.thy
changeset 64543 6b13586ef1a2
parent 64284 f3b905b2eee2
child 64966 d53d7ca3303e
     1.1 --- a/src/HOL/Library/Permutations.thy	Tue Oct 18 12:01:54 2016 +0200
     1.2 +++ b/src/HOL/Library/Permutations.thy	Thu Dec 08 17:22:51 2016 +0100
     1.3 @@ -31,7 +31,7 @@
     1.4    using surj_f_inv_f[OF bij_is_surj[OF bp]]
     1.5    by (simp add: fun_eq_iff Fun.swap_def bij_inv_eq_iff[OF bp])
     1.6  
     1.7 -lemma bij_swap_ompose_bij: "bij p \<Longrightarrow> bij (Fun.swap a b id \<circ> p)"
     1.8 +lemma bij_swap_compose_bij: "bij p \<Longrightarrow> bij (Fun.swap a b id \<circ> p)"
     1.9  proof -
    1.10    assume H: "bij p"
    1.11    show ?thesis
    1.12 @@ -756,18 +756,10 @@
    1.13    let ?q = "Fun.swap a (p a) id \<circ> ?r"
    1.14    have raa: "?r a = a"
    1.15      by (simp add: Fun.swap_def)
    1.16 -  from bij_swap_ompose_bij[OF insert(4)]
    1.17 -  have br: "bij ?r"  .
    1.18 -
    1.19 +  from bij_swap_compose_bij[OF insert(4)] have br: "bij ?r"  .
    1.20    from insert raa have th: "\<forall>x. x \<notin> F \<longrightarrow> ?r x = x"
    1.21 -    apply (clarsimp simp add: Fun.swap_def)
    1.22 -    apply (erule_tac x="x" in allE)
    1.23 -    apply auto
    1.24 -    unfolding bij_iff
    1.25 -    apply metis
    1.26 -    done
    1.27 -  from insert(3)[OF br th]
    1.28 -  have rp: "permutation ?r" .
    1.29 +    by (metis bij_pointE comp_apply id_apply insert_iff swap_apply(3))    
    1.30 +  from insert(3)[OF br th] have rp: "permutation ?r" .
    1.31    have "permutation ?q"
    1.32      by (simp add: permutation_compose permutation_swap_id rp)
    1.33    then show ?case
    1.34 @@ -926,7 +918,7 @@
    1.35      using permutes_in_image[OF assms] by auto
    1.36    have "count (mset (permute_list f xs)) y =
    1.37            card ((\<lambda>i. xs ! f i) -` {y} \<inter> {..<length xs})"
    1.38 -    by (simp add: permute_list_def mset_map count_image_mset atLeast0LessThan)
    1.39 +    by (simp add: permute_list_def count_image_mset atLeast0LessThan)
    1.40    also have "(\<lambda>i. xs ! f i) -` {y} \<inter> {..<length xs} = f -` {i. i < length xs \<and> y = xs ! i}"
    1.41      by auto
    1.42    also from assms have "card \<dots> = card {i. i < length xs \<and> y = xs ! i}"