src/HOL/GroupTheory/Ring.thy
changeset 13592 dfe0c7191125
parent 13583 5fcc8bf538ee
equal deleted inserted replaced
13591:e14d963e3bc0 13592:dfe0c7191125
    35             "[|x \<in> carrier R; y \<in> carrier R; z \<in> carrier R|] 
    35             "[|x \<in> carrier R; y \<in> carrier R; z \<in> carrier R|] 
    36              ==> (x \<cdot> y) \<cdot> z = x \<cdot> (y \<cdot> z)"
    36              ==> (x \<cdot> y) \<cdot> z = x \<cdot> (y \<cdot> z)"
    37       and left:  "distrib_l (carrier R) (prod R) (sum R)"
    37       and left:  "distrib_l (carrier R) (prod R) (sum R)"
    38       and right: "distrib_r (carrier R) (prod R) (sum R)"
    38       and right: "distrib_r (carrier R) (prod R) (sum R)"
    39 
    39 
    40 constdefs (*????FIXME needed?*)
    40 constdefs
    41   Ring :: "('a,'b) ring_scheme set"
    41   Ring :: "('a,'b) ring_scheme set"
    42    "Ring == Collect ring"
    42    "Ring == Collect ring"
    43 
    43 
    44 
    44 
    45 lemma ring_is_abelian_group: "ring(R) ==> abelian_group(R)"
    45 lemma ring_is_abelian_group: "ring(R) ==> abelian_group(R)"
    46 by (simp add: ring_def abelian_group_def)
    46 by (simp add: ring_def abelian_group_def)
    47 
    47 
    48 text{*Construction of a ring from a semigroup and an Abelian group*}
    48 text{*Construction of a ring from a semigroup and an Abelian group*}
    49 lemma "[|abelian_group R; 
    49 lemma ringI:
    50          semigroup(|carrier = carrier R, sum = prod R|);
    50      "[|abelian_group R; 
    51          distrib_l (carrier R) (prod R) (sum R);
    51         semigroup(|carrier = carrier R, sum = prod R|);
    52          distrib_r (carrier R) (prod R) (sum R)|] ==> ring R"
    52         distrib_l (carrier R) (prod R) (sum R);
       
    53         distrib_r (carrier R) (prod R) (sum R)|] ==> ring R"
    53 by (simp add: abelian_group_def ring_def ring_axioms_def semigroup_def) 
    54 by (simp add: abelian_group_def ring_def ring_axioms_def semigroup_def) 
    54 
    55 
    55 lemma (in ring) prod_closed [simp]:
    56 lemma (in ring) prod_closed [simp]:
    56      "[| x \<in> carrier R; y \<in> carrier R |] ==>  x \<cdot> y \<in> carrier R"
    57      "[| x \<in> carrier R; y \<in> carrier R |] ==>  x \<cdot> y \<in> carrier R"
    57 apply (insert prod_funcset) 
    58 apply (insert prod_funcset) 
    95      "[|x \<in> carrier R; y \<in> carrier R|]  
    96      "[|x \<in> carrier R; y \<in> carrier R|]  
    96       ==> x \<cdot> (\<ominus>y) = \<ominus> (x \<cdot> y)"
    97       ==> x \<cdot> (\<ominus>y) = \<ominus> (x \<cdot> y)"
    97 by (simp add: minus_unique prod_zero_right distrib_left [symmetric]) 
    98 by (simp add: minus_unique prod_zero_right distrib_left [symmetric]) 
    98 
    99 
    99 
   100 
       
   101 subsection {*Example: The Ring of Integers*}
       
   102 
       
   103 constdefs
       
   104  integers :: "int ring"
       
   105   "integers == (|carrier = UNIV, 
       
   106                  sum = op +,
       
   107                  gminus = (%x. -x),
       
   108                  zero = 0::int,
       
   109                  prod = op *|)"
       
   110 
       
   111 theorem ring_integers: "ring (integers)"
       
   112 by (simp add: integers_def ring_def ring_axioms_def 
       
   113               distrib_l_def distrib_r_def 
       
   114               zadd_zmult_distrib zadd_zmult_distrib2 
       
   115               abelian_group_axioms_def group_axioms_def semigroup_def) 
       
   116 
       
   117 
   100 subsection {*Ring Homomorphisms*}
   118 subsection {*Ring Homomorphisms*}
   101 
   119 
   102 constdefs
   120 constdefs
   103  ring_hom :: "[('a,'c)ring_scheme, ('b,'d)ring_scheme] => ('a => 'b)set"
   121  ring_hom :: "[('a,'c)ring_scheme, ('b,'d)ring_scheme] => ('a => 'b)set"
   104   "ring_hom R R' ==
   122   "ring_hom R R' ==
   123 
   141 
   124 lemma restrict_Inv_ring_hom:
   142 lemma restrict_Inv_ring_hom:
   125       "[|ring R; h \<in> ring_hom R R; h \<in> Bij (carrier R)|]
   143       "[|ring R; h \<in> ring_hom R R; h \<in> Bij (carrier R)|]
   126        ==> restrict (Inv (carrier R) h) (carrier R) \<in> ring_hom R R"
   144        ==> restrict (Inv (carrier R) h) (carrier R) \<in> ring_hom R R"
   127 by (simp add: ring.axioms group.axioms 
   145 by (simp add: ring.axioms group.axioms 
   128               ring_hom_def Bij_Inv_mem restrictI ring.sum_closed 
   146               ring_hom_def Bij_Inv_mem restrictI 
   129               semigroup.sum_funcset ring.prod_funcset Bij_Inv_lemma)
   147               semigroup.sum_funcset ring.prod_funcset Bij_Inv_lemma)
   130 
   148 
   131 text{*Ring automorphisms are a subgroup of the group of bijections over the 
   149 text{*Ring automorphisms are a subgroup of the group of bijections over the 
   132    ring's carrier, and thus a group*}
   150    ring's carrier, and thus a group*}
   133 lemma subgroup_ring_auto:
   151 lemma subgroup_ring_auto:
   134       "ring R ==> subgroup (ring_auto R) (BijGroup (carrier R))"
   152       "ring R ==> subgroup (ring_auto R) (BijGroup (carrier R))"
   135 apply (rule group.subgroupI) 
   153 apply (rule group.subgroupI) 
   136     apply (rule group_BijGroup) 
   154     apply (rule group_BijGroup) 
   137    apply (force simp add: ring_auto_def BijGroup_def) 
   155    apply (force simp add: ring_auto_def BijGroup_def) 
   138   apply (blast intro: dest: id_in_ring_auto) 
   156   apply (blast dest: id_in_ring_auto) 
   139  apply (simp add: ring_auto_def BijGroup_def restrict_Inv_Bij
   157  apply (simp add: ring_auto_def BijGroup_def restrict_Inv_Bij
   140                   restrict_Inv_ring_hom) 
   158                   restrict_Inv_ring_hom) 
   141 apply (simp add: ring_auto_def BijGroup_def compose_Bij)
   159 apply (simp add: ring_auto_def BijGroup_def compose_Bij)
   142 apply (simp add: ring_hom_def compose_def Pi_def)
   160 apply (simp add: ring_hom_def compose_def Pi_def)
   143 done
   161 done