reserve S for non void non empty ManySortedSign,
  U0 for MSAlgebra over S;
reserve S for non void non empty ManySortedSign,
  X for ManySortedSet of the carrier of S,
  o for OperSymbol of S,
  b for Element of ([:the carrier' of S,{the
  carrier of S}:] \/ Union (coprod X))*;
reserve x for set;

theorem Th9:
  for S be non void non empty ManySortedSign, X be non-empty
ManySortedSet of the carrier of S, o be OperSymbol of S, p be FinSequence of TS
(DTConMSA(X)) holds p in ((FreeSort X)# * (the Arity of S)).o iff dom p = dom (
  the_arity_of o) & for n be Nat st n in dom p holds p.n in FreeSort(X,(
  the_arity_of o)/.n)
proof
  let S be non void non empty ManySortedSign, X be non-empty ManySortedSet of
  the carrier of S, o be OperSymbol of S, p be FinSequence of TS(DTConMSA(X));
  set AR = the Arity of S, cr = the carrier of S, ar = the_arity_of o;
  thus p in ((FreeSort X)# * AR).o implies dom p = dom (the_arity_of o) & for
  n be Nat st n in dom p holds p.n in FreeSort(X,(the_arity_of o)/.n)
  proof
A1: AR.o = ar by MSUALG_1:def 1;
A2: rng ar c= cr & dom ((FreeSort X)) = cr by FINSEQ_1:def 4,PARTFUN1:def 2;
    then
A3: dom ((FreeSort X) * ar) = dom ar by RELAT_1:27;
    assume p in ((FreeSort X)# * (the Arity of S)).o;
    then
A4: p in product ((FreeSort X) * ar) by A1,Th1;
    then
A5: dom p = dom ((FreeSort X) * ar) by CARD_3:9;
    hence dom p = dom ar by A2,RELAT_1:27;
    let n be Nat;
    assume
A6: n in dom p;
    then ((FreeSort X) * ar).n = (FreeSort X).(ar.n) by A5,FUNCT_1:12
      .= (FreeSort X). (ar/.n) by A5,A3,A6,PARTFUN1:def 6
      .= FreeSort(X,ar/.n) by Def11;
    hence thesis by A4,A5,A6,CARD_3:9;
  end;
  assume that
A7: dom p = dom (the_arity_of o) and
A8: for n be Nat st n in dom p holds p.n in FreeSort(X,(the_arity_of o) /.n);
  rng ar c= cr & dom ((FreeSort X)) = cr by FINSEQ_1:def 4,PARTFUN1:def 2;
  then
A9: dom p = dom ((FreeSort X) * ar) by A7,RELAT_1:27;
A10: for x be object st x in dom((FreeSort X) * ar) holds p.x in ((FreeSort X)
  * ar).x
  proof
    let x be object;
    assume
A11: x in dom ((FreeSort X) * ar);
    then reconsider n = x as Nat;
    FreeSort(X,ar/.n) = (FreeSort X). (ar/.n) by Def11
      .= (FreeSort X).(ar.n) by A7,A9,A11,PARTFUN1:def 6
      .= ((FreeSort X) * ar).x by A11,FUNCT_1:12;
    hence thesis by A8,A9,A11;
  end;
  AR.o = ar by MSUALG_1:def 1;
  then ((FreeSort X)# * AR).o = product ((FreeSort X) * ar) by Th1;
  hence thesis by A9,A10,CARD_3:9;
end;
