:: UNIROOTS semantic presentation

theorem Th1: :: UNIROOTS:1
for b1 being Nat holds
( b1 = 0 or b1 = 1 or b1 >= 2 )
proof end;

Lemma2: for b1 being Nat holds
( not b1 is empty iff 1 <= b1 )
proof end;

scheme :: UNIROOTS:sch 1
s1{ P1[ non empty Nat] } :
for b1 being non empty Nat holds P1[b1]
provided
E3: for b1 being non empty Nat st ( for b2 being non empty Nat st b2 < b1 holds
P1[b2] ) holds
P1[b1]
proof end;

theorem Th2: :: UNIROOTS:2
for b1 being FinSequence st 1 <= len b1 holds
b1 | (Seg 1) = <*(b1 . 1)*>
proof end;

Lemma4: for b1 being FinSequence
for b2, b3 being Nat st b3 <= b2 holds
(b1 | (Seg b2)) | (Seg b3) = b1 | (Seg b3)
proof end;

theorem Th3: :: UNIROOTS:3
for b1 being FinSequence of F_Complex
for b2 being FinSequence of REAL st len b1 = len b2 & ( for b3 being Nat st b3 in dom b1 holds
|.(b1 /. b3).| = b2 . b3 ) holds
|.(Product b1).| = Product b2
proof end;

theorem Th4: :: UNIROOTS:4
for b1 being non empty finite Subset of F_Complex
for b2 being Element of F_Complex
for b3 being FinSequence of REAL st len b3 = card b1 & ( for b4 being Nat
for b5 being Element of F_Complex st b4 in dom b3 & b5 = (canFS b1) . b4 holds
b3 . b4 = |.(b2 - b5).| ) holds
|.(eval (poly_with_roots (b1,1 -bag )),b2).| = Product b3
proof end;

theorem Th5: :: UNIROOTS:5
for b1 being FinSequence of F_Complex st ( for b2 being Nat st b2 in dom b1 holds
b1 . b2 is integer ) holds
Sum b1 is integer
proof end;

theorem Th6: :: UNIROOTS:6
canceled;

theorem Th7: :: UNIROOTS:7
for b1, b2 being Element of F_Complex
for b3, b4 being Real st b3 = b1 & b4 = b2 holds
( b3 * b4 = b1 * b2 & b3 + b4 = b1 + b2 ) by COMPLFLD:3, COMPLFLD:6;

theorem Th8: :: UNIROOTS:8
for b1 being Real st b1 is Integer & b1 > 0 holds
for b2 being Element of F_Complex st |.b2.| = 1 & b2 <> [**1,0**] holds
|.([**b1,0**] - b2).| > b1 - 1
proof end;

theorem Th9: :: UNIROOTS:9
for b1 being non empty FinSequence of REAL
for b2 being Real st b2 >= 1 & ( for b3 being Nat st b3 in dom b1 holds
b1 . b3 > b2 ) holds
Product b1 > b2
proof end;

theorem Th10: :: UNIROOTS:10
for b1 being Nat holds 1. F_Complex = (power F_Complex ) . (1. F_Complex ),b1
proof end;

theorem Th11: :: UNIROOTS:11
for b1, b2 being Nat holds
( cos (((2 * PI ) * b2) / b1) = cos (((2 * PI ) * (b2 mod b1)) / b1) & sin (((2 * PI ) * b2) / b1) = sin (((2 * PI ) * (b2 mod b1)) / b1) )
proof end;

theorem Th12: :: UNIROOTS:12
for b1, b2 being Nat holds [**(cos (((2 * PI ) * b2) / b1)),(sin (((2 * PI ) * b2) / b1))**] = [**(cos (((2 * PI ) * (b2 mod b1)) / b1)),(sin (((2 * PI ) * (b2 mod b1)) / b1))**]
proof end;

theorem Th13: :: UNIROOTS:13
for b1, b2, b3 being Nat holds [**(cos (((2 * PI ) * b2) / b1)),(sin (((2 * PI ) * b2) / b1))**] * [**(cos (((2 * PI ) * b3) / b1)),(sin (((2 * PI ) * b3) / b1))**] = [**(cos (((2 * PI ) * ((b2 + b3) mod b1)) / b1)),(sin (((2 * PI ) * ((b2 + b3) mod b1)) / b1))**]
proof end;

theorem Th14: :: UNIROOTS:14
for b1 being non empty unital associative HGrStr
for b2 being Element of b1
for b3, b4 being Nat holds (power b1) . b2,(b3 * b4) = (power b1) . ((power b1) . b2,b3),b4
proof end;

theorem Th15: :: UNIROOTS:15
for b1 being Nat
for b2 being Element of F_Complex st b2 is Integer holds
(power F_Complex ) . b2,b1 is Integer
proof end;

theorem Th16: :: UNIROOTS:16
for b1 being FinSequence of F_Complex st ( for b2 being Nat st b2 in dom b1 holds
b1 . b2 is Integer ) holds
Sum b1 is Integer
proof end;

theorem Th17: :: UNIROOTS:17
for b1 being real number st 0 <= b1 & b1 < 2 * PI & cos b1 = 1 holds
b1 = 0
proof end;

Lemma19: Z3 is finite
by GROUP_1:def 14, MOD_2:def 23;

registration
cluster finite doubleLoopStr ;
existence
ex b1 being Field st b1 is finite
by Lemma19, MOD_2:37;
cluster finite doubleLoopStr ;
existence
ex b1 being Skew-Field st b1 is finite
by Lemma19, MOD_2:37;
end;

definition
let c1 be Skew-Field;
func MultGroup c1 -> strict Group means :Def1: :: UNIROOTS:def 1
( the carrier of a2 = the carrier of a1 \ {(0. a1)} & the mult of a2 = the mult of a1 || the carrier of a2 );
existence
ex b1 being strict Group st
( the carrier of b1 = the carrier of c1 \ {(0. c1)} & the mult of b1 = the mult of c1 || the carrier of b1 )
proof end;
uniqueness
for b1, b2 being strict Group st the carrier of b1 = the carrier of c1 \ {(0. c1)} & the mult of b1 = the mult of c1 || the carrier of b1 & the carrier of b2 = the carrier of c1 \ {(0. c1)} & the mult of b2 = the mult of c1 || the carrier of b2 holds
b1 = b2
;
end;

:: deftheorem Def1 defines MultGroup UNIROOTS:def 1 :
for b1 being Skew-Field
for b2 being strict Group holds
( b2 = MultGroup b1 iff ( the carrier of b2 = the carrier of b1 \ {(0. b1)} & the mult of b2 = the mult of b1 || the carrier of b2 ) );

theorem Th18: :: UNIROOTS:18
for b1 being Skew-Field holds the carrier of b1 = the carrier of (MultGroup b1) \/ {(0. b1)}
proof end;

theorem Th19: :: UNIROOTS:19
for b1 being Skew-Field
for b2, b3 being Element of b1
for b4, b5 being Element of (MultGroup b1) st b2 = b4 & b3 = b5 holds
b4 * b5 = b2 * b3
proof end;

theorem Th20: :: UNIROOTS:20
for b1 being Skew-Field holds 1. b1 = 1. (MultGroup b1)
proof end;

registration
let c1 be finite Skew-Field;
cluster MultGroup a1 -> strict finite ;
correctness
coherence
MultGroup c1 is finite
;
proof end;
end;

theorem Th21: :: UNIROOTS:21
for b1 being finite Skew-Field holds ord (MultGroup b1) = (card the carrier of b1) - 1
proof end;

theorem Th22: :: UNIROOTS:22
for b1 being Skew-Field
for b2 being set st b2 in the carrier of (MultGroup b1) holds
b2 in the carrier of b1
proof end;

theorem Th23: :: UNIROOTS:23
for b1 being Skew-Field holds the carrier of (MultGroup b1) c= the carrier of b1
proof end;

definition
let c1 be non empty Nat;
func c1 -roots_of_1 -> Subset of F_Complex equals :: UNIROOTS:def 2
{ b1 where B is Element of F_Complex : b1 is CRoot of a1, 1. F_Complex } ;
coherence
{ b1 where B is Element of F_Complex : b1 is CRoot of c1, 1. F_Complex } is Subset of F_Complex
proof end;
end;

:: deftheorem Def2 defines -roots_of_1 UNIROOTS:def 2 :
for b1 being non empty Nat holds b1 -roots_of_1 = { b2 where B is Element of F_Complex : b2 is CRoot of b1, 1. F_Complex } ;

theorem Th24: :: UNIROOTS:24
for b1 being non empty Nat
for b2 being Element of F_Complex holds
( b2 in b1 -roots_of_1 iff b2 is CRoot of b1, 1. F_Complex )
proof end;

theorem Th25: :: UNIROOTS:25
for b1 being non empty Nat holds 1. F_Complex in b1 -roots_of_1
proof end;

theorem Th26: :: UNIROOTS:26
for b1 being non empty Nat
for b2 being Element of F_Complex st b2 in b1 -roots_of_1 holds
|.b2.| = 1
proof end;

theorem Th27: :: UNIROOTS:27
for b1 being non empty Nat
for b2 being Element of F_Complex holds
( b2 in b1 -roots_of_1 iff ex b3 being Nat st b2 = [**(cos (((2 * PI ) * b3) / b1)),(sin (((2 * PI ) * b3) / b1))**] )
proof end;

theorem Th28: :: UNIROOTS:28
for b1 being non empty Nat
for b2, b3 being Element of COMPLEX st b2 in b1 -roots_of_1 & b3 in b1 -roots_of_1 holds
b2 * b3 in b1 -roots_of_1
proof end;

theorem Th29: :: UNIROOTS:29
for b1 being non empty Nat holds b1 -roots_of_1 = { [**(cos (((2 * PI ) * b2) / b1)),(sin (((2 * PI ) * b2) / b1))**] where B is Nat : b2 < b1 }
proof end;

theorem Th30: :: UNIROOTS:30
for b1 being non empty Nat holds Card (b1 -roots_of_1 ) = b1
proof end;

registration
let c1 be non empty Nat;
cluster a1 -roots_of_1 -> non empty ;
correctness
coherence
not c1 -roots_of_1 is empty
;
by Th25;
cluster a1 -roots_of_1 -> finite ;
correctness
coherence
c1 -roots_of_1 is finite
;
proof end;
end;

theorem Th31: :: UNIROOTS:31
for b1, b2 being non empty Nat st b2 divides b1 holds
b2 -roots_of_1 c= b1 -roots_of_1
proof end;

theorem Th32: :: UNIROOTS:32
for b1 being Skew-Field
for b2 being Element of (MultGroup b1)
for b3 being Element of b1 st b3 = b2 holds
for b4 being Nat holds (power (MultGroup b1)) . b2,b4 = (power b1) . b3,b4
proof end;

theorem Th33: :: UNIROOTS:33
for b1 being non empty Nat
for b2 being Element of (MultGroup F_Complex ) st b2 in b1 -roots_of_1 holds
b2 is_not_of_order_0
proof end;

theorem Th34: :: UNIROOTS:34
for b1 being non empty Nat
for b2 being Nat
for b3 being Element of (MultGroup F_Complex ) st b3 = [**(cos (((2 * PI ) * b2) / b1)),(sin (((2 * PI ) * b2) / b1))**] holds
ord b3 = b1 div (b2 gcd b1)
proof end;

theorem Th35: :: UNIROOTS:35
for b1 being non empty Nat holds b1 -roots_of_1 c= the carrier of (MultGroup F_Complex )
proof end;

theorem Th36: :: UNIROOTS:36
for b1 being non empty Nat ex b2 being Element of (MultGroup F_Complex ) st ord b2 = b1
proof end;

theorem Th37: :: UNIROOTS:37
for b1 being non empty Nat
for b2 being Element of (MultGroup F_Complex ) holds
( ord b2 divides b1 iff b2 in b1 -roots_of_1 )
proof end;

theorem Th38: :: UNIROOTS:38
for b1 being non empty Nat holds b1 -roots_of_1 = { b2 where B is Element of (MultGroup F_Complex ) : ord b2 divides b1 }
proof end;

theorem Th39: :: UNIROOTS:39
for b1 being non empty Nat
for b2 being set holds
( b2 in b1 -roots_of_1 iff ex b3 being Element of (MultGroup F_Complex ) st
( b2 = b3 & ord b3 divides b1 ) )
proof end;

definition
let c1 be non empty Nat;
func c1 -th_roots_of_1 -> strict Group means :Def3: :: UNIROOTS:def 3
( the carrier of a2 = a1 -roots_of_1 & the mult of a2 = the mult of F_Complex || (a1 -roots_of_1 ) );
existence
ex b1 being strict Group st
( the carrier of b1 = c1 -roots_of_1 & the mult of b1 = the mult of F_Complex || (c1 -roots_of_1 ) )
proof end;
uniqueness
for b1, b2 being strict Group st the carrier of b1 = c1 -roots_of_1 & the mult of b1 = the mult of F_Complex || (c1 -roots_of_1 ) & the carrier of b2 = c1 -roots_of_1 & the mult of b2 = the mult of F_Complex || (c1 -roots_of_1 ) holds
b1 = b2
;
end;

:: deftheorem Def3 defines -th_roots_of_1 UNIROOTS:def 3 :
for b1 being non empty Nat
for b2 being strict Group holds
( b2 = b1 -th_roots_of_1 iff ( the carrier of b2 = b1 -roots_of_1 & the mult of b2 = the mult of F_Complex || (b1 -roots_of_1 ) ) );

theorem Th40: :: UNIROOTS:40
for b1 being non empty Nat holds b1 -th_roots_of_1 is Subgroup of MultGroup F_Complex
proof end;

definition
let c1 be non empty Nat;
let c2 be non empty left_unital doubleLoopStr ;
func unital_poly c2,c1 -> Polynomial of a2 equals :: UNIROOTS:def 4
((0_. a2) +* 0,(- (1. a2))) +* a1,(1. a2);
coherence
((0_. c2) +* 0,(- (1. c2))) +* c1,(1. c2) is Polynomial of c2
proof end;
end;

:: deftheorem Def4 defines unital_poly UNIROOTS:def 4 :
for b1 being non empty Nat
for b2 being non empty left_unital doubleLoopStr holds unital_poly b2,b1 = ((0_. b2) +* 0,(- (1. b2))) +* b1,(1. b2);

theorem Th41: :: UNIROOTS:41
unital_poly F_Complex ,1 = <%(- (1. F_Complex )),(1. F_Complex )%> by POLYNOM5:def 4;

theorem Th42: :: UNIROOTS:42
for b1 being non empty left_unital doubleLoopStr
for b2 being non empty Nat holds
( (unital_poly b1,b2) . 0 = - (1. b1) & (unital_poly b1,b2) . b2 = 1. b1 )
proof end;

theorem Th43: :: UNIROOTS:43
for b1 being non empty left_unital doubleLoopStr
for b2 being non empty Nat
for b3 being Nat st b3 <> 0 & b3 <> b2 holds
(unital_poly b1,b2) . b3 = 0. b1
proof end;

theorem Th44: :: UNIROOTS:44
for b1 being non empty left_unital non degenerated doubleLoopStr
for b2 being non empty Nat holds len (unital_poly b1,b2) = b2 + 1
proof end;

registration
let c1 be non empty left_unital non degenerated doubleLoopStr ;
let c2 be non empty Nat;
cluster unital_poly a1,a2 -> non-zero ;
correctness
coherence
unital_poly c1,c2 is non-zero
;
proof end;
end;

theorem Th45: :: UNIROOTS:45
for b1 being non empty Nat
for b2 being Element of F_Complex holds eval (unital_poly F_Complex ,b1),b2 = ((power F_Complex ) . b2,b1) - 1
proof end;

theorem Th46: :: UNIROOTS:46
for b1 being non empty Nat holds Roots (unital_poly F_Complex ,b1) = b1 -roots_of_1
proof end;

theorem Th47: :: UNIROOTS:47
for b1 being Nat
for b2 being Element of F_Complex st b2 is Real holds
ex b3 being Real st
( b3 = b2 & (power F_Complex ) . b2,b1 = b3 |^ b1 )
proof end;

theorem Th48: :: UNIROOTS:48
for b1 being non empty Nat
for b2 being Real ex b3 being Element of F_Complex st
( b3 = b2 & eval (unital_poly F_Complex ,b1),b3 = (b2 |^ b1) - 1 )
proof end;

theorem Th49: :: UNIROOTS:49
for b1 being non empty Nat holds BRoots (unital_poly F_Complex ,b1) = (b1 -roots_of_1 ),1 -bag
proof end;

theorem Th50: :: UNIROOTS:50
for b1 being non empty Nat holds unital_poly F_Complex ,b1 = poly_with_roots ((b1 -roots_of_1 ),1 -bag )
proof end;

definition
let c1 be Integer;
let c2 be Nat;
redefine func |^ as c1 |^ c2 -> Integer;
coherence
c1 |^ c2 is Integer
;
end;

theorem Th51: :: UNIROOTS:51
for b1 being non empty Nat
for b2 being Element of F_Complex st b2 is Integer holds
eval (unital_poly F_Complex ,b1),b2 is Integer
proof end;

definition
let c1 be non empty Nat;
func cyclotomic_poly c1 -> Polynomial of F_Complex means :Def5: :: UNIROOTS:def 5
ex b1 being non empty finite Subset of F_Complex st
( b1 = { b2 where B is Element of (MultGroup F_Complex ) : ord b2 = a1 } & a2 = poly_with_roots (b1,1 -bag ) );
existence
ex b1 being Polynomial of F_Complex ex b2 being non empty finite Subset of F_Complex st
( b2 = { b3 where B is Element of (MultGroup F_Complex ) : ord b3 = c1 } & b1 = poly_with_roots (b2,1 -bag ) )
proof end;
uniqueness
for b1, b2 being Polynomial of F_Complex st ex b3 being non empty finite Subset of F_Complex st
( b3 = { b4 where B is Element of (MultGroup F_Complex ) : ord b4 = c1 } & b1 = poly_with_roots (b3,1 -bag ) ) & ex b3 being non empty finite Subset of F_Complex st
( b3 = { b4 where B is Element of (MultGroup F_Complex ) : ord b4 = c1 } & b2 = poly_with_roots (b3,1 -bag ) ) holds
b1 = b2
;
end;

:: deftheorem Def5 defines cyclotomic_poly UNIROOTS:def 5 :
for b1 being non empty Nat
for b2 being Polynomial of F_Complex holds
( b2 = cyclotomic_poly b1 iff ex b3 being non empty finite Subset of F_Complex st
( b3 = { b4 where B is Element of (MultGroup F_Complex ) : ord b4 = b1 } & b2 = poly_with_roots (b3,1 -bag ) ) );

theorem Th52: :: UNIROOTS:52
cyclotomic_poly 1 = <%(- (1. F_Complex )),(1. F_Complex )%>
proof end;

theorem Th53: :: UNIROOTS:53
for b1 being non empty Nat
for b2 being FinSequence of the carrier of (Polynom-Ring F_Complex ) st len b2 = b1 & ( for b3 being non empty Nat st b3 in dom b2 holds
( ( not b3 divides b1 implies b2 . b3 = <%(1. F_Complex )%> ) & ( b3 divides b1 implies b2 . b3 = cyclotomic_poly b3 ) ) ) holds
unital_poly F_Complex ,b1 = Product b2
proof end;

theorem Th54: :: UNIROOTS:54
for b1 being non empty Nat ex b2 being FinSequence of the carrier of (Polynom-Ring F_Complex )ex b3 being Polynomial of F_Complex st
( b3 = Product b2 & dom b2 = Seg b1 & ( for b4 being non empty Nat st b4 in Seg b1 holds
( ( ( not b4 divides b1 or b4 = b1 ) implies b2 . b4 = <%(1. F_Complex )%> ) & ( b4 divides b1 & b4 <> b1 implies b2 . b4 = cyclotomic_poly b4 ) ) ) & unital_poly F_Complex ,b1 = (cyclotomic_poly b1) *' b3 )
proof end;

theorem Th55: :: UNIROOTS:55
for b1 being non empty Nat
for b2 being Nat holds
( ( (cyclotomic_poly b1) . 0 = 1 or (cyclotomic_poly b1) . 0 = - 1 ) & (cyclotomic_poly b1) . b2 is integer )
proof end;

theorem Th56: :: UNIROOTS:56
for b1 being non empty Nat
for b2 being Element of F_Complex st b2 is Integer holds
eval (cyclotomic_poly b1),b2 is Integer
proof end;

theorem Th57: :: UNIROOTS:57
for b1, b2 being non empty Nat
for b3 being FinSequence of the carrier of (Polynom-Ring F_Complex )
for b4 being finite Subset of F_Complex st b4 = { b5 where B is Element of (MultGroup F_Complex ) : ( ord b5 divides b1 & not ord b5 divides b2 & ord b5 <> b1 ) } & dom b3 = Seg b1 & ( for b5 being non empty Nat st b5 in dom b3 holds
( ( ( not b5 divides b1 or b5 divides b2 or b5 = b1 ) implies b3 . b5 = <%(1. F_Complex )%> ) & ( b5 divides b1 & not b5 divides b2 & b5 <> b1 implies b3 . b5 = cyclotomic_poly b5 ) ) ) holds
Product b3 = poly_with_roots (b4,1 -bag )
proof end;

theorem Th58: :: UNIROOTS:58
for b1, b2 being non empty Nat st b2 < b1 & b2 divides b1 holds
ex b3 being FinSequence of the carrier of (Polynom-Ring F_Complex )ex b4 being Polynomial of F_Complex st
( b4 = Product b3 & dom b3 = Seg b1 & ( for b5 being non empty Nat st b5 in Seg b1 holds
( ( ( not b5 divides b1 or b5 divides b2 or b5 = b1 ) implies b3 . b5 = <%(1. F_Complex )%> ) & ( b5 divides b1 & not b5 divides b2 & b5 <> b1 implies b3 . b5 = cyclotomic_poly b5 ) ) ) & unital_poly F_Complex ,b1 = ((unital_poly F_Complex ,b2) *' (cyclotomic_poly b1)) *' b4 )
proof end;

theorem Th59: :: UNIROOTS:59
for b1 being Integer
for b2 being Element of F_Complex
for b3 being FinSequence of the carrier of (Polynom-Ring F_Complex )
for b4 being Polynomial of F_Complex st b4 = Product b3 & b2 = b1 & ( for b5 being non empty Nat holds
( not b5 in dom b3 or b3 . b5 = <%(1. F_Complex )%> or b3 . b5 = cyclotomic_poly b5 ) ) holds
eval b4,b2 is integer
proof end;

theorem Th60: :: UNIROOTS:60
for b1 being non empty Nat
for b2, b3, b4 being Integer
for b5 being Element of F_Complex st b5 = b4 & b2 = eval (cyclotomic_poly b1),b5 & b3 = eval (unital_poly F_Complex ,b1),b5 holds
b2 divides b3
proof end;

theorem Th61: :: UNIROOTS:61
for b1, b2 being non empty Nat
for b3 being Integer st b2 < b1 & b2 divides b1 holds
for b4 being Element of F_Complex st b4 = b3 holds
for b5, b6, b7 being Integer st b5 = eval (cyclotomic_poly b1),b4 & b6 = eval (unital_poly F_Complex ,b1),b4 & b7 = eval (unital_poly F_Complex ,b2),b4 holds
b5 divides b6 div b7
proof end;

theorem Th62: :: UNIROOTS:62
for b1, b2 being non empty Nat
for b3 being Element of F_Complex st b3 = b2 holds
for b4 being Integer st b4 = eval (cyclotomic_poly b1),b3 holds
b4 divides (b2 |^ b1) - 1
proof end;

theorem Th63: :: UNIROOTS:63
for b1, b2, b3 being non empty Nat st b2 < b1 & b2 divides b1 holds
for b4 being Element of F_Complex st b4 = b3 holds
for b5 being Integer st b5 = eval (cyclotomic_poly b1),b4 holds
b5 divides ((b3 |^ b1) - 1) div ((b3 |^ b2) - 1)
proof end;

theorem Th64: :: UNIROOTS:64
for b1 being non empty Nat st 1 < b1 holds
for b2 being Nat st 1 < b2 holds
for b3 being Element of F_Complex st b3 = b2 holds
for b4 being Integer st b4 = eval (cyclotomic_poly b1),b3 holds
abs b4 > b2 - 1
proof end;