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

theorem Th23:
  for i,j being Nat st [i,j] in the InternalRel of Necklace n
  holds i = j + 1 or j = i + 1
proof
  let i,j be Nat;
  assume [i,j] in the InternalRel of Necklace n;
  then
  [i,j] in {[k,k+1] where k is Element of NAT:k+1 < n} \/ {[l+1,l] where l
  is Element of NAT:l+1 < n} by Th17;
  then
A1: [i,j] in {[k,k+1] where k is Element of NAT:k+1 < n} or [i,j] in {[k+1,k
  ] where k is Element of NAT:k+1 < n} by XBOOLE_0:def 3;
  i + 1 = j or j + 1 = i
  proof
    per cases by A1;
    suppose
      ex k being Element of NAT st [i,j] = [k,k+1] & k+1 < n;
      then consider k such that
A2:   [i,j] = [k,k+1] and
      k+1 < n;
      i = k by A2,XTUPLE_0:1;
      hence thesis by A2,XTUPLE_0:1;
    end;
    suppose
      ex k being Element of NAT st [i,j] = [k+1,k] & k+1 < n;
      then consider k such that
A3:   [i,j] = [k+1,k] and
      k+1 < n;
      i = k+1 by A3,XTUPLE_0:1;
      hence thesis by A3,XTUPLE_0:1;
    end;
  end;
  hence thesis;
end;
