let S be non empty finite set ; :: thesis: for s being non empty FinSequence of S holds Sum (freqSEQ s) = len s
let s be non empty FinSequence of S; :: thesis: Sum (freqSEQ s) = len s
set L = freqSEQ s;
defpred S1[ set , set ] means ex z being Element of S st
( z = (canFS S) . $1 & $2 = event_pick z,s );
len (canFS S) = card S
by UPROOTS:5;
then PP0:
dom (canFS S) = Seg (card S)
by FINSEQ_1:def 3;
PP1:
for x, y1, y2 being set st x in dom (freqSEQ s) & S1[x,y1] & S1[x,y2] holds
y1 = y2
;
PP2:
for x being set st x in dom (freqSEQ s) holds
ex y being set st S1[x,y]
consider T being Function such that
P1:
( dom T = dom (freqSEQ s) & ( for x being set st x in dom (freqSEQ s) holds
S1[x,T . x] ) )
from FUNCT_1:sch 2(PP1, PP2);
LMISS1:
for a, b being set st a in dom T & b in dom T & a <> b holds
T . a misses T . b
proof
let a,
b be
set ;
:: thesis: ( a in dom T & b in dom T & a <> b implies T . a misses T . b )
assume ZTA:
(
a in dom T &
b in dom T &
a <> b )
;
:: thesis: T . a misses T . b
ZT1:
(
a in dom (canFS S) &
b in dom (canFS S) )
by P1, ZTA, PP0, defDIST;
ZT2:
(canFS S) . a <> (canFS S) . b
by ZTA, FUNCT_1:def 8, ZT1;
consider za being
Element of
S such that ZT3:
(
za = (canFS S) . a &
T . a = event_pick za,
s )
by P1, ZTA;
consider zb being
Element of
S such that ZT4:
(
zb = (canFS S) . b &
T . b = event_pick zb,
s )
by P1, ZTA;
thus
T . a misses T . b
by ZT3, ZT4, FUNCT_1:141, ZFMISC_1:17, ZT2;
:: thesis: verum
end;
for a, b being set st a <> b holds
T . a misses T . b
then Q1:
T is disjoint_valued
by PROB_2:def 3;
Q3:
for i being Nat st i in dom T holds
( T . i is finite & (freqSEQ s) . i = card (T . i) )
reconsider T1 = union (rng T) as finite set by Q1, P1, Q3, LMCARD;
for X being set st X in rng T holds
X c= Seg (len s)
then L1:
union (rng T) c= Seg (len s)
by ZFMISC_1:94;
Seg (len s) c= union (rng T)
proof
assume CNTRSEGLS:
not
Seg (len s) c= union (rng T)
;
:: thesis: contradiction
consider ne being
set such that SEGLS1:
(
ne in Seg (len s) & not
ne in union (rng T) )
by TARSKI:def 3, CNTRSEGLS;
SEGLS2:
ne in dom s
by SEGLS1, FINSEQ_1:def 3;
set yne =
s . ne;
SEGLS4:
s . ne in rng s
by SEGLS2, FUNCT_1:def 5;
reconsider yne =
s . ne as
Element of
S by SEGLS4;
rng (canFS S) = S
by FUNCT_2:def 3;
then consider nne being
set such that SEGLS6:
(
nne in dom (canFS S) &
yne = (canFS S) . nne )
by FUNCT_1:def 5;
NINDOML:
nne in dom (freqSEQ s)
by defDIST, PP0, SEGLS6;
then consider zne being
Element of
S such that SEGLS7:
(
zne = (canFS S) . nne &
T . nne = event_pick zne,
s )
by P1;
s . ne in {(s . ne)}
by TARSKI:def 1;
then SEGLS9:
ne in T . nne
by SEGLS7, SEGLS6, FUNCT_1:def 13, SEGLS2;
T . nne in rng T
by FUNCT_1:12, NINDOML, P1;
hence
contradiction
by SEGLS1, TARSKI:def 4, SEGLS9;
:: thesis: verum
end;
then Q5:
T1 = Seg (len s)
by L1, XBOOLE_0:def 10;
thus Sum (freqSEQ s) =
card T1
by Q1, P1, Q3, LMCARD
.=
len s
by FINSEQ_1:78, Q5
; :: thesis: verum