reserve a,b,c,d for Ordinal;
reserve l for non empty limit_ordinal Ordinal;
reserve u for Element of l;
reserve A for non empty Ordinal;
reserve e for Element of A;
reserve X,Y,x,y,z for set;
reserve n,m for Nat;
reserve f for Ordinal-Sequence;

theorem Th24:
  for X,Y being ordinal-membered set
  st for x,y st x in X & y in Y holds x in y
  holds (numbering X)^(numbering Y) is_isomorphism_of
  RelIncl ((ord-type X)+^(ord-type Y)), RelIncl (X \/ Y)
  proof
    let X,Y be ordinal-membered set; assume
A1: for x,y st x in X & y in Y holds x in y;
    set f = numbering X, g = numbering Y;
    set a = ord-type X, b = ord-type Y;
    set R = RelIncl(a+^b), Q = RelIncl(X\/Y);
    set R1 = RelIncl a, Q1 = RelIncl(X);
    set R2 = RelIncl b, Q2 = RelIncl(Y);
A2:  dom(f^g) = (dom f)+^dom g by ORDINAL4:def 1;
A3: dom f = a & dom g = b by Th18;
A4: rng f = X & rng g = Y by Th19;
A5: f is_isomorphism_of RelIncl a, RelIncl On X &
    g is_isomorphism_of RelIncl b, RelIncl On Y by Th21; then
A6: f is one-to-one & g is one-to-one;
    thus
A7: dom(f^g) = (dom f)+^dom g by ORDINAL4:def 1
    .= field R by A3,WELLORD2:def 1;
    thus rng(f^g) = (rng f)\/rng g by Th10
    .= field Q by A4,WELLORD2:def 1; then
A8: rng(f^g) = X\/Y by WELLORD2:def 1;
A9: On X = X & On Y = Y by Th2;
    thus f^g is one-to-one
    proof
      let x,y be object; assume
A10:   x in dom(f^g) & y in dom(f^g) & (f^g).x = (f^g).y; then
      reconsider a = x, b = y as Ordinal;
      per cases by ORDINAL1:16;
      suppose
A11:     x in dom f & y in dom f; then
        (f^g).x = f.x & (f^g).y = f.y by ORDINAL4:def 1;
        hence thesis by A6,A10,A11;
      end;
      suppose
A12:     x in dom f & dom f c= b; then
A13:     (dom f)+^(b-^dom f) = y by ORDINAL3:def 5; then
A14:     b-^dom f in dom g by A2,A10,ORDINAL3:22; then
        (f^g).x = f.x & (f^g).y = g.(b-^dom f) by A12,A13,ORDINAL4:def 1; then
        f.x in X & f.x in Y by A4,A10,A12,A14,FUNCT_1:def 3; then
        f.x in f.x by A1;
        hence thesis;
      end;
      suppose
A15:     dom f c= a & y in dom f; then
A16:     (dom f)+^(a-^dom f) = x by ORDINAL3:def 5; then
A17:     a-^dom f in dom g by A2,A10,ORDINAL3:22; then
        (f^g).y = f.y & (f^g).x = g.(a-^dom f) by A15,A16,ORDINAL4:def 1; then
        f.y in X & f.y in Y by A4,A10,A15,A17,FUNCT_1:def 3; then
        f.y in f.y by A1;
        hence thesis;
      end;
      suppose dom f c= a & dom f c= b; then
A18:     (dom f)+^(a-^dom f) = x & (dom f)+^(b-^dom f) = y
        by ORDINAL3:def 5; then
A19:     a-^dom f in dom g & b-^dom f in dom g by A2,A10,ORDINAL3:22; then
        (f^g).y = g.(b-^dom f) & (f^g).x = g.(a-^dom f) by A18,ORDINAL4:def 1;
        hence thesis by A6,A10,A18,A19;
      end;
    end;
    let x,y be object;
A20: field R = a+^b by WELLORD2:def 1;
    hereby assume
A21:   [x,y] in R;
      hence
A22:   x in field R & y in field R by RELAT_1:15;
       reconsider xx=x, yy=y as set by TARSKI:1;
A23:   xx c= yy by A21,A20,WELLORD2:def 1,A22;
A24:   (f^g).x in X\/Y & (f^g).y in X\/Y by A7,A8,A22,FUNCT_1:def 3;
      thus [(f^g).x,(f^g).y] in Q
      proof
        reconsider x,y as Ordinal by A20,A22;
        per cases by ORDINAL1:16;
        suppose
A25:       x in dom f & y in dom f; then
A26:       [x,y] in RelIncl a by A3,A23,WELLORD2:def 1;
          (f^g).x = f.x & (f^g).y = f.y by A25,ORDINAL4:def 1; then
A27:       [(f^g).x, (f^g).y] in Q1 by A9,A5,A26; then
          (f^g).x in field Q1 & (f^g).y in field Q1 by RELAT_1:15; then
          (f^g).x in X & (f^g).y in X by WELLORD2:def 1; then
          (f^g).x c= (f^g).y by A27,WELLORD2:def 1;
          hence thesis by A24,WELLORD2:def 1;
        end;
        suppose
A28:       x in dom f & dom f c= y; then
A29:       (dom f)+^(y-^dom f) = y by ORDINAL3:def 5; then
A30:       y-^dom f in dom g by A3,A20,A22,ORDINAL3:22; then
          (f^g).x = f.x & (f^g).y = g.(y-^dom f) by A28,A29,ORDINAL4:def 1;
then
          (f^g).x in X & (f^g).y in Y by A4,A28,A30,FUNCT_1:def 3; then
          (f^g).x in (f^g).y by A1; then
          (f^g).x c= (f^g).y by ORDINAL1:def 2;
          hence thesis by A24,WELLORD2:def 1;
        end;
        suppose
          dom f c= x & y in dom f; then
          y in x; then
          y in y by A23;
          hence thesis;
        end;
        suppose dom f c= x & dom f c= y; then
A31:       (dom f)+^(x-^dom f) = x & (dom f)+^(y-^dom f) = y
          by ORDINAL3:def 5; then
A32:       x-^dom f in dom g & y-^dom f in dom g by A3,A20,A22,ORDINAL3:22;
          x-^a c= y-^a by A23,ORDINAL3:59; then
A33:       [x-^a,y-^a] in RelIncl b by A32,A3,WELLORD2:def 1;
          (f^g).y = g.(y-^dom f) & (f^g).x = g.(x-^dom f)
          by A31,A32,ORDINAL4:def 1; then
A34:       [(f^g).x, (f^g).y] in Q2 by A9,A3,A5,A33; then
          (f^g).x in field Q2 & (f^g).y in field Q2 by RELAT_1:15; then
          (f^g).x in Y & (f^g).y in Y by WELLORD2:def 1; then
          (f^g).x c= (f^g).y by A34,WELLORD2:def 1;
          hence thesis by A24,WELLORD2:def 1;
        end;
      end;
    end;
    assume
A35: x in field R & y in field R & [(f^g).x,(f^g).y] in Q; then
A36: (f^g).x c= (f^g).y by Th8;
    reconsider x,y as Ordinal by A20,A35;
    per cases by ORDINAL1:16;
    suppose
A37:   x in dom f & y in dom f; then
A38:   (f^g).x = f.x & (f^g).y = f.y by ORDINAL4:def 1;
      f.x in X & f.y in X by A4,A37,FUNCT_1:def 3; then
      [f.x, f.y] in Q1 by A38,A36,WELLORD2:def 1; then
      [x,y] in R1 by A9,A37,A5; then
      x c= y by Th8;
      hence thesis by A20,A35,WELLORD2:def 1;
    end;
    suppose
      x in dom f & dom f c= y; then
      x c= y by ORDINAL1:def 2;
      hence thesis by A20,A35,WELLORD2:def 1;
    end;
    suppose
A39:   dom f c= x & y in dom f; then
A40:   (f^g).y = f.y by ORDINAL4:def 1;
A41:   f.y in X by A4,A39,FUNCT_1:def 3;
A42:   (dom f)+^(x-^dom f) = x by A39,ORDINAL3:def 5; then
A43:   x-^dom f in dom g by A3,A20,A35,ORDINAL3:22; then
A44:   (f^g).x = g.(x-^dom f) by A42,ORDINAL4:def 1;
      g.(x-^dom f) in Y by A4,A43,FUNCT_1:def 3; then
      (f^g).y in (f^g).x by A40,A41,A44,A1; then
      (f^g).y in (f^g).y by A36;
      hence thesis;
    end;
    suppose dom f c= x & dom f c= y; then
A45:   (dom f)+^(x-^dom f) = x & (dom f)+^(y-^dom f) = y
      by ORDINAL3:def 5; then
A46:   x-^dom f in dom g & y-^dom f in dom g by A3,A20,A35,ORDINAL3:22; then
A47:   g.(y-^dom f) in Y & g.(x-^dom f) in Y by A4,FUNCT_1:def 3;
      (f^g).y = g.(y-^dom f) & (f^g).x = g.(x-^dom f)
      by A45,A46,ORDINAL4:def 1; then
      [g.(x-^dom f), g.(y-^dom f)] in Q2
      by A47,A36,WELLORD2:def 1; then
      [(x-^dom f), (y-^dom f)] in R2 by A9,A5,A46; then
      x-^dom f c= y-^dom f by Th8; then
      x c= y by A45,ORDINAL3:18;
      hence thesis by A20,A35,WELLORD2:def 1;
    end;
  end;
