src/HOL/Algebra/Bij.thy
author paulson
Tue Jun 01 11:25:26 2004 +0200 (2004-06-01)
changeset 14853 8d710bece29f
parent 14761 28b5eb4a867f
child 14963 d584e32f7d46
permissions -rw-r--r--
more on bij_betw
wenzelm@14706
     1
(*  Title:      HOL/Algebra/Bij.thy
paulson@13945
     2
    ID:         $Id$
paulson@13945
     3
    Author:     Florian Kammueller, with new proofs by L C Paulson
paulson@13945
     4
*)
paulson@13945
     5
wenzelm@14666
     6
header {* Bijections of a Set, Permutation Groups, Automorphism Groups *}
paulson@13945
     7
paulson@13945
     8
theory Bij = Group:
paulson@13945
     9
paulson@13945
    10
constdefs
wenzelm@14666
    11
  Bij :: "'a set => ('a => 'a) set"
paulson@13945
    12
    --{*Only extensional functions, since otherwise we get too many.*}
paulson@14853
    13
  "Bij S == extensional S \<inter> {f. bij_betw f S S}"
paulson@13945
    14
wenzelm@14666
    15
  BijGroup :: "'a set => ('a => 'a) monoid"
wenzelm@14666
    16
  "BijGroup S ==
wenzelm@14666
    17
    (| carrier = Bij S,
wenzelm@14666
    18
      mult = %g: Bij S. %f: Bij S. compose S g f,
wenzelm@14666
    19
      one = %x: S. x |)"
paulson@13945
    20
paulson@13945
    21
paulson@13945
    22
declare Id_compose [simp] compose_Id [simp]
paulson@13945
    23
paulson@13945
    24
lemma Bij_imp_extensional: "f \<in> Bij S ==> f \<in> extensional S"
wenzelm@14666
    25
  by (simp add: Bij_def)
paulson@13945
    26
paulson@13945
    27
lemma Bij_imp_funcset: "f \<in> Bij S ==> f \<in> S -> S"
paulson@14853
    28
  by (auto simp add: Bij_def bij_betw_imp_funcset)
paulson@13945
    29
paulson@13945
    30
wenzelm@14666
    31
subsection {*Bijections Form a Group *}
paulson@13945
    32
paulson@13945
    33
lemma restrict_Inv_Bij: "f \<in> Bij S ==> (%x:S. (Inv S f) x) \<in> Bij S"
paulson@14853
    34
  by (simp add: Bij_def bij_betw_Inv)
paulson@13945
    35
paulson@13945
    36
lemma id_Bij: "(\<lambda>x\<in>S. x) \<in> Bij S "
paulson@14853
    37
  by (auto simp add: Bij_def bij_betw_def inj_on_def)
paulson@13945
    38
paulson@13945
    39
lemma compose_Bij: "[| x \<in> Bij S; y \<in> Bij S|] ==> compose S x y \<in> Bij S"
paulson@14853
    40
  by (auto simp add: Bij_def bij_betw_compose) 
paulson@13945
    41
paulson@13945
    42
lemma Bij_compose_restrict_eq:
paulson@13945
    43
     "f \<in> Bij S ==> compose S (restrict (Inv S f) S) f = (\<lambda>x\<in>S. x)"
paulson@14853
    44
  by (simp add: Bij_def compose_Inv_id)
paulson@13945
    45
paulson@13945
    46
theorem group_BijGroup: "group (BijGroup S)"
wenzelm@14666
    47
apply (simp add: BijGroup_def)
paulson@13945
    48
apply (rule groupI)
paulson@13945
    49
    apply (simp add: compose_Bij)
paulson@13945
    50
   apply (simp add: id_Bij)
paulson@13945
    51
  apply (simp add: compose_Bij)
paulson@13945
    52
  apply (blast intro: compose_assoc [symmetric] Bij_imp_funcset)
paulson@13945
    53
 apply (simp add: id_Bij Bij_imp_funcset Bij_imp_extensional, simp)
wenzelm@14666
    54
apply (blast intro: Bij_compose_restrict_eq restrict_Inv_Bij)
paulson@13945
    55
done
paulson@13945
    56
paulson@13945
    57
paulson@13945
    58
subsection{*Automorphisms Form a Group*}
paulson@13945
    59
paulson@14853
    60
lemma Bij_Inv_mem: "[|  f \<in> Bij S;  x \<in> S |] ==> Inv S f x \<in> S"
paulson@14853
    61
by (simp add: Bij_def bij_betw_def Inv_mem)
paulson@13945
    62
paulson@13945
    63
lemma Bij_Inv_lemma:
paulson@13945
    64
 assumes eq: "!!x y. [|x \<in> S; y \<in> S|] ==> h(g x y) = g (h x) (h y)"
wenzelm@14666
    65
 shows "[| h \<in> Bij S;  g \<in> S \<rightarrow> S \<rightarrow> S;  x \<in> S;  y \<in> S |]
paulson@13945
    66
        ==> Inv S h (g x y) = g (Inv S h x) (Inv S h y)"
paulson@14853
    67
apply (simp add: Bij_def bij_betw_def)
paulson@14853
    68
apply (subgoal_tac "\<exists>x'\<in>S. \<exists>y'\<in>S. x = h x' & y = h y'", clarify)
paulson@14853
    69
 apply (simp add: eq [symmetric] Inv_f_f funcset_mem [THEN funcset_mem], blast )
paulson@13945
    70
done
paulson@13945
    71
paulson@13945
    72
constdefs
wenzelm@14666
    73
  auto :: "('a, 'b) monoid_scheme => ('a => 'a) set"
paulson@13945
    74
  "auto G == hom G G \<inter> Bij (carrier G)"
paulson@13945
    75
wenzelm@14666
    76
  AutoGroup :: "('a, 'c) monoid_scheme => ('a => 'a) monoid"
paulson@13945
    77
  "AutoGroup G == BijGroup (carrier G) (|carrier := auto G |)"
paulson@13945
    78
paulson@13945
    79
lemma id_in_auto: "group G ==> (%x: carrier G. x) \<in> auto G"
wenzelm@14666
    80
  by (simp add: auto_def hom_def restrictI group.axioms id_Bij)
paulson@13945
    81
paulson@13945
    82
lemma mult_funcset: "group G ==> mult G \<in> carrier G -> carrier G -> carrier G"
paulson@13945
    83
  by (simp add:  Pi_I group.axioms)
paulson@13945
    84
paulson@13945
    85
lemma restrict_Inv_hom:
paulson@13945
    86
      "[|group G; h \<in> hom G G; h \<in> Bij (carrier G)|]
paulson@13945
    87
       ==> restrict (Inv (carrier G) h) (carrier G) \<in> hom G G"
paulson@13945
    88
  by (simp add: hom_def Bij_Inv_mem restrictI mult_funcset
paulson@13945
    89
                group.axioms Bij_Inv_lemma)
paulson@13945
    90
paulson@13945
    91
lemma inv_BijGroup:
paulson@13945
    92
     "f \<in> Bij S ==> m_inv (BijGroup S) f = (%x: S. (Inv S f) x)"
paulson@13945
    93
apply (rule group.inv_equality)
paulson@13945
    94
apply (rule group_BijGroup)
wenzelm@14666
    95
apply (simp_all add: BijGroup_def restrict_Inv_Bij Bij_compose_restrict_eq)
paulson@13945
    96
done
paulson@13945
    97
paulson@13945
    98
lemma subgroup_auto:
paulson@13945
    99
      "group G ==> subgroup (auto G) (BijGroup (carrier G))"
wenzelm@14666
   100
apply (rule group.subgroupI)
wenzelm@14666
   101
    apply (rule group_BijGroup)
wenzelm@14666
   102
   apply (force simp add: auto_def BijGroup_def)
paulson@14853
   103
  apply (blast dest: id_in_auto)
paulson@13945
   104
 apply (simp del: restrict_apply
wenzelm@14666
   105
             add: inv_BijGroup auto_def restrict_Inv_Bij restrict_Inv_hom)
paulson@14761
   106
apply (auto simp add: BijGroup_def auto_def Bij_imp_funcset group.hom_compose
paulson@14761
   107
                      compose_Bij)
paulson@13945
   108
done
paulson@13945
   109
paulson@13945
   110
theorem AutoGroup: "group G ==> group (AutoGroup G)"
wenzelm@14666
   111
apply (simp add: AutoGroup_def)
paulson@13945
   112
apply (rule Group.subgroup.groupI)
wenzelm@14666
   113
apply (erule subgroup_auto)
wenzelm@14666
   114
apply (insert Bij.group_BijGroup [of "carrier G"])
wenzelm@14666
   115
apply (simp_all add: group_def)
paulson@13945
   116
done
paulson@13945
   117
paulson@13945
   118
end