
theorem NF890:
  for a being non empty positive at_most_one FinSequence of REAL,
  h being non empty FinSequence of NAT* st
  h = OnlinePackingHistory(a, NextFit(a)) holds
  for i, j being Nat st 1 <= i & i <= len a & j in rng (h . i) holds
  SumBin (a, h . i, {j}) <= 1
  proof
    let a be non empty positive at_most_one FinSequence of REAL,
    h be non empty FinSequence of NAT*;

    assume that HN00: h = OnlinePackingHistory(a, NextFit(a));

    defpred P[Nat] means
    for j being Nat st j in rng (h . $1) holds SumBin (a, h . $1, {j}) <= 1;

    for j being Nat st j in rng (h . 1) holds SumBin (a, h . 1, {j}) <= 1
    proof
      let j be Nat;

      assume FF000: j in rng (h . 1);

      FF005: 1 <= len a by NAT_1:14;

      h . 1 = {[1, 1]} by HN00,defPackHistory;
      then rng (h . 1) = {1} by RELAT_1:9;
      then FF020: j = 1 by FF000,TARSKI:def 1;

      h . 1 = <* 1 *> by HN00,defPackHistory;
      then (h . 1) . 1 = 1;

      hence SumBin (a, h . 1, {j}) <= 1 by FF005,HN00,NF880,FF020;
    end;
    then F1: P[1];

    F2: for i0 being Element of NAT st 1 <= i0 & i0 < len a & P[i0]
    holds P[i0 + 1]
    proof
      let i0 be Element of NAT;

      assume that
      F21: 1 <= i0 & i0 < len a and
      F22: P[i0];

      set i0p = i0 + 1;

      F26: i0p <= len a by F21,INT_1:7;

      for j being Nat st j in rng (h . i0p) holds SumBin (a, h . i0p, {j}) <= 1
      proof
        let j be Nat;

        assume I00: j in rng (h . i0p);

        rng (h . i0p) = rng (h . i0) \/ {(h . i0p) . i0p} by HN00,F21,NF525;
        then rng (h . i0p) =
        (rng (h . i0) \ {(h . i0p) . i0p}) \/ {(h . i0p) . i0p} by XBOOLE_1:39;
        then per cases by I00,XBOOLE_0:def 3;
        suppose IA00: j in (rng (h . i0) \ {(h . i0p) . i0p});
          IA05: j <> (h . i0p) . i0p by IA00,ZFMISC_1:56;

          IA09: h . i0p = (h . i0) ^ <* (NextFit(a)) . (a . i0p, h . i0) *> &
          (h . i0p) . i0p = (NextFit(a)) . (a . i0p, h . i0) by HN00,F21,NF520;

          set f = h . i0;

          IA35: f is FinSequence of NAT by HN00,F21,NF505;

          IA36: h . i0p is FinSequence of NAT by HN00,XREAL_1:31,F26,NF505;

          set b = (h . i0p) . i0p;

          SumBin (a, h . i0p, {j}) = SumBin (a, f, {j})
          by IA09,IA05,IA35,IA36,NF110;
          hence SumBin (a, h . i0p, {j}) <= 1 by IA00,F22;
        end;
        suppose j in {(h . i0p) . i0p};
          then j = (h . i0p) . i0p by TARSKI:def 1;
          hence SumBin (a, h . i0p, {j}) <= 1 by HN00,XREAL_1:31,F26,NF880;
        end;
      end;
      hence thesis;
    end;

    L900: for i being Element of NAT st 1 <= i & i <= len a holds P[i]
    from INT_1:sch 7(F1,F2);

    thus for i, j being Nat st 1 <= i & i <= len a & j in rng (h . i) holds
    SumBin (a, h . i, {j}) <= 1
    proof
      let i, j be Nat;

      assume that
      L910: 1 <= i & i <= len a and
      L912: j in rng (h . i);

      i in NAT by ORDINAL1:def 12;
      hence SumBin (a, h . i, {j}) <= 1 by L910,L900,L912;
    end;
  end;
