src/HOL/Algebra/Bij.thy
author wenzelm
Fri Apr 23 21:46:04 2004 +0200 (2004-04-23)
changeset 14666 65f8680c3f16
parent 13945 5433b2755e98
child 14706 71590b7733b7
permissions -rw-r--r--
improved notation;
paulson@13945
     1
(*  Title:      HOL/Algebra/Bij
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.*}
wenzelm@14666
    13
  "Bij S == extensional S \<inter> {f. f`S = S & inj_on f 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"
wenzelm@14666
    28
  by (auto simp add: Bij_def Pi_def)
paulson@13945
    29
paulson@13945
    30
lemma Bij_imp_apply: "f \<in> Bij S ==> f ` S = S"
wenzelm@14666
    31
  by (simp add: Bij_def)
paulson@13945
    32
paulson@13945
    33
lemma Bij_imp_inj_on: "f \<in> Bij S ==> inj_on f S"
wenzelm@14666
    34
  by (simp add: Bij_def)
paulson@13945
    35
paulson@13945
    36
lemma BijI: "[| f \<in> extensional(S); f`S = S; inj_on f S |] ==> f \<in> Bij S"
wenzelm@14666
    37
  by (simp add: Bij_def)
paulson@13945
    38
paulson@13945
    39
wenzelm@14666
    40
subsection {*Bijections Form a Group *}
paulson@13945
    41
paulson@13945
    42
lemma restrict_Inv_Bij: "f \<in> Bij S ==> (%x:S. (Inv S f) x) \<in> Bij S"
paulson@13945
    43
apply (simp add: Bij_def)
paulson@13945
    44
apply (intro conjI)
paulson@13945
    45
txt{*Proving @{term "restrict (Inv S f) S ` S = S"}*}
paulson@13945
    46
 apply (rule equalityI)
paulson@13945
    47
  apply (force simp add: Inv_mem) --{*first inclusion*}
paulson@13945
    48
 apply (rule subsetI)   --{*second inclusion*}
paulson@13945
    49
 apply (rule_tac x = "f x" in image_eqI)
paulson@13945
    50
  apply (force intro:  simp add: Inv_f_f, blast)
paulson@13945
    51
txt{*Remaining goal: @{term "inj_on (restrict (Inv S f) S) S"}*}
paulson@13945
    52
apply (rule inj_onI)
paulson@13945
    53
apply (auto elim: Inv_injective)
paulson@13945
    54
done
paulson@13945
    55
paulson@13945
    56
lemma id_Bij: "(\<lambda>x\<in>S. x) \<in> Bij S "
paulson@13945
    57
apply (rule BijI)
paulson@13945
    58
apply (auto simp add: inj_on_def)
paulson@13945
    59
done
paulson@13945
    60
paulson@13945
    61
lemma compose_Bij: "[| x \<in> Bij S; y \<in> Bij S|] ==> compose S x y \<in> Bij S"
paulson@13945
    62
apply (rule BijI)
wenzelm@14666
    63
  apply (simp add: compose_extensional)
paulson@13945
    64
 apply (blast del: equalityI
paulson@13945
    65
              intro: surj_compose dest: Bij_imp_apply Bij_imp_inj_on)
paulson@13945
    66
apply (blast intro: inj_on_compose dest: Bij_imp_apply Bij_imp_inj_on)
paulson@13945
    67
done
paulson@13945
    68
paulson@13945
    69
lemma Bij_compose_restrict_eq:
paulson@13945
    70
     "f \<in> Bij S ==> compose S (restrict (Inv S f) S) f = (\<lambda>x\<in>S. x)"
paulson@13945
    71
apply (rule compose_Inv_id)
paulson@13945
    72
 apply (simp add: Bij_imp_inj_on)
wenzelm@14666
    73
apply (simp add: Bij_imp_apply)
paulson@13945
    74
done
paulson@13945
    75
paulson@13945
    76
theorem group_BijGroup: "group (BijGroup S)"
wenzelm@14666
    77
apply (simp add: BijGroup_def)
paulson@13945
    78
apply (rule groupI)
paulson@13945
    79
    apply (simp add: compose_Bij)
paulson@13945
    80
   apply (simp add: id_Bij)
paulson@13945
    81
  apply (simp add: compose_Bij)
paulson@13945
    82
  apply (blast intro: compose_assoc [symmetric] Bij_imp_funcset)
paulson@13945
    83
 apply (simp add: id_Bij Bij_imp_funcset Bij_imp_extensional, simp)
wenzelm@14666
    84
apply (blast intro: Bij_compose_restrict_eq restrict_Inv_Bij)
paulson@13945
    85
done
paulson@13945
    86
paulson@13945
    87
paulson@13945
    88
subsection{*Automorphisms Form a Group*}
paulson@13945
    89
paulson@13945
    90
lemma Bij_Inv_mem: "[|  f \<in> Bij S;  x : S |] ==> Inv S f x : S"
wenzelm@14666
    91
by (simp add: Bij_def Inv_mem)
paulson@13945
    92
paulson@13945
    93
lemma Bij_Inv_lemma:
paulson@13945
    94
 assumes eq: "!!x y. [|x \<in> S; y \<in> S|] ==> h(g x y) = g (h x) (h y)"
wenzelm@14666
    95
 shows "[| h \<in> Bij S;  g \<in> S \<rightarrow> S \<rightarrow> S;  x \<in> S;  y \<in> S |]
paulson@13945
    96
        ==> Inv S h (g x y) = g (Inv S h x) (Inv S h y)"
wenzelm@14666
    97
apply (simp add: Bij_def)
paulson@13945
    98
apply (subgoal_tac "EX x':S. EX y':S. x = h x' & y = h y'", clarify)
paulson@13945
    99
 apply (simp add: eq [symmetric] Inv_f_f funcset_mem [THEN funcset_mem], blast)
paulson@13945
   100
done
paulson@13945
   101
paulson@13945
   102
constdefs
wenzelm@14666
   103
  auto :: "('a, 'b) monoid_scheme => ('a => 'a) set"
paulson@13945
   104
  "auto G == hom G G \<inter> Bij (carrier G)"
paulson@13945
   105
wenzelm@14666
   106
  AutoGroup :: "('a, 'c) monoid_scheme => ('a => 'a) monoid"
paulson@13945
   107
  "AutoGroup G == BijGroup (carrier G) (|carrier := auto G |)"
paulson@13945
   108
paulson@13945
   109
lemma id_in_auto: "group G ==> (%x: carrier G. x) \<in> auto G"
wenzelm@14666
   110
  by (simp add: auto_def hom_def restrictI group.axioms id_Bij)
paulson@13945
   111
paulson@13945
   112
lemma mult_funcset: "group G ==> mult G \<in> carrier G -> carrier G -> carrier G"
paulson@13945
   113
  by (simp add:  Pi_I group.axioms)
paulson@13945
   114
paulson@13945
   115
lemma restrict_Inv_hom:
paulson@13945
   116
      "[|group G; h \<in> hom G G; h \<in> Bij (carrier G)|]
paulson@13945
   117
       ==> restrict (Inv (carrier G) h) (carrier G) \<in> hom G G"
paulson@13945
   118
  by (simp add: hom_def Bij_Inv_mem restrictI mult_funcset
paulson@13945
   119
                group.axioms Bij_Inv_lemma)
paulson@13945
   120
paulson@13945
   121
lemma inv_BijGroup:
paulson@13945
   122
     "f \<in> Bij S ==> m_inv (BijGroup S) f = (%x: S. (Inv S f) x)"
paulson@13945
   123
apply (rule group.inv_equality)
paulson@13945
   124
apply (rule group_BijGroup)
wenzelm@14666
   125
apply (simp_all add: BijGroup_def restrict_Inv_Bij Bij_compose_restrict_eq)
paulson@13945
   126
done
paulson@13945
   127
paulson@13945
   128
lemma subgroup_auto:
paulson@13945
   129
      "group G ==> subgroup (auto G) (BijGroup (carrier G))"
wenzelm@14666
   130
apply (rule group.subgroupI)
wenzelm@14666
   131
    apply (rule group_BijGroup)
wenzelm@14666
   132
   apply (force simp add: auto_def BijGroup_def)
wenzelm@14666
   133
  apply (blast intro: dest: id_in_auto)
paulson@13945
   134
 apply (simp del: restrict_apply
wenzelm@14666
   135
             add: inv_BijGroup auto_def restrict_Inv_Bij restrict_Inv_hom)
paulson@13945
   136
apply (simp add: BijGroup_def auto_def Bij_imp_funcset compose_hom compose_Bij)
paulson@13945
   137
done
paulson@13945
   138
paulson@13945
   139
theorem AutoGroup: "group G ==> group (AutoGroup G)"
wenzelm@14666
   140
apply (simp add: AutoGroup_def)
paulson@13945
   141
apply (rule Group.subgroup.groupI)
wenzelm@14666
   142
apply (erule subgroup_auto)
wenzelm@14666
   143
apply (insert Bij.group_BijGroup [of "carrier G"])
wenzelm@14666
   144
apply (simp_all add: group_def)
paulson@13945
   145
done
paulson@13945
   146
paulson@13945
   147
end