reserve i,j,k,n for Nat;
reserve x,x1,x2,x3,y1,y2,y3 for set;

theorem
  Necklace 1, ComplRelStr Necklace 1 are_isomorphic
proof
  set f = 0 .--> 0;
  set S = Necklace 1, T = ComplRelStr S;
A1: the carrier of S = the carrier of T by Def8;
A2: the carrier of S = {0} by Th19,CARD_1:49;
  then dom f = the carrier of S & rng f c= the carrier of T
    by A1,FUNCOP_1:13;
  then f is Relation of the carrier of S, the carrier of T by RELSET_1:4;
  then reconsider g = f as Function of S,T
          by A2;
A3: rng g = {0} by FUNCOP_1:8;
  for y,x being object holds y in rng g & x = g.y iff x in dom g & y = g.x
  proof
    let x,y being object;
A5: x in dom g & y=g.x implies y in rng g & x = g.y
    proof
      assume that
A6:   x in dom g and
A7:   y = g.x;
A8:   x = 0 by A6,TARSKI:def 1;
      y = 0 by A7;
      hence thesis by A3,A8,TARSKI:def 1;
    end;
    y in rng g & x = g.y implies x in dom g & y=g.x
    proof
      assume that
A9:   y in rng g and
A10:   x = g.y;
A11:  y = 0 by A3,A9,TARSKI:def 1;
      x = 0 by A10;
      hence thesis by A11,TARSKI:def 1;
    end;
    hence thesis by A3,A5;
  end;
  then reconsider h = g" as Function of T,S by A1,A3,FUNCT_1:32;
A12: h is monotone
  proof
    let x,y being Element of T;
    assume x <= y;
    then [x,y] in the InternalRel of T by ORDERS_2:def 5;
    then [x,y] in (the InternalRel of S)` \ id (the carrier of S) by Def8;
    then not [x,y] in id (the carrier of S) by XBOOLE_0:def 5;
    then
A13: not x in (the carrier of S) or x <> y by RELAT_1:def 10;
    let a,b being Element of S such that
    a = h.x and
    b = h.y;
A14: x in (the carrier of T);
A15: the carrier of T = Segm 1 by A1,Th19;
    then x in Segm 1 & y in Segm 1;
    then reconsider i = x, j = y as Nat;
A16: j = 0 by A15,CARD_1:49,TARSKI:def 1;
A17: i = 0 by A15,CARD_1:49,TARSKI:def 1;
A18: i + 1 <> j & j + 1 <> i & i <> j
    proof
      hereby
        assume
A19:    i+1=j or j+1=i;
        per cases by A19;
        suppose
          i+1 = j;
          hence contradiction by A15,A17,NAT_1:44;
        end;
        suppose
          j+1=i;
          hence contradiction by A15,A16,NAT_1:44;
        end;
      end;
      thus thesis by A13,A14,Def8;
    end;
A20: y = 0 by A15,CARD_1:49,TARSKI:def 1;
    the carrier of T = {0} by A1,Th19,CARD_1:49;
    hence thesis by A18,A20,TARSKI:def 1;
  end;
  g is monotone
  proof
    let x,y being Element of S;
    assume x <= y;
    then
A21: [x,y] in the InternalRel of S by ORDERS_2:def 5;
    the carrier of S = Segm 1 by Th19;
    then x in Segm 1 & y in Segm 1;
    then reconsider i = x, j = y as Nat;
    let a,b being Element of T such that
    a = g.x and
    b = g.y;
    the carrier of S = {0} by Th19,CARD_1:49;
    then
A22: x = 0 & y = 0 by TARSKI:def 1;
    i = j + 1 or j = i + 1 by A21,Th23;
    hence thesis by A22;
  end;
  then g is isomorphic by A12,WAYBEL_0:def 38;
  hence thesis;
end;
