| author | huffman | 
| Thu, 18 Jun 2009 08:45:26 -0700 | |
| changeset 31712 | 6f8aa9aea693 | 
| parent 29223 | e09c53289830 | 
| child 32960 | 69916a850301 | 
| permissions | -rw-r--r-- | 
| 14884 | 1 | (* Title: ZF/ex/Group.thy | 
| 2 | ||
| 3 | *) | |
| 4 | ||
| 5 | header {* Groups *}
 | |
| 6 | ||
| 16417 | 7 | theory Group imports Main begin | 
| 14884 | 8 | |
| 9 | text{*Based on work by Clemens Ballarin, Florian Kammueller, L C Paulson and
 | |
| 10 | Markus Wenzel.*} | |
| 11 | ||
| 12 | ||
| 13 | subsection {* Monoids *}
 | |
| 14 | ||
| 15 | (*First, we must simulate a record declaration: | |
| 16 | record monoid = | |
| 17 | carrier :: i | |
| 14891 | 18 | mult :: "[i,i] => i" (infixl "\<cdot>\<index>" 70) | 
| 14884 | 19 |   one :: i ("\<one>\<index>")
 | 
| 20 | *) | |
| 21 | ||
| 21233 | 22 | definition | 
| 21404 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
21233diff
changeset | 23 | carrier :: "i => i" where | 
| 21233 | 24 | "carrier(M) == fst(M)" | 
| 14884 | 25 | |
| 21404 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
21233diff
changeset | 26 | definition | 
| 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
21233diff
changeset | 27 | mmult :: "[i, i, i] => i" (infixl "\<cdot>\<index>" 70) where | 
| 21233 | 28 | "mmult(M,x,y) == fst(snd(M)) ` <x,y>" | 
| 14884 | 29 | |
| 21404 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
21233diff
changeset | 30 | definition | 
| 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
21233diff
changeset | 31 |   one :: "i => i" ("\<one>\<index>") where
 | 
| 21233 | 32 | "one(M) == fst(snd(snd(M)))" | 
| 14884 | 33 | |
| 21404 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
21233diff
changeset | 34 | definition | 
| 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
21233diff
changeset | 35 | update_carrier :: "[i,i] => i" where | 
| 21233 | 36 | "update_carrier(M,A) == <A,snd(M)>" | 
| 14884 | 37 | |
| 21233 | 38 | definition | 
| 21404 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
21233diff
changeset | 39 |   m_inv :: "i => i => i" ("inv\<index> _" [81] 80) where
 | 
| 21233 | 40 | "inv\<^bsub>G\<^esub> x == (THE y. y \<in> carrier(G) & y \<cdot>\<^bsub>G\<^esub> x = \<one>\<^bsub>G\<^esub> & x \<cdot>\<^bsub>G\<^esub> y = \<one>\<^bsub>G\<^esub>)" | 
| 14884 | 41 | |
| 29223 | 42 | locale monoid = fixes G (structure) | 
| 14884 | 43 | assumes m_closed [intro, simp]: | 
| 44 | "\<lbrakk>x \<in> carrier(G); y \<in> carrier(G)\<rbrakk> \<Longrightarrow> x \<cdot> y \<in> carrier(G)" | |
| 45 | and m_assoc: | |
| 46 | "\<lbrakk>x \<in> carrier(G); y \<in> carrier(G); z \<in> carrier(G)\<rbrakk> | |
| 47 | \<Longrightarrow> (x \<cdot> y) \<cdot> z = x \<cdot> (y \<cdot> z)" | |
| 48 | and one_closed [intro, simp]: "\<one> \<in> carrier(G)" | |
| 49 | and l_one [simp]: "x \<in> carrier(G) \<Longrightarrow> \<one> \<cdot> x = x" | |
| 50 | and r_one [simp]: "x \<in> carrier(G) \<Longrightarrow> x \<cdot> \<one> = x" | |
| 51 | ||
| 52 | text{*Simulating the record*}
 | |
| 53 | lemma carrier_eq [simp]: "carrier(<A,Z>) = A" | |
| 54 | by (simp add: carrier_def) | |
| 55 | ||
| 56 | lemma mult_eq [simp]: "mmult(<A,M,Z>, x, y) = M ` <x,y>" | |
| 57 | by (simp add: mmult_def) | |
| 58 | ||
| 59 | lemma one_eq [simp]: "one(<A,M,I,Z>) = I" | |
| 60 | by (simp add: one_def) | |
| 61 | ||
| 62 | lemma update_carrier_eq [simp]: "update_carrier(<A,Z>,B) = <B,Z>" | |
| 63 | by (simp add: update_carrier_def) | |
| 64 | ||
| 65 | lemma carrier_update_carrier [simp]: "carrier(update_carrier(M,B)) = B" | |
| 22931 | 66 | by (simp add: update_carrier_def) | 
| 14884 | 67 | |
| 68 | lemma mult_update_carrier [simp]: "mmult(update_carrier(M,B),x,y) = mmult(M,x,y)" | |
| 22931 | 69 | by (simp add: update_carrier_def mmult_def) | 
| 14884 | 70 | |
| 71 | lemma one_update_carrier [simp]: "one(update_carrier(M,B)) = one(M)" | |
| 22931 | 72 | by (simp add: update_carrier_def one_def) | 
| 14884 | 73 | |
| 74 | ||
| 75 | lemma (in monoid) inv_unique: | |
| 76 | assumes eq: "y \<cdot> x = \<one>" "x \<cdot> y' = \<one>" | |
| 77 | and G: "x \<in> carrier(G)" "y \<in> carrier(G)" "y' \<in> carrier(G)" | |
| 78 | shows "y = y'" | |
| 79 | proof - | |
| 80 | from G eq have "y = y \<cdot> (x \<cdot> y')" by simp | |
| 81 | also from G have "... = (y \<cdot> x) \<cdot> y'" by (simp add: m_assoc) | |
| 82 | also from G eq have "... = y'" by simp | |
| 83 | finally show ?thesis . | |
| 84 | qed | |
| 85 | ||
| 86 | text {*
 | |
| 87 | A group is a monoid all of whose elements are invertible. | |
| 88 | *} | |
| 89 | ||
| 90 | locale group = monoid + | |
| 91 | assumes inv_ex: | |
| 92 | "\<And>x. x \<in> carrier(G) \<Longrightarrow> \<exists>y \<in> carrier(G). y \<cdot> x = \<one> & x \<cdot> y = \<one>" | |
| 93 | ||
| 26199 | 94 | lemma (in group) is_group [simp]: "group(G)" by (rule group_axioms) | 
| 14884 | 95 | |
| 96 | theorem groupI: | |
| 27618 | 97 | fixes G (structure) | 
| 14884 | 98 | assumes m_closed [simp]: | 
| 99 | "\<And>x y. \<lbrakk>x \<in> carrier(G); y \<in> carrier(G)\<rbrakk> \<Longrightarrow> x \<cdot> y \<in> carrier(G)" | |
| 100 | and one_closed [simp]: "\<one> \<in> carrier(G)" | |
| 101 | and m_assoc: | |
| 102 | "\<And>x y z. \<lbrakk>x \<in> carrier(G); y \<in> carrier(G); z \<in> carrier(G)\<rbrakk> \<Longrightarrow> | |
| 103 | (x \<cdot> y) \<cdot> z = x \<cdot> (y \<cdot> z)" | |
| 104 | and l_one [simp]: "\<And>x. x \<in> carrier(G) \<Longrightarrow> \<one> \<cdot> x = x" | |
| 105 | and l_inv_ex: "\<And>x. x \<in> carrier(G) \<Longrightarrow> \<exists>y \<in> carrier(G). y \<cdot> x = \<one>" | |
| 106 | shows "group(G)" | |
| 107 | proof - | |
| 108 | have l_cancel [simp]: | |
| 109 | "\<And>x y z. \<lbrakk>x \<in> carrier(G); y \<in> carrier(G); z \<in> carrier(G)\<rbrakk> \<Longrightarrow> | |
| 110 | (x \<cdot> y = x \<cdot> z) <-> (y = z)" | |
| 111 | proof | |
| 112 | fix x y z | |
| 113 | assume G: "x \<in> carrier(G)" "y \<in> carrier(G)" "z \<in> carrier(G)" | |
| 114 |     { 
 | |
| 115 | assume eq: "x \<cdot> y = x \<cdot> z" | |
| 116 | with G l_inv_ex obtain x_inv where xG: "x_inv \<in> carrier(G)" | |
| 117 | and l_inv: "x_inv \<cdot> x = \<one>" by fast | |
| 118 | from G eq xG have "(x_inv \<cdot> x) \<cdot> y = (x_inv \<cdot> x) \<cdot> z" | |
| 119 | by (simp add: m_assoc) | |
| 120 | with G show "y = z" by (simp add: l_inv) | |
| 121 | next | |
| 122 | assume eq: "y = z" | |
| 123 | with G show "x \<cdot> y = x \<cdot> z" by simp | |
| 124 | } | |
| 125 | qed | |
| 126 | have r_one: | |
| 127 | "\<And>x. x \<in> carrier(G) \<Longrightarrow> x \<cdot> \<one> = x" | |
| 128 | proof - | |
| 129 | fix x | |
| 130 | assume x: "x \<in> carrier(G)" | |
| 131 | with l_inv_ex obtain x_inv where xG: "x_inv \<in> carrier(G)" | |
| 132 | and l_inv: "x_inv \<cdot> x = \<one>" by fast | |
| 133 | from x xG have "x_inv \<cdot> (x \<cdot> \<one>) = x_inv \<cdot> x" | |
| 134 | by (simp add: m_assoc [symmetric] l_inv) | |
| 135 | with x xG show "x \<cdot> \<one> = x" by simp | |
| 136 | qed | |
| 137 | have inv_ex: | |
| 138 | "!!x. x \<in> carrier(G) ==> \<exists>y \<in> carrier(G). y \<cdot> x = \<one> & x \<cdot> y = \<one>" | |
| 139 | proof - | |
| 140 | fix x | |
| 141 | assume x: "x \<in> carrier(G)" | |
| 142 | with l_inv_ex obtain y where y: "y \<in> carrier(G)" | |
| 143 | and l_inv: "y \<cdot> x = \<one>" by fast | |
| 144 | from x y have "y \<cdot> (x \<cdot> y) = y \<cdot> \<one>" | |
| 145 | by (simp add: m_assoc [symmetric] l_inv r_one) | |
| 146 | with x y have r_inv: "x \<cdot> y = \<one>" | |
| 147 | by simp | |
| 148 | from x y show "\<exists>y \<in> carrier(G). y \<cdot> x = \<one> & x \<cdot> y = \<one>" | |
| 149 | by (fast intro: l_inv r_inv) | |
| 150 | qed | |
| 151 | show ?thesis | |
| 152 | by (blast intro: group.intro monoid.intro group_axioms.intro | |
| 153 | prems r_one inv_ex) | |
| 154 | qed | |
| 155 | ||
| 156 | lemma (in group) inv [simp]: | |
| 157 | "x \<in> carrier(G) \<Longrightarrow> inv x \<in> carrier(G) & inv x \<cdot> x = \<one> & x \<cdot> inv x = \<one>" | |
| 158 | apply (frule inv_ex) | |
| 159 | apply (unfold Bex_def m_inv_def) | |
| 160 | apply (erule exE) | |
| 161 | apply (rule theI) | |
| 162 | apply (rule ex1I, assumption) | |
| 163 | apply (blast intro: inv_unique) | |
| 164 | done | |
| 165 | ||
| 166 | lemma (in group) inv_closed [intro!]: | |
| 167 | "x \<in> carrier(G) \<Longrightarrow> inv x \<in> carrier(G)" | |
| 168 | by simp | |
| 169 | ||
| 170 | lemma (in group) l_inv: | |
| 171 | "x \<in> carrier(G) \<Longrightarrow> inv x \<cdot> x = \<one>" | |
| 172 | by simp | |
| 173 | ||
| 174 | lemma (in group) r_inv: | |
| 175 | "x \<in> carrier(G) \<Longrightarrow> x \<cdot> inv x = \<one>" | |
| 176 | by simp | |
| 177 | ||
| 178 | ||
| 179 | subsection {* Cancellation Laws and Basic Properties *}
 | |
| 180 | ||
| 181 | lemma (in group) l_cancel [simp]: | |
| 182 | assumes [simp]: "x \<in> carrier(G)" "y \<in> carrier(G)" "z \<in> carrier(G)" | |
| 183 | shows "(x \<cdot> y = x \<cdot> z) <-> (y = z)" | |
| 184 | proof | |
| 185 | assume eq: "x \<cdot> y = x \<cdot> z" | |
| 186 | hence "(inv x \<cdot> x) \<cdot> y = (inv x \<cdot> x) \<cdot> z" | |
| 187 | by (simp only: m_assoc inv_closed prems) | |
| 188 | thus "y = z" by simp | |
| 189 | next | |
| 190 | assume eq: "y = z" | |
| 191 | then show "x \<cdot> y = x \<cdot> z" by simp | |
| 192 | qed | |
| 193 | ||
| 194 | lemma (in group) r_cancel [simp]: | |
| 195 | assumes [simp]: "x \<in> carrier(G)" "y \<in> carrier(G)" "z \<in> carrier(G)" | |
| 196 | shows "(y \<cdot> x = z \<cdot> x) <-> (y = z)" | |
| 197 | proof | |
| 198 | assume eq: "y \<cdot> x = z \<cdot> x" | |
| 199 | then have "y \<cdot> (x \<cdot> inv x) = z \<cdot> (x \<cdot> inv x)" | |
| 200 | by (simp only: m_assoc [symmetric] inv_closed prems) | |
| 201 | thus "y = z" by simp | |
| 202 | next | |
| 203 | assume eq: "y = z" | |
| 204 | thus "y \<cdot> x = z \<cdot> x" by simp | |
| 205 | qed | |
| 206 | ||
| 207 | lemma (in group) inv_comm: | |
| 208 | assumes inv: "x \<cdot> y = \<one>" | |
| 209 | and G: "x \<in> carrier(G)" "y \<in> carrier(G)" | |
| 210 | shows "y \<cdot> x = \<one>" | |
| 211 | proof - | |
| 212 | from G have "x \<cdot> y \<cdot> x = x \<cdot> \<one>" by (auto simp add: inv) | |
| 213 | with G show ?thesis by (simp del: r_one add: m_assoc) | |
| 214 | qed | |
| 215 | ||
| 216 | lemma (in group) inv_equality: | |
| 217 | "\<lbrakk>y \<cdot> x = \<one>; x \<in> carrier(G); y \<in> carrier(G)\<rbrakk> \<Longrightarrow> inv x = y" | |
| 218 | apply (simp add: m_inv_def) | |
| 219 | apply (rule the_equality) | |
| 220 | apply (simp add: inv_comm [of y x]) | |
| 221 | apply (rule r_cancel [THEN iffD1], auto) | |
| 222 | done | |
| 223 | ||
| 224 | lemma (in group) inv_one [simp]: | |
| 225 | "inv \<one> = \<one>" | |
| 226 | by (auto intro: inv_equality) | |
| 227 | ||
| 228 | lemma (in group) inv_inv [simp]: "x \<in> carrier(G) \<Longrightarrow> inv (inv x) = x" | |
| 229 | by (auto intro: inv_equality) | |
| 230 | ||
| 231 | text{*This proof is by cancellation*}
 | |
| 232 | lemma (in group) inv_mult_group: | |
| 233 | "\<lbrakk>x \<in> carrier(G); y \<in> carrier(G)\<rbrakk> \<Longrightarrow> inv (x \<cdot> y) = inv y \<cdot> inv x" | |
| 234 | proof - | |
| 235 | assume G: "x \<in> carrier(G)" "y \<in> carrier(G)" | |
| 236 | then have "inv (x \<cdot> y) \<cdot> (x \<cdot> y) = (inv y \<cdot> inv x) \<cdot> (x \<cdot> y)" | |
| 237 | by (simp add: m_assoc l_inv) (simp add: m_assoc [symmetric] l_inv) | |
| 238 | with G show ?thesis by (simp_all del: inv add: inv_closed) | |
| 239 | qed | |
| 240 | ||
| 241 | ||
| 242 | subsection {* Substructures *}
 | |
| 243 | ||
| 29223 | 244 | locale subgroup = fixes H and G (structure) | 
| 14884 | 245 | assumes subset: "H \<subseteq> carrier(G)" | 
| 246 | and m_closed [intro, simp]: "\<lbrakk>x \<in> H; y \<in> H\<rbrakk> \<Longrightarrow> x \<cdot> y \<in> H" | |
| 247 | and one_closed [simp]: "\<one> \<in> H" | |
| 248 | and m_inv_closed [intro,simp]: "x \<in> H \<Longrightarrow> inv x \<in> H" | |
| 249 | ||
| 250 | ||
| 251 | lemma (in subgroup) mem_carrier [simp]: | |
| 252 | "x \<in> H \<Longrightarrow> x \<in> carrier(G)" | |
| 253 | using subset by blast | |
| 254 | ||
| 255 | ||
| 256 | lemma subgroup_imp_subset: | |
| 257 | "subgroup(H,G) \<Longrightarrow> H \<subseteq> carrier(G)" | |
| 258 | by (rule subgroup.subset) | |
| 259 | ||
| 260 | lemma (in subgroup) group_axiomsI [intro]: | |
| 27618 | 261 | assumes "group(G)" | 
| 14884 | 262 | shows "group_axioms (update_carrier(G,H))" | 
| 27618 | 263 | proof - | 
| 29223 | 264 | interpret group G by fact | 
| 27618 | 265 | show ?thesis by (force intro: group_axioms.intro l_inv r_inv) | 
| 266 | qed | |
| 14884 | 267 | |
| 14891 | 268 | lemma (in subgroup) is_group [intro]: | 
| 27618 | 269 | assumes "group(G)" | 
| 14891 | 270 | shows "group (update_carrier(G,H))" | 
| 27618 | 271 | proof - | 
| 29223 | 272 | interpret group G by fact | 
| 27618 | 273 | show ?thesis | 
| 14884 | 274 | by (rule groupI) (auto intro: m_assoc l_inv mem_carrier) | 
| 27618 | 275 | qed | 
| 14884 | 276 | |
| 277 | text {*
 | |
| 278 |   Since @{term H} is nonempty, it contains some element @{term x}.  Since
 | |
| 279 |   it is closed under inverse, it contains @{text "inv x"}.  Since
 | |
| 280 |   it is closed under product, it contains @{text "x \<cdot> inv x = \<one>"}.
 | |
| 281 | *} | |
| 282 | ||
| 283 | text {*
 | |
| 284 |   Since @{term H} is nonempty, it contains some element @{term x}.  Since
 | |
| 285 |   it is closed under inverse, it contains @{text "inv x"}.  Since
 | |
| 286 |   it is closed under product, it contains @{text "x \<cdot> inv x = \<one>"}.
 | |
| 287 | *} | |
| 288 | ||
| 289 | lemma (in group) one_in_subset: | |
| 290 | "\<lbrakk>H \<subseteq> carrier(G); H \<noteq> 0; \<forall>a \<in> H. inv a \<in> H; \<forall>a\<in>H. \<forall>b\<in>H. a \<cdot> b \<in> H\<rbrakk> | |
| 291 | \<Longrightarrow> \<one> \<in> H" | |
| 292 | by (force simp add: l_inv) | |
| 293 | ||
| 294 | text {* A characterization of subgroups: closed, non-empty subset. *}
 | |
| 295 | ||
| 296 | declare monoid.one_closed [simp] group.inv_closed [simp] | |
| 297 | monoid.l_one [simp] monoid.r_one [simp] group.inv_inv [simp] | |
| 298 | ||
| 299 | lemma subgroup_nonempty: | |
| 300 | "~ subgroup(0,G)" | |
| 301 | by (blast dest: subgroup.one_closed) | |
| 302 | ||
| 303 | ||
| 304 | subsection {* Direct Products *}
 | |
| 305 | ||
| 21233 | 306 | definition | 
| 21404 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
21233diff
changeset | 307 | DirProdGroup :: "[i,i] => i" (infixr "\<Otimes>" 80) where | 
| 14884 | 308 | "G \<Otimes> H == <carrier(G) \<times> carrier(H), | 
| 309 | (\<lambda><<g,h>, <g', h'>> | |
| 310 | \<in> (carrier(G) \<times> carrier(H)) \<times> (carrier(G) \<times> carrier(H)). | |
| 311 | <g \<cdot>\<^bsub>G\<^esub> g', h \<cdot>\<^bsub>H\<^esub> h'>), | |
| 312 | <\<one>\<^bsub>G\<^esub>, \<one>\<^bsub>H\<^esub>>, 0>" | |
| 313 | ||
| 314 | lemma DirProdGroup_group: | |
| 27618 | 315 | assumes "group(G)" and "group(H)" | 
| 14884 | 316 | shows "group (G \<Otimes> H)" | 
| 27618 | 317 | proof - | 
| 29223 | 318 | interpret G: group G by fact | 
| 319 | interpret H: group H by fact | |
| 27618 | 320 | show ?thesis by (force intro!: groupI G.m_assoc H.m_assoc G.l_inv H.l_inv | 
| 14884 | 321 | simp add: DirProdGroup_def) | 
| 27618 | 322 | qed | 
| 14884 | 323 | |
| 324 | lemma carrier_DirProdGroup [simp]: | |
| 325 | "carrier (G \<Otimes> H) = carrier(G) \<times> carrier(H)" | |
| 326 | by (simp add: DirProdGroup_def) | |
| 327 | ||
| 328 | lemma one_DirProdGroup [simp]: | |
| 329 | "\<one>\<^bsub>G \<Otimes> H\<^esub> = <\<one>\<^bsub>G\<^esub>, \<one>\<^bsub>H\<^esub>>" | |
| 330 | by (simp add: DirProdGroup_def) | |
| 331 | ||
| 332 | lemma mult_DirProdGroup [simp]: | |
| 333 | "[|g \<in> carrier(G); h \<in> carrier(H); g' \<in> carrier(G); h' \<in> carrier(H)|] | |
| 334 | ==> <g, h> \<cdot>\<^bsub>G \<Otimes> H\<^esub> <g', h'> = <g \<cdot>\<^bsub>G\<^esub> g', h \<cdot>\<^bsub>H\<^esub> h'>" | |
| 22931 | 335 | by (simp add: DirProdGroup_def) | 
| 14884 | 336 | |
| 337 | lemma inv_DirProdGroup [simp]: | |
| 27618 | 338 | assumes "group(G)" and "group(H)" | 
| 14884 | 339 | assumes g: "g \<in> carrier(G)" | 
| 340 | and h: "h \<in> carrier(H)" | |
| 341 | shows "inv \<^bsub>G \<Otimes> H\<^esub> <g, h> = <inv\<^bsub>G\<^esub> g, inv\<^bsub>H\<^esub> h>" | |
| 342 | apply (rule group.inv_equality [OF DirProdGroup_group]) | |
| 19931 
fb32b43e7f80
Restructured locales with predicates: import is now an interpretation.
 ballarin parents: 
16417diff
changeset | 343 | apply (simp_all add: prems group.l_inv) | 
| 14884 | 344 | done | 
| 345 | ||
| 346 | subsection {* Isomorphisms *}
 | |
| 347 | ||
| 21233 | 348 | definition | 
| 21404 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
21233diff
changeset | 349 | hom :: "[i,i] => i" where | 
| 14884 | 350 | "hom(G,H) == | 
| 351 |     {h \<in> carrier(G) -> carrier(H).
 | |
| 352 | (\<forall>x \<in> carrier(G). \<forall>y \<in> carrier(G). h ` (x \<cdot>\<^bsub>G\<^esub> y) = (h ` x) \<cdot>\<^bsub>H\<^esub> (h ` y))}" | |
| 353 | ||
| 354 | lemma hom_mult: | |
| 355 | "\<lbrakk>h \<in> hom(G,H); x \<in> carrier(G); y \<in> carrier(G)\<rbrakk> | |
| 356 | \<Longrightarrow> h ` (x \<cdot>\<^bsub>G\<^esub> y) = h ` x \<cdot>\<^bsub>H\<^esub> h ` y" | |
| 357 | by (simp add: hom_def) | |
| 358 | ||
| 359 | lemma hom_closed: | |
| 360 | "\<lbrakk>h \<in> hom(G,H); x \<in> carrier(G)\<rbrakk> \<Longrightarrow> h ` x \<in> carrier(H)" | |
| 361 | by (auto simp add: hom_def) | |
| 362 | ||
| 363 | lemma (in group) hom_compose: | |
| 364 | "\<lbrakk>h \<in> hom(G,H); i \<in> hom(H,I)\<rbrakk> \<Longrightarrow> i O h \<in> hom(G,I)" | |
| 365 | by (force simp add: hom_def comp_fun) | |
| 366 | ||
| 367 | lemma hom_is_fun: | |
| 368 | "h \<in> hom(G,H) \<Longrightarrow> h \<in> carrier(G) -> carrier(H)" | |
| 369 | by (simp add: hom_def) | |
| 370 | ||
| 371 | ||
| 372 | subsection {* Isomorphisms *}
 | |
| 373 | ||
| 21233 | 374 | definition | 
| 21404 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
21233diff
changeset | 375 | iso :: "[i,i] => i" (infixr "\<cong>" 60) where | 
| 14884 | 376 | "G \<cong> H == hom(G,H) \<inter> bij(carrier(G), carrier(H))" | 
| 377 | ||
| 378 | lemma (in group) iso_refl: "id(carrier(G)) \<in> G \<cong> G" | |
| 22931 | 379 | by (simp add: iso_def hom_def id_type id_bij) | 
| 14884 | 380 | |
| 381 | ||
| 382 | lemma (in group) iso_sym: | |
| 383 | "h \<in> G \<cong> H \<Longrightarrow> converse(h) \<in> H \<cong> G" | |
| 384 | apply (simp add: iso_def bij_converse_bij, clarify) | |
| 385 | apply (subgoal_tac "converse(h) \<in> carrier(H) \<rightarrow> carrier(G)") | |
| 386 | prefer 2 apply (simp add: bij_converse_bij bij_is_fun) | |
| 387 | apply (auto intro: left_inverse_eq [of _ "carrier(G)" "carrier(H)"] | |
| 388 | simp add: hom_def bij_is_inj right_inverse_bij); | |
| 389 | done | |
| 390 | ||
| 391 | lemma (in group) iso_trans: | |
| 392 | "\<lbrakk>h \<in> G \<cong> H; i \<in> H \<cong> I\<rbrakk> \<Longrightarrow> i O h \<in> G \<cong> I" | |
| 22931 | 393 | by (auto simp add: iso_def hom_compose comp_bij) | 
| 14884 | 394 | |
| 395 | lemma DirProdGroup_commute_iso: | |
| 27618 | 396 | assumes "group(G)" and "group(H)" | 
| 14884 | 397 | shows "(\<lambda><x,y> \<in> carrier(G \<Otimes> H). <y,x>) \<in> (G \<Otimes> H) \<cong> (H \<Otimes> G)" | 
| 27618 | 398 | proof - | 
| 29223 | 399 | interpret group G by fact | 
| 400 | interpret group H by fact | |
| 27618 | 401 | show ?thesis by (auto simp add: iso_def hom_def inj_def surj_def bij_def) | 
| 402 | qed | |
| 14884 | 403 | |
| 404 | lemma DirProdGroup_assoc_iso: | |
| 27618 | 405 | assumes "group(G)" and "group(H)" and "group(I)" | 
| 14884 | 406 | shows "(\<lambda><<x,y>,z> \<in> carrier((G \<Otimes> H) \<Otimes> I). <x,<y,z>>) | 
| 407 | \<in> ((G \<Otimes> H) \<Otimes> I) \<cong> (G \<Otimes> (H \<Otimes> I))" | |
| 27618 | 408 | proof - | 
| 29223 | 409 | interpret group G by fact | 
| 410 | interpret group H by fact | |
| 411 | interpret group I by fact | |
| 27618 | 412 | show ?thesis | 
| 413 | by (auto intro: lam_type simp add: iso_def hom_def inj_def surj_def bij_def) | |
| 414 | qed | |
| 14884 | 415 | |
| 416 | text{*Basis for homomorphism proofs: we assume two groups @{term G} and
 | |
| 417 |   @term{H}, with a homomorphism @{term h} between them*}
 | |
| 29223 | 418 | locale group_hom = G: group G + H: group H | 
| 419 | for G (structure) and H (structure) and h + | |
| 14884 | 420 | assumes homh: "h \<in> hom(G,H)" | 
| 421 | notes hom_mult [simp] = hom_mult [OF homh] | |
| 422 | and hom_closed [simp] = hom_closed [OF homh] | |
| 423 | and hom_is_fun [simp] = hom_is_fun [OF homh] | |
| 424 | ||
| 425 | lemma (in group_hom) one_closed [simp]: | |
| 426 | "h ` \<one> \<in> carrier(H)" | |
| 427 | by simp | |
| 428 | ||
| 429 | lemma (in group_hom) hom_one [simp]: | |
| 430 | "h ` \<one> = \<one>\<^bsub>H\<^esub>" | |
| 431 | proof - | |
| 432 | have "h ` \<one> \<cdot>\<^bsub>H\<^esub> \<one>\<^bsub>H\<^esub> = (h ` \<one>) \<cdot>\<^bsub>H\<^esub> (h ` \<one>)" | |
| 433 | by (simp add: hom_mult [symmetric] del: hom_mult) | |
| 434 | then show ?thesis by (simp del: r_one) | |
| 435 | qed | |
| 436 | ||
| 437 | lemma (in group_hom) inv_closed [simp]: | |
| 438 | "x \<in> carrier(G) \<Longrightarrow> h ` (inv x) \<in> carrier(H)" | |
| 439 | by simp | |
| 440 | ||
| 441 | lemma (in group_hom) hom_inv [simp]: | |
| 442 | "x \<in> carrier(G) \<Longrightarrow> h ` (inv x) = inv\<^bsub>H\<^esub> (h ` x)" | |
| 443 | proof - | |
| 444 | assume x: "x \<in> carrier(G)" | |
| 445 | then have "h ` x \<cdot>\<^bsub>H\<^esub> h ` (inv x) = \<one>\<^bsub>H\<^esub>" | |
| 446 | by (simp add: hom_mult [symmetric] G.r_inv del: hom_mult) | |
| 447 | also from x have "... = h ` x \<cdot>\<^bsub>H\<^esub> inv\<^bsub>H\<^esub> (h ` x)" | |
| 448 | by (simp add: hom_mult [symmetric] H.r_inv del: hom_mult) | |
| 449 | finally have "h ` x \<cdot>\<^bsub>H\<^esub> h ` (inv x) = h ` x \<cdot>\<^bsub>H\<^esub> inv\<^bsub>H\<^esub> (h ` x)" . | |
| 450 | with x show ?thesis by (simp del: inv add: is_group) | |
| 451 | qed | |
| 452 | ||
| 453 | subsection {* Commutative Structures *}
 | |
| 454 | ||
| 455 | text {*
 | |
| 456 | Naming convention: multiplicative structures that are commutative | |
| 457 |   are called \emph{commutative}, additive structures are called
 | |
| 458 |   \emph{Abelian}.
 | |
| 459 | *} | |
| 460 | ||
| 461 | subsection {* Definition *}
 | |
| 462 | ||
| 463 | locale comm_monoid = monoid + | |
| 464 | assumes m_comm: "\<lbrakk>x \<in> carrier(G); y \<in> carrier(G)\<rbrakk> \<Longrightarrow> x \<cdot> y = y \<cdot> x" | |
| 465 | ||
| 466 | lemma (in comm_monoid) m_lcomm: | |
| 467 | "\<lbrakk>x \<in> carrier(G); y \<in> carrier(G); z \<in> carrier(G)\<rbrakk> \<Longrightarrow> | |
| 468 | x \<cdot> (y \<cdot> z) = y \<cdot> (x \<cdot> z)" | |
| 469 | proof - | |
| 470 | assume xyz: "x \<in> carrier(G)" "y \<in> carrier(G)" "z \<in> carrier(G)" | |
| 471 | from xyz have "x \<cdot> (y \<cdot> z) = (x \<cdot> y) \<cdot> z" by (simp add: m_assoc) | |
| 472 | also from xyz have "... = (y \<cdot> x) \<cdot> z" by (simp add: m_comm) | |
| 473 | also from xyz have "... = y \<cdot> (x \<cdot> z)" by (simp add: m_assoc) | |
| 474 | finally show ?thesis . | |
| 475 | qed | |
| 476 | ||
| 477 | lemmas (in comm_monoid) m_ac = m_assoc m_comm m_lcomm | |
| 478 | ||
| 479 | locale comm_group = comm_monoid + group | |
| 480 | ||
| 481 | lemma (in comm_group) inv_mult: | |
| 482 | "\<lbrakk>x \<in> carrier(G); y \<in> carrier(G)\<rbrakk> \<Longrightarrow> inv (x \<cdot> y) = inv x \<cdot> inv y" | |
| 483 | by (simp add: m_ac inv_mult_group) | |
| 484 | ||
| 485 | ||
| 486 | lemma (in group) subgroup_self: "subgroup (carrier(G),G)" | |
| 487 | by (simp add: subgroup_def prems) | |
| 488 | ||
| 489 | lemma (in group) subgroup_imp_group: | |
| 490 | "subgroup(H,G) \<Longrightarrow> group (update_carrier(G,H))" | |
| 14891 | 491 | by (simp add: subgroup.is_group) | 
| 14884 | 492 | |
| 493 | lemma (in group) subgroupI: | |
| 494 | assumes subset: "H \<subseteq> carrier(G)" and non_empty: "H \<noteq> 0" | |
| 495 | and inv: "!!a. a \<in> H ==> inv a \<in> H" | |
| 496 | and mult: "!!a b. [|a \<in> H; b \<in> H|] ==> a \<cdot> b \<in> H" | |
| 497 | shows "subgroup(H,G)" | |
| 498 | proof (simp add: subgroup_def prems) | |
| 499 | show "\<one> \<in> H" by (rule one_in_subset) (auto simp only: prems) | |
| 500 | qed | |
| 501 | ||
| 502 | ||
| 503 | subsection {* Bijections of a Set, Permutation Groups, Automorphism Groups *}
 | |
| 504 | ||
| 21233 | 505 | definition | 
| 21404 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
21233diff
changeset | 506 | BijGroup :: "i=>i" where | 
| 14884 | 507 | "BijGroup(S) == | 
| 508 | <bij(S,S), | |
| 509 | \<lambda><g,f> \<in> bij(S,S) \<times> bij(S,S). g O f, | |
| 510 | id(S), 0>" | |
| 511 | ||
| 512 | ||
| 513 | subsection {*Bijections Form a Group *}
 | |
| 514 | ||
| 515 | theorem group_BijGroup: "group(BijGroup(S))" | |
| 516 | apply (simp add: BijGroup_def) | |
| 517 | apply (rule groupI) | |
| 518 | apply (simp_all add: id_bij comp_bij comp_assoc) | |
| 519 | apply (simp add: id_bij bij_is_fun left_comp_id [of _ S S] fun_is_rel) | |
| 520 | apply (blast intro: left_comp_inverse bij_is_inj bij_converse_bij) | |
| 521 | done | |
| 522 | ||
| 523 | ||
| 524 | subsection{*Automorphisms Form a Group*}
 | |
| 525 | ||
| 526 | lemma Bij_Inv_mem: "\<lbrakk>f \<in> bij(S,S); x \<in> S\<rbrakk> \<Longrightarrow> converse(f) ` x \<in> S" | |
| 527 | by (blast intro: apply_funtype bij_is_fun bij_converse_bij) | |
| 528 | ||
| 529 | lemma inv_BijGroup: "f \<in> bij(S,S) \<Longrightarrow> m_inv (BijGroup(S), f) = converse(f)" | |
| 530 | apply (rule group.inv_equality) | |
| 531 | apply (rule group_BijGroup) | |
| 532 | apply (simp_all add: BijGroup_def bij_converse_bij | |
| 533 | left_comp_inverse [OF bij_is_inj]) | |
| 534 | done | |
| 535 | ||
| 536 | lemma iso_is_bij: "h \<in> G \<cong> H ==> h \<in> bij(carrier(G), carrier(H))" | |
| 537 | by (simp add: iso_def) | |
| 538 | ||
| 539 | ||
| 21233 | 540 | definition | 
| 21404 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
21233diff
changeset | 541 | auto :: "i=>i" where | 
| 14884 | 542 | "auto(G) == iso(G,G)" | 
| 543 | ||
| 21404 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
21233diff
changeset | 544 | definition | 
| 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
21233diff
changeset | 545 | AutoGroup :: "i=>i" where | 
| 14884 | 546 | "AutoGroup(G) == update_carrier(BijGroup(carrier(G)), auto(G))" | 
| 547 | ||
| 548 | ||
| 549 | lemma (in group) id_in_auto: "id(carrier(G)) \<in> auto(G)" | |
| 550 | by (simp add: iso_refl auto_def) | |
| 551 | ||
| 552 | lemma (in group) subgroup_auto: | |
| 553 | "subgroup (auto(G)) (BijGroup (carrier(G)))" | |
| 554 | proof (rule subgroup.intro) | |
| 555 | show "auto(G) \<subseteq> carrier (BijGroup (carrier(G)))" | |
| 556 | by (auto simp add: auto_def BijGroup_def iso_def) | |
| 557 | next | |
| 558 | fix x y | |
| 559 | assume "x \<in> auto(G)" "y \<in> auto(G)" | |
| 560 | thus "x \<cdot>\<^bsub>BijGroup (carrier(G))\<^esub> y \<in> auto(G)" | |
| 561 | by (auto simp add: BijGroup_def auto_def iso_def bij_is_fun | |
| 562 | group.hom_compose comp_bij) | |
| 563 | next | |
| 564 | show "\<one>\<^bsub>BijGroup (carrier(G))\<^esub> \<in> auto(G)" by (simp add: BijGroup_def id_in_auto) | |
| 565 | next | |
| 566 | fix x | |
| 567 | assume "x \<in> auto(G)" | |
| 568 | thus "inv\<^bsub>BijGroup (carrier(G))\<^esub> x \<in> auto(G)" | |
| 569 | by (simp add: auto_def inv_BijGroup iso_is_bij iso_sym) | |
| 570 | qed | |
| 571 | ||
| 572 | theorem (in group) AutoGroup: "group (AutoGroup(G))" | |
| 14891 | 573 | by (simp add: AutoGroup_def subgroup.is_group subgroup_auto group_BijGroup) | 
| 14884 | 574 | |
| 575 | ||
| 576 | ||
| 577 | subsection{*Cosets and Quotient Groups*}
 | |
| 578 | ||
| 21233 | 579 | definition | 
| 21404 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
21233diff
changeset | 580 | r_coset :: "[i,i,i] => i" (infixl "#>\<index>" 60) where | 
| 21233 | 581 |   "H #>\<^bsub>G\<^esub> a == \<Union>h\<in>H. {h \<cdot>\<^bsub>G\<^esub> a}"
 | 
| 14884 | 582 | |
| 21404 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
21233diff
changeset | 583 | definition | 
| 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
21233diff
changeset | 584 | l_coset :: "[i,i,i] => i" (infixl "<#\<index>" 60) where | 
| 21233 | 585 |   "a <#\<^bsub>G\<^esub> H == \<Union>h\<in>H. {a \<cdot>\<^bsub>G\<^esub> h}"
 | 
| 14884 | 586 | |
| 21404 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
21233diff
changeset | 587 | definition | 
| 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
21233diff
changeset | 588 |   RCOSETS  :: "[i,i] => i"  ("rcosets\<index> _" [81] 80) where
 | 
| 21233 | 589 |   "rcosets\<^bsub>G\<^esub> H == \<Union>a\<in>carrier(G). {H #>\<^bsub>G\<^esub> a}"
 | 
| 14884 | 590 | |
| 21404 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
21233diff
changeset | 591 | definition | 
| 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
21233diff
changeset | 592 | set_mult :: "[i,i,i] => i" (infixl "<#>\<index>" 60) where | 
| 21233 | 593 |   "H <#>\<^bsub>G\<^esub> K == \<Union>h\<in>H. \<Union>k\<in>K. {h \<cdot>\<^bsub>G\<^esub> k}"
 | 
| 14884 | 594 | |
| 21404 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
21233diff
changeset | 595 | definition | 
| 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
21233diff
changeset | 596 |   SET_INV  :: "[i,i] => i"  ("set'_inv\<index> _" [81] 80) where
 | 
| 21233 | 597 |   "set_inv\<^bsub>G\<^esub> H == \<Union>h\<in>H. {inv\<^bsub>G\<^esub> h}"
 | 
| 14884 | 598 | |
| 599 | ||
| 600 | locale normal = subgroup + group + | |
| 601 | assumes coset_eq: "(\<forall>x \<in> carrier(G). H #> x = x <# H)" | |
| 602 | ||
| 21233 | 603 | notation | 
| 604 | normal (infixl "\<lhd>" 60) | |
| 14884 | 605 | |
| 606 | ||
| 607 | subsection {*Basic Properties of Cosets*}
 | |
| 608 | ||
| 609 | lemma (in group) coset_mult_assoc: | |
| 610 | "\<lbrakk>M \<subseteq> carrier(G); g \<in> carrier(G); h \<in> carrier(G)\<rbrakk> | |
| 611 | \<Longrightarrow> (M #> g) #> h = M #> (g \<cdot> h)" | |
| 612 | by (force simp add: r_coset_def m_assoc) | |
| 613 | ||
| 614 | lemma (in group) coset_mult_one [simp]: "M \<subseteq> carrier(G) \<Longrightarrow> M #> \<one> = M" | |
| 615 | by (force simp add: r_coset_def) | |
| 616 | ||
| 617 | lemma (in group) solve_equation: | |
| 618 | "\<lbrakk>subgroup(H,G); x \<in> H; y \<in> H\<rbrakk> \<Longrightarrow> \<exists>h\<in>H. y = h \<cdot> x" | |
| 619 | apply (rule bexI [of _ "y \<cdot> (inv x)"]) | |
| 620 | apply (auto simp add: subgroup.m_closed subgroup.m_inv_closed m_assoc | |
| 621 | subgroup.subset [THEN subsetD]) | |
| 622 | done | |
| 623 | ||
| 624 | lemma (in group) repr_independence: | |
| 625 | "\<lbrakk>y \<in> H #> x; x \<in> carrier(G); subgroup(H,G)\<rbrakk> \<Longrightarrow> H #> x = H #> y" | |
| 626 | by (auto simp add: r_coset_def m_assoc [symmetric] | |
| 627 | subgroup.subset [THEN subsetD] | |
| 628 | subgroup.m_closed solve_equation) | |
| 629 | ||
| 630 | lemma (in group) coset_join2: | |
| 631 | "\<lbrakk>x \<in> carrier(G); subgroup(H,G); x\<in>H\<rbrakk> \<Longrightarrow> H #> x = H" | |
| 632 |   --{*Alternative proof is to put @{term "x=\<one>"} in @{text repr_independence}.*}
 | |
| 633 | by (force simp add: subgroup.m_closed r_coset_def solve_equation) | |
| 634 | ||
| 635 | lemma (in group) r_coset_subset_G: | |
| 636 | "\<lbrakk>H \<subseteq> carrier(G); x \<in> carrier(G)\<rbrakk> \<Longrightarrow> H #> x \<subseteq> carrier(G)" | |
| 637 | by (auto simp add: r_coset_def) | |
| 638 | ||
| 639 | lemma (in group) rcosI: | |
| 640 | "\<lbrakk>h \<in> H; H \<subseteq> carrier(G); x \<in> carrier(G)\<rbrakk> \<Longrightarrow> h \<cdot> x \<in> H #> x" | |
| 641 | by (auto simp add: r_coset_def) | |
| 642 | ||
| 643 | lemma (in group) rcosetsI: | |
| 644 | "\<lbrakk>H \<subseteq> carrier(G); x \<in> carrier(G)\<rbrakk> \<Longrightarrow> H #> x \<in> rcosets H" | |
| 645 | by (auto simp add: RCOSETS_def) | |
| 646 | ||
| 647 | ||
| 648 | text{*Really needed?*}
 | |
| 649 | lemma (in group) transpose_inv: | |
| 650 | "\<lbrakk>x \<cdot> y = z; x \<in> carrier(G); y \<in> carrier(G); z \<in> carrier(G)\<rbrakk> | |
| 651 | \<Longrightarrow> (inv x) \<cdot> z = y" | |
| 652 | by (force simp add: m_assoc [symmetric]) | |
| 653 | ||
| 654 | ||
| 655 | ||
| 656 | subsection {* Normal subgroups *}
 | |
| 657 | ||
| 658 | lemma normal_imp_subgroup: "H \<lhd> G ==> subgroup(H,G)" | |
| 659 | by (simp add: normal_def subgroup_def) | |
| 660 | ||
| 661 | lemma (in group) normalI: | |
| 662 | "subgroup(H,G) \<Longrightarrow> (\<forall>x \<in> carrier(G). H #> x = x <# H) \<Longrightarrow> H \<lhd> G"; | |
| 19931 
fb32b43e7f80
Restructured locales with predicates: import is now an interpretation.
 ballarin parents: 
16417diff
changeset | 663 | by (simp add: normal_def normal_axioms_def) | 
| 14884 | 664 | |
| 665 | lemma (in normal) inv_op_closed1: | |
| 666 | "\<lbrakk>x \<in> carrier(G); h \<in> H\<rbrakk> \<Longrightarrow> (inv x) \<cdot> h \<cdot> x \<in> H" | |
| 667 | apply (insert coset_eq) | |
| 668 | apply (auto simp add: l_coset_def r_coset_def) | |
| 669 | apply (drule bspec, assumption) | |
| 670 | apply (drule equalityD1 [THEN subsetD], blast, clarify) | |
| 671 | apply (simp add: m_assoc) | |
| 672 | apply (simp add: m_assoc [symmetric]) | |
| 673 | done | |
| 674 | ||
| 675 | lemma (in normal) inv_op_closed2: | |
| 676 | "\<lbrakk>x \<in> carrier(G); h \<in> H\<rbrakk> \<Longrightarrow> x \<cdot> h \<cdot> (inv x) \<in> H" | |
| 677 | apply (subgoal_tac "inv (inv x) \<cdot> h \<cdot> (inv x) \<in> H") | |
| 678 | apply simp | |
| 679 | apply (blast intro: inv_op_closed1) | |
| 680 | done | |
| 681 | ||
| 682 | text{*Alternative characterization of normal subgroups*}
 | |
| 683 | lemma (in group) normal_inv_iff: | |
| 684 | "(N \<lhd> G) <-> | |
| 685 | (subgroup(N,G) & (\<forall>x \<in> carrier(G). \<forall>h \<in> N. x \<cdot> h \<cdot> (inv x) \<in> N))" | |
| 686 | (is "_ <-> ?rhs") | |
| 687 | proof | |
| 688 | assume N: "N \<lhd> G" | |
| 689 | show ?rhs | |
| 690 | by (blast intro: N normal.inv_op_closed2 normal_imp_subgroup) | |
| 691 | next | |
| 692 | assume ?rhs | |
| 693 | hence sg: "subgroup(N,G)" | |
| 694 | and closed: "\<And>x. x\<in>carrier(G) \<Longrightarrow> \<forall>h\<in>N. x \<cdot> h \<cdot> inv x \<in> N" by auto | |
| 695 | hence sb: "N \<subseteq> carrier(G)" by (simp add: subgroup.subset) | |
| 696 | show "N \<lhd> G" | |
| 697 | proof (intro normalI [OF sg], simp add: l_coset_def r_coset_def, clarify) | |
| 698 | fix x | |
| 699 | assume x: "x \<in> carrier(G)" | |
| 700 |     show "(\<Union>h\<in>N. {h \<cdot> x}) = (\<Union>h\<in>N. {x \<cdot> h})"
 | |
| 701 | proof | |
| 702 |       show "(\<Union>h\<in>N. {h \<cdot> x}) \<subseteq> (\<Union>h\<in>N. {x \<cdot> h})"
 | |
| 703 | proof clarify | |
| 704 | fix n | |
| 705 | assume n: "n \<in> N" | |
| 706 |         show "n \<cdot> x \<in> (\<Union>h\<in>N. {x \<cdot> h})"
 | |
| 707 | proof (rule UN_I) | |
| 708 | from closed [of "inv x"] | |
| 709 | show "inv x \<cdot> n \<cdot> x \<in> N" by (simp add: x n) | |
| 710 |           show "n \<cdot> x \<in> {x \<cdot> (inv x \<cdot> n \<cdot> x)}"
 | |
| 711 | by (simp add: x n m_assoc [symmetric] sb [THEN subsetD]) | |
| 712 | qed | |
| 713 | qed | |
| 714 | next | |
| 715 |       show "(\<Union>h\<in>N. {x \<cdot> h}) \<subseteq> (\<Union>h\<in>N. {h \<cdot> x})"
 | |
| 716 | proof clarify | |
| 717 | fix n | |
| 718 | assume n: "n \<in> N" | |
| 719 |         show "x \<cdot> n \<in> (\<Union>h\<in>N. {h \<cdot> x})"
 | |
| 720 | proof (rule UN_I) | |
| 721 | show "x \<cdot> n \<cdot> inv x \<in> N" by (simp add: x n closed) | |
| 722 |           show "x \<cdot> n \<in> {x \<cdot> n \<cdot> inv x \<cdot> x}"
 | |
| 723 | by (simp add: x n m_assoc sb [THEN subsetD]) | |
| 724 | qed | |
| 725 | qed | |
| 726 | qed | |
| 727 | qed | |
| 728 | qed | |
| 729 | ||
| 730 | ||
| 731 | subsection{*More Properties of Cosets*}
 | |
| 732 | ||
| 733 | lemma (in group) l_coset_subset_G: | |
| 734 | "\<lbrakk>H \<subseteq> carrier(G); x \<in> carrier(G)\<rbrakk> \<Longrightarrow> x <# H \<subseteq> carrier(G)" | |
| 735 | by (auto simp add: l_coset_def subsetD) | |
| 736 | ||
| 737 | lemma (in group) l_coset_swap: | |
| 738 | "\<lbrakk>y \<in> x <# H; x \<in> carrier(G); subgroup(H,G)\<rbrakk> \<Longrightarrow> x \<in> y <# H" | |
| 739 | proof (simp add: l_coset_def) | |
| 740 | assume "\<exists>h\<in>H. y = x \<cdot> h" | |
| 741 | and x: "x \<in> carrier(G)" | |
| 742 | and sb: "subgroup(H,G)" | |
| 743 | then obtain h' where h': "h' \<in> H & x \<cdot> h' = y" by blast | |
| 744 | show "\<exists>h\<in>H. x = y \<cdot> h" | |
| 745 | proof | |
| 746 | show "x = y \<cdot> inv h'" using h' x sb | |
| 747 | by (auto simp add: m_assoc subgroup.subset [THEN subsetD]) | |
| 748 | show "inv h' \<in> H" using h' sb | |
| 749 | by (auto simp add: subgroup.subset [THEN subsetD] subgroup.m_inv_closed) | |
| 750 | qed | |
| 751 | qed | |
| 752 | ||
| 753 | lemma (in group) l_coset_carrier: | |
| 754 | "\<lbrakk>y \<in> x <# H; x \<in> carrier(G); subgroup(H,G)\<rbrakk> \<Longrightarrow> y \<in> carrier(G)" | |
| 755 | by (auto simp add: l_coset_def m_assoc | |
| 756 | subgroup.subset [THEN subsetD] subgroup.m_closed) | |
| 757 | ||
| 758 | lemma (in group) l_repr_imp_subset: | |
| 759 | assumes y: "y \<in> x <# H" and x: "x \<in> carrier(G)" and sb: "subgroup(H,G)" | |
| 760 | shows "y <# H \<subseteq> x <# H" | |
| 761 | proof - | |
| 762 | from y | |
| 763 | obtain h' where "h' \<in> H" "x \<cdot> h' = y" by (auto simp add: l_coset_def) | |
| 764 | thus ?thesis using x sb | |
| 765 | by (auto simp add: l_coset_def m_assoc | |
| 766 | subgroup.subset [THEN subsetD] subgroup.m_closed) | |
| 767 | qed | |
| 768 | ||
| 769 | lemma (in group) l_repr_independence: | |
| 770 | assumes y: "y \<in> x <# H" and x: "x \<in> carrier(G)" and sb: "subgroup(H,G)" | |
| 771 | shows "x <# H = y <# H" | |
| 772 | proof | |
| 773 | show "x <# H \<subseteq> y <# H" | |
| 774 | by (rule l_repr_imp_subset, | |
| 775 | (blast intro: l_coset_swap l_coset_carrier y x sb)+) | |
| 776 | show "y <# H \<subseteq> x <# H" by (rule l_repr_imp_subset [OF y x sb]) | |
| 777 | qed | |
| 778 | ||
| 779 | lemma (in group) setmult_subset_G: | |
| 780 | "\<lbrakk>H \<subseteq> carrier(G); K \<subseteq> carrier(G)\<rbrakk> \<Longrightarrow> H <#> K \<subseteq> carrier(G)" | |
| 781 | by (auto simp add: set_mult_def subsetD) | |
| 782 | ||
| 783 | lemma (in group) subgroup_mult_id: "subgroup(H,G) \<Longrightarrow> H <#> H = H" | |
| 784 | apply (rule equalityI) | |
| 785 | apply (auto simp add: subgroup.m_closed set_mult_def Sigma_def image_def) | |
| 786 | apply (rule_tac x = x in bexI) | |
| 787 | apply (rule bexI [of _ "\<one>"]) | |
| 788 | apply (auto simp add: subgroup.m_closed subgroup.one_closed | |
| 789 | r_one subgroup.subset [THEN subsetD]) | |
| 790 | done | |
| 791 | ||
| 792 | ||
| 793 | subsubsection {* Set of inverses of an @{text r_coset}. *}
 | |
| 794 | ||
| 795 | lemma (in normal) rcos_inv: | |
| 796 | assumes x: "x \<in> carrier(G)" | |
| 797 | shows "set_inv (H #> x) = H #> (inv x)" | |
| 798 | proof (simp add: r_coset_def SET_INV_def x inv_mult_group, safe intro!: equalityI) | |
| 799 | fix h | |
| 800 | assume "h \<in> H" | |
| 801 |   show "inv x \<cdot> inv h \<in> (\<Union>j\<in>H. {j \<cdot> inv x})"
 | |
| 802 | proof (rule UN_I) | |
| 803 | show "inv x \<cdot> inv h \<cdot> x \<in> H" | |
| 804 | by (simp add: inv_op_closed1 prems) | |
| 805 |     show "inv x \<cdot> inv h \<in> {inv x \<cdot> inv h \<cdot> x \<cdot> inv x}"
 | |
| 806 | by (simp add: prems m_assoc) | |
| 807 | qed | |
| 808 | next | |
| 809 | fix h | |
| 810 | assume "h \<in> H" | |
| 811 |   show "h \<cdot> inv x \<in> (\<Union>j\<in>H. {inv x \<cdot> inv j})"
 | |
| 812 | proof (rule UN_I) | |
| 813 | show "x \<cdot> inv h \<cdot> inv x \<in> H" | |
| 814 | by (simp add: inv_op_closed2 prems) | |
| 815 |     show "h \<cdot> inv x \<in> {inv x \<cdot> inv (x \<cdot> inv h \<cdot> inv x)}"
 | |
| 816 | by (simp add: prems m_assoc [symmetric] inv_mult_group) | |
| 817 | qed | |
| 818 | qed | |
| 819 | ||
| 820 | ||
| 821 | ||
| 822 | subsubsection {*Theorems for @{text "<#>"} with @{text "#>"} or @{text "<#"}.*}
 | |
| 823 | ||
| 824 | lemma (in group) setmult_rcos_assoc: | |
| 825 | "\<lbrakk>H \<subseteq> carrier(G); K \<subseteq> carrier(G); x \<in> carrier(G)\<rbrakk> | |
| 826 | \<Longrightarrow> H <#> (K #> x) = (H <#> K) #> x" | |
| 827 | by (force simp add: r_coset_def set_mult_def m_assoc) | |
| 828 | ||
| 829 | lemma (in group) rcos_assoc_lcos: | |
| 830 | "\<lbrakk>H \<subseteq> carrier(G); K \<subseteq> carrier(G); x \<in> carrier(G)\<rbrakk> | |
| 831 | \<Longrightarrow> (H #> x) <#> K = H <#> (x <# K)" | |
| 832 | by (force simp add: r_coset_def l_coset_def set_mult_def m_assoc) | |
| 833 | ||
| 834 | lemma (in normal) rcos_mult_step1: | |
| 835 | "\<lbrakk>x \<in> carrier(G); y \<in> carrier(G)\<rbrakk> | |
| 836 | \<Longrightarrow> (H #> x) <#> (H #> y) = (H <#> (x <# H)) #> y" | |
| 837 | by (simp add: setmult_rcos_assoc subset | |
| 838 | r_coset_subset_G l_coset_subset_G rcos_assoc_lcos) | |
| 839 | ||
| 840 | lemma (in normal) rcos_mult_step2: | |
| 841 | "\<lbrakk>x \<in> carrier(G); y \<in> carrier(G)\<rbrakk> | |
| 842 | \<Longrightarrow> (H <#> (x <# H)) #> y = (H <#> (H #> x)) #> y" | |
| 843 | by (insert coset_eq, simp add: normal_def) | |
| 844 | ||
| 845 | lemma (in normal) rcos_mult_step3: | |
| 846 | "\<lbrakk>x \<in> carrier(G); y \<in> carrier(G)\<rbrakk> | |
| 847 | \<Longrightarrow> (H <#> (H #> x)) #> y = H #> (x \<cdot> y)" | |
| 19931 
fb32b43e7f80
Restructured locales with predicates: import is now an interpretation.
 ballarin parents: 
16417diff
changeset | 848 | by (simp add: setmult_rcos_assoc coset_mult_assoc | 
| 
fb32b43e7f80
Restructured locales with predicates: import is now an interpretation.
 ballarin parents: 
16417diff
changeset | 849 | subgroup_mult_id subset prems normal.axioms) | 
| 14884 | 850 | |
| 851 | lemma (in normal) rcos_sum: | |
| 852 | "\<lbrakk>x \<in> carrier(G); y \<in> carrier(G)\<rbrakk> | |
| 853 | \<Longrightarrow> (H #> x) <#> (H #> y) = H #> (x \<cdot> y)" | |
| 854 | by (simp add: rcos_mult_step1 rcos_mult_step2 rcos_mult_step3) | |
| 855 | ||
| 856 | lemma (in normal) rcosets_mult_eq: "M \<in> rcosets H \<Longrightarrow> H <#> M = M" | |
| 857 |   -- {* generalizes @{text subgroup_mult_id} *}
 | |
| 858 | by (auto simp add: RCOSETS_def subset | |
| 19931 
fb32b43e7f80
Restructured locales with predicates: import is now an interpretation.
 ballarin parents: 
16417diff
changeset | 859 | setmult_rcos_assoc subgroup_mult_id prems normal.axioms) | 
| 14884 | 860 | |
| 861 | ||
| 862 | subsubsection{*Two distinct right cosets are disjoint*}
 | |
| 863 | ||
| 21233 | 864 | definition | 
| 21404 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
21233diff
changeset | 865 |   r_congruent :: "[i,i] => i" ("rcong\<index> _" [60] 60) where
 | 
| 21233 | 866 |   "rcong\<^bsub>G\<^esub> H == {<x,y> \<in> carrier(G) * carrier(G). inv\<^bsub>G\<^esub> x \<cdot>\<^bsub>G\<^esub> y \<in> H}"
 | 
| 14884 | 867 | |
| 868 | ||
| 869 | lemma (in subgroup) equiv_rcong: | |
| 27618 | 870 | assumes "group(G)" | 
| 14884 | 871 | shows "equiv (carrier(G), rcong H)" | 
| 27618 | 872 | proof - | 
| 29223 | 873 | interpret group G by fact | 
| 27618 | 874 | show ?thesis proof (simp add: equiv_def, intro conjI) | 
| 875 | show "rcong H \<subseteq> carrier(G) \<times> carrier(G)" | |
| 876 | by (auto simp add: r_congruent_def) | |
| 877 | next | |
| 878 | show "refl (carrier(G), rcong H)" | |
| 879 | by (auto simp add: r_congruent_def refl_def) | |
| 880 | next | |
| 881 | show "sym (rcong H)" | |
| 882 | proof (simp add: r_congruent_def sym_def, clarify) | |
| 883 | fix x y | |
| 884 | assume [simp]: "x \<in> carrier(G)" "y \<in> carrier(G)" | |
| 885 | and "inv x \<cdot> y \<in> H" | |
| 886 | hence "inv (inv x \<cdot> y) \<in> H" by (simp add: m_inv_closed) | |
| 887 | thus "inv y \<cdot> x \<in> H" by (simp add: inv_mult_group) | |
| 888 | qed | |
| 889 | next | |
| 890 | show "trans (rcong H)" | |
| 891 | proof (simp add: r_congruent_def trans_def, clarify) | |
| 892 | fix x y z | |
| 893 | assume [simp]: "x \<in> carrier(G)" "y \<in> carrier(G)" "z \<in> carrier(G)" | |
| 894 | and "inv x \<cdot> y \<in> H" and "inv y \<cdot> z \<in> H" | |
| 895 | hence "(inv x \<cdot> y) \<cdot> (inv y \<cdot> z) \<in> H" by simp | |
| 896 | hence "inv x \<cdot> (y \<cdot> inv y) \<cdot> z \<in> H" by (simp add: m_assoc del: inv) | |
| 897 | thus "inv x \<cdot> z \<in> H" by simp | |
| 898 | qed | |
| 14884 | 899 | qed | 
| 900 | qed | |
| 901 | ||
| 902 | text{*Equivalence classes of @{text rcong} correspond to left cosets.
 | |
| 903 | Was there a mistake in the definitions? I'd have expected them to | |
| 904 | correspond to right cosets.*} | |
| 905 | lemma (in subgroup) l_coset_eq_rcong: | |
| 27618 | 906 | assumes "group(G)" | 
| 14884 | 907 | assumes a: "a \<in> carrier(G)" | 
| 908 |   shows "a <# H = (rcong H) `` {a}" 
 | |
| 27618 | 909 | proof - | 
| 29223 | 910 | interpret group G by fact | 
| 27618 | 911 | show ?thesis | 
| 912 | by (force simp add: r_congruent_def l_coset_def m_assoc [symmetric] a | |
| 913 | Collect_image_eq) | |
| 914 | qed | |
| 14884 | 915 | |
| 916 | lemma (in group) rcos_equation: | |
| 27618 | 917 | assumes "subgroup(H, G)" | 
| 14884 | 918 | shows | 
| 919 | "\<lbrakk>ha \<cdot> a = h \<cdot> b; a \<in> carrier(G); b \<in> carrier(G); | |
| 920 | h \<in> H; ha \<in> H; hb \<in> H\<rbrakk> | |
| 27618 | 921 |       \<Longrightarrow> hb \<cdot> a \<in> (\<Union>h\<in>H. {h \<cdot> b})" (is "PROP ?P")
 | 
| 922 | proof - | |
| 29223 | 923 | interpret subgroup H G by fact | 
| 27618 | 924 | show "PROP ?P" | 
| 925 | apply (rule UN_I [of "hb \<cdot> ((inv ha) \<cdot> h)"], simp) | |
| 926 | apply (simp add: m_assoc transpose_inv) | |
| 927 | done | |
| 928 | qed | |
| 14884 | 929 | |
| 930 | lemma (in group) rcos_disjoint: | |
| 27618 | 931 | assumes "subgroup(H, G)" | 
| 932 | shows "\<lbrakk>a \<in> rcosets H; b \<in> rcosets H; a\<noteq>b\<rbrakk> \<Longrightarrow> a \<inter> b = 0" (is "PROP ?P") | |
| 933 | proof - | |
| 29223 | 934 | interpret subgroup H G by fact | 
| 27618 | 935 | show "PROP ?P" | 
| 936 | apply (simp add: RCOSETS_def r_coset_def) | |
| 937 | apply (blast intro: rcos_equation prems sym) | |
| 938 | done | |
| 939 | qed | |
| 14884 | 940 | |
| 941 | ||
| 942 | subsection {*Order of a Group and Lagrange's Theorem*}
 | |
| 943 | ||
| 21233 | 944 | definition | 
| 21404 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
21233diff
changeset | 945 | order :: "i => i" where | 
| 14884 | 946 | "order(S) == |carrier(S)|" | 
| 947 | ||
| 948 | lemma (in group) rcos_self: | |
| 27618 | 949 | assumes "subgroup(H, G)" | 
| 950 | shows "x \<in> carrier(G) \<Longrightarrow> x \<in> H #> x" (is "PROP ?P") | |
| 951 | proof - | |
| 29223 | 952 | interpret subgroup H G by fact | 
| 27618 | 953 | show "PROP ?P" | 
| 954 | apply (simp add: r_coset_def) | |
| 955 | apply (rule_tac x="\<one>" in bexI) apply (auto) | |
| 956 | done | |
| 957 | qed | |
| 14884 | 958 | |
| 959 | lemma (in group) rcosets_part_G: | |
| 27618 | 960 | assumes "subgroup(H, G)" | 
| 14884 | 961 | shows "\<Union>(rcosets H) = carrier(G)" | 
| 27618 | 962 | proof - | 
| 29223 | 963 | interpret subgroup H G by fact | 
| 27618 | 964 | show ?thesis | 
| 965 | apply (rule equalityI) | |
| 966 | apply (force simp add: RCOSETS_def r_coset_def) | |
| 967 | apply (auto simp add: RCOSETS_def intro: rcos_self prems) | |
| 968 | done | |
| 969 | qed | |
| 14884 | 970 | |
| 971 | lemma (in group) cosets_finite: | |
| 972 | "\<lbrakk>c \<in> rcosets H; H \<subseteq> carrier(G); Finite (carrier(G))\<rbrakk> \<Longrightarrow> Finite(c)" | |
| 973 | apply (auto simp add: RCOSETS_def) | |
| 974 | apply (simp add: r_coset_subset_G [THEN subset_Finite]) | |
| 975 | done | |
| 976 | ||
| 977 | text{*More general than the HOL version, which also requires @{term G} to
 | |
| 978 | be finite.*} | |
| 979 | lemma (in group) card_cosets_equal: | |
| 980 | assumes H: "H \<subseteq> carrier(G)" | |
| 981 | shows "c \<in> rcosets H \<Longrightarrow> |c| = |H|" | |
| 982 | proof (simp add: RCOSETS_def, clarify) | |
| 983 | fix a | |
| 984 | assume a: "a \<in> carrier(G)" | |
| 985 | show "|H #> a| = |H|" | |
| 986 | proof (rule eqpollI [THEN cardinal_cong]) | |
| 987 | show "H #> a \<lesssim> H" | |
| 988 | proof (simp add: lepoll_def, intro exI) | |
| 989 | show "(\<lambda>y \<in> H#>a. y \<cdot> inv a) \<in> inj(H #> a, H)" | |
| 990 | by (auto intro: lam_type | |
| 991 | simp add: inj_def r_coset_def m_assoc subsetD [OF H] a) | |
| 992 | qed | |
| 993 | show "H \<lesssim> H #> a" | |
| 994 | proof (simp add: lepoll_def, intro exI) | |
| 995 | show "(\<lambda>y\<in> H. y \<cdot> a) \<in> inj(H, H #> a)" | |
| 996 | by (auto intro: lam_type | |
| 997 | simp add: inj_def r_coset_def subsetD [OF H] a) | |
| 998 | qed | |
| 999 | qed | |
| 1000 | qed | |
| 1001 | ||
| 1002 | ||
| 1003 | lemma (in group) rcosets_subset_PowG: | |
| 1004 | "subgroup(H,G) \<Longrightarrow> rcosets H \<subseteq> Pow(carrier(G))" | |
| 1005 | apply (simp add: RCOSETS_def) | |
| 1006 | apply (blast dest: r_coset_subset_G subgroup.subset) | |
| 1007 | done | |
| 1008 | ||
| 1009 | theorem (in group) lagrange: | |
| 1010 | "\<lbrakk>Finite(carrier(G)); subgroup(H,G)\<rbrakk> | |
| 1011 | \<Longrightarrow> |rcosets H| #* |H| = order(G)" | |
| 1012 | apply (simp (no_asm_simp) add: order_def rcosets_part_G [symmetric]) | |
| 1013 | apply (subst mult_commute) | |
| 1014 | apply (rule card_partition) | |
| 1015 | apply (simp add: rcosets_subset_PowG [THEN subset_Finite]) | |
| 1016 | apply (simp add: rcosets_part_G) | |
| 1017 | apply (simp add: card_cosets_equal [OF subgroup.subset]) | |
| 1018 | apply (simp add: rcos_disjoint) | |
| 1019 | done | |
| 1020 | ||
| 1021 | ||
| 1022 | subsection {*Quotient Groups: Factorization of a Group*}
 | |
| 1023 | ||
| 21233 | 1024 | definition | 
| 21404 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
21233diff
changeset | 1025 | FactGroup :: "[i,i] => i" (infixl "Mod" 65) where | 
| 14884 | 1026 |     --{*Actually defined for groups rather than monoids*}
 | 
| 1027 | "G Mod H == | |
| 21233 | 1028 | <rcosets\<^bsub>G\<^esub> H, \<lambda><K1,K2> \<in> (rcosets\<^bsub>G\<^esub> H) \<times> (rcosets\<^bsub>G\<^esub> H). K1 <#>\<^bsub>G\<^esub> K2, H, 0>" | 
| 14884 | 1029 | |
| 1030 | lemma (in normal) setmult_closed: | |
| 1031 | "\<lbrakk>K1 \<in> rcosets H; K2 \<in> rcosets H\<rbrakk> \<Longrightarrow> K1 <#> K2 \<in> rcosets H" | |
| 1032 | by (auto simp add: rcos_sum RCOSETS_def) | |
| 1033 | ||
| 1034 | lemma (in normal) setinv_closed: | |
| 1035 | "K \<in> rcosets H \<Longrightarrow> set_inv K \<in> rcosets H" | |
| 1036 | by (auto simp add: rcos_inv RCOSETS_def) | |
| 1037 | ||
| 1038 | lemma (in normal) rcosets_assoc: | |
| 1039 | "\<lbrakk>M1 \<in> rcosets H; M2 \<in> rcosets H; M3 \<in> rcosets H\<rbrakk> | |
| 1040 | \<Longrightarrow> M1 <#> M2 <#> M3 = M1 <#> (M2 <#> M3)" | |
| 1041 | by (auto simp add: RCOSETS_def rcos_sum m_assoc) | |
| 1042 | ||
| 1043 | lemma (in subgroup) subgroup_in_rcosets: | |
| 27618 | 1044 | assumes "group(G)" | 
| 14884 | 1045 | shows "H \<in> rcosets H" | 
| 1046 | proof - | |
| 29223 | 1047 | interpret group G by fact | 
| 14884 | 1048 | have "H #> \<one> = H" | 
| 26199 | 1049 | using _ subgroup_axioms by (rule coset_join2) simp_all | 
| 14884 | 1050 | then show ?thesis | 
| 1051 | by (auto simp add: RCOSETS_def intro: sym) | |
| 1052 | qed | |
| 1053 | ||
| 1054 | lemma (in normal) rcosets_inv_mult_group_eq: | |
| 1055 | "M \<in> rcosets H \<Longrightarrow> set_inv M <#> M = H" | |
| 19931 
fb32b43e7f80
Restructured locales with predicates: import is now an interpretation.
 ballarin parents: 
16417diff
changeset | 1056 | by (auto simp add: RCOSETS_def rcos_inv rcos_sum subgroup.subset prems normal.axioms) | 
| 14884 | 1057 | |
| 1058 | theorem (in normal) factorgroup_is_group: | |
| 1059 | "group (G Mod H)" | |
| 1060 | apply (simp add: FactGroup_def) | |
| 14891 | 1061 | apply (rule groupI) | 
| 14884 | 1062 | apply (simp add: setmult_closed) | 
| 1063 | apply (simp add: normal_imp_subgroup subgroup_in_rcosets) | |
| 1064 | apply (simp add: setmult_closed rcosets_assoc) | |
| 1065 | apply (simp add: normal_imp_subgroup | |
| 1066 | subgroup_in_rcosets rcosets_mult_eq) | |
| 1067 | apply (auto dest: rcosets_inv_mult_group_eq simp add: setinv_closed) | |
| 1068 | done | |
| 1069 | ||
| 1070 | lemma (in normal) inv_FactGroup: | |
| 1071 | "X \<in> carrier (G Mod H) \<Longrightarrow> inv\<^bsub>G Mod H\<^esub> X = set_inv X" | |
| 1072 | apply (rule group.inv_equality [OF factorgroup_is_group]) | |
| 1073 | apply (simp_all add: FactGroup_def setinv_closed rcosets_inv_mult_group_eq) | |
| 1074 | done | |
| 1075 | ||
| 1076 | text{*The coset map is a homomorphism from @{term G} to the quotient group
 | |
| 1077 |   @{term "G Mod H"}*}
 | |
| 1078 | lemma (in normal) r_coset_hom_Mod: | |
| 1079 | "(\<lambda>a \<in> carrier(G). H #> a) \<in> hom(G, G Mod H)" | |
| 1080 | by (auto simp add: FactGroup_def RCOSETS_def hom_def rcos_sum intro: lam_type) | |
| 1081 | ||
| 1082 | ||
| 14891 | 1083 | subsection{*The First Isomorphism Theorem*}
 | 
| 1084 | ||
| 1085 | text{*The quotient by the kernel of a homomorphism is isomorphic to the 
 | |
| 1086 | range of that homomorphism.*} | |
| 14884 | 1087 | |
| 21233 | 1088 | definition | 
| 21404 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
21233diff
changeset | 1089 | kernel :: "[i,i,i] => i" where | 
| 14884 | 1090 |     --{*the kernel of a homomorphism*}
 | 
| 1091 |   "kernel(G,H,h) == {x \<in> carrier(G). h ` x = \<one>\<^bsub>H\<^esub>}";
 | |
| 1092 | ||
| 1093 | lemma (in group_hom) subgroup_kernel: "subgroup (kernel(G,H,h), G)" | |
| 1094 | apply (rule subgroup.intro) | |
| 1095 | apply (auto simp add: kernel_def group.intro prems) | |
| 1096 | done | |
| 1097 | ||
| 1098 | text{*The kernel of a homomorphism is a normal subgroup*}
 | |
| 1099 | lemma (in group_hom) normal_kernel: "(kernel(G,H,h)) \<lhd> G" | |
| 1100 | apply (simp add: group.normal_inv_iff subgroup_kernel group.intro prems) | |
| 1101 | apply (simp add: kernel_def) | |
| 1102 | done | |
| 1103 | ||
| 1104 | lemma (in group_hom) FactGroup_nonempty: | |
| 1105 | assumes X: "X \<in> carrier (G Mod kernel(G,H,h))" | |
| 1106 | shows "X \<noteq> 0" | |
| 1107 | proof - | |
| 1108 | from X | |
| 1109 | obtain g where "g \<in> carrier(G)" | |
| 1110 | and "X = kernel(G,H,h) #> g" | |
| 1111 | by (auto simp add: FactGroup_def RCOSETS_def) | |
| 1112 | thus ?thesis | |
| 1113 | by (auto simp add: kernel_def r_coset_def image_def intro: hom_one) | |
| 1114 | qed | |
| 1115 | ||
| 1116 | ||
| 1117 | lemma (in group_hom) FactGroup_contents_mem: | |
| 1118 | assumes X: "X \<in> carrier (G Mod (kernel(G,H,h)))" | |
| 1119 | shows "contents (h``X) \<in> carrier(H)" | |
| 1120 | proof - | |
| 1121 | from X | |
| 1122 | obtain g where g: "g \<in> carrier(G)" | |
| 1123 | and "X = kernel(G,H,h) #> g" | |
| 1124 | by (auto simp add: FactGroup_def RCOSETS_def) | |
| 1125 |   hence "h `` X = {h ` g}"
 | |
| 1126 | by (auto simp add: kernel_def r_coset_def image_UN | |
| 1127 | image_eq_UN [OF hom_is_fun] g) | |
| 1128 | thus ?thesis by (auto simp add: g) | |
| 1129 | qed | |
| 1130 | ||
| 1131 | lemma mult_FactGroup: | |
| 1132 | "[|X \<in> carrier(G Mod H); X' \<in> carrier(G Mod H)|] | |
| 1133 | ==> X \<cdot>\<^bsub>(G Mod H)\<^esub> X' = X <#>\<^bsub>G\<^esub> X'" | |
| 1134 | by (simp add: FactGroup_def) | |
| 1135 | ||
| 1136 | lemma (in normal) FactGroup_m_closed: | |
| 1137 | "[|X \<in> carrier(G Mod H); X' \<in> carrier(G Mod H)|] | |
| 1138 | ==> X <#>\<^bsub>G\<^esub> X' \<in> carrier(G Mod H)" | |
| 1139 | by (simp add: FactGroup_def setmult_closed) | |
| 1140 | ||
| 1141 | lemma (in group_hom) FactGroup_hom: | |
| 1142 | "(\<lambda>X \<in> carrier(G Mod (kernel(G,H,h))). contents (h``X)) | |
| 1143 | \<in> hom (G Mod (kernel(G,H,h)), H)" | |
| 1144 | proof (simp add: hom_def FactGroup_contents_mem lam_type mult_FactGroup normal.FactGroup_m_closed [OF normal_kernel], intro ballI) | |
| 1145 | fix X and X' | |
| 1146 | assume X: "X \<in> carrier (G Mod kernel(G,H,h))" | |
| 1147 | and X': "X' \<in> carrier (G Mod kernel(G,H,h))" | |
| 1148 | then | |
| 1149 | obtain g and g' | |
| 1150 | where "g \<in> carrier(G)" and "g' \<in> carrier(G)" | |
| 1151 | and "X = kernel(G,H,h) #> g" and "X' = kernel(G,H,h) #> g'" | |
| 1152 | by (auto simp add: FactGroup_def RCOSETS_def) | |
| 1153 | hence all: "\<forall>x\<in>X. h ` x = h ` g" "\<forall>x\<in>X'. h ` x = h ` g'" | |
| 1154 | and Xsub: "X \<subseteq> carrier(G)" and X'sub: "X' \<subseteq> carrier(G)" | |
| 1155 | by (force simp add: kernel_def r_coset_def image_def)+ | |
| 1156 |   hence "h `` (X <#> X') = {h ` g \<cdot>\<^bsub>H\<^esub> h ` g'}" using X X'
 | |
| 1157 | by (auto dest!: FactGroup_nonempty | |
| 1158 | simp add: set_mult_def image_eq_UN [OF hom_is_fun] image_UN | |
| 1159 | subsetD [OF Xsub] subsetD [OF X'sub]) | |
| 1160 | thus "contents (h `` (X <#> X')) = contents (h `` X) \<cdot>\<^bsub>H\<^esub> contents (h `` X')" | |
| 1161 | by (simp add: all image_eq_UN [OF hom_is_fun] FactGroup_nonempty | |
| 1162 | X X' Xsub X'sub) | |
| 1163 | qed | |
| 1164 | ||
| 1165 | ||
| 1166 | text{*Lemma for the following injectivity result*}
 | |
| 1167 | lemma (in group_hom) FactGroup_subset: | |
| 1168 | "\<lbrakk>g \<in> carrier(G); g' \<in> carrier(G); h ` g = h ` g'\<rbrakk> | |
| 1169 | \<Longrightarrow> kernel(G,H,h) #> g \<subseteq> kernel(G,H,h) #> g'" | |
| 1170 | apply (clarsimp simp add: kernel_def r_coset_def image_def) | |
| 1171 | apply (rename_tac y) | |
| 1172 | apply (rule_tac x="y \<cdot> g \<cdot> inv g'" in bexI) | |
| 1173 | apply (simp_all add: G.m_assoc) | |
| 1174 | done | |
| 1175 | ||
| 1176 | lemma (in group_hom) FactGroup_inj: | |
| 1177 | "(\<lambda>X\<in>carrier (G Mod kernel(G,H,h)). contents (h `` X)) | |
| 1178 | \<in> inj(carrier (G Mod kernel(G,H,h)), carrier(H))" | |
| 1179 | proof (simp add: inj_def FactGroup_contents_mem lam_type, clarify) | |
| 1180 | fix X and X' | |
| 1181 | assume X: "X \<in> carrier (G Mod kernel(G,H,h))" | |
| 1182 | and X': "X' \<in> carrier (G Mod kernel(G,H,h))" | |
| 1183 | then | |
| 1184 | obtain g and g' | |
| 1185 | where gX: "g \<in> carrier(G)" "g' \<in> carrier(G)" | |
| 1186 | "X = kernel(G,H,h) #> g" "X' = kernel(G,H,h) #> g'" | |
| 1187 | by (auto simp add: FactGroup_def RCOSETS_def) | |
| 1188 | hence all: "\<forall>x\<in>X. h ` x = h ` g" "\<forall>x\<in>X'. h ` x = h ` g'" | |
| 1189 | and Xsub: "X \<subseteq> carrier(G)" and X'sub: "X' \<subseteq> carrier(G)" | |
| 1190 | by (force simp add: kernel_def r_coset_def image_def)+ | |
| 1191 | assume "contents (h `` X) = contents (h `` X')" | |
| 1192 | hence h: "h ` g = h ` g'" | |
| 1193 | by (simp add: all image_eq_UN [OF hom_is_fun] FactGroup_nonempty | |
| 1194 | X X' Xsub X'sub) | |
| 1195 | show "X=X'" by (rule equalityI) (simp_all add: FactGroup_subset h gX) | |
| 1196 | qed | |
| 1197 | ||
| 1198 | ||
| 1199 | lemma (in group_hom) kernel_rcoset_subset: | |
| 1200 | assumes g: "g \<in> carrier(G)" | |
| 1201 | shows "kernel(G,H,h) #> g \<subseteq> carrier (G)" | |
| 1202 | by (auto simp add: g kernel_def r_coset_def) | |
| 1203 | ||
| 1204 | ||
| 1205 | ||
| 1206 | text{*If the homomorphism @{term h} is onto @{term H}, then so is the
 | |
| 1207 | homomorphism from the quotient group*} | |
| 1208 | lemma (in group_hom) FactGroup_surj: | |
| 1209 | assumes h: "h \<in> surj(carrier(G), carrier(H))" | |
| 1210 | shows "(\<lambda>X\<in>carrier (G Mod kernel(G,H,h)). contents (h `` X)) | |
| 1211 | \<in> surj(carrier (G Mod kernel(G,H,h)), carrier(H))" | |
| 1212 | proof (simp add: surj_def FactGroup_contents_mem lam_type, clarify) | |
| 1213 | fix y | |
| 1214 | assume y: "y \<in> carrier(H)" | |
| 1215 | with h obtain g where g: "g \<in> carrier(G)" "h ` g = y" | |
| 1216 | by (auto simp add: surj_def) | |
| 1217 |   hence "(\<Union>x\<in>kernel(G,H,h) #> g. {h ` x}) = {y}" 
 | |
| 1218 | by (auto simp add: y kernel_def r_coset_def) | |
| 1219 | with g show "\<exists>x\<in>carrier(G Mod kernel(G, H, h)). contents(h `` x) = y" | |
| 1220 |         --{*The witness is @{term "kernel(G,H,h) #> g"}*}
 | |
| 1221 | by (force simp add: FactGroup_def RCOSETS_def | |
| 1222 | image_eq_UN [OF hom_is_fun] kernel_rcoset_subset) | |
| 1223 | qed | |
| 1224 | ||
| 1225 | ||
| 1226 | text{*If @{term h} is a homomorphism from @{term G} onto @{term H}, then the
 | |
| 1227 |  quotient group @{term "G Mod (kernel(G,H,h))"} is isomorphic to @{term H}.*}
 | |
| 1228 | theorem (in group_hom) FactGroup_iso: | |
| 1229 | "h \<in> surj(carrier(G), carrier(H)) | |
| 1230 | \<Longrightarrow> (\<lambda>X\<in>carrier (G Mod kernel(G,H,h)). contents (h``X)) \<in> (G Mod (kernel(G,H,h))) \<cong> H" | |
| 1231 | by (simp add: iso_def FactGroup_hom FactGroup_inj bij_def FactGroup_surj) | |
| 1232 | ||
| 1233 | end |