reserve i,n for Nat,
  K for Field,
  M1,M2,M3,M4 for Matrix of n,K;

theorem
  M1 is Idempotent & M2 is Idempotent & M1 commutes_with M2 implies M1*
  M2 is Idempotent
proof
  assume that
A1: M1 is Idempotent and
A2: M2 is Idempotent and
A3: M1 commutes_with M2;
A4: len M1=n by MATRIX_0:24;
A5: width M2=n by MATRIX_0:24;
A6: width M1=n & len M2=n by MATRIX_0:24;
  width (M1*M2)=n by MATRIX_0:24;
  then (M1*M2)*(M1*M2)=((M1*M2)*M1)*M2 by A4,A6,MATRIX_3:33
    .=(M1*(M2*M1))*M2 by A4,A6,A5,MATRIX_3:33
    .=(M1*(M1*M2))*M2 by A3,MATRIX_6:def 1
    .=((M1*M1)*M2)*M2 by A4,A6,MATRIX_3:33
    .=(M1*M2)*M2 by A1
    .=M1*(M2*M2) by A6,A5,MATRIX_3:33
    .=M1*M2 by A2;
  hence thesis;
end;
