
theorem :: Lemma_4_5_i_ii:
  for R being Noetherian add-associative left_zeroed right_zeroed
  add-cancelable associative distributive well-unital non empty doubleLoopStr
for B being non empty Subset of R ex C being non empty finite Subset of R st C
  c= B & C-Ideal = B-Ideal
proof
  let R be Noetherian add-associative left_zeroed right_zeroed add-cancelable
  associative distributive well-unital non empty doubleLoopStr;
  let B be non empty Subset of R;
  defpred P[object,object] means
ex cL being non empty LinearCombination of B st $1
  = Sum cL & ex fsB being FinSequence of B st dom fsB = dom cL & $2 = rng fsB &
for i being Nat st i in dom cL ex u, v being Element of R st cL/.i =
  u*((fsB/.i qua Element of B) qua Element of R)*v;
  B-Ideal is finitely_generated by Def26;
  then consider D being non empty finite Subset of R such that
A1: D-Ideal = B-Ideal;
A2: D c= B-Ideal by A1,Def14;
A3: for e being object st e in D ex u being object st u in bool B & P[e,u]
  proof
    let e be object;
    assume e in D;
    then consider cL being LinearCombination of B such that
A4: e = Sum cL by A2,Th60;
    per cases;
    suppose
A5:   cL is non empty;
      defpred P1[set,Element of B] means ex u, v being Element of R st cL/.$1
      = u*($2 qua Element of R)*v;
A6:   now
        let k be Nat;
        assume k in Seg len cL;
        then k in dom cL by FINSEQ_1:def 3;
        then consider u, v being Element of R, a being Element of B such that
A7:     cL/.k = u*a*v by Def8;
        take d = a;
        thus P1[k,d] by A7;
      end;
      consider fsB being FinSequence of B such that
A8:   dom fsB = Seg len cL & for k being Nat st k in Seg
      len cL holds P1[k,(fsB/.k) qua Element of B] from RECDEF_1:sch 17(A6);
      take u = rng fsB;
      thus u in bool B;
      dom cL = Seg len cL by FINSEQ_1:def 3;
      hence thesis by A4,A5,A8;
    end;
    suppose
A9:   cL is empty;
      set b = the Element of B;
      set kL = <*0.R*b*0.R*>;
      now
        let i be set;
        assume
A10:    i in dom kL;
        take u = 0.R, v = 0.R, b;
        i in Seg len kL by A10,FINSEQ_1:def 3;
        then i in {1} by FINSEQ_1:2,40;
        then i = 1 by TARSKI:def 1;
        hence kL/.i = u*b*v by FINSEQ_4:16;
      end;
      then reconsider kL as non empty LinearCombination of B by Def8;
      cL = <*>the carrier of R by A9;
      then
A11:  e = 0.R by A4,RLVECT_1:43
        .= 0.R*b*0.R by BINOM:2
        .= Sum kL by BINOM:3;
      defpred P2[Nat,Element of B] means ex u, v being Element of R
      st kL/.$1 = u*(($2 qua Element of B) qua Element of R)*v;
A12:  now
        let k be Nat;
        assume
A13:    k in Seg len kL;
        take b;
        k in {1} by A13,FINSEQ_1:2,40;
        then k = 1 by TARSKI:def 1;
        hence P2[k,b] by FINSEQ_4:16;
      end;
      consider fsB being FinSequence of B such that
A14:  dom fsB = Seg len kL & for k being Nat st k in Seg
      len kL holds P2[k,(fsB/.k) qua Element of B] from RECDEF_1:sch 17(A12);
      take u = rng fsB;
      thus u in bool B;
      dom kL = Seg len kL by FINSEQ_1:def 3;
      hence thesis by A11,A14;
    end;
  end;
  consider f being Function of D, bool B such that
A15: for e being object st e in D holds P[e,f.e] from FUNCT_2:sch 1(A3);
A16: now
    let r be set;
    assume r in rng f;
    then consider x being object such that
A17: x in dom f & r = f.x by FUNCT_1:def 3;
    ex cL being non empty LinearCombination of B st x = Sum cL & ex fsB
being FinSequence of B st dom fsB = dom cL & r = rng fsB &
   for i being Nat st i in dom cL ex u, v being Element of R
     st cL/.i = u*(( fsB/.i qua
    Element of B) qua Element of R)*v by A15,A17;
    hence r is finite;
  end;
  reconsider rf = rng f as Subset-Family of B;
  reconsider C = union rf as Subset of B;
  consider r being object such that
A18: r in rng f by XBOOLE_0:def 1;
 consider x being object such that
A19: x in dom f & r = f.x by A18,FUNCT_1:def 3;
  reconsider r as set by TARSKI:1;
  ex cL being non empty LinearCombination of B st x = Sum cL & ex fsB
being FinSequence of B st dom fsB = dom cL & r = rng fsB &
  for i being Nat st i in dom cL ex u, v being Element of R
    st cL/.i = u*(( fsB/.i qua
  Element of B) qua Element of R)*v by A15,A19;
  then r is non empty by RELAT_1:42;
  then ex x being object st x in r;
  then reconsider C as non empty finite Subset of R by A18,A16,FINSET_1:7
,TARSKI:def 4,XBOOLE_1:1;
  now
    let d be object;
    assume
A20: d in D;
    then consider cL being non empty LinearCombination of B such that
A21: d = Sum cL and
A22: ex fsB being FinSequence of B st dom fsB = dom cL & f.d = rng fsB
& for i being Nat st i in dom cL ex u, v being Element of R st cL/.i
    = u*((fsB/.i qua Element of B) qua Element of R)*v by A15;
    d in dom f by A20,FUNCT_2:def 1;
    then f.d in rng f by FUNCT_1:def 3;
    then
A23: f.d c= C by ZFMISC_1:74;
    now
      let i be set;
      consider fsB being FinSequence of B such that
A24:  dom fsB = dom cL and
A25:  f.d = rng fsB and
A26:  for i being Nat st i in dom cL ex u, v being Element
      of R st cL/.i = u*((fsB/.i qua Element of B) qua Element of R)*v by A22;
      assume
A27:  i in dom cL;
      then fsB/.i = fsB.i by A24,PARTFUN1:def 6;
      then
A28:  fsB/.i in f.d by A27,A24,A25,FUNCT_1:def 3;
      ex u, v being Element of R st cL/.i = u*((fsB/.i qua Element of B)
      qua Element of R)*v by A27,A26;
      hence
      ex u,v being Element of R, a being Element of C st cL/.i = u*a*v by A23
,A28;
    end;
    then reconsider cL9= cL as LinearCombination of C by Def8;
    d = Sum cL9 by A21;
    hence d in C-Ideal by Th60;
  end;
  then D c= C-Ideal;
  then D-Ideal c= (C-Ideal)-Ideal by Th57;
  then
A29: B-Ideal c= C-Ideal by A1,Th44;
  take C;
  C-Ideal c= B-Ideal by Th57;
  hence thesis by A29;
end;
