let R be non empty add-cancelable left_zeroed distributive unital associative commutative Abelian add-associative right_zeroed doubleLoopStr ; :: thesis: for a, b being Element of R
for n being Element of NAT holds (a + b) |^ n = Sum ((a,b) In_Power n)

let a, b be Element of R; :: thesis: for n being Element of NAT holds (a + b) |^ n = Sum ((a,b) In_Power n)
let n be Element of NAT ; :: thesis: (a + b) |^ n = Sum ((a,b) In_Power n)
defpred S1[ Nat] means (a + b) |^ $1 = Sum ((a,b) In_Power $1);
A1: for n being Nat st S1[n] holds
S1[n + 1]
proof
let n be Nat; :: thesis: ( S1[n] implies S1[n + 1] )
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 ((((a,b) In_Power n) * a) ^ <*(0. R)*>) = (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 = (((a,b) In_Power n) * a) ^ <*(0. R)*> 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 (<*(0. R)*> ^ (((a,b) In_Power n) * b)) = (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 = <*(0. R)*> ^ (((a,b) In_Power n) * b) 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 (F1 + F2)) = dom (F1 + F2) by FINSEQ_1:def 3
.= dom F1 by Def1
.= Seg (len F1) by FINSEQ_1:def 3 ;
then A7: len (F1 + F2) = (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
(F1 + F2) . i = ((a,b) In_Power (n + 1)) . i
proof
let i be Nat; :: thesis: ( 1 <= i & i <= len ((a,b) In_Power (n + 1)) implies (F1 + F2) . i = ((a,b) In_Power (n + 1)) . i )
assume that
A9: 1 <= i and
A10: i <= len ((a,b) In_Power (n + 1)) ; :: thesis: (F1 + F2) . i = ((a,b) In_Power (n + 1)) . i
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 (F1 + F2) . i = ((a,b) In_Power (n + 1)) . i )
proof
assume A20: i in {((n + 1) + 1)} ; :: thesis: (F1 + F2) . i = ((a,b) In_Power (n + 1)) . i
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: F1 /. i = ((((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: ((a,b) In_Power n) /. j = ((a,b) In_Power n) . (n + 1) by A23, PARTFUN1:def 6
.= b |^ n by Th24 ;
A28: F2 /. i = (<*(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 (F1 + F2) = Seg ((n + 1) + 1) by A4, A6, FINSEQ_1:def 3;
then i in dom (F1 + F2) by A9, A21, FINSEQ_1:1;
hence (F1 + F2) . i = (F1 + F2) /. i by PARTFUN1:def 6
.= (0. R) + (F2 /. i) by A9, A18, A22, Def1
.= b |^ (n + 1) by A28, ALGSTR_1:def 2
.= ((a,b) In_Power (n + 1)) . i by A21, Th24 ;
:: thesis: verum
end;
A29: i in dom (F1 + F2) 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 (F1 + F2) . 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 ) } ; :: thesis: (F1 + F2) . i = ((a,b) In_Power (n + 1)) . i
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;
F2 /. i = (<*(0. R)*> ^ (((a,b) In_Power n) * b)) . i by A17, PARTFUN1:def 6;
then A40: F2 /. i = (<*(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
.= (((a,b) In_Power n) /. j) * 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;
F1 /. i = ((((a,b) In_Power n) * a) ^ <*(0. R)*>) . i by A16, PARTFUN1:def 6;
then A43: F1 /. i = (((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
.= (((a,b) In_Power n) /. i) * a by A34, POLYNOM1:def 2 ;
thus (F1 + F2) . i = (F1 + F2) /. i by A29, PARTFUN1:def 6
.= (F1 /. i) + ((((a,b) In_Power n) /. j) * b) by A9, A18, A40, Def1
.= ((((n choose m1) * (a |^ l1)) * (b |^ m1)) * a) + ((((a,b) In_Power n) /. j) * b) by A34, A43, Def7
.= ((((a |^ l1) * (n choose m1)) * (b |^ m1)) * a) + ((((a,b) In_Power n) /. j) * b) by Th17
.= (a * ((a |^ l1) * ((n choose m1) * (b |^ m1)))) + ((((a,b) In_Power n) /. j) * b) by Th21
.= ((a * (a |^ l1)) * ((n choose m1) * (b |^ m1))) + ((((a,b) In_Power n) /. j) * b) by GROUP_1:def 3
.= ((a |^ (l1 + 1)) * ((n choose m1) * (b |^ m1))) + ((((a,b) In_Power n) /. j) * 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 ; :: thesis: verum
end;
A44: ( i in {1} implies (F1 + F2) . i = ((a,b) In_Power (n + 1)) . i )
proof
assume i in {1} ; :: thesis: (F1 + F2) . i = ((a,b) In_Power (n + 1)) . i
then A45: i = 1 by TARSKI:def 1;
then A46: F2 /. i = (<*(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: ((a,b) In_Power n) /. i = ((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: F1 /. i = ((((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 (F1 + F2) . i = (F1 + F2) /. i by A29, PARTFUN1:def 6
.= (F1 /. i) + (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 ; :: thesis: verum
end;
now :: thesis: ( i in ({1} \/ { k where k is Element of NAT : ( 1 < k & k < (n + 1) + 1 ) } ) \/ {((n + 1) + 1)} implies (F1 + F2) . i = ((a,b) In_Power (n + 1)) . i )
assume i in ({1} \/ { k where k is Element of NAT : ( 1 < k & k < (n + 1) + 1 ) } ) \/ {((n + 1) + 1)} ; :: thesis: (F1 + F2) . i = ((a,b) In_Power (n + 1)) . i
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 (F1 + F2) . i = ((a,b) In_Power (n + 1)) . i by A44, A19, A30, XBOOLE_0:def 3; :: thesis: verum
end;
hence (F1 + F2) . i = ((a,b) In_Power (n + 1)) . i by A12, A13, NAT_1:12, NEWTON:1; :: thesis: verum
end;
assume S1[n] ; :: thesis: S1[n + 1]
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 (((((a,b) In_Power n) * a) ^ <*(0. R)*>) + (<*(0. R)*> ^ (((a,b) In_Power n) * b))) = (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 (F1 + F2) by A7, Def7;
hence S1[n + 1] by A52, A55, A8, FINSEQ_1:14; :: thesis: verum
end;
(a + b) |^ 0 = 1_ R by Th8
.= Sum <*(1_ R)*> by Th3
.= Sum ((a,b) In_Power 0) by Th22 ;
then A56: S1[ 0 ] ;
for n being Nat holds S1[n] from NAT_1:sch 2(A56, A1);
hence (a + b) |^ n = Sum ((a,b) In_Power n) ; :: thesis: verum