A1: now end;
defpred S1[ Element of NAT ] means for a, k being Element of NAT
for X being set
for F being FinSequence of SetPrimes
for p being Prime st X c= SetPrimes & X c= Seg k & F = Sgm X & a = Product F & len F = $1 holds
( ( p in rng F implies p |-count a = 1 ) & ( not p in rng F implies p |-count a = 0 ) );
A2: S1[ 0 ]
proof
let a, k be Element of NAT ; :: thesis: for X being set
for F being FinSequence of SetPrimes
for p being Prime st X c= SetPrimes & X c= Seg k & F = Sgm X & a = Product F & len F = 0 holds
( ( p in rng F implies p |-count a = 1 ) & ( not p in rng F implies p |-count a = 0 ) )

let X be set ; :: thesis: for F being FinSequence of SetPrimes
for p being Prime st X c= SetPrimes & X c= Seg k & F = Sgm X & a = Product F & len F = 0 holds
( ( p in rng F implies p |-count a = 1 ) & ( not p in rng F implies p |-count a = 0 ) )

let F be FinSequence of SetPrimes ; :: thesis: for p being Prime st X c= SetPrimes & X c= Seg k & F = Sgm X & a = Product F & len F = 0 holds
( ( p in rng F implies p |-count a = 1 ) & ( not p in rng F implies p |-count a = 0 ) )

let p be Prime; :: thesis: ( X c= SetPrimes & X c= Seg k & F = Sgm X & a = Product F & len F = 0 implies ( ( p in rng F implies p |-count a = 1 ) & ( not p in rng F implies p |-count a = 0 ) ) )
assume A3: ( X c= SetPrimes & X c= Seg k & F = Sgm X & a = Product F & len F = 0 ) ; :: thesis: ( ( p in rng F implies p |-count a = 1 ) & ( not p in rng F implies p |-count a = 0 ) )
assume A4: ( ( p in rng F & not p |-count a = 1 ) or ( not p in rng F & not p |-count a = 0 ) ) ; :: thesis: contradiction
A5: F = <*> REAL by A3;
per cases ( ( p in rng F & not p |-count a = 1 ) or ( not p in rng F & not p |-count a = 0 ) ) by A4;
end;
end;
A8: for n being Element of NAT st S1[n] holds
S1[n + 1]
proof
let n be Element of NAT ; :: thesis: ( S1[n] implies S1[n + 1] )
assume A9: S1[n] ; :: thesis: S1[n + 1]
for a, k being Element of NAT
for X being set
for F being FinSequence of SetPrimes
for p being Prime st X c= SetPrimes & X c= Seg k & F = Sgm X & a = Product F & len F = n + 1 holds
( ( p in rng F implies p |-count a = 1 ) & ( not p in rng F implies p |-count a = 0 ) )
proof
let a, k be Element of NAT ; :: thesis: for X being set
for F being FinSequence of SetPrimes
for p being Prime st X c= SetPrimes & X c= Seg k & F = Sgm X & a = Product F & len F = n + 1 holds
( ( p in rng F implies p |-count a = 1 ) & ( not p in rng F implies p |-count a = 0 ) )

let X be set ; :: thesis: for F being FinSequence of SetPrimes
for p being Prime st X c= SetPrimes & X c= Seg k & F = Sgm X & a = Product F & len F = n + 1 holds
( ( p in rng F implies p |-count a = 1 ) & ( not p in rng F implies p |-count a = 0 ) )

let F be FinSequence of SetPrimes ; :: thesis: for p being Prime st X c= SetPrimes & X c= Seg k & F = Sgm X & a = Product F & len F = n + 1 holds
( ( p in rng F implies p |-count a = 1 ) & ( not p in rng F implies p |-count a = 0 ) )

let p be Prime; :: thesis: ( X c= SetPrimes & X c= Seg k & F = Sgm X & a = Product F & len F = n + 1 implies ( ( p in rng F implies p |-count a = 1 ) & ( not p in rng F implies p |-count a = 0 ) ) )
assume A10: ( X c= SetPrimes & X c= Seg k & F = Sgm X & a = Product F ) ; :: thesis: ( not len F = n + 1 or ( ( p in rng F implies p |-count a = 1 ) & ( not p in rng F implies p |-count a = 0 ) ) )
assume A11: len F = n + 1 ; :: thesis: ( ( p in rng F implies p |-count a = 1 ) & ( not p in rng F implies p |-count a = 0 ) )
set x = F . (n + 1);
A12: Seg (n + 1) = dom F by A11, FINSEQ_1:def 3;
then n + 1 in dom F by FINSEQ_1:5;
then A13: F . (n + 1) in rng F by FUNCT_1:def 5;
rng F c= SetPrimes by FINSEQ_1:def 4;
then reconsider x = F . (n + 1) as Prime by A13, NEWTON:def 6;
set X1 = X \ {x};
A14: X \ {x} c= X by XBOOLE_1:36;
then A15: X \ {x} c= SetPrimes by A10, XBOOLE_1:1;
A16: X \ {x} c= Seg k by A10, A14, XBOOLE_1:1;
set F1 = Sgm (X \ {x});
reconsider F1 = Sgm (X \ {x}) as FinSequence of NAT ;
set a1 = Product F1;
set F2 = Sgm {x};
A17: rng F = X by A10, FINSEQ_1:def 13;
now
let y be set ; :: thesis: ( y in {x} implies y in Seg k )
assume y in {x} ; :: thesis: y in Seg k
then y = x by TARSKI:def 1;
hence y in Seg k by A10, A13, A17; :: thesis: verum
end;
then A18: {x} c= Seg k by TARSKI:def 3;
A19: for m1, n1 being Element of NAT st m1 in X \ {x} & n1 in {x} holds
m1 < n1
proof
let m1, n1 be Element of NAT ; :: thesis: ( m1 in X \ {x} & n1 in {x} implies m1 < n1 )
assume A20: ( m1 in X \ {x} & n1 in {x} ) ; :: thesis: m1 < n1
then A21: m1 in rng F by A14, A17;
A22: F is one-to-one by A10, FINSEQ_3:99;
then A23: m1 in dom (F " ) by A21, FUNCT_1:55;
set l = (F " ) . m1;
(F " ) . m1 in rng (F " ) by A23, FUNCT_1:def 5;
then A24: (F " ) . m1 in Seg (n + 1) by A12, A22, FUNCT_1:55;
then reconsider l = (F " ) . m1 as Element of NAT ;
A25: ( 1 <= l & l <= n + 1 ) by A24, FINSEQ_1:3;
set n' = n + 1;
A26: m1 = F . l by A14, A17, A20, A22, FUNCT_1:57;
A27: n1 = F . (n + 1) by A20, TARSKI:def 1;
not n + 1 = l by A20, A26, ZFMISC_1:64;
then l < n + 1 by A25, XXREAL_0:1;
hence m1 < n1 by A10, A11, A25, A26, A27, FINSEQ_1:def 13; :: thesis: verum
end;
A28: (X \ {x}) \/ {x} = X \/ {x} by XBOOLE_1:39
.= X by A13, A17, ZFMISC_1:46 ;
then A29: F = F1 ^ (Sgm {x}) by A10, A16, A18, A19, FINSEQ_3:48;
then A30: len F = (len F1) + (len (Sgm {x})) by FINSEQ_1:35;
A31: Sgm {x} = <*x*> by FINSEQ_3:50;
then A32: n + 1 = (len F1) + 1 by A11, A30, FINSEQ_1:56;
A33: rng F c= SetPrimes by FINSEQ_1:def 4;
rng F1 c= rng F by A29, FINSEQ_1:42;
then A34: rng F1 c= SetPrimes by A33, XBOOLE_1:1;
then reconsider F1 = F1 as FinSequence of SetPrimes by FINSEQ_1:def 4;
A35: rng (Sgm {x}) = {x} by A31, FINSEQ_1:56;
A36: Product F = Product (F1 ^ (Sgm {x})) by A10, A16, A18, A19, A28, FINSEQ_3:48
.= Product (F1 ^ <*x*>) by FINSEQ_3:50
.= (Product F1) * x by RVSUM_1:126 ;
now
let k be Element of NAT ; :: thesis: ( k in dom F1 implies F1 . k > 0 )
assume k in dom F1 ; :: thesis: F1 . k > 0
then F1 . k in rng F1 by FUNCT_1:def 5;
then F1 . k is Prime by A34, NEWTON:def 6;
hence F1 . k > 0 ; :: thesis: verum
end;
then Product F1 <> 0 by Th42;
then A37: p |-count a = (p |-count (Product F1)) + (p |-count x) by A10, A36, NAT_3:28;
A38: rng F1 = X \ {x} by A16, FINSEQ_1:def 13;
hence ( ( p in rng F implies p |-count a = 1 ) & ( not p in rng F implies p |-count a = 0 ) ) by A39; :: thesis: verum
end;
hence S1[n + 1] ; :: thesis: verum
end;
A45: for n being Element of NAT holds S1[n] from NAT_1:sch 1(A2, A8);
let a, k be Element of NAT ; :: thesis: for X being set
for F being FinSequence of SetPrimes
for p being Prime st X c= SetPrimes & X c= Seg k & F = Sgm X & a = Product F holds
( ( p in rng F implies p |-count a = 1 ) & ( not p in rng F implies p |-count a = 0 ) )

let X be set ; :: thesis: for F being FinSequence of SetPrimes
for p being Prime st X c= SetPrimes & X c= Seg k & F = Sgm X & a = Product F holds
( ( p in rng F implies p |-count a = 1 ) & ( not p in rng F implies p |-count a = 0 ) )

let F be FinSequence of SetPrimes ; :: thesis: for p being Prime st X c= SetPrimes & X c= Seg k & F = Sgm X & a = Product F holds
( ( p in rng F implies p |-count a = 1 ) & ( not p in rng F implies p |-count a = 0 ) )

let p be Prime; :: thesis: ( X c= SetPrimes & X c= Seg k & F = Sgm X & a = Product F implies ( ( p in rng F implies p |-count a = 1 ) & ( not p in rng F implies p |-count a = 0 ) ) )
reconsider F = F as FinSequence of REAL by A1;
ex n being Element of NAT st n = len F ;
hence ( X c= SetPrimes & X c= Seg k & F = Sgm X & a = Product F implies ( ( p in rng F implies p |-count a = 1 ) & ( not p in rng F implies p |-count a = 0 ) ) ) by A45; :: thesis: verum