
theorem Th38:
  for O1,O2 being ordinal number, C1 being O1 -ordered preorder category,
  C2 being O2 -ordered preorder category holds O1 = O2 iff C1 ~= C2
  proof
    let O1,O2 be ordinal number;
    let C1 be O1 -ordered preorder category;
    let C2 be O2 -ordered preorder category;
    thus O1 = O2 implies C1 ~= C2
    proof
      assume
A1:   O1 = O2;
      per cases;
      suppose O1 is empty;
        hence thesis by A1,Th13;
      end;
      suppose
A2:     O1 is non empty;
        then reconsider D1 = C1, D2 = C2 as non empty category by A1;
        consider F1 be Function such that
A3:     F1 is_isomorphism_of RelOb(C1), RelIncl(O1) by Def14,WELLORD1:def 8;
        consider F2 be Function such that
A4:     F2 is_isomorphism_of RelOb(C2), RelIncl(O2) by Def14,WELLORD1:def 8;
A5:     F2" is_isomorphism_of RelIncl(O2), RelOb(C2) by A4,WELLORD1:39;
        set F3 = (F2") * F1;
A6:     F3 is_isomorphism_of RelOb(C1), RelOb(C2) by A1,A3,A5,WELLORD1:41;
        consider F4 be Function of C1, RelOb(C1) such that
A7:     F4 is bijective &
        for f being morphism of C1 holds F4.f = [dom f,cod f] by A2,Th36;
        consider F5 be Function of C2, RelOb(C2) such that
A8:     F5 is bijective &
        for f being morphism of C2 holds F5.f = [dom f,cod f] by A1,A2,Th36;
A9:     dom F3 = field RelOb(C1) & rng F3 = field RelOb(C2) &
        F3 is one-to-one &
        for a,b being set holds [a,b] in RelOb(C1) iff (a in field RelOb(C1) &
        b in field RelOb(C1) & [F3.a, F3.b] in RelOb(C2)) by A6,WELLORD1:def 7;
A10:     field RelOb(C1) = dom RelOb(C1) \/ rng RelOb(C1) by RELAT_1:def 6
        .= dom RelOb(C1) \/ Ob C1 by Th34
        .= Ob(C1) \/ Ob C1 by Th34
        .= Ob C1;
        defpred P[object,object] means for a,b being set st $1 = [a,b] holds
        $2 = [F3.a, F3.b];
A11:    for x being Element of RelOb(D1)
        ex y being Element of RelOb(D2) st P[x,y]
        proof
          let x be Element of RelOb(D1);
          x in RelOb(D1);
          then consider o1,o2 be Object of D1 such that
A12:      x = [o1,o2] & ex f being morphism of D1 st f in Hom(o1,o2);
          reconsider y = [F3.o1,F3.o2] as Element of RelOb(D2)
          by A12,A6,WELLORD1:def 7;
          take y;
          for a,b being set st x = [a,b] holds y = [F3.a, F3.b]
          proof
            let a,b be set;
            assume x = [a,b];
            then a = o1 & b = o2 by A12,XTUPLE_0:1;
            hence y = [F3.a, F3.b];
          end;
          hence P[x,y];
        end;
        consider F33 be Function of RelOb(D1), RelOb(D2) such that
A13:    for x being Element of RelOb(D1) holds P[x,F33.x]
        from FUNCT_2:sch 3(A11);
A14:    rng F5 = dom(F5") & dom F5 = rng(F5") by A8,FUNCT_1:33;
        set F = F5" * F33 * F4;
        rng F33 c= RelOb(C2);
        then rng F33 c= rng F5 by A8,FUNCT_2:def 3;
        then
A15:    dom (F5" * F33) = dom F33 by A14,RELAT_1:27;
        RelOb(C1) c= dom F33 by FUNCT_2:def 1;
        then rng F4 c= dom F33 by XBOOLE_1:1;
        then
A16:    dom F = dom F4 by A15,RELAT_1:27;
        then
A17:    dom F = the carrier of C1 by FUNCT_2:def 1;
        for y being object st y in RelOb(C2) holds y in rng F33
        proof
          let y be object;
          assume y in RelOb(C2);
          then consider o1,o2 be Object of C2 such that
A18:      y = [o1,o2] & ex g being morphism of C2 st g in Hom(o1,o2);
A19:      rng F3 = dom RelOb(C2) \/ rng RelOb(C2) by A9,RELAT_1:def 6
          .= dom RelOb(C2) \/ Ob C2 by Th34
          .= Ob(C2) \/ Ob C2 by Th34
          .= Ob D2;
          consider x1 be object such that
A20:      x1 in dom F3 & o1 = F3.x1 by A19,FUNCT_1:def 3;
          consider x2 be object such that
A21:      x2 in dom F3 & o2 = F3.x2 by A19,FUNCT_1:def 3;
          reconsider x1,x2 as set by A20,A21;
          set x = [x1,x2];
A22:      x1 in field RelOb(C1) & x2 in field RelOb(C1)
          by A20,A21,A6,WELLORD1:def 7;
          [F3.x1, F3.x2] in  RelOb(C2) by A18,A20,A21;
          then reconsider x as Element of RelOb(D1)
          by A22,A6,WELLORD1:def 7;
A23:      dom F33 = RelOb(D1) by FUNCT_2:def 1;
          F33.x = [F3.x1,F3.x2] by A13;
          hence y in rng F33 by A23,A18,A20,A21,FUNCT_1:def 3;
        end;
        then RelOb(C2) c= rng F33 by TARSKI:def 3;
        then rng F5 c= rng F33 by A8,FUNCT_2:def 3;
        then rng(F5" * F33) = rng(F5") by A14,RELAT_1:28;
        then
A24:    rng(F5" * F33) = the carrier of C2 by A14,FUNCT_2:def 1;
        dom F33 c= RelOb(C1);
        then dom F33 c= rng F4 by A7,FUNCT_2:def 3;
        then
A25:    rng F = the carrier of C2 by A24,A15,RELAT_1:28;
        then reconsider F as Functor of C1,C2 by A17,FUNCT_2:1;
        for x1,x2 being object st x1 in dom F33 & x2 in dom F33 &
        F33.x1 = F33.x2 holds x1 = x2
        proof
          let x1,x2 be object;
          assume x1 in dom F33;
          then x1 in RelOb(D1);
          then consider o11,o12 be Object of D1 such that
A26:      x1 = [o11,o12] & ex f1 being morphism of D1 st f1 in Hom(o11,o12);
A27:      [o11,o12] in RelOb(C1) by A26;
          reconsider x11=x1 as Element of RelOb(D1) by A26,A27;
          assume x2 in dom F33;
          then x2 in RelOb(D1);
          then consider o21,o22 be Object of D1 such that
A28:      x2 = [o21,o22] & ex f1 being morphism of D1 st f1 in Hom(o21,o22);
A29:      [o21,o22] in RelOb(C1) by A28;
          reconsider x22=x2 as Element of RelOb(D1) by A28,A29;
          assume
A30:      F33.x1 = F33.x2;
          F33.x11 = [F3.o11,F3.o12] & F33.x22 = [F3.o21,F3.o22] by A13,A26,A28;
          then F3.o11 = F3.o21 & F3.o12 = F3.o22 by A30,XTUPLE_0:1;
          then o11 = o21 & o12 = o22 by A10,A9,FUNCT_1:def 4;
          hence x1 = x2 by A26,A28;
        end;
        then
A31:    F33 is one-to-one by FUNCT_1:def 4;
A32:    F is onto by A25,FUNCT_2:def 3;
A33:    for f being morphism of C1 holds dom(F.f) = F3.(dom f) &
        cod(F.f) = F3.(cod f)
        proof
          let f be morphism of C1;
          reconsider x = f as object;
          x in Mor C1 by A2,SUBSET_1:def 1;
          then
A34:      x in dom F4 by A17,A16,CAT_6:def 1;
          f in Hom(dom f, cod f) by A2,Th20;
          then
A35:      [dom f, cod f] in RelOb(D1);
          then
A36:      [dom f, cod f] in dom F33 by FUNCT_2:def 1;
          reconsider x1 = [dom f, cod f] as Element of RelOb(D1) by A35;
A37:      for a,b being set st x1 = [a,b] holds F33.x1 = [F3.a, F3.b] by A13;
          [F3.(dom f), F3.(cod f)] in RelOb(C2) by A35,A6,WELLORD1:def 7;
          then
A38:      [F3.(dom f), F3.(cod f)] in rng F5 by A8,FUNCT_2:def 3;
A39:      F.f = ((F5" * F33) * F4).x by CAT_6:def 21
          .= (F5" * F33).(F4.x) by A34,FUNCT_1:13
          .= (F5" * F33).[dom f, cod f] by A7
          .= (F5").(F33.[dom f, cod f]) by A36,FUNCT_1:13
          .= (F5").[F3.(dom f), F3.(cod f)] by A37;
          [dom(F.f), cod(F.f)]
          = F5.((F5").[F3.(dom f), F3.(cod f)]) by A8,A39
          .= [F3.(dom f), F3.(cod f)] by A8,A38,FUNCT_1:35;
          hence thesis by XTUPLE_0:1;
        end;
        for f1,f2 being morphism of C1 st f1 |> f2 holds F.f1 |> F.f2 &
        F.(f1(*)f2) = (F.f1) (*) (F.f2)
        proof
          let f1,f2 be morphism of C1;
          assume
A40:      f1 |> f2;
          dom(F.f1) = F3.(dom f1) by A33
          .= F3.(cod f2) by A2,A40,Th5
          .= cod(F.f2) by A33;
          hence
A41:      F.f1 |> F.f2 by Th5;
          set g1 = F.(f1(*)f2);
          set g2 = (F.f1) (*) (F.f2);
A42:      dom g1 = F3.(dom(f1(*)f2)) by A33
          .= F3.(dom f2) by A40,Th4
          .= dom(F.f2) by A33
          .= dom g2 by A41,Th4;
A43:      cod g1 = F3.(cod(f1(*)f2)) by A33
          .= F3.(cod f1) by A40,Th4
          .= cod(F.f1) by A33
          .= cod g2 by A41,Th4;
A44:      g1 in Hom(dom g1, cod g1) by Th20;
          g2 in Hom(dom g1, cod g1) by A42,A43,Th20;
          hence F.(f1(*)f2) = (F.f1) (*) (F.f2) by A44,Def12;
        end;
        then
A45:    F is multiplicative by CAT_6:def 23;
        for f being morphism of C1 st f is identity holds F.f is identity
        proof
          let f be morphism of C1;
          assume
A46:      f is identity;
          then
A47:      dom f = f by Th6 .= cod f by A46,Th6;
A48:      for g1 being morphism of C2 st (F.f) |> g1 holds (F.f) (*) g1 = g1
          proof
            let g1 be morphism of C2;
            assume
A49:        (F.f) |> g1;
            set g2 = (F.f) (*) g1;
A50:        dom g2 = dom g1 by A49,Th4;
A51:        cod g2 = cod(F.f) by A49,Th4
            .= F3.(dom f) by A33,A47
            .= dom(F.f) by A33
            .= cod g1 by A49,Th5;
A52:        g1 in Hom(dom g1, cod g1) by A1,A2,Th20;
            g2 in Hom(dom g1, cod g1) by A50,A51,Th20;
            hence (F.f) (*) g1 = g1 by A52,Def12;
          end;
          then F.f is left_identity by CAT_6:def 4;
          then F.f is right_identity by CAT_6:9;
          hence F.f is identity by A48,CAT_6:def 4,def 14;
        end;
        then F is identity-preserving by CAT_6:def 22;
        hence C1 ~= C2 by A32,Th12,A45,CAT_6:def 25,A8,A7,A31;
      end;
    end;
    thus C1 ~= C2 implies O1 = O2
    proof
      assume C1 ~= C2;
      then
A53:  RelOb(C1), RelOb(C2) are_isomorphic by Th35;
A54:  RelOb(C1), RelIncl(O1) are_isomorphic by Def14;
      RelOb(C2), RelIncl(O2) are_isomorphic by Def14;
      then RelOb(C1), RelIncl(O2) are_isomorphic by A53,WELLORD1:42;
      then RelIncl(O2), RelOb(C1) are_isomorphic by WELLORD1:40;
      hence O1 = O2 by A54,WELLORD1:42,WELLORD2:10;
    end;
  end;
