equal
deleted
inserted
replaced
1 (* Title: ZF/ex/Ring.thy |
1 (* Title: ZF/ex/Ring.thy |
2 |
2 |
3 *) |
3 *) |
4 |
4 |
5 section {* Rings *} |
5 section \<open>Rings\<close> |
6 |
6 |
7 theory Ring imports Group begin |
7 theory Ring imports Group begin |
8 |
8 |
9 no_notation |
9 no_notation |
10 cadd (infixl "\<oplus>" 65) and |
10 cadd (infixl "\<oplus>" 65) and |
37 |
37 |
38 lemma zero_eq [simp]: "zero(<C,M,I,A,Z,z>) = Z" |
38 lemma zero_eq [simp]: "zero(<C,M,I,A,Z,z>) = Z" |
39 by (simp add: zero_def) |
39 by (simp add: zero_def) |
40 |
40 |
41 |
41 |
42 text {* Derived operations. *} |
42 text \<open>Derived operations.\<close> |
43 |
43 |
44 definition |
44 definition |
45 a_inv :: "[i,i] => i" ("\<ominus>\<index> _" [81] 80) where |
45 a_inv :: "[i,i] => i" ("\<ominus>\<index> _" [81] 80) where |
46 "a_inv(R) == m_inv (<carrier(R), add_field(R), zero(R), 0>)" |
46 "a_inv(R) == m_inv (<carrier(R), add_field(R), zero(R), 0>)" |
47 |
47 |
51 |
51 |
52 locale abelian_monoid = fixes G (structure) |
52 locale abelian_monoid = fixes G (structure) |
53 assumes a_comm_monoid: |
53 assumes a_comm_monoid: |
54 "comm_monoid (<carrier(G), add_field(G), zero(G), 0>)" |
54 "comm_monoid (<carrier(G), add_field(G), zero(G), 0>)" |
55 |
55 |
56 text {* |
56 text \<open> |
57 The following definition is redundant but simple to use. |
57 The following definition is redundant but simple to use. |
58 *} |
58 \<close> |
59 |
59 |
60 locale abelian_group = abelian_monoid + |
60 locale abelian_group = abelian_monoid + |
61 assumes a_comm_group: |
61 assumes a_comm_group: |
62 "comm_group (<carrier(G), add_field(G), zero(G), 0>)" |
62 "comm_group (<carrier(G), add_field(G), zero(G), 0>)" |
63 |
63 |
73 assumes one_not_zero [simp]: "\<one> \<noteq> \<zero>" |
73 assumes one_not_zero [simp]: "\<one> \<noteq> \<zero>" |
74 and integral: "\<lbrakk>a \<cdot> b = \<zero>; a \<in> carrier(R); b \<in> carrier(R)\<rbrakk> \<Longrightarrow> |
74 and integral: "\<lbrakk>a \<cdot> b = \<zero>; a \<in> carrier(R); b \<in> carrier(R)\<rbrakk> \<Longrightarrow> |
75 a = \<zero> | b = \<zero>" |
75 a = \<zero> | b = \<zero>" |
76 |
76 |
77 |
77 |
78 subsection {* Basic Properties *} |
78 subsection \<open>Basic Properties\<close> |
79 |
79 |
80 lemma (in abelian_monoid) a_monoid: |
80 lemma (in abelian_monoid) a_monoid: |
81 "monoid (<carrier(G), add_field(G), zero(G), 0>)" |
81 "monoid (<carrier(G), add_field(G), zero(G), 0>)" |
82 apply (insert a_comm_monoid) |
82 apply (insert a_comm_monoid) |
83 apply (simp add: comm_monoid_def) |
83 apply (simp add: comm_monoid_def) |
170 using comm_group.inv_mult [OF a_comm_group] |
170 using comm_group.inv_mult [OF a_comm_group] |
171 by (simp add: a_inv_def ring_add_def [symmetric]) |
171 by (simp add: a_inv_def ring_add_def [symmetric]) |
172 |
172 |
173 lemmas (in abelian_monoid) a_ac = a_assoc a_comm a_lcomm |
173 lemmas (in abelian_monoid) a_ac = a_assoc a_comm a_lcomm |
174 |
174 |
175 text {* |
175 text \<open> |
176 The following proofs are from Jacobson, Basic Algebra I, pp.~88--89 |
176 The following proofs are from Jacobson, Basic Algebra I, pp.~88--89 |
177 *} |
177 \<close> |
178 |
178 |
179 context ring |
179 context ring |
180 begin |
180 begin |
181 |
181 |
182 lemma l_null [simp]: "x \<in> carrier(R) \<Longrightarrow> \<zero> \<cdot> x = \<zero>" |
182 lemma l_null [simp]: "x \<in> carrier(R) \<Longrightarrow> \<zero> \<cdot> x = \<zero>" |
226 by (simp only: minus_def) |
226 by (simp only: minus_def) |
227 |
227 |
228 end |
228 end |
229 |
229 |
230 |
230 |
231 subsection {* Morphisms *} |
231 subsection \<open>Morphisms\<close> |
232 |
232 |
233 definition |
233 definition |
234 ring_hom :: "[i,i] => i" where |
234 ring_hom :: "[i,i] => i" where |
235 "ring_hom(R,S) == |
235 "ring_hom(R,S) == |
236 {h \<in> carrier(R) -> carrier(S). |
236 {h \<in> carrier(R) -> carrier(S). |