reserve X for set;
reserve a,b,c,k,m,n for Nat;
reserve i,j for Integer;
reserve r,s for Real;
reserve p,p1,p2,p3 for Prime;

theorem
  { [x,y] where x,y is positive Rational: x*(x+1) = 4*y*(y+1) } is infinite
  proof
    deffunc R(Complex,Complex) = $1*($1+1) - 4*$2*($2+1);
    set A = { [x,y] where x,y is positive Rational: R(x,y) = 0 };
    deffunc p1(Nat) = (3|^$1-3 to_power(1-$1)-2)/4;
    deffunc p2(Nat) = (3|^$1+3 to_power(1-$1)-4)/8;
    deffunc F(Nat) = [ p1($1) , p2($1) ];
    set D = NAT \ {0,1};
    reconsider D as infinite natural-membered set;
    consider f being ManySortedSet of D such that
A1: for d being Element of D holds f.d = F(d) from PBOOLE:sch 5;
A2: dom f = D by PARTFUN1:def 2;
A3: rng f c= A
    proof
      let y be object;
      assume y in rng f;
      then consider k being object such that
A4:   k in dom f and
A5:   f.k = y by FUNCT_1:def 3;
      reconsider k as Element of D by A4,PARTFUN1:def 2;
A6:   not k in {0,1} by XBOOLE_0:def 5;
A7:   now
        assume k <= 1;
        then k = 0 or ... or k = 1;
        hence contradiction by A6,TARSKI:def 2;
      end;
      p1(k)*(p1(k)+1) = 4*p2(k)*(p2(k)+1) by Th102;
      then
A8:   R(p1(k),p2(k)) = 0;
A9:   3|^k-3 to_power(1-k)-2 > 0 by A7,Th100;
      3|^k+3 to_power(1-k)-4 > 0 by A7,Th101;
      then F(k) in A by A8,A9;
      hence thesis by A1,A5;
    end;
A10: f is one-to-one
    proof
      let x1,x2 be object such that
A11:  x1 in dom f & x2 in dom f and
A12:  f.x1 = f.x2;
      reconsider x1,x2 as Element of D by A11,PARTFUN1:def 2;
      f.x1 = F(x1) & f.x2 = F(x2) by A1;
      then
A13:  p1(x1) = p1(x2) by A12,XTUPLE_0:1;
      now
        assume x1 <> x2;
        then x1 < x2 or x1 > x2 by XXREAL_0:1;
        hence contradiction by A13,Th103;
      end;
      hence thesis;
    end;
    defpred R[Complex,Complex] means $1*($1+1) = 4*$2*($2+1);
    set B = { [x,y] where x,y is positive Rational : R[x,y] };
    A = B
    proof
      thus A c= B
      proof
        let a be object;
        assume a in A;
        then ex x,y being positive Rational st a = [x,y] & R(x,y) = 0;
        hence thesis;
      end;
      let a be object;
      assume a in B;
      then consider x,y being positive Rational such that
A14:  a = [x,y] and
A15:  R[x,y];
      R(x,y) = 0 by A15;
      hence thesis by A14;
    end;
    hence thesis by A2,A3,A10,CARD_1:59;
  end;
