src/HOL/Algebra/Bij.thy
 author wenzelm Tue Jan 16 09:30:00 2018 +0100 (15 months ago) changeset 67443 3abf6a722518 parent 67091 1393c2340eec child 68687 2976a4a3b126 permissions -rw-r--r--
 wenzelm@14706 ` 1` ```(* Title: HOL/Algebra/Bij.thy ``` paulson@13945 ` 2` ``` Author: Florian Kammueller, with new proofs by L C Paulson ``` paulson@13945 ` 3` ```*) ``` paulson@13945 ` 4` wenzelm@35849 ` 5` ```theory Bij ``` wenzelm@35849 ` 6` ```imports Group ``` wenzelm@35849 ` 7` ```begin ``` ballarin@20318 ` 8` wenzelm@61382 ` 9` ```section \Bijections of a Set, Permutation and Automorphism Groups\ ``` paulson@13945 ` 10` wenzelm@35848 ` 11` ```definition ``` wenzelm@35848 ` 12` ``` Bij :: "'a set \ ('a \ 'a) set" ``` wenzelm@67443 ` 13` ``` \ \Only extensional functions, since otherwise we get too many.\ ``` wenzelm@35848 ` 14` ``` where "Bij S = extensional S \ {f. bij_betw f S S}" ``` paulson@13945 ` 15` wenzelm@35848 ` 16` ```definition ``` wenzelm@35848 ` 17` ``` BijGroup :: "'a set \ ('a \ 'a) monoid" ``` wenzelm@35848 ` 18` ``` where "BijGroup S = ``` paulson@14963 ` 19` ``` \carrier = Bij S, ``` paulson@14963 ` 20` ``` mult = \g \ Bij S. \f \ Bij S. compose S g f, ``` paulson@14963 ` 21` ``` one = \x \ S. x\" ``` paulson@13945 ` 22` paulson@13945 ` 23` paulson@13945 ` 24` ```declare Id_compose [simp] compose_Id [simp] ``` paulson@13945 ` 25` paulson@14963 ` 26` ```lemma Bij_imp_extensional: "f \ Bij S \ f \ extensional S" ``` wenzelm@14666 ` 27` ``` by (simp add: Bij_def) ``` paulson@13945 ` 28` paulson@14963 ` 29` ```lemma Bij_imp_funcset: "f \ Bij S \ f \ S \ S" ``` paulson@14853 ` 30` ``` by (auto simp add: Bij_def bij_betw_imp_funcset) ``` paulson@13945 ` 31` paulson@13945 ` 32` wenzelm@61382 ` 33` ```subsection \Bijections Form a Group\ ``` paulson@13945 ` 34` nipkow@33057 ` 35` ```lemma restrict_inv_into_Bij: "f \ Bij S \ (\x \ S. (inv_into S f) x) \ Bij S" ``` nipkow@33057 ` 36` ``` by (simp add: Bij_def bij_betw_inv_into) ``` paulson@13945 ` 37` paulson@13945 ` 38` ```lemma id_Bij: "(\x\S. x) \ Bij S " ``` paulson@14853 ` 39` ``` by (auto simp add: Bij_def bij_betw_def inj_on_def) ``` paulson@13945 ` 40` paulson@14963 ` 41` ```lemma compose_Bij: "\x \ Bij S; y \ Bij S\ \ compose S x y \ Bij S" ``` paulson@14853 ` 42` ``` by (auto simp add: Bij_def bij_betw_compose) ``` paulson@13945 ` 43` paulson@13945 ` 44` ```lemma Bij_compose_restrict_eq: ``` nipkow@33057 ` 45` ``` "f \ Bij S \ compose S (restrict (inv_into S f) S) f = (\x\S. x)" ``` nipkow@33057 ` 46` ``` by (simp add: Bij_def compose_inv_into_id) ``` paulson@13945 ` 47` paulson@13945 ` 48` ```theorem group_BijGroup: "group (BijGroup S)" ``` wenzelm@14666 ` 49` ```apply (simp add: BijGroup_def) ``` paulson@13945 ` 50` ```apply (rule groupI) ``` paulson@13945 ` 51` ``` apply (simp add: compose_Bij) ``` paulson@13945 ` 52` ``` apply (simp add: id_Bij) ``` paulson@13945 ` 53` ``` apply (simp add: compose_Bij) ``` nipkow@31754 ` 54` ``` apply (blast intro: compose_assoc [symmetric] dest: Bij_imp_funcset) ``` paulson@13945 ` 55` ``` apply (simp add: id_Bij Bij_imp_funcset Bij_imp_extensional, simp) ``` nipkow@33057 ` 56` ```apply (blast intro: Bij_compose_restrict_eq restrict_inv_into_Bij) ``` paulson@13945 ` 57` ```done ``` paulson@13945 ` 58` paulson@13945 ` 59` wenzelm@61382 ` 60` ```subsection\Automorphisms Form a Group\ ``` paulson@13945 ` 61` nipkow@33057 ` 62` ```lemma Bij_inv_into_mem: "\ f \ Bij S; x \ S\ \ inv_into S f x \ S" ``` nipkow@33057 ` 63` ```by (simp add: Bij_def bij_betw_def inv_into_into) ``` paulson@13945 ` 64` nipkow@33057 ` 65` ```lemma Bij_inv_into_lemma: ``` paulson@14963 ` 66` ``` assumes eq: "\x y. \x \ S; y \ S\ \ h(g x y) = g (h x) (h y)" ``` paulson@14963 ` 67` ``` shows "\h \ Bij S; g \ S \ S \ S; x \ S; y \ S\ ``` nipkow@33057 ` 68` ``` \ inv_into S h (g x y) = g (inv_into S h x) (inv_into S h y)" ``` paulson@14853 ` 69` ```apply (simp add: Bij_def bij_betw_def) ``` wenzelm@67091 ` 70` ```apply (subgoal_tac "\x'\S. \y'\S. x = h x' \ y = h y'", clarify) ``` nipkow@32988 ` 71` ``` apply (simp add: eq [symmetric] inv_f_f funcset_mem [THEN funcset_mem], blast) ``` paulson@13945 ` 72` ```done ``` paulson@13945 ` 73` paulson@14963 ` 74` wenzelm@35848 ` 75` ```definition ``` wenzelm@35848 ` 76` ``` auto :: "('a, 'b) monoid_scheme \ ('a \ 'a) set" ``` wenzelm@35848 ` 77` ``` where "auto G = hom G G \ Bij (carrier G)" ``` paulson@13945 ` 78` wenzelm@35848 ` 79` ```definition ``` wenzelm@35848 ` 80` ``` AutoGroup :: "('a, 'c) monoid_scheme \ ('a \ 'a) monoid" ``` wenzelm@35848 ` 81` ``` where "AutoGroup G = BijGroup (carrier G) \carrier := auto G\" ``` paulson@13945 ` 82` paulson@14963 ` 83` ```lemma (in group) id_in_auto: "(\x \ carrier G. x) \ auto G" ``` wenzelm@14666 ` 84` ``` by (simp add: auto_def hom_def restrictI group.axioms id_Bij) ``` paulson@13945 ` 85` paulson@14963 ` 86` ```lemma (in group) mult_funcset: "mult G \ carrier G \ carrier G \ carrier G" ``` paulson@13945 ` 87` ``` by (simp add: Pi_I group.axioms) ``` paulson@13945 ` 88` nipkow@33057 ` 89` ```lemma (in group) restrict_inv_into_hom: ``` paulson@14963 ` 90` ``` "\h \ hom G G; h \ Bij (carrier G)\ ``` nipkow@33057 ` 91` ``` \ restrict (inv_into (carrier G) h) (carrier G) \ hom G G" ``` nipkow@33057 ` 92` ``` by (simp add: hom_def Bij_inv_into_mem restrictI mult_funcset ``` nipkow@33057 ` 93` ``` group.axioms Bij_inv_into_lemma) ``` paulson@13945 ` 94` paulson@13945 ` 95` ```lemma inv_BijGroup: ``` nipkow@33057 ` 96` ``` "f \ Bij S \ m_inv (BijGroup S) f = (\x \ S. (inv_into S f) x)" ``` paulson@13945 ` 97` ```apply (rule group.inv_equality) ``` paulson@13945 ` 98` ```apply (rule group_BijGroup) ``` nipkow@33057 ` 99` ```apply (simp_all add:BijGroup_def restrict_inv_into_Bij Bij_compose_restrict_eq) ``` paulson@13945 ` 100` ```done ``` paulson@13945 ` 101` paulson@14963 ` 102` ```lemma (in group) subgroup_auto: ``` paulson@14963 ` 103` ``` "subgroup (auto G) (BijGroup (carrier G))" ``` paulson@14963 ` 104` ```proof (rule subgroup.intro) ``` paulson@14963 ` 105` ``` show "auto G \ carrier (BijGroup (carrier G))" ``` paulson@14963 ` 106` ``` by (force simp add: auto_def BijGroup_def) ``` paulson@14963 ` 107` ```next ``` paulson@14963 ` 108` ``` fix x y ``` paulson@14963 ` 109` ``` assume "x \ auto G" "y \ auto G" ``` paulson@14963 ` 110` ``` thus "x \\<^bsub>BijGroup (carrier G)\<^esub> y \ auto G" ``` paulson@14963 ` 111` ``` by (force simp add: BijGroup_def is_group auto_def Bij_imp_funcset ``` paulson@14963 ` 112` ``` group.hom_compose compose_Bij) ``` paulson@14963 ` 113` ```next ``` paulson@14963 ` 114` ``` show "\\<^bsub>BijGroup (carrier G)\<^esub> \ auto G" by (simp add: BijGroup_def id_in_auto) ``` paulson@14963 ` 115` ```next ``` paulson@14963 ` 116` ``` fix x ``` paulson@14963 ` 117` ``` assume "x \ auto G" ``` paulson@14963 ` 118` ``` thus "inv\<^bsub>BijGroup (carrier G)\<^esub> x \ auto G" ``` paulson@14963 ` 119` ``` by (simp del: restrict_apply ``` nipkow@33057 ` 120` ``` add: inv_BijGroup auto_def restrict_inv_into_Bij restrict_inv_into_hom) ``` paulson@14963 ` 121` ```qed ``` paulson@13945 ` 122` paulson@14963 ` 123` ```theorem (in group) AutoGroup: "group (AutoGroup G)" ``` paulson@14963 ` 124` ```by (simp add: AutoGroup_def subgroup.subgroup_is_group subgroup_auto ``` paulson@14963 ` 125` ``` group_BijGroup) ``` paulson@13945 ` 126` paulson@13945 ` 127` ```end ```