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

theorem Th18:
  for x be set holds x in the InternalRel of Necklace n iff ex i
  being Element of NAT st i+1 < n & (x = [i,i+1] or x = [i+1,i])
proof
  let x be set;
  thus x in the InternalRel of Necklace n implies ex i being Element of NAT st
  i+1< n & (x = [i,i+1] or x = [i+1,i])
  proof
    assume x in the InternalRel of Necklace n;
    then
    x in ({[i,i+1] where i is Element of NAT:i+1 < n} \/ {[i+1,i] where i
    is Element of NAT:i+1 < n } ) by Th17;
    then x in {[i,i+1] where i is Element of NAT:i+1 < n} or x in {[i+1,i]
    where i is Element of NAT:i+1 < n} by XBOOLE_0:def 3;
    then (ex i being Element of NAT st x = [i,i+1] & i+1<n) or ex i being
    Element of NAT st x = [i+1,i] & i+1<n;
    hence thesis;
  end;
  thus (ex i being Element of NAT st i+1 < n & (x = [i,i+1] or x = [i+1,i]))
  implies x in the InternalRel of Necklace n
  proof
    given i being Element of NAT such that
A1: i+1 < n &( x=[i,i+1] or x=[i+1,i]);
    per cases by A1;
    suppose
      i+1 < n & x=[i,i+1];
      then x in {[j,j+1] where j is Element of NAT:j+1 < n};
      then
      x in ({[j,j+1] where j is Element of NAT:j+1 < n} \/ {[j+1,j] where
      j is Element of NAT:j+1 < n}) by XBOOLE_0:def 3;
      hence thesis by Th17;
    end;
    suppose
      i+1 < n & x=[i+1,i];
      then x in {[j+1,j] where j is Element of NAT:j+1 < n};
      then
      x in ({[j+1,j] where j is Element of NAT:j+1 < n} \/ {[j,j+1] where
      j is Element of NAT:j+1 < n}) by XBOOLE_0:def 3;
      hence thesis by Th17;
    end;
  end;
end;
