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


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
for x, y being Real st x >= 0 & y > 0 holds
x / ([\(x / y)/] + 1) < y
proof end;

theorem Th2: :: NAT_2:2
for n being Nat holds 0 div n = 0
proof end;

theorem :: NAT_2:3
for n being non zero Nat holds n div n = 1
proof end;

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

theorem :: NAT_2:5
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:6
for i, n being Nat st i in Seg n holds
(n -' i) + 1 in Seg n
proof end;

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

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

theorem Th9: :: NAT_2:9
for i, j being non zero Nat holds i -' j < i
proof end;

theorem Th10: :: NAT_2:10
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:11
for k, n being Nat st k <= n holds
2 to_power k divides 2 to_power n
proof end;

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

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

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

theorem :: NAT_2:15
for i, k, n 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:16
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:17
for n being Nat st n > 0 holds
(2 to_power n) mod 2 = 0
proof end;

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

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

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

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

theorem :: NAT_2:22
for n being Nat holds
( n is odd iff n mod 2 = 1 ) by Th21, NAT_D:12;

theorem :: NAT_2:23
for k, n, t 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 Th24: :: NAT_2:24
for k, m, n being Nat st n <= m holds
n div k <= m div k
proof end;

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

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

theorem :: NAT_2:27
for i, k, n 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 V12() V13() V14() V18() complex V38() integer dim-like for set ;
existence
not for b1 being Nat holds b1 is trivial
proof end;
end;

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

theorem :: NAT_2:29
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;

:: from POLYNOM1, 2007.03.18, A.T.
theorem :: NAT_2:30
for i, j, k being Nat holds (i -' j) -' k = i -' (j + k)
proof end;