:: NAT_1 semantic presentation

definition
mode Nat is Element of NAT ;
end;

theorem Th1: :: NAT_1:1
canceled;

theorem Th2: :: NAT_1:2
for b1 being Subset of REAL st 0 in b1 & ( for b2 being Real st b2 in b1 holds
b2 + 1 in b1 ) holds
for b2 being Nat holds b2 in b1
proof end;

definition
let c1, c2 be Nat;
redefine func + as c1 + c2 -> Nat;
coherence
c1 + c2 is Nat
proof end;
end;

registration
let c1, c2 be natural number ;
cluster a1 + a2 -> natural ;
coherence
c1 + c2 is natural
proof end;
end;

scheme :: NAT_1:sch 1
s1{ P1[ Nat] } :
for b1 being Nat holds P1[b1]
provided
E2: P1[0] and
E3: for b1 being Nat st P1[b1] holds
P1[b1 + 1]
proof end;

scheme :: NAT_1:sch 2
s2{ P1[ natural number ] } :
for b1 being natural number holds P1[b1]
provided
E2: P1[0] and
E3: for b1 being natural number st P1[b1] holds
P1[b1 + 1]
proof end;

definition
let c1, c2 be Nat;
redefine func * as c1 * c2 -> Nat;
coherence
c1 * c2 is Nat
proof end;
end;

registration
let c1, c2 be natural number ;
cluster a1 * a2 -> natural ;
coherence
c1 * c2 is natural
proof end;
end;

theorem Th3: :: NAT_1:3
canceled;

theorem Th4: :: NAT_1:4
canceled;

theorem Th5: :: NAT_1:5
canceled;

theorem Th6: :: NAT_1:6
canceled;

theorem Th7: :: NAT_1:7
canceled;

theorem Th8: :: NAT_1:8
canceled;

theorem Th9: :: NAT_1:9
canceled;

theorem Th10: :: NAT_1:10
canceled;

theorem Th11: :: NAT_1:11
canceled;

theorem Th12: :: NAT_1:12
canceled;

theorem Th13: :: NAT_1:13
canceled;

theorem Th14: :: NAT_1:14
canceled;

theorem Th15: :: NAT_1:15
canceled;

theorem Th16: :: NAT_1:16
canceled;

theorem Th17: :: NAT_1:17
canceled;

theorem Th18: :: NAT_1:18
for b1 being natural number holds 0 <= b1
proof end;

theorem Th19: :: NAT_1:19
for b1 being natural number st 0 <> b1 holds
0 < b1 by Th18;

theorem Th20: :: NAT_1:20
for b1, b2, b3 being natural number st b1 <= b2 holds
b1 * b3 <= b2 * b3
proof end;

theorem Th21: :: NAT_1:21
for b1 being natural number holds 0 < b1 + 1
proof end;

theorem Th22: :: NAT_1:22
for b1 being natural number holds
( b1 = 0 or ex b2 being Nat st b1 = b2 + 1 )
proof end;

theorem Th23: :: NAT_1:23
for b1, b2 being natural number st b1 + b2 = 0 holds
( b1 = 0 & b2 = 0 )
proof end;

registration
cluster non zero natural set ;
existence
not for b1 being natural number holds b1 is empty
proof end;
end;

registration
let c1 be natural number ;
let c2 be non zero natural number ;
cluster a1 + a2 -> non zero natural ;
coherence
not c1 + c2 is empty
by Th23;
cluster a2 + a1 -> non zero natural ;
coherence
not c2 + c1 is empty
;
end;

scheme :: NAT_1:sch 3
s3{ F1() -> Nat, F2( Nat, Nat) -> Nat, P1[ Nat, Nat] } :
( ( for b1 being Nat ex b2 being Nat st P1[b1,b2] ) & ( for b1, b2, b3 being Nat st P1[b1,b2] & P1[b1,b3] holds
b2 = b3 ) )
provided
E6: for b1, b2 being Nat holds
( P1[b1,b2] iff ( ( b1 = 0 & b2 = F1() ) or ex b3, b4 being Nat st
( b1 = b3 + 1 & P1[b3,b4] & b2 = F2(b1,b4) ) ) )
proof end;

theorem Th24: :: NAT_1:24
canceled;

theorem Th25: :: NAT_1:25
canceled;

theorem Th26: :: NAT_1:26
for b1, b2 being natural number holds
( not b1 <= b2 + 1 or b1 <= b2 or b1 = b2 + 1 )
proof end;

theorem Th27: :: NAT_1:27
for b1, b2 being natural number st b1 <= b2 & b2 <= b1 + 1 & not b1 = b2 holds
b2 = b1 + 1
proof end;

theorem Th28: :: NAT_1:28
for b1, b2 being natural number st b1 <= b2 holds
ex b3 being Nat st b2 = b1 + b3
proof end;

theorem Th29: :: NAT_1:29
for b1, b2 being natural number holds b1 <= b1 + b2
proof end;

scheme :: NAT_1:sch 4
s4{ P1[ Nat] } :
for b1 being Nat holds P1[b1]
provided
E9: for b1 being Nat st ( for b2 being Nat st b2 < b1 holds
P1[b2] ) holds
P1[b1]
proof end;

scheme :: NAT_1:sch 5
s5{ P1[ Nat] } :
ex b1 being Nat st
( P1[b1] & ( for b2 being Nat st P1[b2] holds
b1 <= b2 ) )
provided
E9: ex b1 being Nat st P1[b1]
proof end;

scheme :: NAT_1:sch 6
s6{ P1[ Nat], F1() -> Nat } :
ex b1 being Nat st
( P1[b1] & ( for b2 being Nat st P1[b2] holds
b2 <= b1 ) )
provided
E9: for b1 being Nat st P1[b1] holds
b1 <= F1() and
E10: ex b1 being Nat st P1[b1]
proof end;

theorem Th30: :: NAT_1:30
canceled;

theorem Th31: :: NAT_1:31
canceled;

theorem Th32: :: NAT_1:32
canceled;

theorem Th33: :: NAT_1:33
canceled;

theorem Th34: :: NAT_1:34
canceled;

theorem Th35: :: NAT_1:35
canceled;

theorem Th36: :: NAT_1:36
canceled;

theorem Th37: :: NAT_1:37
for b1, b2, b3 being natural number st b1 <= b2 holds
b1 <= b2 + b3
proof end;

theorem Th38: :: NAT_1:38
for b1, b2 being natural number holds
( b1 < b2 + 1 iff b1 <= b2 )
proof end;

theorem Th39: :: NAT_1:39
for b1 being natural number st b1 < 1 holds
b1 = 0
proof end;

theorem Th40: :: NAT_1:40
for b1, b2 being natural number st b1 * b2 = 1 holds
( b1 = 1 & b2 = 1 )
proof end;

theorem Th41: :: NAT_1:41
for b1, b2 being natural number st b1 <> 0 holds
b2 < b2 + b1
proof end;

scheme :: NAT_1:sch 7
s7{ P1[ Nat] } :
P1[0]
provided
E14: ex b1 being Nat st P1[b1] and
E15: for b1 being Nat st b1 <> 0 & P1[b1] holds
ex b2 being Nat st
( b2 < b1 & P1[b2] )
proof end;

theorem Th42: :: NAT_1:42
for b1 being Nat st 0 < b1 holds
for b2 being Nat ex b3, b4 being Nat st
( b2 = (b1 * b3) + b4 & b4 < b1 )
proof end;

theorem Th43: :: NAT_1:43
for b1, b2, b3, b4, b5, b6 being natural number st b1 = (b2 * b3) + b5 & b5 < b2 & b1 = (b2 * b4) + b6 & b6 < b2 holds
( b3 = b4 & b5 = b6 )
proof end;

definition
let c1, c2 be natural number ;
E16: ( c1 is Nat & c2 is Nat ) by ORDINAL2:def 21;
func c1 div c2 -> Nat means :Def1: :: NAT_1:def 1
( ex b1 being Nat st
( a1 = (a2 * a3) + b1 & b1 < a2 ) or ( a3 = 0 & a2 = 0 ) );
existence
ex b1 being Nat st
( ex b2 being Nat st
( c1 = (c2 * b1) + b2 & b2 < c2 ) or ( b1 = 0 & c2 = 0 ) )
proof end;
uniqueness
for b1, b2 being Nat st ( ex b3 being Nat st
( c1 = (c2 * b1) + b3 & b3 < c2 ) or ( b1 = 0 & c2 = 0 ) ) & ( ex b3 being Nat st
( c1 = (c2 * b2) + b3 & b3 < c2 ) or ( b2 = 0 & c2 = 0 ) ) holds
b1 = b2
proof end;
func c1 mod c2 -> Nat means :Def2: :: NAT_1:def 2
( ex b1 being Nat st
( a1 = (a2 * b1) + a3 & a3 < a2 ) or ( a3 = 0 & a2 = 0 ) );
existence
ex b1 being Nat st
( ex b2 being Nat st
( c1 = (c2 * b2) + b1 & b1 < c2 ) or ( b1 = 0 & c2 = 0 ) )
proof end;
uniqueness
for b1, b2 being Nat st ( ex b3 being Nat st
( c1 = (c2 * b3) + b1 & b1 < c2 ) or ( b1 = 0 & c2 = 0 ) ) & ( ex b3 being Nat st
( c1 = (c2 * b3) + b2 & b2 < c2 ) or ( b2 = 0 & c2 = 0 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def1 defines div NAT_1:def 1 :
for b1, b2 being natural number
for b3 being Nat holds
( b3 = b1 div b2 iff ( ex b4 being Nat st
( b1 = (b2 * b3) + b4 & b4 < b2 ) or ( b3 = 0 & b2 = 0 ) ) );

:: deftheorem Def2 defines mod NAT_1:def 2 :
for b1, b2 being natural number
for b3 being Nat holds
( b3 = b1 mod b2 iff ( ex b4 being Nat st
( b1 = (b2 * b4) + b3 & b3 < b2 ) or ( b3 = 0 & b2 = 0 ) ) );

theorem Th44: :: NAT_1:44
canceled;

theorem Th45: :: NAT_1:45
canceled;

theorem Th46: :: NAT_1:46
for b1, b2 being natural number st 0 < b1 holds
b2 mod b1 < b1
proof end;

theorem Th47: :: NAT_1:47
for b1, b2 being natural number st 0 < b1 holds
b2 = (b1 * (b2 div b1)) + (b2 mod b1)
proof end;

definition
let c1, c2 be natural number ;
pred c1 divides c2 means :Def3: :: NAT_1:def 3
ex b1 being Nat st a2 = a1 * b1;
reflexivity
for b1 being natural number ex b2 being Nat st b1 = b1 * b2
proof end;
end;

:: deftheorem Def3 defines divides NAT_1:def 3 :
for b1, b2 being natural number holds
( b1 divides b2 iff ex b3 being Nat st b2 = b1 * b3 );

theorem Th48: :: NAT_1:48
canceled;

theorem Th49: :: NAT_1:49
for b1, b2 being natural number holds
( b1 divides b2 iff b2 = b1 * (b2 div b1) )
proof end;

theorem Th50: :: NAT_1:50
canceled;

theorem Th51: :: NAT_1:51
for b1, b2, b3 being natural number st b1 divides b2 & b2 divides b3 holds
b1 divides b3
proof end;

theorem Th52: :: NAT_1:52
for b1, b2 being natural number st b1 divides b2 & b2 divides b1 holds
b1 = b2
proof end;

theorem Th53: :: NAT_1:53
for b1 being natural number holds
( b1 divides 0 & 1 divides b1 )
proof end;

theorem Th54: :: NAT_1:54
for b1, b2 being natural number st 0 < b1 & b2 divides b1 holds
b2 <= b1
proof end;

theorem Th55: :: NAT_1:55
for b1, b2, b3 being natural number st b1 divides b2 & b1 divides b3 holds
b1 divides b2 + b3
proof end;

theorem Th56: :: NAT_1:56
for b1, b2, b3 being natural number st b1 divides b2 holds
b1 divides b2 * b3
proof end;

theorem Th57: :: NAT_1:57
for b1, b2, b3 being natural number st b1 divides b2 & b1 divides b2 + b3 holds
b1 divides b3
proof end;

theorem Th58: :: NAT_1:58
for b1, b2, b3 being natural number st b1 divides b2 & b1 divides b3 holds
b1 divides b2 mod b3
proof end;

definition
let c1, c2 be Nat;
func c1 lcm c2 -> Nat means :Def4: :: NAT_1:def 4
( a1 divides a3 & a2 divides a3 & ( for b1 being Nat st a1 divides b1 & a2 divides b1 holds
a3 divides b1 ) );
existence
ex b1 being Nat st
( c1 divides b1 & c2 divides b1 & ( for b2 being Nat st c1 divides b2 & c2 divides b2 holds
b1 divides b2 ) )
proof end;
uniqueness
for b1, b2 being Nat st c1 divides b1 & c2 divides b1 & ( for b3 being Nat st c1 divides b3 & c2 divides b3 holds
b1 divides b3 ) & c1 divides b2 & c2 divides b2 & ( for b3 being Nat st c1 divides b3 & c2 divides b3 holds
b2 divides b3 ) holds
b1 = b2
proof end;
idempotence
for b1 being Nat holds
( b1 divides b1 & b1 divides b1 & ( for b2 being Nat st b1 divides b2 & b1 divides b2 holds
b1 divides b2 ) )
;
commutativity
for b1, b2, b3 being Nat st b2 divides b1 & b3 divides b1 & ( for b4 being Nat st b2 divides b4 & b3 divides b4 holds
b1 divides b4 ) holds
( b3 divides b1 & b2 divides b1 & ( for b4 being Nat st b3 divides b4 & b2 divides b4 holds
b1 divides b4 ) )
;
end;

:: deftheorem Def4 defines lcm NAT_1:def 4 :
for b1, b2, b3 being Nat holds
( b3 = b1 lcm b2 iff ( b1 divides b3 & b2 divides b3 & ( for b4 being Nat st b1 divides b4 & b2 divides b4 holds
b3 divides b4 ) ) );

definition
let c1, c2 be Nat;
func c1 hcf c2 -> Nat means :Def5: :: NAT_1:def 5
( a3 divides a1 & a3 divides a2 & ( for b1 being Nat st b1 divides a1 & b1 divides a2 holds
b1 divides a3 ) );
existence
ex b1 being Nat st
( b1 divides c1 & b1 divides c2 & ( for b2 being Nat st b2 divides c1 & b2 divides c2 holds
b2 divides b1 ) )
proof end;
uniqueness
for b1, b2 being Nat st b1 divides c1 & b1 divides c2 & ( for b3 being Nat st b3 divides c1 & b3 divides c2 holds
b3 divides b1 ) & b2 divides c1 & b2 divides c2 & ( for b3 being Nat st b3 divides c1 & b3 divides c2 holds
b3 divides b2 ) holds
b1 = b2
proof end;
idempotence
for b1 being Nat holds
( b1 divides b1 & b1 divides b1 & ( for b2 being Nat st b2 divides b1 & b2 divides b1 holds
b2 divides b1 ) )
;
commutativity
for b1, b2, b3 being Nat st b1 divides b2 & b1 divides b3 & ( for b4 being Nat st b4 divides b2 & b4 divides b3 holds
b4 divides b1 ) holds
( b1 divides b3 & b1 divides b2 & ( for b4 being Nat st b4 divides b3 & b4 divides b2 holds
b4 divides b1 ) )
;
end;

:: deftheorem Def5 defines hcf NAT_1:def 5 :
for b1, b2, b3 being Nat holds
( b3 = b1 hcf b2 iff ( b3 divides b1 & b3 divides b2 & ( for b4 being Nat st b4 divides b1 & b4 divides b2 holds
b4 divides b3 ) ) );

scheme :: NAT_1:sch 8
s8{ F1( Nat) -> Nat, F2() -> Nat, F3() -> Nat } :
ex b1 being Nat st
( F1(b1) = F2() hcf F3() & F1((b1 + 1)) = 0 )
provided
E31: ( 0 < F3() & F3() < F2() ) and
E32: ( F1(0) = F2() & F1(1) = F3() ) and
E33: for b1 being Nat holds F1((b1 + 2)) = F1(b1) mod F1((b1 + 1))
proof end;

registration
cluster -> ordinal Element of NAT ;
coherence
for b1 being Nat holds b1 is ordinal
;
end;

registration
cluster non empty ordinal Element of K40(REAL );
existence
ex b1 being Subset of REAL st
( not b1 is empty & b1 is ordinal )
proof end;
end;

theorem Th59: :: NAT_1:59
for b1, b2 being natural number holds
( b1 < b1 + b2 iff 1 <= b2 )
proof end;

theorem Th60: :: NAT_1:60
for b1, b2 being natural number st b1 < b2 holds
b2 - 1 is Nat
proof end;

theorem Th61: :: NAT_1:61
for b1, b2 being natural number st b1 <= b2 holds
b2 - b1 is Nat
proof end;

theorem Th62: :: NAT_1:62
for b1 being natural number holds
( b1 mod 2 = 0 or b1 mod 2 = 1 )
proof end;

theorem Th63: :: NAT_1:63
for b1, b2 being natural number holds (b1 * b2) mod b1 = 0
proof end;

theorem Th64: :: NAT_1:64
for b1, b2 being natural number st b1 > 1 holds
1 mod b1 = 1
proof end;

theorem Th65: :: NAT_1:65
for b1, b2, b3, b4 being natural number st b1 mod b3 = 0 & b2 = b1 - (b4 * b3) holds
b2 mod b3 = 0
proof end;

theorem Th66: :: NAT_1:66
for b1, b2, b3 being natural number st b3 <> 0 & b1 mod b3 = 0 & b2 < b3 holds
(b1 + b2) mod b3 = b2
proof end;

theorem Th67: :: NAT_1:67
for b1, b2, b3 being natural number st b1 mod b3 = 0 holds
(b1 + b2) mod b3 = b2 mod b3
proof end;

theorem Th68: :: NAT_1:68
for b1, b2 being natural number st b1 <> 0 holds
(b1 * b2) div b1 = b2
proof end;

theorem Th69: :: NAT_1:69
for b1, b2, b3 being natural number st b1 mod b2 = 0 holds
(b1 + b3) div b2 = (b1 div b2) + (b3 div b2)
proof end;

theorem Th70: :: NAT_1:70
for b1, b2 being Nat holds
( not b1 < b2 + 1 or b1 < b2 or b1 = b2 )
proof end;

theorem Th71: :: NAT_1:71
for b1 being Nat holds
( not b1 < 2 or b1 = 0 or b1 = 1 )
proof end;

registration
cluster non zero Element of NAT ;
existence
not for b1 being Nat holds b1 is empty
proof end;
end;

registration
cluster -> ordinal non negative Element of NAT ;
coherence
for b1 being Element of NAT holds not b1 is negative
by Th18;
end;

registration
cluster natural -> natural non negative set ;
coherence
for b1 being natural number holds not b1 is negative
by Th18;
end;

theorem Th72: :: NAT_1:72
for b1, b2 being Nat st b2 <> 0 holds
(b1 * b2) div b2 = b1
proof end;

theorem Th73: :: NAT_1:73
for b1, b2, b3 being natural number holds b1 mod b2 = ((b2 * b3) + b1) mod b2
proof end;

theorem Th74: :: NAT_1:74
for b1, b2, b3 being natural number holds (b1 + b2) mod b3 = ((b1 mod b3) + b2) mod b3
proof end;

theorem Th75: :: NAT_1:75
for b1, b2, b3 being natural number holds (b1 + b2) mod b3 = (b1 + (b2 mod b3)) mod b3 by Th74;

theorem Th76: :: NAT_1:76
for b1, b2 being natural number st b2 < b1 holds
b2 mod b1 = b2
proof end;

theorem Th77: :: NAT_1:77
for b1 being natural number holds b1 mod b1 = 0
proof end;

theorem Th78: :: NAT_1:78
for b1 being natural number holds 0 = 0 mod b1
proof end;