
theorem Th80:
  for R being Abelian left_zeroed right_zeroed add-cancelable
add-associative associative distributive non empty doubleLoopStr, I,J,K being
  right-ideal non empty Subset of R holds I *' (J + K) = (I *' J) + (I *' K)
proof
  let R be Abelian left_zeroed right_zeroed add-cancelable add-associative
  associative distributive non empty doubleLoopStr, I,J,K be right-ideal non
  empty Subset of R;
A1: now
    let u be object;
    assume u in I *' (J + K);
    then consider s being FinSequence of the carrier of R such that
A2: Sum s = u and
A3: for i being Element of NAT st 1 <= i & i <= len s ex a,b being
    Element of R st s.i = a*b & a in I & b in J+K;
    consider f being sequence of the carrier of R such that
A4: Sum s = f.(len s) and
A5: f.0 = 0.R and
A6: for j being Nat,v being Element of R st j < len s & v =
    s .(j + 1) holds f.(j + 1) = f.j + v by RLVECT_1:def 12;
    defpred P[Element of NAT] means ex x,y being Element of R st f.$1=x+y & x
    in I*'J & y in I*'K;
A7: now
      let n be Element of NAT;
      assume that
      0 <= n and
A8:   n < len s;
      thus P[n] implies P[n+1]
      proof
        assume ex x,y being Element of R st f.n = x+y & x in I*'J & y in I*' K;
        then consider x,y being Element of R such that
A9:     f.n = x+y and
A10:    x in I*'J and
A11:    y in I*'K;
        consider p being FinSequence of the carrier of R such that
A12:    Sum p = y and
A13:    for i being Element of NAT st 1 <= i & i <= len p ex a,b
        being Element of R st p.i = a*b & a in I & b in K by A11;
        consider q being FinSequence of the carrier of R such that
A14:    Sum q = x and
A15:    for i being Element of NAT st 1 <= i & i <= len q ex a,b
        being Element of R st q.i = a*b & a in I & b in J by A10;
A16:    0 + 1 <= n + 1 & n + 1 <= len s by A8,NAT_1:13;
        then consider a,b being Element of R such that
A17:    s.(n+1) = a*b and
A18:    a in I and
A19:    b in J+K by A3;
        consider c,d being Element of R such that
A20:    b = c + d and
A21:    c in J and
A22:    d in K by A19;
        set q1 = q^<*a*c*>, p1 = p^<*a*d*>;
        n + 1 in Seg(len s) by A16,FINSEQ_1:1;
        then
A23:    n + 1 in dom s by FINSEQ_1:def 3;
        then
A24:    s.(n+1) = s/.(n+1) by PARTFUN1:def 6;
A25:    len p1 = len p + len(<*a*d*>) by FINSEQ_1:22
          .= len p + 1 by FINSEQ_1:40;
        for i being Element of NAT st 1 <= i & i <= len p1 ex a,b being
        Element of R st p1.i = a*b & a in I & b in K
        proof
          let i be Element of NAT;
          assume that
A26:      1 <= i and
A27:      i <= len p1;
          per cases;
          suppose
            i = len p1;
            hence thesis by A18,A22,A25,FINSEQ_1:42;
          end;
          suppose
            i <> len p1;
            then i < len p1 by A27,XXREAL_0:1;
            then
A28:        i <= len p by A25,NAT_1:13;
            then consider a,b being Element of R such that
A29:        p.i = a*b and
A30:        a in I & b in K by A13,A26;
            i in Seg(len p) by A26,A28,FINSEQ_1:1;
            then i in dom p by FINSEQ_1:def 3;
            then p1.i = a*b by A29,FINSEQ_1:def 7;
            hence thesis by A30;
          end;
        end;
        then
A31:    Sum p1 in I *' K;
A32:    len q1 = len q + len(<*a*c*>) by FINSEQ_1:22
          .= len q + 1 by FINSEQ_1:40;
        for i being Element of NAT st 1 <= i & i <= len q1 ex a,b being
        Element of R st q1.i = a*b & a in I & b in J
        proof
          let i be Element of NAT;
          assume that
A33:      1 <= i and
A34:      i <= len q1;
          per cases;
          suppose
            i = len q1;
            hence thesis by A18,A21,A32,FINSEQ_1:42;
          end;
          suppose
            i <> len q1;
            then i < len q1 by A34,XXREAL_0:1;
            then
A35:        i <= len q by A32,NAT_1:13;
            then consider a,b being Element of R such that
A36:        q.i = a*b and
A37:        a in I & b in J by A15,A33;
            i in Seg(len q) by A33,A35,FINSEQ_1:1;
            then i in dom q by FINSEQ_1:def 3;
            then q1.i = a*b by A36,FINSEQ_1:def 7;
            hence thesis by A37;
          end;
        end;
        then
A38:    Sum q1 in {Sum t where t is FinSequence of the carrier of R: for
i being Element of NAT st 1 <= i & i <= len t ex a,b being Element of R st t.i
        = a*b & a in I & b in J};
A39:    s/.(n+1) = a*(c + d) by A23,A17,A20,PARTFUN1:def 6
          .= a*c + a*d by VECTSP_1:def 7;
        Sum q1 + Sum p1 = (Sum q + Sum <*a*c*>) + Sum p1 by RLVECT_1:41
          .= (Sum q + a*c) + Sum p1 by BINOM:3
          .= (Sum q + a*c) + (Sum p + Sum <*a*d*>) by RLVECT_1:41
          .= (Sum q + a*c) + (Sum p + a*d) by BINOM:3
          .= ((Sum q + a*c) + Sum p) + a*d by RLVECT_1:def 3
          .= (a*c + (Sum q + Sum p)) + a*d by RLVECT_1:def 3
          .= f.n + (a*c + a*d) by A9,A14,A12,RLVECT_1:def 3
          .= f.(n+1) by A6,A8,A24,A39;
        hence thesis by A38,A31;
      end;
    end;
A40: P[0]
    proof
      take 0.R,0.R;
      thus thesis by A5,Th3,RLVECT_1:def 4;
    end;
    for n being Element of NAT st 0 <= n &n <= len s holds P[n] from
    INT_1:sch 7(A40,A7);
    then ex x,y being Element of R st Sum s = x+y & x in I*'J & y in I*'K by A4
;
    hence u in (I *' J) + (I *' K) by A2;
  end;
  now
    let u be object;
    assume u in (I *' J) + (I *' K);
    then consider a,b being Element of R such that
A41: u = a + b and
A42: a in I*'J and
A43: b in I*'K;
    consider p being FinSequence of the carrier of R such that
A44: b = Sum p and
A45: for i being Element of NAT st 1 <= i & i <= len p ex a,b being
    Element of R st p.i = a*b & a in I & b in K by A43;
    consider q being FinSequence of the carrier of R such that
A46: a = Sum q and
A47: for i being Element of NAT st 1 <= i & i <= len q ex a,b being
    Element of R st q.i = a*b & a in I & b in J by A42;
    set s = p^q;
A48: for i being Element of NAT st 1 <= i & i <= len s ex a,b being
    Element of R st s.i = a*b & a in I & b in J+K
    proof
      let i be Element of NAT;
      assume that
A49:  1 <= i and
A50:  i <= len s;
      i in Seg(len s) by A49,A50,FINSEQ_1:1;
      then
A51:  i in dom s by FINSEQ_1:def 3;
      now
        per cases;
        case
A52:      i <= len p;
          then consider a,b being Element of R such that
A53:      p.i = a*b and
A54:      a in I and
A55:      b in K by A45,A49;
          i in Seg(len p) by A49,A52,FINSEQ_1:1;
          then i in dom p by FINSEQ_1:def 3;
          then
A56:      s.i=a*b by A53,FINSEQ_1:def 7
            .=a*(0.R + b) by ALGSTR_1:def 2;
          0.R in J by Th3;
          then
          0.R + b in {a9+b9 where a9,b9 is Element of R:a9 in J & b9 in K
          } by A55;
          hence thesis by A54,A56;
        end;
        case
          i > len p;
          then not i in Seg(len p) by FINSEQ_1:1;
          then not i in dom p by FINSEQ_1:def 3;
          then consider n being Nat such that
A57:      n in dom q and
A58:      i = len p + n by A51,FINSEQ_1:25;
          n in Seg(len q) by A57,FINSEQ_1:def 3;
          then 1 <= n & n <= len q by FINSEQ_1:1;
          then consider a,b being Element of R such that
A59:      q.n = a*b and
A60:      a in I and
A61:      b in J by A47,A57;
          0.R in K by Th3;
          then
A62:      b + 0.R in {a9+b9 where a9,b9 is Element of R:a9 in J & b9 in K
          } by A61;
          s.i = q.n by A57,A58,FINSEQ_1:def 7
            .= a*(b + 0.R) by A59,RLVECT_1:def 4;
          hence thesis by A60,A62;
        end;
      end;
      hence thesis;
    end;
    Sum s = u by A41,A46,A44,RLVECT_1:41;
    hence u in I *' (J + K) by A48;
  end;
  hence thesis by A1,TARSKI:2;
end;
