reserve i,j for Nat;

theorem
  for K being Ring,A,B,C being Matrix of K st len B=len C & width B=
  width C & len A=width B holds (B+C)*A=B*A + C*A
proof
  let K be Ring;
  let A,B,C be Matrix of K;
  assume that
A1: len B=len C and
A2: width B= width C and
A3: len A=width B;
  set LHS = (B+C)*A;
  set RHS = B*A + C*A;
A4: len LHS = len RHS & len LHS = len B
  proof
    width (B + C) = len A by A3, MATRIX_3:def 3;
    then
A5: len LHS = len (B + C) by MATRIX_3:def 4
      .= len B by MATRIX_3:def 3;
    len(C*A) = len B & len(B*A) = len B by A1,A2,A3,MATRIX_3:def 4;
    then len RHS = len B by MATRIX_3:def 3;
    hence thesis by A5;
  end;
  per cases by NAT_1:3;
  suppose len B = 0;
    hence thesis by A4, CARD_2:64;
  end;
  suppose len B > 0;
    hence thesis by A1,A2,A3,Lm2;
  end;
end;
