reserve x,y,z, X,Y,Z for set,
  n for Element of NAT;
reserve A for set,
  D for non empty set,
  a,b,c,l,r for Element of D,
  o,o9 for BinOp of D,
  f,g,h for Function of A,D;
reserve G for non empty multMagma;
reserve A for non empty set,
  a for Element of A,
  p for FinSequence of A,
  m1,m2 for Multiset of A;
reserve p,q for FinSequence of A;

theorem Th40:
  |.p^q.| = |.p.|[*]|.q.|
proof
  defpred P[Nat] means for q st len q = $1 holds |.p^q.| = |.p.|[*]
  |.q.|;
A1: len q = len q;
A2: for n being Nat st P[n] holds P[n+1]
  proof
    let n be Nat such that
A3: for q st len q = n holds |.p^q.| = |.p.|[*]|.q.|;
    let q;
    assume
A4: len q = n+1;
    then q <> {};
    then consider r being FinSequence, x being object such that
A5: q = r^<*x*> by FINSEQ_1:46;
    rng <*x*> = {x} by FINSEQ_1:39;
    then {x} c= rng q by A5,FINSEQ_1:30;
    then
A6: {x} c= A by XBOOLE_1:1;
    reconsider r as FinSequence of A by A5,FINSEQ_1:36;
    len <*x*> = 1 by FINSEQ_1:40;
    then
A7: n+1 = len r+1 by A4,A5,FINSEQ_1:22;
    reconsider x as Element of A by A6,ZFMISC_1:31;
    thus |.p^q.| = |.p^r^<*x*>.| by A5,FINSEQ_1:32
      .= |.p^r.|[*] chi x by Th39
      .= |.p.|[*]|.r.|[*] chi x by A3,A7
      .= |.p.|[*](|.r.|[*] chi x) by GROUP_1:def 3
      .= |.p.|[*]|.q.| by A5,Th39;
  end;
A8: P[0]
  proof
    let q;
A9: |.<*>A.| = A-->0 & A-->0 = un(MultiSet_over A) by Th26,Th37;
    assume len q = 0;
    then
A10: q = {};
    then p^q = p by FINSEQ_1:34;
    hence thesis by A10,A9,MONOID_0:16;
  end;
  for n being Nat holds P[n] from NAT_1:sch 2(A8,A2);
  hence thesis by A1;
end;
