:: WSIERP_1 semantic presentation

definition
let c1 be FinSequence of REAL ;
let c2 be Nat;
redefine func . as c1 . c2 -> Real;
coherence
c1 . c2 is Real
proof end;
end;

theorem Th1: :: WSIERP_1:1
canceled;

theorem Th2: :: WSIERP_1:2
for b1 being real number holds
( b1 |^ 2 = b1 * b1 & (- b1) |^ 2 = b1 |^ 2 )
proof end;

theorem Th3: :: WSIERP_1:3
for b1 being real number
for b2 being Nat holds
( (- b1) |^ (2 * b2) = b1 |^ (2 * b2) & (- b1) |^ ((2 * b2) + 1) = - (b1 |^ ((2 * b2) + 1)) )
proof end;

theorem Th4: :: WSIERP_1:4
canceled;

theorem Th5: :: WSIERP_1:5
for b1, b2 being real number
for b3 being Nat st b1 >= 0 & b2 >= 0 & b3 > 0 & b1 |^ b3 = b2 |^ b3 holds
b1 = b2
proof end;

theorem Th6: :: WSIERP_1:6
for b1, b2, b3 being real number holds
( b1 > max b2,b3 iff ( b1 > b2 & b1 > b3 ) )
proof end;

Lemma5: for b1, b2 being real number holds
( ( b1 >= 0 implies b1 + b2 >= b2 ) & ( b1 + b2 >= b2 implies b1 >= 0 ) & ( b1 > 0 implies b1 + b2 > b2 ) & ( b1 + b2 > b2 implies b1 > 0 ) & ( b1 >= 0 implies b2 >= b2 - b1 ) & ( b2 >= b2 - b1 implies b1 >= 0 ) & ( b1 > 0 implies b2 > b2 - b1 ) & ( b2 > b2 - b1 implies b1 > 0 ) )
proof end;

Lemma6: for b1, b2, b3 being real number st b1 >= 0 & b2 >= b3 holds
( b1 + b2 >= b3 & b2 >= b3 - b1 )
proof end;

Lemma7: for b1, b2, b3 being real number st ( ( b1 >= 0 & b2 > b3 ) or ( b1 > 0 & b2 >= b3 ) ) holds
( b1 + b2 > b3 & b2 > b3 - b1 )
proof end;

theorem Th7: :: WSIERP_1:7
for b1, b2, b3 being real number st b1 <= 0 & b2 >= b3 holds
( b2 - b1 >= b3 & b2 >= b3 + b1 ) by XREAL_1:37, XREAL_1:54;

theorem Th8: :: WSIERP_1:8
for b1, b2, b3 being real number st ( ( b1 <= 0 & b2 > b3 ) or ( b1 < 0 & b2 >= b3 ) ) holds
( b2 > b3 + b1 & b2 - b1 > b3 ) by XREAL_1:38, XREAL_1:39, XREAL_1:55, XREAL_1:56;

Lemma8: for b1, b2 being Nat holds
( b1 divides b2 iff b1 divides b2 )
proof end;

Lemma9: for b1 being Nat holds abs b1 = b1
by ABSVALUE:def 1;

registration
let c1 be Integer;
let c2 be Nat;
cluster a1 |^ a2 -> integer ;
coherence
c1 |^ c2 is integer
proof end;
end;

definition
let c1, c2 be Nat;
redefine func |^ as c1 |^ c2 -> Nat;
coherence
c1 |^ c2 is Nat
by NEWTON:99;
end;

Lemma10: for b1 being Nat ex b2 being Nat st
( b1 = 2 * b2 or b1 = (2 * b2) + 1 )
proof end;

Lemma11: for b1, b2, b3 being Nat st b1 > 0 & b2 |^ b1 = b3 |^ b1 holds
b2 = b3
by Th5;

theorem Th9: :: WSIERP_1:9
for b1, b2, b3 being Integer st b1 divides b2 & b1 divides b3 holds
b1 divides b2 + b3
proof end;

theorem Th10: :: WSIERP_1:10
for b1, b2, b3, b4, b5 being Integer st b1 divides b2 & b1 divides b3 holds
b1 divides (b2 * b4) + (b3 * b5)
proof end;

Lemma14: for b1, b2 being Nat holds b1 gcd b2 = b1 hcf b2
proof end;

Lemma15: for b1, b2 being Nat holds
( b1,b2 are_relative_prime iff b1,b2 are_relative_prime )
proof end;

theorem Th11: :: WSIERP_1:11
for b1, b2, b3 being Integer st b1 gcd b2 = 1 & b3 gcd b2 = 1 holds
(b1 * b3) gcd b2 = 1
proof end;

theorem Th12: :: WSIERP_1:12
for b1, b2, b3 being Nat st b1 hcf b2 = 1 & b3 hcf b2 = 1 holds
(b1 * b3) hcf b2 = 1
proof end;

theorem Th13: :: WSIERP_1:13
for b1 being Integer holds
( 0 gcd b1 = abs b1 & 1 gcd b1 = 1 )
proof end;

theorem Th14: :: WSIERP_1:14
for b1 being Integer holds 1,b1 are_relative_prime
proof end;

theorem Th15: :: WSIERP_1:15
for b1 being Nat
for b2, b3 being Integer st b2,b3 are_relative_prime holds
b2 |^ b1,b3 are_relative_prime
proof end;

theorem Th16: :: WSIERP_1:16
for b1, b2 being Nat
for b3, b4 being Integer st b3,b4 are_relative_prime holds
b3 |^ b1,b4 |^ b2 are_relative_prime
proof end;

theorem Th17: :: WSIERP_1:17
for b1, b2 being Nat
for b3, b4 being Integer st b3 gcd b4 = 1 holds
( b3 gcd (b4 |^ b1) = 1 & (b3 |^ b2) gcd (b4 |^ b1) = 1 )
proof end;

Lemma23: for b1, b2, b3, b4 being Nat st b1 hcf b2 = 1 holds
( b1 hcf (b2 |^ b3) = 1 & (b1 |^ b4) hcf (b2 |^ b3) = 1 )
proof end;

theorem Th18: :: WSIERP_1:18
for b1, b2 being Integer holds
( abs b1 divides b2 iff b1 divides b2 )
proof end;

theorem Th19: :: WSIERP_1:19
for b1, b2, b3 being Nat st b1 divides b2 holds
b1 |^ b3 divides b2 |^ b3
proof end;

theorem Th20: :: WSIERP_1:20
for b1 being Nat st b1 divides 1 holds
b1 = 1
proof end;

theorem Th21: :: WSIERP_1:21
for b1, b2, b3 being Nat st b1 divides b2 & b2 hcf b3 = 1 holds
b1 hcf b3 = 1
proof end;

Lemma27: for b1, b2 being Nat st b1 <> 0 holds
( b1 divides b2 iff b2 / b1 is Nat )
proof end;

theorem Th22: :: WSIERP_1:22
for b1, b2 being Integer st b1 <> 0 holds
( b1 divides b2 iff b2 / b1 is Integer )
proof end;

Lemma28: for b1, b2 being Nat
for b3 being Integer st b1 <> 0 & b2 * b3 = b1 holds
b3 is Nat
proof end;

Lemma29: for b1 being Nat
for b2 being Integer st b1 <= b2 holds
b2 is Nat
by INT_1:16;

Lemma30: for b1, b2, b3 being Nat st b1 + b2 <= b3 holds
( b1 <= b3 & b2 <= b3 )
proof end;

theorem Th23: :: WSIERP_1:23
for b1, b2, b3 being Nat st b1 <= b2 - b3 holds
( b1 <= b2 & b3 <= b2 )
proof end;

Lemma31: for b1, b2 being Integer holds
( b1 < b2 iff b1 <= b2 - 1 )
proof end;

Lemma32: for b1, b2 being Integer holds
( b1 < b2 + 1 iff b1 <= b2 )
proof end;

Lemma33: for b1 being real number
for b2 being Function holds
( ( b1 in dom b2 & b2 . b1 in rng b2 ) or b2 . b1 = {} )
proof end;

Lemma34: for b1 being Nat
for b2 being set st 0 in b2 holds
for b3 being FinSequence of b2 holds b3 . b1 is Element of b2
proof end;

registration
let c1 be FinSequence of INT ;
let c2 be set ;
cluster a1 . a2 -> integer ;
coherence
c1 . c2 is integer
proof end;
end;

definition
let c1 be FinSequence of NAT ;
let c2 be Nat;
redefine func . as c1 . c2 -> Nat;
coherence
c1 . c2 is Nat
by Lemma34;
end;

definition
let c1 be non empty set ;
let c2 be non empty Subset of c1;
let c3, c4 be FinSequence of c2;
redefine func ^ as c3 ^ c4 -> FinSequence of a2;
coherence
c3 ^ c4 is FinSequence of c2
proof end;
end;

definition
let c1 be non empty set ;
let c2 be non empty Subset of c1;
redefine func <*> as <*> c2 -> empty FinSequence of a2;
coherence
<*> c2 is empty FinSequence of c2
;
end;

definition
redefine func INT as INT -> non empty Subset of REAL ;
coherence
INT is non empty Subset of REAL
by NUMBERS:15;
end;

definition
let c1 be FinSequence of INT ;
redefine func Sum as Sum c1 -> Element of INT ;
coherence
Sum c1 is Element of INT
proof end;
redefine func Product as Product c1 -> Element of INT ;
coherence
Product c1 is Element of INT
proof end;
end;

definition
let c1 be FinSequence of NAT ;
redefine func Sum as Sum c1 -> Nat;
coherence
Sum c1 is Nat
proof end;
redefine func Product as Product c1 -> Nat;
coherence
Product c1 is Nat
proof end;
end;

Lemma35: for b1 being Nat
for b2 being FinSequence st b1 in dom b2 holds
ex b3, b4 being FinSequence st
( b2 = (b3 ^ <*(b2 . b1)*>) ^ b4 & len b3 = b1 - 1 & len b4 = (len b2) - b1 )
proof end;

definition
let c1 be Nat;
let c2 be FinSequence;
redefine func Del c2,c1 -> set means :Def1: :: WSIERP_1:def 1
a3 = a2 if not a1 in dom a2
otherwise ( (len a3) + 1 = len a2 & ( for b1 being Nat holds
( ( b1 < a1 implies a3 . b1 = a2 . b1 ) & ( b1 >= a1 implies a3 . b1 = a2 . (b1 + 1) ) ) ) );
compatibility
for b1 being set holds
( ( not c1 in dom c2 implies ( b1 = Del c2,c1 iff b1 = c2 ) ) & ( c1 in dom c2 implies ( b1 = Del c2,c1 iff ( (len b1) + 1 = len c2 & ( for b2 being Nat holds
( ( b2 < c1 implies b1 . b2 = c2 . b2 ) & ( b2 >= c1 implies b1 . b2 = c2 . (b2 + 1) ) ) ) ) ) ) )
proof end;
correctness
consistency
for b1 being set holds verum
;
;
end;

:: deftheorem Def1 defines Del WSIERP_1:def 1 :
for b1 being Nat
for b2 being FinSequence
for b3 being set holds
( ( not b1 in dom b2 implies ( b3 = Del b2,b1 iff b3 = b2 ) ) & ( b1 in dom b2 implies ( b3 = Del b2,b1 iff ( (len b3) + 1 = len b2 & ( for b4 being Nat holds
( ( b4 < b1 implies b3 . b4 = b2 . b4 ) & ( b4 >= b1 implies b3 . b4 = b2 . (b4 + 1) ) ) ) ) ) ) );

Lemma37: for b1 being Nat
for b2, b3, b4 being FinSequence
for b5 being set st b1 in dom b2 & b2 = (b3 ^ <*b5*>) ^ b4 & len b3 = b1 - 1 holds
Del b2,b1 = b3 ^ b4
proof end;

Lemma38: for b1 being Nat
for b2 being FinSequence holds dom (Del b2,b1) c= dom b2
proof end;

definition
let c1 be non empty set ;
let c2 be Nat;
let c3 be FinSequence of c1;
redefine func Del as Del c3,c2 -> FinSequence of a1;
coherence
Del c3,c2 is FinSequence of c1
proof end;
end;

definition
let c1 be non empty set ;
let c2 be non empty Subset of c1;
let c3 be Nat;
let c4 be FinSequence of c2;
redefine func Del as Del c4,c3 -> FinSequence of a2;
coherence
Del c4,c3 is FinSequence of c2
proof end;
end;

Lemma39: for b1 being Nat
for b2, b3 being FinSequence holds
( ( b1 <= len b2 implies Del (b2 ^ b3),b1 = (Del b2,b1) ^ b3 ) & ( b1 >= 1 implies Del (b2 ^ b3),((len b2) + b1) = b2 ^ (Del b3,b1) ) )
proof end;

Lemma40: for b1 being FinSequence
for b2 being set holds
( Del (<*b2*> ^ b1),1 = b1 & Del (b1 ^ <*b2*>),((len b1) + 1) = b1 )
proof end;

theorem Th24: :: WSIERP_1:24
canceled;

theorem Th25: :: WSIERP_1:25
canceled;

theorem Th26: :: WSIERP_1:26
for b1, b2, b3 being set holds
( Del <*b1*>,1 = {} & Del <*b1,b2*>,1 = <*b2*> & Del <*b1,b2*>,2 = <*b1*> & Del <*b1,b2,b3*>,1 = <*b2,b3*> & Del <*b1,b2,b3*>,2 = <*b1,b3*> & Del <*b1,b2,b3*>,3 = <*b1,b2*> )
proof end;

Lemma41: for b1 being FinSequence st 1 <= len b1 holds
( b1 = <*(b1 . 1)*> ^ (Del b1,1) & b1 = (Del b1,(len b1)) ^ <*(b1 . (len b1))*> )
proof end;

Lemma42: for b1 being Nat
for b2 being FinSequence of REAL st b1 in dom b2 holds
(Product (Del b2,b1)) * (b2 . b1) = Product b2
proof end;

theorem Th27: :: WSIERP_1:27
for b1 being Nat
for b2 being FinSequence of REAL st b1 in dom b2 holds
(Sum (Del b2,b1)) + (b2 . b1) = Sum b2
proof end;

theorem Th28: :: WSIERP_1:28
for b1 being Nat
for b2 being FinSequence of NAT st b1 in dom b2 holds
(Product b2) / (b2 . b1) is Nat
proof end;

theorem Th29: :: WSIERP_1:29
for b1 being Rational holds numerator b1, denominator b1 are_relative_prime
proof end;

theorem Th30: :: WSIERP_1:30
for b1 being Nat
for b2 being Integer
for b3 being Rational st b3 <> 0 & b3 = b2 / b1 & b1 <> 0 & b2,b1 are_relative_prime holds
( b2 = numerator b3 & b1 = denominator b3 )
proof end;

theorem Th31: :: WSIERP_1:31
for b1, b2 being Nat st ex b3 being Rational st b1 = b3 |^ b2 holds
ex b3 being Integer st b1 = b3 |^ b2
proof end;

theorem Th32: :: WSIERP_1:32
for b1, b2 being Nat st ex b3 being Rational st b1 = b3 |^ b2 holds
ex b3 being Nat st b1 = b3 |^ b2
proof end;

theorem Th33: :: WSIERP_1:33
for b1, b2, b3 being Nat st b1 > 0 & b2 |^ b1 divides b3 |^ b1 holds
b2 divides b3
proof end;

theorem Th34: :: WSIERP_1:34
for b1, b2 being Nat ex b3, b4 being Integer st b1 hcf b2 = (b1 * b3) + (b2 * b4)
proof end;

theorem Th35: :: WSIERP_1:35
for b1, b2 being Integer ex b3, b4 being Integer st b1 gcd b2 = (b1 * b3) + (b2 * b4)
proof end;

theorem Th36: :: WSIERP_1:36
for b1, b2, b3 being Integer st b1 divides b2 * b3 & b1 gcd b2 = 1 holds
b1 divides b3
proof end;

theorem Th37: :: WSIERP_1:37
for b1, b2, b3 being Nat st b1 hcf b2 = 1 & b1 divides b2 * b3 holds
b1 divides b3
proof end;

theorem Th38: :: WSIERP_1:38
for b1, b2 being Nat st b1 <> 0 & b2 <> 0 holds
ex b3, b4 being Nat st b1 hcf b2 = (b1 * b3) - (b2 * b4)
proof end;

theorem Th39: :: WSIERP_1:39
for b1, b2, b3, b4 being Nat st b1 > 0 & b2 > 0 & b1 hcf b2 = 1 & b3 |^ b1 = b4 |^ b2 holds
ex b5 being Nat st
( b3 = b5 |^ b2 & b4 = b5 |^ b1 )
proof end;

theorem Th40: :: WSIERP_1:40
for b1, b2, b3 being Integer holds
( ex b4, b5 being Integer st (b1 * b4) + (b2 * b5) = b3 iff b1 gcd b2 divides b3 )
proof end;

theorem Th41: :: WSIERP_1:41
for b1, b2, b3, b4, b5 being Integer st b1 <> 0 & b2 <> 0 & (b1 * b3) + (b2 * b4) = b5 holds
for b6, b7 being Integer st (b1 * b6) + (b2 * b7) = b5 holds
ex b8 being Integer st
( b6 = b3 + (b8 * (b2 / (b1 gcd b2))) & b7 = b4 - (b8 * (b1 / (b1 gcd b2))) )
proof end;

theorem Th42: :: WSIERP_1:42
for b1, b2, b3, b4 being Nat st b1 hcf b2 = 1 & b1 * b2 = b3 |^ b4 holds
ex b5, b6 being Nat st
( b1 = b5 |^ b4 & b2 = b6 |^ b4 )
proof end;

theorem Th43: :: WSIERP_1:43
for b1 being FinSequence of NAT
for b2 being Nat st ( for b3 being Nat st b3 in dom b1 holds
(b1 . b3) hcf b2 = 1 ) holds
(Product b1) hcf b2 = 1
proof end;

theorem Th44: :: WSIERP_1:44
for b1 being FinSequence of NAT st len b1 >= 2 & ( for b2, b3 being Nat st b2 in dom b1 & b3 in dom b1 & b2 <> b3 holds
(b1 . b2) hcf (b1 . b3) = 1 ) holds
for b2 being FinSequence of INT st len b2 = len b1 holds
ex b3 being FinSequence of INT st
( len b3 = len b1 & ( for b4 being Nat st b4 in dom b1 holds
((b1 . b4) * (b3 . b4)) + (b2 . b4) = ((b1 . 1) * (b3 . 1)) + (b2 . 1) ) )
proof end;

Lemma53: for b1, b2 being Nat st b1 divides b2 & b2 < b1 holds
b2 = 0
proof end;

Lemma54: for b1, b2 being Integer holds
( b1 divides b2 iff b1 divides abs b2 )
proof end;

Lemma55: for b1 being Nat
for b2 being Integer holds
( b1 divides b2 iff b1 divides abs b2 )
proof end;

Lemma56: for b1, b2 being Integer holds (b1 * b2) mod b2 = 0
proof end;

Lemma57: for b1, b2, b3 being Integer st b1 mod b2 = b3 mod b2 holds
(b1 - b3) mod b2 = 0
proof end;

Lemma58: for b1, b2 being Integer st b1 <> 0 & b2 mod b1 = 0 holds
b1 divides b2
proof end;

Lemma59: for b1 being Integer holds
( ( 1 < b1 implies ( 1 < sqrt b1 & sqrt b1 < b1 ) ) & ( 0 < b1 & b1 < 1 implies ( 0 < sqrt b1 & sqrt b1 < 1 & b1 < sqrt b1 ) ) )
proof end;

theorem Th45: :: WSIERP_1:45
canceled;

theorem Th46: :: WSIERP_1:46
for b1 being Nat
for b2 being Integer st b1 <> 0 & b1 gcd b2 = 1 holds
ex b3, b4 being Nat st
( 0 <> b3 & 0 <> b4 & b3 <= sqrt b1 & b4 <= sqrt b1 & ( b1 divides (b2 * b3) + b4 or b1 divides (b2 * b3) - b4 ) )
proof end;

theorem Th47: :: WSIERP_1:47
for b1 being Nat
for b2 being FinSequence holds dom (Del b2,b1) c= dom b2 by Lemma38;

theorem Th48: :: WSIERP_1:48
for b1 being FinSequence
for b2 being set holds
( Del (<*b2*> ^ b1),1 = b1 & Del (b1 ^ <*b2*>),((len b1) + 1) = b1 ) by Lemma40;