let K be Field; :: thesis: for A, B, C being Matrix of K st len B = len C & width B = width C & len A = width B & len B > 0 & len A > 0 holds
(B + C) * A = (B * A) + (C * A)

let A, B, C be Matrix of K; :: thesis: ( len B = len C & width B = width C & len A = width B & len B > 0 & len A > 0 implies (B + C) * A = (B * A) + (C * A) )
assume that
A1: len B = len C and
A2: width B = width C and
A3: len A = width B and
A4: len B > 0 and
A5: len A > 0 ; :: thesis: (B + C) * A = (B * A) + (C * A)
A6: width (B + C) = width B by MATRIX_3:def 3;
then A7: width ((B + C) * A) = width A by ;
len (B + C) = len B by MATRIX_3:def 3;
then A8: len ((B + C) * A) = len B by ;
then reconsider M1 = (B + C) * A as Matrix of len B, width A,K by ;
A9: len (B * A) = len B by ;
A10: width (B * A) = width A by ;
then A11: Indices M1 = Indices (B * A) by A8, A7, A9, Th55;
A12: ( len ((B * A) + (C * A)) = len (B * A) & width ((B * A) + (C * A)) = width (B * A) ) by MATRIX_3:def 3;
then reconsider M2 = (B * A) + (C * A) as Matrix of len B, width A,K by ;
( len (C * A) = len C & width (C * A) = width A ) by ;
then A13: Indices M1 = Indices (C * A) by A1, A8, A7, Th55;
for i, j being Nat st [i,j] in Indices M1 holds
M1 * (i,j) = M2 * (i,j)
proof
let i, j be Nat; :: thesis: ( [i,j] in Indices M1 implies M1 * (i,j) = M2 * (i,j) )
len (Col (A,j)) = width B by ;
then A14: len (Col (A,j)) = len (Line (B,i)) by MATRIX_0:def 7;
reconsider q1 = Line (B,i), q2 = Line (C,i), q3 = Col (A,j) as Element of (len A) -tuples_on the carrier of K by A2, A3;
A15: len (mlt ((Line (B,i)),(Col (A,j)))) = len (mlt (q1,q3))
.= len A by CARD_1:def 7
.= len (mlt (q2,q3)) by CARD_1:def 7
.= len (mlt ((Line (C,i)),(Col (A,j)))) ;
1 + 0 <= width B by ;
then A16: 1 in Seg () by FINSEQ_1:1;
len (Col (A,j)) = width C by ;
then A17: len (Col (A,j)) = len (Line (C,i)) by MATRIX_0:def 7;
assume A18: [i,j] in Indices M1 ; :: thesis: M1 * (i,j) = M2 * (i,j)
then A19: M2 * (i,j) = ((B * A) * (i,j)) + ((C * A) * (i,j)) by
.= ((Line (B,i)) "*" (Col (A,j))) + ((C * A) * (i,j)) by
.= ((Line (B,i)) "*" (Col (A,j))) + ((Line (C,i)) "*" (Col (A,j))) by
.= ((Line (B,i)) "*" (Col (A,j))) + (Sum (mlt ((Line (C,i)),(Col (A,j))))) by FVSUM_1:def 9
.= (Sum (mlt ((Line (B,i)),(Col (A,j))))) + (Sum (mlt ((Line (C,i)),(Col (A,j))))) by FVSUM_1:def 9 ;
i in dom (B * A) by ;
then i in Seg (len B) by ;
then i in dom B by FINSEQ_1:def 3;
then A20: [i,1] in Indices B by ;
M1 * (i,j) = (Line ((B + C),i)) "*" (Col (A,j)) by
.= Sum (mlt ((Line ((B + C),i)),(Col (A,j)))) by FVSUM_1:def 9
.= Sum (mlt (((Line (B,i)) + (Line (C,i))),(Col (A,j)))) by
.= Sum ((mlt ((Line (B,i)),(Col (A,j)))) + (mlt ((Line (C,i)),(Col (A,j))))) by
.= (Sum (mlt ((Line (B,i)),(Col (A,j))))) + (Sum (mlt ((Line (C,i)),(Col (A,j))))) by ;
hence M1 * (i,j) = M2 * (i,j) by A19; :: thesis: verum
end;
hence (B + C) * A = (B * A) + (C * A) by ; :: thesis: verum