reserve a, I for set,
  S for non empty non void ManySortedSign;

theorem Th17:
  for A, B being non-empty MSAlgebra over S for F being
  ManySortedFunction of A, B st F is "onto" for o being OperSymbol of S for x
  being Element of Args(o,B) holds ex y being Element of Args(o,A) st F # y = x
proof
  let A, B be non-empty MSAlgebra over S, F be ManySortedFunction of A, B such
  that
A1: F is "onto";
  let o be OperSymbol of S, t be Element of Args(o,B);
  set D = len (the_arity_of o);
  defpred P[object,object] means
   ex y1 being Element of (the Sorts of A).((
  the_arity_of o)/.$1) st (F.((the_arity_of o)/.$1)).y1 = t.$1 & $2 = y1;
A2: for k being Element of NAT st k in Seg D ex x being object st P[k,x]
  proof
    let k be Element of NAT;
    assume k in Seg D;
    then
A3: k in dom the_arity_of o by FINSEQ_1:def 3;
    set s = (the_arity_of o)/.k;
A4: t.k in (the Sorts of B).s by A3,MSUALG_6:2;
    rng (F.s) = (the Sorts of B).s by A1;
    then consider y1 being object such that
A5: y1 in (the Sorts of A).s and
A6: F.s.y1 = t.k by A4,FUNCT_2:11;
    reconsider y2 = y1 as Element of (the Sorts of A).s by A5;
    take y1;
    take y2;
    thus thesis by A6;
  end;
  consider p being FinSequence such that
A7: dom p = Seg D and
A8: for k being Element of NAT st k in Seg D holds P[k,p.k] from
  MSUALG_8:sch 1(A2);
A9: len p = len the_arity_of o by A7,FINSEQ_1:def 3;
  for k being Nat st k in dom p holds p.k in (the Sorts of A).((
  the_arity_of o)/.k)
  proof
    let k be Nat;
    assume k in dom p;
    then
    ex y1 being Element of (the Sorts of A).((the_arity_of o)/.k ) st F.((
    the_arity_of o)/.k).y1 = t.k & p.k = y1 by A7,A8;
    hence thesis;
  end;
  then reconsider p as Element of Args(o,A) by A9,MSAFREE2:5;
  set fp = F # p;
  take p;
  reconsider E = (the Sorts of B)*(the_arity_of o) as non-empty ManySortedSet
  of dom (the_arity_of o);
A10: Args(o,B) = product E by PRALG_2:3;
A11: Seg D = dom the_arity_of o by FINSEQ_1:def 3
    .= dom ((the Sorts of B)*(the_arity_of o)) by PRALG_2:3
    .= dom t by A10,CARD_3:9;
A12: for k being Nat st k in dom t holds fp.k = t.k
  proof
    let k be Nat;
    assume
A13: k in dom t;
    then
    ex y1 being Element of (the Sorts of A).((the_arity_of o)/.k) st (F.(
    (the_arity_of o)/.k)).y1 = t.k & p.k = y1 by A11,A8;
    hence thesis by A11,A7,A13,MSUALG_3:def 6;
  end;
  dom fp = dom ((the Sorts of B)*(the_arity_of o)) by A10,CARD_3:9
    .= dom t by A10,CARD_3:9;
  hence thesis by A12;
end;
