reserve A,B,a,b,c,d,e,f,g,h for set;

theorem Th24:
  for G being non empty irreflexive RelStr holds G embeds Necklace
  4 iff ComplRelStr G embeds Necklace 4
proof
  let G be non empty irreflexive RelStr;
  set N4 = Necklace 4, CmpN4 = ComplRelStr Necklace 4, CmpG = ComplRelStr G;
A1: the carrier of CmpG = the carrier of G by NECKLACE:def 8;
A2: the carrier of Necklace 4 = {0,1,2,3} by NECKLACE:1,20;
  then
A3: 0 in the carrier of N4 by ENUMSET1:def 2;
A4: the carrier of CmpN4 = the carrier of N4 by NECKLACE:def 8;
  thus G embeds N4 implies CmpG embeds N4
  proof
    CmpN4,N4 are_isomorphic by NECKLACE:29,WAYBEL_1:6;
    then consider g being Function of CmpN4,N4 such that
A5: g is isomorphic by WAYBEL_1:def 8;
    assume G embeds Necklace 4;
    then consider f being Function of N4,G such that
A6: f is one-to-one and
A7: for x,y being Element of N4 holds [x,y] in the InternalRel of N4
    iff [f.x,f.y] in the InternalRel of G;
    reconsider h = f*g as Function of CmpN4,G;
A8: g is one-to-one monotone by A5,WAYBEL_0:def 38;
A9: for x,y being Element of CmpN4 holds [x,y] in the InternalRel of
    CmpN4 iff [h.x,h.y] in the InternalRel of G
    proof
      let x,y be Element of CmpN4;
      thus [x,y] in the InternalRel of CmpN4 implies [h.x,h.y] in the
      InternalRel of G
      proof
        assume [x,y] in the InternalRel of CmpN4;
        then x <= y by ORDERS_2:def 5;
        then g.x <= g.y by A8,WAYBEL_1:def 2;
        then [g.x,g.y] in the InternalRel of N4 by ORDERS_2:def 5;
        then [f.(g.x),f.(g.y)] in the InternalRel of G by A7;
        then [(f*g).x,f.(g.y)] in the InternalRel of G by FUNCT_2:15;
        hence thesis by FUNCT_2:15;
      end;
      assume [h.x,h.y] in the InternalRel of G;
      then [f.(g.x),h.y] in the InternalRel of G by FUNCT_2:15;
      then [f.(g.x),f.(g.y)] in the InternalRel of G by FUNCT_2:15;
      then [g.x,g.y] in the InternalRel of N4 by A7;
      then g.x <= g.y by ORDERS_2:def 5;
      then x <= y by A5,WAYBEL_0:66;
      hence thesis by ORDERS_2:def 5;
    end;
A10: 0 in the carrier of CmpN4 by A2,A4,ENUMSET1:def 2;
A11: 1 in the carrier of CmpN4 by A2,A4,ENUMSET1:def 2;
A12: dom h = the carrier of CmpN4 by FUNCT_2:def 1;
A13: [h.0,h.1] in the InternalRel of CmpG
    proof
      assume
A14:  not thesis;
      [h.0,h.1] in the InternalRel of G
      proof
        h.0 in the carrier of G & h.1 in the carrier of G by A10,A11,FUNCT_2:5;
        then [h.0,h.1] in [:the carrier of G,the carrier of G:] by ZFMISC_1:87;
        then
        [h.0,h.1] in id (the carrier of G) \/ (the InternalRel of G) \/ (
        the InternalRel of CmpG) by Th14;
        then
A15:    [h.0,h.1] in id (the carrier of G) \/ (the InternalRel of G) or [
        h.0,h.1] in the InternalRel of CmpG by XBOOLE_0:def 3;
        assume not thesis;
        then [h.0,h.1] in id (the carrier of G) by A14,A15,XBOOLE_0:def 3;
        then h.0 = h.1 by RELAT_1:def 10;
        hence contradiction by A6,A8,A12,A10,A11,FUNCT_1:def 4;
      end;
      then
A16:  [0,1] in the InternalRel of CmpN4 by A9,A10,A11;
      [0,1] in the InternalRel of N4 by ENUMSET1:def 4,NECKLA_2:2;
      then [0,1] in (the InternalRel of N4) /\ (the InternalRel of CmpN4) by
A16,XBOOLE_0:def 4;
      then the InternalRel of N4 meets the InternalRel of CmpN4;
      hence thesis by Th12;
    end;
A17: 2 in the carrier of CmpN4 by A2,A4,ENUMSET1:def 2;
A18: [h.1,h.2] in the InternalRel of CmpG
    proof
      assume
A19:  not thesis;
      [h.1,h.2] in the InternalRel of G
      proof
        h.1 in the carrier of G & h.2 in the carrier of G by A11,A17,FUNCT_2:5;
        then [h.1,h.2] in [:the carrier of G,the carrier of G:] by ZFMISC_1:87;
        then
        [h.1,h.2] in id (the carrier of G) \/ (the InternalRel of G) \/ (
        the InternalRel of CmpG) by Th14;
        then
A20:    [h.1,h.2] in id (the carrier of G) \/ (the InternalRel of G) or [
        h.1,h.2] in the InternalRel of CmpG by XBOOLE_0:def 3;
        assume not thesis;
        then [h.1,h.2] in id (the carrier of G) by A19,A20,XBOOLE_0:def 3;
        then h.1 = h.2 by RELAT_1:def 10;
        hence contradiction by A6,A8,A12,A11,A17,FUNCT_1:def 4;
      end;
      then
A21:  [1,2] in the InternalRel of CmpN4 by A9,A11,A17;
      [1,2] in the InternalRel of N4 by ENUMSET1:def 4,NECKLA_2:2;
      then [1,2] in (the InternalRel of N4) /\ (the InternalRel of CmpN4) by
A21,XBOOLE_0:def 4;
      then the InternalRel of N4 meets the InternalRel of CmpN4;
      hence thesis by Th12;
    end;
A22: 3 in the carrier of CmpN4 by A2,A4,ENUMSET1:def 2;
A23: [h.2,h.3] in the InternalRel of CmpG
    proof
      assume
A24:  not thesis;
      [h.2,h.3] in the InternalRel of G
      proof
        h.2 in the carrier of G & h.3 in the carrier of G by A17,A22,FUNCT_2:5;
        then [h.2,h.3] in [:the carrier of G,the carrier of G:] by ZFMISC_1:87;
        then [h.2,h.3] in id (the carrier of G) \/ (the InternalRel of G) \/
        (the InternalRel of CmpG) by Th14;
        then
A25:    [h.2,h.3] in id (the carrier of G) \/ (the InternalRel of G) or
        [h.2,h.3] in the InternalRel of CmpG by XBOOLE_0:def 3;
        assume not thesis;
        then [h.2,h.3] in id (the carrier of G) by A24,A25,XBOOLE_0:def 3;
        then h.2 = h.3 by RELAT_1:def 10;
        hence contradiction by A6,A8,A12,A17,A22,FUNCT_1:def 4;
      end;
      then
A26:  [2,3] in the InternalRel of CmpN4 by A9,A17,A22;
      [2,3] in the InternalRel of N4 by ENUMSET1:def 4,NECKLA_2:2;
      then [2,3] in (the InternalRel of N4) /\ (the InternalRel of CmpN4) by
A26,XBOOLE_0:def 4;
      then the InternalRel of N4 meets the InternalRel of CmpN4;
      hence thesis by Th12;
    end;
    [3,1] in the InternalRel of CmpN4 by Th11,ENUMSET1:def 4;
    then
A27: [h.3,h.1] in the InternalRel of G by A9,A11,A22;
    [1,3] in the InternalRel of CmpN4 by Th11,ENUMSET1:def 4;
    then
A28: [h.1,h.3] in the InternalRel of G by A9,A11,A22;
    [3,0] in the InternalRel of CmpN4 by Th11,ENUMSET1:def 4;
    then
A29: [h.3,h.0] in the InternalRel of G by A9,A10,A22;
    [0,3] in the InternalRel of CmpN4 by Th11,ENUMSET1:def 4;
    then
A30: [h.0,h.3] in the InternalRel of G by A9,A10,A22;
A31: [h.1,h.0] in the InternalRel of CmpG
    proof
      assume
A32:  not thesis;
      [h.1,h.0] in the InternalRel of G
      proof
        h.0 in the carrier of G & h.1 in the carrier of G by A10,A11,FUNCT_2:5;
        then [h.1,h.0] in [:the carrier of G,the carrier of G:] by ZFMISC_1:87;
        then
        [h.1,h.0] in id (the carrier of G) \/ (the InternalRel of G) \/ (
        the InternalRel of CmpG) by Th14;
        then
A33:    [h.1,h.0] in id (the carrier of G) \/ (the InternalRel of G) or [
        h.1,h.0] in the InternalRel of CmpG by XBOOLE_0:def 3;
        assume not thesis;
        then [h.1,h.0] in id (the carrier of G) by A32,A33,XBOOLE_0:def 3;
        then h.0 = h.1 by RELAT_1:def 10;
        hence contradiction by A6,A8,A12,A10,A11,FUNCT_1:def 4;
      end;
      then
A34:  [1,0] in the InternalRel of CmpN4 by A9,A10,A11;
      [1,0] in the InternalRel of N4 by ENUMSET1:def 4,NECKLA_2:2;
      then [1,0] in (the InternalRel of N4) /\ (the InternalRel of CmpN4) by
A34,XBOOLE_0:def 4;
      then the InternalRel of N4 meets the InternalRel of CmpN4;
      hence thesis by Th12;
    end;
A35: [h.2,h.1] in the InternalRel of CmpG
    proof
      assume
A36:  not thesis;
      [h.2,h.1] in the InternalRel of G
      proof
        h.1 in the carrier of G & h.2 in the carrier of G by A11,A17,FUNCT_2:5;
        then [h.2,h.1] in [:the carrier of G,the carrier of G:] by ZFMISC_1:87;
        then
        [h.2,h.1] in id (the carrier of G) \/ (the InternalRel of G) \/ (
        the InternalRel of CmpG) by Th14;
        then
A37:    [h.2,h.1] in id (the carrier of G) \/ (the InternalRel of G) or [
        h.2,h.1] in the InternalRel of CmpG by XBOOLE_0:def 3;
        assume not thesis;
        then [h.2,h.1] in id (the carrier of G) by A36,A37,XBOOLE_0:def 3;
        then h.1 = h.2 by RELAT_1:def 10;
        hence contradiction by A6,A8,A12,A11,A17,FUNCT_1:def 4;
      end;
      then
A38:  [2,1] in the InternalRel of CmpN4 by A9,A11,A17;
      [2,1] in the InternalRel of N4 by ENUMSET1:def 4,NECKLA_2:2;
      then [2,1] in (the InternalRel of N4) /\ (the InternalRel of CmpN4) by
A38,XBOOLE_0:def 4;
      then the InternalRel of N4 meets the InternalRel of CmpN4;
      hence thesis by Th12;
    end;
A39: [h.3,h.2] in the InternalRel of CmpG
    proof
      assume
A40:  not thesis;
      [h.3,h.2] in the InternalRel of G
      proof
        h.2 in the carrier of G & h.3 in the carrier of G by A17,A22,FUNCT_2:5;
        then [h.3,h.2] in [:the carrier of G,the carrier of G:] by ZFMISC_1:87;
        then [h.3,h.2] in id (the carrier of G) \/ (the InternalRel of G) \/
        (the InternalRel of CmpG) by Th14;
        then
A41:    [h.3,h.2] in id (the carrier of G) \/ (the InternalRel of G) or
        [h.3,h.2] in the InternalRel of CmpG by XBOOLE_0:def 3;
        assume not thesis;
        then [h.3,h.2] in id (the carrier of G) by A40,A41,XBOOLE_0:def 3;
        then h.2 = h.3 by RELAT_1:def 10;
        hence contradiction by A6,A8,A12,A17,A22,FUNCT_1:def 4;
      end;
      then
A42:  [3,2] in the InternalRel of CmpN4 by A9,A17,A22;
      [3,2] in the InternalRel of N4 by ENUMSET1:def 4,NECKLA_2:2;
      then [3,2] in (the InternalRel of N4) /\ (the InternalRel of CmpN4) by
A42,XBOOLE_0:def 4;
      then the InternalRel of N4 meets the InternalRel of CmpN4;
      hence thesis by Th12;
    end;
    [2,0] in the InternalRel of CmpN4 by Th11,ENUMSET1:def 4;
    then
A43: [h.2,h.0] in the InternalRel of G by A9,A10,A17;
    [0,2] in the InternalRel of CmpN4 by Th11,ENUMSET1:def 4;
    then
A44: [h.0,h.2] in the InternalRel of G by A9,A10,A17;
    for x,y being Element of N4 holds [x,y] in the InternalRel of N4 iff
    [h.x,h.y] in the InternalRel of CmpG
    proof
      let x,y be Element of N4;
      thus [x,y] in the InternalRel of N4 implies [h.x,h.y] in the InternalRel
      of CmpG
      proof
        assume
A45:    [x,y] in the InternalRel of N4;
        per cases by A45,ENUMSET1:def 4,NECKLA_2:2;
        suppose
A46:      [x,y] = [0,1];
          then x = 0 by XTUPLE_0:1;
          hence thesis by A13,A46,XTUPLE_0:1;
        end;
        suppose
A47:      [x,y] = [1,0];
          then x = 1 by XTUPLE_0:1;
          hence thesis by A31,A47,XTUPLE_0:1;
        end;
        suppose
A48:      [x,y] = [1,2];
          then x = 1 by XTUPLE_0:1;
          hence thesis by A18,A48,XTUPLE_0:1;
        end;
        suppose
A49:      [x,y] = [2,1];
          then x = 2 by XTUPLE_0:1;
          hence thesis by A35,A49,XTUPLE_0:1;
        end;
        suppose
A50:      [x,y] = [2,3];
          then x = 2 by XTUPLE_0:1;
          hence thesis by A23,A50,XTUPLE_0:1;
        end;
        suppose
A51:      [x,y] = [3,2];
          then x = 3 by XTUPLE_0:1;
          hence thesis by A39,A51,XTUPLE_0:1;
        end;
      end;
      assume
A52:  [h.x,h.y] in the InternalRel of CmpG;
      per cases by A2,ENUMSET1:def 2;
      suppose
A53:    x = 0 & y = 0;
        then h.0 in the carrier of CmpG by A52,ZFMISC_1:87;
        hence thesis by A52,A53,NECKLACE:def 5;
      end;
      suppose
        x = 0 & y = 1;
        hence thesis by ENUMSET1:def 4,NECKLA_2:2;
      end;
      suppose
        x = 0 & y = 2;
        then [h.0,h.2] in (the InternalRel of G) /\ the InternalRel of CmpG
        by A44,A52,XBOOLE_0:def 4;
        then the InternalRel of G meets the InternalRel of CmpG;
        hence thesis by Th12;
      end;
      suppose
        x = 0 & y = 3;
        then [h.0,h.3] in (the InternalRel of G) /\ the InternalRel of CmpG
        by A30,A52,XBOOLE_0:def 4;
        then the InternalRel of G meets the InternalRel of CmpG;
        hence thesis by Th12;
      end;
      suppose
        x = 1 & y = 0;
        hence thesis by ENUMSET1:def 4,NECKLA_2:2;
      end;
      suppose
A54:    x = 1 & y = 1;
        then h.1 in the carrier of CmpG by A52,ZFMISC_1:87;
        hence thesis by A52,A54,NECKLACE:def 5;
      end;
      suppose
        x = 1 & y = 2;
        hence thesis by ENUMSET1:def 4,NECKLA_2:2;
      end;
      suppose
        x = 1 & y = 3;
        then [h.1,h.3] in (the InternalRel of G) /\ the InternalRel of CmpG
        by A28,A52,XBOOLE_0:def 4;
        then the InternalRel of G meets the InternalRel of CmpG;
        hence thesis by Th12;
      end;
      suppose
        x = 2 & y = 0;
        then [h.2,h.0] in (the InternalRel of G) /\ the InternalRel of CmpG
        by A43,A52,XBOOLE_0:def 4;
        then the InternalRel of G meets the InternalRel of CmpG;
        hence thesis by Th12;
      end;
      suppose
        x = 2 & y = 1;
        hence thesis by ENUMSET1:def 4,NECKLA_2:2;
      end;
      suppose
A55:    x = 2 & y = 2;
        then h.2 in the carrier of CmpG by A52,ZFMISC_1:87;
        hence thesis by A52,A55,NECKLACE:def 5;
      end;
      suppose
        x = 2 & y = 3;
        hence thesis by ENUMSET1:def 4,NECKLA_2:2;
      end;
      suppose
        x = 3 & y = 0;
        then [h.3,h.0] in (the InternalRel of G) /\ the InternalRel of CmpG
        by A29,A52,XBOOLE_0:def 4;
        then the InternalRel of G meets the InternalRel of CmpG;
        hence thesis by Th12;
      end;
      suppose
        x = 3 & y = 1;
        then [h.3,h.1] in (the InternalRel of G) /\ the InternalRel of CmpG
        by A27,A52,XBOOLE_0:def 4;
        then the InternalRel of G meets the InternalRel of CmpG;
        hence thesis by Th12;
      end;
      suppose
        x = 3 & y = 2;
        hence thesis by ENUMSET1:def 4,NECKLA_2:2;
      end;
      suppose
A56:    x = 3 & y = 3;
        then h.3 in the carrier of CmpG by A52,ZFMISC_1:87;
        hence thesis by A52,A56,NECKLACE:def 5;
      end;
    end;
    hence thesis by A4,A1,A6,A8;
  end;
  assume CmpG embeds N4;
  then consider f being Function of N4, CmpG such that
A57: f is one-to-one and
A58: for x,y being Element of N4 holds [x,y] in the InternalRel of N4
  iff [f.x,f.y] in the InternalRel of CmpG;
  consider g being Function of N4,CmpN4 such that
A59: g is isomorphic by NECKLACE:29,WAYBEL_1:def 8;
A60: 2 in the carrier of N4 by A2,ENUMSET1:def 2;
A61: dom f = the carrier of N4 by FUNCT_2:def 1;
A62: [f.0,f.2] in the InternalRel of G
  proof
    assume
A63: not thesis;
    [f.0,f.2] in the InternalRel of CmpG
    proof
      f.0 in the carrier of CmpG & f.2 in the carrier of CmpG by A3,A60,
FUNCT_2:5;
      then [f.0,f.2] in [:the carrier of G,the carrier of G:] by A1,ZFMISC_1:87
;
      then [f.0,f.2] in id (the carrier of G) \/ (the InternalRel of G) \/ (
      the InternalRel of CmpG) by Th14;
      then
A64:  [f.0,f.2] in id (the carrier of G) \/ (the InternalRel of G) or [f
      .0,f.2] in the InternalRel of CmpG by XBOOLE_0:def 3;
      assume not thesis;
      then [f.0,f.2] in id (the carrier of G) by A63,A64,XBOOLE_0:def 3;
      then f.0 = f.2 by RELAT_1:def 10;
      hence contradiction by A57,A61,A3,A60,FUNCT_1:def 4;
    end;
    then
A65: [0,2] in the InternalRel of N4 by A58,A3,A60;
    [0,2] in the InternalRel of CmpN4 by Th11,ENUMSET1:def 4;
    then [0,2] in (the InternalRel of N4) /\ (the InternalRel of CmpN4) by A65,
XBOOLE_0:def 4;
    then the InternalRel of N4 meets the InternalRel of CmpN4;
    hence thesis by Th12;
  end;
A66: 3 in the carrier of N4 by A2,ENUMSET1:def 2;
A67: [f.0,f.3] in the InternalRel of G
  proof
    assume
A68: not [f.0,f.3] in the InternalRel of G;
    [f.0,f.3] in the InternalRel of CmpG
    proof
      f.0 in the carrier of CmpG & f.3 in the carrier of CmpG by A3,A66,
FUNCT_2:5;
      then [f.0,f.3] in [:the carrier of G,the carrier of G:] by A1,ZFMISC_1:87
;
      then [f.0,f.3] in id (the carrier of G) \/ (the InternalRel of G) \/ (
      the InternalRel of CmpG) by Th14;
      then
A69:  [f.0,f.3] in id (the carrier of G) \/ (the InternalRel of G) or [f
      .0,f.3] in the InternalRel of CmpG by XBOOLE_0:def 3;
      assume not thesis;
      then [f.0,f.3] in id (the carrier of G) by A68,A69,XBOOLE_0:def 3;
      then f.0 = f.3 by RELAT_1:def 10;
      hence contradiction by A57,A61,A3,A66,FUNCT_1:def 4;
    end;
    then
A70: [0,3] in the InternalRel of N4 by A58,A3,A66;
    [0,3] in the InternalRel of CmpN4 by Th11,ENUMSET1:def 4;
    then [0,3] in (the InternalRel of N4) /\ (the InternalRel of CmpN4) by A70,
XBOOLE_0:def 4;
    then the InternalRel of N4 meets the InternalRel of CmpN4;
    hence thesis by Th12;
  end;
A71: 1 in the carrier of N4 by A2,ENUMSET1:def 2;
A72: [f.1,f.3] in the InternalRel of G
  proof
    assume
A73: not [f.1,f.3] in the InternalRel of G;
    [f.1,f.3] in the InternalRel of CmpG
    proof
      f.1 in the carrier of CmpG & f.3 in the carrier of CmpG by A71,A66,
FUNCT_2:5;
      then [f.1,f.3] in [:the carrier of G,the carrier of G:] by A1,ZFMISC_1:87
;
      then [f.1,f.3] in id (the carrier of G) \/ (the InternalRel of G) \/ (
      the InternalRel of CmpG) by Th14;
      then
A74:  [f.1,f.3] in id (the carrier of G) \/ (the InternalRel of G) or [f
      .1,f.3] in the InternalRel of CmpG by XBOOLE_0:def 3;
      assume not thesis;
      then [f.1,f.3] in id (the carrier of G) by A73,A74,XBOOLE_0:def 3;
      then f.1 = f.3 by RELAT_1:def 10;
      hence contradiction by A57,A61,A71,A66,FUNCT_1:def 4;
    end;
    then
A75: [1,3] in the InternalRel of N4 by A58,A71,A66;
    [1,3] in the InternalRel of CmpN4 by Th11,ENUMSET1:def 4;
    then [1,3] in (the InternalRel of N4) /\ (the InternalRel of CmpN4) by A75,
XBOOLE_0:def 4;
    then the InternalRel of N4 meets the InternalRel of CmpN4;
    hence thesis by Th12;
  end;
  [3,2] in the InternalRel of N4 by ENUMSET1:def 4,NECKLA_2:2;
  then
A76: [f.3,f.2] in the InternalRel of CmpG by A58,A60,A66;
  [2,3] in the InternalRel of N4 by ENUMSET1:def 4,NECKLA_2:2;
  then
A77: [f.2,f.3] in the InternalRel of CmpG by A58,A60,A66;
  [1,2] in the InternalRel of N4 by ENUMSET1:def 4,NECKLA_2:2;
  then
A78: [f.1,f.2] in the InternalRel of CmpG by A58,A71,A60;
  [1,0] in the InternalRel of N4 by ENUMSET1:def 4,NECKLA_2:2;
  then
A79: [f.1,f.0] in the InternalRel of CmpG by A58,A3,A71;
A80: [f.2,f.0] in the InternalRel of G
  proof
    assume
A81: not [f.2,f.0] in the InternalRel of G;
    [f.2,f.0] in the InternalRel of CmpG
    proof
      f.0 in the carrier of CmpG & f.2 in the carrier of CmpG by A3,A60,
FUNCT_2:5;
      then [f.2,f.0] in [:the carrier of G,the carrier of G:] by A1,ZFMISC_1:87
;
      then [f.2,f.0] in id (the carrier of G) \/ (the InternalRel of G) \/ (
      the InternalRel of CmpG) by Th14;
      then
A82:  [f.2,f.0] in id (the carrier of G) \/ (the InternalRel of G) or [f
      .2,f.0] in the InternalRel of CmpG by XBOOLE_0:def 3;
      assume not thesis;
      then [f.2,f.0] in id (the carrier of G) by A81,A82,XBOOLE_0:def 3;
      then f.0 = f.2 by RELAT_1:def 10;
      hence contradiction by A57,A61,A3,A60,FUNCT_1:def 4;
    end;
    then
A83: [2,0] in the InternalRel of N4 by A58,A3,A60;
    [2,0] in the InternalRel of CmpN4 by Th11,ENUMSET1:def 4;
    then [2,0] in (the InternalRel of N4) /\ (the InternalRel of CmpN4) by A83,
XBOOLE_0:def 4;
    then the InternalRel of N4 meets the InternalRel of CmpN4;
    hence thesis by Th12;
  end;
A84: [f.3,f.0] in the InternalRel of G
  proof
    assume
A85: not [f.3,f.0] in the InternalRel of G;
    [f.3,f.0] in the InternalRel of CmpG
    proof
      f.0 in the carrier of CmpG & f.3 in the carrier of CmpG by A3,A66,
FUNCT_2:5;
      then [f.3,f.0] in [:the carrier of G,the carrier of G:] by A1,ZFMISC_1:87
;
      then [f.3,f.0] in id (the carrier of G) \/ (the InternalRel of G) \/ (
      the InternalRel of CmpG) by Th14;
      then
A86:  [f.3,f.0] in id (the carrier of G) \/ (the InternalRel of G) or [f
      .3,f.0] in the InternalRel of CmpG by XBOOLE_0:def 3;
      assume not thesis;
      then [f.3,f.0] in id (the carrier of G) by A85,A86,XBOOLE_0:def 3;
      then f.0 = f.3 by RELAT_1:def 10;
      hence contradiction by A57,A61,A3,A66,FUNCT_1:def 4;
    end;
    then
A87: [3,0] in the InternalRel of N4 by A58,A3,A66;
    [3,0] in the InternalRel of CmpN4 by Th11,ENUMSET1:def 4;
    then [3,0] in (the InternalRel of N4) /\ (the InternalRel of CmpN4) by A87,
XBOOLE_0:def 4;
    then the InternalRel of N4 meets the InternalRel of CmpN4;
    hence thesis by Th12;
  end;
A88: [f.3,f.1] in the InternalRel of G
  proof
    assume
A89: not [f.3,f.1] in the InternalRel of G;
    [f.3,f.1] in the InternalRel of CmpG
    proof
      f.1 in the carrier of CmpG & f.3 in the carrier of CmpG by A71,A66,
FUNCT_2:5;
      then [f.3,f.1] in [:the carrier of G,the carrier of G:] by A1,ZFMISC_1:87
;
      then [f.3,f.1] in id (the carrier of G) \/ (the InternalRel of G) \/ (
      the InternalRel of CmpG) by Th14;
      then
A90:  [f.3,f.1] in id (the carrier of G) \/ (the InternalRel of G) or [f
      .3,f.1] in the InternalRel of CmpG by XBOOLE_0:def 3;
      assume not thesis;
      then [f.3,f.1] in id (the carrier of G) by A89,A90,XBOOLE_0:def 3;
      then f.1 = f.3 by RELAT_1:def 10;
      hence contradiction by A57,A61,A71,A66,FUNCT_1:def 4;
    end;
    then
A91: [3,1] in the InternalRel of N4 by A58,A71,A66;
    [3,1] in the InternalRel of CmpN4 by Th11,ENUMSET1:def 4;
    then [3,1] in (the InternalRel of N4) /\ (the InternalRel of CmpN4) by A91,
XBOOLE_0:def 4;
    then the InternalRel of N4 meets the InternalRel of CmpN4;
    hence thesis by Th12;
  end;
  [2,1] in the InternalRel of N4 by ENUMSET1:def 4,NECKLA_2:2;
  then
A92: [f.2,f.1] in the InternalRel of CmpG by A58,A71,A60;
  [0,1] in the InternalRel of N4 by ENUMSET1:def 4,NECKLA_2:2;
  then
A93: [f.0,f.1] in the InternalRel of CmpG by A58,A3,A71;
A94: for x,y being Element of CmpN4 holds [x,y] in the InternalRel of CmpN4
  iff [f.x,f.y] in the InternalRel of G
  proof
    let x,y be Element of CmpN4;
A95: the carrier of N4 = the carrier of CmpN4 by NECKLACE:def 8;
    thus [x,y] in the InternalRel of CmpN4 implies [f.x,f.y] in the
    InternalRel of G
    proof
      assume
A96:  [x,y] in the InternalRel of CmpN4;
      per cases by A96,Th11,ENUMSET1:def 4;
      suppose
A97:    [x,y] = [0,2];
        then x = 0 by XTUPLE_0:1;
        hence thesis by A62,A97,XTUPLE_0:1;
      end;
      suppose
A98:    [x,y] = [2,0];
        then x = 2 by XTUPLE_0:1;
        hence thesis by A80,A98,XTUPLE_0:1;
      end;
      suppose
A99:    [x,y] = [0,3];
        then x = 0 by XTUPLE_0:1;
        hence thesis by A67,A99,XTUPLE_0:1;
      end;
      suppose
A100:   [x,y] = [3,0];
        then x = 3 by XTUPLE_0:1;
        hence thesis by A84,A100,XTUPLE_0:1;
      end;
      suppose
A101:   [x,y] = [1,3];
        then x = 1 by XTUPLE_0:1;
        hence thesis by A72,A101,XTUPLE_0:1;
      end;
      suppose
A102:   [x,y] = [3,1];
        then x = 3 by XTUPLE_0:1;
        hence thesis by A88,A102,XTUPLE_0:1;
      end;
    end;
    assume
A103: [f.x,f.y] in the InternalRel of G;
    per cases by A2,A95,ENUMSET1:def 2;
    suppose
A104: x = 0 & y = 0;
      then f.0 in the carrier of G by A103,ZFMISC_1:87;
      hence thesis by A103,A104,NECKLACE:def 5;
    end;
    suppose
      x = 0 & y = 1;
      then [f.0,f.1] in (the InternalRel of G) /\ the InternalRel of CmpG by
A93,A103,XBOOLE_0:def 4;
      then the InternalRel of G meets the InternalRel of CmpG;
      hence thesis by Th12;
    end;
    suppose
      x = 0 & y = 2;
      hence thesis by Th11,ENUMSET1:def 4;
    end;
    suppose
      x = 0 & y = 3;
      hence thesis by Th11,ENUMSET1:def 4;
    end;
    suppose
      x = 1 & y = 0;
      then [f.1,f.0] in (the InternalRel of G) /\ the InternalRel of CmpG by
A79,A103,XBOOLE_0:def 4;
      then the InternalRel of G meets the InternalRel of CmpG;
      hence thesis by Th12;
    end;
    suppose
      x = 2 & y = 0;
      hence thesis by Th11,ENUMSET1:def 4;
    end;
    suppose
      x = 3 & y = 0;
      hence thesis by Th11,ENUMSET1:def 4;
    end;
    suppose
A105: x = 1 & y = 1;
      then f.1 in the carrier of G by A103,ZFMISC_1:87;
      hence thesis by A103,A105,NECKLACE:def 5;
    end;
    suppose
      x = 1 & y = 2;
      then [f.1,f.2] in (the InternalRel of G) /\ the InternalRel of CmpG by
A78,A103,XBOOLE_0:def 4;
      then the InternalRel of G meets the InternalRel of CmpG;
      hence thesis by Th12;
    end;
    suppose
      x = 1 & y = 3;
      hence thesis by Th11,ENUMSET1:def 4;
    end;
    suppose
      x = 2 & y = 1;
      then [f.2,f.1] in (the InternalRel of G) /\ the InternalRel of CmpG by
A92,A103,XBOOLE_0:def 4;
      then the InternalRel of G meets the InternalRel of CmpG;
      hence thesis by Th12;
    end;
    suppose
A106: x = 2 & y = 2;
      then f.2 in the carrier of G by A103,ZFMISC_1:87;
      hence thesis by A103,A106,NECKLACE:def 5;
    end;
    suppose
      x = 2 & y = 3;
      then [f.2,f.3] in (the InternalRel of G) /\ the InternalRel of CmpG by
A77,A103,XBOOLE_0:def 4;
      then the InternalRel of G meets the InternalRel of CmpG;
      hence thesis by Th12;
    end;
    suppose
      x = 3 & y = 1;
      hence thesis by Th11,ENUMSET1:def 4;
    end;
    suppose
      x = 3 & y = 2;
      then [f.3,f.2] in (the InternalRel of G) /\ the InternalRel of CmpG by
A76,A103,XBOOLE_0:def 4;
      then the InternalRel of G meets the InternalRel of CmpG;
      hence thesis by Th12;
    end;
    suppose
A107: x = 3 & y = 3;
      then f.3 in the carrier of G by A103,ZFMISC_1:87;
      hence thesis by A103,A107,NECKLACE:def 5;
    end;
  end;
  reconsider f as Function of CmpN4,G by A4,NECKLACE:def 8;
  reconsider h = f*g as Function of N4,G;
A108: g is one-to-one monotone by A59,WAYBEL_0:def 38;
  for x,y being Element of N4 holds [x,y] in the InternalRel of N4 iff [
  h.x,h.y] in the InternalRel of G
  proof
    let x,y be Element of N4;
    thus [x,y] in the InternalRel of N4 implies [h.x,h.y] in the InternalRel
    of G
    proof
      assume [x,y] in the InternalRel of N4;
      then x <= y by ORDERS_2:def 5;
      then g.x <= g.y by A108,WAYBEL_1:def 2;
      then [g.x,g.y] in the InternalRel of CmpN4 by ORDERS_2:def 5;
      then [f.(g.x),f.(g.y)] in the InternalRel of G by A94;
      then [(f*g).x,f.(g.y)] in the InternalRel of G by FUNCT_2:15;
      hence thesis by FUNCT_2:15;
    end;
    assume [h.x,h.y] in the InternalRel of G;
    then [f.(g.x),h.y] in the InternalRel of G by FUNCT_2:15;
    then [f.(g.x),f.(g.y)] in the InternalRel of G by FUNCT_2:15;
    then [g.x,g.y] in the InternalRel of CmpN4 by A94;
    then g.x <= g.y by ORDERS_2:def 5;
    then x <= y by A59,WAYBEL_0:66;
    hence thesis by ORDERS_2:def 5;
  end;
  hence thesis by A57,A108;
end;
