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 Th31:
 Tseq,q,p is_constructingBinHuffmanTree implies
 for i be Nat
 for T be finite binary DecoratedTree of IndexedREAL
 st T in Tseq.i
 holds T is one-to-one
proof
assume A1:Tseq,q,p is_constructingBinHuffmanTree;
defpred P[Nat] means 1 <=$1 & $1 <=len Tseq implies
 for T be finite binary DecoratedTree of IndexedREAL st T in Tseq.$1
 holds T is one-to-one;
A2: P[0];
A3: for i be Nat st P[i] holds P[i+1]
proof
 let i be Nat;
 assume A4: P[i];
 assume A5: 1 <=i+1 & i+1 <=len Tseq;
 let d be finite binary DecoratedTree of IndexedREAL;
 assume A6: d in Tseq.(i+1);
 per cases;
 suppose i = 0;
 then
 ex d0 be Element of FinTrees IndexedREAL st
 d0=d & d0 is finite binary DecoratedTree of IndexedREAL &
 ex x be Element of SOURCE st
 d0 = root-tree [ (canFS SOURCE)".x, p.{x} ] by A1,A6;
 hence d is one-to-one;
 end;
 suppose A7:i <> 0;
 then 1<= i & i < len Tseq by A5,XXREAL_0:2,NAT_1:16,NAT_1:14;
 then consider X,Y be non empty finite Subset of BinFinTrees IndexedREAL,
    s being MinValueTree of X,
    t being MinValueTree of Y,
    w being finite binary DecoratedTree of IndexedREAL such that
A8: Tseq.i = X & Y = X \ {s} &
 w in {MakeTree (t,s,MaxVl(X) + 1),MakeTree (s,t,MaxVl(X) + 1)} &
 Tseq.(i+1) = (X \ {t,s} ) \/ {w} by A1;
 A9: w = MakeTree (t,s,MaxVl(X) + 1) or
 w = MakeTree (s,t,MaxVl(X) + 1) by A8,TARSKI:def 2;
A10: s in X & t in Y by Def10; then
 A11:t in X & not t in {s} by A8,XBOOLE_0:def 5;
 then
 A12: t in X & t <> s by TARSKI:def 1;
 A13: for z be finite binary DecoratedTree of IndexedREAL st z in X holds
 not [(MaxVl(X) + 1),(Vrootr t) +(Vrootr s)] in rng z
 by A10,A1,Th27,A8,A11;
 A14: s is one-to-one & t is one-to-one by A10,A11,A8,A4,
A5,XXREAL_0:2,NAT_1:16,NAT_1:14,A7;
 A15: rng s /\ rng t = {} by A10,A12,A8,Th29,A1;
 per cases by XBOOLE_0:def 3,A8,A6;
 suppose d in (X \ {t,s} ); then
 d in X & not d in {t,s} by XBOOLE_0:def 5;
 hence d is one-to-one by A7,A5,XXREAL_0:2,NAT_1:16,NAT_1:14,A4,A8;
 end;
 suppose A16: d in {w};
 per cases by A16,TARSKI:def 1,A9;
 suppose d =MakeTree (t,s,MaxVl(X) + 1);
 hence d is one-to-one by A10,Th30,A13,A11,A14,A15;
 end;
 suppose d =MakeTree (s,t,MaxVl(X) + 1);
 hence d is one-to-one by A10,Th30,A13,A11,A14,A15;
 end;
 end;
 end;
end;
A17: for i be Nat holds P[i] from NAT_1:sch 2(A2,A3);
let i be Nat;
let T be finite binary DecoratedTree of IndexedREAL such that
A18: T in Tseq.i;
i in dom Tseq by A18,FUNCT_1:def 2;
then 1 <= i & i <= len Tseq by FINSEQ_3:25;
hence thesis by A18,A17;
end;
