let D be Nat; ( not D is square implies { [x,y] where x, y is Integer : ( y <> 0 & |.((x ^2) - (D * (y ^2))).| < (2 * (sqrt D)) + 1 & 0 < x - (y * (sqrt D)) ) } is infinite )
set S = { [x,y] where x, y is Integer : ( y <> 0 & |.((x ^2) - (D * (y ^2))).| < (2 * (sqrt D)) + 1 & 0 < x - (y * (sqrt D)) ) } ;
assume A1:
( not D is square & { [x,y] where x, y is Integer : ( y <> 0 & |.((x ^2) - (D * (y ^2))).| < (2 * (sqrt D)) + 1 & 0 < x - (y * (sqrt D)) ) } is finite )
; contradiction
ex f being Function of { [x,y] where x, y is Integer : ( y <> 0 & |.((x ^2) - (D * (y ^2))).| < (2 * (sqrt D)) + 1 & 0 < x - (y * (sqrt D)) ) } ,REAL st
for x, y being Integer st [x,y] in { [x,y] where x, y is Integer : ( y <> 0 & |.((x ^2) - (D * (y ^2))).| < (2 * (sqrt D)) + 1 & 0 < x - (y * (sqrt D)) ) } holds
f . [x,y] = x - (y * (sqrt D))
proof
defpred S1[
object ,
object ]
means for
x,
y being
Integer st
[x,y] = $1 holds
$2
= x - (y * (sqrt D));
A2:
for
xy being
object st
xy in { [x,y] where x, y is Integer : ( y <> 0 & |.((x ^2) - (D * (y ^2))).| < (2 * (sqrt D)) + 1 & 0 < x - (y * (sqrt D)) ) } holds
ex
u being
object st
S1[
xy,
u]
proof
let xy be
object ;
( xy in { [x,y] where x, y is Integer : ( y <> 0 & |.((x ^2) - (D * (y ^2))).| < (2 * (sqrt D)) + 1 & 0 < x - (y * (sqrt D)) ) } implies ex u being object st S1[xy,u] )
assume A3:
xy in { [x,y] where x, y is Integer : ( y <> 0 & |.((x ^2) - (D * (y ^2))).| < (2 * (sqrt D)) + 1 & 0 < x - (y * (sqrt D)) ) }
;
ex u being object st S1[xy,u]
consider x,
y being
Integer such that A4:
(
xy = [x,y] &
y <> 0 &
|.((x ^2) - (D * (y ^2))).| < (2 * (sqrt D)) + 1 &
0 < x - (y * (sqrt D)) )
by A3;
take u =
x - (y * (sqrt D));
S1[xy,u]
let x1,
y1 be
Integer;
( [x1,y1] = xy implies u = x1 - (y1 * (sqrt D)) )
assume A5:
[x1,y1] = xy
;
u = x1 - (y1 * (sqrt D))
(
x1 = x &
y1 = y )
by A4, A5, XTUPLE_0:1;
hence
u = x1 - (y1 * (sqrt D))
;
verum
end;
consider f being
Function such that A6:
(
dom f = { [x,y] where x, y is Integer : ( y <> 0 & |.((x ^2) - (D * (y ^2))).| < (2 * (sqrt D)) + 1 & 0 < x - (y * (sqrt D)) ) } & ( for
xy being
object st
xy in { [x,y] where x, y is Integer : ( y <> 0 & |.((x ^2) - (D * (y ^2))).| < (2 * (sqrt D)) + 1 & 0 < x - (y * (sqrt D)) ) } holds
S1[
xy,
f . xy] ) )
from CLASSES1:sch 1(A2);
rng f c= REAL
then reconsider f =
f as
Function of
{ [x,y] where x, y is Integer : ( y <> 0 & |.((x ^2) - (D * (y ^2))).| < (2 * (sqrt D)) + 1 & 0 < x - (y * (sqrt D)) ) } ,
REAL by A6, FUNCT_2:2;
take
f
;
for x, y being Integer st [x,y] in { [x,y] where x, y is Integer : ( y <> 0 & |.((x ^2) - (D * (y ^2))).| < (2 * (sqrt D)) + 1 & 0 < x - (y * (sqrt D)) ) } holds
f . [x,y] = x - (y * (sqrt D))
thus
for
x,
y being
Integer st
[x,y] in { [x,y] where x, y is Integer : ( y <> 0 & |.((x ^2) - (D * (y ^2))).| < (2 * (sqrt D)) + 1 & 0 < x - (y * (sqrt D)) ) } holds
f . [x,y] = x - (y * (sqrt D))
by A6;
verum
end;
then consider f being Function of { [x,y] where x, y is Integer : ( y <> 0 & |.((x ^2) - (D * (y ^2))).| < (2 * (sqrt D)) + 1 & 0 < x - (y * (sqrt D)) ) } ,REAL such that
A9:
for x, y being Integer st [x,y] in { [x,y] where x, y is Integer : ( y <> 0 & |.((x ^2) - (D * (y ^2))).| < (2 * (sqrt D)) + 1 & 0 < x - (y * (sqrt D)) ) } holds
f . [x,y] = x - (y * (sqrt D))
;
not { [x,y] where x, y is Integer : ( y <> 0 & |.((x ^2) - (D * (y ^2))).| < (2 * (sqrt D)) + 1 & 0 < x - (y * (sqrt D)) ) } is empty
then reconsider R = rng f as non empty finite Subset of REAL by A1;
inf R > 0
then consider n being Nat such that
A12:
1 / n < inf R
and
A13:
n > 1
by Lm3;
consider x, y being Integer such that
A14:
( y <> 0 & |.y.| <= n & 0 < x - (y * (sqrt D)) & x - (y * (sqrt D)) < 1 / n )
by A1, A13, Th9;
A15:
|.((x ^2) - (D * (y ^2))).| <= (2 * (sqrt D)) + (1 / (n ^2))
by A1, A13, A14, Th10;
(2 * (sqrt D)) + (1 / (n ^2)) < (2 * (sqrt D)) + 1
then
|.((x ^2) - (D * (y ^2))).| < (2 * (sqrt D)) + 1
by A15, XXREAL_0:2;
then
( [x,y] in { [x,y] where x, y is Integer : ( y <> 0 & |.((x ^2) - (D * (y ^2))).| < (2 * (sqrt D)) + 1 & 0 < x - (y * (sqrt D)) ) } & { [x,y] where x, y is Integer : ( y <> 0 & |.((x ^2) - (D * (y ^2))).| < (2 * (sqrt D)) + 1 & 0 < x - (y * (sqrt D)) ) } = dom f )
by A14, FUNCT_2:def 1;
then
( f . [x,y] in R & f . [x,y] = x - (y * (sqrt D)) )
by A9, FUNCT_1:def 3;
then
x - (y * (sqrt D)) >= inf R
by XXREAL_2:def 7;
hence
contradiction
by A12, A14, XXREAL_0:2; verum