reserve SOURCE for non empty finite set,
 p for Probability of Trivial-SigmaField SOURCE,
 Tseq for FinSequence of BoolBinFinTrees IndexedREAL,
 q for FinSequence of NAT;
reserve T for BinHuffmanTree of p;

theorem Th18:
union LeavesSet(Initial-Trees p) = { z where z is Element of [:NAT,REAL:]
 :ex x be Element of SOURCE st z =[(canFS SOURCE)".x,p.{x}] }
proof
set L = union LeavesSet(Initial-Trees(p));
set R = { z where z is Element of [:NAT,REAL:]
 :ex x be Element of SOURCE st z =[(canFS SOURCE)".x,p.{x}] };
reconsider fcs = (canFS SOURCE)" as Function of SOURCE, Seg (card SOURCE)
 by FINSEQ_1:95;
for x be object holds x in L iff x in R
proof
 let x be object;
 hereby assume x in L; then
 consider Y be set
 such that A1: x in Y & Y in LeavesSet(Initial-Trees(p)) by TARSKI:def 4;
 consider q be Element of BinFinTrees IndexedREAL
 such that A2: Y = Leaves q & q in Initial-Trees(p) by A1;
 consider T be Element of FinTrees IndexedREAL such that
 A3: q = T & T is finite binary DecoratedTree of IndexedREAL &
 ex y be Element of SOURCE st
 T = root-tree [ (canFS SOURCE)".y, p.{y} ] by A2;
 reconsider T as finite binary DecoratedTree of IndexedREAL by A3;
 consider y be Element of SOURCE such that
 A4: T = root-tree [ (canFS SOURCE)".y, p.{y} ] by A3;
 Y = {[ (canFS SOURCE)".y, p.{y} ]} by A2,A3,A4,Th16; then
 x = [ (canFS SOURCE)".y, p.{y} ] by TARSKI:def 1,A1;
 hence x in R by A1;
 end;
assume x in R; then
 consider z be Element of [:NAT,REAL:] such that
 A5: x=z & ex y be Element of SOURCE
 st z =[(canFS SOURCE)".y,p.{y}];
 consider y be Element of SOURCE such that
 A6: z =[(canFS SOURCE)".y,p.{y}] by A5;
 fcs.y in NAT by TARSKI:def 3; then
A7: [ fcs.y, p.{y} ] in [:NAT,REAL:] by ZFMISC_1:87;
 set T = root-tree [ fcs.y, p.{y} ];
A8: dom T = elementary_tree 0;
then T is Element of FinTrees IndexedREAL by TREES_3:def 8,A7; then
A9: T in Initial-Trees(p);
reconsider T as Element of BinFinTrees IndexedREAL by A7,A8,Def2;
 Leaves (T) = {[(canFS SOURCE)".y,p.{y}]} by Th16; then
A10: x in (Leaves T) by TARSKI:def 1,A5,A6;
 (Leaves T) in LeavesSet(Initial-Trees(p)) by A9;
 hence x in L by TARSKI:def 4,A10;
end;
hence thesis by TARSKI:2;
end;
