
theorem Th4:
  for p being natural-valued FinSequence, i being Nat st i in dom p
  holds Sum p >= p.i
proof
  let p be natural-valued FinSequence;
  let i be Nat;
A0: p is FinSequence of NAT by FINSEQ_1:103;
  defpred P[FinSequence of NAT] means for i be Element of NAT st i in dom $1
  holds Sum $1 >= $1.i;
A1: for p be FinSequence of NAT for x being Element of NAT st P[p] holds P[p
  ^<*x*>]
  proof
    let p be FinSequence of NAT qua set;
    let x be Element of NAT;
    assume
A2: for i be Element of NAT st i in dom p holds Sum p >= p.i;
    let i be Element of NAT;
A3: p.i + x >= p.i by NAT_1:11;
    len (p^<*x*>) = len p + 1 by FINSEQ_2:16;
    then
A4: dom (p^<*x*>) = Seg (len p + 1) by FINSEQ_1:def 3
      .= Seg len p \/ {len p + 1} by FINSEQ_1:9
      .= dom p \/ {len p + 1} by FINSEQ_1:def 3;
    assume
A5: i in dom (p^<*x*>);
    per cases by A5,A4,XBOOLE_0:def 3;
    suppose
A6:   i in dom p;
      then Sum p + x >= p.i + x by A2,XREAL_1:6;
      then Sum (p^<*x*>) >= p.i + x by RVSUM_1:74;
      then Sum (p^<*x*>) >= p.i by A3,XXREAL_0:2;
      hence thesis by A6,FINSEQ_1:def 7;
    end;
    suppose
      i in {len p + 1};
      then i = len p + 1 by TARSKI:def 1;
      then (p^<*x*>).i = x by FINSEQ_1:42;
      then Sum p + x >= (p^<*x*>).i by NAT_1:11;
      hence thesis by RVSUM_1:74;
    end;
  end;
A7: P[<*> NAT qua FinSequence of NAT];
  for p be FinSequence of NAT holds P[p] from FINSEQ_2:sch 2(A7,A1);
  hence thesis by A0;
end;
