
theorem Th8: :: Lemma 4.24.ii
  for R being RelStr
  st R is quasi_ordered holds <=E R partially_orders Class(EqRel R)
proof
  let R be RelStr;
  set CR = the carrier of R;
  set IR = the InternalRel of R;
  assume
A1: R is quasi_ordered;
  then R is transitive;
  then
A2: IR is_transitive_in CR;
  thus <=E R is_reflexive_in Class(EqRel R)
  proof
    let x be object;
    assume x in Class(EqRel R);
    then consider a being object such that
A3: a in CR and
A4: x = Class(EqRel R,a) by EQREL_1:def 3;
    R is reflexive by A1;
    then IR is_reflexive_in CR;
    then
A5: [a,a] in IR by A3;
    reconsider a9= a as Element of R by A3;
    a9 <= a9 by A5;
    hence thesis by A4,Def5;
  end;
  thus <=E R is_transitive_in Class(EqRel R)
  proof
    let x,y,z be object such that
A6: x in Class(EqRel R) and y in Class(EqRel R)
    and z in Class(EqRel R) and
A7: [x,y] in <=E R and
A8: [y,z] in <=E R;
    consider a,b being Element of R such that
A9: x = Class(EqRel R, a) and
A10: y = Class(EqRel R, b) and
A11: a <= b by A7,Def5;
    consider c,d being Element of R such that
A12: y = Class(EqRel R,c) and
A13: z = Class(EqRel R,d) and
A14: c <= d by A8,Def5;
A15: [a,b] in IR by A11;
A16: [c,d] in IR by A14;
A17: ex x1 being object st ( x1 in CR)&( x = Class(EqRel R, x1)) by A6,
EQREL_1:def 3;
    then b in Class(EqRel R, c) by A10,A12,EQREL_1:23;
    then [b,c] in EqRel R by EQREL_1:19;
    then [b,c] in IR/\ IR~ by A1,Def4;
    then [b,c] in IR by XBOOLE_0:def 4;
    then [a,c] in IR by A2,A15,A17;
    then [a,d] in IR by A2,A16,A17;
    then a<=d;
    hence thesis by A9,A13,Def5;
  end;
  thus <=E R is_antisymmetric_in Class(EqRel R)
  proof
    let x,y be object such that
A18: x in Class(EqRel R) and y in Class(EqRel R) and
A19: [x,y] in <=E R and
A20: [y,x] in <=E R;
    consider a,b being Element of R such that
A21: x = Class(EqRel R, a) and
A22: y = Class(EqRel R, b) and
A23: a <= b by A19,Def5;
    consider c,d being Element of R such that
A24: y = Class(EqRel R, c) and
A25: x = Class(EqRel R, d) and
A26: c <= d by A20,Def5;
A27: [a,b] in IR by A23;
A28: [c,d] in IR by A26;
A29: ex x1 being object st ( x1 in CR)&( x = Class(EqRel R, x1)) by A18,
EQREL_1:def 3;
    then
A30: d in Class(EqRel R, a) by A21,A25,EQREL_1:23;
    a in Class(EqRel R, a) by A29,EQREL_1:20;
    then
A31: [a,d] in EqRel R by A30,EQREL_1:22;
A32: c in Class(EqRel R, b) by A22,A24,A29,EQREL_1:23;
    b in Class(EqRel R, b) by A29,EQREL_1:20;
    then
A33: [b,c] in EqRel R by A32,EQREL_1:22;
    [a,d] in IR /\ IR~ by A1,A31,Def4;
    then [a,d] in IR~ by XBOOLE_0:def 4;
    then
A34: [d,a] in IR by RELAT_1:def 7;
    [b,c] in IR /\ IR~ by A1,A33,Def4;
    then [b,c] in IR by XBOOLE_0:def 4;
    then [b,d] in IR by A2,A28,A29;
    then
A35: [b,a] in IR by A2,A29,A34;
    [b,a] in IR~ by A27,RELAT_1:def 7;
    then [b,a] in IR /\ IR~ by A35,XBOOLE_0:def 4;
    then [b,a] in EqRel R by A1,Def4;
    then b in Class(EqRel R, a) by EQREL_1:19;
    hence thesis by A21,A22,EQREL_1:23;
  end;
end;
