src/HOL/Algebra/Bij.thy
author paulson
Fri May 02 10:25:42 2003 +0200 (2003-05-02)
changeset 13945 5433b2755e98
child 14666 65f8680c3f16
permissions -rw-r--r--
moved Bij.thy from HOL/GroupTheory
     1 (*  Title:      HOL/Algebra/Bij
     2     ID:         $Id$
     3     Author:     Florian Kammueller, with new proofs by L C Paulson
     4 *)
     5 
     6 
     7 header{*Bijections of a Set, Permutation Groups, Automorphism Groups*} 
     8 
     9 theory Bij = Group:
    10 
    11 constdefs
    12   Bij :: "'a set => (('a => 'a)set)" 
    13     --{*Only extensional functions, since otherwise we get too many.*}
    14     "Bij S == extensional S \<inter> {f. f`S = S & inj_on f S}"
    15 
    16    BijGroup ::  "'a set => (('a => 'a) monoid)"
    17    "BijGroup S == (| carrier = Bij S, 
    18 		     mult  = %g: Bij S. %f: Bij S. compose S g f,
    19 		     one = %x: S. x |)"
    20 
    21 
    22 declare Id_compose [simp] compose_Id [simp]
    23 
    24 lemma Bij_imp_extensional: "f \<in> Bij S ==> f \<in> extensional S"
    25 by (simp add: Bij_def)
    26 
    27 lemma Bij_imp_funcset: "f \<in> Bij S ==> f \<in> S -> S"
    28 by (auto simp add: Bij_def Pi_def)
    29 
    30 lemma Bij_imp_apply: "f \<in> Bij S ==> f ` S = S"
    31 by (simp add: Bij_def)
    32 
    33 lemma Bij_imp_inj_on: "f \<in> Bij S ==> inj_on f S"
    34 by (simp add: Bij_def)
    35 
    36 lemma BijI: "[| f \<in> extensional(S); f`S = S; inj_on f S |] ==> f \<in> Bij S"
    37 by (simp add: Bij_def)
    38 
    39 
    40 subsection{*Bijections Form a Group*}
    41 
    42 lemma restrict_Inv_Bij: "f \<in> Bij S ==> (%x:S. (Inv S f) x) \<in> Bij S"
    43 apply (simp add: Bij_def)
    44 apply (intro conjI)
    45 txt{*Proving @{term "restrict (Inv S f) S ` S = S"}*}
    46  apply (rule equalityI)
    47   apply (force simp add: Inv_mem) --{*first inclusion*}
    48  apply (rule subsetI)   --{*second inclusion*}
    49  apply (rule_tac x = "f x" in image_eqI)
    50   apply (force intro:  simp add: Inv_f_f, blast)
    51 txt{*Remaining goal: @{term "inj_on (restrict (Inv S f) S) S"}*}
    52 apply (rule inj_onI)
    53 apply (auto elim: Inv_injective)
    54 done
    55 
    56 lemma id_Bij: "(\<lambda>x\<in>S. x) \<in> Bij S "
    57 apply (rule BijI)
    58 apply (auto simp add: inj_on_def)
    59 done
    60 
    61 lemma compose_Bij: "[| x \<in> Bij S; y \<in> Bij S|] ==> compose S x y \<in> Bij S"
    62 apply (rule BijI)
    63   apply (simp add: compose_extensional) 
    64  apply (blast del: equalityI
    65               intro: surj_compose dest: Bij_imp_apply Bij_imp_inj_on)
    66 apply (blast intro: inj_on_compose dest: Bij_imp_apply Bij_imp_inj_on)
    67 done
    68 
    69 lemma Bij_compose_restrict_eq:
    70      "f \<in> Bij S ==> compose S (restrict (Inv S f) S) f = (\<lambda>x\<in>S. x)"
    71 apply (rule compose_Inv_id)
    72  apply (simp add: Bij_imp_inj_on)
    73 apply (simp add: Bij_imp_apply) 
    74 done
    75 
    76 theorem group_BijGroup: "group (BijGroup S)"
    77 apply (simp add: BijGroup_def) 
    78 apply (rule groupI)
    79     apply (simp add: compose_Bij)
    80    apply (simp add: id_Bij)
    81   apply (simp add: compose_Bij)
    82   apply (blast intro: compose_assoc [symmetric] Bij_imp_funcset)
    83  apply (simp add: id_Bij Bij_imp_funcset Bij_imp_extensional, simp)
    84 apply (blast intro: Bij_compose_restrict_eq restrict_Inv_Bij) 
    85 done
    86 
    87 
    88 subsection{*Automorphisms Form a Group*}
    89 
    90 lemma Bij_Inv_mem: "[|  f \<in> Bij S;  x : S |] ==> Inv S f x : S"
    91 by (simp add: Bij_def Inv_mem) 
    92 
    93 lemma Bij_Inv_lemma:
    94  assumes eq: "!!x y. [|x \<in> S; y \<in> S|] ==> h(g x y) = g (h x) (h y)"
    95  shows "[| h \<in> Bij S;  g \<in> S \<rightarrow> S \<rightarrow> S;  x \<in> S;  y \<in> S |]        
    96         ==> Inv S h (g x y) = g (Inv S h x) (Inv S h y)"
    97 apply (simp add: Bij_def) 
    98 apply (subgoal_tac "EX x':S. EX y':S. x = h x' & y = h y'", clarify)
    99  apply (simp add: eq [symmetric] Inv_f_f funcset_mem [THEN funcset_mem], blast)
   100 done
   101 
   102 constdefs
   103  auto :: "('a,'b) monoid_scheme => ('a => 'a)set"
   104   "auto G == hom G G \<inter> Bij (carrier G)"
   105 
   106   AutoGroup :: "[('a,'c) monoid_scheme] => ('a=>'a) monoid"
   107   "AutoGroup G == BijGroup (carrier G) (|carrier := auto G |)"
   108 
   109 lemma id_in_auto: "group G ==> (%x: carrier G. x) \<in> auto G"
   110   by (simp add: auto_def hom_def restrictI group.axioms id_Bij) 
   111 
   112 lemma mult_funcset: "group G ==> mult G \<in> carrier G -> carrier G -> carrier G"
   113   by (simp add:  Pi_I group.axioms)
   114 
   115 lemma restrict_Inv_hom:
   116       "[|group G; h \<in> hom G G; h \<in> Bij (carrier G)|]
   117        ==> restrict (Inv (carrier G) h) (carrier G) \<in> hom G G"
   118   by (simp add: hom_def Bij_Inv_mem restrictI mult_funcset
   119                 group.axioms Bij_Inv_lemma)
   120 
   121 lemma inv_BijGroup:
   122      "f \<in> Bij S ==> m_inv (BijGroup S) f = (%x: S. (Inv S f) x)"
   123 apply (rule group.inv_equality)
   124 apply (rule group_BijGroup)
   125 apply (simp_all add: BijGroup_def restrict_Inv_Bij Bij_compose_restrict_eq)  
   126 done
   127 
   128 lemma subgroup_auto:
   129       "group G ==> subgroup (auto G) (BijGroup (carrier G))"
   130 apply (rule group.subgroupI) 
   131     apply (rule group_BijGroup) 
   132    apply (force simp add: auto_def BijGroup_def) 
   133   apply (blast intro: dest: id_in_auto) 
   134  apply (simp del: restrict_apply
   135 	     add: inv_BijGroup auto_def restrict_Inv_Bij restrict_Inv_hom) 
   136 apply (simp add: BijGroup_def auto_def Bij_imp_funcset compose_hom compose_Bij)
   137 done
   138 
   139 theorem AutoGroup: "group G ==> group (AutoGroup G)"
   140 apply (simp add: AutoGroup_def) 
   141 apply (rule Group.subgroup.groupI)
   142 apply (erule subgroup_auto)  
   143 apply (insert Bij.group_BijGroup [of "carrier G"]) 
   144 apply (simp_all add: group_def) 
   145 done
   146 
   147 end
   148