Theory Ring_ZF_3

(*
    This file is a part of IsarMathLib - 
    a library of formalized mathematics for Isabelle/Isar.

    Copyright (C) 2022  Daniel de la Concepcion

    This program is free software; Redistribution and use in source and binary forms, 
    with or without modification, are permitted provided that the following conditions are met:

   1. Redistributions of source code must retain the above copyright notice, 
   this list of conditions and the following disclaimer.
   2. Redistributions in binary form must reproduce the above copyright notice, 
   this list of conditions and the following disclaimer in the documentation and/or 
   other materials provided with the distribution.
   3. The name of the author may not be used to endorse or promote products 
   derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

*)

section Rings - Ideals of quotient rings

theory Ring_ZF_3 imports Ring_ZF_2 Group_ZF_5

begin

textThis section studies the ideals of quotient rings,
  and defines ring homomorphisms.

subsectionRing homomorphisms

textMorphisms in general are structure preserving functions between algebraic
  structures. In this section we study ring homomorphisms.

textA ring homomorphism is a function between rings 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(f,R,A,M,S,U,V)  f:RS  IsMorphism(R,A,U,f)  IsMorphism(R,M,V,f) 
   f`(TheNeutralElement(R,M)) = TheNeutralElement(S,V)"

textThe 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 homomorphism: "ringHomomor(f,R,A,M,S,U,V)"

  fixes ringa (infixl "\<ra>R" 90)
  defines ringa_def [simp]: "x\<ra>Ry  A`x,y"

  fixes ringminus ("\<rm>R _" 89)
  defines ringminus_def [simp]: "(\<rm>Rx)  GroupInv(R,A)`(x)"

  fixes ringsub (infixl "\<rs>R" 90)
  defines ringsub_def [simp]: "x\<rs>Ry  x\<ra>R(\<rm>Ry)"

  fixes ringm (infixl "R" 95)
  defines ringm_def [simp]: "xRy  M`x,y"

  fixes ringzero ("𝟬R")
  defines ringzero_def [simp]: "𝟬R  TheNeutralElement(R,A)"

  fixes ringone ("𝟭R")
  defines ringone_def [simp]: "𝟭R  TheNeutralElement(R,M)"

  fixes ringtwo ("𝟮R")
  defines ringtwo_def [simp]: "𝟮R  𝟭R\<ra>R𝟭R"

  fixes ringsq ("_2R" [96] 97)
  defines ringsq_def [simp]: "x2R  xRx"

  fixes ringas (infixl "\<ra>S" 90)
  defines ringas_def [simp]: "x\<ra>Sb  U`x,b"

  fixes ringminuss ("\<rm>S _" 89)
  defines ringminuss_def [simp]: "(\<rm>Sx)  GroupInv(S,U)`(x)"

  fixes ringsubs (infixl "\<rs>S" 90)
  defines ringsubs_def [simp]: "x\<rs>Sb  x\<ra>S(\<rm>Sb)"

  fixes ringms (infixl "S" 95)
  defines ringms_def [simp]: "xSb  V` x,b"

  fixes ringzeros ("𝟬S")
  defines ringzeros_def [simp]: "𝟬S  TheNeutralElement(S,U)"

  fixes ringones ("𝟭S")
  defines ringones_def [simp]: "𝟭S  TheNeutralElement(S,V)"

  fixes ringtwos ("𝟮S")
  defines ringtwos_def [simp]: "𝟮S  𝟭S\<ra>S𝟭S"

  fixes ringsqs ("_2S" [96] 97)
  defines ringsqs_def [simp]: "x2S  xSx"

textWe will write I◃Ro to denote that $I$ is an ideal
  of the ring $R$. Note that in this notation the Ro part by itself has no meaning,
  only the whole ◃Ro serves as postfix operator. 

abbreviation (in ring_homo) ideal_origin ("_◃Ro")
  where "I◃Ro  ring0.Ideal(R,A,M,I)"

textI◃Rt means that $I$ is an ideal of $S$.

abbreviation (in ring_homo) ideal_target ("_◃Rt")
  where "I◃Rt  ring0.Ideal(S,U,V,I)"

text I◃pRo means that $I$ is a prime ideal of $R$.

abbreviation (in ring_homo) prime_ideal_origin ("_pRo")
  where "IpRo  ring0.primeIdeal(R,A,M,I)"

textWe will write I◃pRt to denote that $I$ is a prime ideal of the ring $S$. 

abbreviation (in ring_homo) prime_ideal_target ("_pRt")
  where "IpRt  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-``{𝟬S}"

textThe 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

textThe 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

textA 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

textSince 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:RS"
  using homomorphism unfolding ringHomomor_def by simp

textIn 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×RR" "M:R×RR" "U:S×SS" "V:S×SS"
  using origin target 
  unfolding IsAring_def IsAgroup_def IsAmonoid_def IsAssociative_def
  by auto

textThe 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 = {rR. f`(r) = 𝟬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 "xker"
  shows "f`(x) = 𝟬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 "xR" "yR"
  shows "f`(xRy) = (f`(x))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 "xR" "yR"
  shows "f`(x\<ra>Ry) = (f`(x))\<ra>S(f`(y))"
  using homomor_eq origin target homomorphism assms
  unfolding IsAring_def ringHomomor_def IsMorphism_def
  by simp

textFor $x\in R$ the value of $f$ is in $S$.

lemma (in ring_homo) homomor_val: assumes "xR"
  shows "f`(x)  S" 
  using homomorphism assms apply_funtype unfolding ringHomomor_def 
  by blast

textA ring homomorphism preserves taking negative of an element.

lemma (in ring_homo) homomor_dest_minus:
  assumes "xR"
  shows "f`(\<rm>Rx) = \<rm>S(f`(x))"
  using origin target homomorphism assms ringHomHom image_inv
  unfolding IsAring_def by auto

textA ring homomorphism preserves substraction. 

lemma (in ring_homo) homomor_dest_subs:
  assumes "xR" "yR"
  shows "f`(x\<rs>Ry) = (f`(x))\<rs>S(f`(y))"
  using assms homomor_dest_add homomor_dest_minus
  using origin_ring.Ring_ZF_1_L3(1) by auto

textA ring homomorphism maps zero to zero.

lemma (in ring_homo) homomor_dest_zero:
  shows "f`(𝟬R) = 𝟬S"
  using origin target homomorphism ringHomHom(1) image_neutral
  unfolding IsAring_def by auto

textThe kernel of a homomorphism is never empty.

lemma (in ring_homo) kernel_non_empty: 
  shows "𝟬R ker" and "ker0"
  using homomor_dest_zero origin_ring.Ring_ZF_1_L2(1)
    func1_1_L15 f_is_fun by auto

textThe image of the kernel by $f$ is the singleton $\{ 0_R\}$.

corollary (in ring_homo) image_kernel_2: shows "f``(ker) = {𝟬S}"
proof -
  have "f:RS" "kerR" "ker0" "xker. f`(x) = 𝟬S"
    using f_is_fun kernel_def_alt kernel_non_empty by auto
  then show  "f``(ker) = {𝟬S}" using image_constant_singleton
    by simp
qed

textThe 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◃Rt"
  shows
    "IsAnormalSubgroup(R,A,f-``(J))"
    "(f-``(J))◃Ro" "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)" "yR"
    from homomorphism have "f:RS"
      unfolding ringHomomor_def by simp
    with x  f-``(J) have "xR" and "f`(x)  J"
      using func1_1_L15 unfolding ringHomomor_def
      by simp_all
    with assms yR f:RS 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 xR yR have "f`(M`x,y)  J" and "f`(M`y,x)  J"
      using homomor_dest_mult by auto
    with xR yR f:RS 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))◃Ro" using origin_ring.Ideal_def 
    by auto
  from assms show "ker  f-``(J)" using target_ring.ideal_dest_zero
    by auto
qed

textKernel of the homomorphism in an ideal.

lemma (in ring_homo) kernel_ideal: shows "ker ◃Ro"
  using target_ring.zero_ideal preimage_ideal(2) by simp

textThe 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 "JpRt" shows "f-``(J)  R"
proof -
  { assume "R = f-``(J)"
    then have "R = {xR. f`(x)J}" using f_is_fun func1_1_L15 
      by simp
    then have "𝟭R  {xR. 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

textEven more, if the target ring of the homomorphism is commutative
  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 "JpRt" "V {is commutative on} S"
  shows "(f-``(J))pRo" 
proof -
  have "xR. yR. (zR. xRzRy  f-``(J))  xf-``(J)  yf-``( J)"
  proof -
    { fix x y assume "xR" "yR" and as: "zR. xRzRy  f-``(J)" 
        and "y  f-``(J)"
      { fix s assume "sS"
        with assms(2) xR yR have 
          "(f`(x))SsS(f`(y)) = sS((f`(x))S(f`(y)))"
          using f_is_fun apply_funtype target_ring.Ring_ZF_1_L11(2)
          unfolding IsCommutative_def by auto
        with xR yR have "(f`x)SsS(f`y) = sS(f`(xRy))"
          using homomor_dest_mult by simp
        with assms(1) sS xR as have "(f`(x))SsS(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 "zS. (f`x) S z S (f`y)  J" by simp
      with assms(1) xR yR  have "f`(x) J  f`(y)J" 
        using target_ring.equivalent_prime_ideal f_is_fun apply_funtype 
          by simp
      with xR yR y  f-``(J) have "xf-``(J)"
        using func1_1_L15 f_is_fun by simp
    } thus ?thesis by blast
  qed
  moreover from assms have "(f-``J)◃Ro" 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))pRo" 
    by (rule origin_ring.equivalent_prime_ideal_2)
qed

textWe 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 "JpRt" "f  surj(R,S)"
  shows "(f-``(J))pRo" 
proof -
  have "xR. yR. (zR. xRzRy  f-``(J))  xf-``(J)  yf-``(J)"
  proof -
    { fix x y assume "xR" "yR" and as: "zR. xRzRy  f-``(J)" 
        and "y  f-``(J)"
      { fix s assume s: "sS"
        with assms(2) obtain t where "s=f`(t)" "tR"
          unfolding surj_def by auto
        with xR yR as have "(f`x)SsS(f`y)J"
          using homomor_dest_mult origin_ring.Ring_ZF_1_L4(3) 
            func1_1_L15 f_is_fun by simp
      } hence "zS. (f`(x)) S z S (f`(y))  J" by simp
      with target_ring.equivalent_prime_ideal assms(1) xR yR
      have "f`(x)Jf`(y)J" using f_is_fun apply_funtype 
        by auto
      with xR yR y  f-``(J) have "xf-``(J)" 
        using func1_1_L15 f_is_fun by auto
    } thus ?thesis by blast
  qed
  moreover from assms have "(f-``(J))◃Ro" 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))pRo" 
    by (rule origin_ring.equivalent_prime_ideal_2)
qed

subsectionQuotient ring with quotient map

textThe 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. 

textThe 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"

  fixes quot ("RI")
  defines quot_def [simp]: "RI  QuotientBy(I)"

  fixes qrel ("rI")
  defines qrel_def [simp]: "rI  QuotientGroupRel(R,A,I)"

  fixes qfun ("fI")
  defines qfun_def [simp]: "fI  λrR. rI``{r}"

  fixes qadd ("AI")
  defines qadd_def [simp]: "AI  QuotientGroupOp(R, A, I)"

  fixes qmul ("MI")
  defines qmul_def [simp]: "MI  ProjFun2(R, qrel, M)"

textThe expression J◃RI will mean that $J$ is an ideal of the quotient ring $R_I$
  (with the quotient addition and multiplication).

abbreviation (in ring2) qideal ("_◃RI") where
  "J◃RI  ring0.Ideal(RI,AI,MI,J)"

textIn the ring2› The expression J◃pRI means that $J$ is a prime ideal of the quotient 
  ring $R_I$. 

abbreviation (in ring2) qprimeIdeal ("_pRI") where
  "JpRI  ring0.primeIdeal(RI,AI,MI,J)"

textTheorems 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)"
  "𝟬⇩I" "𝟭⇩I" "𝟮⇩I" "λx. (x2I)" 
  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

textThe 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 "ringHomomor(fI,R,A,M,RI,AI,MI)"
  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 
      ideal_equiv_rel quotientBy_mul_monoid(1) QuotientBy_def
  unfolding IsAring_def Homomor_def IsMorphism_def ringHomomor_def
  by simp

textThe quotient map is surjective

lemma (in ring2) quot_fun:
  shows "fIsurj(R,RI)" 
  using lam_funtype idealAssum QuotientBy_def 
  unfolding quotient_def surj_def by auto

textThe 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)"
  "𝟬⇩I" "𝟭⇩I" "𝟮⇩I" "λx. (x2I)"
  using ringAssum quotient_ring.ringAssum quotient_fun_homomor
  unfolding ring_homo_def by simp_all

textThe ideal we divide by is the kernel of the quotient map.

lemma (in ring2) quotient_kernel: 
  shows "quot_homomorphism.kernel = I"
proof
  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 "tI"
    then have "tR" using ideal_dest_subset idealAssum by auto
    with idealAssum tI have "t  fI-``{𝟬⇩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

textThe 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)"
  "𝟬⇩I" "𝟭⇩I" "𝟮⇩I" "λx. (x2I)" 
  using idealAssum quotientBy_is_ring neutral_quotient
    one_quotient two_quotient 
  unfolding ring0_def by simp_all

textIf 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+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+II) = f``(J)" "f``(I+IJ) = f``(J)"
proof-
  from assms(1,3) have "J+II  R" 
    using origin_ring.sum_ideals_is_ideal 
      origin_ring.ideal_dest_subset by auto
  show "f``(J+II) = f``(J)"
  proof
    { fix t assume "tf``(J+II)"
      with J+II  R obtain q where q: "q  J+II" "t=f`(q)"
        using func_imagedef f_is_fun by auto
      with assms(1,3) q  J+II have "qA``(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). pJ×I}"
        unfolding IsAgroup_def IsAmonoid_def IsAssociative_def
        using func_imagedef by auto
      with qA``(J×I) obtain qj qi where "qjJ" "qiI" "q=qj\<ra>Rqi" 
        by auto
      with assms have "f`(q) = (f`(qj)) \<ra>S 𝟬S"
        using homomor_dest_add origin_ring.ideal_dest_subset image_kernel
        by blast
      moreover from assms(1) qjJ have "f`(qj)  S"
        using origin_ring.ideal_dest_subset f_is_fun apply_funtype by blast
      ultimately have "f`(q) = f`(qj)" using target_ring.Ring_ZF_1_L3(3) 
        by auto    
      with assms t=f`(q) qjJ have "t  f``(J)"
        using func_imagedef f_is_fun origin_ring.ideal_dest_subset by auto    
    } thus "f``(J+II)  f``(J)" by blast
    { fix t assume "tf``(J)"
      with assms(1) obtain q where q:"qJ" "t=f`(q)"
        using func_imagedef f_is_fun origin_ring.ideal_dest_subset 
        by auto
      from qJ have "qJI" by auto 
      moreover from assms(1,3) have "JI  R" 
        using origin_ring.ideal_dest_subset by auto
      ultimately have "qJII" using origin_ring.generated_ideal_contains_set 
        by auto
      with assms(1,3) J+II  R t=f`(q) have "tf``(J+II)"
        using origin_ring.sumIdeal_def f_is_fun func_imagedef by auto
    } thus "f``(J)  f``(J+II)" by auto
  qed
  with assms(1,3) show "f ``(I+IJ) = f``(J)"
    using origin_ring.sum_ideals_commute by auto
qed

subsectionQuotient ideals

textIf 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$.

textThe preimage of an ideal is an ideal, so it applies to the
  quotient map; but the preimage ideal contains the quotient ideal.

lemma (in ring2) ideal_quot_preimage:
  assumes "J◃RI"
  shows "(fI-``(J)) ◃R" "I  fI-``(J)"
proof -
  from assms quot_homomorphism.preimage_ideal show "(fI-``(J)) ◃R" 
    by simp
  { fix x assume x: "xI"
    with idealAssum have "xR" using ideal_dest_subset by auto
    from assms xI have "fI`(x)  J"
      using quotient_kernel quot_homomorphism.image_kernel 
        quotient_ring.ideal_dest_zero by simp
    with xR have "xfI-``(J)" using quot_homomorphism.f_is_fun func1_1_L15 
      by simp
  } thus "I  fI-``(J)" by auto
qed

textSince the map is surjective, the image is also an ideal

lemma (in ring_homo) image_ideal_surj:
  assumes "J◃Ro" "fsurj(R,S)"
  shows "(f``(J)) ◃Rt" 
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 "xf``(J)" "yS"
    from assms(1) xf``(J) obtain j where "x=f`(j)" "jJ" 
      using func_imagedef f_is_fun origin_ring.ideal_dest_subset 
      by auto
    from assms yS jJ have "jR" and "yf``(R)"
      using origin_ring.ideal_dest_subset surj_range_image_domain
      by auto
    with assms(1) obtain s where "y=f`(s)" "sR" 
      using func_imagedef origin_ring.ideal_dest_subset f_is_fun 
      by auto
    with assms(1) jR x=f`(j) xf``(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) jJ sR have "(xSy)f``(J)" and "(ySx)f``J"
      using origin_ring.ideal_dest_mult func_imagedef f_is_fun 
        origin_ring.ideal_dest_subset by auto
  } hence "xf``(J). yS. (ySx)  f``(J)  (xSy)  f``(J)"
    by auto
  ultimately show ?thesis unfolding target_ring.Ideal_def by simp
qed
  
textIf 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◃Rt" "K◃Rt" "fsurj(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-``{𝟬S})"
  let ?Q = "target_ring.productIdeal(J, K)"
  from assms(1,2) have ideals: "(f-``(J)) ◃Ro" "(f-``(K)) ◃Ro"
    using preimage_ideal by auto
  then have idealJK: "((f-``(J))I(f-``(K))) ◃Ro"
    using origin_ring.product_in_intersection(2) by auto
  then have "?P ◃Ro" and "?PR" 
    using kernel_ideal origin_ring.sum_ideals_is_ideal 
      origin_ring.ideal_dest_subset by simp_all
  with assms(3) have  "(f``(?P)) ◃Rt" using  image_ideal_surj
    by simp
  let ?X = "((f-``(J)) I (f-``(K)))(f-``{𝟬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 "tV ``(J×K)"
    moreover from assms have "J×K  S×S" 
      using target_ring.ideal_dest_subset by blast 
    ultimately obtain j k where "jJ" "kK" "t=V`j,k"
      using func_imagedef AMUV_are_ops(4) by auto
    from assms(1) jJ have "jS" 
      using target_ring.ideal_dest_subset by blast
    with assms(3) obtain j0 where  "j0R" "f`(j0) = j"
      unfolding surj_def by auto
    with assms(2,3) kK obtain k0 where "k0R" "f`(k0) = k"
      using target_ring.ideal_dest_subset unfolding surj_def 
      by blast
    with t=V`j,k f`(j0) = j  j0R have "t=f`(M`j0,k0)" 
      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) j0R f`(j0) = j jJ kK k0R f`(k0) = k
      have "j0,k0  (f-``J)×(f-``K)"
      using func1_1_L15 unfolding surj_def by auto
    ultimately have "M`j0,k0  M``((f-``(J))×(f-``(K)))"
      using AMUV_are_ops func_imagedef by auto
    with ideals ?X  ?P have "M`j0,k0  ?P"
      using origin_ring.product_in_intersection(3) 
      by blast
    with ?PR t=f`(M`j0,k0) 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)) ◃Rt have "?Qf``(?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 ◃Ro ?PR have P_ideal: "?P  {N. f-``{𝟬S}  N}" 
    by auto
  { fix t assume "tf-``(f``(?P))"
    then have "f`(t)  f``(?P)" and "tR" 
      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 "sR" by blast
    from tR sR f`(t) = f`(s) have "f`(t\<rs>Rs) = 𝟬S"
      using f_is_fun apply_funtype target_ring.Ring_ZF_1_L3(7) 
        homomor_dest_subs by simp
    with tR sR ?X?P have "t\<rs>Rs  ?P"
      using origin_ring.Ring_ZF_1_L4(2) func1_1_L15 f_is_fun 
      by auto
    with P_ideal s?P have "s\<ra>R(t\<rs>Rs)  ?P" 
      using origin_ring.ideal_dest_sum by auto
    with tR sR have "t?P" 
      using origin_ring.Ring_ZF_2_L1A(5) by auto
  } with R show "f-``(?Q)  ?P" 
    by auto
  { 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 tj tk where 
      jk: "t=tjRtk" "tjf-``(J)" "tkf-``(K)"
      using AMUV_are_ops(2) func_imagedef IsAssociative_def 
      by auto
    from as have "tR" using AMUV_are_ops(2) func1_1_L6(2) by blast
    from jk(2,3) have "tjR" "f`(tj)J" and "tkR" "f`(tk)K" 
      using func1_1_L15 f_is_fun by simp_all
    from jk(1) tjR tkR have ft: "f`(t) = ((f`(tj))S(f`(tk)))"
      using homomor_dest_mult by simp
    from f`(tj)J f`(tk) K have "f`(tj),f`(tk)  J×K" 
      by simp
    moreover from assms have "V:S×SS" 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 by force
    with assms ft tR 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 from assms(1,2) have 
    id: "(f-``(?Q)) ◃Ro"
    using preimage_ideal target_ring.product_in_intersection(2)
    by simp
  ultimately have "(f -`` J) I (f -`` K)f-``(?Q)"
    using ideals origin_ring.generated_ideal_small origin_ring.productIdeal_def
    by auto
  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))I(f-``(K)))+I(f-``{𝟬S})  f-``(?Q)"
    using origin_ring.generated_ideal_small kernel_ideal origin_ring.sumIdeal_def
    by simp
qed

textIf 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◃Rt" "K◃Rt" "fsurj(R,S)"
  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)) I (f-``(K))) +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

textIf 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 "JpRo" "ker  J" "fsurj(R,S)"
  shows "(f``(J))pRt"
proof -
  from assms(1) have "J  R" "J  R" 
    unfolding origin_ring.primeIdeal_def 
    using origin_ring.ideal_dest_subset by auto
  from assms(1,3) have "(f``(J))◃Rt" 
    using image_ideal_surj  unfolding origin_ring.primeIdeal_def 
    by auto 
  moreover 
  { assume "f``(J) = S"
    from J  R J  R obtain t where "tR-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: "jJ" "f`(t)= f`(j)"
      using func_imagedef f_is_fun by auto   
    from jJ J  R have "jR" by auto
    with assms(3) f`(t)= f`(j) tR-J have "t\<rs>Rjf-``{𝟬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\<ra>R(t\<rs>Rj) J"
      unfolding origin_ring.primeIdeal_def
      using origin_ring.ideal_dest_sum by auto
    with jR tR-J have False using origin_ring.Ring_ZF_2_L1A(5)
      by auto
  } hence "f``(J)  S" by auto 
  moreover
  { fix I K assume as: "Itarget_ring.ideals" "Ktarget_ring.ideals"
           "target_ring.productIdeal(I, K)  f``(J)"
    let ?A = "(f-``(I)) 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
    { fix t assume "t  f-``(f``(J))"
      then have "f`(t)f``(J)" "tR" using func1_1_L15 f_is_fun 
        by auto
      from assms(1) f`(t)f``(J) obtain s where "f`(t)=f`(s)" "sJ"
        using func_imagedef f_is_fun origin_ring.ideal_dest_subset 
        unfolding origin_ring.primeIdeal_def by auto
      from assms(1) sJ have "sR" 
        unfolding origin_ring.primeIdeal_def
        using origin_ring.ideal_dest_subset by auto
      with assms(2) f`(t)=f`(s) tR have "t\<rs>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) sJ have "s\<ra>R(t\<rs>Rs)J"
        using origin_ring.ideal_dest_sum
        unfolding origin_ring.primeIdeal_def by auto
      with sR tR have "tJ" 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) 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

textThe 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.

theorem (in ring_homo) ideal_quot_bijection:
  assumes "fsurj(R,S)"
  defines "idealFun  λJtarget_ring.ideals. f-``(J)"
  shows "idealFun  bij(target_ring.ideals,{K. ker  K})"
proof -
  let ?ℐt = "target_ring.ideals"
  have "idealFun : ?ℐt  {f-``(J). J?ℐt}"
    unfolding idealFun_def using lam_funtype by simp 
  moreover
  { fix t assume "t  {f-``(J). J?ℐt}"
    then obtain K where "K  ?ℐt" "f-``(K) = t" by auto
    then have "K◃Rt" 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?ℐt}  {K. ker  K}" by blast
  ultimately have I: "idealFun : ?ℐt  {K. ker  K}"
    using func1_1_L1B by auto
  { fix w x assume 
      as: "w◃Rt" "x◃Rt" "wS" "xS" "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
  }
  with I have "idealFun   inj(?ℐt,{K. ker  K})"
    unfolding inj_def by auto
  moreover
  { fix y assume "y◃R" "yR" "ker  y"
    from yR have "y  f-``(f``y)" using func1_1_L9 f_is_fun 
      by auto
    moreover
    { fix t assume "tf-``(f``(y))"
      then have "f`(t)  f``(y)" "tR" using func1_1_L15 f_is_fun 
        by auto
      from f`(t)  f``(y) yR obtain s where "sy" "f`(t) = f`(s)" 
        using func_imagedef f_is_fun by auto
      from sy  yR have "sR" by auto
      with tR f`(t) = f`(s) ker  y have "t\<rs>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 sy y◃R sR tR have "ty"
        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))◃Rt" using image_ideal_surj
       by auto
    ultimately have "x?ℐt. idealFun`(x) = y"
      unfolding idealFun_def by auto
  }
  with I have "idealFun  surj(?ℐt,{K. ker  K})"
    unfolding surj_def by auto
  ultimately show ?thesis unfolding bij_def by blast
qed

textAssume 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 "F  λJtarget_ring.ideals. f-``(J)"
  assumes "J◃R" "kerJ" "fsurj(R,S)"
  shows "converse(F)`(J) = f``(J)"
proof-
  let ?g = "λJ{K. kerK}. f``(J)"
  let ?ℐt = "target_ring.ideals"
  let ?CF = "converse(F)"
  from assms(1,4) have "?CF  bij({K. kerK}, ?ℐt)" 
    using bij_converse_bij ideal_quot_bijection 
    by auto
  then have I: "?CF:{K. kerK}  ?ℐt"
    unfolding bij_def inj_def by auto
  moreover from assms(2,3) have J: "J  {K. kerK}" 
    using origin_ring.ideal_dest_subset by auto
  ultimately have ideal: "?CF`(J)  ?ℐt"
    using apply_funtype by blast
  with assms(1,4) ideal have "?g`(F`(?CF`(J))) = ?CF`(J)"
    using preimage_ideal origin_ring.ideal_dest_subset
      surj_image_vimage by auto
  moreover
  from assms(1) have "F: ?ℐt  {f-``(J). J?ℐt}"
    using lam_funtype by simp
  with I J have "F`(?CF`(J)) = J"
    using right_inverse_lemma by simp
  ultimately have "?g`(J) = ?CF`(J)" by simp
  with J show ?thesis by simp
qed
  
textSince the map is surjective, this bijection
  restricts to prime ideals on both sides.

corollary (in ring_homo) prime_ideal_quot_3:
  assumes "K◃Rt" "f  surj(R,S)"
  shows "KpRt  ((f-``(K))pR)"
proof
  { assume "KpRt"
    with assms(2) show "(f-``(K))pR"
      using preimage_prime_ideal_surj target_ring.ideal_dest_subset
      unfolding target_ring.primeIdeal_def by auto
  }
  { assume "(f-``(K))pR"
    with assms(1,2) have "K◃Rt" and "KS"
      using func1_1_L4 unfolding origin_ring.primeIdeal_def surj_def 
      by auto    
    moreover
    { fix J P assume jp: "Jtarget_ring.ideals"
        "Ptarget_ring.ideals"
        "target_ring.productIdeal(J, P)  K"
      from jp(3) have "f-``(target_ring.productIdeal(J, P))  f-``(K)"
        by auto
      with assms(2) jp(1,2) have 
        A: "((f-``(J)) I (f-``(P))) +I (ker)  f-``(K)" 
        using prime_ideal_quot by auto 
      from jp(1,2) have 
        "(f-``(J))I(f-``(P))  ker  ((f-``(J))I(f-``(P))) +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) I (f -`` P))  f-``(K)" by auto
      with (f-``(K))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
      with assms jp(1,2) have "J  K  P  K" 
        using surj_image_vimage target_ring.ideal_dest_subset
        by auto
    }
    ultimately show "KpRt"
      unfolding target_ring.primeIdeal_def by auto
  }
qed

textIf 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 "F  λJtarget_ring.ideals. f-``(J)"
  assumes "f  surj(R,S)"
  shows "restrict(F,{JPow(S). JpRt})  
    bij({JPow(S). JpRt}, {JPow(R). kerJ  (JpR)})"
proof -
  let ?ℐt = "target_ring.ideals"
  from assms have I: "F:?ℐt  {K. ker  K}"
    using ideal_quot_bijection bij_is_fun by simp 
  have II: "{JPow(S). JpRt}  ?ℐt"
    unfolding target_ring.primeIdeal_def by auto
  have III: "{JPow(S). JpRt}  ?ℐt" 
    unfolding target_ring.primeIdeal_def by auto
  with assms have "restrict(F,{JPow(S). JpRt})  
    bij({JPow(S). JpRt}, F``{JPow(S). JpRt})"
    using restrict_bij ideal_quot_bijection unfolding bij_def 
    by auto
  moreover have "{tPow(R). kert  (tpR)} = F``{JPow(S). JpRt}"
  proof 
    { fix t assume "t  F``{JPow(S). JpRt}"
      with I III obtain q where "qPow(S)" "qpRt" "t=F`(q)"
        using func_imagedef by auto 
      from qPow(S) qpRt have "q?ℐt" 
        unfolding target_ring.primeIdeal_def by auto
      with I have "F`(q)  {K. ker  K}" using apply_funtype 
        by blast
      with assms qpRt t=F`(q) q?ℐt t=F`(q) 
        have "t◃R" "tpR" "kert"
        using prime_ideal_quot_3 by simp_all
    } then show "F``{JPow(S). JpRt}  {tPow(R). kert  (tpR)}"
      using origin_ring.ideal_dest_subset by blast
    { fix t assume "t{tPow(R). kert  (tpR)}"
      then have "tPow(R)" "kert" "tpR" by auto
      then have tSet: "t  {t. ker  t}" 
        unfolding origin_ring.primeIdeal_def by auto
      with assms have cont: "converse(F)`(t)  ?ℐ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 tpR cont have "t  F``{JPow(S). JpRt}"
        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 "{tPow(R). kert  (tpR)}  F``{JPow(S). JpRt}" 
      by auto
  qed
  ultimately show ?thesis by auto
qed
    
end