author | wenzelm |
Fri, 24 Jan 2025 19:25:31 +0100 | |
changeset 81970 | 6a2f889fa3b9 |
parent 81128 | 5b201b24d99b |
permissions | -rw-r--r-- |
14883 | 1 |
(* Title: ZF/ex/Ring.thy |
2 |
||
3 |
*) |
|
4 |
||
60770 | 5 |
section \<open>Rings\<close> |
14883 | 6 |
|
16417 | 7 |
theory Ring imports Group begin |
14883 | 8 |
|
81128 | 9 |
no_notation cadd (infixl \<open>\<oplus>\<close> 65) and cmult (infixl \<open>\<otimes>\<close> 70) |
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
41524
diff
changeset
|
10 |
|
14883 | 11 |
(*First, we must simulate a record declaration: |
12 |
record ring = monoid + |
|
76215
a642599ffdea
More syntactic cleanup. LaTeX markup working
paulson <lp15@cam.ac.uk>
parents:
76214
diff
changeset
|
13 |
add :: "[i, i] \<Rightarrow> i" (infixl "\<oplus>\<index>" 65) |
14883 | 14 |
zero :: i ("\<zero>\<index>") |
15 |
*) |
|
16 |
||
21233 | 17 |
definition |
76215
a642599ffdea
More syntactic cleanup. LaTeX markup working
paulson <lp15@cam.ac.uk>
parents:
76214
diff
changeset
|
18 |
add_field :: "i \<Rightarrow> i" where |
21233 | 19 |
"add_field(M) = fst(snd(snd(snd(M))))" |
14883 | 20 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21233
diff
changeset
|
21 |
definition |
76215
a642599ffdea
More syntactic cleanup. LaTeX markup working
paulson <lp15@cam.ac.uk>
parents:
76214
diff
changeset
|
22 |
ring_add :: "[i, i, i] \<Rightarrow> i" (infixl \<open>\<oplus>\<index>\<close> 65) where |
a642599ffdea
More syntactic cleanup. LaTeX markup working
paulson <lp15@cam.ac.uk>
parents:
76214
diff
changeset
|
23 |
"ring_add(M,x,y) = add_field(M) ` \<langle>x,y\<rangle>" |
14883 | 24 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21233
diff
changeset
|
25 |
definition |
76215
a642599ffdea
More syntactic cleanup. LaTeX markup working
paulson <lp15@cam.ac.uk>
parents:
76214
diff
changeset
|
26 |
zero :: "i \<Rightarrow> i" (\<open>\<zero>\<index>\<close>) where |
21233 | 27 |
"zero(M) = fst(snd(snd(snd(snd(M)))))" |
14883 | 28 |
|
29 |
||
30 |
lemma add_field_eq [simp]: "add_field(<C,M,I,A,z>) = A" |
|
31 |
by (simp add: add_field_def) |
|
32 |
||
76215
a642599ffdea
More syntactic cleanup. LaTeX markup working
paulson <lp15@cam.ac.uk>
parents:
76214
diff
changeset
|
33 |
lemma add_eq [simp]: "ring_add(<C,M,I,A,z>, x, y) = A ` \<langle>x,y\<rangle>" |
14883 | 34 |
by (simp add: ring_add_def) |
35 |
||
36 |
lemma zero_eq [simp]: "zero(<C,M,I,A,Z,z>) = Z" |
|
37 |
by (simp add: zero_def) |
|
38 |
||
39 |
||
60770 | 40 |
text \<open>Derived operations.\<close> |
14883 | 41 |
|
21233 | 42 |
definition |
76215
a642599ffdea
More syntactic cleanup. LaTeX markup working
paulson <lp15@cam.ac.uk>
parents:
76214
diff
changeset
|
43 |
a_inv :: "[i,i] \<Rightarrow> i" (\<open>\<ominus>\<index> _\<close> [81] 80) where |
76213
e44d86131648
Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents:
69587
diff
changeset
|
44 |
"a_inv(R) \<equiv> m_inv (<carrier(R), add_field(R), zero(R), 0>)" |
14883 | 45 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21233
diff
changeset
|
46 |
definition |
80917 | 47 |
minus :: "[i,i,i] \<Rightarrow> i" (\<open>(\<open>notation=\<open>infix \<ominus>\<close>\<close>_ \<ominus>\<index> _)\<close> [65,66] 65) where |
21233 | 48 |
"\<lbrakk>x \<in> carrier(R); y \<in> carrier(R)\<rbrakk> \<Longrightarrow> x \<ominus>\<^bsub>R\<^esub> y = x \<oplus>\<^bsub>R\<^esub> (\<ominus>\<^bsub>R\<^esub> y)" |
14883 | 49 |
|
29223 | 50 |
locale abelian_monoid = fixes G (structure) |
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
41524
diff
changeset
|
51 |
assumes a_comm_monoid: |
14883 | 52 |
"comm_monoid (<carrier(G), add_field(G), zero(G), 0>)" |
53 |
||
60770 | 54 |
text \<open> |
14883 | 55 |
The following definition is redundant but simple to use. |
60770 | 56 |
\<close> |
14883 | 57 |
|
58 |
locale abelian_group = abelian_monoid + |
|
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
41524
diff
changeset
|
59 |
assumes a_comm_group: |
14883 | 60 |
"comm_group (<carrier(G), add_field(G), zero(G), 0>)" |
61 |
||
29223 | 62 |
locale ring = abelian_group R + monoid R for R (structure) + |
14883 | 63 |
assumes l_distr: "\<lbrakk>x \<in> carrier(R); y \<in> carrier(R); z \<in> carrier(R)\<rbrakk> |
64 |
\<Longrightarrow> (x \<oplus> y) \<cdot> z = x \<cdot> z \<oplus> y \<cdot> z" |
|
65 |
and r_distr: "\<lbrakk>x \<in> carrier(R); y \<in> carrier(R); z \<in> carrier(R)\<rbrakk> |
|
66 |
\<Longrightarrow> z \<cdot> (x \<oplus> y) = z \<cdot> x \<oplus> z \<cdot> y" |
|
67 |
||
68 |
locale cring = ring + comm_monoid R |
|
69 |
||
70 |
locale "domain" = cring + |
|
71 |
assumes one_not_zero [simp]: "\<one> \<noteq> \<zero>" |
|
72 |
and integral: "\<lbrakk>a \<cdot> b = \<zero>; a \<in> carrier(R); b \<in> carrier(R)\<rbrakk> \<Longrightarrow> |
|
73 |
a = \<zero> | b = \<zero>" |
|
74 |
||
75 |
||
60770 | 76 |
subsection \<open>Basic Properties\<close> |
14883 | 77 |
|
78 |
lemma (in abelian_monoid) a_monoid: |
|
79 |
"monoid (<carrier(G), add_field(G), zero(G), 0>)" |
|
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
41524
diff
changeset
|
80 |
apply (insert a_comm_monoid) |
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
41524
diff
changeset
|
81 |
apply (simp add: comm_monoid_def) |
14883 | 82 |
done |
83 |
||
84 |
lemma (in abelian_group) a_group: |
|
85 |
"group (<carrier(G), add_field(G), zero(G), 0>)" |
|
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
41524
diff
changeset
|
86 |
apply (insert a_comm_group) |
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
41524
diff
changeset
|
87 |
apply (simp add: comm_group_def group_def) |
14883 | 88 |
done |
89 |
||
90 |
||
91 |
lemma (in abelian_monoid) l_zero [simp]: |
|
92 |
"x \<in> carrier(G) \<Longrightarrow> \<zero> \<oplus> x = x" |
|
93 |
apply (insert monoid.l_one [OF a_monoid]) |
|
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
41524
diff
changeset
|
94 |
apply (simp add: ring_add_def) |
14883 | 95 |
done |
96 |
||
97 |
lemma (in abelian_monoid) zero_closed [intro, simp]: |
|
98 |
"\<zero> \<in> carrier(G)" |
|
99 |
by (rule monoid.one_closed [OF a_monoid, simplified]) |
|
100 |
||
101 |
lemma (in abelian_group) a_inv_closed [intro, simp]: |
|
102 |
"x \<in> carrier(G) \<Longrightarrow> \<ominus> x \<in> carrier(G)" |
|
103 |
by (simp add: a_inv_def group.inv_closed [OF a_group, simplified]) |
|
104 |
||
105 |
lemma (in abelian_monoid) a_closed [intro, simp]: |
|
76213
e44d86131648
Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents:
69587
diff
changeset
|
106 |
"\<lbrakk>x \<in> carrier(G); y \<in> carrier(G)\<rbrakk> \<Longrightarrow> x \<oplus> y \<in> carrier(G)" |
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
41524
diff
changeset
|
107 |
by (rule monoid.m_closed [OF a_monoid, |
14883 | 108 |
simplified, simplified ring_add_def [symmetric]]) |
109 |
||
110 |
lemma (in abelian_group) minus_closed [intro, simp]: |
|
111 |
"\<lbrakk>x \<in> carrier(G); y \<in> carrier(G)\<rbrakk> \<Longrightarrow> x \<ominus> y \<in> carrier(G)" |
|
112 |
by (simp add: minus_def) |
|
113 |
||
114 |
lemma (in abelian_group) a_l_cancel [simp]: |
|
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
41524
diff
changeset
|
115 |
"\<lbrakk>x \<in> carrier(G); y \<in> carrier(G); z \<in> carrier(G)\<rbrakk> |
46822
95f1e700b712
mathematical symbols for Isabelle/ZF example theories
paulson
parents:
46821
diff
changeset
|
116 |
\<Longrightarrow> (x \<oplus> y = x \<oplus> z) \<longleftrightarrow> (y = z)" |
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
41524
diff
changeset
|
117 |
by (rule group.l_cancel [OF a_group, |
14883 | 118 |
simplified, simplified ring_add_def [symmetric]]) |
119 |
||
120 |
lemma (in abelian_group) a_r_cancel [simp]: |
|
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
41524
diff
changeset
|
121 |
"\<lbrakk>x \<in> carrier(G); y \<in> carrier(G); z \<in> carrier(G)\<rbrakk> |
46822
95f1e700b712
mathematical symbols for Isabelle/ZF example theories
paulson
parents:
46821
diff
changeset
|
122 |
\<Longrightarrow> (y \<oplus> x = z \<oplus> x) \<longleftrightarrow> (y = z)" |
14883 | 123 |
by (rule group.r_cancel [OF a_group, simplified, simplified ring_add_def [symmetric]]) |
124 |
||
125 |
lemma (in abelian_monoid) a_assoc: |
|
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
41524
diff
changeset
|
126 |
"\<lbrakk>x \<in> carrier(G); y \<in> carrier(G); z \<in> carrier(G)\<rbrakk> |
14883 | 127 |
\<Longrightarrow> (x \<oplus> y) \<oplus> z = x \<oplus> (y \<oplus> z)" |
128 |
by (rule monoid.m_assoc [OF a_monoid, simplified, simplified ring_add_def [symmetric]]) |
|
129 |
||
130 |
lemma (in abelian_group) l_neg: |
|
131 |
"x \<in> carrier(G) \<Longrightarrow> \<ominus> x \<oplus> x = \<zero>" |
|
132 |
by (simp add: a_inv_def |
|
133 |
group.l_inv [OF a_group, simplified, simplified ring_add_def [symmetric]]) |
|
134 |
||
135 |
lemma (in abelian_monoid) a_comm: |
|
136 |
"\<lbrakk>x \<in> carrier(G); y \<in> carrier(G)\<rbrakk> \<Longrightarrow> x \<oplus> y = y \<oplus> x" |
|
137 |
by (rule comm_monoid.m_comm [OF a_comm_monoid, |
|
138 |
simplified, simplified ring_add_def [symmetric]]) |
|
139 |
||
140 |
lemma (in abelian_monoid) a_lcomm: |
|
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
41524
diff
changeset
|
141 |
"\<lbrakk>x \<in> carrier(G); y \<in> carrier(G); z \<in> carrier(G)\<rbrakk> |
14883 | 142 |
\<Longrightarrow> x \<oplus> (y \<oplus> z) = y \<oplus> (x \<oplus> z)" |
143 |
by (rule comm_monoid.m_lcomm [OF a_comm_monoid, |
|
144 |
simplified, simplified ring_add_def [symmetric]]) |
|
145 |
||
146 |
lemma (in abelian_monoid) r_zero [simp]: |
|
147 |
"x \<in> carrier(G) \<Longrightarrow> x \<oplus> \<zero> = x" |
|
148 |
using monoid.r_one [OF a_monoid] |
|
149 |
by (simp add: ring_add_def [symmetric]) |
|
150 |
||
151 |
lemma (in abelian_group) r_neg: |
|
152 |
"x \<in> carrier(G) \<Longrightarrow> x \<oplus> (\<ominus> x) = \<zero>" |
|
153 |
using group.r_inv [OF a_group] |
|
154 |
by (simp add: a_inv_def ring_add_def [symmetric]) |
|
155 |
||
156 |
lemma (in abelian_group) minus_zero [simp]: |
|
157 |
"\<ominus> \<zero> = \<zero>" |
|
158 |
by (simp add: a_inv_def |
|
159 |
group.inv_one [OF a_group, simplified ]) |
|
160 |
||
161 |
lemma (in abelian_group) minus_minus [simp]: |
|
162 |
"x \<in> carrier(G) \<Longrightarrow> \<ominus> (\<ominus> x) = x" |
|
163 |
using group.inv_inv [OF a_group, simplified] |
|
164 |
by (simp add: a_inv_def) |
|
165 |
||
166 |
lemma (in abelian_group) minus_add: |
|
167 |
"\<lbrakk>x \<in> carrier(G); y \<in> carrier(G)\<rbrakk> \<Longrightarrow> \<ominus> (x \<oplus> y) = \<ominus> x \<oplus> \<ominus> y" |
|
168 |
using comm_group.inv_mult [OF a_comm_group] |
|
169 |
by (simp add: a_inv_def ring_add_def [symmetric]) |
|
170 |
||
171 |
lemmas (in abelian_monoid) a_ac = a_assoc a_comm a_lcomm |
|
172 |
||
60770 | 173 |
text \<open> |
76213
e44d86131648
Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents:
69587
diff
changeset
|
174 |
The following proofs are from Jacobson, Basic Algebra I, pp.\<not>88--89 |
60770 | 175 |
\<close> |
14883 | 176 |
|
21233 | 177 |
context ring |
178 |
begin |
|
179 |
||
180 |
lemma l_null [simp]: "x \<in> carrier(R) \<Longrightarrow> \<zero> \<cdot> x = \<zero>" |
|
14883 | 181 |
proof - |
182 |
assume R: "x \<in> carrier(R)" |
|
183 |
then have "\<zero> \<cdot> x \<oplus> \<zero> \<cdot> x = (\<zero> \<oplus> \<zero>) \<cdot> x" |
|
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
41524
diff
changeset
|
184 |
by (blast intro: l_distr [THEN sym]) |
14883 | 185 |
also from R have "... = \<zero> \<cdot> x \<oplus> \<zero>" by simp |
186 |
finally have "\<zero> \<cdot> x \<oplus> \<zero> \<cdot> x = \<zero> \<cdot> x \<oplus> \<zero>" . |
|
187 |
with R show ?thesis by (simp del: r_zero) |
|
188 |
qed |
|
189 |
||
21233 | 190 |
lemma r_null [simp]: "x \<in> carrier(R) \<Longrightarrow> x \<cdot> \<zero> = \<zero>" |
14883 | 191 |
proof - |
192 |
assume R: "x \<in> carrier(R)" |
|
193 |
then have "x \<cdot> \<zero> \<oplus> x \<cdot> \<zero> = x \<cdot> (\<zero> \<oplus> \<zero>)" |
|
194 |
by (simp add: r_distr del: l_zero r_zero) |
|
195 |
also from R have "... = x \<cdot> \<zero> \<oplus> \<zero>" by simp |
|
196 |
finally have "x \<cdot> \<zero> \<oplus> x \<cdot> \<zero> = x \<cdot> \<zero> \<oplus> \<zero>" . |
|
197 |
with R show ?thesis by (simp del: r_zero) |
|
198 |
qed |
|
199 |
||
21233 | 200 |
lemma l_minus: |
14883 | 201 |
"\<lbrakk>x \<in> carrier(R); y \<in> carrier(R)\<rbrakk> \<Longrightarrow> \<ominus> x \<cdot> y = \<ominus> (x \<cdot> y)" |
202 |
proof - |
|
203 |
assume R: "x \<in> carrier(R)" "y \<in> carrier(R)" |
|
204 |
then have "(\<ominus> x) \<cdot> y \<oplus> x \<cdot> y = (\<ominus> x \<oplus> x) \<cdot> y" by (simp add: l_distr) |
|
41524 | 205 |
also from R have "... = \<zero>" by (simp add: l_neg) |
14883 | 206 |
finally have "(\<ominus> x) \<cdot> y \<oplus> x \<cdot> y = \<zero>" . |
207 |
with R have "(\<ominus> x) \<cdot> y \<oplus> x \<cdot> y \<oplus> \<ominus> (x \<cdot> y) = \<zero> \<oplus> \<ominus> (x \<cdot> y)" by simp |
|
208 |
with R show ?thesis by (simp add: a_assoc r_neg) |
|
209 |
qed |
|
210 |
||
21233 | 211 |
lemma r_minus: |
14883 | 212 |
"\<lbrakk>x \<in> carrier(R); y \<in> carrier(R)\<rbrakk> \<Longrightarrow> x \<cdot> \<ominus> y = \<ominus> (x \<cdot> y)" |
213 |
proof - |
|
214 |
assume R: "x \<in> carrier(R)" "y \<in> carrier(R)" |
|
215 |
then have "x \<cdot> (\<ominus> y) \<oplus> x \<cdot> y = x \<cdot> (\<ominus> y \<oplus> y)" by (simp add: r_distr) |
|
41524 | 216 |
also from R have "... = \<zero>" by (simp add: l_neg) |
14883 | 217 |
finally have "x \<cdot> (\<ominus> y) \<oplus> x \<cdot> y = \<zero>" . |
218 |
with R have "x \<cdot> (\<ominus> y) \<oplus> x \<cdot> y \<oplus> \<ominus> (x \<cdot> y) = \<zero> \<oplus> \<ominus> (x \<cdot> y)" by simp |
|
219 |
with R show ?thesis by (simp add: a_assoc r_neg) |
|
220 |
qed |
|
221 |
||
21233 | 222 |
lemma minus_eq: |
14883 | 223 |
"\<lbrakk>x \<in> carrier(R); y \<in> carrier(R)\<rbrakk> \<Longrightarrow> x \<ominus> y = x \<oplus> \<ominus> y" |
224 |
by (simp only: minus_def) |
|
225 |
||
21233 | 226 |
end |
227 |
||
14883 | 228 |
|
60770 | 229 |
subsection \<open>Morphisms\<close> |
14883 | 230 |
|
21233 | 231 |
definition |
76215
a642599ffdea
More syntactic cleanup. LaTeX markup working
paulson <lp15@cam.ac.uk>
parents:
76214
diff
changeset
|
232 |
ring_hom :: "[i,i] \<Rightarrow> i" where |
76213
e44d86131648
Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents:
69587
diff
changeset
|
233 |
"ring_hom(R,S) \<equiv> |
14883 | 234 |
{h \<in> carrier(R) -> carrier(S). |
76214 | 235 |
(\<forall>x y. x \<in> carrier(R) \<and> y \<in> carrier(R) \<longrightarrow> |
236 |
h ` (x \<cdot>\<^bsub>R\<^esub> y) = (h ` x) \<cdot>\<^bsub>S\<^esub> (h ` y) \<and> |
|
237 |
h ` (x \<oplus>\<^bsub>R\<^esub> y) = (h ` x) \<oplus>\<^bsub>S\<^esub> (h ` y)) \<and> |
|
14883 | 238 |
h ` \<one>\<^bsub>R\<^esub> = \<one>\<^bsub>S\<^esub>}" |
239 |
||
240 |
lemma ring_hom_memI: |
|
241 |
assumes hom_type: "h \<in> carrier(R) \<rightarrow> carrier(S)" |
|
242 |
and hom_mult: "\<And>x y. \<lbrakk>x \<in> carrier(R); y \<in> carrier(R)\<rbrakk> \<Longrightarrow> |
|
243 |
h ` (x \<cdot>\<^bsub>R\<^esub> y) = (h ` x) \<cdot>\<^bsub>S\<^esub> (h ` y)" |
|
244 |
and hom_add: "\<And>x y. \<lbrakk>x \<in> carrier(R); y \<in> carrier(R)\<rbrakk> \<Longrightarrow> |
|
245 |
h ` (x \<oplus>\<^bsub>R\<^esub> y) = (h ` x) \<oplus>\<^bsub>S\<^esub> (h ` y)" |
|
246 |
and hom_one: "h ` \<one>\<^bsub>R\<^esub> = \<one>\<^bsub>S\<^esub>" |
|
247 |
shows "h \<in> ring_hom(R,S)" |
|
41524 | 248 |
by (auto simp add: ring_hom_def assms) |
14883 | 249 |
|
250 |
lemma ring_hom_closed: |
|
251 |
"\<lbrakk>h \<in> ring_hom(R,S); x \<in> carrier(R)\<rbrakk> \<Longrightarrow> h ` x \<in> carrier(S)" |
|
252 |
by (auto simp add: ring_hom_def) |
|
253 |
||
254 |
lemma ring_hom_mult: |
|
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
41524
diff
changeset
|
255 |
"\<lbrakk>h \<in> ring_hom(R,S); x \<in> carrier(R); y \<in> carrier(R)\<rbrakk> |
14883 | 256 |
\<Longrightarrow> h ` (x \<cdot>\<^bsub>R\<^esub> y) = (h ` x) \<cdot>\<^bsub>S\<^esub> (h ` y)" |
257 |
by (simp add: ring_hom_def) |
|
258 |
||
259 |
lemma ring_hom_add: |
|
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
41524
diff
changeset
|
260 |
"\<lbrakk>h \<in> ring_hom(R,S); x \<in> carrier(R); y \<in> carrier(R)\<rbrakk> |
14883 | 261 |
\<Longrightarrow> h ` (x \<oplus>\<^bsub>R\<^esub> y) = (h ` x) \<oplus>\<^bsub>S\<^esub> (h ` y)" |
262 |
by (simp add: ring_hom_def) |
|
263 |
||
264 |
lemma ring_hom_one: "h \<in> ring_hom(R,S) \<Longrightarrow> h ` \<one>\<^bsub>R\<^esub> = \<one>\<^bsub>S\<^esub>" |
|
265 |
by (simp add: ring_hom_def) |
|
266 |
||
29223 | 267 |
locale ring_hom_cring = R: cring R + S: cring S |
268 |
for R (structure) and S (structure) and h + |
|
14883 | 269 |
assumes homh [simp, intro]: "h \<in> ring_hom(R,S)" |
270 |
notes hom_closed [simp, intro] = ring_hom_closed [OF homh] |
|
271 |
and hom_mult [simp] = ring_hom_mult [OF homh] |
|
272 |
and hom_add [simp] = ring_hom_add [OF homh] |
|
273 |
and hom_one [simp] = ring_hom_one [OF homh] |
|
274 |
||
275 |
lemma (in ring_hom_cring) hom_zero [simp]: |
|
276 |
"h ` \<zero>\<^bsub>R\<^esub> = \<zero>\<^bsub>S\<^esub>" |
|
277 |
proof - |
|
278 |
have "h ` \<zero>\<^bsub>R\<^esub> \<oplus>\<^bsub>S\<^esub> h ` \<zero> = h ` \<zero>\<^bsub>R\<^esub> \<oplus>\<^bsub>S\<^esub> \<zero>\<^bsub>S\<^esub>" |
|
279 |
by (simp add: hom_add [symmetric] del: hom_add) |
|
280 |
then show ?thesis by (simp del: S.r_zero) |
|
281 |
qed |
|
282 |
||
283 |
lemma (in ring_hom_cring) hom_a_inv [simp]: |
|
284 |
"x \<in> carrier(R) \<Longrightarrow> h ` (\<ominus>\<^bsub>R\<^esub> x) = \<ominus>\<^bsub>S\<^esub> h ` x" |
|
285 |
proof - |
|
286 |
assume R: "x \<in> carrier(R)" |
|
287 |
then have "h ` x \<oplus>\<^bsub>S\<^esub> h ` (\<ominus> x) = h ` x \<oplus>\<^bsub>S\<^esub> (\<ominus>\<^bsub>S\<^esub> (h ` x))" |
|
288 |
by (simp add: hom_add [symmetric] R.r_neg S.r_neg del: hom_add) |
|
289 |
with R show ?thesis by simp |
|
290 |
qed |
|
291 |
||
292 |
lemma (in ring) id_ring_hom [simp]: "id(carrier(R)) \<in> ring_hom(R,R)" |
|
46821
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
41524
diff
changeset
|
293 |
apply (rule ring_hom_memI) |
ff6b0c1087f2
Using mathematical notation for <-> and cardinal arithmetic
paulson
parents:
41524
diff
changeset
|
294 |
apply (auto simp add: id_type) |
14883 | 295 |
done |
296 |
||
297 |
end |