src/HOL/Algebra/Bij.thy
 author wenzelm Thu Mar 26 20:08:55 2009 +0100 (2009-03-26) changeset 30729 461ee3e49ad3 parent 27717 21bbd410ba04 child 31754 b5260f5272a4 permissions -rw-r--r--
interpretation/interpret: prefixes are mandatory by default;
```     1 (*  Title:      HOL/Algebra/Bij.thy
```
```     2     ID:         \$Id\$
```
```     3     Author:     Florian Kammueller, with new proofs by L C Paulson
```
```     4 *)
```
```     5
```
```     6 theory Bij imports Group begin
```
```     7
```
```     8
```
```     9 section {* Bijections of a Set, Permutation and Automorphism Groups *}
```
```    10
```
```    11 constdefs
```
```    12   Bij :: "'a set \<Rightarrow> ('a \<Rightarrow> 'a) set"
```
```    13     --{*Only extensional functions, since otherwise we get too many.*}
```
```    14   "Bij S \<equiv> extensional S \<inter> {f. bij_betw f S S}"
```
```    15
```
```    16   BijGroup :: "'a set \<Rightarrow> ('a \<Rightarrow> 'a) monoid"
```
```    17   "BijGroup S \<equiv>
```
```    18     \<lparr>carrier = Bij S,
```
```    19      mult = \<lambda>g \<in> Bij S. \<lambda>f \<in> Bij S. compose S g f,
```
```    20      one = \<lambda>x \<in> S. x\<rparr>"
```
```    21
```
```    22
```
```    23 declare Id_compose [simp] compose_Id [simp]
```
```    24
```
```    25 lemma Bij_imp_extensional: "f \<in> Bij S \<Longrightarrow> f \<in> extensional S"
```
```    26   by (simp add: Bij_def)
```
```    27
```
```    28 lemma Bij_imp_funcset: "f \<in> Bij S \<Longrightarrow> f \<in> S \<rightarrow> S"
```
```    29   by (auto simp add: Bij_def bij_betw_imp_funcset)
```
```    30
```
```    31
```
```    32 subsection {*Bijections Form a Group *}
```
```    33
```
```    34 lemma restrict_Inv_Bij: "f \<in> Bij S \<Longrightarrow> (\<lambda>x \<in> S. (Inv S f) x) \<in> Bij S"
```
```    35   by (simp add: Bij_def bij_betw_Inv)
```
```    36
```
```    37 lemma id_Bij: "(\<lambda>x\<in>S. x) \<in> Bij S "
```
```    38   by (auto simp add: Bij_def bij_betw_def inj_on_def)
```
```    39
```
```    40 lemma compose_Bij: "\<lbrakk>x \<in> Bij S; y \<in> Bij S\<rbrakk> \<Longrightarrow> compose S x y \<in> Bij S"
```
```    41   by (auto simp add: Bij_def bij_betw_compose)
```
```    42
```
```    43 lemma Bij_compose_restrict_eq:
```
```    44      "f \<in> Bij S \<Longrightarrow> compose S (restrict (Inv S f) S) f = (\<lambda>x\<in>S. x)"
```
```    45   by (simp add: Bij_def compose_Inv_id)
```
```    46
```
```    47 theorem group_BijGroup: "group (BijGroup S)"
```
```    48 apply (simp add: BijGroup_def)
```
```    49 apply (rule groupI)
```
```    50     apply (simp add: compose_Bij)
```
```    51    apply (simp add: id_Bij)
```
```    52   apply (simp add: compose_Bij)
```
```    53   apply (blast intro: compose_assoc [symmetric] Bij_imp_funcset)
```
```    54  apply (simp add: id_Bij Bij_imp_funcset Bij_imp_extensional, simp)
```
```    55 apply (blast intro: Bij_compose_restrict_eq restrict_Inv_Bij)
```
```    56 done
```
```    57
```
```    58
```
```    59 subsection{*Automorphisms Form a Group*}
```
```    60
```
```    61 lemma Bij_Inv_mem: "\<lbrakk> f \<in> Bij S;  x \<in> S\<rbrakk> \<Longrightarrow> Inv S f x \<in> S"
```
```    62 by (simp add: Bij_def bij_betw_def Inv_mem)
```
```    63
```
```    64 lemma Bij_Inv_lemma:
```
```    65  assumes eq: "\<And>x y. \<lbrakk>x \<in> S; y \<in> S\<rbrakk> \<Longrightarrow> h(g x y) = g (h x) (h y)"
```
```    66  shows "\<lbrakk>h \<in> Bij S;  g \<in> S \<rightarrow> S \<rightarrow> S;  x \<in> S;  y \<in> S\<rbrakk>
```
```    67         \<Longrightarrow> Inv S h (g x y) = g (Inv S h x) (Inv S h y)"
```
```    68 apply (simp add: Bij_def bij_betw_def)
```
```    69 apply (subgoal_tac "\<exists>x'\<in>S. \<exists>y'\<in>S. x = h x' & y = h y'", clarify)
```
```    70  apply (simp add: eq [symmetric] Inv_f_f funcset_mem [THEN funcset_mem], blast)
```
```    71 done
```
```    72
```
```    73
```
```    74 constdefs
```
```    75   auto :: "('a, 'b) monoid_scheme \<Rightarrow> ('a \<Rightarrow> 'a) set"
```
```    76   "auto G \<equiv> hom G G \<inter> Bij (carrier G)"
```
```    77
```
```    78   AutoGroup :: "('a, 'c) monoid_scheme \<Rightarrow> ('a \<Rightarrow> 'a) monoid"
```
```    79   "AutoGroup G \<equiv> BijGroup (carrier G) \<lparr>carrier := auto G\<rparr>"
```
```    80
```
```    81 lemma (in group) id_in_auto: "(\<lambda>x \<in> carrier G. x) \<in> auto G"
```
```    82   by (simp add: auto_def hom_def restrictI group.axioms id_Bij)
```
```    83
```
```    84 lemma (in group) mult_funcset: "mult G \<in> carrier G \<rightarrow> carrier G \<rightarrow> carrier G"
```
```    85   by (simp add:  Pi_I group.axioms)
```
```    86
```
```    87 lemma (in group) restrict_Inv_hom:
```
```    88       "\<lbrakk>h \<in> hom G G; h \<in> Bij (carrier G)\<rbrakk>
```
```    89        \<Longrightarrow> restrict (Inv (carrier G) h) (carrier G) \<in> hom G G"
```
```    90   by (simp add: hom_def Bij_Inv_mem restrictI mult_funcset
```
```    91                 group.axioms Bij_Inv_lemma)
```
```    92
```
```    93 lemma inv_BijGroup:
```
```    94      "f \<in> Bij S \<Longrightarrow> m_inv (BijGroup S) f = (\<lambda>x \<in> S. (Inv S f) x)"
```
```    95 apply (rule group.inv_equality)
```
```    96 apply (rule group_BijGroup)
```
```    97 apply (simp_all add: BijGroup_def restrict_Inv_Bij Bij_compose_restrict_eq)
```
```    98 done
```
```    99
```
```   100 lemma (in group) subgroup_auto:
```
```   101       "subgroup (auto G) (BijGroup (carrier G))"
```
```   102 proof (rule subgroup.intro)
```
```   103   show "auto G \<subseteq> carrier (BijGroup (carrier G))"
```
```   104     by (force simp add: auto_def BijGroup_def)
```
```   105 next
```
```   106   fix x y
```
```   107   assume "x \<in> auto G" "y \<in> auto G"
```
```   108   thus "x \<otimes>\<^bsub>BijGroup (carrier G)\<^esub> y \<in> auto G"
```
```   109     by (force simp add: BijGroup_def is_group auto_def Bij_imp_funcset
```
```   110                         group.hom_compose compose_Bij)
```
```   111 next
```
```   112   show "\<one>\<^bsub>BijGroup (carrier G)\<^esub> \<in> auto G" by (simp add:  BijGroup_def id_in_auto)
```
```   113 next
```
```   114   fix x
```
```   115   assume "x \<in> auto G"
```
```   116   thus "inv\<^bsub>BijGroup (carrier G)\<^esub> x \<in> auto G"
```
```   117     by (simp del: restrict_apply
```
```   118              add: inv_BijGroup auto_def restrict_Inv_Bij restrict_Inv_hom)
```
```   119 qed
```
```   120
```
```   121 theorem (in group) AutoGroup: "group (AutoGroup G)"
```
```   122 by (simp add: AutoGroup_def subgroup.subgroup_is_group subgroup_auto
```
```   123               group_BijGroup)
```
```   124
```
```   125 end
```