Article ENTROPY1, MML version 4.99.1005

:: ENTROPY1:th 1
theorem
for b1, b2, b3, b4 being Element of NAT
      st b1 <> 0 & b2 < b3 & b3 <= b4 & b1 divides b3
   holds b2 div b1 < b4 div b1;

:: ENTROPY1:th 2
theorem
for b1 being Element of REAL
      st 0 < b1
   holds (log_ number_e) . b1 <= b1 - 1 &
    (b1 = 1 implies (log_ number_e) . b1 = b1 - 1) &
    ((log_ number_e) . b1 = b1 - 1 implies b1 = 1) &
    (b1 <> 1 implies (log_ number_e) . b1 < b1 - 1) &
    ((log_ number_e) . b1 < b1 - 1 implies b1 <> 1);

:: ENTROPY1:th 3
theorem
for b1 being Element of REAL
      st 0 < b1
   holds log(number_e,b1) <= b1 - 1 &
    (b1 = 1 implies log(number_e,b1) = b1 - 1) &
    (log(number_e,b1) = b1 - 1 implies b1 = 1) &
    (b1 <> 1 implies log(number_e,b1) < b1 - 1) &
    (log(number_e,b1) < b1 - 1 implies b1 <> 1);

:: ENTROPY1:th 4
theorem
for b1, b2 being Element of REAL
      st 1 < b1 & 1 < b2
   holds 0 < log(b1,b2);

:: ENTROPY1:th 5
theorem
for b1, b2 being Element of REAL
      st 0 < b1 & b1 <> 1 & 0 < b2
   holds - log(b1,b2) = log(b1,1 / b2);

:: ENTROPY1:th 6
theorem
for b1, b2, b3 being Element of REAL
      st 0 < b1 & b1 <> 1 & 0 <= b2 & 0 <= b3
   holds (b2 * b3) * log(b1,b2 * b3) = ((b2 * b3) * log(b1,b2)) + ((b2 * b3) * log(b1,b3));

:: ENTROPY1:th 7
theorem
for b1, b2, b3 being FinSequence of REAL
      st len b2 = len b1 &
         len b2 = len b3 &
         (for b4 being Element of NAT
               st b4 in dom b2
            holds b1 . b4 = (b2 . b4) + (b3 . b4))
   holds Sum b1 = (Sum b2) + Sum b3;

:: ENTROPY1:th 8
theorem
for b1, b2, b3 being FinSequence of REAL
      st len b2 = len b1 &
         len b2 = len b3 &
         (for b4 being Element of NAT
               st b4 in dom b2
            holds b1 . b4 = (b2 . b4) - (b3 . b4))
   holds Sum b1 = (Sum b2) - Sum b3;

:: ENTROPY1:th 9
theorem
for b1 being FinSequence of REAL
      st 1 <= len b1
   holds ex b2 being FinSequence of REAL st
      len b2 = len b1 &
       b2 . 1 = b1 . 1 &
       (for b3 being Element of NAT
             st 0 <> b3 & b3 < len b1
          holds b2 . (b3 + 1) = (b2 . b3) + (b1 . (b3 + 1))) &
       Sum b1 = b2 . len b1;

:: ENTROPY1:attrnot 1 => PARTFUN3:attr 4
notation
  let a1 be FinSequence of REAL;
  synonym nonnegative for nonnegative-yielding;
end;

:: ENTROPY1:attrnot 2 => PARTFUN3:attr 4
definition
  let a1 be Relation-like set;
  attr a1 is nonnegative means
    for b1 being Element of NAT
          st b1 in dom a1
       holds 0 <= a1 . b1;
end;

:: ENTROPY1:dfs 1
definiens
  let a1 be FinSequence of REAL;
To prove
     a1 is nonnegative-yielding
it is sufficient to prove
  thus for b1 being Element of NAT
          st b1 in dom a1
       holds 0 <= a1 . b1;

:: ENTROPY1:def 1
theorem
for b1 being FinSequence of REAL holds
      b1 is nonnegative-yielding
   iff
      for b2 being Element of NAT
            st b2 in dom b1
         holds 0 <= b1 . b2;

:: ENTROPY1:exreg 1
registration
  cluster Relation-like Function-like finite FinSequence-like complex-valued ext-real-valued real-valued nonnegative-yielding FinSequence of REAL;
end;

:: ENTROPY1:th 10
theorem
for b1 being Element of REAL
for b2 being FinSequence of REAL
      st b2 is nonnegative-yielding & 0 <= b1
   holds b1 * b2 is nonnegative-yielding;

:: ENTROPY1:prednot 1 => ENTROPY1:pred 1
definition
  let a1 be FinSequence of REAL;
  let a2 be Element of NAT;
  pred A1 has_onlyone_value_in A2 means
    a2 in dom a1 &
     (for b1 being Element of NAT
           st b1 in dom a1 & b1 <> a2
        holds a1 . b1 = 0);
end;

:: ENTROPY1:dfs 2
definiens
  let a1 be FinSequence of REAL;
  let a2 be Element of NAT;
To prove
     a1 has_onlyone_value_in a2
it is sufficient to prove
  thus a2 in dom a1 &
     (for b1 being Element of NAT
           st b1 in dom a1 & b1 <> a2
        holds a1 . b1 = 0);

:: ENTROPY1:def 2
theorem
for b1 being FinSequence of REAL
for b2 being Element of NAT holds
      b1 has_onlyone_value_in b2
   iff
      b2 in dom b1 &
       (for b3 being Element of NAT
             st b3 in dom b1 & b3 <> b2
          holds b1 . b3 = 0);

:: ENTROPY1:th 11
theorem
for b1, b2 being Element of NAT
for b3 being FinSequence of REAL
      st b3 has_onlyone_value_in b1 & b2 <> b1
   holds b3 . b2 = 0;

:: ENTROPY1:th 12
theorem
for b1 being Element of NAT
for b2, b3 being FinSequence of REAL
      st len b2 = len b3 & b2 has_onlyone_value_in b1
   holds mlt(b2,b3) has_onlyone_value_in b1 &
    (mlt(b2,b3)) . b1 = (b2 . b1) * (b3 . b1);

:: ENTROPY1:th 13
theorem
for b1 being Element of NAT
for b2 being FinSequence of REAL
      st b2 has_onlyone_value_in b1
   holds Sum b2 = b2 . b1;

:: ENTROPY1:th 14
theorem
for b1 being FinSequence of REAL
   st b1 is nonnegative-yielding
for b2 being Element of NAT
      st b2 in dom b1 & b1 . b2 = Sum b1
   holds b1 has_onlyone_value_in b2;

:: ENTROPY1:condreg 1
registration
  cluster ProbFinS -> non empty nonnegative-yielding (FinSequence of REAL);
end;

:: ENTROPY1:th 15
theorem
for b1 being ProbFinS FinSequence of REAL
for b2 being Element of NAT
      st b2 in dom b1 & b1 . b2 = 1
   holds b1 has_onlyone_value_in b2;

:: ENTROPY1:th 16
theorem
for b1 being non empty natural set holds
   b1 |-> (1 / b1) is ProbFinS FinSequence of REAL;

:: ENTROPY1:condreg 2
registration
  cluster tabular with_sum=1 -> non empty-yielding (FinSequence of REAL *);
end;

:: ENTROPY1:condreg 3
registration
  cluster tabular Joint_Probability -> non empty-yielding (FinSequence of REAL *);
end;

:: ENTROPY1:th 17
theorem
for b1 being tabular FinSequence of REAL *
      st b1 = {}
   holds SumAll b1 = 0;

:: ENTROPY1:th 18
theorem
for b1 being non empty set
for b2 being tabular FinSequence of b1 *
for b3 being Element of NAT
      st b3 in dom b2
   holds dom (b2 . b3) = Seg width b2;

:: ENTROPY1:th 19
theorem
for b1 being tabular FinSequence of REAL * holds
      b1 is m-nonnegative
   iff
      for b2 being Element of NAT
            st b2 in dom b1
         holds Line(b1,b2) is nonnegative-yielding;

:: ENTROPY1:th 20
theorem
for b1 being FinSequence of REAL
for b2 being Element of NAT
      st b2 in dom b1
   holds Col(LineVec2Mx b1,b2) = <*b1 . b2*>;

:: ENTROPY1:th 21
theorem
for b1 being non empty FinSequence of REAL
for b2 being FinSequence of REAL
for b3 being tabular FinSequence of REAL * holds
      b3 = (ColVec2Mx b1) * LineVec2Mx b2
   iff
      len b3 = len b1 &
       width b3 = len b2 &
       (for b4, b5 being Element of NAT
             st [b4,b5] in Indices b3
          holds b3 *(b4,b5) = (b1 . b4) * (b2 . b5));

:: ENTROPY1:th 22
theorem
for b1 being non empty FinSequence of REAL
for b2 being FinSequence of REAL
for b3 being tabular FinSequence of REAL * holds
      b3 = (ColVec2Mx b1) * LineVec2Mx b2
   iff
      len b3 = len b1 &
       width b3 = len b2 &
       (for b4 being Element of NAT
             st b4 in dom b3
          holds Line(b3,b4) = (b1 . b4) * b2);

:: ENTROPY1:th 23
theorem
for b1, b2 being ProbFinS FinSequence of REAL holds
(ColVec2Mx b1) * LineVec2Mx b2 is Joint_Probability;

:: ENTROPY1:attrnot 3 => ENTROPY1:attr 1
definition
  let a1 be natural set;
  let a2 be Matrix of a1,a1,REAL;
  attr a2 is diagonal means
    for b1, b2 being Element of NAT
          st [b1,b2] in Indices a2 & a2 *(b1,b2) <> 0
       holds b1 = b2;
end;

:: ENTROPY1:dfs 3
definiens
  let a1 be natural set;
  let a2 be Matrix of a1,a1,REAL;
To prove
     a2 is diagonal
it is sufficient to prove
  thus for b1, b2 being Element of NAT
          st [b1,b2] in Indices a2 & a2 *(b1,b2) <> 0
       holds b1 = b2;

:: ENTROPY1:def 3
theorem
for b1 being natural set
for b2 being Matrix of b1,b1,REAL holds
      b2 is diagonal(b1)
   iff
      for b3, b4 being Element of NAT
            st [b3,b4] in Indices b2 & b2 *(b3,b4) <> 0
         holds b3 = b4;

:: ENTROPY1:exreg 2
registration
  let a1 be natural set;
  cluster Relation-like Function-like finite FinSequence-like tabular diagonal Matrix of a1,a1,REAL;
end;

:: ENTROPY1:th 24
theorem
for b1 being natural set
for b2 being Matrix of b1,b1,REAL holds
      b2 is diagonal(b1)
   iff
      for b3 being Element of NAT
            st b3 in dom b2
         holds Line(b2,b3) has_onlyone_value_in b3;

:: ENTROPY1:funcnot 1 => ENTROPY1:func 1
definition
  let a1 be FinSequence of REAL;
  func Vec2DiagMx A1 -> diagonal Matrix of len a1,len a1,REAL means
    for b1 being Element of NAT
          st b1 in dom a1
       holds it *(b1,b1) = a1 . b1;
end;

:: ENTROPY1:def 4
theorem
for b1 being FinSequence of REAL
for b2 being diagonal Matrix of len b1,len b1,REAL holds
      b2 = Vec2DiagMx b1
   iff
      for b3 being Element of NAT
            st b3 in dom b1
         holds b2 *(b3,b3) = b1 . b3;

:: ENTROPY1:th 25
theorem
for b1 being FinSequence of REAL
for b2 being tabular FinSequence of REAL * holds
      b2 = Vec2DiagMx b1
   iff
      len b2 = len b1 &
       width b2 = len b1 &
       (for b3 being Element of NAT
             st b3 in dom b2
          holds Line(b2,b3) has_onlyone_value_in b3 & (Line(b2,b3)) . b3 = b1 . b3);

:: ENTROPY1:th 26
theorem
for b1 being FinSequence of REAL
for b2, b3 being tabular FinSequence of REAL *
      st len b1 = len b2
   holds    b3 = (Vec2DiagMx b1) * b2
   iff
      len b3 = len b1 &
       width b3 = width b2 &
       (for b4, b5 being Element of NAT
             st [b4,b5] in Indices b3
          holds b3 *(b4,b5) = (b1 . b4) * (b2 *(b4,b5)));

:: ENTROPY1:th 27
theorem
for b1 being FinSequence of REAL
for b2, b3 being tabular FinSequence of REAL *
      st len b1 = len b2
   holds    b3 = (Vec2DiagMx b1) * b2
   iff
      len b3 = len b1 &
       width b3 = width b2 &
       (for b4 being Element of NAT
             st b4 in dom b3
          holds Line(b3,b4) = (b1 . b4) * Line(b2,b4));

:: ENTROPY1:th 28
theorem
for b1 being ProbFinS FinSequence of REAL
for b2 being non empty-yielding tabular Conditional_Probability FinSequence of REAL *
      st len b1 = len b2
   holds (Vec2DiagMx b1) * b2 is Joint_Probability;

:: ENTROPY1:th 29
theorem
for b1 being non empty set
for b2 being tabular FinSequence of b1 *
for b3 being FinSequence of b1 *
   st len b3 = len b2 &
      b3 . 1 = b2 . 1 &
      (for b4 being Element of NAT
            st 1 <= b4 & b4 < len b2
         holds b3 . (b4 + 1) = (b3 . b4) ^ (b2 . (b4 + 1)))
for b4 being Element of NAT
      st b4 in dom b3
   holds len (b3 . b4) = b4 * width b2;

:: ENTROPY1:th 30
theorem
for b1 being non empty set
for b2 being tabular FinSequence of b1 *
for b3 being FinSequence of b1 *
   st len b3 = len b2 &
      b3 . 1 = b2 . 1 &
      (for b4 being Element of NAT
            st 1 <= b4 & b4 < len b2
         holds b3 . (b4 + 1) = (b3 . b4) ^ (b2 . (b4 + 1)))
for b4, b5 being Element of NAT
      st b4 in dom b3 & b5 in dom b3 & b4 <= b5
   holds dom (b3 . b4) c= dom (b3 . b5);

:: ENTROPY1:th 31
theorem
for b1 being non empty set
for b2 being tabular FinSequence of b1 *
for b3 being FinSequence of b1 *
      st len b3 = len b2 &
         b3 . 1 = b2 . 1 &
         (for b4 being Element of NAT
               st 1 <= b4 & b4 < len b2
            holds b3 . (b4 + 1) = (b3 . b4) ^ (b2 . (b4 + 1)))
   holds len (b3 . 1) = width b2 &
    (for b4 being Element of NAT
          st [1,b4] in Indices b2
       holds b4 in dom (b3 . 1) & (b3 . 1) . b4 = b2 *(1,b4));

:: ENTROPY1:th 32
theorem
for b1 being non empty set
for b2 being tabular FinSequence of b1 *
for b3 being FinSequence of b1 *
   st len b3 = len b2 &
      b3 . 1 = b2 . 1 &
      (for b4 being Element of NAT
            st 1 <= b4 & b4 < len b2
         holds b3 . (b4 + 1) = (b3 . b4) ^ (b2 . (b4 + 1)))
for b4 being Element of NAT
   st 1 <= b4 & b4 < len b3
for b5 being Element of NAT
      st b5 in dom (b3 . b4)
   holds (b3 . b4) . b5 = (b3 . (b4 + 1)) . b5;

:: ENTROPY1:th 33
theorem
for b1 being non empty set
for b2 being tabular FinSequence of b1 *
for b3 being FinSequence of b1 *
   st len b3 = len b2 &
      b3 . 1 = b2 . 1 &
      (for b4 being Element of NAT
            st 1 <= b4 & b4 < len b2
         holds b3 . (b4 + 1) = (b3 . b4) ^ (b2 . (b4 + 1)))
for b4, b5 being Element of NAT
   st b4 in dom b3 & b5 in dom b3 & b4 <= b5
for b6 being Element of NAT
      st b6 in dom (b3 . b4)
   holds (b3 . b4) . b6 = (b3 . b5) . b6;

:: ENTROPY1:th 34
theorem
for b1 being non empty set
for b2 being tabular FinSequence of b1 *
for b3 being FinSequence of b1 *
   st len b3 = len b2 &
      b3 . 1 = b2 . 1 &
      (for b4 being Element of NAT
            st 1 <= b4 & b4 < len b2
         holds b3 . (b4 + 1) = (b3 . b4) ^ (b2 . (b4 + 1)))
for b4 being Element of NAT
   st 1 <= b4 & b4 < len b3
for b5 being Element of NAT
      st b5 in Seg width b2
   holds (b4 * width b2) + b5 in dom (b3 . (b4 + 1)) &
    (b3 . (b4 + 1)) . ((b4 * width b2) + b5) = (b2 . (b4 + 1)) . b5;

:: ENTROPY1:th 35
theorem
for b1 being non empty set
for b2 being tabular FinSequence of b1 *
for b3 being FinSequence of b1 *
   st len b3 = len b2 &
      b3 . 1 = b2 . 1 &
      (for b4 being Element of NAT
            st 1 <= b4 & b4 < len b2
         holds b3 . (b4 + 1) = (b3 . b4) ^ (b2 . (b4 + 1)))
for b4, b5 being Element of NAT
      st [b4,b5] in Indices b2
   holds ((b4 - 1) * width b2) + b5 in dom (b3 . b4) &
    b2 *(b4,b5) = (b3 . b4) . (((b4 - 1) * width b2) + b5);

:: ENTROPY1:th 36
theorem
for b1 being non empty set
for b2 being tabular FinSequence of b1 *
for b3 being FinSequence of b1 *
   st len b3 = len b2 &
      b3 . 1 = b2 . 1 &
      (for b4 being Element of NAT
            st 1 <= b4 & b4 < len b2
         holds b3 . (b4 + 1) = (b3 . b4) ^ (b2 . (b4 + 1)))
for b4, b5 being Element of NAT
      st [b4,b5] in Indices b2
   holds ((b4 - 1) * width b2) + b5 in dom (b3 . len b2) &
    b2 *(b4,b5) = (b3 . len b2) . (((b4 - 1) * width b2) + b5);

:: ENTROPY1:th 37
theorem
for b1 being tabular FinSequence of REAL *
for b2 being FinSequence of REAL *
   st len b2 = len b1 &
      b2 . 1 = b1 . 1 &
      (for b3 being Element of NAT
            st 1 <= b3 & b3 < len b1
         holds b2 . (b3 + 1) = (b2 . b3) ^ (b1 . (b3 + 1)))
for b3 being Element of NAT
      st 1 <= b3 & b3 < len b1
   holds Sum (b2 . (b3 + 1)) = (Sum (b2 . b3)) + Sum (b1 . (b3 + 1));

:: ENTROPY1:th 38
theorem
for b1 being tabular FinSequence of REAL *
for b2 being FinSequence of REAL *
      st len b2 = len b1 &
         b2 . 1 = b1 . 1 &
         (for b3 being Element of NAT
               st 1 <= b3 & b3 < len b1
            holds b2 . (b3 + 1) = (b2 . b3) ^ (b1 . (b3 + 1)))
   holds SumAll b1 = Sum (b2 . len b1);

:: ENTROPY1:funcnot 2 => ENTROPY1:func 2
definition
  let a1 be non empty set;
  let a2 be tabular FinSequence of a1 *;
  func Mx2FinS A2 -> FinSequence of a1 means
    it = {}
    if len a2 = 0
    otherwise ex b1 being FinSequence of a1 * st
       it = b1 . len a2 &
        len b1 = len a2 &
        b1 . 1 = a2 . 1 &
        (for b2 being Element of NAT
              st 1 <= b2 & b2 < len a2
           holds b1 . (b2 + 1) = (b1 . b2) ^ (a2 . (b2 + 1)));
end;

:: ENTROPY1:def 5
theorem
for b1 being non empty set
for b2 being tabular FinSequence of b1 *
for b3 being FinSequence of b1 holds
   (len b2 = 0 implies    (b3 = Mx2FinS b2
    iff
       b3 = {})) &
    (len b2 = 0 or    (b3 = Mx2FinS b2
    iff
       ex b4 being FinSequence of b1 * st
          b3 = b4 . len b2 &
           len b4 = len b2 &
           b4 . 1 = b2 . 1 &
           (for b5 being Element of NAT
                 st 1 <= b5 & b5 < len b2
              holds b4 . (b5 + 1) = (b4 . b5) ^ (b2 . (b5 + 1)))));

:: ENTROPY1:th 39
theorem
for b1 being non empty set
for b2 being tabular FinSequence of b1 * holds
   len Mx2FinS b2 = (len b2) * width b2;

:: ENTROPY1:th 40
theorem
for b1 being non empty set
for b2 being tabular FinSequence of b1 *
for b3, b4 being Element of NAT
      st [b3,b4] in Indices b2
   holds ((b3 - 1) * width b2) + b4 in dom Mx2FinS b2 &
    b2 *(b3,b4) = (Mx2FinS b2) . (((b3 - 1) * width b2) + b4);

:: ENTROPY1:th 41
theorem
for b1 being non empty set
for b2 being tabular FinSequence of b1 *
for b3, b4 being Element of NAT
      st b3 in dom Mx2FinS b2 & b4 = b3 - 1
   holds [(b4 div width b2) + 1,(b4 mod width b2) + 1] in Indices b2 &
    (Mx2FinS b2) . b3 = b2 *((b4 div width b2) + 1,(b4 mod width b2) + 1);

:: ENTROPY1:th 42
theorem
for b1 being tabular FinSequence of REAL * holds
   SumAll b1 = Sum Mx2FinS b1;

:: ENTROPY1:th 43
theorem
for b1 being tabular FinSequence of REAL * holds
      b1 is m-nonnegative
   iff
      Mx2FinS b1 is nonnegative-yielding;

:: ENTROPY1:th 44
theorem
for b1 being tabular FinSequence of REAL * holds
      b1 is Joint_Probability
   iff
      Mx2FinS b1 is ProbFinS;

:: ENTROPY1:th 45
theorem
for b1, b2 being ProbFinS FinSequence of REAL holds
Mx2FinS ((ColVec2Mx b1) * LineVec2Mx b2) is ProbFinS;

:: ENTROPY1:th 46
theorem
for b1 being ProbFinS FinSequence of REAL
for b2 being non empty-yielding tabular Conditional_Probability FinSequence of REAL *
      st len b1 = len b2
   holds Mx2FinS ((Vec2DiagMx b1) * b2) is ProbFinS;

:: ENTROPY1:funcnot 3 => ENTROPY1:func 3
definition
  let a1 be Element of REAL;
  let a2 be FinSequence of REAL;
  assume 0 < a1 & a1 <> 1 & a2 is nonnegative-yielding;
  func FinSeq_log(A1,A2) -> FinSequence of REAL means
    len it = len a2 &
     (for b1 being natural set
           st b1 in dom it
        holds (a2 . b1 <= 0 or it . b1 = log(a1,a2 . b1)) &
         (a2 . b1 = 0 implies it . b1 = 0));
end;

:: ENTROPY1:def 6
theorem
for b1 being Element of REAL
for b2 being FinSequence of REAL
   st 0 < b1 & b1 <> 1 & b2 is nonnegative-yielding
for b3 being FinSequence of REAL holds
      b3 = FinSeq_log(b1,b2)
   iff
      len b3 = len b2 &
       (for b4 being natural set
             st b4 in dom b3
          holds (b2 . b4 <= 0 or b3 . b4 = log(b1,b2 . b4)) &
           (b2 . b4 = 0 implies b3 . b4 = 0));

:: ENTROPY1:funcnot 4 => ENTROPY1:func 4
definition
  let a1 be FinSequence of REAL;
  func Infor_FinSeq_of A1 -> FinSequence of REAL equals
    mlt(a1,FinSeq_log(2,a1));
end;

:: ENTROPY1:def 7
theorem
for b1 being FinSequence of REAL holds
   Infor_FinSeq_of b1 = mlt(b1,FinSeq_log(2,b1));

:: ENTROPY1:th 47
theorem
for b1 being nonnegative-yielding FinSequence of REAL
for b2 being FinSequence of REAL holds
      b2 = Infor_FinSeq_of b1
   iff
      len b2 = len b1 &
       (for b3 being Element of NAT
             st b3 in dom b2
          holds b2 . b3 = (b1 . b3) * log(2,b1 . b3));

:: ENTROPY1:th 48
theorem
for b1 being nonnegative-yielding FinSequence of REAL
for b2 being Element of NAT
      st b2 in dom b1
   holds (b1 . b2 = 0 implies (Infor_FinSeq_of b1) . b2 = 0) &
    (b1 . b2 <= 0 or (Infor_FinSeq_of b1) . b2 = (b1 . b2) * log(2,b1 . b2));

:: ENTROPY1:th 49
theorem
for b1 being nonnegative-yielding FinSequence of REAL
for b2 being FinSequence of REAL holds
      b2 = - Infor_FinSeq_of b1
   iff
      len b2 = len b1 &
       (for b3 being Element of NAT
             st b3 in dom b2
          holds b2 . b3 = (b1 . b3) * log(2,1 / (b1 . b3)));

:: ENTROPY1:th 50
theorem
for b1, b2 being Element of REAL
for b3 being nonnegative-yielding FinSequence of REAL
   st 0 <= b1 & 0 <= b2
for b4 being Element of NAT
      st b4 in dom b3 & b3 . b4 = b1 * b2
   holds (Infor_FinSeq_of b3) . b4 = ((b1 * b2) * log(2,b1)) + ((b1 * b2) * log(2,b2));

:: ENTROPY1:th 51
theorem
for b1 being Element of REAL
for b2 being nonnegative-yielding FinSequence of REAL
      st 0 <= b1
   holds Infor_FinSeq_of (b1 * b2) = ((b1 * log(2,b1)) * b2) + (b1 * mlt(b2,FinSeq_log(2,b2)));

:: ENTROPY1:th 52
theorem
for b1 being non empty ProbFinS FinSequence of REAL
for b2 being Element of NAT
      st b2 in dom b1
   holds (Infor_FinSeq_of b1) . b2 <= 0;

:: ENTROPY1:funcnot 5 => ENTROPY1:func 5
definition
  let a1 be tabular FinSequence of REAL *;
  assume a1 is m-nonnegative;
  func Infor_FinSeq_of A1 -> tabular FinSequence of REAL * means
    len it = len a1 &
     width it = width a1 &
     (for b1 being Element of NAT
           st b1 in dom it
        holds it . b1 = mlt(Line(a1,b1),FinSeq_log(2,Line(a1,b1))));
end;

:: ENTROPY1:def 8
theorem
for b1 being tabular FinSequence of REAL *
   st b1 is m-nonnegative
for b2 being tabular FinSequence of REAL * holds
      b2 = Infor_FinSeq_of b1
   iff
      len b2 = len b1 &
       width b2 = width b1 &
       (for b3 being Element of NAT
             st b3 in dom b2
          holds b2 . b3 = mlt(Line(b1,b3),FinSeq_log(2,Line(b1,b3))));

:: ENTROPY1:th 53
theorem
for b1 being tabular m-nonnegative FinSequence of REAL *
for b2 being Element of NAT
      st b2 in dom b1
   holds Line(Infor_FinSeq_of b1,b2) = Infor_FinSeq_of Line(b1,b2);

:: ENTROPY1:th 54
theorem
for b1 being tabular m-nonnegative FinSequence of REAL *
for b2 being tabular FinSequence of REAL * holds
      b2 = Infor_FinSeq_of b1
   iff
      len b2 = len b1 &
       width b2 = width b1 &
       (for b3, b4 being Element of NAT
             st [b3,b4] in Indices b2
          holds b2 *(b3,b4) = (b1 *(b3,b4)) * log(2,b1 *(b3,b4)));

:: ENTROPY1:funcnot 6 => ENTROPY1:func 6
definition
  let a1 be FinSequence of REAL;
  func Entropy A1 -> Element of REAL equals
    - Sum Infor_FinSeq_of a1;
end;

:: ENTROPY1:def 9
theorem
for b1 being FinSequence of REAL holds
   Entropy b1 = - Sum Infor_FinSeq_of b1;

:: ENTROPY1:th 55
theorem
for b1 being non empty ProbFinS FinSequence of REAL holds
   0 <= Entropy b1;

:: ENTROPY1:th 56
theorem
for b1 being non empty ProbFinS FinSequence of REAL
      st ex b2 being Element of NAT st
           b2 in dom b1 & b1 . b2 = 1
   holds Entropy b1 = 0;

:: ENTROPY1:th 57
theorem
for b1, b2 being non empty ProbFinS FinSequence of REAL
for b3, b4 being FinSequence of REAL
      st len b1 = len b2 &
         len b3 = len b1 &
         len b4 = len b2 &
         (for b5 being Element of NAT
               st b5 in dom b1
            holds 0 < b1 . b5 &
             0 < b2 . b5 &
             b3 . b5 = - ((b1 . b5) * log(2,b1 . b5)) &
             b4 . b5 = - ((b1 . b5) * log(2,b2 . b5)))
   holds Sum b3 <= Sum b4 &
    (for b5 being Element of NAT
          st b5 in dom b1
       holds b1 . b5 = b2 . b5 implies Sum b3 = Sum b4) &
    (Sum b3 = Sum b4 implies for b5 being Element of NAT
          st b5 in dom b1
       holds b1 . b5 = b2 . b5) &
    (ex b5 being Element of NAT st
       b5 in dom b1 & b1 . b5 <> b2 . b5 implies Sum b3 < Sum b4) &
    (Sum b3 < Sum b4 implies ex b5 being Element of NAT st
       b5 in dom b1 & b1 . b5 <> b2 . b5);

:: ENTROPY1:th 58
theorem
for b1 being non empty ProbFinS FinSequence of REAL
      st for b2 being Element of NAT
              st b2 in dom b1
           holds 0 < b1 . b2
   holds Entropy b1 <= log(2,len b1) &
    (for b2 being Element of NAT
          st b2 in dom b1
       holds b1 . b2 = 1 / len b1 implies Entropy b1 = log(2,len b1)) &
    (Entropy b1 = log(2,len b1) implies for b2 being Element of NAT
          st b2 in dom b1
       holds b1 . b2 = 1 / len b1) &
    (ex b2 being Element of NAT st
       b2 in dom b1 & b1 . b2 <> 1 / len b1 implies Entropy b1 < log(2,len b1)) &
    (Entropy b1 < log(2,len b1) implies ex b2 being Element of NAT st
       b2 in dom b1 & b1 . b2 <> 1 / len b1);

:: ENTROPY1:th 59
theorem
for b1 being tabular m-nonnegative FinSequence of REAL * holds
   Mx2FinS Infor_FinSeq_of b1 = Infor_FinSeq_of Mx2FinS b1;

:: ENTROPY1:th 60
theorem
for b1, b2 being ProbFinS FinSequence of REAL
for b3 being tabular FinSequence of REAL *
      st b3 = (ColVec2Mx b1) * LineVec2Mx b2
   holds SumAll Infor_FinSeq_of b3 = (Sum Infor_FinSeq_of b1) + Sum Infor_FinSeq_of b2;

:: ENTROPY1:funcnot 7 => ENTROPY1:func 7
definition
  let a1 be tabular FinSequence of REAL *;
  func Entropy_of_Joint_Prob A1 -> Element of REAL equals
    Entropy Mx2FinS a1;
end;

:: ENTROPY1:def 10
theorem
for b1 being tabular FinSequence of REAL * holds
   Entropy_of_Joint_Prob b1 = Entropy Mx2FinS b1;

:: ENTROPY1:th 61
theorem
for b1, b2 being ProbFinS FinSequence of REAL holds
Entropy_of_Joint_Prob ((ColVec2Mx b1) * LineVec2Mx b2) = (Entropy b1) + Entropy b2;

:: ENTROPY1:funcnot 8 => ENTROPY1:func 8
definition
  let a1 be tabular FinSequence of REAL *;
  func Entropy_of_Cond_Prob A1 -> FinSequence of REAL means
    len it = len a1 &
     (for b1 being Element of NAT
           st b1 in dom it
        holds it . b1 = Entropy Line(a1,b1));
end;

:: ENTROPY1:def 11
theorem
for b1 being tabular FinSequence of REAL *
for b2 being FinSequence of REAL holds
      b2 = Entropy_of_Cond_Prob b1
   iff
      len b2 = len b1 &
       (for b3 being Element of NAT
             st b3 in dom b2
          holds b2 . b3 = Entropy Line(b1,b3));

:: ENTROPY1:th 62
theorem
for b1 being non empty-yielding tabular Conditional_Probability FinSequence of REAL *
for b2 being FinSequence of REAL holds
      b2 = Entropy_of_Cond_Prob b1
   iff
      len b2 = len b1 &
       (for b3 being Element of NAT
             st b3 in dom b2
          holds b2 . b3 = - Sum ((Infor_FinSeq_of b1) . b3));

:: ENTROPY1:th 63
theorem
for b1 being non empty-yielding tabular Conditional_Probability FinSequence of REAL * holds
   Entropy_of_Cond_Prob b1 = - Sum Infor_FinSeq_of b1;

:: ENTROPY1:th 64
theorem
for b1 being ProbFinS FinSequence of REAL
for b2 being non empty-yielding tabular Conditional_Probability FinSequence of REAL *
   st len b1 = len b2
for b3 being tabular FinSequence of REAL *
      st b3 = (Vec2DiagMx b1) * b2
   holds SumAll Infor_FinSeq_of b3 = (Sum Infor_FinSeq_of b1) + Sum mlt(b1,Sum Infor_FinSeq_of b2);

:: ENTROPY1:th 65
theorem
for b1 being ProbFinS FinSequence of REAL
for b2 being non empty-yielding tabular Conditional_Probability FinSequence of REAL *
      st len b1 = len b2
   holds Entropy_of_Joint_Prob ((Vec2DiagMx b1) * b2) = (Entropy b1) + Sum mlt(b1,Entropy_of_Cond_Prob b2);