src/HOL/Algebra/Bij.thy
author paulson
Tue Jun 28 15:27:45 2005 +0200 (2005-06-28)
changeset 16587 b34c8aa657a5
parent 16417 9bc16273c2d4
child 20318 0e0ea63fe768
permissions -rw-r--r--
Constant "If" is now local
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
haftmann@16417
     8
theory Bij imports Group begin
paulson@13945
     9
paulson@13945
    10
constdefs
paulson@14963
    11
  Bij :: "'a set \<Rightarrow> ('a \<Rightarrow> 'a) set"
paulson@13945
    12
    --{*Only extensional functions, since otherwise we get too many.*}
paulson@14963
    13
  "Bij S \<equiv> extensional S \<inter> {f. bij_betw f S S}"
paulson@13945
    14
paulson@14963
    15
  BijGroup :: "'a set \<Rightarrow> ('a \<Rightarrow> 'a) monoid"
paulson@14963
    16
  "BijGroup S \<equiv>
paulson@14963
    17
    \<lparr>carrier = Bij S,
paulson@14963
    18
     mult = \<lambda>g \<in> Bij S. \<lambda>f \<in> Bij S. compose S g f,
paulson@14963
    19
     one = \<lambda>x \<in> S. x\<rparr>"
paulson@13945
    20
paulson@13945
    21
paulson@13945
    22
declare Id_compose [simp] compose_Id [simp]
paulson@13945
    23
paulson@14963
    24
lemma Bij_imp_extensional: "f \<in> Bij S \<Longrightarrow> f \<in> extensional S"
wenzelm@14666
    25
  by (simp add: Bij_def)
paulson@13945
    26
paulson@14963
    27
lemma Bij_imp_funcset: "f \<in> Bij S \<Longrightarrow> f \<in> S \<rightarrow> 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@14963
    33
lemma restrict_Inv_Bij: "f \<in> Bij S \<Longrightarrow> (\<lambda>x \<in> 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@14963
    39
lemma compose_Bij: "\<lbrakk>x \<in> Bij S; y \<in> Bij S\<rbrakk> \<Longrightarrow> 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@14963
    43
     "f \<in> Bij S \<Longrightarrow> 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@14963
    60
lemma Bij_Inv_mem: "\<lbrakk> f \<in> Bij S;  x \<in> S\<rbrakk> \<Longrightarrow> 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@14963
    64
 assumes eq: "\<And>x y. \<lbrakk>x \<in> S; y \<in> S\<rbrakk> \<Longrightarrow> h(g x y) = g (h x) (h y)"
paulson@14963
    65
 shows "\<lbrakk>h \<in> Bij S;  g \<in> S \<rightarrow> S \<rightarrow> S;  x \<in> S;  y \<in> S\<rbrakk>
paulson@14963
    66
        \<Longrightarrow> 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@14963
    69
 apply (simp add: eq [symmetric] Inv_f_f funcset_mem [THEN funcset_mem], blast)
paulson@13945
    70
done
paulson@13945
    71
paulson@14963
    72
paulson@13945
    73
constdefs
paulson@14963
    74
  auto :: "('a, 'b) monoid_scheme \<Rightarrow> ('a \<Rightarrow> 'a) set"
paulson@14963
    75
  "auto G \<equiv> hom G G \<inter> Bij (carrier G)"
paulson@13945
    76
paulson@14963
    77
  AutoGroup :: "('a, 'c) monoid_scheme \<Rightarrow> ('a \<Rightarrow> 'a) monoid"
paulson@14963
    78
  "AutoGroup G \<equiv> BijGroup (carrier G) \<lparr>carrier := auto G\<rparr>"
paulson@13945
    79
paulson@14963
    80
lemma (in group) id_in_auto: "(\<lambda>x \<in> carrier G. x) \<in> auto G"
wenzelm@14666
    81
  by (simp add: auto_def hom_def restrictI group.axioms id_Bij)
paulson@13945
    82
paulson@14963
    83
lemma (in group) mult_funcset: "mult G \<in> carrier G \<rightarrow> carrier G \<rightarrow> carrier G"
paulson@13945
    84
  by (simp add:  Pi_I group.axioms)
paulson@13945
    85
paulson@14963
    86
lemma (in group) restrict_Inv_hom:
paulson@14963
    87
      "\<lbrakk>h \<in> hom G G; h \<in> Bij (carrier G)\<rbrakk>
paulson@14963
    88
       \<Longrightarrow> restrict (Inv (carrier G) h) (carrier G) \<in> hom G G"
paulson@13945
    89
  by (simp add: hom_def Bij_Inv_mem restrictI mult_funcset
paulson@13945
    90
                group.axioms Bij_Inv_lemma)
paulson@13945
    91
paulson@13945
    92
lemma inv_BijGroup:
paulson@14963
    93
     "f \<in> Bij S \<Longrightarrow> m_inv (BijGroup S) f = (\<lambda>x \<in> S. (Inv S f) x)"
paulson@13945
    94
apply (rule group.inv_equality)
paulson@13945
    95
apply (rule group_BijGroup)
wenzelm@14666
    96
apply (simp_all add: BijGroup_def restrict_Inv_Bij Bij_compose_restrict_eq)
paulson@13945
    97
done
paulson@13945
    98
paulson@14963
    99
lemma (in group) subgroup_auto:
paulson@14963
   100
      "subgroup (auto G) (BijGroup (carrier G))"
paulson@14963
   101
proof (rule subgroup.intro)
paulson@14963
   102
  show "auto G \<subseteq> carrier (BijGroup (carrier G))"
paulson@14963
   103
    by (force simp add: auto_def BijGroup_def)
paulson@14963
   104
next
paulson@14963
   105
  fix x y
paulson@14963
   106
  assume "x \<in> auto G" "y \<in> auto G" 
paulson@14963
   107
  thus "x \<otimes>\<^bsub>BijGroup (carrier G)\<^esub> y \<in> auto G"
paulson@14963
   108
    by (force simp add: BijGroup_def is_group auto_def Bij_imp_funcset 
paulson@14963
   109
                        group.hom_compose compose_Bij)
paulson@14963
   110
next
paulson@14963
   111
  show "\<one>\<^bsub>BijGroup (carrier G)\<^esub> \<in> auto G" by (simp add:  BijGroup_def id_in_auto)
paulson@14963
   112
next
paulson@14963
   113
  fix x 
paulson@14963
   114
  assume "x \<in> auto G" 
paulson@14963
   115
  thus "inv\<^bsub>BijGroup (carrier G)\<^esub> x \<in> auto G"
paulson@14963
   116
    by (simp del: restrict_apply
wenzelm@14666
   117
             add: inv_BijGroup auto_def restrict_Inv_Bij restrict_Inv_hom)
paulson@14963
   118
qed
paulson@13945
   119
paulson@14963
   120
theorem (in group) AutoGroup: "group (AutoGroup G)"
paulson@14963
   121
by (simp add: AutoGroup_def subgroup.subgroup_is_group subgroup_auto 
paulson@14963
   122
              group_BijGroup)
paulson@13945
   123
paulson@13945
   124
end