reserve S for locally_directed OrderSortedSign;
reserve o for Element of the carrier' of S;

theorem Th14:
  for A be non-empty OSAlgebra of S, R be OSCongruence of A, x be
set st x in ((OSClass R)# * the Arity of S).o ex a be Element of Args(o,A) st x
  = R #_os a
proof
  let A be non-empty OSAlgebra of S, R be OSCongruence of A, x be set;
  assume
A1: x in ((OSClass R)# * the Arity of S).o;
  set ar = the_arity_of o;
A2: ar = (the Arity of S).o by MSUALG_1:def 1;
  then ((OSClass R)# * the Arity of S).o = product ((OSClass R) * ar) by
MSAFREE:1;
  then consider f be Function such that
A3: f = x and
A4: dom f = dom ((OSClass R) * ar) and
A5: for y be object st y in dom ((OSClass R) * ar) holds f.y in ((OSClass R
  ) * ar).y by A1,CARD_3:def 5;
  defpred P[object,object] means
$2 in (the Sorts of A).((ar)/.$1) & $2 in f.$1;
A6: dom ((OSClass R) * ar) = dom ar by PARTFUN1:def 2;
A7: for n be Nat st n in dom f holds f.n in OSClass (R,((ar)/.n))
  proof
    let n be Nat;
    reconsider s = ((ar)/.n) as Element of S;
    assume
A8: n in dom f;
    then ar.n = ((ar)/.n) by A4,A6,PARTFUN1:def 6;
    then ((OSClass R) * ar).n = (OSClass R).s by A4,A8,FUNCT_1:12
      .= OSClass (R,s) by Def11;
    hence thesis by A4,A5,A8;
  end;
A9: for a be object st a in dom f ex b be object st P[a,b]
  proof
    let a be object;
    reconsider s = ((ar)/.a) as Element of S;
    assume
A10: a in dom f;
    then reconsider n = a as Nat by A4;
    f.n in OSClass (R,s) by A7,A10;
    then consider x being set such that
A11: x in (the Sorts of A).s & f.n = Class( CompClass(R,CComp(s)), x) by Def10;
    take x;
    thus thesis by A11,Th5,EQREL_1:20;
  end;
  consider g be Function such that
A12: dom g = dom f & for a be object st a in dom f holds P[a,g.a] from
  CLASSES1:sch 1(A9);
  dom (the Sorts of A) = the carrier of S by PARTFUN1:def 2;
  then rng ar c= dom (the Sorts of A);
  then
A13: dom g = dom ((the Sorts of A) * ar) by A4,A6,A12,RELAT_1:27;
A14: for y be object st y in dom ((the Sorts of A) * ar) holds g.y in ((the
  Sorts of A) * ar).y
  proof
    let y be object;
    assume
A15: y in dom ((the Sorts of A) * ar);
    then reconsider n = y as Nat;
    reconsider s = ((ar)/.n) as Element of S;
    ar.n = ((ar)/.n) & g.n in (the Sorts of A).s by A4,A6,A12,A13,A15,
PARTFUN1:def 6;
    hence thesis by A15,FUNCT_1:12;
  end;
  Args(o,A) = ((the Sorts of A)# * (the Arity of S)).o by MSUALG_1:def 4
    .= product ((the Sorts of A) * ar) by A2,MSAFREE:1;
  then reconsider g as Element of Args(o,A) by A13,A14,CARD_3:9;
A16: for x being object st x in dom ar holds f.x = (R #_os g).x
  proof
    let x be object;
    assume
A17: x in dom ar;
    then reconsider n = x as Nat;
A18: (ex z being Element of (the Sorts of A).((the_arity_of o)/.n ) st z =
    g.n & (R #_os g).n = OSClass(R, z) )& g.n in f.n by A4,A6,A12,A17,Def13;
    reconsider s = ((ar)/.n) as Element of S;
    f.n in OSClass (R,s) by A4,A6,A7,A17;
    then consider u being set such that
A19: u in (the Sorts of A).s and
A20: f.n = Class( CompClass(R,CComp(s)), u) by Def10;
    u in (the Sorts of A)-carrier_of CComp(s) by A19,Th5;
    hence thesis by A18,A20,EQREL_1:23;
  end;
  take g;
  dom (R #_os g) = dom ((OSClass R) * ar) by CARD_3:9;
  hence thesis by A3,A4,A6,A16,FUNCT_1:2;
end;
