src/ZF/ex/Ring.thy
changeset 17258 5e1a443fb298
parent 16417 9bc16273c2d4
child 21233 5a5c8ea5f66a
equal deleted inserted replaced
17257:0ab67cb765da 17258:5e1a443fb298
   216 
   216 
   217 lemma (in ring) minus_eq:
   217 lemma (in ring) minus_eq:
   218   "\<lbrakk>x \<in> carrier(R); y \<in> carrier(R)\<rbrakk> \<Longrightarrow> x \<ominus> y = x \<oplus> \<ominus> y"
   218   "\<lbrakk>x \<in> carrier(R); y \<in> carrier(R)\<rbrakk> \<Longrightarrow> x \<ominus> y = x \<oplus> \<ominus> y"
   219   by (simp only: minus_def)
   219   by (simp only: minus_def)
   220 
   220 
   221 
       
   222 lemma (in ring) l_null [simp]:
       
   223   "x \<in> carrier(R) \<Longrightarrow> \<zero> \<cdot> x = \<zero>"
       
   224 proof -
       
   225   assume R: "x \<in> carrier(R)"
       
   226   then have "\<zero> \<cdot> x \<oplus> \<zero> \<cdot> x = (\<zero> \<oplus> \<zero>) \<cdot> x"
       
   227     by (simp add: l_distr del: l_zero r_zero)
       
   228   also from R have "... = \<zero> \<cdot> x \<oplus> \<zero>" by simp
       
   229   finally have "\<zero> \<cdot> x \<oplus> \<zero> \<cdot> x = \<zero> \<cdot> x \<oplus> \<zero>" .
       
   230   with R show ?thesis by (simp del: r_zero)
       
   231 qed
       
   232 
       
   233 lemma (in ring) r_null [simp]:
       
   234   "x \<in> carrier(R) \<Longrightarrow> x \<cdot> \<zero> = \<zero>"
       
   235 proof -
       
   236   assume R: "x \<in> carrier(R)"
       
   237   then have "x \<cdot> \<zero> \<oplus> x \<cdot> \<zero> = x \<cdot> (\<zero> \<oplus> \<zero>)"
       
   238     by (simp add: r_distr del: l_zero r_zero)
       
   239   also from R have "... = x \<cdot> \<zero> \<oplus> \<zero>" by simp
       
   240   finally have "x \<cdot> \<zero> \<oplus> x \<cdot> \<zero> = x \<cdot> \<zero> \<oplus> \<zero>" .
       
   241   with R show ?thesis by (simp del: r_zero)
       
   242 qed
       
   243 
       
   244 lemma (in ring) l_minus:
       
   245   "\<lbrakk>x \<in> carrier(R); y \<in> carrier(R)\<rbrakk> \<Longrightarrow> \<ominus> x \<cdot> y = \<ominus> (x \<cdot> y)"
       
   246 proof -
       
   247   assume R: "x \<in> carrier(R)" "y \<in> carrier(R)"
       
   248   then have "(\<ominus> x) \<cdot> y \<oplus> x \<cdot> y = (\<ominus> x \<oplus> x) \<cdot> y" by (simp add: l_distr)
       
   249   also from R have "... = \<zero>" by (simp add: l_neg l_null)
       
   250   finally have "(\<ominus> x) \<cdot> y \<oplus> x \<cdot> y = \<zero>" .
       
   251   with R have "(\<ominus> x) \<cdot> y \<oplus> x \<cdot> y \<oplus> \<ominus> (x \<cdot> y) = \<zero> \<oplus> \<ominus> (x \<cdot> y)" by simp
       
   252   with R show ?thesis by (simp add: a_assoc r_neg)
       
   253 qed
       
   254 
       
   255 lemma (in ring) r_minus:
       
   256   "\<lbrakk>x \<in> carrier(R); y \<in> carrier(R)\<rbrakk> \<Longrightarrow> x \<cdot> \<ominus> y = \<ominus> (x \<cdot> y)"
       
   257 proof -
       
   258   assume R: "x \<in> carrier(R)" "y \<in> carrier(R)"
       
   259   then have "x \<cdot> (\<ominus> y) \<oplus> x \<cdot> y = x \<cdot> (\<ominus> y \<oplus> y)" by (simp add: r_distr)
       
   260   also from R have "... = \<zero>" by (simp add: l_neg r_null)
       
   261   finally have "x \<cdot> (\<ominus> y) \<oplus> x \<cdot> y = \<zero>" .
       
   262   with R have "x \<cdot> (\<ominus> y) \<oplus> x \<cdot> y \<oplus> \<ominus> (x \<cdot> y) = \<zero> \<oplus> \<ominus> (x \<cdot> y)" by simp
       
   263   with R show ?thesis by (simp add: a_assoc r_neg)
       
   264 qed
       
   265 
       
   266 lemma (in ring) minus_eq:
       
   267   "\<lbrakk>x \<in> carrier(R); y \<in> carrier(R)\<rbrakk> \<Longrightarrow> x \<ominus> y = x \<oplus> \<ominus> y"
       
   268   by (simp only: minus_def)
       
   269 
   221 
   270 subsection {* Morphisms *}
   222 subsection {* Morphisms *}
   271 
   223 
   272 constdefs
   224 constdefs
   273   ring_hom :: "[i,i] => i"
   225   ring_hom :: "[i,i] => i"