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 Th39:
  |.p^<*a*>.| = |.p.| [*] chi a
proof
  now
    reconsider pa = p^<*a*> as FinSequence of A;
    let b be Element of A;
    len p < len p+1 & dom ({b}|`p) c= dom p by FUNCT_1:56,NAT_1:13;
    then
A1: not len p+1 in dom ({b}|`p) by FINSEQ_3:25;
A2: |.p^<*a*>.|.b = card dom ({b}|`pa) & |.p.|.b = card dom ({b}|`p) by Def7;
A3: a <> b implies dom ({b}|`(p^<*a*>)) = dom ({b}|`p) & (chi a).b = 0 by Th31
,Th35;
A4: (|.p.| [*] chi a).b = (|.p.|.b) + ((chi a).b) by Th29;
    dom ({a}|`(p^<*a*>)) = dom ({a}|`p) \/ {len p+1} & (chi a).a = 1
      by Th31,Th34;
    hence |.p^<*a*>.|.b = (|.p.| [*] chi a).b by A1,A2,A3,A4,CARD_2:41;
  end;
  hence thesis by Th32;
end;
