:: by Freek Wiedijk

::

:: Received July 2, 1999

:: Copyright (c) 1999-2012 Association of Mizar Users

begin

:: The Irrationality of the Square Root of 2

begin

scheme :: IRRAT_1:sch 1

LambdaRealSeq{ F_{1}( set ) -> real number } :

LambdaRealSeq{ F

( ex seq being Real_Sequence st

for n being Element of NAT holds seq . n = F_{1}(n) & ( for seq1, seq2 being Real_Sequence st ( for n being Element of NAT holds seq1 . n = F_{1}(n) ) & ( for n being Element of NAT holds seq2 . n = F_{1}(n) ) holds

seq1 = seq2 ) )

for n being Element of NAT holds seq . n = F

seq1 = seq2 ) )

proof end;

definition

let k be Nat;

existence

ex b_{1} being Real_Sequence st

for n being Element of NAT holds b_{1} . n = (n - k) / n;

uniqueness

for b_{1}, b_{2} being Real_Sequence st ( for n being Element of NAT holds b_{1} . n = (n - k) / n ) & ( for n being Element of NAT holds b_{2} . n = (n - k) / n ) holds

b_{1} = b_{2};

existence

ex b_{1} being Real_Sequence st

for n being Element of NAT holds b_{1} . n = (n choose k) * (n ^ (- k));

uniqueness

for b_{1}, b_{2} being Real_Sequence st ( for n being Element of NAT holds b_{1} . n = (n choose k) * (n ^ (- k)) ) & ( for n being Element of NAT holds b_{2} . n = (n choose k) * (n ^ (- k)) ) holds

b_{1} = b_{2};

end;
func aseq k -> Real_Sequence means :Def1: :: IRRAT_1:def 1

for n being Element of NAT holds it . n = (n - k) / n;

correctness for n being Element of NAT holds it . n = (n - k) / n;

existence

ex b

for n being Element of NAT holds b

uniqueness

for b

b

proof end;

func bseq k -> Real_Sequence means :Def2: :: IRRAT_1:def 2

for n being Element of NAT holds it . n = (n choose k) * (n ^ (- k));

correctness for n being Element of NAT holds it . n = (n choose k) * (n ^ (- k));

existence

ex b

for n being Element of NAT holds b

uniqueness

for b

b

proof end;

:: deftheorem Def1 defines aseq IRRAT_1:def 1 :

for k being Nat

for b_{2} being Real_Sequence holds

( b_{2} = aseq k iff for n being Element of NAT holds b_{2} . n = (n - k) / n );

for k being Nat

for b

( b

:: deftheorem Def2 defines bseq IRRAT_1:def 2 :

for k being Nat

for b_{2} being Real_Sequence holds

( b_{2} = bseq k iff for n being Element of NAT holds b_{2} . n = (n choose k) * (n ^ (- k)) );

for k being Nat

for b

( b

definition

let n be Nat;

existence

ex b_{1} being Real_Sequence st

for k being Element of NAT holds b_{1} . k = (n choose k) * (n ^ (- k));

uniqueness

for b_{1}, b_{2} being Real_Sequence st ( for k being Element of NAT holds b_{1} . k = (n choose k) * (n ^ (- k)) ) & ( for k being Element of NAT holds b_{2} . k = (n choose k) * (n ^ (- k)) ) holds

b_{1} = b_{2};

end;
func cseq n -> Real_Sequence means :Def3: :: IRRAT_1:def 3

for k being Element of NAT holds it . k = (n choose k) * (n ^ (- k));

correctness for k being Element of NAT holds it . k = (n choose k) * (n ^ (- k));

existence

ex b

for k being Element of NAT holds b

uniqueness

for b

b

proof end;

:: deftheorem Def3 defines cseq IRRAT_1:def 3 :

for n being Nat

for b_{2} being Real_Sequence holds

( b_{2} = cseq n iff for k being Element of NAT holds b_{2} . k = (n choose k) * (n ^ (- k)) );

for n being Nat

for b

( b

definition

existence

ex b_{1} being Real_Sequence st

for n being Element of NAT holds b_{1} . n = (1 + (1 / n)) ^ n;

uniqueness

for b_{1}, b_{2} being Real_Sequence st ( for n being Element of NAT holds b_{1} . n = (1 + (1 / n)) ^ n ) & ( for n being Element of NAT holds b_{2} . n = (1 + (1 / n)) ^ n ) holds

b_{1} = b_{2};

end;

func dseq -> Real_Sequence means :Def4: :: IRRAT_1:def 4

for n being Element of NAT holds it . n = (1 + (1 / n)) ^ n;

correctness for n being Element of NAT holds it . n = (1 + (1 / n)) ^ n;

existence

ex b

for n being Element of NAT holds b

uniqueness

for b

b

proof end;

:: deftheorem Def4 defines dseq IRRAT_1:def 4 :

for b_{1} being Real_Sequence holds

( b_{1} = dseq iff for n being Element of NAT holds b_{1} . n = (1 + (1 / n)) ^ n );

for b

( b

definition

existence

ex b_{1} being Real_Sequence st

for k being Element of NAT holds b_{1} . k = 1 / (k !);

uniqueness

for b_{1}, b_{2} being Real_Sequence st ( for k being Element of NAT holds b_{1} . k = 1 / (k !) ) & ( for k being Element of NAT holds b_{2} . k = 1 / (k !) ) holds

b_{1} = b_{2};

end;

func eseq -> Real_Sequence means :Def5: :: IRRAT_1:def 5

for k being Element of NAT holds it . k = 1 / (k !);

correctness for k being Element of NAT holds it . k = 1 / (k !);

existence

ex b

for k being Element of NAT holds b

uniqueness

for b

b

proof end;

:: deftheorem Def5 defines eseq IRRAT_1:def 5 :

for b_{1} being Real_Sequence holds

( b_{1} = eseq iff for k being Element of NAT holds b_{1} . k = 1 / (k !) );

for b

( b

:: lim(\n:(n choose k)*(n ^ (-k))) = 1/(k!)

theorem Th6: :: IRRAT_1:6

for n, k being Element of NAT st n > 0 holds

(bseq (k + 1)) . n = ((1 / (k + 1)) * ((bseq k) . n)) * ((aseq k) . n)

(bseq (k + 1)) . n = ((1 / (k + 1)) * ((bseq k) . n)) * ((aseq k) . n)

proof end;

theorem Th9: :: IRRAT_1:9

for x being real number

for seq being Real_Sequence st ( for n being Nat holds seq . n = x ) holds

( seq is convergent & lim seq = x )

for seq being Real_Sequence st ( for n being Nat holds seq . n = x ) holds

( seq is convergent & lim seq = x )

proof end;

theorem Th12: :: IRRAT_1:12

for k being Element of NAT holds

( bseq k is convergent & lim (bseq k) = 1 / (k !) & lim (bseq k) = eseq . k )

( bseq k is convergent & lim (bseq k) = 1 / (k !) & lim (bseq k) = eseq . k )

proof end;

:: 0 <= (n choose k)*(n ^ (-k))) <= 1/(k!)

theorem Th14: :: IRRAT_1:14

for n, k being Element of NAT st n > 0 holds

( 0 <= (bseq k) . n & (bseq k) . n <= 1 / (k !) & (bseq k) . n <= eseq . k & 0 <= (cseq n) . k & (cseq n) . k <= 1 / (k !) & (cseq n) . k <= eseq . k )

( 0 <= (bseq k) . n & (bseq k) . n <= 1 / (k !) & (bseq k) . n <= eseq . k & 0 <= (cseq n) . k & (cseq n) . k <= 1 / (k !) & (cseq n) . k <= eseq . k )

proof end;

:: n>0 implies (1+(1/n)) ^ n = Sum (\k:(n choose k)*(n ^ (-k)))

theorem Th15: :: IRRAT_1:15

for seq being Real_Sequence st seq ^\ 1 is summable holds

( seq is summable & Sum seq = (seq . 0) + (Sum (seq ^\ 1)) )

( seq is summable & Sum seq = (seq . 0) + (Sum (seq ^\ 1)) )

proof end;

theorem Th16: :: IRRAT_1:16

for k being Element of NAT

for D being non empty set

for sq being FinSequence of D st 1 <= k & k < len sq holds

(sq /^ 1) . k = sq . (k + 1)

for D being non empty set

for sq being FinSequence of D st 1 <= k & k < len sq holds

(sq /^ 1) . k = sq . (k + 1)

proof end;

theorem Th18: :: IRRAT_1:18

for n being Element of NAT

for seq being Real_Sequence

for sq being FinSequence of REAL st len sq = n & ( for k being Element of NAT st k < n holds

seq . k = sq . (k + 1) ) & ( for k being Element of NAT st k >= n holds

seq . k = 0 ) holds

( seq is summable & Sum seq = Sum sq )

for seq being Real_Sequence

for sq being FinSequence of REAL st len sq = n & ( for k being Element of NAT st k < n holds

seq . k = sq . (k + 1) ) & ( for k being Element of NAT st k >= n holds

seq . k = 0 ) holds

( seq is summable & Sum seq = Sum sq )

proof end;

theorem Th19: :: IRRAT_1:19

for k, n being Element of NAT

for x, y being real number st k <= n holds

((x,y) In_Power n) . (k + 1) = ((n choose k) * (x ^ (n - k))) * (y ^ k)

for x, y being real number st k <= n holds

((x,y) In_Power n) . (k + 1) = ((n choose k) * (x ^ (n - k))) * (y ^ k)

proof end;

theorem Th20: :: IRRAT_1:20

for n, k being Element of NAT st n > 0 & k <= n holds

(cseq n) . k = ((1,(1 / n)) In_Power n) . (k + 1)

(cseq n) . k = ((1,(1 / n)) In_Power n) . (k + 1)

proof end;

theorem Th21: :: IRRAT_1:21

for n being Element of NAT st n > 0 holds

( cseq n is summable & Sum (cseq n) = (1 + (1 / n)) ^ n & Sum (cseq n) = dseq . n )

( cseq n is summable & Sum (cseq n) = (1 + (1 / n)) ^ n & Sum (cseq n) = dseq . n )

proof end;

:: number_e = lim(\n:(1+(1/n)) ^ n)

:: exp(1) = Sum (\k:1/(k!))

:: lim(\n:(1+(1/n)) ^ n) = Sum (\k:1/(k!))

theorem Th24: :: IRRAT_1:24

for K being Element of NAT

for dseqK being Real_Sequence st ( for n being Element of NAT holds dseqK . n = (Partial_Sums (cseq n)) . K ) holds

( dseqK is convergent & lim dseqK = (Partial_Sums eseq) . K )

for dseqK being Real_Sequence st ( for n being Element of NAT holds dseqK . n = (Partial_Sums (cseq n)) . K ) holds

( dseqK is convergent & lim dseqK = (Partial_Sums eseq) . K )

proof end;

theorem Th25: :: IRRAT_1:25

for x being real number

for seq being Real_Sequence st seq is convergent & lim seq = x holds

for eps being real number st eps > 0 holds

ex N being Element of NAT st

for n being Element of NAT st n >= N holds

seq . n > x - eps

for seq being Real_Sequence st seq is convergent & lim seq = x holds

for eps being real number st eps > 0 holds

ex N being Element of NAT st

for n being Element of NAT st n >= N holds

seq . n > x - eps

proof end;

theorem Th26: :: IRRAT_1:26

for x being real number

for seq being Real_Sequence st ( for eps being real number st eps > 0 holds

ex N being Element of NAT st

for n being Element of NAT st n >= N holds

seq . n > x - eps ) & ex N being Element of NAT st

for n being Element of NAT st n >= N holds

seq . n <= x holds

( seq is convergent & lim seq = x )

for seq being Real_Sequence st ( for eps being real number st eps > 0 holds

ex N being Element of NAT st

for n being Element of NAT st n >= N holds

seq . n > x - eps ) & ex N being Element of NAT st

for n being Element of NAT st n >= N holds

seq . n <= x holds

( seq is convergent & lim seq = x )

proof end;

theorem Th27: :: IRRAT_1:27

for seq being Real_Sequence st seq is summable holds

for eps being real number st eps > 0 holds

ex K being Element of NAT st (Partial_Sums seq) . K > (Sum seq) - eps

for eps being real number st eps > 0 holds

ex K being Element of NAT st (Partial_Sums seq) . K > (Sum seq) - eps

proof end;

theorem Th29: :: IRRAT_1:29

for K being Element of NAT

for seq being Real_Sequence st seq is summable & ( for k being Element of NAT holds seq . k >= 0 ) holds

Sum seq >= (Partial_Sums seq) . K

for seq being Real_Sequence st seq is summable & ( for k being Element of NAT holds seq . k >= 0 ) holds

Sum seq >= (Partial_Sums seq) . K

proof end;

:: number_e = exp(1)

definition
end;

definition
end;

begin

theorem Th31: :: IRRAT_1:31

for x being real number st x is rational holds

ex n being Element of NAT st

( n >= 2 & (n !) * x is integer )

ex n being Element of NAT st

( n >= 2 & (n !) * x is integer )

proof end;

theorem Th34: :: IRRAT_1:34

for seq being Real_Sequence st seq is summable & ( for n being Element of NAT holds seq . n > 0 ) holds

Sum seq > 0

Sum seq > 0

proof end;

theorem Th38: :: IRRAT_1:38

for n, k being Element of NAT

for x being real number st x = 1 / (n + 1) holds

(n !) / (((n + k) + 1) !) <= x ^ (k + 1)

for x being real number st x = 1 / (n + 1) holds

(n !) / (((n + k) + 1) !) <= x ^ (k + 1)

proof end;

theorem Th39: :: IRRAT_1:39

for n being Element of NAT

for x being real number st n > 0 & x = 1 / (n + 1) holds

(n !) * (Sum (eseq ^\ (n + 1))) <= x / (1 - x)

for x being real number st n > 0 & x = 1 / (n + 1) holds

(n !) * (Sum (eseq ^\ (n + 1))) <= x / (1 - x)

proof end;