reserve n,n1,n2,k,D for Nat,
        r,r1,r2 for Real,
        x,y for Integer;

theorem
  for D be non square Nat holds
    the set of all ab where
        ab is positive Pell's_solution of D
    is infinite
  proof
    let D be non square Nat;
    set P=the set of all ab where
      ab is positive Pell's_solution of D;
    assume A1: P is finite;
    set ab = the positive Pell's_solution of D;
    A2: ab = [ab`1,ab`2] & ab in P;
    proj2 P c= NAT
    proof
      let y be object; assume y in proj2 P;
      then consider x be object such that
      A3:[x,y] in P by XTUPLE_0:def 13;
      consider ab be positive Pell's_solution of D such that
      A4: [x,y] = ab by A3;
      y = ab`2 & ab`2 >0 by A4;
      hence thesis by INT_1:3;
    end;
    then reconsider P2=proj2 P as finite non empty Subset of NAT
    by A1,WAYBEL26:39,A2,XTUPLE_0:def 13;
    set b = max P2;
    b in P2 by XXREAL_2:def 8;
    then consider a be object such that
    A5:[a,b] in P by XTUPLE_0:def 13;
    consider ab be positive Pell's_solution of D such that
    A6: [a,b] = ab by A5;
    A7: a = ab`1 & b = ab`2 by A6;
    then reconsider a,b as Nat;
    set A=2*a^2-1,B = 2 * a * b;
    a^2 - (b^2)*D = 1 by Lm4,A6;
    then a^2 = 1+b^2*D;
    then 1 = 4*a^2*a^2 - 4*a^2 +1 -4 * a^2 *b^2 *D
         .= A^2 -B^2*D;
    then reconsider AB = [A,B] as Pell's_solution of D by Lm4;
    a^2 >=1 by A7,NAT_1:14;
    then a^2+a^2 >= 1+1 by XREAL_1:7;
    then A >= 1+1-1 by XREAL_1:9;
    then AB`1 > 0 & AB`2 > 0 by A7;
    then AB is positive Pell's_solution of D by Def2;
    then AB in P;
    then A8: B in P2 by XTUPLE_0:def 13;
    a >= 1 by A7,NAT_1:14;
    then a+a > 1+0 by XREAL_1:8;
    then B > 1*b by A7,XREAL_1:68;
    hence thesis by A8,XXREAL_2:def 8;
  end;
