
theorem
  for R being Abelian add-associative left_zeroed right_zeroed
  commutative associative add-cancelable distributive unital non empty
doubleLoopStr, a,b being Element of R, n being Element of NAT holds (a+b)|^n =
  Sum((a,b) In_Power n)
proof
  let R be add-associative left_zeroed right_zeroed distributive associative
  Abelian add-cancelable commutative unital non empty doubleLoopStr, a,b be
  Element of R, n be Element of NAT;
  defpred P[Nat] means (a+b)|^$1 = Sum((a,b) In_Power $1);
A1: for n being Nat st P[n] holds P[n+1]
  proof
    let n be Nat;
    set G1 = (((a,b) In_Power n) * a)^<*0.R*>;
    set G2 = <*0.R*>^(((a,b) In_Power n) * b);
A2: Seg(len(((a,b) In_Power n) * a)) = dom(((a,b) In_Power n) * a) by
FINSEQ_1:def 3
      .= dom((a,b) In_Power n) by POLYNOM1:def 2
      .= Seg(len((a,b) In_Power n)) by FINSEQ_1:def 3;
    len G1 = len(((a,b) In_Power n) * a) + len<*0.R*> by FINSEQ_1:22
      .= len(((a,b) In_Power n) * a) + 1 by FINSEQ_1:40
      .= len((a,b) In_Power n) + 1 by A2,FINSEQ_1:6
      .= n + 1 + 1 by Def7;
    then reconsider
    F1 = G1 as Element of (n+1+1)-tuples_on the carrier of R by FINSEQ_2:92;
A3: Seg(len(((a,b) In_Power n) * b)) = dom(((a,b) In_Power n) * b) by
FINSEQ_1:def 3
      .= dom((a,b) In_Power n) by POLYNOM1:def 2
      .= Seg(len((a,b) In_Power n)) by FINSEQ_1:def 3;
    len G2 = len(((a,b) In_Power n) * b) + len<*0.R*> by FINSEQ_1:22
      .= len(((a,b) In_Power n) * b) + 1 by FINSEQ_1:40
      .= len((a,b) In_Power n) + 1 by A3,FINSEQ_1:6
      .= n + 1 + 1 by Def7;
    then reconsider
    F2 = G2 as Element of (n+1+1)-tuples_on the carrier of R by FINSEQ_2:92;
A4: len F1 = n+1+1 by CARD_1:def 7;
    set F = F1 + F2;
A5: len F2 = n+1+1 by CARD_1:def 7;
A6: Seg(len F) = dom F by FINSEQ_1:def 3
      .= dom F1 by Def1
      .= Seg(len F1) by FINSEQ_1:def 3;
    then
A7: len F = n + 1 + 1 by A4,FINSEQ_1:6;
A8: for i being Nat st 1 <= i & i <= len((a,b) In_Power (n+1)) holds F.i
    = ((a,b) In_Power (n+1)).i
    proof
      let i be Nat;
      assume that
A9:   1 <= i and
A10:  i <= len((a,b) In_Power (n+1));
A11:  len((a,b) In_Power (n+1)) = n+1+1 by Def7;
      then
A12:  dom((a,b) In_Power (n+1)) = Seg(n+1+1) by FINSEQ_1:def 3;
      then
A13:  i in dom((a,b) In_Power (n+1)) by A9,A10,A11,FINSEQ_1:1;
      reconsider j = i - 1 as Element of NAT by A9,INT_1:5;
      set x = ((a,b) In_Power n)/.j;
      set r1 = F1/.i;
      set r2 = F2/.i;
      set r = ((a,b) In_Power n)/.i;
A14:  i = j+1;
A15:  i in Seg(n+1+1) by A9,A10,A11,FINSEQ_1:1;
      then
A16:  i in dom F1 by A4,FINSEQ_1:def 3;
A17:  i in dom F2 by A5,A15,FINSEQ_1:def 3;
A18:  i <= len(F1+F2) by A7,A10,Def7;
A19:  i in {n+1+1} implies F.i = ((a,b) In_Power (n+1)).i
      proof
        assume
A20:    i in {n+1+1};
        then
A21:    i = n+1+1 by TARSKI:def 1;
        n+1 = len ((a,b) In_Power n) by Def7
          .= len(((a,b) In_Power n) * a) by A2,FINSEQ_1:6;
        then
A22:    r1 = ((((a,b) In_Power n)*a)^<*0.R*>). (len(((a,b) In_Power n)*a)
        +1) by A16,A21,PARTFUN1:def 6
          .= 0.R by FINSEQ_1:42;
A23:    j = n+1+1-1 by A20,TARSKI:def 1
          .= n+1;
        n+1 in Seg (n+1) by FINSEQ_1:4;
        then
A24:    j in Seg len (((a,b) In_Power n)) by A23,Def7;
        then
A25:    j in dom (((a,b) In_Power n) * b) by A3,FINSEQ_1:def 3;
A26:    j in dom ((a,b) In_Power n) by A24,FINSEQ_1:def 3;
        then
A27:    x = ((a,b) In_Power n).(n+1) by A23,PARTFUN1:def 6
          .= b|^n by Th24;
A28:    r2 = (<*0.R*>^(((a,b) In_Power n) * b)).(1+(n+1)) by A17,A21,
PARTFUN1:def 6
          .= (<*0.R*>^(((a,b) In_Power n) * b)).(len <*0.R*> + j) by A23,
FINSEQ_1:39
          .= (((a,b) In_Power n) * b).j by A25,FINSEQ_1:def 7
          .= (((a,b) In_Power n) * b)/.j by A25,PARTFUN1:def 6
          .= b|^n * b by A26,A27,POLYNOM1:def 2
          .= b|^(n+1) by GROUP_1:def 7;
        dom F = Seg(n+1+1) by A4,A6,FINSEQ_1:def 3;
        then i in dom F by A9,A21,FINSEQ_1:1;
        hence F.i = F/.i by PARTFUN1:def 6
          .= 0.R + r2 by A9,A18,A22,Def1
          .= b|^(n+1) by A28,ALGSTR_1:def 2
          .= ((a,b) In_Power (n+1)).i by A21,Th24;
      end;
A29:  i in dom F by A4,A6,A15,FINSEQ_1:def 3;
A30:  i in {k where k is Element of NAT: k>1 & k<n+1+1} implies F.i = ((a
      ,b) In_Power (n+1)).i
      proof
        assume i in {k where k is Element of NAT: 1 < k & k < n+1+1};
        then
A31:    ex k being Element of NAT st k = i & 1 < k & k < n+1+1;
        then reconsider m1 = i-1 as Element of NAT by INT_1:5;
A32:    i <= n+1 by A31,NAT_1:13;
        then i in Seg (n+1) by A31,FINSEQ_1:1;
        then
A33:    i in Seg len ((a,b) In_Power n) by Def7;
        then
A34:    i in dom ((a,b) In_Power n) by FINSEQ_1:def 3;
        1 <= j by A14,A31,NAT_1:13;
        then reconsider m2 = j - 1 as Element of NAT by INT_1:5;
A35:    j <= n+1 by A14,A31,XREAL_1:6;
        then j-1<=n+1-1 by XREAL_1:9;
        then reconsider l2 = n-m2 as Element of NAT by INT_1:5;
        1 <= j by A14,A31,NAT_1:13;
        then j in Seg (n+1) by A35,FINSEQ_1:1;
        then
A36:    j in Seg len ((a,b) In_Power n) by Def7;
        then
A37:    j in dom ((a,b) In_Power n) by FINSEQ_1:def 3;
A38:    j in dom (((a,b) In_Power n) * b) by A3,A36,FINSEQ_1:def 3;
A39:    j in dom (((a,b) In_Power n) * b) by A3,A36,FINSEQ_1:def 3;
        r2=(<*0.R*>^(((a,b) In_Power n)*b)).i by A17,PARTFUN1:def 6;
        then
A40:    r2 = (<*0.R*>^(((a,b) In_Power n) * b)).(len <*0.R*> +j) by A14,
FINSEQ_1:40
          .= (((a,b) In_Power n) * b).j by A39,FINSEQ_1:def 7
          .= (((a,b) In_Power n) * b)/.j by A38,PARTFUN1:def 6
          .= x * b by A37,POLYNOM1:def 2;
        i-1 <= n+1-1 by A32,XREAL_1:9;
        then reconsider l1 = n - m1 as Element of NAT by INT_1:5;
A41:    l1+1 = n+1-(m2+1);
A42:    i in dom (((a,b) In_Power n) * a) by A2,A33,FINSEQ_1:def 3;
        r1=((((a,b) In_Power n)*a)^<*0.R*>).i by A16,PARTFUN1:def 6;
        then
A43:    r1 = (((a,b) In_Power n) * a).i by A42,FINSEQ_1:def 7
          .= (((a,b) In_Power n) * a)/.i by A42,PARTFUN1:def 6
          .= r * a by A34,POLYNOM1:def 2;
        thus F.i = F/.i by A29,PARTFUN1:def 6
          .= F1/.i + x * b by A9,A18,A40,Def1
          .= ((n choose m1) * a|^l1 * b|^m1) * a + x * b by A34,A43,Def7
          .= (a|^l1 * (n choose m1) * b|^m1) * a + x * b by Th17
          .= a * (a|^l1 *((n choose m1) * b|^m1)) + x * b by Th21
          .= a * a|^l1 *((n choose m1) * b|^m1) + x * b by GROUP_1:def 3
          .= a|^(l1+1) * ((n choose m1) * b|^m1) + x * b by GROUP_1:def 7
          .= a|^(l1+1) * ((n choose m1) * b|^m1) + b|^m2 * ((n choose m2) *
        a|^l2) * b by A37,Def7
          .= a|^(l1+1) * ((n choose m1) * b|^m1) + (b|^m2 * b) * ((n choose
        m2) * a|^l2) by GROUP_1:def 3
          .= a|^(l1+1) * ((n choose (m2+1)) * b|^(m2+1)) + b|^(m2+1) * ((n
        choose m2) * a|^l2) by GROUP_1:def 7
          .= (b|^(m2+1) * a|^(l1+1)) * (n choose (m2+1)) + b|^(m2+1) * ((n
        choose m2) * a|^l2) by Th20
          .= b|^(m2+1) * ((n choose (m2+1)) * a|^(l1+1)) + b|^(m2+1) * ((n
        choose m2) * a|^l2) by Th20
          .= b|^(m2+1) * (a|^(l1+1) * (n choose (m2+1))) + b|^(m2+1) * ((n
        choose m2) * a|^l2) by Th17
          .= ((a|^(l1+1) * (n choose (m2+1))) + ((n choose m2) * a|^l2)) * b
        |^(m2+1) by VECTSP_1:def 7
          .= (((n choose (m2+1)) * a|^(l1+1)) + ((n choose m2) * a|^(l1+1)))
        * b|^(m2+1) by Th17
          .= ((n choose (m2+1)) + (n choose m2)) * a|^(l1+1) * b|^(m2+1) by
Th15
          .= ((n+1) choose (m2+1)) * a|^(l1+1) * b|^(m2+1) by NEWTON:22
          .= ((a,b) In_Power (n+1))/.i by A13,A41,Def7
          .= ((a,b) In_Power (n+1)).i by A13,PARTFUN1:def 6;
      end;
A44:  i in {1} implies F.i = ((a,b) In_Power (n+1)).i
      proof
        assume i in {1};
        then
A45:    i = 1 by TARSKI:def 1;
        then
A46:    r2 = (<*0.R*>^(((a,b) In_Power n) * b)).1 by A17,PARTFUN1:def 6
          .= 0.R by FINSEQ_1:41;
        n+1 >= 0+1 by XREAL_1:6;
        then 1 in Seg (n+1) by FINSEQ_1:1;
        then
A47:    1 in Seg len(((a,b) In_Power n)) by Def7;
        then
A48:    1 in dom ((a,b) In_Power n) by FINSEQ_1:def 3;
        then
A49:    r = ((a,b) In_Power n).i by A45,PARTFUN1:def 6;
A50:    1 in dom (((a,b) In_Power n) * a) by A2,A47,FINSEQ_1:def 3;
A51:    r1 = ((((a,b) In_Power n) * a)^<*0.R*>).1 by A16,A45,PARTFUN1:def 6
          .= (((a,b) In_Power n) * a).1 by A50,FINSEQ_1:def 7
          .= (((a,b) In_Power n) * a)/.1 by A50,PARTFUN1:def 6
          .= (((a,b) In_Power n)/.1) * a by A48,POLYNOM1:def 2
          .= a|^n * a by A45,A49,Th23
          .= a|^(n+1) by GROUP_1:def 7;
        thus F.i = F/.i by A29,PARTFUN1:def 6
          .= r1 + F2/.i by A9,A18,Def1
          .= a|^(n+1) by A51,A46,RLVECT_1:def 4
          .= ((a,b) In_Power (n+1)).i by A45,Th23;
      end;
      now
        assume
        i in {1} \/ {k where k is Element of NAT: 1<k & k<n+1+1} \/ { n+1+1};
        then i in {1} \/ {k where k is Element of NAT: 1<k & k<n+1+1} or i in
        {n+1+1} by XBOOLE_0:def 3;
        hence thesis by A44,A19,A30,XBOOLE_0:def 3;
      end;
      hence thesis by A12,A13,NAT_1:12,NEWTON:1;
    end;
    assume P[n];
    then
A52: (a+b)|^(n+1) = Sum((a,b) In_Power n) * (a + b) by GROUP_1:def 7
      .= Sum((a,b) In_Power n) * a + Sum ((a,b) In_Power n) * b by
VECTSP_1:def 2
      .= Sum(((a,b) In_Power n) * a) + Sum((a,b) In_Power n) * b by Th5
      .= Sum(((a,b) In_Power n) * a) + Sum(((a,b) In_Power n) * b)by Th5;
A53: Sum F1 = Sum(((a,b) In_Power n) * a) + Sum<*0.R*> by RLVECT_1:41
      .= Sum(((a,b) In_Power n) * a) + 0.R by Th3
      .= Sum(((a,b) In_Power n) * a) by RLVECT_1:def 4;
A54: Sum F2 = Sum<*0.R*> + Sum(((a,b) In_Power n) * b) by RLVECT_1:41
      .= 0.R + Sum(((a,b) In_Power n) * b) by Th3
      .= Sum(((a,b) In_Power n) * b) by ALGSTR_1:def 2;
    dom F1 = Seg(len F1) by FINSEQ_1:def 3
      .= dom F2 by A4,A5,FINSEQ_1:def 3;
    then
A55: Sum(G1+G2) = Sum(((a,b) In_Power n) * a) + Sum (((a,b) In_Power n ) *
    b) by A53,A54,Th7;
    len ((a,b) In_Power (n+1)) = len F by A7,Def7;
    hence thesis by A52,A55,A8,FINSEQ_1:14;
  end;
  (a+b)|^0 = 1_R by Th8
    .= Sum <*1_R*> by Th3
    .= Sum((a,b) In_Power 0) by Th22;
  then
A56: P[0];
  for n being Nat holds P[n] from NAT_1:sch 2(A56,A1);
  hence thesis;
end;
