reserve k for Element of NAT;
reserve r,r1 for Real;
reserve i for Integer;
reserve q for Rational;

theorem Th4:
  for n being Nat holds INT,RAT_with_denominator (n+1) are_equipotent
proof
  let n be Nat;
  defpred P[Element of INT,set] means $2=$1/(n+1);
A1: for x being Element of INT ex y being Element of RAT_with_denominator(n+1)
  st P[x,y]
  proof
    let x be Element of INT;
    reconsider x as Integer;
    reconsider i1=n+1 as Integer;
    set y=x/i1;
 y in RAT by RAT_1:def 1;
    then reconsider y as Rational;
 y in RAT_with_denominator(n+1) by Def2;
    hence thesis;
  end;
  consider f being Function of INT,RAT_with_denominator(n+1) such that
A2: for x being Element of INT holds P[x,f.x] from FUNCT_2:sch 3(A1);
A3: f in Funcs(INT,RAT_with_denominator(n+1)) by FUNCT_2:8;
then A4: dom f = INT by FUNCT_2:92;
A5: for x1,x2 being object st x1 in dom f & x2 in dom f & f.x1=f.x2
holds x1=x2
  proof
    let x1,x2 be object;
    assume that
A6: x1 in dom f and
A7: x2 in dom f and
A8: f.x1=f.x2;
    reconsider x1 as Element of INT by A3,A6,FUNCT_2:92;
    reconsider x2 as Element of INT by A3,A7,FUNCT_2:92;
 f.x1 = x1/(n+1) & f.x2 = x2/(n+1) by A2;
    hence thesis by A8,XCMPLX_1:53;
  end;
A9: for y being object st y in RAT_with_denominator(n+1) holds f"{y} <> {}
  proof
    let y being object;
    assume
A10: y in RAT_with_denominator(n+1);
    then reconsider y as Rational;
    consider i being Integer such that
A11: y = i/(n+1) by A10,Def2;
    reconsider i as Element of INT by INT_1:def 2;
 f.i = i/(n+1) by A2;
then  f.i in {y} by A11,TARSKI:def 1;
    hence thesis by A4,FUNCT_1:def 7;
  end;
A12: f is one-to-one by A5,FUNCT_1:def 4;
 rng f = RAT_with_denominator(n+1) by A9,FUNCT_2:41;
  hence thesis by A4,A12,WELLORD2:def 4;
end;
