:: MOEBIUS1 semantic presentation

Lemma1: for b1, b2, b3, b4 being set holds
not ( b1 misses b2 & b4 in b1 /\ b3 & b4 in b2 /\ b3 )
proof end;

scheme :: MOEBIUS1:sch 1
s1{ F1() -> Element of NAT , F2() -> set , F3( set ) -> set } :
ex b1 being Function of NAT ,F2() st
( b1 . 0 = F1() & ( for b2 being non zero Nat holds b1 . b2 = F3(b2) ) )
provided
E2: F1() in F2() and E3: for b1 being non zero Nat holds F3(b1) in F2()
proof end;

registration
cluster non zero non prime Element of NAT ;
existence
ex b1 being Nat st
( not b1 is prime & not b1 is empty )
by INT_2:46;
end;

theorem Th1: :: MOEBIUS1:1
for b1 being non zero natural number holds
( b1 <> 1 implies b1 >= 2 )
proof end;

theorem Th2: :: MOEBIUS1:2
for b1, b2, b3 being natural number holds
( 1 <= b1 implies ( b3 in Seg b2 iff b1 * b3 in Seg (b1 * b2) ) )
proof end;

theorem Th3: :: MOEBIUS1:3
for b1, b2 being Nat holds
not ( b1,b2 are_relative_prime & not b1 > 0 & not b2 > 0 )
proof end;

Lemma3: for b1 being natural number holds
not ( b1 <> 1 & ( for b2 being Prime holds
not b2 divides b1 ) )
proof end;

theorem Th4: :: MOEBIUS1:4
for b1 being non prime Nat holds
not ( b1 <> 1 & ( for b2 being Prime holds
not ( b2 divides b1 & b2 <> b1 ) ) )
proof end;

theorem Th5: :: MOEBIUS1:5
for b1 being natural number holds
not ( b1 <> 1 & ( for b2 being Prime holds
not b2 divides b1 ) )
proof end;

theorem Th6: :: MOEBIUS1:6
for b1 being Prime
for b2 being non zero natural number holds
( b1 divides b2 iff b1 |-count b2 > 0 )
proof end;

theorem Th7: :: MOEBIUS1:7
support (ppf 1) = {}
proof end;

theorem Th8: :: MOEBIUS1:8
for b1 being Prime holds support (ppf b1) = {b1}
proof end;

theorem Th9: :: MOEBIUS1:9
for b1, b2 being natural number
for b3 being Prime holds
( b1 <> 0 & b2 <= b3 |-count b1 implies b3 |^ b2 divides b1 )
proof end;

registration
cluster odd -> non zero Element of NAT ;
coherence
for b1 being Nat holds
not ( not b1 is even & b1 is empty )
proof end;
end;

theorem Th10: :: MOEBIUS1:10
for b1 being Nat
for b2 being Prime holds
( b2 |^ 2 divides b1 implies b2 divides b1 )
proof end;

theorem Th11: :: MOEBIUS1:11
for b1 being prime Nat
for b2, b3 being non zero Nat holds
not ( b2,b3 are_relative_prime & b1 |^ 2 divides b2 * b3 & not b1 |^ 2 divides b2 & not b1 |^ 2 divides b3 )
proof end;

theorem Th12: :: MOEBIUS1:12
for b1 being natural number
for b2 being Rbag of NAT holds
( support b2 = {b1} implies Sum b2 = b2 . b1 )
proof end;

registration
cluster canFS {} -> empty ;
coherence
canFS {} is empty
proof end;
end;

theorem Th13: :: MOEBIUS1:13
for b1 being natural number
for b2 being Prime holds
( b2 divides b1 implies { b3 where B is Nat : ( b3 > 0 & b3 divides b1 & b2 divides b3 ) } = { (b2 * b3) where B is Nat : ( b3 > 0 & b3 divides b1 div b2 ) } )
proof end;

theorem Th14: :: MOEBIUS1:14
for b1 being non zero natural number holds
ex b2 being Nat st support (ppf b1) c= Seg b2
proof end;

theorem Th15: :: MOEBIUS1:15
for b1 being non zero Nat
for b2 being Prime holds
( not b2 in support (ppf b1) implies b2 |-count b1 = 0 )
proof end;

theorem Th16: :: MOEBIUS1:16
for b1 being Nat
for b2 being non zero Nat holds
( support (ppf b2) c= Seg (b1 + 1) & not support (ppf b2) c= Seg b1 implies b1 + 1 is Prime )
proof end;

theorem Th17: :: MOEBIUS1:17
for b1, b2 being non zero natural number holds
( ( for b3 being Prime holds b3 |-count b1 <= b3 |-count b2 ) implies support (ppf b1) c= support (ppf b2) )
proof end;

theorem Th18: :: MOEBIUS1:18
for b1 being Nat
for b2 being non zero Nat holds
not ( support (ppf b2) c= Seg (b1 + 1) & ( for b3 being non zero Nat
for b4 being Nat holds
not ( support (ppf b3) c= Seg b1 & b2 = b3 * ((b1 + 1) |^ b4) & ( for b5 being Prime holds
( ( b5 in support (ppf b3) implies b5 |-count b3 = b5 |-count b2 ) & ( not b5 in support (ppf b3) implies b5 |-count b3 <= b5 |-count b2 ) ) ) ) ) )
proof end;

theorem Th19: :: MOEBIUS1:19
for b1, b2 being non zero natural number holds
( ( for b3 being Prime holds b3 |-count b1 <= b3 |-count b2 ) implies b1 divides b2 )
proof end;

definition
let c1 be natural number ;
attr a1 is square-containing means :Def1: :: MOEBIUS1:def 1
ex b1 being Prime st b1 |^ 2 divides a1;
end;

:: deftheorem Def1 defines square-containing MOEBIUS1:def 1 :
for b1 being natural number holds
( b1 is square-containing iff ex b2 being Prime st b2 |^ 2 divides b1 );

theorem Th20: :: MOEBIUS1:20
for b1 being natural number holds
( ex b2 being non zero natural number st
( b2 <> 1 & b2 |^ 2 divides b1 ) implies b1 is square-containing )
proof end;

notation
let c1 be natural number ;
antonym square-free c1 for square-containing c1;
end;

theorem Th21: :: MOEBIUS1:21
0 is square-containing
proof end;

theorem Th22: :: MOEBIUS1:22
not 1 is square-containing
proof end;

theorem Th23: :: MOEBIUS1:23
for b1 being Prime holds
not b1 is square-containing
proof end;

registration
cluster prime -> square-free Element of NAT ;
coherence
for b1 being Element of NAT holds
not ( b1 is prime & b1 is square-containing )
by Th23;
end;

definition
func SCNAT -> Subset of NAT means :Def2: :: MOEBIUS1:def 2
for b1 being natural number holds
( b1 in a1 iff not b1 is square-containing );
existence
ex b1 being Subset of NAT st
for b2 being natural number holds
( b2 in b1 iff not b2 is square-containing )
proof end;
uniqueness
for b1, b2 being Subset of NAT holds
( ( for b3 being natural number holds
( b3 in b1 iff not b3 is square-containing ) ) & ( for b3 being natural number holds
( b3 in b2 iff not b3 is square-containing ) ) implies b1 = b2 )
proof end;
end;

:: deftheorem Def2 defines SCNAT MOEBIUS1:def 2 :
for b1 being Subset of NAT holds
( b1 = SCNAT iff for b2 being natural number holds
( b2 in b1 iff not b2 is square-containing ) );

registration
cluster natural square-free set ;
existence
not for b1 being natural number holds b1 is square-containing
by Th22;
cluster natural square-containing set ;
existence
ex b1 being natural number st b1 is square-containing
proof end;
end;

registration
cluster natural square non trivial -> natural square-containing set ;
coherence
for b1 being natural number holds
( b1 is square & not b1 is trivial implies b1 is square-containing )
proof end;
end;

theorem Th24: :: MOEBIUS1:24
for b1 being natural number holds
( not b1 is square-containing implies for b2 being Prime holds b2 |-count b1 <= 1 )
proof end;

theorem Th25: :: MOEBIUS1:25
for b1, b2 being natural number holds
not ( not b1 * b2 is square-containing & b1 is square-containing )
proof end;

theorem Th26: :: MOEBIUS1:26
for b1, b2 being natural number holds
not ( not b1 is square-containing & b2 divides b1 & b2 is square-containing )
proof end;

theorem Th27: :: MOEBIUS1:27
for b1 being Prime
for b2, b3 being natural number holds
( not b2 is square-containing & b1 divides b2 & b3 divides b2 div b1 implies ( b3 divides b2 & not b1 divides b3 ) )
proof end;

theorem Th28: :: MOEBIUS1:28
for b1 being Prime
for b2, b3 being natural number holds
( b1 divides b2 & b3 divides b2 & not b1 divides b3 implies b3 divides b2 div b1 )
proof end;

theorem Th29: :: MOEBIUS1:29
for b1 being Prime
for b2 being natural number holds
( not b2 is square-containing & b1 divides b2 implies { b3 where B is Nat : ( 0 < b3 & b3 divides b2 & not b1 divides b3 ) } = { b3 where B is Nat : ( 0 < b3 & b3 divides b2 div b1 ) } )
proof end;

definition
let c1 be natural number ;
func Moebius c1 -> real number means :Def3: :: MOEBIUS1:def 3
a2 = 0 if a1 is square-containing
otherwise ex b1 being non zero natural number st
( b1 = a1 & a2 = (- 1) |^ (card (support (ppf b1))) );
consistency
for b1 being real number holds
verum
;
existence
( not ( c1 is square-containing & ( for b1 being real number holds
not b1 = 0 ) ) & not ( not c1 is square-containing & ( for b1 being real number
for b2 being non zero natural number holds
not ( b2 = c1 & b1 = (- 1) |^ (card (support (ppf b2))) ) ) ) )
proof end;
uniqueness
for b1, b2 being real number holds
( ( c1 is square-containing & b1 = 0 & b2 = 0 implies b1 = b2 ) & ( not c1 is square-containing & ex b3 being non zero natural number st
( b3 = c1 & b1 = (- 1) |^ (card (support (ppf b3))) ) & ex b3 being non zero natural number st
( b3 = c1 & b2 = (- 1) |^ (card (support (ppf b3))) ) implies b1 = b2 ) )
;
end;

:: deftheorem Def3 defines Moebius MOEBIUS1:def 3 :
for b1 being natural number
for b2 being real number holds
( ( b1 is square-containing implies ( b2 = Moebius b1 iff b2 = 0 ) ) & ( not b1 is square-containing implies ( b2 = Moebius b1 iff ex b3 being non zero natural number st
( b3 = b1 & b2 = (- 1) |^ (card (support (ppf b3))) ) ) ) );

theorem Th30: :: MOEBIUS1:30
Moebius 1 = 1
proof end;

theorem Th31: :: MOEBIUS1:31
Moebius 2 = - 1
proof end;

theorem Th32: :: MOEBIUS1:32
Moebius 3 = - 1
proof end;

theorem Th33: :: MOEBIUS1:33
for b1 being natural number holds
not ( not b1 is square-containing & not Moebius b1 <> 0 )
proof end;

registration
let c1 be natural square-free number ;
cluster Moebius a1 -> non zero real ;
coherence
not Moebius c1 is empty
by Th33;
end;

theorem Th34: :: MOEBIUS1:34
for b1 being Prime holds Moebius b1 = - 1
proof end;

theorem Th35: :: MOEBIUS1:35
for b1, b2 being non zero Nat holds
( b1,b2 are_relative_prime implies Moebius (b1 * b2) = (Moebius b1) * (Moebius b2) )
proof end;

theorem Th36: :: MOEBIUS1:36
for b1 being Prime
for b2 being Nat holds
( 1 <= b2 & not b2 * b1 is square-containing implies Moebius (b2 * b1) = - (Moebius b2) )
proof end;

theorem Th37: :: MOEBIUS1:37
for b1, b2 being non zero Nat holds
( not b1,b2 are_relative_prime implies Moebius (b1 * b2) = 0 )
proof end;

theorem Th38: :: MOEBIUS1:38
for b1 being natural number holds
( b1 in SCNAT iff Moebius b1 <> 0 )
proof end;

definition
let c1 be natural number ;
func NatDivisors c1 -> Subset of NAT equals :: MOEBIUS1:def 4
{ b1 where B is Element of NAT : ( b1 <> 0 & b1 divides a1 ) } ;
coherence
{ b1 where B is Element of NAT : ( b1 <> 0 & b1 divides c1 ) } is Subset of NAT
proof end;
end;

:: deftheorem Def4 defines NatDivisors MOEBIUS1:def 4 :
for b1 being natural number holds NatDivisors b1 = { b2 where B is Element of NAT : ( b2 <> 0 & b2 divides b1 ) } ;

theorem Th39: :: MOEBIUS1:39
for b1, b2 being natural number holds
( b2 in NatDivisors b1 iff ( 0 < b2 & b2 divides b1 ) )
proof end;

theorem Th40: :: MOEBIUS1:40
for b1 being non zero natural number holds NatDivisors b1 c= Seg b1
proof end;

registration
let c1 be non zero natural number ;
cluster NatDivisors a1 -> with_non-empty_elements finite ;
coherence
( NatDivisors c1 is finite & NatDivisors c1 is with_non-empty_elements )
proof end;
end;

theorem Th41: :: MOEBIUS1:41
NatDivisors 1 = {1}
proof end;

definition
let c1 be set ;
func SMoebius c1 -> ManySortedSet of NAT means :Def5: :: MOEBIUS1:def 5
( support a2 = a1 /\ SCNAT & ( for b1 being Nat holds
( b1 in support a2 implies a2 . b1 = Moebius b1 ) ) );
existence
ex b1 being ManySortedSet of NAT st
( support b1 = c1 /\ SCNAT & ( for b2 being Nat holds
( b2 in support b1 implies b1 . b2 = Moebius b2 ) ) )
proof end;
uniqueness
for b1, b2 being ManySortedSet of NAT holds
( support b1 = c1 /\ SCNAT & ( for b3 being Nat holds
( b3 in support b1 implies b1 . b3 = Moebius b3 ) ) & support b2 = c1 /\ SCNAT & ( for b3 being Nat holds
( b3 in support b2 implies b2 . b3 = Moebius b3 ) ) implies b1 = b2 )
proof end;
end;

:: deftheorem Def5 defines SMoebius MOEBIUS1:def 5 :
for b1 being set
for b2 being ManySortedSet of NAT holds
( b2 = SMoebius b1 iff ( support b2 = b1 /\ SCNAT & ( for b3 being Nat holds
( b3 in support b2 implies b2 . b3 = Moebius b3 ) ) ) );

registration
let c1 be set ;
cluster SMoebius a1 -> real-yielding ;
coherence
SMoebius c1 is real-yielding
proof end;
end;

registration
let c1 be finite set ;
cluster SMoebius a1 -> real-yielding finite-support ;
coherence
SMoebius c1 is finite-support
proof end;
end;

theorem Th42: :: MOEBIUS1:42
Sum (SMoebius (NatDivisors 1)) = 1
proof end;

theorem Th43: :: MOEBIUS1:43
for b1, b2 being finite Subset of NAT holds
( b1 misses b2 implies (support (SMoebius b1)) \/ (support (SMoebius b2)) = support ((SMoebius b1) + (SMoebius b2)) )
proof end;

theorem Th44: :: MOEBIUS1:44
for b1, b2 being finite Subset of NAT holds
( b1 misses b2 implies SMoebius (b1 \/ b2) = (SMoebius b1) + (SMoebius b2) )
proof end;

definition
let c1 be non zero natural number ;
func PFactors c1 -> ManySortedSet of SetPrimes means :Def6: :: MOEBIUS1:def 6
( support a2 = support (pfexp a1) & ( for b1 being natural number holds
( b1 in support (pfexp a1) implies a2 . b1 = b1 ) ) );
existence
ex b1 being ManySortedSet of SetPrimes st
( support b1 = support (pfexp c1) & ( for b2 being natural number holds
( b2 in support (pfexp c1) implies b1 . b2 = b2 ) ) )
proof end;
uniqueness
for b1, b2 being ManySortedSet of SetPrimes holds
( support b1 = support (pfexp c1) & ( for b3 being natural number holds
( b3 in support (pfexp c1) implies b1 . b3 = b3 ) ) & support b2 = support (pfexp c1) & ( for b3 being natural number holds
( b3 in support (pfexp c1) implies b2 . b3 = b3 ) ) implies b1 = b2 )
proof end;
end;

:: deftheorem Def6 defines PFactors MOEBIUS1:def 6 :
for b1 being non zero natural number
for b2 being ManySortedSet of SetPrimes holds
( b2 = PFactors b1 iff ( support b2 = support (pfexp b1) & ( for b3 being natural number holds
( b3 in support (pfexp b1) implies b2 . b3 = b3 ) ) ) );

registration
let c1 be non zero natural number ;
cluster PFactors a1 -> natural-yielding finite-support ;
coherence
( PFactors c1 is finite-support & PFactors c1 is natural-yielding )
proof end;
end;

theorem Th45: :: MOEBIUS1:45
PFactors 1 = EmptyBag SetPrimes
proof end;

theorem Th46: :: MOEBIUS1:46
for b1 being Prime holds (PFactors b1) * <*b1*> = <*b1*>
proof end;

theorem Th47: :: MOEBIUS1:47
for b1 being Prime
for b2 being non zero natural number holds (PFactors (b1 |^ b2)) * <*b1*> = <*b1*>
proof end;

theorem Th48: :: MOEBIUS1:48
for b1 being Prime
for b2 being non zero natural number holds
( b1 |-count b2 = 0 implies (PFactors b2) . b1 = 0 )
proof end;

theorem Th49: :: MOEBIUS1:49
for b1 being non zero natural number
for b2 being Prime holds
( b2 |-count b1 <> 0 implies (PFactors b1) . b2 = b2 )
proof end;

theorem Th50: :: MOEBIUS1:50
for b1, b2 being non zero Nat holds
( b1,b2 are_relative_prime implies PFactors (b1 * b2) = (PFactors b1) + (PFactors b2) )
proof end;

theorem Th51: :: MOEBIUS1:51
for b1 being non zero Nat
for b2 being finite Subset of NAT holds
( b2 = { b3 where B is Element of NAT : ( 0 < b3 & b3 divides b1 & b3 is square-containing ) } implies SMoebius b2 = EmptyBag NAT )
proof end;

definition
let c1 be non zero natural number ;
func Radical c1 -> Nat equals :: MOEBIUS1:def 7
Product (PFactors a1);
coherence
Product (PFactors c1) is Nat
;
end;

:: deftheorem Def7 defines Radical MOEBIUS1:def 7 :
for b1 being non zero natural number holds Radical b1 = Product (PFactors b1);

theorem Th52: :: MOEBIUS1:52
for b1 being non zero natural number holds
Radical b1 > 0
proof end;

registration
let c1 be non zero natural number ;
cluster Radical a1 -> non zero ;
coherence
not Radical c1 is empty
by Th52;
end;

theorem Th53: :: MOEBIUS1:53
for b1 being Prime holds b1 = Radical b1
proof end;

theorem Th54: :: MOEBIUS1:54
for b1 being Prime
for b2 being non zero Nat holds Radical (b1 |^ b2) = b1
proof end;

theorem Th55: :: MOEBIUS1:55
for b1 being non zero natural number holds Radical b1 divides b1
proof end;

theorem Th56: :: MOEBIUS1:56
for b1 being Prime
for b2 being non zero natural number holds
( b1 divides b2 iff b1 divides Radical b2 )
proof end;

theorem Th57: :: MOEBIUS1:57
for b1 being non zero natural number holds
( not b1 is square-containing implies Radical b1 = b1 )
proof end;

theorem Th58: :: MOEBIUS1:58
for b1 being non zero natural number holds Radical b1 <= b1
proof end;

theorem Th59: :: MOEBIUS1:59
for b1 being Prime
for b2 being non zero natural number holds b1 |-count (Radical b2) <= b1 |-count b2
proof end;

theorem Th60: :: MOEBIUS1:60
for b1 being non zero natural number holds
( Radical b1 = 1 iff b1 = 1 )
proof end;

theorem Th61: :: MOEBIUS1:61
for b1 being Prime
for b2 being non zero natural number holds b1 |-count (Radical b2) <= 1
proof end;

Lemma54: for b1 being non zero natural number
for b2 being Prime holds
not b2 |^ 2 divides Radical b1
proof end;

Lemma55: for b1 being non zero natural number holds
not Radical b1 is square-containing
proof end;

registration
let c1 be non zero natural number ;
cluster Radical a1 -> non zero square-free ;
coherence
not Radical c1 is square-containing
by Lemma55;
end;

theorem Th62: :: MOEBIUS1:62
for b1 being non zero natural number holds Radical (Radical b1) = Radical b1 by Th57;

theorem Th63: :: MOEBIUS1:63
for b1 being non zero Nat
for b2 being Prime holds { b3 where B is Element of NAT : ( 0 < b3 & b3 divides Radical b1 & b2 divides b3 ) } c= Seg b1
proof end;

theorem Th64: :: MOEBIUS1:64
for b1 being non zero Nat
for b2 being Prime holds { b3 where B is Element of NAT : ( 0 < b3 & b3 divides Radical b1 & not b2 divides b3 ) } c= Seg b1
proof end;

Lemma56: for b1, b2 being non zero Nat holds
( b1 divides b2 & not b1 is square-containing implies b1 divides Radical b2 )
proof end;

theorem Th65: :: MOEBIUS1:65
for b1, b2 being non zero natural number holds
( ( b1 divides b2 & not b1 is square-containing ) iff b1 divides Radical b2 )
proof end;

theorem Th66: :: MOEBIUS1:66
for b1 being non zero natural number holds { b2 where B is Nat : ( 0 < b2 & b2 divides b1 & not b2 is square-containing ) } = { b2 where B is Nat : ( 0 < b2 & b2 divides Radical b1 ) }
proof end;