:: Natural Numbers
:: by Robert Milewski
::
:: Received February 23, 1998
:: Copyright (c) 1998-2011 Association of Mizar Users


begin

scheme :: NAT_2:sch 1
NonUniqPiFinRecExD{ F1() -> non empty set , F2() -> Element of F1(), F3() -> Nat, P1[ set , set , set ] } :
ex p being FinSequence of F1() st
( len p = F3() & ( p /. 1 = F2() or F3() = 0 ) & ( for n being Nat st 1 <= n & n < F3() holds
P1[n,p /. n,p /. (n + 1)] ) )
provided
A1: for n being Nat st 1 <= n & n < F3() holds
for x being Element of F1() ex y being Element of F1() st P1[n,x,y]
proof end;

theorem :: NAT_2:1
canceled;

theorem :: NAT_2:2
for x, y being real number st x >= 0 & y > 0 holds
x / ([\(x / y)/] + 1) < y
proof end;

begin

theorem :: NAT_2:3
canceled;

theorem Th4: :: NAT_2:4
for n being Nat holds 0 div n = 0
proof end;

theorem :: NAT_2:5
for n being non empty Nat holds n div n = 1
proof end;

theorem :: NAT_2:6
for n being Nat holds n div 1 = n
proof end;

theorem :: NAT_2:7
for i, j, k, l being Nat st i <= j & k <= j & i = (j -' k) + l holds
k = (j -' i) + l
proof end;

theorem :: NAT_2:8
for i, n being Nat st i in Seg n holds
(n -' i) + 1 in Seg n
proof end;

theorem :: NAT_2:9
for j, i being Nat st j < i holds
(i -' (j + 1)) + 1 = i -' j
proof end;

theorem Th10: :: NAT_2:10
for i, j being Nat st i >= j holds
j -' i = 0
proof end;

theorem Th11: :: NAT_2:11
for i, j being non empty Nat holds i -' j < i
proof end;

theorem Th12: :: NAT_2:12
for k, n being Nat st k <= n holds
2 to_power n = (2 to_power k) * (2 to_power (n -' k))
proof end;

theorem :: NAT_2:13
for k, n being Nat st k <= n holds
2 to_power k divides 2 to_power n
proof end;

theorem Th14: :: NAT_2:14
for k, n being Nat st k > 0 & n div k = 0 holds
n < k
proof end;

theorem :: NAT_2:15
for k, n being Nat st k > 0 & k <= n holds
n div k >= 1
proof end;

theorem :: NAT_2:16
for k, n being Nat st k <> 0 holds
(n + k) div k = (n div k) + 1
proof end;

theorem :: NAT_2:17
for k, n, i being Nat st k divides n & 1 <= n & 1 <= i & i <= k holds
(n -' i) div k = (n div k) - 1
proof end;

theorem :: NAT_2:18
for k, n being Nat st k <= n holds
(2 to_power n) div (2 to_power k) = 2 to_power (n -' k)
proof end;

theorem :: NAT_2:19
for n being Nat st n > 0 holds
(2 to_power n) mod 2 = 0
proof end;

theorem :: NAT_2:20
for n being Nat st n > 0 holds
( n mod 2 = 0 iff (n -' 1) mod 2 = 1 )
proof end;

theorem :: NAT_2:21
for n being non empty Nat st n <> 1 holds
n > 1
proof end;

theorem :: NAT_2:22
for n, k being Nat st n <= k & k < n + n holds
k div n = 1
proof end;

theorem Th23: :: NAT_2:23
for n being Nat holds
( n is even iff n mod 2 = 0 )
proof end;

theorem :: NAT_2:24
for n being Nat holds
( not n is even iff n mod 2 = 1 )
proof end;

theorem :: NAT_2:25
for t, k, n being Nat st 1 <= t & k <= n & 2 * t divides k holds
( n div t is even iff (n -' k) div t is even )
proof end;

theorem Th26: :: NAT_2:26
for n, m, k being Nat st n <= m holds
n div k <= m div k
proof end;

theorem :: NAT_2:27
for k, n being Nat st k <= 2 * n holds
(k + 1) div 2 <= n
proof end;

theorem :: NAT_2:28
for n being Nat st n is even holds
n div 2 = (n + 1) div 2
proof end;

theorem :: NAT_2:29
for n, k, i being Nat holds (n div k) div i = n div (k * i)
proof end;

definition
let n be Nat;
redefine attr n is trivial means :Def1: :: NAT_2:def 1
( n = 0 or n = 1 );
compatibility
( n is trivial iff ( n = 0 or n = 1 ) )
proof end;
end;

:: deftheorem Def1 defines trivial NAT_2:def 1 :
for n being Nat holds
( n is trivial iff ( n = 0 or n = 1 ) );

registration
cluster ext-real non negative non trivial ordinal natural V14() real integer set ;
existence
not for b1 being Nat holds b1 is trivial
proof end;
end;

theorem :: NAT_2:30
for k being Nat holds
( not k is trivial iff ( not k is empty & k <> 1 ) ) by Def1;

theorem :: NAT_2:31
for k being non trivial Nat holds k >= 2
proof end;

scheme :: NAT_2:sch 2
Indfrom2{ P1[ set ] } :
for k being non trivial Nat holds P1[k]
provided
A1: P1[2] and
A2: for k being non trivial Nat st P1[k] holds
P1[k + 1]
proof end;

begin

theorem :: NAT_2:32
for i, j, k being Nat holds (i -' j) -' k = i -' (j + k)
proof end;