src/HOL/Algebra/Bij.thy
changeset 14963 d584e32f7d46
parent 14853 8d710bece29f
child 16417 9bc16273c2d4
     1.1 --- a/src/HOL/Algebra/Bij.thy	Thu Jun 17 14:27:01 2004 +0200
     1.2 +++ b/src/HOL/Algebra/Bij.thy	Thu Jun 17 17:18:30 2004 +0200
     1.3 @@ -8,39 +8,39 @@
     1.4  theory Bij = Group:
     1.5  
     1.6  constdefs
     1.7 -  Bij :: "'a set => ('a => 'a) set"
     1.8 +  Bij :: "'a set \<Rightarrow> ('a \<Rightarrow> 'a) set"
     1.9      --{*Only extensional functions, since otherwise we get too many.*}
    1.10 -  "Bij S == extensional S \<inter> {f. bij_betw f S S}"
    1.11 +  "Bij S \<equiv> extensional S \<inter> {f. bij_betw f S S}"
    1.12  
    1.13 -  BijGroup :: "'a set => ('a => 'a) monoid"
    1.14 -  "BijGroup S ==
    1.15 -    (| carrier = Bij S,
    1.16 -      mult = %g: Bij S. %f: Bij S. compose S g f,
    1.17 -      one = %x: S. x |)"
    1.18 +  BijGroup :: "'a set \<Rightarrow> ('a \<Rightarrow> 'a) monoid"
    1.19 +  "BijGroup S \<equiv>
    1.20 +    \<lparr>carrier = Bij S,
    1.21 +     mult = \<lambda>g \<in> Bij S. \<lambda>f \<in> Bij S. compose S g f,
    1.22 +     one = \<lambda>x \<in> S. x\<rparr>"
    1.23  
    1.24  
    1.25  declare Id_compose [simp] compose_Id [simp]
    1.26  
    1.27 -lemma Bij_imp_extensional: "f \<in> Bij S ==> f \<in> extensional S"
    1.28 +lemma Bij_imp_extensional: "f \<in> Bij S \<Longrightarrow> f \<in> extensional S"
    1.29    by (simp add: Bij_def)
    1.30  
    1.31 -lemma Bij_imp_funcset: "f \<in> Bij S ==> f \<in> S -> S"
    1.32 +lemma Bij_imp_funcset: "f \<in> Bij S \<Longrightarrow> f \<in> S \<rightarrow> S"
    1.33    by (auto simp add: Bij_def bij_betw_imp_funcset)
    1.34  
    1.35  
    1.36  subsection {*Bijections Form a Group *}
    1.37  
    1.38 -lemma restrict_Inv_Bij: "f \<in> Bij S ==> (%x:S. (Inv S f) x) \<in> Bij S"
    1.39 +lemma restrict_Inv_Bij: "f \<in> Bij S \<Longrightarrow> (\<lambda>x \<in> S. (Inv S f) x) \<in> Bij S"
    1.40    by (simp add: Bij_def bij_betw_Inv)
    1.41  
    1.42  lemma id_Bij: "(\<lambda>x\<in>S. x) \<in> Bij S "
    1.43    by (auto simp add: Bij_def bij_betw_def inj_on_def)
    1.44  
    1.45 -lemma compose_Bij: "[| x \<in> Bij S; y \<in> Bij S|] ==> compose S x y \<in> Bij S"
    1.46 +lemma compose_Bij: "\<lbrakk>x \<in> Bij S; y \<in> Bij S\<rbrakk> \<Longrightarrow> compose S x y \<in> Bij S"
    1.47    by (auto simp add: Bij_def bij_betw_compose) 
    1.48  
    1.49  lemma Bij_compose_restrict_eq:
    1.50 -     "f \<in> Bij S ==> compose S (restrict (Inv S f) S) f = (\<lambda>x\<in>S. x)"
    1.51 +     "f \<in> Bij S \<Longrightarrow> compose S (restrict (Inv S f) S) f = (\<lambda>x\<in>S. x)"
    1.52    by (simp add: Bij_def compose_Inv_id)
    1.53  
    1.54  theorem group_BijGroup: "group (BijGroup S)"
    1.55 @@ -57,62 +57,68 @@
    1.56  
    1.57  subsection{*Automorphisms Form a Group*}
    1.58  
    1.59 -lemma Bij_Inv_mem: "[|  f \<in> Bij S;  x \<in> S |] ==> Inv S f x \<in> S"
    1.60 +lemma Bij_Inv_mem: "\<lbrakk> f \<in> Bij S;  x \<in> S\<rbrakk> \<Longrightarrow> Inv S f x \<in> S"
    1.61  by (simp add: Bij_def bij_betw_def Inv_mem)
    1.62  
    1.63  lemma Bij_Inv_lemma:
    1.64 - assumes eq: "!!x y. [|x \<in> S; y \<in> S|] ==> h(g x y) = g (h x) (h y)"
    1.65 - shows "[| h \<in> Bij S;  g \<in> S \<rightarrow> S \<rightarrow> S;  x \<in> S;  y \<in> S |]
    1.66 -        ==> Inv S h (g x y) = g (Inv S h x) (Inv S h y)"
    1.67 + assumes eq: "\<And>x y. \<lbrakk>x \<in> S; y \<in> S\<rbrakk> \<Longrightarrow> h(g x y) = g (h x) (h y)"
    1.68 + shows "\<lbrakk>h \<in> Bij S;  g \<in> S \<rightarrow> S \<rightarrow> S;  x \<in> S;  y \<in> S\<rbrakk>
    1.69 +        \<Longrightarrow> Inv S h (g x y) = g (Inv S h x) (Inv S h y)"
    1.70  apply (simp add: Bij_def bij_betw_def)
    1.71  apply (subgoal_tac "\<exists>x'\<in>S. \<exists>y'\<in>S. x = h x' & y = h y'", clarify)
    1.72 - apply (simp add: eq [symmetric] Inv_f_f funcset_mem [THEN funcset_mem], blast )
    1.73 + apply (simp add: eq [symmetric] Inv_f_f funcset_mem [THEN funcset_mem], blast)
    1.74  done
    1.75  
    1.76 +
    1.77  constdefs
    1.78 -  auto :: "('a, 'b) monoid_scheme => ('a => 'a) set"
    1.79 -  "auto G == hom G G \<inter> Bij (carrier G)"
    1.80 +  auto :: "('a, 'b) monoid_scheme \<Rightarrow> ('a \<Rightarrow> 'a) set"
    1.81 +  "auto G \<equiv> hom G G \<inter> Bij (carrier G)"
    1.82  
    1.83 -  AutoGroup :: "('a, 'c) monoid_scheme => ('a => 'a) monoid"
    1.84 -  "AutoGroup G == BijGroup (carrier G) (|carrier := auto G |)"
    1.85 +  AutoGroup :: "('a, 'c) monoid_scheme \<Rightarrow> ('a \<Rightarrow> 'a) monoid"
    1.86 +  "AutoGroup G \<equiv> BijGroup (carrier G) \<lparr>carrier := auto G\<rparr>"
    1.87  
    1.88 -lemma id_in_auto: "group G ==> (%x: carrier G. x) \<in> auto G"
    1.89 +lemma (in group) id_in_auto: "(\<lambda>x \<in> carrier G. x) \<in> auto G"
    1.90    by (simp add: auto_def hom_def restrictI group.axioms id_Bij)
    1.91  
    1.92 -lemma mult_funcset: "group G ==> mult G \<in> carrier G -> carrier G -> carrier G"
    1.93 +lemma (in group) mult_funcset: "mult G \<in> carrier G \<rightarrow> carrier G \<rightarrow> carrier G"
    1.94    by (simp add:  Pi_I group.axioms)
    1.95  
    1.96 -lemma restrict_Inv_hom:
    1.97 -      "[|group G; h \<in> hom G G; h \<in> Bij (carrier G)|]
    1.98 -       ==> restrict (Inv (carrier G) h) (carrier G) \<in> hom G G"
    1.99 +lemma (in group) restrict_Inv_hom:
   1.100 +      "\<lbrakk>h \<in> hom G G; h \<in> Bij (carrier G)\<rbrakk>
   1.101 +       \<Longrightarrow> restrict (Inv (carrier G) h) (carrier G) \<in> hom G G"
   1.102    by (simp add: hom_def Bij_Inv_mem restrictI mult_funcset
   1.103                  group.axioms Bij_Inv_lemma)
   1.104  
   1.105  lemma inv_BijGroup:
   1.106 -     "f \<in> Bij S ==> m_inv (BijGroup S) f = (%x: S. (Inv S f) x)"
   1.107 +     "f \<in> Bij S \<Longrightarrow> m_inv (BijGroup S) f = (\<lambda>x \<in> S. (Inv S f) x)"
   1.108  apply (rule group.inv_equality)
   1.109  apply (rule group_BijGroup)
   1.110  apply (simp_all add: BijGroup_def restrict_Inv_Bij Bij_compose_restrict_eq)
   1.111  done
   1.112  
   1.113 -lemma subgroup_auto:
   1.114 -      "group G ==> subgroup (auto G) (BijGroup (carrier G))"
   1.115 -apply (rule group.subgroupI)
   1.116 -    apply (rule group_BijGroup)
   1.117 -   apply (force simp add: auto_def BijGroup_def)
   1.118 -  apply (blast dest: id_in_auto)
   1.119 - apply (simp del: restrict_apply
   1.120 +lemma (in group) subgroup_auto:
   1.121 +      "subgroup (auto G) (BijGroup (carrier G))"
   1.122 +proof (rule subgroup.intro)
   1.123 +  show "auto G \<subseteq> carrier (BijGroup (carrier G))"
   1.124 +    by (force simp add: auto_def BijGroup_def)
   1.125 +next
   1.126 +  fix x y
   1.127 +  assume "x \<in> auto G" "y \<in> auto G" 
   1.128 +  thus "x \<otimes>\<^bsub>BijGroup (carrier G)\<^esub> y \<in> auto G"
   1.129 +    by (force simp add: BijGroup_def is_group auto_def Bij_imp_funcset 
   1.130 +                        group.hom_compose compose_Bij)
   1.131 +next
   1.132 +  show "\<one>\<^bsub>BijGroup (carrier G)\<^esub> \<in> auto G" by (simp add:  BijGroup_def id_in_auto)
   1.133 +next
   1.134 +  fix x 
   1.135 +  assume "x \<in> auto G" 
   1.136 +  thus "inv\<^bsub>BijGroup (carrier G)\<^esub> x \<in> auto G"
   1.137 +    by (simp del: restrict_apply
   1.138               add: inv_BijGroup auto_def restrict_Inv_Bij restrict_Inv_hom)
   1.139 -apply (auto simp add: BijGroup_def auto_def Bij_imp_funcset group.hom_compose
   1.140 -                      compose_Bij)
   1.141 -done
   1.142 +qed
   1.143  
   1.144 -theorem AutoGroup: "group G ==> group (AutoGroup G)"
   1.145 -apply (simp add: AutoGroup_def)
   1.146 -apply (rule Group.subgroup.groupI)
   1.147 -apply (erule subgroup_auto)
   1.148 -apply (insert Bij.group_BijGroup [of "carrier G"])
   1.149 -apply (simp_all add: group_def)
   1.150 -done
   1.151 +theorem (in group) AutoGroup: "group (AutoGroup G)"
   1.152 +by (simp add: AutoGroup_def subgroup.subgroup_is_group subgroup_auto 
   1.153 +              group_BijGroup)
   1.154  
   1.155  end