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

theorem Th25:
  n > 0 implies card ({[i+1,i] where i is Element of NAT:i+1 < n}) = n-1
proof
  deffunc F(Element of NAT) = [$1+1,$1];
  defpred P[Element of NAT] means $1+1<n;
  defpred Q[Element of NAT] means $1 in Segm(n-'1);
A1: for d1,d2 being Element of NAT st F(d1) = F(d2) holds d1=d2 by XTUPLE_0:1;
  assume
A2: n > 0;
  then
A3: n >= 0+1 by NAT_1:13;
A4: i in Segm(n-'1) implies i+1<n
  proof
    assume i in Segm(n-'1);
    then
A5: i < n-'1 by NAT_1:44;
    n >= 0+1 by A2,NAT_1:13;
    then i < n-1 by A5,XREAL_1:233;
    hence thesis by XREAL_1:20;
  end;
A6: for i being Element of NAT holds P[i] iff Q[i]
  proof
    let i being Element of NAT;
    thus i+1<n implies i in Segm(n-'1)
    proof
      assume i+1<n;
      then i < n-1 by XREAL_1:20;
      then i < n-'1 by A3,XREAL_1:233;
      hence thesis by NAT_1:44;
    end;
    thus thesis by A4;
  end;
A7: {F(i) where i is Element of NAT: P[i]} = {F(i) where i is Element of
  NAT: Q[i]} from FRAENKEL:sch 3(A6);
A8: n-'1 c= NAT;
  n-'1, {F(i) where i is Element of NAT: i in n-'1} are_equipotent from
  FUNCT_7:sch 4 (A8,A1);
  hence
  card ({[i+1,i] where i is Element of NAT:i+1 < n}) = card (n-'1) by A7,
CARD_1:5
    .= n-'1
    .= n-1 by A3,XREAL_1:233;
end;
