reserve x, x1, x2, y, X, D for set,
  i, j, k, l, m, n, N for Nat,
  p, q for XFinSequence of NAT,
  q9 for XFinSequence,
  pd, qd for XFinSequence of D;

theorem Th2:
  p is dominated_by_0 implies 2*Sum (p|k) <= k
proof
  assume
A1: p is dominated_by_0;
  now
    per cases;
    suppose
      k <= dom p;
      hence thesis by A1;
    end;
    suppose
A2:   k > dom p;
      then Segm len p c= Segm k by NAT_1:39;
      then
A3:   p|k=p by RELAT_1:68;
      2 * Sum (p|(len p)) <= dom p & p|(len p)=p by A1;
      hence thesis by A2,A3,XXREAL_0:2;
    end;
  end;
  hence thesis;
end;
