reserve S for OrderSortedSign;
reserve S for OrderSortedSign,
  X for ManySortedSet 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 Th25:
  for S be locally_directed OrderSortedSign, X be non-empty
  ManySortedSet of S, s be Element of S, x be Element of (the Sorts of
  ParsedTermsOSA(X)).s holds OSClass(PTCongruence X,x) = proj1((PTClasses X).x)
proof
  let S be locally_directed OrderSortedSign, X be non-empty ManySortedSet of S
  , s be Element of S, x be Element of (the Sorts of ParsedTermsOSA(X)).s;
  set R = PTCongruence X, PTA = ParsedTermsOSA(X), D = DTConOSA(X);
  for z being object holds z in OSClass(R,x) iff z in proj1((PTClasses X).x)
  proof
    let z be object;
    hereby
      assume z in OSClass(R,x);
      then [z,x] in CompClass(R, CComp(s)) by EQREL_1:19;
      then
      ex s1 being Element of S st s1 in CComp(s) & [z,s1] in ( PTClasses
      X).x by Th24;
      hence z in proj1((PTClasses X).x) by XTUPLE_0:def 12;
    end;
    assume z in proj1((PTClasses X).x);
    then consider s1 being object such that
A1: [z,s1] in (PTClasses X).x by XTUPLE_0:def 12;
    reconsider s2 = s1 as Element of S by A1,Th23;
    reconsider x1=x,z1=z as Element of TS(D) by A1,Th23;
A2: LeastSort x1 <= s by Def12;
    [z1,s2] in (PTClasses X).x1 by A1;
    then [x1,s2] in (PTClasses X).x1 by Th20;
    then x in (the Sorts of PTA).s1 by Th19;
    then LeastSort x1 <= s2 by Def12;
    then CComp(s2) = CComp(LeastSort x1) by OSALG_4:4
      .= CComp(s) by A2,OSALG_4:4;
    then s2 in CComp(s) by EQREL_1:20;
    then [z,x] in CompClass(R,CComp(s)) by A1,Th24;
    hence thesis by EQREL_1:19;
  end;
  hence thesis by TARSKI:2;
end;
