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

theorem Th26:
  n > 0 implies card the InternalRel of Necklace n = 2*(n-1)
proof
  deffunc G(Element of NAT) = $1+1;
  deffunc F(Element of NAT) = $1;
  defpred P[Element of NAT] means $1+1 < n;
  set A = {[i,i+1] where i is Element of NAT:i+1 < n}, B = {[G(i),F(i)] where
  i is Element of NAT:P[i]};
A1: A is Relation-like
  proof
    let x be object;
    assume x in A;
    then ex i being Element of NAT st x = [i,i+1] & i+1<n;
    hence thesis;
  end;
A2: the InternalRel of Necklace n = A \/ B by Th17;
  assume
A3: n > 0;
  then n >= 0+1 by NAT_1:13;
  then
A4: n-'1 = n-1 by XREAL_1:233;
  A = the InternalRel of n-SuccRelStr by Def6;
  then
A5: card A = n-1 by A3,Th15;
  reconsider A as Relation by A1;
A6: A = {[F(i),G(i)] where i is Element of NAT: P[i]};
A7: A~ = B from Convers(A6);
A8: A misses B
  proof
    assume A meets B;
    then consider x being object such that
A9: x in A and
A10: x in B by XBOOLE_0:3;
    consider y,z being object such that
A11: x = [y,z] by A9,RELAT_1:def 1;
    [z,y] in A by A7,A10,A11,RELAT_1:def 7;
    then consider j be Element of NAT such that
A12: [z,y] = [j,j+1] and
    j+1<n;
A13: z = j & y = j+1 by A12,XTUPLE_0:1;
    consider i be Element of NAT such that
A14: [y,z] = [i,i+1] and
    i+1<n by A9,A11;
    y = i & z = i+1 by A14,XTUPLE_0:1;
    hence contradiction by A13;
  end;
  card B = n-1 by A3,Th25;
  then
  card the InternalRel of Necklace n = card (n-1) +` card (n-1) by A2,A5,A8,
CARD_2:35
    .= card ((n-'1) + (n-'1)) by A4,CARD_2:38
    .= 2*(n-1) by A4;
  hence thesis;
end;
