:: FIB_NUM2 semantic presentation

theorem Th1: :: FIB_NUM2:1
for b1 being non empty Nat holds (b1 -' 1) + 2 = b1 + 1
proof end;

theorem Th2: :: FIB_NUM2:2
for b1 being odd Integer
for b2 being non empty real number holds (- b2) to_power b1 = - (b2 to_power b1)
proof end;

theorem Th3: :: FIB_NUM2:3
for b1 being odd Integer holds (- 1) to_power b1 = - 1
proof end;

theorem Th4: :: FIB_NUM2:4
for b1 being even Integer
for b2 being non empty real number holds (- b2) to_power b1 = b2 to_power b1
proof end;

theorem Th5: :: FIB_NUM2:5
for b1 being even Integer holds (- 1) to_power b1 = 1
proof end;

theorem Th6: :: FIB_NUM2:6
for b1 being non empty real number
for b2 being Integer holds ((- 1) * b1) to_power b2 = ((- 1) to_power b2) * (b1 to_power b2)
proof end;

theorem Th7: :: FIB_NUM2:7
for b1, b2 being Nat
for b3 being non empty real number holds b3 to_power (b1 + b2) = (b3 to_power b1) * (b3 to_power b2)
proof end;

theorem Th8: :: FIB_NUM2:8
for b1 being Nat
for b2 being non empty real number
for b3 being odd Integer holds (b2 to_power b3) to_power b1 = b2 to_power (b3 * b1)
proof end;

theorem Th9: :: FIB_NUM2:9
for b1 being Nat holds ((- 1) to_power (- b1)) ^2 = 1
proof end;

theorem Th10: :: FIB_NUM2:10
for b1, b2 being Nat
for b3 being non empty real number holds (b3 to_power (- b1)) * (b3 to_power (- b2)) = b3 to_power ((- b1) - b2)
proof end;

theorem Th11: :: FIB_NUM2:11
for b1 being Nat holds (- 1) to_power (- (2 * b1)) = 1
proof end;

theorem Th12: :: FIB_NUM2:12
for b1 being Nat
for b2 being non empty real number holds (b2 to_power b1) * (b2 to_power (- b1)) = 1
proof end;

registration
let c1 be odd Integer;
cluster - a1 -> odd ;
coherence
not - c1 is even
proof end;
end;

registration
let c1 be even Integer;
cluster - a1 -> even ;
coherence
- c1 is even
proof end;
end;

theorem Th13: :: FIB_NUM2:13
for b1 being Nat holds (- 1) to_power (- b1) = (- 1) to_power b1
proof end;

theorem Th14: :: FIB_NUM2:14
for b1, b2, b3, b4, b5 being Nat st b2 divides b3 & b2 divides b1 holds
b2 divides (b3 * b4) + (b1 * b5)
proof end;

registration
cluster non empty finite natural-membered with_non-empty_elements set ;
existence
ex b1 being set st
( b1 is finite & not b1 is empty & b1 is natural-membered & b1 is with_non-empty_elements )
proof end;
end;

registration
let c1 be Function of NAT , NAT ;
let c2 be finite natural-membered with_non-empty_elements set ;
cluster a1 | a2 -> FinSubsequence-like ;
coherence
c1 | c2 is FinSubsequence-like
proof end;
end;

theorem Th15: :: FIB_NUM2:15
for b1 being FinSubsequence holds rng (Seq b1) c= rng b1
proof end;

definition
let c1 be Function of NAT , NAT ;
let c2 be finite natural-membered with_non-empty_elements set ;
func Prefix c1,c2 -> FinSequence of NAT equals :: FIB_NUM2:def 1
Seq (a1 | a2);
coherence
Seq (c1 | c2) is FinSequence of NAT
proof end;
end;

:: deftheorem Def1 defines Prefix FIB_NUM2:def 1 :
for b1 being Function of NAT , NAT
for b2 being finite natural-membered with_non-empty_elements set holds Prefix b1,b2 = Seq (b1 | b2);

theorem Th16: :: FIB_NUM2:16
for b1, b2, b3 being Nat st b3 <> 0 & b3 + b1 <= b2 holds
b1 < b2
proof end;

registration
cluster omega -> bounded_below ;
coherence
NAT is bounded_below
proof end;
end;

registration
cluster K417(1,2,3) -> natural-membered with_non-empty_elements ;
coherence
( {1,2,3} is natural-membered & {1,2,3} is with_non-empty_elements )
proof end;
end;

registration
cluster K418(1,2,3,4) -> natural-membered with_non-empty_elements ;
coherence
( {1,2,3,4} is natural-membered & {1,2,3,4} is with_non-empty_elements )
proof end;
end;

theorem Th17: :: FIB_NUM2:17
for b1, b2 being Nat
for b3, b4 being set st 0 < b1 & b1 < b2 holds
{[b1,b3],[b2,b4]} is FinSubsequence
proof end;

theorem Th18: :: FIB_NUM2:18
for b1, b2 being Nat
for b3, b4 being set
for b5 being FinSubsequence st b1 < b2 & b5 = {[b1,b3],[b2,b4]} holds
Seq b5 = <*b3,b4*>
proof end;

registration
let c1 be Nat;
cluster Seg a1 -> with_non-empty_elements ;
coherence
Seg c1 is with_non-empty_elements
proof end;
end;

registration
let c1 be with_non-empty_elements set ;
cluster -> with_non-empty_elements Element of K40(a1);
coherence
for b1 being Subset of c1 holds b1 is with_non-empty_elements
proof end;
end;

registration
let c1 be with_non-empty_elements set ;
let c2 be set ;
cluster a1 /\ a2 -> with_non-empty_elements ;
coherence
c1 /\ c2 is with_non-empty_elements
proof end;
cluster a2 /\ a1 -> with_non-empty_elements ;
coherence
c2 /\ c1 is with_non-empty_elements
;
end;

theorem Th19: :: FIB_NUM2:19
for b1 being Nat
for b2 being set st b1 >= 1 holds
{[b1,b2]} is FinSubsequence
proof end;

theorem Th20: :: FIB_NUM2:20
for b1 being Nat
for b2 being set
for b3 being FinSubsequence st b3 = {[1,b2]} holds
b1 Shift b3 = {[(1 + b1),b2]}
proof end;

theorem Th21: :: FIB_NUM2:21
for b1 being FinSubsequence
for b2, b3 being Nat st dom b1 c= Seg b2 & b3 > b2 holds
ex b4 being FinSequence st
( b1 c= b4 & dom b4 = Seg b3 )
proof end;

theorem Th22: :: FIB_NUM2:22
for b1 being FinSubsequence ex b2 being FinSequence st b1 c= b2
proof end;

scheme :: FIB_NUM2:sch 1
s1{ P1[ Nat] } :
for b1 being non empty Nat holds P1[b1]
provided
E22: P1[1] and
E23: P1[2] and
E24: for b1 being non empty Nat st P1[b1] & P1[b1 + 1] holds
P1[b1 + 2]
proof end;

scheme :: FIB_NUM2:sch 2
s2{ P1[ Nat] } :
for b1 being non trivial Nat holds P1[b1]
provided
E22: P1[2] and
E23: P1[3] and
E24: for b1 being non trivial Nat st P1[b1] & P1[b1 + 1] holds
P1[b1 + 2]
proof end;

theorem Th23: :: FIB_NUM2:23
Fib 2 = 1
proof end;

theorem Th24: :: FIB_NUM2:24
Fib 3 = 2
proof end;

theorem Th25: :: FIB_NUM2:25
Fib 4 = 3
proof end;

theorem Th26: :: FIB_NUM2:26
for b1 being Nat holds Fib (b1 + 2) = (Fib b1) + (Fib (b1 + 1))
proof end;

theorem Th27: :: FIB_NUM2:27
for b1 being Nat holds Fib (b1 + 3) = (Fib (b1 + 2)) + (Fib (b1 + 1))
proof end;

theorem Th28: :: FIB_NUM2:28
for b1 being Nat holds Fib (b1 + 4) = (Fib (b1 + 2)) + (Fib (b1 + 3))
proof end;

theorem Th29: :: FIB_NUM2:29
for b1 being Nat holds Fib (b1 + 5) = (Fib (b1 + 3)) + (Fib (b1 + 4))
proof end;

Lemma29: for b1 being Nat holds Fib ((2 * (b1 + 2)) + 1) = (Fib ((2 * b1) + 3)) + (Fib ((2 * b1) + 4))
proof end;

theorem Th30: :: FIB_NUM2:30
for b1 being Nat holds Fib (b1 + 2) = (Fib (b1 + 3)) - (Fib (b1 + 1))
proof end;

theorem Th31: :: FIB_NUM2:31
for b1 being Nat holds Fib (b1 + 1) = (Fib (b1 + 2)) - (Fib b1)
proof end;

theorem Th32: :: FIB_NUM2:32
for b1 being Nat holds Fib b1 = (Fib (b1 + 2)) - (Fib (b1 + 1))
proof end;

theorem Th33: :: FIB_NUM2:33
for b1 being Nat holds ((Fib b1) * (Fib (b1 + 2))) - ((Fib (b1 + 1)) ^2 ) = (- 1) |^ (b1 + 1)
proof end;

theorem Th34: :: FIB_NUM2:34
for b1 being non empty Nat holds ((Fib (b1 -' 1)) * (Fib (b1 + 1))) - ((Fib b1) ^2 ) = (- 1) |^ b1
proof end;

theorem Th35: :: FIB_NUM2:35
tau > 0
proof end;

theorem Th36: :: FIB_NUM2:36
tau_bar = (- tau ) to_power (- 1)
proof end;

theorem Th37: :: FIB_NUM2:37
for b1 being Nat holds (- tau ) to_power ((- 1) * b1) = ((- tau ) to_power (- 1)) to_power b1
proof end;

theorem Th38: :: FIB_NUM2:38
- (1 / tau ) = tau_bar
proof end;

theorem Th39: :: FIB_NUM2:39
for b1 being Nat holds (((tau to_power b1) ^2 ) - (2 * ((- 1) to_power b1))) + ((tau to_power (- b1)) ^2 ) = ((tau to_power b1) - (tau_bar to_power b1)) ^2
proof end;

theorem Th40: :: FIB_NUM2:40
for b1, b2 being non empty Nat st b2 <= b1 holds
((Fib b1) ^2 ) - ((Fib (b1 + b2)) * (Fib (b1 -' b2))) = ((- 1) |^ (b1 -' b2)) * ((Fib b2) ^2 )
proof end;

theorem Th41: :: FIB_NUM2:41
for b1 being Nat holds ((Fib b1) ^2 ) + ((Fib (b1 + 1)) ^2 ) = Fib ((2 * b1) + 1)
proof end;

theorem Th42: :: FIB_NUM2:42
for b1 being Nat
for b2 being non empty Nat holds Fib (b1 + b2) = ((Fib b2) * (Fib (b1 + 1))) + ((Fib (b2 -' 1)) * (Fib b1))
proof end;

theorem Th43: :: FIB_NUM2:43
for b1 being Nat
for b2 being non empty Nat holds Fib b2 divides Fib (b2 * b1)
proof end;

theorem Th44: :: FIB_NUM2:44
for b1 being Nat
for b2 being non empty Nat st b2 divides b1 holds
Fib b2 divides Fib b1
proof end;

theorem Th45: :: FIB_NUM2:45
for b1 being Nat holds Fib b1 <= Fib (b1 + 1)
proof end;

theorem Th46: :: FIB_NUM2:46
for b1 being Nat st b1 > 1 holds
Fib b1 < Fib (b1 + 1)
proof end;

theorem Th47: :: FIB_NUM2:47
for b1, b2 being Nat st b1 >= b2 holds
Fib b1 >= Fib b2
proof end;

theorem Th48: :: FIB_NUM2:48
for b1, b2 being Nat st b2 > 1 & b2 < b1 holds
Fib b2 < Fib b1
proof end;

theorem Th49: :: FIB_NUM2:49
for b1 being Nat holds
( Fib b1 = 1 iff ( b1 = 1 or b1 = 2 ) )
proof end;

theorem Th50: :: FIB_NUM2:50
for b1, b2 being Nat st b2 > 1 & b1 <> 0 & b1 <> 1 & ( ( b1 <> 1 & b2 <> 2 ) or ( b1 <> 2 & b2 <> 1 ) ) holds
( Fib b1 = Fib b2 iff b1 = b2 )
proof end;

theorem Th51: :: FIB_NUM2:51
for b1 being Nat st b1 > 1 & b1 <> 4 & not b1 is prime holds
ex b2 being non empty Nat st
( b2 <> 1 & b2 <> 2 & b2 <> b1 & b2 divides b1 )
proof end;

theorem Th52: :: FIB_NUM2:52
for b1 being Nat st b1 > 1 & b1 <> 4 & Fib b1 is prime holds
b1 is prime
proof end;

definition
func FIB -> Function of NAT , NAT means :Def2: :: FIB_NUM2:def 2
for b1 being Nat holds a1 . b1 = Fib b1;
existence
ex b1 being Function of NAT , NAT st
for b2 being Nat holds b1 . b2 = Fib b2
proof end;
uniqueness
for b1, b2 being Function of NAT , NAT st ( for b3 being Nat holds b1 . b3 = Fib b3 ) & ( for b3 being Nat holds b2 . b3 = Fib b3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def2 defines FIB FIB_NUM2:def 2 :
for b1 being Function of NAT , NAT holds
( b1 = FIB iff for b2 being Nat holds b1 . b2 = Fib b2 );

definition
func EvenNAT -> Subset of NAT equals :: FIB_NUM2:def 3
{ (2 * b1) where B is Nat : verum } ;
coherence
{ (2 * b1) where B is Nat : verum } is Subset of NAT
proof end;
func OddNAT -> Subset of NAT equals :: FIB_NUM2:def 4
{ ((2 * b1) + 1) where B is Nat : verum } ;
coherence
{ ((2 * b1) + 1) where B is Nat : verum } is Subset of NAT
proof end;
end;

:: deftheorem Def3 defines EvenNAT FIB_NUM2:def 3 :
EvenNAT = { (2 * b1) where B is Nat : verum } ;

:: deftheorem Def4 defines OddNAT FIB_NUM2:def 4 :
OddNAT = { ((2 * b1) + 1) where B is Nat : verum } ;

theorem Th53: :: FIB_NUM2:53
for b1 being Nat holds
( 2 * b1 in EvenNAT & not (2 * b1) + 1 in EvenNAT )
proof end;

theorem Th54: :: FIB_NUM2:54
for b1 being Nat holds
( (2 * b1) + 1 in OddNAT & not 2 * b1 in OddNAT )
proof end;

definition
let c1 be Nat;
func EvenFibs c1 -> FinSequence of NAT equals :: FIB_NUM2:def 5
Prefix FIB ,(EvenNAT /\ (Seg a1));
coherence
Prefix FIB ,(EvenNAT /\ (Seg c1)) is FinSequence of NAT
;
func OddFibs c1 -> FinSequence of NAT equals :: FIB_NUM2:def 6
Prefix FIB ,(OddNAT /\ (Seg a1));
coherence
Prefix FIB ,(OddNAT /\ (Seg c1)) is FinSequence of NAT
;
end;

:: deftheorem Def5 defines EvenFibs FIB_NUM2:def 5 :
for b1 being Nat holds EvenFibs b1 = Prefix FIB ,(EvenNAT /\ (Seg b1));

:: deftheorem Def6 defines OddFibs FIB_NUM2:def 6 :
for b1 being Nat holds OddFibs b1 = Prefix FIB ,(OddNAT /\ (Seg b1));

theorem Th55: :: FIB_NUM2:55
EvenFibs 0 = {}
proof end;

theorem Th56: :: FIB_NUM2:56
Seq (FIB | {2}) = <*1*>
proof end;

theorem Th57: :: FIB_NUM2:57
EvenFibs 2 = <*1*>
proof end;

theorem Th58: :: FIB_NUM2:58
EvenFibs 4 = <*1,3*>
proof end;

theorem Th59: :: FIB_NUM2:59
for b1 being Nat holds (EvenNAT /\ (Seg ((2 * b1) + 2))) \/ {((2 * b1) + 4)} = EvenNAT /\ (Seg ((2 * b1) + 4))
proof end;

theorem Th60: :: FIB_NUM2:60
for b1 being Nat holds (FIB | (EvenNAT /\ (Seg ((2 * b1) + 2)))) \/ {[((2 * b1) + 4),(FIB . ((2 * b1) + 4))]} = FIB | (EvenNAT /\ (Seg ((2 * b1) + 4)))
proof end;

theorem Th61: :: FIB_NUM2:61
for b1 being Nat holds EvenFibs ((2 * b1) + 2) = (EvenFibs (2 * b1)) ^ <*(Fib ((2 * b1) + 2))*>
proof end;

theorem Th62: :: FIB_NUM2:62
OddFibs 1 = <*1*>
proof end;

theorem Th63: :: FIB_NUM2:63
OddFibs 3 = <*1,2*>
proof end;

theorem Th64: :: FIB_NUM2:64
for b1 being Nat holds (OddNAT /\ (Seg ((2 * b1) + 3))) \/ {((2 * b1) + 5)} = OddNAT /\ (Seg ((2 * b1) + 5))
proof end;

theorem Th65: :: FIB_NUM2:65
for b1 being Nat holds (FIB | (OddNAT /\ (Seg ((2 * b1) + 3)))) \/ {[((2 * b1) + 5),(FIB . ((2 * b1) + 5))]} = FIB | (OddNAT /\ (Seg ((2 * b1) + 5)))
proof end;

theorem Th66: :: FIB_NUM2:66
for b1 being Nat holds OddFibs ((2 * b1) + 3) = (OddFibs ((2 * b1) + 1)) ^ <*(Fib ((2 * b1) + 3))*>
proof end;

theorem Th67: :: FIB_NUM2:67
for b1 being Nat holds Sum (EvenFibs ((2 * b1) + 2)) = (Fib ((2 * b1) + 3)) - 1
proof end;

theorem Th68: :: FIB_NUM2:68
for b1 being Nat holds Sum (OddFibs ((2 * b1) + 1)) = Fib ((2 * b1) + 2)
proof end;

theorem Th69: :: FIB_NUM2:69
for b1 being Nat holds Fib b1, Fib (b1 + 1) are_relative_prime
proof end;

theorem Th70: :: FIB_NUM2:70
for b1 being non empty Nat
for b2 being Nat st b2 <> 1 & b2 divides Fib b1 holds
not b2 divides Fib (b1 -' 1)
proof end;

theorem Th71: :: FIB_NUM2:71
for b1 being Nat
for b2 being non empty Nat st b1 is prime & b2 is prime & b1 divides Fib b2 holds
for b3 being Nat st b3 < b2 & b3 <> 0 holds
not b1 divides Fib b3
proof end;

theorem Th72: :: FIB_NUM2:72
for b1 being non empty Nat holds {((Fib b1) * (Fib (b1 + 3))),((2 * (Fib (b1 + 1))) * (Fib (b1 + 2))),(((Fib (b1 + 1)) ^2 ) + ((Fib (b1 + 2)) ^2 ))} is Pythagorean_triple
proof end;