src/HOL/Algebra/Ring.thy
changeset 35848 5443079512ea
parent 35847 19f1f7066917
child 35849 b5522b51cb1e
equal deleted inserted replaced
35847:19f1f7066917 35848:5443079512ea
    20 
    20 
    21 text {* Derived operations. *}
    21 text {* Derived operations. *}
    22 
    22 
    23 definition
    23 definition
    24   a_inv :: "[('a, 'm) ring_scheme, 'a ] => 'a" ("\<ominus>\<index> _" [81] 80)
    24   a_inv :: "[('a, 'm) ring_scheme, 'a ] => 'a" ("\<ominus>\<index> _" [81] 80)
    25   where "a_inv R == m_inv (| carrier = carrier R, mult = add R, one = zero R |)"
    25   where "a_inv R = m_inv (| carrier = carrier R, mult = add R, one = zero R |)"
    26 
    26 
    27 definition
    27 definition
    28   a_minus :: "[('a, 'm) ring_scheme, 'a, 'a] => 'a" (infixl "\<ominus>\<index>" 65)
    28   a_minus :: "[('a, 'm) ring_scheme, 'a, 'a] => 'a" (infixl "\<ominus>\<index>" 65)
    29   where "[| x \<in> carrier R; y \<in> carrier R |] ==> x \<ominus>\<^bsub>R\<^esub> y == x \<oplus>\<^bsub>R\<^esub> (\<ominus>\<^bsub>R\<^esub> y)"
    29   where "[| x \<in> carrier R; y \<in> carrier R |] ==> x \<ominus>\<^bsub>R\<^esub> y = x \<oplus>\<^bsub>R\<^esub> (\<ominus>\<^bsub>R\<^esub> y)"
    30 
    30 
    31 locale abelian_monoid =
    31 locale abelian_monoid =
    32   fixes G (structure)
    32   fixes G (structure)
    33   assumes a_comm_monoid:
    33   assumes a_comm_monoid:
    34      "comm_monoid (| carrier = carrier G, mult = add G, one = zero G |)"
    34      "comm_monoid (| carrier = carrier G, mult = add G, one = zero G |)"
   198 
   198 
   199 text {*
   199 text {*
   200   This definition makes it easy to lift lemmas from @{term finprod}.
   200   This definition makes it easy to lift lemmas from @{term finprod}.
   201 *}
   201 *}
   202 
   202 
   203 definition finsum :: "[('b, 'm) ring_scheme, 'a => 'b, 'a set] => 'b" where
   203 definition
   204   "finsum G f A == finprod (| carrier = carrier G,
   204   finsum :: "[('b, 'm) ring_scheme, 'a => 'b, 'a set] => 'b" where
   205      mult = add G, one = zero G |) f A"
   205   "finsum G f A = finprod (| carrier = carrier G, mult = add G, one = zero G |) f A"
   206 
   206 
   207 syntax
   207 syntax
   208   "_finsum" :: "index => idt => 'a set => 'b => 'b"
   208   "_finsum" :: "index => idt => 'a set => 'b => 'b"
   209       ("(3\<Oplus>__:_. _)" [1000, 0, 51, 10] 10)
   209       ("(3\<Oplus>__:_. _)" [1000, 0, 51, 10] 10)
   210 syntax (xsymbols)
   210 syntax (xsymbols)
   730 
   730 
   731 subsection {* Morphisms *}
   731 subsection {* Morphisms *}
   732 
   732 
   733 definition
   733 definition
   734   ring_hom :: "[('a, 'm) ring_scheme, ('b, 'n) ring_scheme] => ('a => 'b) set"
   734   ring_hom :: "[('a, 'm) ring_scheme, ('b, 'n) ring_scheme] => ('a => 'b) set"
   735   where "ring_hom R S ==
   735   where "ring_hom R S =
   736     {h. h \<in> carrier R -> carrier S &
   736     {h. h \<in> carrier R -> carrier S &
   737       (ALL x y. x \<in> carrier R & y \<in> carrier R -->
   737       (ALL x y. x \<in> carrier R & y \<in> carrier R -->
   738         h (x \<otimes>\<^bsub>R\<^esub> y) = h x \<otimes>\<^bsub>S\<^esub> h y & h (x \<oplus>\<^bsub>R\<^esub> y) = h x \<oplus>\<^bsub>S\<^esub> h y) &
   738         h (x \<otimes>\<^bsub>R\<^esub> y) = h x \<otimes>\<^bsub>S\<^esub> h y & h (x \<oplus>\<^bsub>R\<^esub> y) = h x \<oplus>\<^bsub>S\<^esub> h y) &
   739       h \<one>\<^bsub>R\<^esub> = \<one>\<^bsub>S\<^esub>}"
   739       h \<one>\<^bsub>R\<^esub> = \<one>\<^bsub>S\<^esub>}"
   740 
   740