reserve X,Y,Z for set,
  a,b,c,d,x,y,z,u for object,
  R for Relation,
  A,B,C for Ordinal;
reserve H for Function;
reserve f,g for Function;

theorem Th10:
  R well_orders X implies field(R|_2 X) = X & R|_2 X is well-ordering
proof
  assume that
A1: R is_reflexive_in X and
A2: R is_transitive_in X and
A3: R is_antisymmetric_in X and
A4: R is_connected_in X and
A5: R is_well_founded_in X;
A6: R|_2 X is_antisymmetric_in X
  proof
    let x,y be object;
    assume that
A7: x in X & y in X and
A8: [x,y] in R|_2 X & [y,x] in R|_2 X;
    [x,y] in R & [y,x] in R by A8,XBOOLE_0:def 4;
    hence thesis by A3,A7;
  end;
A9: R|_2 X is_well_founded_in X
  proof
    let Y;
    assume Y c= X & Y <> {};
    then consider a being object such that
A10: a in Y and
A11: R-Seg(a) misses Y by A5;
    take a;
    thus a in Y by A10;
    assume not thesis;
    then consider x being object such that
A12: x in (R|_2 X)-Seg(a) and
A13: x in Y by XBOOLE_0:3;
    [x,a] in R|_2 X by A12,WELLORD1:1;
    then
A14: [x,a] in R by XBOOLE_0:def 4;
    x <> a by A12,WELLORD1:1;
    then x in R-Seg(a) by A14,WELLORD1:1;
    hence contradiction by A11,A13,XBOOLE_0:3;
  end;
A15: R|_2 X is_transitive_in X
  proof
    let x,y,z be object;
    assume that
A16: x in X and
A17: y in X and
A18: z in X and
A19: [x,y] in R|_2 X & [y,z] in R|_2 X;
    [x,y] in R & [y,z] in R by A19,XBOOLE_0:def 4;
    then
A20: [x,z] in R by A2,A16,A17,A18;
    [x,z] in [:X,X:] by A16,A18,ZFMISC_1:87;
    hence thesis by A20,XBOOLE_0:def 4;
  end;
A21: R|_2 X is_connected_in X
  proof
    let x,y be object;
    assume that
A22: x in X & y in X and
A23: x <> y;
A24: [x,y] in [:X,X:] & [y,x] in [:X,X :] by A22,ZFMISC_1:87;
    [x,y] in R or [y,x] in R by A4,A22,A23;
    hence thesis by A24,XBOOLE_0:def 4;
  end;
  thus
A25: field(R|_2 X) = X
  proof
    thus field(R|_2 X) c= X by WELLORD1:13;
    let x be object;
    assume x in X;
    then [x,x] in R & [x,x] in [:X,X:] by A1,ZFMISC_1:87;
    then [x,x] in R|_2 X by XBOOLE_0:def 4;
    hence thesis by RELAT_1:15;
  end;
  R|_2 X is_reflexive_in X
  proof
    let x be object;
    assume x in X;
    then [x,x] in R & [x,x] in [:X,X:] by A1,ZFMISC_1:87;
    hence thesis by XBOOLE_0:def 4;
  end;
  then R|_2 X well_orders X by A15,A6,A21,A9;
  hence thesis by A25,WELLORD1:4;
end;
