:: NAT_4 semantic presentation

theorem Th1: :: NAT_4:1
for b1, b2 being real number holds
not ( 0 <= b1 & b2 * b2 < b1 * b1 & not b2 < b1 )
proof end;

theorem Th2: :: NAT_4:2
for b1, b2 being real number holds
not ( 1 < b1 & b1 * b1 <= b2 & not b1 < b2 )
proof end;

theorem Th3: :: NAT_4:3
for b1, b2 being natural number holds
not ( b1 > 1 & not b1 |^ b2 > b2 )
proof end;

theorem Th4: :: NAT_4:4
for b1, b2, b3 being Nat holds
( b2 <= b1 & b3 = [\(b1 / 2)/] implies b1 choose b3 >= b1 choose b2 )
proof end;

theorem Th5: :: NAT_4:5
for b1, b2 being Nat holds
( b2 = [\(b1 / 2)/] & b1 >= 2 implies b1 choose b2 >= (2 |^ b1) / b1 )
proof end;

theorem Th6: :: NAT_4:6
for b1 being Nat holds (2 * b1) choose b1 >= (4 |^ b1) / (2 * b1)
proof end;

theorem Th7: :: NAT_4:7
for b1, b2 being Nat holds
( b2 > 0 & b1 divides b2 & b1 <> 1 & b1 <> b2 implies ( 1 < b1 & b1 < b2 ) )
proof end;

theorem Th8: :: NAT_4:8
for b1 being Nat holds
not ( ex b2 being Nat st
( b2 divides b1 & 1 < b2 & b2 < b1 ) & ( for b2 being Nat holds
not ( b2 divides b1 & 1 < b2 & b2 * b2 <= b1 ) ) )
proof end;

theorem Th9: :: NAT_4:9
for b1, b2, b3, b4 being Nat holds
not ( b1 = (b2 * b3) + b4 & b4 < b2 & 0 < b4 & b2 divides b1 )
proof end;

theorem Th10: :: NAT_4:10
for b1, b2, b3 being Nat holds
( b2 hcf b3 = 1 & b2 <> 0 & b3 <> 0 implies (b2 |^ b1) hcf b3 = 1 )
proof end;

theorem Th11: :: NAT_4:11
for b1, b2, b3 being Nat holds (b1 |^ (2 * b2)) mod b3 = (((b1 |^ b2) mod b3) * ((b1 |^ b2) mod b3)) mod b3
proof end;

theorem Th12: :: NAT_4:12
for b1 being Nat holds
( not ( not b1 is prime & not b1 <= 1 & ( for b2 being Nat holds
not ( b2 divides b1 & 1 < b2 & b2 < b1 ) ) ) & not ( not ( not b1 <= 1 & ( for b2 being Nat holds
not ( b2 divides b1 & 1 < b2 & b2 < b1 ) ) ) & b1 is prime ) )
proof end;

theorem Th13: :: NAT_4:13
for b1, b2 being Nat holds
not ( b1 divides b2 & 1 < b1 & ( for b3 being Nat holds
not ( b3 divides b2 & b3 <= b1 & b3 is prime ) ) )
proof end;

Lemma14: for b1 being Nat holds
( not ( not b1 is prime & not b1 <= 1 & ( for b2 being Nat holds
not ( b2 divides b1 & 1 < b2 & b2 * b2 <= b1 & b2 is prime ) ) ) & not ( not ( not b1 <= 1 & ( for b2 being Nat holds
not ( b2 divides b1 & 1 < b2 & b2 * b2 <= b1 & b2 is prime ) ) ) & b1 is prime ) )
proof end;

theorem Th14: :: NAT_4:14
for b1 being Nat holds
( b1 is prime iff ( b1 > 1 & ( for b2 being Nat holds
not ( 1 < b2 & b2 * b2 <= b1 & b2 is prime & b2 divides b1 ) ) ) )
proof end;

theorem Th15: :: NAT_4:15
for b1, b2, b3 being Nat holds
( (b1 |^ b3) mod b2 = 1 & b3 >= 1 & b2 is prime implies b1,b2 are_relative_prime )
proof end;

theorem Th16: :: NAT_4:16
for b1 being Prime
for b2 being Nat
for b3 being set holds
not ( b2 <> 0 & b3 = b1 |^ (b1 |-count b2) & ( for b4 being Nat holds
not ( b4 = b3 & 1 <= b4 & b4 <= b2 ) ) )
proof end;

theorem Th17: :: NAT_4:17
for b1, b2, b3, b4 being Nat holds
( b2 is prime & b4 divides b1 * (b2 |^ (b3 + 1)) & not b4 divides b1 * (b2 |^ b3) implies b2 |^ (b3 + 1) divides b4 )
proof end;

theorem Th18: :: NAT_4:18
for b1, b2, b3 being Nat holds
( b1 divides b2 |^ b3 & b2 is prime & b1 is prime & b3 > 0 implies b2 = b1 )
proof end;

theorem Th19: :: NAT_4:19
for b1 being Prime
for b2 being Nat holds
not ( b2 < b1 & b1 divides b2 ! )
proof end;

theorem Th20: :: NAT_4:20
for b1, b2 being non empty natural number holds
not ( ( for b3 being Nat holds
( b3 is prime implies b3 |-count b1 <= b3 |-count b2 ) ) & ( for b3 being Nat holds
not b2 = b1 * b3 ) )
proof end;

theorem Th21: :: NAT_4:21
for b1, b2 being non empty natural number holds
( ( for b3 being Nat holds
( b3 is prime implies b3 |-count b1 = b3 |-count b2 ) ) implies b1 = b2 )
proof end;

theorem Th22: :: NAT_4:22
for b1, b2 being Prime
for b3 being non empty Nat holds
( b1 |^ (b1 |-count b3) = b2 |^ (b2 |-count b3) & b1 |-count b3 > 0 implies b1 = b2 )
proof end;

theorem Th23: :: NAT_4:23
for b1, b2, b3, b4, b5, b6, b7 being Nat holds
not ( b1 - 1 = b2 * (b3 |^ b5) & b2 > 0 & b5 > 0 & b3 is prime & (b7 |^ (b1 -' 1)) mod b1 = 1 & b6 is prime & b6 divides b1 & not b6 divides (b7 |^ ((b1 -' 1) div b3)) -' 1 & not b6 mod (b3 |^ b5) = 1 )
proof end;

theorem Th24: :: NAT_4:24
for b1, b2, b3 being Nat holds
( b1 - 1 = b2 * b3 & b2 > b3 & b3 > 0 & b2 hcf b3 = 1 & ( for b4 being Nat holds
not ( b4 divides b2 & b4 is prime & ( for b5 being Nat holds
not ( (b5 |^ (b1 -' 1)) mod b1 = 1 & ((b5 |^ ((b1 -' 1) div b4)) -' 1) hcf b1 = 1 ) ) ) ) implies b1 is prime )
proof end;

theorem Th25: :: NAT_4:25
for b1, b2, b3, b4, b5, b6 being Nat holds
( b1 - 1 = (b6 |^ b4) * b3 & b6 |^ b4 > b3 & b3 > 0 & b6 hcf b3 = 1 & b6 is prime & (b5 |^ (b1 -' 1)) mod b1 = 1 & ((b5 |^ ((b1 -' 1) div b6)) -' 1) hcf b1 = 1 implies b1 is prime )
proof end;

Lemma27: for b1 being Nat holds
not ( 1 < b1 & b1 < 5 & b1 is prime & not b1 = 2 & not b1 = 3 )
proof end;

Lemma28: for b1 being Nat holds
( b1 < 25 implies for b2 being Nat holds
not ( 1 < b2 & b2 * b2 <= b1 & b2 is prime & not b2 = 2 & not b2 = 3 ) )
proof end;

theorem Th26: :: NAT_4:26
7 is prime
proof end;

theorem Th27: :: NAT_4:27
11 is prime
proof end;

theorem Th28: :: NAT_4:28
13 is prime
proof end;

Lemma31: ( not 6 is prime & not 8 is prime & not 9 is prime & not 10 is prime & not 12 is prime & not 14 is prime & not 15 is prime & not 16 is prime & not 18 is prime & not 20 is prime & not 21 is prime & not 22 is prime & not 24 is prime & not 25 is prime & not 26 is prime & not 27 is prime & not 28 is prime )
proof end;

theorem Th29: :: NAT_4:29
19 is prime
proof end;

theorem Th30: :: NAT_4:30
23 is prime
proof end;

Lemma33: for b1 being Nat holds
not ( 1 < b1 & b1 < 29 & b1 is prime & not b1 = 2 & not b1 = 3 & not b1 = 5 & not b1 = 7 & not b1 = 11 & not b1 = 13 & not b1 = 17 & not b1 = 19 & not b1 = 23 )
proof end;

Lemma34: for b1 being Nat holds
( b1 < 841 implies for b2 being Nat holds
not ( 1 < b2 & b2 * b2 <= b1 & b2 is prime & not b2 = 2 & not b2 = 3 & not b2 = 5 & not b2 = 7 & not b2 = 11 & not b2 = 13 & not b2 = 17 & not b2 = 19 & not b2 = 23 ) )
proof end;

theorem Th31: :: NAT_4:31
37 is prime
proof end;

theorem Th32: :: NAT_4:32
43 is prime
proof end;

theorem Th33: :: NAT_4:33
83 is prime
proof end;

theorem Th34: :: NAT_4:34
139 is prime
proof end;

theorem Th35: :: NAT_4:35
163 is prime
proof end;

theorem Th36: :: NAT_4:36
317 is prime
proof end;

theorem Th37: :: NAT_4:37
631 is prime
proof end;

theorem Th38: :: NAT_4:38
1259 is prime
proof end;

theorem Th39: :: NAT_4:39
2503 is prime
proof end;

theorem Th40: :: NAT_4:40
4001 is prime
proof end;

Lemma45: for b1 being Nat holds
not ( 1 <= b1 & b1 < 4001 & ( for b2 being Prime holds
not ( b1 < b2 & b2 <= 2 * b1 ) ) )
proof end;

theorem Th41: :: NAT_4:41
for b1, b2, b3 being FinSequence of REAL holds
( b1 = b2 + b3 implies dom b1 = (dom b2) /\ (dom b3) )
proof end;

theorem Th42: :: NAT_4:42
for b1 being FinSequence of REAL holds
not ( ( for b2 being Nat holds
not ( b2 in dom b1 & not b1 . b2 > 0 ) ) & not Product b1 > 0 )
proof end;

theorem Th43: :: NAT_4:43
for b1 being set
for b2 being finite set holds
( b1 c= b2 & b2 c= NAT & not {} in b2 implies Product (Sgm b1) <= Product (Sgm b2) )
proof end;

theorem Th44: :: NAT_4:44
for b1, b2 being Nat
for b3 being set
for b4 being FinSequence of SetPrimes
for b5 being Prime holds
( b3 c= SetPrimes & b3 c= Seg b2 & b4 = Sgm b3 & b1 = Product b4 implies ( ( b5 in rng b4 implies b5 |-count b1 = 1 ) & ( not b5 in rng b4 implies b5 |-count b1 = 0 ) ) )
proof end;

theorem Th45: :: NAT_4:45
for b1 being Nat holds Product (Sgm { b2 where B is Prime : b2 <= b1 + 1 } ) <= 4 to_power b1
proof end;

theorem Th46: :: NAT_4:46
for b1 being Real holds
( b1 >= 2 implies Product (Sgm { b2 where B is Prime : b2 <= b1 } ) <= 4 to_power (b1 - 1) )
proof end;

theorem Th47: :: NAT_4:47
for b1 being Nat
for b2 being Prime holds
not ( b1 <> 0 & ( for b3 being FinSequence of NAT holds
not ( len b3 = b1 & ( for b4 being Nat holds
( b4 in dom b3 implies ( ( b3 . b4 = 1 implies b2 |^ b4 divides b1 ) & ( b2 |^ b4 divides b1 implies b3 . b4 = 1 ) & not ( b3 . b4 = 0 & b2 |^ b4 divides b1 ) & ( not b2 |^ b4 divides b1 implies b3 . b4 = 0 ) ) ) ) & b2 |-count b1 = Sum b3 ) ) )
proof end;

theorem Th48: :: NAT_4:48
for b1 being Nat
for b2 being Prime holds
ex b3 being FinSequence of NAT st
( len b3 = b1 & ( for b4 being Nat holds
( b4 in dom b3 implies b3 . b4 = [\(b1 / (b2 |^ b4))/] ) ) & b2 |-count (b1 ! ) = Sum b3 )
proof end;

theorem Th49: :: NAT_4:49
for b1 being Nat
for b2 being Prime holds
ex b3 being FinSequence of REAL st
( len b3 = 2 * b1 & ( for b4 being Nat holds
( b4 in dom b3 implies b3 . b4 = [\((2 * b1) / (b2 |^ b4))/] - (2 * [\(b1 / (b2 |^ b4))/]) ) ) & b2 |-count ((2 * b1) choose b1) = Sum b3 )
proof end;

Lemma55: for b1, b2 being Nat
for b3 being Prime
for b4 being FinSequence of REAL holds
( b1 >= 2 & b3 |^ b2 <= 2 * b1 & 2 * b1 < b3 |^ (b2 + 1) & len b4 = 2 * b1 & ( for b5 being Nat holds
( b5 in dom b4 implies b4 . b5 = [\((2 * b1) / (b3 |^ b5))/] - (2 * [\(b1 / (b3 |^ b5))/]) ) ) implies Sum b4 <= b2 )
proof end;

Lemma56: for b1 being Nat
for b2 being Prime holds
( b1 >= 3 implies ( ( b2 > 2 * b1 implies b2 |-count ((2 * b1) choose b1) = 0 ) & ( b1 < b2 & b2 <= 2 * b1 implies b2 |-count ((2 * b1) choose b1) <= 1 ) & ( (2 * b1) / 3 < b2 & b2 <= b1 implies b2 |-count ((2 * b1) choose b1) = 0 ) & ( sqrt (2 * b1) < b2 & b2 <= (2 * b1) / 3 implies b2 |-count ((2 * b1) choose b1) <= 1 ) & ( b2 <= sqrt (2 * b1) implies b2 |^ (b2 |-count ((2 * b1) choose b1)) <= 2 * b1 ) ) )
proof end;

definition
let c1 be FinSequence of NAT ;
let c2 be Prime;
func c2 |-count c1 -> FinSequence of NAT means :Def1: :: NAT_4:def 1
( len a3 = len a1 & ( for b1 being set holds
( b1 in dom a3 implies a3 . b1 = a2 |-count (a1 . b1) ) ) );
existence
ex b1 being FinSequence of NAT st
( len b1 = len c1 & ( for b2 being set holds
( b2 in dom b1 implies b1 . b2 = c2 |-count (c1 . b2) ) ) )
proof end;
uniqueness
for b1, b2 being FinSequence of NAT holds
( len b1 = len c1 & ( for b3 being set holds
( b3 in dom b1 implies b1 . b3 = c2 |-count (c1 . b3) ) ) & len b2 = len c1 & ( for b3 being set holds
( b3 in dom b2 implies b2 . b3 = c2 |-count (c1 . b3) ) ) implies b1 = b2 )
proof end;
end;

:: deftheorem Def1 defines |-count NAT_4:def 1 :
for b1 being FinSequence of NAT
for b2 being Prime
for b3 being FinSequence of NAT holds
( b3 = b2 |-count b1 iff ( len b3 = len b1 & ( for b4 being set holds
( b4 in dom b3 implies b3 . b4 = b2 |-count (b1 . b4) ) ) ) );

theorem Th50: :: NAT_4:50
for b1 being Prime
for b2 being FinSequence of NAT holds
( b2 = {} implies b1 |-count b2 = {} )
proof end;

theorem Th51: :: NAT_4:51
for b1 being Prime
for b2, b3 being FinSequence of NAT holds b1 |-count (b2 ^ b3) = (b1 |-count b2) ^ (b1 |-count b3)
proof end;

theorem Th52: :: NAT_4:52
for b1 being Prime
for b2 being non empty Nat holds b1 |-count <*b2*> = <*(b1 |-count b2)*>
proof end;

theorem Th53: :: NAT_4:53
for b1 being FinSequence of NAT
for b2 being Prime holds
( Product b1 <> 0 implies b2 |-count (Product b1) = Sum (b2 |-count b1) )
proof end;

theorem Th54: :: NAT_4:54
for b1, b2 being FinSequence of REAL holds
( len b1 = len b2 & ( for b3 being Nat holds
( b3 in dom b1 implies ( b1 . b3 <= b2 . b3 & b1 . b3 > 0 ) ) ) implies Product b1 <= Product b2 )
proof end;

theorem Th55: :: NAT_4:55
for b1 being Nat
for b2 being Real holds
( b2 > 0 implies Product (b1 |-> b2) = b2 to_power b1 )
proof end;

scheme :: NAT_4:sch 1
s1{ P1[ Nat, Nat, Prime] } :
for b1 being Prime
for b2 being Nat
for b3 being non empty Nat
for b4 being set holds
not ( b4 = { (b5 |^ (b5 |-count b3)) where B is Prime : P1[b2,b3,b5] } & not Product (Sgm b4) > 0 )
proof end;

scheme :: NAT_4:sch 2
s2{ P1[ Nat, Nat, Prime] } :
for b1 being Prime
for b2 being Nat
for b3 being non empty Nat
for b4 being set holds
( b4 = { (b5 |^ (b5 |-count b3)) where B is Prime : P1[b2,b3,b5] } & not b1 |^ (b1 |-count b3) in b4 implies b1 |-count (Product (Sgm b4)) = 0 )
proof end;

scheme :: NAT_4:sch 3
s3{ P1[ Nat, Nat, Prime] } :
for b1 being Prime
for b2 being Nat
for b3 being non empty Nat
for b4 being set holds
( b4 = { (b5 |^ (b5 |-count b3)) where B is Prime : P1[b2,b3,b5] } & b1 |^ (b1 |-count b3) in b4 implies b1 |-count (Product (Sgm b4)) = b1 |-count b3 )
proof end;

Lemma64: for b1, b2 being Nat holds
( b2 = (2 * b1) choose b1 & b1 >= 3 implies b2 = ((Product (Sgm { (b3 |^ (b3 |-count b2)) where B is Prime : ( b3 <= sqrt (2 * b1) & b3 |-count b2 > 0 ) } )) * (Product (Sgm { (b3 |^ (b3 |-count b2)) where B is Prime : ( sqrt (2 * b1) < b3 & b3 <= (2 * b1) / 3 & b3 |-count b2 > 0 ) } ))) * (Product (Sgm { (b3 |^ (b3 |-count b2)) where B is Prime : ( b1 < b3 & b3 <= 2 * b1 & b3 |-count b2 > 0 ) } )) )
proof end;

scheme :: NAT_4:sch 4
s4{ F1( Prime, Nat) -> set , P1[ Prime, Nat] } :
for b1, b2 being Nat
for b3 being Real
for b4 being finite set holds
( b4 = { F1(b5,b2) where B is Prime : ( b5 <= b3 & P1[b5,b2] ) } & b3 >= 0 implies card b4 <= [\b3/] )
proof end;

Lemma65: for b1, b2 being Nat holds
( b2 = (2 * b1) choose b1 & b1 >= 3 implies Product (Sgm { (b3 |^ (b3 |-count b2)) where B is Prime : ( b3 <= sqrt (2 * b1) & b3 |-count b2 > 0 ) } ) <= (2 * b1) to_power (sqrt (2 * b1)) )
proof end;

theorem Th56: :: NAT_4:56
for b1 being Nat holds
not ( b1 >= 1 & ( for b2 being Prime holds
not ( b1 < b2 & b2 <= 2 * b1 ) ) )
proof end;