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