reserve x, y for object, X for set,
  i, j, k, l, n, m for Nat,
  D for non empty set,
  K for commutative Ring,
  a,b for Element of K,
  perm, p, q for Element of Permutations(n),
  Perm,P for Permutation of Seg n,
  F for Function of Seg n,Seg n,
  perm2, p2, q2, pq2 for Element of Permutations(n+2),
  Perm2 for Permutation of Seg (n+2);
reserve s for Element of 2Set Seg (n+2);
reserve pD for FinSequence of D,
  M for Matrix of n,m,D,
  pK,qK for FinSequence of K,
  A for Matrix of n,K;

theorem
  for A,B be Matrix of n,K st 0 < n holds Det (A * B) = Det A * Det B
proof
  let A,B be Matrix of n,K such that
A1: 0 < n;
  set P=Permutations n;
  set KK=the carrier of K;
  set mm=the multF of K;
  set aa=the addF of K;
  set AB = A * B;
  consider SUM1 be Function of P,KK such that
A2: Det(AB) = aa $$ (In(P,Fin P),SUM1) and
A3: for perm be Element of Permutations n holds SUM1.perm = mm $$
  Path_matrix(perm,A) * -(Det B,perm) by A1,Th61;
  set Path=Path_product(A);
  set F=In(P,Fin P);
  P in Fin P by FINSUB_1:def 5; then
A4: F=P by SUBSET_1:def 8;
  then consider Ga be Function of Fin P,KK such that
A5: Det A = Ga.F and
A6: for e being Element of KK st e is_a_unity_wrt aa holds Ga.{} = e and
A7: for x being Element of P holds Ga.{x} = Path.x and
A8: for B9 being Element of Fin P st B9 c= F & B9 <> {} for x being
  Element of P st x in F \ B9 holds Ga.(B9 \/ {x}) = aa.(Ga.B9,Path.x) by
SETWISEO:def 3;
A9: Ga.{}=0.K by A6,FVSUM_1:6;
  consider Gs be Function of Fin P,KK such that
A10: Det(AB) = Gs.F and
A11: for e being Element of KK st e is_a_unity_wrt aa holds Gs.{} = e and
A12: for x being Element of P holds Gs.{x} = SUM1.x and
A13: for B9 being Element of Fin P st B9 c= F & B9 <> {} for x being
  Element of P st x in F \ B9 holds Gs.(B9 \/ {x}) = aa.(Gs.B9,SUM1.x)
  by A2,A4,SETWISEO:def 3;
  defpred S[set] means for B9 be Element of Fin P st B9=$1 holds Gs.B9=(Ga.B9)
  *Det B;
A14: for B9 be (Element of Fin P), b be Element of P holds S[B9] & not b in
  B9 implies S[B9 \/ {b}]
  proof
    let B9 be (Element of Fin P), b be Element of P;
    assume that
A15: S[B9] and
A16: not b in B9;
    set mA=mm $$ Path_matrix(b,A);
    let Bb be Element of Fin P such that
A17: Bb=B9\/{b};
A18: now
      per cases;
      suppose
A19:    b is even;
        then
A20:    -(mA,b)=mA by MATRIX_1:def 16;
        -(Det B,b)=Det B by A19,MATRIX_1:def 16;
        hence SUM1.b = -(mA,b)*Det B by A3,A20
          .= Path.b*Det B by MATRIX_3:def 8;
      end;
      suppose
A21:    b is odd;
        then
A22:    -(mA,b)=-mA by MATRIX_1:def 16;
        -(Det B,b)=-Det B by A21,MATRIX_1:def 16;
        then -(-(mA,b)*(Det B)) = (-mA)*(-(Det B,b)) by A22,VECTSP_1:9
          .= -(mA*-(Det B,b)) by VECTSP_1:9;
        then (mA*-(Det B,b))--(mA,b)*(Det B)=0.K by VECTSP_1:16;
        then
A23:    -(mA,b)*(Det B)=mA*-(Det B,b) by VECTSP_1:19;
        -(mA,b)=Path.b by MATRIX_3:def 8;
        hence SUM1.b=Path.b*Det B by A3,A23;
      end;
    end;
    per cases;
    suppose
A24:  B9={};
      then Ga.Bb = Path.b by A7,A17;
      hence thesis by A12,A17,A18,A24;
    end;
    suppose
A25:  B9<>{};
A26:  B9 c= P by FINSUB_1:def 5;
A27:  b in F\B9 by A4,A16,XBOOLE_0:def 5;
      then Gs.Bb = aa.(Gs.B9,SUM1.b) by A4,A13,A17,A25,A26;
      then
A28:  Gs.Bb=((Ga.B9)*Det B)+(Path.b*Det B) by A15,A18;
      Ga.Bb=Ga.B9+Path.b by A4,A8,A17,A25,A27,A26;
      hence thesis by A28,VECTSP_1:def 7;
    end;
  end;
  Gs.{}=0.K by A11,FVSUM_1:6;
  then
A29: S[{}.P] by A9;
  for B be Element of Fin P holds S[B] from SETWISEO:sch 2(A29,A14);
  hence thesis by A10,A5;
end;
