
theorem NF520:
  for a being non empty FinSequence of REAL,
  Alg being Function of [:REAL, NAT*:],NAT,
  h being non empty FinSequence of NAT* st
  h = OnlinePackingHistory(a, Alg) holds
  (for i being Nat st 1 <= i & i < len a holds
  h . (i + 1) = (h . i) ^ <* Alg . (a . (i + 1), h . i) *> &
  (h . (i + 1)) . (i + 1) =  Alg . (a . (i + 1), h . i))
  proof
    let a be non empty FinSequence of REAL,
        Alg be Function of [:REAL, NAT*:],NAT,
        h be non empty FinSequence of NAT*;

    assume L00: h = OnlinePackingHistory(a, Alg);

    let i be Nat;

    assume L10: 1 <= i & i < len a;

    consider d1 being Element of REAL, d2 being FinSequence of NAT
    such that
    L20: d1 = a . (i + 1) & d2 = h . i and
    L30: h . (i + 1) = d2 ^ <* Alg . (d1, d2) *> by L00,L10,defPackHistory;

    thus h . (i + 1) = (h . i) ^ <* Alg . (a . (i + 1), h . i) *>
    by L20,L30;

    len (h . i) = i by L00,L10,NF510;
    hence (h . (i + 1)) . (i + 1) = Alg . (a . (i + 1), h . i)
    by L20,L30,FINSEQ_1:42;
  end;
