reserve s1,s2,q1 for Real_Sequence;
reserve n for Element of NAT;
reserve a,b for Real;

theorem Th10:
for Y be RealNormSpace,
    p be FinSequence of Y,
    q be FinSequence of REAL st len p = len q
    & (for j be Nat st j in dom p holds ||. p/.j .|| <= q.j)
   holds ||. Sum(p) .|| <= Sum(q)
proof
  let Y be RealNormSpace;
  let p be FinSequence of Y, q be FinSequence of REAL;
  assume A1: len p = len q
   & (for j be Nat st j in dom p holds ||. p/.j .|| <= q.j);
  defpred P1[Nat,set] means
    ex v be Point of Y st v = p/.$1 & $2 = ||. v .||;
A2: for i be Nat st i in Seg len p ex x be Element of REAL st P1[i,x]
    proof
      let i be Nat;
      assume i in Seg len p;
      reconsider w = ||.p/.i.|| as Element of REAL;
      take w;
      thus thesis;
    end;
    consider u be FinSequence of REAL such that
A3:   dom u = Seg len p & for i be Nat st
    i in Seg len p holds P1[i,u.i] from FINSEQ_1:sch 5(A2);
A4: for i be Element of NAT st i in dom p holds
    ex v be Point of Y st v = p/.i & u.i = ||. v .||
    proof
      let i be Element of NAT;
      assume i in dom p; then
      i in Seg len p by FINSEQ_1:def 3;
      hence ex v be Point of Y st v = p/.i & u.i = ||. v .|| by A3;
    end;
A5: len u = len p by A3,FINSEQ_1:def 3; then
A6: ||.Sum p.|| <= Sum u by A4,Th9;
    set i = len p;
    reconsider uu=u as Element of i-tuples_on REAL by A5,FINSEQ_2:92;
    reconsider qq=q as Element of i-tuples_on REAL by A1,FINSEQ_2:92;
    now let j be Nat;
      assume j in Seg i; then
A7:  j in dom p by FINSEQ_1:def 3; then
      ex v be Point of Y st v = p/.j & u.j = ||. v .|| by A4;
      hence uu.j <= qq.j by A7,A1;
    end; then
    Sum uu <= Sum qq by RVSUM_1:82;
    hence thesis by A6,XXREAL_0:2;
  end;
