let n be Element of NAT ; for p being Prime st n <> 0 holds
ex f being FinSequence of NAT st
( len f = n & ( for k being Element of NAT st k in dom f holds
( ( f . k = 1 implies p |^ k divides n ) & ( p |^ k divides n implies f . k = 1 ) & ( f . k = 0 implies not p |^ k divides n ) & ( not p |^ k divides n implies f . k = 0 ) ) ) & p |-count n = Sum f )
let p be Prime; ( n <> 0 implies ex f being FinSequence of NAT st
( len f = n & ( for k being Element of NAT st k in dom f holds
( ( f . k = 1 implies p |^ k divides n ) & ( p |^ k divides n implies f . k = 1 ) & ( f . k = 0 implies not p |^ k divides n ) & ( not p |^ k divides n implies f . k = 0 ) ) ) & p |-count n = Sum f ) )
defpred S1[ Nat, set ] means ( ( $2 = 1 implies p |^ $1 divides n ) & ( p |^ $1 divides n implies $2 = 1 ) & ( $2 = 0 implies not p |^ $1 divides n ) & ( not p |^ $1 divides n implies $2 = 0 ) );
set f1 = ((p |-count n) |-> 1) ^ ((n -' (p |-count n)) |-> 0);
set n1 = p |-count n;
set n2 = n -' (p |-count n);
set fa = (p |-count n) |-> 1;
set fb = (n -' (p |-count n)) |-> 0;
A1: Sum (((p |-count n) |-> 1) ^ ((n -' (p |-count n)) |-> 0)) =
(Sum ((p |-count n) |-> 1)) + (Sum ((n -' (p |-count n)) |-> 0))
by RVSUM_1:75
.=
((p |-count n) * 1) + (Sum ((n -' (p |-count n)) |-> 0))
by RVSUM_1:80
.=
(p |-count n) + ((n -' (p |-count n)) * 0)
by RVSUM_1:80
;
assume A2:
n <> 0
; ex f being FinSequence of NAT st
( len f = n & ( for k being Element of NAT st k in dom f holds
( ( f . k = 1 implies p |^ k divides n ) & ( p |^ k divides n implies f . k = 1 ) & ( f . k = 0 implies not p |^ k divides n ) & ( not p |^ k divides n implies f . k = 0 ) ) ) & p |-count n = Sum f )
A6:
for k being Nat st k in Seg n holds
ex x being set st S1[k,x]
consider f being FinSequence such that
A9:
dom f = Seg n
and
A10:
for k being Nat st k in Seg n holds
S1[k,f . k]
from FINSEQ_1:sch 1(A6);
then
rng f c= NAT
by TARSKI:def 3;
then reconsider f = f as FinSequence of NAT by FINSEQ_1:def 4;
A13: len (((p |-count n) |-> 1) ^ ((n -' (p |-count n)) |-> 0)) =
(len ((p |-count n) |-> 1)) + (len ((n -' (p |-count n)) |-> 0))
by FINSEQ_1:22
.=
(p |-count n) + (len ((n -' (p |-count n)) |-> 0))
by CARD_1:def 7
.=
(p |-count n) + (n -' (p |-count n))
by CARD_1:def 7
.=
(p |-count n) + (n - (p |-count n))
by A3, XREAL_1:233
;
A14:
for x being set st x in dom f holds
f . x = (((p |-count n) |-> 1) ^ ((n -' (p |-count n)) |-> 0)) . x
take
f
; ( len f = n & ( for k being Element of NAT st k in dom f holds
( ( f . k = 1 implies p |^ k divides n ) & ( p |^ k divides n implies f . k = 1 ) & ( f . k = 0 implies not p |^ k divides n ) & ( not p |^ k divides n implies f . k = 0 ) ) ) & p |-count n = Sum f )
thus
len f = n
by A9, FINSEQ_1:def 3; ( ( for k being Element of NAT st k in dom f holds
( ( f . k = 1 implies p |^ k divides n ) & ( p |^ k divides n implies f . k = 1 ) & ( f . k = 0 implies not p |^ k divides n ) & ( not p |^ k divides n implies f . k = 0 ) ) ) & p |-count n = Sum f )
thus
for k being Element of NAT st k in dom f holds
( ( f . k = 1 implies p |^ k divides n ) & ( p |^ k divides n implies f . k = 1 ) & ( f . k = 0 implies not p |^ k divides n ) & ( not p |^ k divides n implies f . k = 0 ) )
by A9, A10; p |-count n = Sum f
dom f = dom (((p |-count n) |-> 1) ^ ((n -' (p |-count n)) |-> 0))
by A9, A13, FINSEQ_1:def 3;
hence
p |-count n = Sum f
by A14, A1, FUNCT_1:2; verum