diff --git a/IsarMathLib/Group_ZF_5.thy b/IsarMathLib/Group_ZF_5.thy index 8214b66..9aa9c5f 100644 --- a/IsarMathLib/Group_ZF_5.thy +++ b/IsarMathLib/Group_ZF_5.thy @@ -37,20 +37,30 @@ subsection\Homomorphisms\ text\A homomorphism is a function between groups that preserves the group operations.\ -text\Suppose we have two groups $G$ and $H$ with corresponding binary operations - $P:G\times G \rightarrow G$ and $F:H\times H \rightarrow H$. Then $f$ is a homomorphism - if for all $g_1,g_2\in G$ we have $f(P\langle g_1,g_2\rangle ) = F\langle f(g_1),f(g_2)\rangle$. \ +text\In general we may have a homomorphism not only between groups, but also between various + algebraic structures with one operation like magmas, semigroups, quasigroups, loops and monoids. + In all cases the homomorphism is defined by using the morphism property. In the + multiplicative notation we we will write that $f$ has a morphism property if + $f(x\cdot_G y) = f(x)\cdot_H f(y)$ for all $x,y\in G$. Below we write this definition + in raw set theory notation and use the expression \IsMorphism\ instead of the possible, but longer + \HasMorphismProperty\. \ + +definition + "IsMorphism(G,P,F,f) \ \g\<^sub>1\G. \g\<^sub>2\G. f`(P`\g\<^sub>1,g\<^sub>2\) = F`\f`(g\<^sub>1),f`(g\<^sub>2)\" + +text\A function $f:G\rightarrow H$ between algebraic structures + $(G,\cdot_G)$ and $(H,\cdot_H)$ with one operation (each) is a homomorphism is it has the morphism + property. \ definition - Homomor where "IsAgroup(G,P) \ IsAgroup(H,F) \ - Homomor(f,G,P,H,F) \ \g\<^sub>1\G. \g\<^sub>2\G. f`(P`\g\<^sub>1,g\<^sub>2\)=F`\f`(g\<^sub>1),f`(g\<^sub>2)\" + "Homomor(f,G,P,H,F) \ f:G\H \ IsMorphism(G,P,F,f)" text\Now a lemma about the definition:\ lemma homomor_eq: - assumes "IsAgroup(G,P)" "IsAgroup(H,F)" "Homomor(f,G,P,H,F)" "g\<^sub>1\G" "g\<^sub>2\G" - shows "f`(P`\g\<^sub>1,g\<^sub>2\)=F`\f`(g\<^sub>1),f`(g\<^sub>2)\" - using assms Homomor_def by auto + assumes "Homomor(f,G,P,H,F)" "g\<^sub>1\G" "g\<^sub>2\G" + shows "f`(P`\g\<^sub>1,g\<^sub>2\) = F`\f`(g\<^sub>1),f`(g\<^sub>2)\" + using assms unfolding Homomor_def IsMorphism_def by auto text\An endomorphism is a homomorphism from a group to the same group. In case the group is abelian, it has a nice structure.\ @@ -62,7 +72,7 @@ text\The defining property of an endomorphism written in notation used in lemma (in group0) endomor_eq: assumes "f \ End(G,P)" "g\<^sub>1\G" "g\<^sub>2\G" shows "f`(g\<^sub>1\g\<^sub>2) = f`(g\<^sub>1)\f`(g\<^sub>2)" - using groupAssum assms homomor_eq unfolding End_def by simp + using assms homomor_eq unfolding End_def by auto text\A function that maps a group $G$ into itself and satisfies $f(g_1\cdot g2) = f(g_1)\cdot f(g_2)$ is an endomorphism.\ @@ -70,7 +80,7 @@ text\A function that maps a group $G$ into itself and satisfies lemma (in group0) eq_endomor: assumes "f:G\G" and "\g\<^sub>1\G. \g\<^sub>2\G. f`(g\<^sub>1\g\<^sub>2)=f`(g\<^sub>1)\f`(g\<^sub>2)" shows "f \ End(G,P)" - using groupAssum assms Homomor_def unfolding End_def by auto + using assms unfolding End_def Homomor_def IsMorphism_def by simp text\The set of endomorphisms forms a submonoid of the monoid of function from a set to that set under composition.\ @@ -149,7 +159,7 @@ lemma (in abelian_group) end_inverse_group: shows "GroupInv(G,P) \ End(G,P)" using inverse_in_group group_inv_of_two isAbelian IsCommutative_def group0_2_T2 groupAssum Homomor_def - unfolding End_def by simp + unfolding End_def IsMorphism_def by simp text\The set of homomorphisms of an abelian group is an abelian subgroup of the group of functions from a set to a group, under pointwise multiplication.\ @@ -294,17 +304,19 @@ text\Now we will prove that any homomorphism $f:G\to H$ defines a bijectiv text\A group homomorphism sends the neutral element to the neutral element.\ lemma image_neutral: - assumes "IsAgroup(G,P)" "IsAgroup(H,F)" "Homomor(f,G,P,H,F)" "f:G\H" + assumes "IsAgroup(G,P)" "IsAgroup(H,F)" "Homomor(f,G,P,H,F)" shows "f`(TheNeutralElement(G,P)) = TheNeutralElement(H,F)" proof - let ?e\<^sub>G = "TheNeutralElement(G,P)" let ?e\<^sub>H = "TheNeutralElement(H,F)" + from assms(3) have ff: "f:G\H" + unfolding Homomor_def by simp have g: "?e\<^sub>G = P`\?e\<^sub>G,?e\<^sub>G\" "?e\<^sub>G \ G" using assms(1) group0.group0_2_L2 unfolding group0_def by simp_all with assms have "f`(?e\<^sub>G) = F`\f`(?e\<^sub>G),f`(?e\<^sub>G)\" - using Homomor_def by force + unfolding Homomor_def IsMorphism_def by force moreover - from assms(4) g(2) have h: "f`(?e\<^sub>G) \ H" using apply_type + from ff g(2) have h: "f`(?e\<^sub>G) \ H" using apply_type by simp with assms(2) have "f`(?e\<^sub>G) = F`\f`(?e\<^sub>G),?e\<^sub>H\" using group0.group0_2_L2 unfolding group0_def by simp @@ -324,44 +336,47 @@ qed text\If $f:G\rightarrow H$ is a homomorphism, then it commutes with the inverse \ lemma image_inv: - assumes "IsAgroup(G,P)" "IsAgroup(H,F)" "Homomor(f,G,P,H,F)" "f:G\H" "g\G" + assumes "IsAgroup(G,P)" "IsAgroup(H,F)" "Homomor(f,G,P,H,F)" "g\G" shows "f`(GroupInv(G,P)`(g)) = GroupInv(H,F)`(f`(g))" -proof- - from assms(4,5) have im: "f`(g)\H" using apply_type by simp - from assms(1,5) have inv: "GroupInv(G,P)`(g)\G" +proof - + from assms(3) have ff: "f:G\H" + unfolding Homomor_def by simp + with assms(4) have im: "f`(g)\H" using apply_type by simp + from assms(1,4) have inv: "GroupInv(G,P)`(g)\G" using group0.inverse_in_group unfolding group0_def by simp - with assms(4) have inv2: "f`(GroupInv(G,P)`g)\H" using apply_type by simp - from assms(1,5) have + with ff have inv2: "f`(GroupInv(G,P)`g)\H" using apply_type by simp + from assms(1,4) have "f`(TheNeutralElement(G,P)) = f`(P`\g,GroupInv(G,P)`(g)\)" using group0.group0_2_L6 unfolding group0_def by simp - also from assms(1,2,3,5) inv have "\ = F`\f`(g),f`(GroupInv(G,P)`(g))\" - using Homomor_def by simp + also from assms inv have "\ = F`\f`(g),f`(GroupInv(G,P)`(g))\" + unfolding Homomor_def IsMorphism_def by simp finally have "f`(TheNeutralElement(G,P)) = F`\f`(g),f`(GroupInv(G,P)`(g))\" by simp - with assms(1-4) im inv2 show ?thesis + with assms im inv2 show ?thesis using group0.group0_2_L9 image_neutral unfolding group0_def by simp qed text\The preimage of a subgroup is a subgroup\ theorem preimage_sub: - assumes "IsAgroup(G,P)" "IsAgroup(H,F)" "Homomor(f,G,P,H,F)" "f:G\H" + assumes "IsAgroup(G,P)" "IsAgroup(H,F)" "Homomor(f,G,P,H,F)" "IsAsubgroup(K,F)" shows "IsAsubgroup(f-``(K),P)" proof - + from assms(3) have ff: "f:G\H" + unfolding Homomor_def by simp from assms(2) have Hgr: "group0(H,F)" unfolding group0_def by simp from assms(1) have Ggr: "group0(G,P)" unfolding group0_def by simp moreover - from assms Ggr Hgr have "TheNeutralElement(G,P) \ f-``(K)" + from assms ff Ggr Hgr have "TheNeutralElement(G,P) \ f-``(K)" using image_neutral group0.group0_3_L5 func1_1_L15 group0.group0_2_L2 by simp hence "f-``(K)\0" by blast - moreover from assms(4) have "f-``(K) \ G" using func1_1_L3 by simp - moreover from assms Ggr Hgr have "f-``(K) {is closed under} P" - using func1_1_L15 group0.group0_3_L6 Homomor_def - group0.group_op_closed func1_1_L15 - unfolding IsOpClosed_def by simp - moreover from assms Ggr Hgr have + moreover from ff have "f-``(K) \ G" using func1_1_L3 by simp + moreover from assms ff Ggr Hgr have "f-``(K) {is closed under} P" + using func1_1_L15 group0.group0_3_L6 group0.group_op_closed func1_1_L15 + unfolding IsOpClosed_def Homomor_def IsMorphism_def by simp + moreover from assms ff Ggr Hgr have "\x\f-``(K). GroupInv(G, P)`(x) \ f-``(K)" using group0.group0_3_T3A image_inv func1_1_L15 group0.inverse_in_group by simp @@ -371,13 +386,15 @@ qed text\The preimage of a normal subgroup is normal\ theorem preimage_normal_subgroup: - assumes "IsAgroup(G,P)" "IsAgroup(H,F)" "Homomor(f,G,P,H,F)" "f:G\H" + assumes "IsAgroup(G,P)" "IsAgroup(H,F)" "Homomor(f,G,P,H,F)" "IsAnormalSubgroup(H,F,K)" shows "IsAnormalSubgroup(G,P,f-``(K))" proof - + from assms(3) have ff: "f:G\H" + unfolding Homomor_def by simp from assms(2) have Hgr: "group0(H,F)" unfolding group0_def by simp - with assms(5) have "K\H" using group0.group0_3_L2 - unfolding IsAnormalSubgroup_def by simp + with assms(4) have "K\H" using group0.group0_3_L2 + unfolding IsAnormalSubgroup_def by simp from assms(1) have Ggr: "group0(G,P)" unfolding group0_def by simp moreover from assms have "IsAsubgroup(f-``(K),P)" using preimage_sub unfolding IsAnormalSubgroup_def by simp @@ -388,14 +405,14 @@ proof - k: "h = P`\g,P`\k,GroupInv(G, P)`(g)\\" "k \ f-``(K)" by auto from k(1) have "f`(h) = f`(P`\g,P`\k, GroupInv(G, P)`(g)\\)" by simp - moreover from assms(4) k(2) have "k\G" using vimage_iff + moreover from ff k(2) have "k\G" using vimage_iff unfolding Pi_def by blast ultimately have f: "f`(h) = F`\f`(g),F`\f`(k),GroupInv(H,F)`(f`(g))\\" using assms(1-4) Ggr gG group0.group_op_closed group0.inverse_in_group image_inv homomor_eq by simp - from assms(1,4) Ggr \g\G\ k have "h\G" using group0.group_op_closed + from assms(1) ff Ggr \g\G\ k have "h\G" using group0.group_op_closed group0.inverse_in_group func1_1_L15 by simp - from assms(4,5) k(2) \g\G\ have "f`(k)\K" "f`(g)\H" and + from assms(4) ff k(2) \g\G\ have "f`(k)\K" "f`(g)\H" and "F`\F`\f`(g),f`(k)\,GroupInv(H,F)`(f`(g))\ \ K" using func1_1_L15 apply_type unfolding IsAnormalSubgroup_def by auto @@ -403,7 +420,7 @@ proof - "f`(h) = F`\F`\f`(g),f`(k)\,GroupInv(H,F)`(f`(g))\" using group0.group_oper_assoc group0.inverse_in_group by auto ultimately have "f`(h) \ K" by simp - with assms(4) \h\G\ have "h \ f-``(K)" using func1_1_L15 by simp + with ff \h\G\ have "h \ f-``(K)" using func1_1_L15 by simp } hence "{P`\g,P`\h,GroupInv(G,P)`(g)\\. h\f-``(K)} \ f-``(K)" by blast } hence "\g\G. {P`\g, P`\h, GroupInv(G, P)`(g)\\. h\f-``(K)} \ f-``(K)" @@ -414,7 +431,7 @@ qed text\The kernel of an homomorphism is a normal subgroup.\ corollary kernel_normal_sub: - assumes "IsAgroup(G,P)" "IsAgroup(H,F)" "Homomor(f,G,P,H,F)" "f:G\H" + assumes "IsAgroup(G,P)" "IsAgroup(H,F)" "Homomor(f,G,P,H,F)" shows "IsAnormalSubgroup(G,P,f-``{TheNeutralElement(H,F)})" using assms preimage_normal_subgroup group0.trivial_normal_subgroup unfolding group0_def by auto @@ -465,14 +482,14 @@ qed text\The image of a group under a homomorphism is a subgroup of the target group.\ corollary image_group: - assumes "IsAgroup(G,P)" "IsAgroup(H,F)" "Homomor(f,G,P,H,F)" "f:G\H" + assumes "IsAgroup(G,P)" "IsAgroup(H,F)" "Homomor(f,G,P,H,F)" shows "IsAsubgroup(f``(G),F)" proof - from assms(1) have "restrict(P,G\G) = P" using group0.group_oper_fun restrict_domain unfolding group0_def by blast - with assms show ?thesis using image_subgroup unfolding IsAsubgroup_def - by simp + with assms show ?thesis using image_subgroup + unfolding Homomor_def IsAsubgroup_def by simp qed text\Now we are able to prove the first isomorphism theorem. This theorem states @@ -480,16 +497,18 @@ text\Now we are able to prove the first isomorphism theorem. This theorem and a subgroup of $H$.\ theorem isomorphism_first_theorem: - assumes "IsAgroup(G,P)" "IsAgroup(H,F)" "Homomor(f,G,P,H,F)" "f:G\H" + assumes "IsAgroup(G,P)" "IsAgroup(H,F)" "Homomor(f,G,P,H,F)" defines "r \ QuotientGroupRel(G,P,f-``{TheNeutralElement(H,F)})" and "\

\ QuotientGroupOp(G,P,f-``{TheNeutralElement(H,F)})" shows "\\. Homomor(\,G//r,\

,f``(G),restrict(F,(f``(G))\(f``(G)))) \ \\bij(G//r,f``(G))" proof- let ?\ = "{\r``{g},f`(g)\. g\G}" + from assms(3) have ff: "f:G\H" + unfolding Homomor_def by simp from assms(1-5) have "equiv(G,r)" using group0.Group_ZF_2_4_L3 kernel_normal_sub unfolding group0_def IsAnormalSubgroup_def by simp - from assms(4,5) have "?\ \ Pow((G//r)\f``G)" + from assms(4) ff have "?\ \ Pow((G//r)\f``(G))" unfolding quotient_def using func_imagedef by auto moreover have "(G//r) \ domain(?\)" unfolding domain_def quotient_def by auto moreover @@ -497,16 +516,16 @@ proof- then obtain g\<^sub>y g\<^sub>r where "\x, y\=\r``{g\<^sub>y},f`(g\<^sub>y)\" "\x, t\=\r``{g\<^sub>r},f`(g\<^sub>r)\" and "g\<^sub>r\G" "g\<^sub>y\G" by auto hence B: "r``{g\<^sub>y}=r``{g\<^sub>r}" "y=f`(g\<^sub>y)" "t=f`(g\<^sub>r)" by auto - from assms(4) \g\<^sub>y\G\ \g\<^sub>r\G\ B(2,3) have "y\H" "t\H" + from ff \g\<^sub>y\G\ \g\<^sub>r\G\ B(2,3) have "y\H" "t\H" using apply_type by simp_all with \equiv(G,r)\ \g\<^sub>r\G\ \r``{g\<^sub>y}=r``{g\<^sub>r}\ have "\g\<^sub>y,g\<^sub>r\\r" using same_image_equiv by simp - with assms(4,5) have + with assms(4) ff have "f`(P`\g\<^sub>y,GroupInv(G,P)`(g\<^sub>r)\) = TheNeutralElement(H,F)" unfolding QuotientGroupRel_def using func1_1_L15 by simp with assms(1-4) B(2,3) \g\<^sub>y\G\ \g\<^sub>r\G\ \y\H\ \t\H\ have "y=t" - using image_inv Homomor_def group0.inverse_in_group group0.group0_2_L11A - unfolding group0_def by auto + using image_inv group0.inverse_in_group group0.group0_2_L11A + unfolding group0_def Homomor_def IsMorphism_def by auto } hence "\x y. \x,y\ \ ?\ \ (\z. \x,z\\?\ \ y=z)" by auto ultimately have ff_fun: "?\:G//r\f``(G)" unfolding Pi_def function_def by auto @@ -520,19 +539,20 @@ proof- by simp from \g\<^sub>1\G\ \g\<^sub>2\G\ a have "\a\<^sub>1,f`(g\<^sub>1)\ \ ?\" and "\a\<^sub>2,f`(g\<^sub>2)\ \ ?\" by auto with assms(1,2,3) ff_fun \g\<^sub>1\G\ \g\<^sub>2\G\ eq have "F`\?\`(a\<^sub>1),?\`(a\<^sub>2)\ = ?\`(\

`\a\<^sub>1,a\<^sub>2\)" - using apply_equality Homomor_def by simp + using apply_equality unfolding Homomor_def IsMorphism_def by simp moreover from AS ff_fun have "?\`(a\<^sub>1) \ f``(G)" "?\`(a\<^sub>2) \ f``(G)" using apply_type by auto ultimately have "restrict(F,f``(G)\f``(G))`\?\`(a\<^sub>1),?\`(a\<^sub>2)\ = ?\`(\

`\a\<^sub>1,a\<^sub>2\)" by simp - } hence r: "\a\<^sub>1\G//r. \a\<^sub>2\G//r. restrict(F,f``G\f``G)`\?\`a\<^sub>1,?\`a\<^sub>2\ = ?\`(\

`\a\<^sub>1,a\<^sub>2\)" + } hence + r: "\a\<^sub>1\G//r. \a\<^sub>2\G//r. restrict(F,f``(G)\f``(G))`\?\`(a\<^sub>1),?\`(a\<^sub>2)\ = ?\`(\

`\a\<^sub>1,a\<^sub>2\)" by simp - moreover from assms have G: "IsAgroup(G//r,\

)" - using Group_ZF_2_4_T1 kernel_normal_sub by simp - moreover from assms(1-4) have H: "IsAgroup(f``(G), restrict(F,f``(G)\f``(G)))" - using image_group unfolding IsAsubgroup_def by simp - ultimately have HOM: "Homomor(?\,G//r,\

,f``(G),restrict(F,(f``(G))\(f``(G))))" - using Homomor_def by simp + with ff_fun have HOM: "Homomor(?\,G//r,\

,f``(G),restrict(F,(f``(G))\(f``(G))))" + unfolding Homomor_def IsMorphism_def by simp + from assms have G: "IsAgroup(G//r,\

)" and + H: "IsAgroup(f``(G), restrict(F,f``(G)\f``(G)))" + using Group_ZF_2_4_T1 kernel_normal_sub image_group + unfolding IsAsubgroup_def by simp_all { fix b\<^sub>1 b\<^sub>2 assume AS: "?\`(b\<^sub>1) = ?\`(b\<^sub>2)" "b\<^sub>1\G//r" "b\<^sub>2\G//r" from G AS(3) have invb2: "GroupInv(G//r,\

)`(b\<^sub>2)\G//r" using group0.inverse_in_group unfolding group0_def by simp @@ -551,16 +571,18 @@ proof- EE: "F`\?\`(b\<^sub>1),?\`(GroupInv(G//r,\

)`(b\<^sub>2))\= restrict(F,f``(G)\f``(G))`\?\`(b\<^sub>1),?\`(GroupInv(G//r,\

)`(b\<^sub>2))\" by auto - from assms(4) have "f``(G) \ H" using func1_1_L6(2) by simp + from ff have "f``(G) \ H" using func1_1_L6(2) by simp with fff have "?\`(b\<^sub>1)\H" "?\`(b\<^sub>2)\H" by auto with assms(1-4) G H HOM ff_fun AS(1,3) fff(2) EE have - "TheNeutralElement(H,F) = restrict(F,f``(G)\f``(G))`\?\`(b\<^sub>1),?\`(GroupInv(G//r,\

)`(b\<^sub>2))\" + "TheNeutralElement(H,F) = + restrict(F,f``(G)\f``(G))`\?\`(b\<^sub>1),?\`(GroupInv(G//r,\

)`(b\<^sub>2))\" using group0.group0_2_L6(1) restrict image_inv group0.group0_3_T1 image_group unfolding group0_def by simp also from G H HOM AS(2,3) E have "\ = f`(g)" - using Homomor_def group0.inverse_in_group unfolding group0_def by simp + using group0.inverse_in_group unfolding group0_def IsMorphism_def Homomor_def + by simp finally have "TheNeutralElement(H,F) = f`(g)" by simp - with assms(4) \g\G\ have "g\f-``{TheNeutralElement(H,F)}" using func1_1_L15 + with ff \g\G\ have "g\f-``{TheNeutralElement(H,F)}" using func1_1_L15 by simp with assms \g\G\ gg have "\

`\b\<^sub>1,GroupInv(G//r,\

)`(b\<^sub>2)\ = TheNeutralElement(G//r,\

)" @@ -571,13 +593,13 @@ proof- } with ff_fun have "?\ \ inj(G//r,f``(G))" unfolding inj_def by blast moreover { fix m assume "m \ f``(G)" - with assms(4) obtain g where "g\G" "m=f`(g)" using func_imagedef by auto + with ff obtain g where "g\G" "m=f`(g)" using func_imagedef by auto hence "\r``{g},m\ \ ?\" by blast with ff_fun have "?\`(r``{g})=m" using apply_equality by auto with \g\G\ have "\A\G//r. ?\`(A) = m" unfolding quotient_def by auto } - ultimately have "?\ \ bij(G//r,f``G)" unfolding bij_def surj_def using ff_fun - by blast + ultimately have "?\ \ bij(G//r,f``G)" unfolding bij_def surj_def + using ff_fun by blast with HOM show ?thesis by blast qed @@ -585,21 +607,22 @@ text\The inverse of a bijective homomorphism is an homomorphism. Meaning that in the previous result, the homomorphism we found is an isomorphism.\ theorem bij_homomor: - assumes "f\bij(G,H)" "IsAgroup(G,P)" "IsAgroup(H,F)" "Homomor(f,G,P,H,F)" + assumes "f\bij(G,H)" "IsAgroup(G,P)" "Homomor(f,G,P,H,F)" shows "Homomor(converse(f),H,F,G,P)" -proof- +proof - { fix h\<^sub>1 h\<^sub>2 assume "h\<^sub>1\H" "h\<^sub>2\H" with assms(1) obtain g\<^sub>1 g\<^sub>2 where g1: "g\<^sub>1\G" "f`(g\<^sub>1)=h\<^sub>1" and g2: "g\<^sub>2\G" "f`(g\<^sub>2)=h\<^sub>2" unfolding bij_def surj_def by blast - with assms(2,3,4) have + with assms(2,3) have "converse(f)`(f`(P`\g\<^sub>1,g\<^sub>2\)) = converse(f)`(F`\h\<^sub>1,h\<^sub>2\)" using homomor_eq by simp with assms(1,2) g1 g2 have "P`\converse(f)`(h\<^sub>1),converse(f)`(h\<^sub>2)\ = converse(f)`(F`\h\<^sub>1,h\<^sub>2\)" using left_inverse group0.group_op_closed unfolding group0_def bij_def by auto - } with assms(2,3) show ?thesis using Homomor_def by simp + } with assms(1) show ?thesis using bij_converse_bij bij_is_fun + unfolding Homomor_def IsMorphism_def by simp qed text\A very important homomorphism is given by taking every element @@ -612,8 +635,8 @@ lemma (in group0) quotient_map: defines "r \ QuotientGroupRel(G,P,H)" and "q \ \x\G. QuotientGroupRel(G,P,H)``{x}" shows "Homomor(q,G,P,G//r,QuotientGroupOp(G,P,H))" using groupAssum assms group_op_closed lam_funtype lamE EquivClass_1_L10 - Group_ZF_2_4_L3 Group_ZF_2_4_L5A Homomor_def Group_ZF_2_4_T1 - unfolding IsAnormalSubgroup_def QuotientGroupOp_def + Group_ZF_2_4_L3 Group_ZF_2_4_L5A Group_ZF_2_4_T1 + unfolding IsAnormalSubgroup_def QuotientGroupOp_def Homomor_def IsMorphism_def by simp text\In the context of \group0\, we may use all results of \semigr0\.\ diff --git a/IsarMathLib/Ring_ZF_2.thy b/IsarMathLib/Ring_ZF_2.thy index 56e664f..b5f1308 100644 --- a/IsarMathLib/Ring_ZF_2.thy +++ b/IsarMathLib/Ring_ZF_2.thy @@ -41,8 +41,9 @@ is actually a full ring.\ text\An ideal is a subgroup of the additive group of the ring, which is closed by left and right multiplication by any ring element.\ + definition (in ring0) Ideal ("_\R") where -"I \R \ (\x\I. \y\R. y\x\I \ x\y\I) \ IsAsubgroup(I,A)" + "I \R \ (\x\I. \y\R. y\x\I \ x\y\I) \ IsAsubgroup(I,A)" text\To write less during proofs, we add this small definition\ abbreviation (in ring0) ideals ("\") where @@ -266,6 +267,18 @@ text\Some times, we may need to sum an arbitrary number definition(in ring0) sumArbitraryIdeals ("\\<^sub>I_" 90) where "\ \ \ \ \\<^sub>I\ \ \\\\\<^sub>I" +text\Each component of the sum of ideals is contained in the sum.\ + +lemma (in ring0) comp_in_sum_ideals: + assumes "I\R" and "J\R" + shows "I \ I+\<^sub>IJ" and "J \ I+\<^sub>IJ" and "I\J \ I+\<^sub>IJ" +proof - + from assms have "I\J \ R" using ideal_dest_subset + by auto + with assms show "I \ I+\<^sub>IJ" "J \ I+\<^sub>IJ" "I\J \ I+\<^sub>IJ" + using generated_ideal_contains_set sumIdeal_def by auto +qed + text\Every element in the arbitrary sum of ideals is generated by only a finite subset of those ideals\ diff --git a/IsarMathLib/Ring_ZF_3.thy b/IsarMathLib/Ring_ZF_3.thy index 2808b90..82d13a4 100644 --- a/IsarMathLib/Ring_ZF_3.thy +++ b/IsarMathLib/Ring_ZF_3.thy @@ -35,21 +35,28 @@ theory Ring_ZF_3 imports Ring_ZF_2 Group_ZF_5 begin text \This section studies the ideals of quotient rings, -and defines ring homomorphisms.\ + and defines ring homomorphisms.\ + +text\A ring homomorphism is a function between rings that which has the + morphism property with respect to both addition and multiplication operation, + and maps one (the neutral element of multiplication) in the first ring to one + in the second ring. \ definition - ringHomomor ("_{is a ring homomorphism}{_,_,_}\{_,_,_}" 85) - where "IsAring(R,A,M) \ IsAring(S,U,V) \ ringHomomor(f,R,A,M,S,U,V) \ - Homomor(f,R,A,S,U) - \ (\x\R. \y\R. f`(M`\x,y\) = V`\f`x,f`y\) - \ f`(TheNeutralElement(R,M)) = TheNeutralElement(S,V)" + "ringHomomor(f,R,A,M,S,U,V) \ f:R\S \ IsMorphism(R,A,U,f) \ IsMorphism(R,M,V,f) + \ f`(TheNeutralElement(R,M)) = TheNeutralElement(S,V)" + +text\The next locale defines notation which we will use in this theory. + We assume that we have two rings, one (which we will call the origin ring) + defined by the triple $(R,A,M)$ + and the second one (which we will call the target ring) by the triple $(S,U,V)$, + and a homomorphism $f:R\rightarrow S$. \ locale ring_homo = fixes R A M S U V f - assumes origin:"IsAring(R,A,M)" - and target:"IsAring(S,U,V)" - and fun:"f:R\S" - and homomorphism:"f{is a ring homomorphism}{R,A,M}\{S,U,V}" + assumes origin: "IsAring(R,A,M)" + and target: "IsAring(S,U,V)" + and homomorphism: "ringHomomor(f,R,A,M,S,U,V)" fixes ringa (infixl "\\<^sub>R" 90) defines ringa_def [simp]: "x\\<^sub>Rb \ A`\x,b\" @@ -99,209 +106,300 @@ locale ring_homo = fixes ringsqs ("_\<^sup>2\<^sup>S" [96] 97) defines ringsqs_def [simp]: "x\<^sup>2\<^sup>S \ x\\<^sub>Sx" +text\We will write \I\R\<^sub>o\ to denote that $I$ is an ideal + of the ring $R$. Note that in this notation the \R\<^sub>o\ part by itself has no meaning, + only the whole \\R\<^sub>o\ serves as postfix operator. \ + abbreviation (in ring_homo) ideal_origin ("_\R\<^sub>o") where "I\R\<^sub>o \ ring0.Ideal(R,A,M,I)" -abbreviation (in ring_homo) prime_ideal_target ("_\\<^sub>pR\<^sub>t") - where "I\\<^sub>pR\<^sub>t \ ring0.primeIdeal(S,U,V,I)" +text\\I\R\<^sub>t\ means that $I$ is an ideal of $S$.\ + +abbreviation (in ring_homo) ideal_target ("_\R\<^sub>t") + where "I\R\<^sub>t \ ring0.Ideal(S,U,V,I)" + +text\ \I\\<^sub>pR\<^sub>o\ means that $I$ is a prime ideal of $R$.\ abbreviation (in ring_homo) prime_ideal_origin ("_\\<^sub>pR\<^sub>o") where "I\\<^sub>pR\<^sub>o \ ring0.primeIdeal(R,A,M,I)" -abbreviation (in ring_homo) ideal_target ("_\R\<^sub>t") - where "I\R\<^sub>t \ ring0.Ideal(S,U,V,I)" +text\We will write \I\\<^sub>pR\<^sub>t\ to denote that $I$ is a prime ideal of the ring $S$. \ + +abbreviation (in ring_homo) prime_ideal_target ("_\\<^sub>pR\<^sub>t") + where "I\\<^sub>pR\<^sub>t \ ring0.primeIdeal(S,U,V,I)" + +text\ \ker\ denotes the kernel of $f$ (which is assumed to be a homomorphism + between $R$ and $S$.\ abbreviation (in ring_homo) kernel ("ker" 90) where "ker \ f-``{\\<^sub>S}" +text\The theorems proven in the \ring0\ context are valid in the \ring_homo\ + context when applied to the ring $R$.\ + sublocale ring_homo < origin_ring:ring0 using origin unfolding ring0_def by auto -sublocale ring_homo < target_ring:ring0 S U V ringas - ringminuss ringsubs ringms ringzeros ringones ringtwos - ringsqs +text\The theorems proven in the \ring0\ context are valid in the \ring_homo\ + context when applied to the ring $S$.\ + +sublocale ring_homo < target_ring:ring0 S U V ringas ringminuss + ringsubs ringms ringzeros ringones ringtwos ringsqs using target unfolding ring0_def by auto +text\A ring homomorphism is a homomorphism both with respect to + addition and multiplication.\ + +lemma ringHomHom: assumes "ringHomomor(f,R,A,M,S,U,V)" + shows "Homomor(f,R,A,S,U)" and "Homomor(f,R,M,S,V)" + using assms unfolding ringHomomor_def Homomor_def + by simp_all + +text\Since in the \ring_homo\ locale $f$ is a ring homomorphism it implies + that $f$ is a function from $R$ to $S$. \ + +lemma (in ring_homo) f_is_fun: shows "f:R\S" + using homomorphism unfolding ringHomomor_def by simp + +text\In the \ring_homo\ context $A$ is the addition in the first (source) ring + $M$ is the multiplication there and $U,V$ are the addition and multiplication resp. + in the second (target) ring. The next lemma states the all these are binary + operations, a trivial, but frequently used fact.\ + +lemma (in ring_homo) AMUV_are_ops: + shows "A:R\R\R" "M:R\R\R" "U:S\S\S" "V:S\S\S" + using origin target + unfolding IsAring_def IsAgroup_def IsAmonoid_def IsAssociative_def + by auto + +text\The kernel is a subset of $R$ on which the value of $f$ is zero + (of the target ring)\ + +lemma (in ring_homo) kernel_def_alt: shows "ker = {r\R. f`(r) = \\<^sub>S}" + using f_is_fun func1_1_L14 by simp + +text\ the homomorphism $f$ maps each element of the kernel + to zero of the target ring. \ + +lemma (in ring_homo) image_kernel: + assumes "x\ker" + shows "f`(x) = \\<^sub>S" + using assms func1_1_L15 f_is_fun by simp + +text\ As a ring homomorphism $f$ preserves multiplication.\ + lemma (in ring_homo) homomor_dest_mult: assumes "x\R" "y\R" - shows "f`(x\\<^sub>Ry) = (f`x)\\<^sub>S(f`y)" - using assms origin target homomorphism ringHomomor_def by auto + shows "f`(x\\<^sub>Ry) = (f`(x))\\<^sub>S(f`(y))" + using assms origin target homomorphism + unfolding ringHomomor_def IsMorphism_def by simp + +text\ As a ring homomorphism $f$ preserves addition. \ lemma (in ring_homo) homomor_dest_add: assumes "x\R" "y\R" - shows "f`(x\\<^sub>Ry) = (f`x)\\<^sub>S(f`y)" - using homomor_eq[of R A S U f x y] - origin target homomorphism assms - unfolding IsAring_def ringHomomor_def[OF origin target] - by auto + shows "f`(x\\<^sub>Ry) = (f`(x))\\<^sub>S(f`(y))" + using homomor_eq origin target homomorphism assms + unfolding IsAring_def ringHomomor_def IsMorphism_def + by simp + +text\For $x\in R$ the value of $f$ is in $S$.\ + +lemma (in ring_homo) homomor_val: assumes "x\R" + shows "f`(x) \ S" + using homomorphism assms apply_funtype unfolding ringHomomor_def + by blast + +text\A ring homomorphism preserves taking negative of an element.\ lemma (in ring_homo) homomor_dest_minus: assumes "x\R" - shows "f`(\\<^sub>Rx) = \\<^sub>S(f`x)" - using image_inv[of R A S U f x] - origin target homomorphism assms fun - unfolding IsAring_def ringHomomor_def[OF origin target] - by auto + shows "f`(\\<^sub>Rx) = \\<^sub>S(f`(x))" + using origin target homomorphism assms ringHomHom image_inv + unfolding IsAring_def by auto + +text\A ring homomorphism preserves substraction.\ lemma (in ring_homo) homomor_dest_subs: assumes "x\R" "y\R" - shows "f`(x\\<^sub>Ry) = (f`x)\\<^sub>S(f`y)" - using assms homomor_dest_add[of x "\\<^sub>Ry"] - homomor_dest_minus[of y] + shows "f`(x\\<^sub>Ry) = (f`(x))\\<^sub>S(f`(y))" + using assms homomor_dest_add homomor_dest_minus using origin_ring.Ring_ZF_1_L3(1) by auto +text\A ring homomorphism maps zero to zero.\ lemma (in ring_homo) homomor_dest_zero: shows "f`(\\<^sub>R) = \\<^sub>S" -proof- - have "f`(\\<^sub>R) = f`(\\<^sub>R\\<^sub>R\\<^sub>R)" - using origin_ring.Ring_ZF_1_L3(7) origin_ring.Ring_ZF_1_L2(1) - by auto - then have "f`(\\<^sub>R) = f`(\\<^sub>R)\\<^sub>S(f`\\<^sub>R)" - using homomor_dest_subs origin_ring.Ring_ZF_1_L2(1) - by auto - then show ?thesis using target_ring.Ring_ZF_1_L3(7) - origin_ring.Ring_ZF_1_L2(1) apply_type[OF fun] by auto + using origin target homomorphism ringHomHom(1) image_neutral + unfolding IsAring_def by auto + +text\The kernel of a homomorphism is never empty.\ + +lemma (in ring_homo) kernel_non_empty: + shows "\\<^sub>R \ker" and "ker\0" + using homomor_dest_zero origin_ring.Ring_ZF_1_L2(1) + func1_1_L15 f_is_fun by auto + +text\The image of the kernel by $f$ is the singleton $\{ 0_R\}$.\ + +corollary (in ring_homo) image_kernel_2: shows "f``(ker) = {\\<^sub>S}" +proof - + have "f:R\S" "ker\R" "ker\0" "\x\ker. f`(x) = \\<^sub>S" + using f_is_fun kernel_def_alt kernel_non_empty by auto + then show "f``(ker) = {\\<^sub>S}" using image_constant_singleton + by simp qed - + +text\The inverse image of an ideal (in the target ring) is + a normal subgroup of the addition group and an ideal in the origin ring. + The kernel of the homomorphism + is a subset of the inverse of image of every ideal. \ lemma (in ring_homo) preimage_ideal: assumes "J\R\<^sub>t" - shows "(f-``J)\R\<^sub>o" "ker \ f-``J" -proof- - have "IsAnormalSubgroup(R,A,f-``J)" - using preimage_normal_subgroup[OF _ _ _ fun] - target_ring.ideal_normal_add_subgroup origin assms - target homomorphism - unfolding IsAring_def ring0_def - ringHomomor_def[OF origin target] by auto - then have "IsAsubgroup(f-``J,A)" unfolding IsAnormalSubgroup_def - by auto moreover - { - fix x y assume xy:"x\f-``J" "y\R" - from xy(1) have "f`x \ J" "x\R" using func1_1_L15 fun - by auto - moreover have "f`y\S" using xy(2) apply_type fun - by auto - ultimately have "V`\f`x,f`y\\J" "V`\f`y,f`x\\J" - using target_ring.ideal_dest_mult assms - by auto - then have "f`(M`\x,y\)\J" "f`(M`\y,x\)\J" - using homomor_dest_mult xy(2) \x\R\ - by auto - moreover have "M`\x,y\\R" "M`\y,x\\R" using xy(2) \x\R\ - origin_ring.Ring_ZF_1_L4(3) by auto - ultimately have "M`\x,y\\f-``J" "M`\y,x\\f-``J" - using func1_1_L15 fun by auto + shows + "IsAnormalSubgroup(R,A,f-``(J))" + "(f-``(J))\R\<^sub>o" "ker \ f-``(J)" +proof - + from origin target homomorphism assms + show "IsAnormalSubgroup(R,A,f-``(J))" + using ringHomHom(1) preimage_normal_subgroup + target_ring.ideal_normal_add_subgroup + unfolding IsAring_def by blast + then have "IsAsubgroup(f-``(J),A)" unfolding IsAnormalSubgroup_def + by auto + moreover + { fix x y assume "x \ f-``(J)" "y\R" + from homomorphism have "f:R\S" + unfolding ringHomomor_def by simp + with \x \ f-``(J)\ have "x\R" and "f`(x) \ J" + using func1_1_L15 unfolding ringHomomor_def + by simp_all + with assms \y\R\ \f:R\S\ have + "V`\f`(x),f`(y)\ \ J" and "V`\f`(y),f`(x)\\J" + using apply_funtype target_ring.ideal_dest_mult by simp_all + with \x\R\ \y\R\ have "f`(M`\x,y\) \ J" and "f`(M`\y,x\) \ J" + using homomor_dest_mult by auto + with \x\R\ \y\R\ \f:R\S\ have + "M`\x,y\ \ f-``(J)" and "M`\y,x\ \ f-``(J)" + using origin_ring.Ring_ZF_1_L4(3) func1_1_L15 by auto } - ultimately show "(f-``J)\R\<^sub>o" using origin_ring.Ideal_def by auto - have "\\<^sub>S\J" using assms target_ring.ideal_dest_zero by auto - then show "ker \ f-``J" by auto + ultimately show "(f-``(J))\R\<^sub>o" using origin_ring.Ideal_def + by auto + from assms show "ker \ f-``(J)" using target_ring.ideal_dest_zero + by auto +qed + +text\Kernel of the homomorphism in an ideal.\ + +lemma (in ring_homo) kernel_ideal: shows "ker \R\<^sub>o" + using target_ring.zero_ideal preimage_ideal(2) by simp + +text\The inverse image of a prime ideal by a homomorphism is not the whole ring. + Proof by contradiction.\ + +lemma (in ring_homo) vimage_prime_ideal_not_all: + assumes "J\\<^sub>pR\<^sub>t" shows "f-``(J) \ R" +proof - + { assume "R = f-``(J)" + then have "R = {x\R. f`(x)\J}" using f_is_fun func1_1_L15 + by simp + then have "\\<^sub>R \ {x\R. f`(x)\J}" using origin_ring.Ring_ZF_1_L2(2) + by simp + with origin_ring.ringAssum target_ring.ringAssum homomorphism assms + have False using target_ring.ideal_with_one + unfolding target_ring.primeIdeal_def ringHomomor_def by auto + } thus "f-``(J) \ R" by blast qed text\Even more, if the target ring of the homomorphism is commutative -or the homomorphism is surjective; we show that if the ideal es prime, -then its preimage is also. Note that this is not true in general.\ + and the ideal is prime then its preimage is also. Note that this is + not true in general.\ lemma (in ring_homo) preimage_prime_ideal_comm: - assumes "J\\<^sub>pR\<^sub>t" "V{is commutative on}S" - shows "(f-``J)\\<^sub>pR\<^sub>o" -proof(rule origin_ring.equivalent_prime_ideal_2) - show "(f-``J)\R\<^sub>o" using preimage_ideal assms unfolding target_ring.primeIdeal_def by auto - { - assume "R = f-`` J" - then have "R = {x\R. f`x \J}" - using fun func1_1_L15 by auto - moreover have "\\<^sub>R\R" using origin_ring.Ring_ZF_1_L2(2). - ultimately have "\\<^sub>R\{x\R. f`x \J}" by auto - then have "f`(\\<^sub>R) \J" by auto - moreover have "f`\\<^sub>R = \\<^sub>S" using homomorphism - unfolding ringHomomor_def[OF origin_ring.ringAssum - target_ring.ringAssum] by auto - ultimately have "\\<^sub>S \ J" by auto - then have False using target_ring.ideal_with_one - assms unfolding target_ring.primeIdeal_def by auto - } - then show "f -`` J \ R" by auto - show "\x\R. \y\R. (\z\R. x \\<^sub>R z \\<^sub>R y \ f -`` J) \ - x \ f -`` J \ y \ f -`` J" - proof(safe) - fix x y assume as:"x\R" "y\R" "\z\R. x \\<^sub>R z \\<^sub>R y \ f -`` J" "y \ f -`` J" - { - fix s assume s:"s\S" - then have "(f`x)\\<^sub>Ss\\<^sub>S(f`y) = s\\<^sub>S((f`x)\\<^sub>S(f`y))" - using assms(2) unfolding IsCommutative_def - using apply_type[OF fun as(1)] - target_ring.Ring_ZF_1_L11(2) apply_type[OF fun as(2)] - by auto - then have "(f`x)\\<^sub>Ss\\<^sub>S(f`y) = s\\<^sub>S(f`(x\\<^sub>Ry))" - using homomor_dest_mult[OF as(1,2)] - by auto moreover - from as(3) have "x\\<^sub>Ry : f-``J" using origin_ring.Ring_ZF_1_L2(2) - origin_ring.Ring_ZF_1_L3(5)[OF as(1)] by force - then have "f`(x\\<^sub>Ry) : J" using func1_1_L15 fun by auto - with s have "s\\<^sub>S(f`(x\\<^sub>Ry)) :J" using assms(1) - unfolding target_ring.primeIdeal_def using target_ring.ideal_dest_mult(2) - by auto - ultimately have "(f`x)\\<^sub>Ss\\<^sub>S(f`y):J" by auto - } - then have "\z\S. (f`x) \\<^sub>S z \\<^sub>S (f`y) \ J" by auto - with target_ring.equivalent_prime_ideal[OF assms(1)] - apply_type[OF fun] as(1,2) have "f`x:J\f`y:J" by auto - with as(4,2) have "f`x:J" using func1_1_L15 fun by auto - then show "x:f-``J" using as(1) func1_1_L15 fun by auto + assumes "J\\<^sub>pR\<^sub>t" "V {is commutative on} S" + shows "(f-``(J))\\<^sub>pR\<^sub>o" +proof - + have "\x\R. \y\R. (\z\R. x\\<^sub>Rz\\<^sub>Ry \ f-``(J)) \ x\f-``(J) \ y\f-``( J)" + proof - + { fix x y assume "x\R" "y\R" and as: "\z\R. x\\<^sub>Rz\\<^sub>Ry \ f-``(J)" + and "y \ f-``(J)" + { fix s assume "s\S" + with assms(2) \x\R\ \y\R\ have + "(f`(x))\\<^sub>Ss\\<^sub>S(f`(y)) = s\\<^sub>S((f`(x))\\<^sub>S(f`(y)))" + using f_is_fun apply_funtype target_ring.Ring_ZF_1_L11(2) + unfolding IsCommutative_def by auto + with \x\R\ \y\R\ have "(f`x)\\<^sub>Ss\\<^sub>S(f`y) = s\\<^sub>S(f`(x\\<^sub>Ry))" + using homomor_dest_mult by simp + with assms(1) \s\S\ \x\R\ as have "(f`(x))\\<^sub>Ss\\<^sub>S(f`(y)) \ J" + using origin_ring.Ring_ZF_1_L2(2) origin_ring.Ring_ZF_1_L3(5) + func1_1_L15 f_is_fun target_ring.ideal_dest_mult(2) + unfolding target_ring.primeIdeal_def by auto + } hence "\z\S. (f`x) \\<^sub>S z \\<^sub>S (f`y) \ J" by simp + with assms(1) \x\R\ \y\R\ have "f`(x)\ J \ f`(y)\J" + using target_ring.equivalent_prime_ideal f_is_fun apply_funtype + by simp + with \x\R\ \y\R\ \y \ f-``(J)\ have "x\f-``(J)" + using func1_1_L15 f_is_fun by simp + } thus ?thesis by blast qed + moreover from assms have "(f-``J)\R\<^sub>o" using preimage_ideal + unfolding target_ring.primeIdeal_def by auto + moreover from assms(1) have "f-``(J) \ R" using vimage_prime_ideal_not_all + by simp + ultimately show "(f-``(J))\\<^sub>pR\<^sub>o" + by (rule origin_ring.equivalent_prime_ideal_2) qed +text\We can replace the assumption that the target ring of the homomorphism is commutative + with the assumption that homomorphism is surjective in \preimage_prime_ideal_comm\ + above and we can show the same assertion that the preimage of a prime ideal prime. \ + lemma (in ring_homo) preimage_prime_ideal_surj: - assumes "J\\<^sub>pR\<^sub>t" "f:surj(R,S)" - shows "(f-``J)\\<^sub>pR\<^sub>o" -proof(rule origin_ring.equivalent_prime_ideal_2) - show "(f-``J)\R\<^sub>o" using preimage_ideal assms unfolding target_ring.primeIdeal_def by auto - { - assume "R = f-`` J" - then have "R = {x\R. f`x \J}" - using fun func1_1_L15 by auto - moreover have "\\<^sub>R\R" using origin_ring.Ring_ZF_1_L2(2). - ultimately have "\\<^sub>R\{x\R. f`x \J}" by auto - then have "f`(\\<^sub>R) \J" by auto - moreover have "f`\\<^sub>R = \\<^sub>S" using homomorphism - unfolding ringHomomor_def[OF origin_ring.ringAssum - target_ring.ringAssum] by auto - ultimately have "\\<^sub>S \ J" by auto - then have False using target_ring.ideal_with_one - assms unfolding target_ring.primeIdeal_def by auto - } - then show "f -`` J \ R" by auto - show "\x\R. \y\R. (\z\R. x \\<^sub>R z \\<^sub>R y \ f -`` J) \ - x \ f -`` J \ y \ f -`` J" - proof(safe) - fix x y assume as:"x\R" "y\R" "\z\R. x \\<^sub>R z \\<^sub>R y \ f -`` J" "y \ f -`` J" - { - fix s assume s:"s\S" - with assms(2) obtain t where t:"s=f`t" "t:R" - unfolding surj_def by auto - then have "(f`x)\\<^sub>S(f`t)\\<^sub>S(f`y) = f`(x\\<^sub>Rt\\<^sub>Ry)" - using homomor_dest_mult as(1,2) t(2) - origin_ring.Ring_ZF_1_L4(3) by auto - moreover have "(x\\<^sub>Rt\\<^sub>Ry)\f-``J" using as(3) t(2) by auto - ultimately have "(f`x)\\<^sub>S(f`t)\\<^sub>S(f`y)\J" - using func1_1_L15 fun by auto - with t(1) have "(f`x)\\<^sub>Ss\\<^sub>S(f`y)\J" by auto - } - then have "\z\S. (f`x) \\<^sub>S z \\<^sub>S (f`y) \ J" by auto - with target_ring.equivalent_prime_ideal[OF assms(1)] - apply_type[OF fun] as(1,2) have "f`x:J\f`y:J" by auto - with as(4,2) have "f`x:J" using func1_1_L15 fun by auto - then show "x:f-``J" using as(1) func1_1_L15 fun by auto + assumes "J\\<^sub>pR\<^sub>t" "f \ surj(R,S)" + shows "(f-``(J))\\<^sub>pR\<^sub>o" +proof - + have "\x\R. \y\R. (\z\R. x\\<^sub>Rz\\<^sub>Ry \ f-``(J)) \ x\f-``(J) \ y\f-``(J)" + proof - + { fix x y assume "x\R" "y\R" and as: "\z\R. x\\<^sub>Rz\\<^sub>Ry \ f-``(J)" + and "y \ f-``(J)" + { fix s assume s: "s\S" + with assms(2) obtain t where "s=f`(t)" "t\R" + unfolding surj_def by auto + with \x\R\ \y\R\ as have "(f`x)\\<^sub>Ss\\<^sub>S(f`y)\J" + using homomor_dest_mult origin_ring.Ring_ZF_1_L4(3) + func1_1_L15 f_is_fun by simp + } hence "\z\S. (f`(x)) \\<^sub>S z \\<^sub>S (f`(y)) \ J" by simp + with target_ring.equivalent_prime_ideal assms(1) \x\R\ \y\R\ + have "f`(x)\J\f`(y)\J" using f_is_fun apply_funtype + by auto + with \x\R\ \y\R\ \y \ f-``(J)\ have "x\f-``(J)" + using func1_1_L15 f_is_fun by auto + } thus ?thesis by blast qed + moreover from assms have "(f-``(J))\R\<^sub>o" using preimage_ideal + unfolding target_ring.primeIdeal_def by auto + moreover from assms(1) have "f-``(J) \ R" using vimage_prime_ideal_not_all + by simp + ultimately show "(f-``(J))\\<^sub>pR\<^sub>o" + by (rule origin_ring.equivalent_prime_ideal_2) qed section\Quotient ring with quotient map\ +text\The notion of a quotient ring (a.k.a factor ring, difference ring or residue class) + is analogous to the notion of quotient group from the group theory. \ + +text\The next locale \ring2\ extends the \ring0\ locale (defined in the \Ring_ZF\ theory) + with the assumption that some fixed set $I$ is an ideal. It also defines some notation + related to quotient rings, in particular we define the function (projection) + $f_I$ that maps each element $r$ of the ring $R$ to its class $r_I(\{ r\}$ + where $r_I$ is the quotient group relation defined by $I$ as a (normal) subgroup + of $R$ with addition. \ + locale ring2 = ring0 + fixes I - assumes idealAssum:"I\R" + assumes idealAssum: "I\R" fixes quot ("R\<^sub>I") defines quot_def [simp]: "R\<^sub>I \ QuotientBy(I)" @@ -310,7 +408,7 @@ locale ring2 = ring0 + defines qrel_def [simp]: "r\<^sub>I \ QuotientGroupRel(R,A,I)" fixes qfun ("f\<^sub>I") - defines qfun_def [simp]: "f\<^sub>I \ \r\R. r\<^sub>I ``{r}" + defines qfun_def [simp]: "f\<^sub>I \ \r\R. r\<^sub>I``{r}" fixes qadd ("A\<^sub>I") defines qadd_def [simp]: "A\<^sub>I \ QuotientGroupOp(R, A, I)" @@ -318,737 +416,558 @@ locale ring2 = ring0 + fixes qmul ("M\<^sub>I") defines qmul_def [simp]: "M\<^sub>I \ ProjFun2(R, qrel, M)" +text\The expression \J\R\<^sub>I\ will mean that $J$ is an ideal of the quotient ring $R_I$ + (with the quotient addition and multiplication).\ + abbreviation (in ring2) qideal ("_\R\<^sub>I") where "J\R\<^sub>I \ ring0.Ideal(R\<^sub>I,A\<^sub>I,M\<^sub>I,J)" +text\In the \ring2\ The expression \J\\<^sub>pR\<^sub>I\ means that $J$ is a prime ideal of the quotient + ring $R_I$. \ + abbreviation (in ring2) qprimeIdeal ("_\\<^sub>pR\<^sub>I") where "J\\<^sub>pR\<^sub>I \ ring0.primeIdeal(R\<^sub>I,A\<^sub>I,M\<^sub>I,J)" -lemma (in ring_homo) image_kernel: - assumes "x\ker" - shows "f`x = \\<^sub>S" - using assms func1_1_L15 fun by auto - -corollary (in ring_homo) image_kernel_2: - shows "f``(ker) = {\\<^sub>S}" -proof- - have "\\<^sub>R \ker" using homomor_dest_zero origin_ring.Ring_ZF_1_L2(1) - func1_1_L15 fun by auto moreover - have "ker \ R" using func1_1_L15[OF fun, of "{\\<^sub>S}"] by auto - then have "f `` (ker) = {f ` x . x \ ker}" - using func_imagedef[OF fun, of ker] by auto - ultimately show ?thesis using image_kernel by auto -qed +text\Theorems proven in the \ring0\ context can be applied + to the quotient ring in the \ring2\ context. \ sublocale ring2 < quotient_ring: ring0 quot qadd qmul "\x y. ideal_radd(x,I,y)" "\y. ideal_rmin(I,y)" "\x y. ideal_rsub(x,I,y)" "\x y. ideal_rmult(x,I,y)" - "\\<^sub>I" "\\<^sub>I" "\\<^sub>I" "\x. (x\<^sup>2\<^sup>I)" unfolding ring0_def quot_def - using quotientBy_is_ring[OF idealAssum] apply simp - unfolding ideal_radd_def ideal_rmin_def - ideal_rsub_def ideal_rmult_def - ideal_rzero_def ideal_rone_def - ideal_rtwo_def ideal_rsqr_def apply auto - using neutral_quotient[OF idealAssum] apply simp - using one_quotient[OF idealAssum] apply simp - using two_quotient[OF idealAssum] by simp - -text\The quotient map is a homomorphism of rings\ + "\\<^sub>I" "\\<^sub>I" "\\<^sub>I" "\x. (x\<^sup>2\<^sup>I)" + using quotientBy_is_ring idealAssum neutral_quotient + one_quotient two_quotient + unfolding ring0_def ideal_radd_def ideal_rmin_def + ideal_rsub_def ideal_rmult_def ideal_rzero_def + ideal_rone_def ideal_rtwo_def ideal_rsqr_def by auto + +text\The quotient map is a homomorphism of rings. This is probably one of the + most sophisticated facts in IsarMathlib that Isabelle's simp method proves + from 10 facts and 5 definitions. \ theorem (in ring2) quotient_fun_homomor: - shows "f\<^sub>I{is a ring homomorphism}{R,A,M}\{R\<^sub>I,A\<^sub>I,M\<^sub>I}" - unfolding ringHomomor_def[OF ringAssum quotient_ring.ringAssum] -proof(safe) - from add_group.quotient_map[OF ideal_normal_add_subgroup[OF idealAssum]] - show "Homomor(f\<^sub>I,R,A,R\<^sub>I,A\<^sub>I)" - unfolding qfun_def quot_def qadd_def QuotientBy_def[OF idealAssum] by auto - { - fix x y assume as:"x\R" "y\R" - have "f\<^sub>I ` (x\y) = QuotientGroupRel(R,A,I)``{x\y}" - unfolding qfun_def using as Ring_ZF_1_L4(3) - lamE lam_funtype by auto - then have "f\<^sub>I ` (x\y) = ((QuotientGroupRel(R,A,I)``{x}){\I}(QuotientGroupRel(R,A,I)``{y}))" - using EquivClass_1_L10[OF equiv_rel[OF idealAssum] - quotientBy_mul_monoid(1)[OF idealAssum]] as by auto - then have "f\<^sub>I ` (x\y) = ((f\<^sub>I `x){\I}(f\<^sub>I `y))" unfolding qfun_def - using as lamE lam_funtype by auto - then show "f\<^sub>I ` (M ` \x, y\) =M\<^sub>I ` \f\<^sub>I ` x, f\<^sub>I ` y\" by auto - } - have "f\<^sub>I `\ = QuotientGroupRel(R,A,I)``{\}" - unfolding qfun_def using lam_funtype lamE Ring_ZF_1_L2(2) - by auto - then have "f\<^sub>I `\ = TheNeutralElement(QuotientBy(I),ProjFun2(R, QuotientGroupRel(R,A,I), M))" - using Group_ZF_2_2_L1[OF _ equiv_rel[OF idealAssum] - quotientBy_mul_monoid(1)[OF idealAssum]] - ringAssum unfolding IsAring_def QuotientBy_def[OF idealAssum] - by auto - then show "f\<^sub>I ` TheNeutralElement(R, M) = TheNeutralElement(R\<^sub>I, M\<^sub>I)" - unfolding quot_def by auto -qed + shows "ringHomomor(f\<^sub>I,R,A,M,R\<^sub>I,A\<^sub>I,M\<^sub>I)" + using ringAssum idealAssum ideal_normal_add_subgroup add_group.quotient_map + Ring_ZF_1_L4(3) EquivClass_1_L10 Ring_ZF_1_L2(2) Group_ZF_2_2_L1 equiv_rel + quotientBy_mul_monoid(1) QuotientBy_def + unfolding IsAring_def Homomor_def IsMorphism_def ringHomomor_def + by simp text\The quotient map is surjective\ lemma (in ring2) quot_fun: - shows "f\<^sub>I\surj(R,R\<^sub>I)" unfolding qfun_def using lam_funtype unfolding quot_def QuotientBy_def[OF idealAssum] - quotient_def qrel_def surj_def by auto + shows "f\<^sub>I\surj(R,R\<^sub>I)" + using lam_funtype idealAssum QuotientBy_def + unfolding quotient_def surj_def by auto + +text\The theorems proven in the \ring_homo\ context are valid in the + \ring_homo\ context when applied to the quotient ring as the second (target) + ring and the quotient map as the ring homomorphism.\ sublocale ring2 < quot_homomorphism: ring_homo R A M quot qadd qmul qfun _ _ _ _ _ _ _ _ "\x y. ideal_radd(x,I,y)" "\y. ideal_rmin(I,y)" "\x y. ideal_rsub(x,I,y)" "\x y. ideal_rmult(x,I,y)" "\\<^sub>I" "\\<^sub>I" "\\<^sub>I" "\x. (x\<^sup>2\<^sup>I)" - unfolding ring_homo_def using ringAssum quotient_ring.ringAssum - quotient_fun_homomor quot_fun unfolding surj_def by auto + using ringAssum quotient_ring.ringAssum quotient_fun_homomor + unfolding ring_homo_def by simp_all + +text\The ideal we divide by is the kernel of the quotient map.\ -lemma (in ring2) quotient_kernel: +lemma (in ring2) quotient_kernel: shows "quot_homomorphism.kernel = I" proof - { - fix t assume t:"t\quot_homomorphism.kernel" - then have t:"f\<^sub>I`t = \\<^sub>I" "t\R" using quot_homomorphism.image_kernel - func1_1_L15[OF surj_is_fun[OF quot_fun]] by auto - then have "r\<^sub>I``{t} = \\<^sub>I" using beta by auto - then have "t\I" using add_group.Group_ZF_2_4_L5E[OF - ideal_normal_add_subgroup[OF idealAssum] t(2)] - neutral_quotient[OF idealAssum] unfolding - ideal_rzero_def QuotientBy_def[OF idealAssum] - by auto - } - then show "quot_homomorphism.kernel \ I" by auto - { - fix t assume t:"t\I" - then have tt:"t\R" using ideal_dest_subset idealAssum by auto - then have "r\<^sub>I``{t} = \\<^sub>I" using add_group.Group_ZF_2_4_L5E[OF - ideal_normal_add_subgroup[OF idealAssum] tt] t - neutral_quotient[OF idealAssum] unfolding - ideal_rzero_def QuotientBy_def[OF idealAssum] - by auto - then have "f\<^sub>I`t = \\<^sub>I" using beta tt by auto - with tt have "t\f\<^sub>I-``{\\<^sub>I}" using func1_1_L15 - surj_is_fun quot_fun by auto - } - then show "I \ quot_homomorphism.kernel" by auto + from idealAssum show "quot_homomorphism.kernel \ I" + using add_group.Group_ZF_2_4_L5E ideal_normal_add_subgroup + neutral_quotient QuotientBy_def + quot_homomorphism.image_kernel func1_1_L15 + unfolding ideal_rzero_def QuotientBy_def by auto + { fix t assume "t\I" + then have "t\R" using ideal_dest_subset idealAssum by auto + with idealAssum \t\I\ have "t \ f\<^sub>I-``{\\<^sub>I}" + using add_group.Group_ZF_2_4_L5E ideal_normal_add_subgroup + neutral_quotient QuotientBy_def func1_1_L15 surj_is_fun + unfolding ideal_rzero_def by auto + } thus "I \ quot_homomorphism.kernel" by blast qed - + +text\The theorems proven in the \ring0\ context are valid in the + \ring 2\ context when applied to the quotient ring.\ + sublocale ring2 < quotient_ring: ring0 quot qadd qmul "\x y. ideal_radd(x,I,y)" "\y. ideal_rmin(I,y)" "\x y. ideal_rsub(x,I,y)" "\x y. ideal_rmult(x,I,y)" - "\\<^sub>I" "\\<^sub>I" "\\<^sub>I" "\x. (x\<^sup>2\<^sup>I)" unfolding ring0_def quot_def - using quotientBy_is_ring[OF idealAssum] apply simp - unfolding ideal_radd_def ideal_rmin_def - ideal_rsub_def ideal_rmult_def - ideal_rzero_def ideal_rone_def - ideal_rtwo_def ideal_rsqr_def apply auto - using neutral_quotient[OF idealAssum] apply simp - using one_quotient[OF idealAssum] apply simp - using two_quotient[OF idealAssum] by simp - -sublocale ring2 < quot_homomorphism: ring_homo R A M quot qadd qmul qfun - _ _ _ _ _ _ _ _ "\x y. ideal_radd(x,I,y)" "\y. ideal_rmin(I,y)" - "\x y. ideal_rsub(x,I,y)" "\x y. ideal_rmult(x,I,y)" - "\\<^sub>I" "\\<^sub>I" "\\<^sub>I" "\x. (x\<^sup>2\<^sup>I)" - unfolding ring_homo_def using ringAssum quotient_ring.ringAssum - quotient_fun_homomor quot_fun unfolding surj_def by auto + "\\<^sub>I" "\\<^sub>I" "\\<^sub>I" "\x. (x\<^sup>2\<^sup>I)" + using idealAssum quotientBy_is_ring neutral_quotient + one_quotient two_quotient + unfolding ring0_def by simp_all + +text\If an ideal $I$ is a subset of the kernel of the homomorphism + then the image of the ideal generated by $I\cup J$, where $J$ is another ideal, + is the same as the image of $J$. Note that \J+\<^sub>II\ notation means + the ideal generated by the union of ideals $J$ and $J$, see the definitions + of \sumIdeal\ and \generatedIdeal\ in the \Ring_ZF_2\ theory, and also + corollary \sum_ideals_is_sum_elements\ for an alternative definition. \ theorem (in ring_homo) kernel_empty_image: assumes "J\R" "I \ ker" "I\R" - shows "f``(J+\<^sub>II) = f``J" "f``(I+\<^sub>IJ) = f``J" + shows "f``(J+\<^sub>II) = f``(J)" "f``(I+\<^sub>IJ) = f``(J)" proof- - have sub:"J+\<^sub>II \ R" using assms - origin_ring.sum_ideals_is_ideal[THEN origin_ring.ideal_dest_subset] - origin_ring.ideal_dest_subset by auto - { - fix t assume "t\f``(J+\<^sub>II)" - then obtain q where q:"q\J+\<^sub>II" "t=f`q" - using func_imagedef fun sub(1) by auto - from q(1) have "q\A``(J\I)" "J\I \ R\R" - using origin_ring.sum_ideals_is_sum_elements - assms(1,3) origin_ring.ideal_dest_subset by auto - then obtain qj qi where qji:"qj\J" "qi\I" - "q=qj\\<^sub>Rqi" using func_imagedef[of A "R\R" R] - origin_ring.add_group.groupAssum unfolding IsAgroup_def - IsAmonoid_def IsAssociative_def by auto - from qji(3) have "f`q = f`(qj\\<^sub>Rqi)" by auto - with qji(1,2) assms(1,3) have "(f`q) = ((f`qj)\\<^sub>S(f`qi))" - using homomor_dest_add[of qj qi] origin_ring.ideal_dest_subset - by auto - moreover from qji(2) assms(2) have "qi\ker" by auto - ultimately have "f ` q = ((f ` qj)\\<^sub>S\\<^sub>S)" using image_kernel - by auto - then have "f ` qj \S \ f ` q = (f ` qj)" - using target_ring.Ring_ZF_1_L3(3) by auto - moreover have "qj\R" using assms qji(1) + from assms(1,3) have "J+\<^sub>II \ R" + using origin_ring.sum_ideals_is_ideal origin_ring.ideal_dest_subset by auto - then have "f ` qj \S" using apply_type[OF fun] - by auto - ultimately have "f ` q = (f ` qj)" by auto - with q(2) have "t = f` qj" by auto - then have "t\ f``J" using qji(1) func_imagedef - fun assms origin_ring.ideal_dest_subset by auto - } - then have "f `` (J +\<^sub>I I) \ f `` J" by auto - moreover - { - fix t assume t:"t\f``J" - then obtain q where q:"q\J" "t=f`q" - using func_imagedef fun - assms(1) origin_ring.ideal_dest_subset by auto - from q(1) have "q\J\I" by auto moreover - have "J\I \ R" using assms(1,3) origin_ring.ideal_dest_subset by auto - ultimately have "q\\J\I\\<^sub>I" using origin_ring.generated_ideal_contains_set by auto - then have "q\J+\<^sub>II" unfolding origin_ring.sumIdeal_def[OF assms(1,3)]. - with q(2) have "t\f``(J+\<^sub>II)" using func_imagedef - fun sub by auto - } - then have "f``J \ f `` (J +\<^sub>I I)" by auto - ultimately show "f `` (J +\<^sub>I I) = f``J" "f `` (I +\<^sub>I J) = f``J" - using origin_ring.sum_ideals_commute assms(1,3) by auto + show "f``(J+\<^sub>II) = f``(J)" + proof + { fix t assume "t\f``(J+\<^sub>II)" + with \J+\<^sub>II \ R\ obtain q where q: "q \ J+\<^sub>II" "t=f`(q)" + using func_imagedef f_is_fun by auto + with assms(1,3) \q \ J+\<^sub>II\ have "q\A``(J\I)" "J\I \ R\R" + using origin_ring.sum_ideals_is_sum_elements + assms(1,3) origin_ring.ideal_dest_subset by auto + from origin_ring.add_group.groupAssum \J\I \ R\R\ + have "A``(J\I) = {A`(p). p\J\I}" + unfolding IsAgroup_def IsAmonoid_def IsAssociative_def + using func_imagedef by auto + with \q\A``(J\I)\ obtain q\<^sub>j q\<^sub>i where "q\<^sub>j\J" "q\<^sub>i\I" "q=q\<^sub>j\\<^sub>Rq\<^sub>i" + by auto + with assms have "f`(q) = (f`(q\<^sub>j)) \\<^sub>S \\<^sub>S" + using homomor_dest_add origin_ring.ideal_dest_subset image_kernel + by blast + moreover from assms(1) \q\<^sub>j\J\ have "f`(q\<^sub>j) \ S" + using origin_ring.ideal_dest_subset f_is_fun apply_funtype by blast + ultimately have "f`(q) = f`(q\<^sub>j)" using target_ring.Ring_ZF_1_L3(3) + by auto + with assms \t=f`(q)\ \q\<^sub>j\J\ have "t \ f``(J)" + using func_imagedef f_is_fun origin_ring.ideal_dest_subset by auto + } thus "f``(J+\<^sub>II) \ f``(J)" by blast + { fix t assume "t\f``(J)" + with assms(1) obtain q where q:"q\J" "t=f`(q)" + using func_imagedef f_is_fun origin_ring.ideal_dest_subset + by auto + from \q\J\ have "q\J\I" by auto + moreover from assms(1,3) have "J\I \ R" + using origin_ring.ideal_dest_subset by auto + ultimately have "q\\J\I\\<^sub>I" using origin_ring.generated_ideal_contains_set + by auto + with assms(1,3) \J+\<^sub>II \ R\ \t=f`(q)\ have "t\f``(J+\<^sub>II)" + using origin_ring.sumIdeal_def f_is_fun func_imagedef by auto + } thus "f``(J) \ f``(J+\<^sub>II)" by auto + qed + with assms(1,3) show "f ``(I+\<^sub>IJ) = f``(J)" + using origin_ring.sum_ideals_commute by auto qed subsection\Quotient ideals\ +text\If we have an ideal $J$ in a ring $R$, and another ideal $I$ contained in J, + then we can form the quotient ideal J/I whose elements are of the form $a + I$ + where $a$ is an element of $J$.\ + text\The preimage of an ideal is an ideal, so it applies to the -quotient map; but the preimage ideal contains the quotient ideal.\ + quotient map; but the preimage ideal contains the quotient ideal.\ lemma (in ring2) ideal_quot_preimage: assumes "J\R\<^sub>I" - shows "(f\<^sub>I-``J) \R" "I \ f\<^sub>I-``J" -proof- - from quot_homomorphism.preimage_ideal[OF assms] - show "(f\<^sub>I-``J) \R" by auto - { - fix x assume x:"x\I" - with quot_fun have "f\<^sub>I`x = r\<^sub>I``{x}" - using lamI[of x R] ideal_dest_subset[OF idealAssum] - apply_equality[of x "r\<^sub>I``{x}" "f\<^sub>I"] unfolding qfun_def - by auto - then have "f\<^sub>I`x = \\<^sub>I" using add_group.Group_ZF_2_4_L5E[OF - ideal_normal_add_subgroup[OF idealAssum], of x - "r\<^sub>I" "\\<^sub>I"] x ideal_dest_subset[OF idealAssum] - unfolding qrel_def ideal_rzero_def using - Group_ZF_2_4_L5B[OF _ ideal_normal_add_subgroup[OF idealAssum]] - using ringAssum unfolding IsAring_def by auto - then have "f\<^sub>I`x \ J" using quotient_ring.ideal_dest_zero - assms by auto - then have "x\f\<^sub>I-``J" using x ideal_dest_subset[OF idealAssum] - quot_fun func1_1_L15 by auto - } - then show "I \ f\<^sub>I-``J" by auto + shows "(f\<^sub>I-``(J)) \R" "I \ f\<^sub>I-``(J)" +proof - + from assms quot_homomorphism.preimage_ideal show "(f\<^sub>I-``(J)) \R" + by simp + { fix x assume x: "x\I" + with idealAssum have "x\R" using ideal_dest_subset by auto + from assms \x\I\ have "f\<^sub>I`(x) \ J" + using quotient_kernel quot_homomorphism.image_kernel + quotient_ring.ideal_dest_zero by simp + with \x\R\ have "x\f\<^sub>I-``(J)" using quot_homomorphism.f_is_fun func1_1_L15 + by simp + } thus "I \ f\<^sub>I-``(J)" by auto qed text\Since the map is surjective, the image is also an ideal\ lemma (in ring_homo) image_ideal_surj: assumes "J\R\<^sub>o" "f\surj(R,S)" - shows "(f``J) \R\<^sub>t" unfolding target_ring.Ideal_def -proof - show "IsAsubgroup(f``J,U)" - proof (rule image_subgroup) - show "IsAgroup(R,A)" using origin_ring.ringAssum unfolding IsAring_def by auto - show "f : R \ S" using fun . - show "IsAsubgroup(J,A)" using assms unfolding origin_ring.Ideal_def by auto - show "Homomor(f,R,A,S,U)" using homomorphism - unfolding ringHomomor_def[OF origin target] + shows "(f``(J)) \R\<^sub>t" +proof - + from assms homomorphism target_ring.ringAssum origin_ring.ringAssum + have "IsAsubgroup(f``(J),U)" + using ringHomHom(1) image_subgroup f_is_fun + unfolding IsAring_def origin_ring.Ideal_def by blast + moreover + { fix x y assume "x\f``(J)" "y\S" + from assms(1) \x\f``(J)\ obtain j where "x=f`(j)" "j\J" + using func_imagedef f_is_fun origin_ring.ideal_dest_subset by auto - show "IsAgroup(S,U)" using target_ring.ringAssum - unfolding IsAring_def by auto - qed - { - fix x y assume xy:"x\f``J" "y\S" - from xy(1) obtain j where x:"x=f`j" "j\J" using func_imagedef - fun origin_ring.ideal_dest_subset[OF assms(1)] by auto - from xy(2) have "y\f``R" using assms(2) surj_range_image_domain + from assms \y\S\ \j\J\ have "j\R" and "y\f``(R)" + using origin_ring.ideal_dest_subset surj_range_image_domain by auto - then obtain s where y:"y=f`s" "s\R" using func_imagedef - origin_ring.ideal_dest_subset[OF assms(1)] - fun by auto - from x(1) y(1) have "V`\x,y\ = V`\f`j,f`s\" - "V`\y,x\ = V`\f`s,f`j\" by auto - then have "V`\x,y\ = f`(M`\j,s\)" "V`\y,x\ = f`(M`\s,j\)" - using homomor_dest_mult[of s j] - homomor_dest_mult[of j s] - x(2) y(2) origin_ring.ideal_dest_subset[OF assms(1)] by auto - moreover have "j\\<^sub>Rs\J" "s\\<^sub>Rj\J" using origin_ring.ideal_dest_mult[OF assms(1)] - x(2) y(2) by auto - ultimately have "(x\\<^sub>Sy)\f``J" "(y\\<^sub>Sx)\f``J" - using func_imagedef fun origin_ring.ideal_dest_subset[OF assms(1)] + with assms(1) obtain s where "y=f`(s)" "s\R" + using func_imagedef origin_ring.ideal_dest_subset f_is_fun by auto - } - then show "\x\f `` J. \y\S. (y\\<^sub>Sx) \ f `` J \ (x\\<^sub>Sy) \ f `` J" + with assms(1) \j\R\ \x=f`(j)\ \x\f``(J)\ have + "V`\x,y\ = f`(M`\j,s\)" and "V`\y,x\ = f`(M`\s,j\)" + using homomor_dest_mult origin_ring.ideal_dest_subset by auto + with assms(1) \j\J\ \s\R\ have "(x\\<^sub>Sy)\f``(J)" and "(y\\<^sub>Sx)\f``J" + using origin_ring.ideal_dest_mult func_imagedef f_is_fun + origin_ring.ideal_dest_subset by auto + } hence "\x\f``(J). \y\S. (y\\<^sub>Sx) \ f``(J) \ (x\\<^sub>Sy) \ f``(J)" by auto + ultimately show ?thesis unfolding target_ring.Ideal_def by simp qed + +text\If the homomorphism is a surjection and given two ideals in the target ring + the inverse image of their product ideal is the sum ideal of the product + ideal of their inverse images and the kernel of the homomorphism.\ corollary (in ring_homo) prime_ideal_quot: - assumes "J\R\<^sub>t" "K\R\<^sub>t" "f:surj(R,S)" - shows "f-``(target_ring.productIdeal(J, K)) = origin_ring.sumIdeal(origin_ring.productIdeal((f-``J),(f-``K)), ker)" + assumes "J\R\<^sub>t" "K\R\<^sub>t" "f\surj(R,S)" + shows "f-``(target_ring.productIdeal(J, K)) = + origin_ring.sumIdeal(origin_ring.productIdeal((f-``(J)),(f-``(K))), ker)" proof - let ?P = "origin_ring.sumIdeal(origin_ring.productIdeal((f-``J),(f-``K)), f-``{\\<^sub>S})" - have qRI:"target_ring.productIdeal(J, K)\R\<^sub>t" - using target_ring.product_in_intersection(2) - assms by auto - from assms(1,2) have ideals:"(f-``J) \R\<^sub>o" "(f-``K) \R\<^sub>o" + let ?P = "origin_ring.sumIdeal(origin_ring.productIdeal((f-``(J)),(f-``(K))), f-``{\\<^sub>S})" + let ?Q = "target_ring.productIdeal(J, K)" + from assms(1,2) have ideals: "(f-``(J)) \R\<^sub>o" "(f-``(K)) \R\<^sub>o" using preimage_ideal by auto - then have idealJK:"((f-``J) \\<^sub>I (f-``K)) \R\<^sub>o" + then have idealJK: "((f-``(J))\\<^sub>I(f-``(K))) \R\<^sub>o" using origin_ring.product_in_intersection(2) by auto - have idealSum:"?P \R" - using origin_ring.sum_ideals_is_sum_elements[OF idealJK preimage_ideal(1)[OF target_ring.zero_ideal]] - origin_ring.sum_elements_is_ideal[OF idealJK preimage_ideal(1)[OF target_ring.zero_ideal]] - by auto - then have ideal:"(f``?P) \R\<^sub>t" - using image_ideal_surj assms(3) + then have "?P \R\<^sub>o" and "?P\R" + using kernel_ideal origin_ring.sum_ideals_is_ideal + origin_ring.ideal_dest_subset by simp_all + with assms(3) have "(f``(?P)) \R\<^sub>t" using image_ideal_surj + by simp + let ?X = "((f-``(J)) \\<^sub>I (f-``(K)))\(f-``{\\<^sub>S})" + from assms(3) idealJK have "?X \ R" + using func1_1_L6A surj_is_fun origin_ring.ideal_dest_subset + by blast + with idealJK have "?X \ ?P" + using kernel_ideal origin_ring.sumIdeal_def + origin_ring.generated_ideal_contains_set by simp + { fix t assume "t\V ``(J\K)" + moreover from assms have "J\K \ S\S" + using target_ring.ideal_dest_subset by blast + ultimately obtain j k where "j\J" "k\K" "t=V`\j,k\" + using func_imagedef AMUV_are_ops(4) by auto + from assms(1) \j\J\ have "j\S" + using target_ring.ideal_dest_subset by blast + with assms(3) obtain j\<^sub>0 where "j\<^sub>0\R" "f`(j\<^sub>0) = j" + unfolding surj_def by auto + with assms(2,3) \k\K\ obtain k\<^sub>0 where "k\<^sub>0\R" "f`(k\<^sub>0) = k" + using target_ring.ideal_dest_subset unfolding surj_def + by blast + with \t=V`\j,k\\ \f`(j\<^sub>0) = j\ \j\<^sub>0\R\ have "t=f`(M`\j\<^sub>0,k\<^sub>0\)" + using homomor_dest_mult by simp + from assms(3) have "(f-``(J))\(f-``(K)) \ R\R" + using func1_1_L6A f_is_fun by blast + moreover from assms(3) \j\<^sub>0\R\ \f`(j\<^sub>0) = j\ \j\J\ \k\K\ \k\<^sub>0\R\ \f`(k\<^sub>0) = k\ + have "\j\<^sub>0,k\<^sub>0\ \ (f-``J)\(f-``K)" + using func1_1_L15 unfolding surj_def by auto + ultimately have "M`\j\<^sub>0,k\<^sub>0\ \ M``((f-``(J))\(f-``(K)))" + using AMUV_are_ops func_imagedef by auto + with ideals \?X \ ?P\ have "M`\j\<^sub>0,k\<^sub>0\ \ ?P" + using origin_ring.product_in_intersection(3) + by blast + with \?P\R\ \t=f`(M`\j\<^sub>0,k\<^sub>0\)\ have "t\(f``(?P))" + using f_is_fun func1_1_L15D by simp + } hence "V``(J \ K) \ f``(?P)" by blast + with assms(1,2) \(f``(?P)) \R\<^sub>t\ have "?Q\f``(?P)" + using target_ring.generated_ideal_small target_ring.productIdeal_def + by simp + then have R: "f-``(?Q) \ f-``(f``?P)" + unfolding vimage_def by blast + from \?X \ ?P\ \?P \R\<^sub>o\ \?P\R\ have P_ideal: "?P \ {N\\. f-``{\\<^sub>S} \ N}" by auto - { - fix t assume "t\V ``(J\K)" moreover - have "J\K \ S\S" using assms - target_ring.ideal_dest_subset by auto moreover - have "V:S\S \ S" using target_ring.ringAssum - unfolding IsAring_def IsAmonoid_def - IsAssociative_def by auto - ultimately obtain j k where jk:"j\J" "k\K" "t=V`\j,k\" - using func_imagedef by auto - from jk(1) have "j\S" using assms(1) - target_ring.ideal_dest_subset by auto - then obtain jj where jj:"jj\R" "f`jj = j" using - assms(3) unfolding surj_def by auto - from jk(2) have "k\S" using assms(2) - target_ring.ideal_dest_subset by auto - then obtain kk where kk:"kk\R" "f`kk = k" using - assms(3) unfolding surj_def by auto - from jk(3) jj(2) kk(2) - have "t=V`\f`jj,f`kk\" by auto - then have t:"t=f`(M`\jj,kk\)" using - homomor_dest_mult[OF jj(1) kk(1)] by auto - have "f-``J \ R" using assms(3) - using func1_1_L6A[OF surj_is_fun] by auto moreover - have "f-``K \ R" using assms(3) - using func1_1_L6A[OF surj_is_fun] by auto ultimately - have sub:"(f-``J)\(f-``K) \ R\R" by auto moreover - have "M:R\R \ R" using origin_ring.ringAssum - unfolding IsAring_def IsAmonoid_def - IsAssociative_def by auto moreover - { - from jj have "jj\f-``J" using func1_1_L15 - assms(3) jk(1) unfolding surj_def by auto moreover - from kk have "kk\f-``K" using func1_1_L15 - assms(3) jk(2) unfolding surj_def by auto ultimately - have "\jj,kk\\(f-``J)\(f-``K)" by auto - } ultimately - have "M`\jj,kk\ \ M``((f-``J)\(f-``K))" - using func_imagedef by auto - then have "M`\jj,kk\ \ (f-``J) \\<^sub>I (f-``K)" - using preimage_ideal - assms origin_ring.product_in_intersection(3) by blast - then have "M`\jj,kk\ \ ((f-``J) \\<^sub>I (f-``K))\(f-``{\\<^sub>S})" - by auto moreover - have "((f-``J) \\<^sub>I (f -`` K))\(f-``{\\<^sub>S})\R" using - func1_1_L6A[OF surj_is_fun[OF assms(3)]] - origin_ring.ideal_dest_subset[OF idealJK] by auto - ultimately have "M`\jj,kk\ \ ?P" - unfolding origin_ring.sumIdeal_def[OF idealJK - preimage_ideal(1)[OF target_ring.zero_ideal]] - using origin_ring.generated_ideal_contains_set[of - "((f-`` J) \\<^sub>I (f-`` K)) \ (f-``{\\<^sub>S})"] by blast - then have "f`(M`\jj,kk\) \ f``?P" - using func1_1_L15D[OF surj_is_fun[OF assms(3)] _ - idealSum[THEN origin_ring.ideal_dest_subset]] by auto - moreover note t ultimately - have "t\(f``?P)" + { fix t assume "t\f-``(f``(?P))" + then have "f`(t) \ f``(?P)" and "t\R" + using func1_1_L15 f_is_fun by simp_all + with P_ideal obtain s where "f`(t) = f`(s)" "s\?P" + using func_imagedef f_is_fun by auto + from P_ideal \s\?P\ have "s\R" by blast + from \t\R\ \s\R\ \f`(t) = f`(s)\ have "f`(t\\<^sub>Rs) = \\<^sub>S" + using f_is_fun apply_funtype target_ring.Ring_ZF_1_L3(7) + homomor_dest_subs by simp + with \t\R\ \s\R\ \?X\?P\ have "t\\<^sub>Rs \ ?P" + using origin_ring.Ring_ZF_1_L4(2) func1_1_L15 f_is_fun by auto - } - then have "V `` (J \ K) \ f``?P" by blast - then have "target_ring.generatedIdeal(V `` (J \ K)) \ f``?P" - using ideal target_ring.generated_ideal_small by auto - then have "target_ring.productIdeal(J, K) \ f``(?P)" - unfolding target_ring.productIdeal_def[OF assms(1,2)]. - then have R:"f-``target_ring.productIdeal(J, K) \ f-``(f``?P)" - unfolding vimage_def by blast - have "((f-``J) \\<^sub>I (f-``K)) \ (f -`` {\\<^sub>S}) \ R" using idealJK - origin_ring.ideal_dest_subset func1_1_L6A[OF surj_is_fun] - assms(3) by blast - then have p:"(f -`` {\\<^sub>S}) \ ?P" - unfolding origin_ring.sumIdeal_def[OF idealJK - preimage_ideal(1)[OF target_ring.zero_ideal]] - using origin_ring.generated_ideal_contains_set - by blast - moreover - from idealSum origin_ring.ideal_dest_subset - have "?P \R" by auto - moreover note idealSum - ultimately have P_ideal:"?P \ {N\\. f-``{\\<^sub>S} \ N}" + with P_ideal \s\?P\ have "s\\<^sub>R(t\\<^sub>Rs) \ ?P" + using origin_ring.ideal_dest_sum by auto + with \t\R\ \s\R\ have "t\?P" + using origin_ring.Ring_ZF_2_L1A(5) by auto + } with R show "f-``(?Q) \ ?P" by auto - have P:"f``?P \ S" - using ideal P_ideal - assms(3) target_ring.ideal_dest_subset by auto - { - fix t assume "t\f-``(f``?P)" - then have t:"f`t\f``?P" "t\R" using func1_1_L15 - surj_is_fun[OF assms(3)] by auto - then obtain s where s:"f`t = f`s" "s\?P" using - func_imagedef[OF surj_is_fun[OF assms(3)]] P_ideal by auto - from s(2) have ss:"s\R" using P_ideal by auto - from s(1) have "(f`t) \\<^sub>S (f`s) = \\<^sub>S" using - target_ring.Ring_ZF_1_L3(7)[OF apply_type[OF surj_is_fun[OF assms(3)] - t(2)]] by auto - then have "f`(t\\<^sub>Rs) = \\<^sub>S" using homomor_dest_subs - t(2) ss by auto moreover - from t(2) ss have "t\\<^sub>Rs \R" using origin_ring.Ring_ZF_1_L4(2) by auto - ultimately have "t\\<^sub>Rs \ f-``{\\<^sub>S}" using func1_1_L15 - surj_is_fun[OF assms(3)] by auto - then have "t\\<^sub>Rs \ ?P" using p by auto - then have "s\\<^sub>R(t\\<^sub>Rs) \ ?P" using origin_ring.ideal_dest_sum - P_ideal s(2) by auto - then have "t\?P" using origin_ring.Ring_ZF_2_L1A(5) - ss t(2) by auto - } - then have "f-``(f``?P) \ ?P" by auto - with R show "f-``target_ring.productIdeal(J, K) \ ?P" by auto - { - fix t assume as:"t\M``((f-``J)\(f-``K))" - moreover have "(f-``J)\(f-``K) \ R\R" using func1_1_L15[OF surj_is_fun[OF assms(3)]] by auto - ultimately obtain tj tk where jk:"t=tj\\<^sub>Rtk" "tj\f-``J" "tk\f-``K" - using func_imagedef[of M "R\R" R] origin_ring.ringAssum unfolding IsAring_def IsAmonoid_def - IsAssociative_def by auto - from as have tR:"t\R" using func1_1_L6(2)[of M "R\R" R] - origin_ring.ringAssum unfolding IsAring_def IsAmonoid_def IsAssociative_def + { fix t assume as: "t \ M``((f-``(J))\(f-``(K)))" + have "(f-``(J))\(f-``(K)) \ R\R" + using func1_1_L15 f_is_fun by auto + with as obtain t\<^sub>j t\<^sub>k where + jk: "t=t\<^sub>j\\<^sub>Rt\<^sub>k" "t\<^sub>j\f-``(J)" "t\<^sub>k\f-``(K)" + using AMUV_are_ops(2) func_imagedef IsAssociative_def by auto - from jk(2) have j:"tj\R" "f`tj \J" using func1_1_L15 surj_is_fun[OF - assms(3)] by auto - from jk(3) have k:"tk\R" "f`tk \K" using func1_1_L15 surj_is_fun[OF - assms(3)] by auto - from jk(1) have "f`t = f`(tj\\<^sub>Rtk)" by auto - then have ft:"f`t = ((f`tj)\\<^sub>S(f`tk))" using homomor_dest_mult - using j(1) k(1) by auto - from j(2) k(2) have "\f`tj,f`tk\\J\K" by auto - moreover have "V:S\S\S" using target_ring.ringAssum unfolding IsAring_def - IsAmonoid_def IsAssociative_def by auto - moreover have "J\K \ S\S" using assms using target_ring.ideal_dest_subset + from as have "t\R" using AMUV_are_ops(2) func1_1_L6(2) by blast + from jk(2,3) have "t\<^sub>j\R" "f`(t\<^sub>j)\J" and "t\<^sub>k\R" "f`(t\<^sub>k)\K" + using func1_1_L15 f_is_fun by simp_all + from jk(1) \t\<^sub>j\R\ \t\<^sub>k\R\ have ft: "f`(t) = ((f`(t\<^sub>j))\\<^sub>S(f`(t\<^sub>k)))" + using homomor_dest_mult by simp + from \f`(t\<^sub>j)\J\ \f`(t\<^sub>k) \K\ have "\f`(t\<^sub>j),f`(t\<^sub>k)\ \ J\K" + by simp + moreover from assms have "V:S\S\S" and "J\K \ S\S" + using AMUV_are_ops(4) target_ring.ideal_dest_subset by auto - ultimately have "V`\f ` tj, f ` tk\ \V``(J\K)" - using func_imagedef[of V "S\S" S "J\K"] by force - with ft have "f`t\V``(J\K)" by auto - then have "f`t\target_ring.productIdeal(J, K)" - using target_ring.product_in_intersection(3) assms - by blast - then have "t\f-``target_ring.productIdeal(J, K)" - using func1_1_L15 surj_is_fun[OF assms(3)] tR - by auto - } - then have "M `` (f -`` J \ f -`` K) \ f -`` target_ring.productIdeal(J, K)" by auto - moreover have id:"(f -``target_ring.productIdeal(J, K)) \R\<^sub>o" - apply (rule preimage_ideal) apply (rule target_ring.product_in_intersection(2)) - using assms(1,2) . - ultimately have "(f -`` J) \\<^sub>I (f -`` K) \ f -``target_ring.productIdeal(J, K)" - using origin_ring.generated_ideal_small origin_ring.productIdeal_def[OF ideals] + ultimately have "V`\f`(t\<^sub>j), f`(t\<^sub>k)\ \V``(J\K)" + using func_imagedef by force + with assms ft \t\R\ have "t \ f-``(?Q)" + using target_ring.product_in_intersection(3) func1_1_L15 f_is_fun + by auto + } hence "M``(f-``(J)\f-``(K))\f-``(?Q)" by auto - moreover have "\\<^sub>S \ target_ring.productIdeal(J, K)" - using target_ring.product_in_intersection(2) assms(1,2) - target_ring.ideal_dest_zero by auto - then have "(f -`` {\\<^sub>S}) \ f -``target_ring.productIdeal(J, K)" - by auto - ultimately have "((f -`` J) \\<^sub>I (f -`` K))\(f -`` {\\<^sub>S}) \ f -``target_ring.productIdeal(J, K)" + moreover from assms(1,2) have + id: "(f-``(?Q)) \R\<^sub>o" + using preimage_ideal target_ring.product_in_intersection(2) + by simp + ultimately have "(f -`` J) \\<^sub>I (f -`` K)\f-``(?Q)" + using ideals origin_ring.generated_ideal_small origin_ring.productIdeal_def by auto - then show "((f -`` J) \\<^sub>I (f -`` K))+\<^sub>I(f -`` {\\<^sub>S}) \ f -``target_ring.productIdeal(J, K)" - using origin_ring.generated_ideal_small id - origin_ring.sumIdeal_def[OF idealJK preimage_ideal(1)[OF target_ring.zero_ideal]] + with assms(1,2) have "?X \ f-``(?Q)" + using target_ring.product_in_intersection(2) target_ring.ideal_dest_zero by auto + with idealJK id show + "((f-``(J))\\<^sub>I(f-``(K)))+\<^sub>I(f-``{\\<^sub>S}) \ f-``(?Q)" + using origin_ring.generated_ideal_small kernel_ideal origin_ring.sumIdeal_def + by simp qed +text\If the homomorphism is surjective then the product ideal of ideals $J,K$ + in the target ring is the image of the product ideal (in the source ring) + of the inverse images of $J,K$. \ + corollary (in ring_homo) prime_ideal_quot_2: assumes "J\R\<^sub>t" "K\R\<^sub>t" "f\surj(R,S)" - shows "target_ring.productIdeal(J, K) = f``origin_ring.productIdeal((f-`` J), (f-`` K))" -proof- - have "f-`` target_ring.productIdeal(J, K) = - ((f-`` J) \\<^sub>I (f-`` K)) +\<^sub>I (ker)" using prime_ideal_quot assms beta by auto - then have "f``(f-`` target_ring.productIdeal(J, K)) - = f``(((f -`` J) \\<^sub>I (f -`` K)) +\<^sub>I (ker))" - by auto - moreover have "target_ring.productIdeal(J, K)\R\<^sub>t" - using target_ring.product_in_intersection(2) - assms(1,2) by auto - then have "target_ring.productIdeal(J, K) \ S" using - target_ring.ideal_dest_subset by auto - ultimately have A:"target_ring.productIdeal(J, K) = - f``(((f-`` J) \\<^sub>I (f-`` K)) +\<^sub>I(f-``{\\<^sub>S}))" - using surj_image_vimage assms(3) - by auto - have idealJK:"((f-``J) \\<^sub>I (f-``K)) \R" - using origin_ring.product_in_intersection(2) - preimage_ideal assms(1,2) by auto - with A show "target_ring.productIdeal(J, K) = - f``((f-`` J) \\<^sub>I (f-`` K))" using kernel_empty_image(1) - preimage_ideal[OF target_ring.zero_ideal] by auto + shows "target_ring.productIdeal(J, K) = + f``(origin_ring.productIdeal((f-``(J)), (f-``(K))))" +proof - + from assms have "f``(f-``(target_ring.productIdeal(J, K))) + = f``(((f-``(J)) \\<^sub>I (f-``(K))) +\<^sub>I (ker))" + using prime_ideal_quot by simp + with assms show ?thesis + using target_ring.product_in_intersection(2) + target_ring.ideal_dest_subset surj_image_vimage + origin_ring.product_in_intersection(2) preimage_ideal + kernel_empty_image(1) target_ring.zero_ideal + by simp qed +text\If the homomorphism is surjective and an ideal in the source ring + contains the kernel, then the image of that ideal is a prime ideal in the + target ring.\ + lemma (in ring_homo) preimage_ideal_prime: assumes "J\\<^sub>pR\<^sub>o" "ker \ J" "f\surj(R,S)" - shows "(f``J)\\<^sub>pR\<^sub>t" -proof- - from assms(1,3) have "(f``J)\R\<^sub>t" using image_ideal_surj - unfolding origin_ring.primeIdeal_def by auto moreover - from assms(1) have JT:"J \ R" "J \ R" + shows "(f``(J))\\<^sub>pR\<^sub>t" +proof - + from assms(1) have "J \ R" "J \ R" unfolding origin_ring.primeIdeal_def using origin_ring.ideal_dest_subset by auto - { - assume full:"f``J = S" - from JT obtain t where t:"t\R-J" by auto - with assms(3) have "f`t\S" - using apply_type[OF surj_is_fun] by auto - with full have "f`t\f``J" by auto - with assms(3) JT(1) obtain j where j:"j\J" "f`t= f`j" - using func_imagedef[OF surj_is_fun] by auto - from j(1) have jt:"j\R" using JT(1) by auto - then have fj:"f`j\S" using apply_type assms(3) - unfolding surj_def by auto - from j(2) have "(f`t)\\<^sub>S(f`j) = \\<^sub>S" using - target_ring.Ring_ZF_1_L3(7) fj by auto - then have "f`(t\\<^sub>Rj) =\\<^sub>S" using homomor_dest_subs - t jt by auto moreover - have "t\\<^sub>Rj \R" using origin_ring.Ring_ZF_1_L4(2) - t jt by auto - ultimately have "t\\<^sub>Rj\f-``{\\<^sub>S}" using func1_1_L15[OF surj_is_fun] - assms(3) by auto - with assms(2) have tjJ:"t\\<^sub>Rj\J" by auto - with j(1) have "j\\<^sub>R(t\\<^sub>Rj) \J" using assms(1) + from assms(1,3) have "(f``(J))\R\<^sub>t" + using image_ideal_surj unfolding origin_ring.primeIdeal_def + by auto + moreover + { assume "f``(J) = S" + from \J \ R\ \J \ R\ obtain t where "t\R-J" by auto + with assms(3) have "f`(t)\S" + using apply_funtype f_is_fun by auto + with assms(3) \J \ R\ \f``(J) = S\ obtain j + where j: "j\J" "f`(t)= f`(j)" + using func_imagedef f_is_fun by auto + from \j\J\ \J \ R\ have "j\R" by auto + with assms(3) \f`(t)= f`(j)\ \t\R-J\ have "t\\<^sub>Rj\f-``{\\<^sub>S}" + using apply_type target_ring.Ring_ZF_1_L3(7) f_is_fun + homomor_dest_subs origin_ring.Ring_ZF_1_L4(2) func1_1_L15 + by auto + with assms(1,2) j(1) have "j\\<^sub>R(t\\<^sub>Rj) \J" unfolding origin_ring.primeIdeal_def using origin_ring.ideal_dest_sum by auto - then have False using origin_ring.Ring_ZF_2_L1A(5) - using jt t by auto - } - then have "f``J \ S" by auto moreover - { - fix I K assume as:"I\target_ring.ideals" "K\target_ring.ideals" - "target_ring.productIdeal(I, K) \ f``J" - then have "f `` ((f -`` I) \\<^sub>I (f -`` K)) \ f``J" - using prime_ideal_quot_2 assms(3) by auto - then have "f-``(f `` ((f -`` I) \\<^sub>I (f -`` K))) \ f-``(f``J)" - by blast - moreover have "((f -`` I) \\<^sub>I (f -`` K)) \R" - using origin_ring.product_in_intersection(2)[OF preimage_ideal(1) - preimage_ideal(1)] - as(1,2) by auto - then have "((f -`` I) \\<^sub>I (f -`` K)) \ R" using origin_ring.ideal_dest_subset + with \j\R\ \t\R-J\ have False using origin_ring.Ring_ZF_2_L1A(5) by auto - ultimately have "(f -`` I) \\<^sub>I (f -`` K) \ f-``(f``J)" - using func1_1_L9[OF fun, of "(f -`` I) \\<^sub>I (f -`` K)"] by auto + } hence "f``(J) \ S" by auto + moreover + { fix I K assume as: "I\target_ring.ideals" "K\target_ring.ideals" + "target_ring.productIdeal(I, K) \ f``(J)" + let ?A = "(f-``(I)) \\<^sub>I (f-``(K))" + from as(1,2) have "?A \ f-``(f``(?A))" + using origin_ring.product_in_intersection(2) preimage_ideal(2) + origin_ring.ideal_dest_subset func1_1_L9 f_is_fun by auto + with assms(3) as have "?A \ f-``(f``(J))" + using prime_ideal_quot_2 vimage_mono by force + moreover from assms(1) have "J \ f-``(f``(J))" + using func1_1_L9 f_is_fun origin_ring.ideal_dest_subset + unfolding origin_ring.primeIdeal_def by auto moreover - have "J \ f-``(f``J)" using func1_1_L9 fun assms(1) - origin_ring.ideal_dest_subset unfolding origin_ring.primeIdeal_def - by auto moreover - { - fix t assume "t\f-``(f``J)" - then have t:"f`t\f``J" "t\R" using func1_1_L15 fun by auto - from t(1) obtain s where s:"f`t = f`s" "s\J" - using func_imagedef fun assms(1) - origin_ring.ideal_dest_subset unfolding origin_ring.primeIdeal_def + { fix t assume "t \ f-``(f``(J))" + then have "f`(t)\f``(J)" "t\R" using func1_1_L15 f_is_fun by auto - from s(2) assms(1) have ss:"s\R" unfolding origin_ring.primeIdeal_def + from assms(1) \f`(t)\f``(J)\ obtain s where "f`(t)=f`(s)" "s\J" + using func_imagedef f_is_fun origin_ring.ideal_dest_subset + unfolding origin_ring.primeIdeal_def by auto + from assms(1) \s\J\ have "s\R" + unfolding origin_ring.primeIdeal_def using origin_ring.ideal_dest_subset by auto - from s(1) have "f`t \\<^sub>S (f`s) = \\<^sub>S" using target_ring.Ring_ZF_1_L3(7)[ - OF apply_type[OF fun t(2)]] by auto - then have "f`(t\\<^sub>Rs) = \\<^sub>S" using homomor_dest_subs - t(2) ss by auto - moreover have "t\\<^sub>Rs \R" using ss t(2) - origin_ring.Ring_ZF_1_L4(2) by auto - ultimately have "t\\<^sub>Rs \ f-``{\\<^sub>S}" using func1_1_L15 - fun by auto - with assms(2) have "t\\<^sub>Rs \ J" by auto - with s(2) have "s\\<^sub>R(t\\<^sub>Rs)\J" - using assms(1) origin_ring.ideal_dest_sum + with assms(2) \f`(t)=f`(s)\ \t\R\ have "t\\<^sub>Rs \ J" + using target_ring.Ring_ZF_1_L3(7) apply_funtype f_is_fun + homomor_dest_subs origin_ring.Ring_ZF_1_L4(2) func1_1_L15 + by auto + with assms(1) \s\J\ have "s\\<^sub>R(t\\<^sub>Rs)\J" + using origin_ring.ideal_dest_sum unfolding origin_ring.primeIdeal_def by auto - then have "t: J" using origin_ring.Ring_ZF_2_L1A(5) - ss t(2) by auto - } - then have "f-``(f``J) \ J" by auto - ultimately have "(f -`` I) \\<^sub>I (f -`` K) \ J" by auto - moreover have "(f -`` I) \\" "(f -`` K) \\" - using as(1,2) preimage_ideal - origin_ring.ideal_dest_subset by auto - ultimately have "(f -`` I) \ J \ (f -`` K) \ J" - using assms(1) unfolding origin_ring.primeIdeal_def by auto - then have "f``(f -`` I) \ f``J \ f``(f -`` K) \ f``J" + with \s\R\ \t\R\ have "t\J" using origin_ring.Ring_ZF_2_L1A(5) + by auto + } hence "f-``(f``J) \ J" by auto + ultimately have "?A \ J" by auto + with assms(1) as(1,2) have "(f-``(I)) \ J \ (f-``(K)) \ J" + using preimage_ideal origin_ring.ideal_dest_subset + unfolding origin_ring.primeIdeal_def + by auto + hence "f``(f-``(I)) \ f``J \ f``(f-``(K)) \ f``(J)" by auto - with assms(3) have "I \ f``J \ K \ f``J" - using surj_image_vimage as(1,2) by auto + with assms(3) as(1,2) have "I \ f``(J) \ K \ f``(J)" + using surj_image_vimage by auto } ultimately show ?thesis unfolding target_ring.primeIdeal_def by auto qed text\The ideals of the quotient ring are in bijection -with the ideals of the original ring that contain the ideal -by which we made the quotient.\ + with the ideals of the original ring that contain the ideal + by which we made the quotient.\ theorem (in ring_homo) ideal_quot_bijection: assumes "f\surj(R,S)" - defines "idealFun \ \J\target_ring.ideals. f-``J" + defines "idealFun \ \J\target_ring.ideals. f-``(J)" shows "idealFun \ bij(target_ring.ideals,{K\\. ker \ K})" - unfolding bij_def inj_def surj_def -proof(safe) - have "idealFun \ target_ring.ideals \ {f-``J. J\target_ring.ideals}" - unfolding idealFun_def - using lam_funtype by auto moreover - { - fix t assume "t\{f-``J. J\target_ring.ideals}" - then obtain K where "K\target_ring.ideals" "f-``K = t" by auto - then have "ker \ t" "t\R" "t \ R" using preimage_ideal[of K] - using func1_1_L3[OF surj_is_fun[OF assms(1)], of K] - by auto - then have "t\{K\\. ker \ K}" by auto - } - then have "{f-``J. J\target_ring.ideals} \ {K\\. ker \ K}" by blast - ultimately show "idealFun \ target_ring.ideals \ {K\\. ker \ K}" +proof - + let ?\\<^sub>t = "target_ring.ideals" + have "idealFun : ?\\<^sub>t \ {f-``(J). J\?\\<^sub>t}" + unfolding idealFun_def using lam_funtype by simp + moreover + { fix t assume "t \ {f-``(J). J\?\\<^sub>t}" + then obtain K where "K \ ?\\<^sub>t" "f-``(K) = t" by auto + then have "K\R\<^sub>t" by simp + then have "(f-``(K))\R" "ker \ f-``(K)" using preimage_ideal(2,3) + by simp_all + with \f-``(K) = t\ have "ker \ t" "t\R" by simp_all + with \f-``(K) = t\ have "t\{K\\. ker \ K}" using func1_1_L3 f_is_fun + by blast + } hence "{f-``(J). J\?\\<^sub>t} \ {K\\. ker \ K}" by blast + ultimately have I: "idealFun : ?\\<^sub>t \ {K\\. ker \ K}" using func1_1_L1B by auto - then show "idealFun \ target_ring.ideals \ {K\\. ker \ K}". - { - fix w x assume as:"w\R\<^sub>t" "x\R\<^sub>t" "w\S" "x\S" "idealFun ` w = idealFun ` x" - then have "f-``w = f-``x" unfolding idealFun_def - using beta by auto - then have "f``(f-``w) = f``(f-``x)" by auto - then show "w = x" using surj_image_vimage assms(1) as - by auto + { fix w x assume + as: "w\R\<^sub>t" "x\R\<^sub>t" "w\S" "x\S" "idealFun`(w) = idealFun`(x)" + then have "f``(f-``(w)) = f``(f-``(x))" unfolding idealFun_def by simp + with assms(1) as have "w = x" using surj_image_vimage + by simp } - { - fix y assume y:"y\R" "y\R" "ker \ y" - from y(2) have "y \ f-``(f``y)" using func1_1_L9[OF surj_is_fun] - assms(1) by auto + with I have "idealFun \ inj(?\\<^sub>t,{K\\. ker \ K})" + unfolding inj_def by auto + moreover + { fix y assume "y\R" "y\R" "ker \ y" + from \y\R\ have "y \ f-``(f``y)" using func1_1_L9 f_is_fun + by auto moreover - { - fix t assume "t\f-``(f``y)" - then have t:"f`t\f``y" "t\R" using func1_1_L15[OF surj_is_fun] - assms(1) by auto - from t(1) y(2) obtain s where s:"s\y" "f`t = f`s" - using func_imagedef[of f R S y, OF surj_is_fun] assms(1) + { fix t assume "t\f-``(f``(y))" + then have "f`(t) \ f``(y)" "t\R" using func1_1_L15 f_is_fun by auto - from s(1) have "s\R" using y(2) by auto - with t(2) have E:"f`t : S" "f`s: S" using apply_type[of f R "\u. S", OF surj_is_fun] - assms(1) by auto - from E(1) s(2) have "(f`t)\\<^sub>S(f`s) = \\<^sub>S" - using target_ring.Ring_ZF_1_L3(7) by auto - then have "f`(t\\<^sub>Rs) = \\<^sub>S" using homomor_dest_subs - t(2) `s:R` by auto - moreover from \s\R\ have "t\\<^sub>Rs \R" - using origin_ring.Ring_ZF_1_L4(2) t(2) by auto - ultimately have "t\\<^sub>Rs \ f-``{\\<^sub>S}" - using func1_1_L15[OF surj_is_fun] assms(1) by auto - with y(3) have "t\\<^sub>Rs \ y" by auto - with s(1) have "s\\<^sub>R(t\\<^sub>Rs) \ y" using - origin_ring.ideal_dest_sum y(1) by auto - then have "t\y" using origin_ring.Ring_ZF_2_L1A(5) - using `s\R` t(2) by auto - } - ultimately have "f-``(f``y) = y" by blast moreover - have "f``y \ S" using func1_1_L6(2)[of f R S] assms(1) - unfolding surj_def by auto moreover - have "(f``y)\R\<^sub>t" using image_ideal_surj - assms(1) y(1) by auto - ultimately show "\x\target_ring.ideals. idealFun ` x = y" - unfolding idealFun_def - by auto + from \f`(t) \ f``(y)\ \y\R\ obtain s where "s\y" "f`(t) = f`(s)" + using func_imagedef f_is_fun by auto + from \s\y\ \y\R\ have "s\R" by auto + with \t\R\ \f`(t) = f`(s)\ \ker \ y\ have "t\\<^sub>Rs \ y" + using target_ring.Ring_ZF_1_L3(7) homomor_dest_subs + origin_ring.Ring_ZF_1_L4(2) func1_1_L15 f_is_fun + by auto + with \s\y\ \y\R\ \s\R\ \t\R\ have "t\y" + using origin_ring.ideal_dest_sum origin_ring.Ring_ZF_2_L1A(5) + by force + } + ultimately have "f-``(f``(y)) = y" by blast + moreover have "f``(y) \ S" using func1_1_L6(2) f_is_fun + unfolding surj_def by auto + moreover from assms(1) \y\R\ have "(f``(y))\R\<^sub>t" using image_ideal_surj + by auto + ultimately have "\x\?\\<^sub>t. idealFun`(x) = y" + unfolding idealFun_def by auto } + with I have "idealFun \ surj(?\\<^sub>t,{K\\. ker \ K})" + unfolding surj_def by auto + ultimately show ?thesis unfolding bij_def by blast qed +text\Assume the homomorphism $f$ is surjective and consider the function + that maps an ideal $J$ in the target ring to its inverse image + $f^{-1}(J)$ (in the source ring). Then the value of the converse + of that function on any ideal containing the kernel of $f$ is the image + of that ideal under the homomorphism $f$. \ + theorem (in ring_homo) quot_converse: - defines "idealFun \ \J\target_ring.ideals. f-``J" - assumes "J\R" "ker\J" "f:surj(R,S)" - shows "converse(idealFun)`J = f``J" + defines "F \ \J\target_ring.ideals. f-``(J)" + assumes "J\R" "ker\J" "f\surj(R,S)" + shows "converse(F)`(J) = f``(J)" proof- - let ?g="\J\{K\\. ker\K}. f``J" - have "?g\{K\\. ker\K} \ {f``J. J\{K\\. ker\K}}" - using lam_funtype by auto moreover - have "{f``J. J\{K\\. ker\K}} \ target_ring.ideals" - using image_ideal_surj target_ring.ideal_dest_subset - assms(4) by auto - ultimately have "?g\{K\\. ker\K} \ target_ring.ideals" - using func1_1_L1B by auto - have "converse(idealFun)\bij({K\\. ker\K}, target_ring.ideals)" - using bij_converse_bij ideal_quot_bijection assms(4) - unfolding idealFun_def by auto - then have confun:"converse(idealFun):{K\\. ker\K} \ target_ring.ideals" - unfolding bij_def inj_def by auto - moreover have J:"J\{K\\. ker\K}" using assms(2,3) - origin_ring.ideal_dest_subset by auto - ultimately have ideal:"converse(idealFun)`J \ target_ring.ideals" - using apply_type[of "converse(idealFun)" "{K\\. ker\K}" "\q. target_ring.ideals" J] - by auto - then have "?g`(idealFun`(converse(idealFun)`J)) = ?g`(f-``(converse(idealFun)`J))" - using beta unfolding idealFun_def - by auto moreover - from preimage_ideal ideal - have "(f-``(converse(idealFun)`J))\R" "ker \ (f-``(converse(idealFun)`J))" by auto - then have "?g`(f-``(converse(idealFun)`J)) = f``(f-``(converse(idealFun)`J))" - using beta origin_ring.ideal_dest_subset by auto - ultimately have "?g`(idealFun`(converse(idealFun)`J)) = f``(f-``(converse(idealFun)`J))" + let ?g="\J\{K\\. ker\K}. f``(J)" + let ?\\<^sub>t = "target_ring.ideals" + let ?C\<^sub>F = "converse(F)" + from assms(1,4) have "?C\<^sub>F \ bij({K\\. ker\K}, ?\\<^sub>t)" + using bij_converse_bij ideal_quot_bijection by auto - then have "?g`(idealFun`(converse(idealFun)`J)) = converse(idealFun)`J" - using surj_image_vimage assms(4) ideal by auto - then have "?g`J = converse(idealFun)`J" - using right_inverse_lemma[of idealFun target_ring.ideals - "{K \ \ . ker \ K}" "{K \ \ . ker \ K}" J ] J - confun bij_is_fun[OF ideal_quot_bijection] assms(4) - unfolding idealFun_def by auto - then show ?thesis using beta J by auto + then have I: "?C\<^sub>F:{K\\. ker\K} \ ?\\<^sub>t" + unfolding bij_def inj_def by auto + moreover from assms(2,3) have J: "J \ {K\\. ker\K}" + using origin_ring.ideal_dest_subset by auto + ultimately have ideal: "?C\<^sub>F`(J) \ ?\\<^sub>t" + using apply_funtype by blast + with assms(1,4) ideal have "?g`(F`(?C\<^sub>F`(J))) = ?C\<^sub>F`(J)" + using preimage_ideal origin_ring.ideal_dest_subset + surj_image_vimage by auto + moreover + from assms(1) have "F: ?\\<^sub>t \ {f-``(J). J\?\\<^sub>t}" + using lam_funtype by simp + with I J have "F`(?C\<^sub>F`(J)) = J" + using right_inverse_lemma by simp + ultimately have "?g`(J) = ?C\<^sub>F`(J)" by simp + with J show ?thesis by simp qed text\Since the map is surjective, this bijection -restricts to prime ideals on both sides.\ + restricts to prime ideals on both sides.\ corollary (in ring_homo) prime_ideal_quot_3: - assumes "K\R\<^sub>t" "f:surj(R,S)" - shows "K\\<^sub>pR\<^sub>t \ ((f-``K)\\<^sub>pR\<^sub>o)" + assumes "K\R\<^sub>t" "f \ surj(R,S)" + shows "K\\<^sub>pR\<^sub>t \ ((f-``(K))\\<^sub>pR)" proof - { - assume as:"K\\<^sub>pR\<^sub>t" - then have "(f-``K)\\<^sub>pR\<^sub>o" using preimage_prime_ideal_surj - assms(2) by auto - then show "(f-``K)\\<^sub>pR\<^sub>o" - using beta[of K target_ring.ideals] - using target_ring.ideal_dest_subset[of K] as + { assume "K\\<^sub>pR\<^sub>t" + with assms(2) show "(f-``(K))\\<^sub>pR" + using preimage_prime_ideal_surj target_ring.ideal_dest_subset unfolding target_ring.primeIdeal_def by auto - } moreover - { - assume as:"(f-``K)\\<^sub>pR\<^sub>o" - from assms(1) have "K\R\<^sub>t". moreover - { - assume "K=S" - then have "f-``K = f-``S" by auto - then have "f-``K = R" using func1_1_L4 - assms(2) unfolding surj_def by auto - with as have False unfolding origin_ring.primeIdeal_def by auto - } - then have "K\S" by auto moreover - { - fix J P assume jp:"J\target_ring.ideals" + } + { assume "(f-``(K))\\<^sub>pR" + with assms(1,2) have "K\R\<^sub>t" and "K\S" + using func1_1_L4 unfolding origin_ring.primeIdeal_def surj_def + by auto + moreover + { fix J P assume jp: "J\target_ring.ideals" "P\target_ring.ideals" "target_ring.productIdeal(J, P) \ K" - have sub:"((f -`` J) \\<^sub>I (f -`` P)) \ ker \ R" - using origin_ring.ideal_dest_subset - origin_ring.product_in_intersection(2) - preimage_ideal target_ring.zero_ideal - jp by auto - from jp(3) have "f -``target_ring.productIdeal(J, P) \ f -``K" + from jp(3) have "f-``(target_ring.productIdeal(J, P)) \ f-``(K)" by auto - with jp(1,2) have A:"((f -`` J) \\<^sub>I (f -`` P)) +\<^sub>I (ker) \ f -``K" - using prime_ideal_quot assms(2) - by auto moreover - have j:"J\R\<^sub>t" and p:"P\R\<^sub>t" using jp(1,2) by auto - then have "(f -`` J) \\<^sub>I (f -`` P) \ ker \ R" - using origin_ring.ideal_dest_subset[OF origin_ring.product_in_intersection(2) - [OF preimage_ideal(1) preimage_ideal(1)]] - origin_ring.ideal_dest_subset[OF preimage_ideal(1)[OF target_ring.zero_ideal]] - by auto - with A have "((f -`` J) \\<^sub>I (f -`` P)) \ f -``K" - unfolding origin_ring.sumIdeal_def[OF origin_ring.product_in_intersection(2) - [OF preimage_ideal(1)[OF j] preimage_ideal(1)[OF p]] - preimage_ideal(1)[OF target_ring.zero_ideal]] using - origin_ring.generated_ideal_contains_set[of "(f -`` J) \\<^sub>I (f -`` P) \ ker"] - by auto - moreover have "f -`` J \\" "f -`` P \\" - using preimage_ideal - origin_ring.ideal_dest_subset jp(1,2) by auto - ultimately have "f -`` J \ f -`` K \ f -`` P \ f -`` K" - using as unfolding origin_ring.primeIdeal_def by auto - then have "f``(f -`` J) \ f``(f -`` K) \ f``(f -`` P) \ f``(f -`` K)" + with assms(2) jp(1,2) have + A: "((f-``(J)) \\<^sub>I (f-``(P))) +\<^sub>I (ker) \ f-``(K)" + using prime_ideal_quot by auto + from jp(1,2) have + "(f-``(J))\\<^sub>I(f-``(P)) \ ker \ ((f-``(J))\\<^sub>I(f-``(P))) +\<^sub>I (ker)" + using preimage_ideal origin_ring.product_in_intersection(2) + kernel_ideal origin_ring.comp_in_sum_ideals(3) by simp + with A have "((f -`` J) \\<^sub>I (f -`` P)) \ f-``(K)" by auto + with \(f-``(K))\\<^sub>pR\ jp(1,2) have + "f-``(J) \ f-``(K) \ f-``(P) \ f-``(K)" + using preimage_ideal origin_ring.ideal_dest_subset + unfolding origin_ring.primeIdeal_def by auto + then have + "f``(f-``(J)) \ f``(f-``(K)) \ f``(f-``(P)) \ f``(f-``(K))" by blast - then have "J \ K \ P \ K" using assms(2) - surj_image_vimage jp(1,2) assms target_ring.ideal_dest_subset + with assms jp(1,2) have "J \ K \ P \ K" + using surj_image_vimage target_ring.ideal_dest_subset by auto } ultimately show "K\\<^sub>pR\<^sub>t" @@ -1056,67 +975,61 @@ proof } qed +text\If the homomorphism is surjective then the function + that maps ideals in the target ring to their inverse images (in the source ring) + is a bijection between prime ideals in the target ring and the prime ideals + containing the kernel in the source ring. \ + corollary (in ring_homo) bij_prime_ideals: - defines "idealFun \ \J\target_ring.ideals. f-``J" - assumes "f:surj(R,S)" - shows "restrict(idealFun,{J\Pow(S). J\\<^sub>pR\<^sub>t})\bij({J\Pow(S). J\\<^sub>pR\<^sub>t}, {J\Pow(R). ker\J \ (J\\<^sub>pR)})" -proof- - have "{J\Pow(S). J\\<^sub>pR\<^sub>t} \ target_ring.ideals" + defines "F \ \J\target_ring.ideals. f-``(J)" + assumes "f \ surj(R,S)" + shows "restrict(F,{J\Pow(S). J\\<^sub>pR\<^sub>t}) \ + bij({J\Pow(S). J\\<^sub>pR\<^sub>t}, {J\Pow(R). ker\J \ (J\\<^sub>pR)})" +proof - + let ?\\<^sub>t = "target_ring.ideals" + from assms have I: "F:?\\<^sub>t \ {K\\. ker \ K}" + using ideal_quot_bijection bij_is_fun by simp + have II: "{J\Pow(S). J\\<^sub>pR\<^sub>t} \ ?\\<^sub>t" unfolding target_ring.primeIdeal_def by auto - then have rest_bij:"restrict(idealFun,{J\Pow(S). J\\<^sub>pR\<^sub>t})\bij({J\Pow(S). J\\<^sub>pR\<^sub>t}, idealFun``{J\Pow(S). J\\<^sub>pR\<^sub>t})" - using restrict_bij assms(2) - ideal_quot_bijection unfolding bij_def - idealFun_def by auto - { - fix t assume t:"t\idealFun``{J\Pow(S). J\\<^sub>pR\<^sub>t}" - have sub:"{J\Pow(S). J\\<^sub>pR\<^sub>t} \ target_ring.ideals" - unfolding target_ring.primeIdeal_def by auto - from t obtain q where q:"q\{J\Pow(S). J\\<^sub>pR\<^sub>t}" "t=idealFun`q" - using assms(2) func_imagedef[OF bij_is_fun[OF ideal_quot_bijection] sub] - unfolding idealFun_def by auto - note q(1) moreover - then have "q\target_ring.ideals" unfolding - target_ring.primeIdeal_def by auto moreover - with q(2) have "t = f-``q" "ker\t" "t\R" unfolding idealFun_def - using beta - apply_type[OF ideal_quot_bijection[THEN bij_is_fun], of q] assms(2) by auto - ultimately have "t\R" "t\\<^sub>pR" "ker\t" using assms(2) prime_ideal_quot_3 - by auto - } - then have "idealFun `` Collect(Pow(S), prime_ideal_target) \ {t\Pow(R). ker\t \ (t\\<^sub>pR)}" - using origin_ring.ideal_dest_subset by blast moreover - { - fix t assume "t\{t\Pow(R). ker\t \ (t\\<^sub>pR)}" - then have t:"t\Pow(R)" "ker\t" "t\\<^sub>pR" by auto - then have tSet:"t\{t\\. ker \ t}" unfolding origin_ring.primeIdeal_def by auto - have "converse(idealFun)\bij({t\\. ker \ t}, target_ring.ideals)" - using ideal_quot_bijection[OF assms(2)] bij_converse_bij unfolding idealFun_def - by auto - with tSet have cont:"converse(idealFun)`t \ target_ring.ideals" - using apply_type[OF bij_is_fun] by blast moreover - from tSet have eq:"idealFun`(converse(idealFun)`t) = t" - using ideal_quot_bijection assms(2) unfolding idealFun_def - using right_inverse_bij by blast - ultimately have "f-``(converse(idealFun)`t) = t" - using beta unfolding idealFun_def by auto - with t(3) have "(converse(idealFun)`t) \\<^sub>pR\<^sub>t" - using prime_ideal_quot_3 cont assms(2) by auto - then have "(converse(idealFun)`t) \\<^sub>pR\<^sub>t" "(converse(idealFun)`t) \ S" - unfolding target_ring.primeIdeal_def - using target_ring.ideal_dest_subset by auto - then have elem:"converse(idealFun)`t\{q\Pow(S). q\\<^sub>pR\<^sub>t}" - by auto - have sub:"{q\Pow(S). q\\<^sub>pR\<^sub>t} \ target_ring.ideals" - unfolding target_ring.primeIdeal_def by auto - have "t\idealFun``Collect(Pow(S), prime_ideal_target)" - using assms(2) func_imagedef[OF ideal_quot_bijection[THEN bij_is_fun] sub] unfolding idealFun_def - using eq elem unfolding idealFun_def by auto - } - then have "{t\Pow(R). ker\t \ (t\\<^sub>pR)} \ idealFun``Collect(Pow(S), prime_ideal_target)" by auto - ultimately - have "{t\Pow(R). ker\t \ (t\\<^sub>pR)} = idealFun``Collect(Pow(S), prime_ideal_target)" + have III: "{J\Pow(S). J\\<^sub>pR\<^sub>t} \ ?\\<^sub>t" + unfolding target_ring.primeIdeal_def by auto + with assms have "restrict(F,{J\Pow(S). J\\<^sub>pR\<^sub>t}) \ + bij({J\Pow(S). J\\<^sub>pR\<^sub>t}, F``{J\Pow(S). J\\<^sub>pR\<^sub>t})" + using restrict_bij ideal_quot_bijection unfolding bij_def by auto - with rest_bij show ?thesis by auto + moreover have "{t\Pow(R). ker\t \ (t\\<^sub>pR)} = F``{J\Pow(S). J\\<^sub>pR\<^sub>t}" + proof + { fix t assume "t \ F``{J\Pow(S). J\\<^sub>pR\<^sub>t}" + with I III obtain q where "q\Pow(S)" "q\\<^sub>pR\<^sub>t" "t=F`(q)" + using func_imagedef by auto + from \q\Pow(S)\ \q\\<^sub>pR\<^sub>t\ have "q\?\\<^sub>t" + unfolding target_ring.primeIdeal_def by auto + with I have "F`(q) \ {K\\. ker \ K}" using apply_funtype + by blast + with assms \q\\<^sub>pR\<^sub>t\ \t=F`(q)\ \q\?\\<^sub>t\ \t=F`(q)\ have + "t\R" "t\\<^sub>pR" "ker\t" + using prime_ideal_quot_3 by simp_all + } then show "F``{J\Pow(S). J\\<^sub>pR\<^sub>t} \ {t\Pow(R). ker\t \ (t\\<^sub>pR)}" + using origin_ring.ideal_dest_subset by blast + { fix t assume "t\{t\Pow(R). ker\t \ (t\\<^sub>pR)}" + then have "t\Pow(R)" "ker\t" "t\\<^sub>pR" by auto + then have tSet: "t \ {t\\. ker \ t}" + unfolding origin_ring.primeIdeal_def by auto + with assms have cont: "converse(F)`(t) \ ?\\<^sub>t" + using ideal_quot_bijection bij_converse_bij + apply_funtype bij_is_fun by blast + moreover from assms tSet have "F`(converse(F)`(t)) = t" + using ideal_quot_bijection right_inverse_bij by blast + ultimately have "f-``(converse(F)`(t)) = t" + using assms(1) by simp + with assms II tSet \t\\<^sub>pR\ cont have "t \ F``{J\Pow(S). J\\<^sub>pR\<^sub>t}" + using prime_ideal_quot_3 target_ring.ideal_dest_subset + bij_val_image_vimage ideal_quot_bijection + unfolding target_ring.primeIdeal_def by auto + } thus "{t\Pow(R). ker\t \ (t\\<^sub>pR)} \ F``{J\Pow(S). J\\<^sub>pR\<^sub>t}" + by auto + qed + ultimately show ?thesis by auto qed end \ No newline at end of file diff --git a/IsarMathLib/Ring_Zariski_ZF_3.thy b/IsarMathLib/Ring_Zariski_ZF_3.thy index 3c221fe..58fa680 100644 --- a/IsarMathLib/Ring_Zariski_ZF_3.thy +++ b/IsarMathLib/Ring_Zariski_ZF_3.thy @@ -320,8 +320,8 @@ proof assms(2) by auto with t have p:"t\origin_ring.Spec" "\(f-``I \ t)" using origin_ring.openBasic_def by auto - from t(2) have kt:"ker \ t" using origin_ring.closeBasic_def[OF - func1_1_L3[OF fun]] by auto + from t(2) have kt:"ker \ t" using origin_ring.closeBasic_def + func1_1_L3 f_is_fun by auto { fix x assume "x\f-``(f``t)" then have t:"f`x\f``t" "x\R" using func1_1_L15 @@ -383,11 +383,10 @@ proof spectrum_surj_bij[OF assms(2)]],of U] unfolding g_def by blast moreover - have "D(f -`` I) \\\<^sub>o" unfolding top_origin_def - using preimage_ideal(1)[OF I(1)] - origin_ring.ideal_dest_subset by auto - then have "V(ker)\D(f -`` I) \ {V(ker) \ A . A \ \\<^sub>o}" - by auto + from I(1) have "(f-``(I)) \R" and "(f-``(I)) \ R" + using preimage_ideal(2) origin_ring.ideal_dest_subset by simp_all + then have "V(ker)\D(f-``(I)) \ {V(ker) \ A . A \ \\<^sub>o}" + unfolding top_origin_def by auto ultimately show "g``U: \\<^sub>o{restricted to}V(ker)" unfolding RestrictedTo_def by auto qed @@ -406,8 +405,8 @@ proof- top_origin_def RestrictedTo_def using origin_ring.total_spec by auto then have "\(\\<^sub>o{restricted to}V(ker)) = V(ker)" - using origin_ring.closeBasic_def[OF func1_1_L3[OF fun, - of "{\\<^sub>S}"]] by auto moreover + using origin_ring.closeBasic_def func1_1_L3 f_is_fun + by auto moreover have "\\\<^sub>t = target_ring.Spec" unfolding top_target_def using target_ring.total_spec by auto ultimately show ?thesis using bij_cont_open_homeo[of g \\<^sub>t "\\<^sub>o{restricted to}V(ker)"] diff --git a/IsarMathLib/func1.thy b/IsarMathLib/func1.thy index ee97f2b..af3bfda 100644 --- a/IsarMathLib/func1.thy +++ b/IsarMathLib/func1.thy @@ -560,7 +560,7 @@ lemma func1_1_L13A: assumes A1: "f``(A)\0" shows "A\0" text\What is the inverse image of a singleton?\ -lemma func1_1_L14: assumes "f\X\Y" +lemma func1_1_L14: assumes "f:X\Y" shows "f-``({y}) = {x\X. f`(x) = y}" using assms func1_1_L6A vimage_singleton_iff apply_iff by auto @@ -652,6 +652,14 @@ proof qed qed +text\If all elements of a nonempty set map to the same element of the codomain, + then the image of this set is a singleton.\ + +lemma image_constant_singleton: + assumes "f:X\Y" "A\X" "A\0" "\x\A. f`(x) = c" + shows "f``(A) = {c}" + using assms func_imagedef by auto + text\A technical lemma about graphs of functions: if we have two disjoint sets $A$ and $B$ then the cartesian product of the inverse image of $A$ and $B$ is disjoint with (the graph of) $f$.\ @@ -879,8 +887,7 @@ proof - qed text\A composition of functions is a function. This is a slight - generalization of standard Isabelle's \comp_fun\ -\ + generalization of standard Isabelle's \comp_fun\. \ lemma comp_fun_subset: assumes A1: "g:A\B" and A2: "f:C\D" and A3: "B \ C" @@ -1290,6 +1297,28 @@ proof - using func1_1_L5A right_inverse by auto qed +text\For a bijection between $Y$ and $X$ and a set $A\subseteq X$ + an element $y\in Y$ is in the image $f(A)$ if and only if $f^{-1}(y)$ + is an element of $A$. Note this is false with the weakened assumption that + $f$ is an injection, for example consider $f:\{ 0,1\}\rightarrow \mathbb{N}, f(n)= n+1$ + and $y=3$. Then $f^{-1}:\{1, 2\}\rightarrow \{ 0,1\}$ and (since $3$ is not in the domain + of the inverse function) $f^{-1}(3) = \emptyset = 0 \in {0,1}$, but $3$ is not in the + image $f(\{ 0,1\})$. \ + +lemma bij_val_image_vimage: assumes "f \ bij(X,Y)" "A\X" "y\Y" + shows "y\f``(A) \ converse(f)`(y) \ A" +proof + assume "y\f``(A)" + with assms(1,2) show "converse(f)`(y) \ A" + unfolding bij_def using inj_inv_back_in_set by blast +next + assume "converse(f)`(y) \ A" + with assms(1,3) have "y\{f`(x). x\A}" using right_inverse_bij + by force + with assms(1,2) show "y\f``(A)" using bij_is_fun func_imagedef + by force +qed + text\For injections if a value at a point belongs to the image of a set, then the point belongs to the set.\