
theorem Th31:
  for A being partial non-empty UAStr
  for S being non void non empty ManySortedSign for G being MSAlgebra over S
  for Q being IndexedPartition of the carrier' of S
  st A can_be_characterized_by S,G,Q
  for o being OperSymbol of A, r being FinSequence of rng the Sorts of G
  st product r c= dom Den(o,A) ex s being OperSymbol of S st
  (the Sorts of G)*the_arity_of s = r & s in Q.o
proof
  let A be partial non-empty UAStr;
  let S2 be non void non empty ManySortedSign;
  let G be MSAlgebra over S2,
  Q be IndexedPartition of the carrier' of S2 such that
A1: the Sorts of G is IndexedPartition of A and
A2: dom Q = dom the charact of A and
A3: for o being OperSymbol of A holds
  (the Charact of G)|(Q.o) is IndexedPartition of Den(o, A);
  reconsider R = the Sorts of G as IndexedPartition of A by A1;
  dom R = the carrier of S2 by PARTFUN1:def 2;
  then reconsider SG = the Sorts of G as Function of the carrier of S2, rng R
  by RELSET_1:4;
  let o be OperSymbol of A, r be FinSequence of rng the Sorts of G;
  reconsider p = r as Element of (rng R)* by FINSEQ_1:def 11;
  assume
A4: product r c= dom Den(o,A);
  reconsider P = (the Charact of G)|(Q.o) as IndexedPartition of Den(o, A)
  by A3;
  set h = the Element of product p;
  h in product r;
  then
A5: [h,Den(o,A).h] in Den(o, A) by A4,FUNCT_1:def 2;
  then
A6: P-index_of [h,Den(o,A).h] in dom P by Def3;
A7: [h,Den(o,A).h] in P.(P-index_of [h,Den(o,A).h]) by A5,Def3;
  reconsider Qo = Q.o as Element of rng Q by A2,FUNCT_1:def 3;
A8: dom the Charact of G = the carrier' of S2 by PARTFUN1:def 2;
  then
A9: dom P = Qo by RELAT_1:62;
reconsider s = P-index_of [h,Den(o,A).h] as Element of Qo by A6,A8,RELAT_1:62;
  reconsider q = SG*the_arity_of s as FinSequence of rng R by Lm2;
  reconsider q as Element of (rng R)* by FINSEQ_1:def 11;
  reconsider Q = the set of all product t where t is Element of (rng R)*
   as a_partition of (the carrier of A)* by Th8;
  take s;
  dom the Arity of S2 = the carrier' of S2 by FUNCT_2:def 1;
  then
A10: Args(s,G) = (the Sorts of G)# .((the Arity of S2).s) by FUNCT_1:13
    .= product q by FINSEQ_2:def 5;
A11: product q in Q;
A12: product p in Q;
  P.s = (the Charact of G).s by A9,FUNCT_1:47;
  then h in dom Den(s,G) by A7,XTUPLE_0:def 12;
  hence (the Sorts of G)*the_arity_of s = r by A10,A11,A12,Th2,Lm3;
  thus thesis;
end;
