reserve a, b, p, q for Real;

theorem Th7:
  for p be Real st 1 < p
  for a,b,ap,bp,ab be Real_Sequence st ( for
n be Nat holds ap.n=|.a.n.| to_power p & bp.n=|.b.n.| to_power p &
  ab.n=|.a.n+b.n.| to_power p ) holds for n be Nat holds (
Partial_Sums(ab).n) to_power (1/p) <= ( Partial_Sums(ap).n) to_power (1/p) + (
  Partial_Sums(bp).n) to_power (1/p)
proof
  let p be Real such that
A1: 1 < p;
A2: 1/p > 0 by A1,XREAL_1:139;
  let a,b,ap,bp,ab be Real_Sequence such that
A3: for n be Nat holds ap.n=|.a.n.| to_power p & bp.n=|.b.
  n.| to_power p & ab.n=|.a.n+ b.n.| to_power p;
A4: for n be Nat holds 0 <= ap.n
  proof
    let n be Nat;
A5: ap.n=|.a.n.| to_power p by A3;
    now
      per cases by COMPLEX1:46;
      case
        |.a.n.| = 0;
        hence thesis by A1,A5,POWER:def 2;
      end;
      case
        |.a.n.| > 0;
        hence thesis by A5,POWER:34;
      end;
    end;
    hence thesis;
  end;
A6: for n be Nat holds 0 <= bp.n
  proof
    let n be Nat;
A7: bp.n=|.b.n.| to_power p by A3;
    now
      per cases by COMPLEX1:46;
      case
        |.b.n.| = 0;
        hence thesis by A1,A7,POWER:def 2;
      end;
      case
        |.b.n.| > 0;
        hence thesis by A7,POWER:34;
      end;
    end;
    hence thesis;
  end;
  deffunc F(Nat)=|.a.$1+ b.$1.| to_power (p-1);
  consider x be Real_Sequence such that
A8: for n be Nat holds x.n=F(n) from SEQ_1:sch 1;
A9: 1-1 < p-1 by A1,XREAL_1:14;
A10: for n be Nat holds 0 <= x.n
  proof
    let n be Nat;
A11: x.n=|.a.n+ b.n.| to_power (p-1) by A8;
    now
      per cases by COMPLEX1:46;
      case
        |.a.n+ b.n.| = 0;
        hence thesis by A9,A11,POWER:def 2;
      end;
      case
        |.a.n+ b.n.| > 0;
        hence thesis by A11,POWER:34;
      end;
    end;
    hence thesis;
  end;
A12: for n be Nat holds (x(#)abs(b)).n= |.b.n*x.n.|
  proof
    let n be Nat;
    0 <= x.n by A10;
    then
A13: |.x.n.|=x.n by ABSVALUE:def 1;
    thus (x(#)abs(b)).n =x.n * abs(b).n by SEQ_1:8
      .=x.n * |.b.n.| by SEQ_1:12
      .=|.b.n*x.n.| by A13,COMPLEX1:65;
  end;
  reconsider pp=1/p as Real;
  reconsider qq=1-pp as Real;
  reconsider q=1/qq as Real;
A14: qq=1/q by XCMPLX_1:56;
  then
A15: 1/p + 1/q= 1;
  1/p < 1 by A1,XREAL_1:189;
  then
A16: 1-1 < 1-pp by XREAL_1:15;
  then
A17: q <> 0 by A14;
  then ((1*q+1*p)/(p*q))*(p*q) =1*(p*q) by A1,A15,XCMPLX_1:116;
  then
A18: q+p=p*q by A1,A17,XCMPLX_1:6,87;
A19: for n be Nat holds ab.n=x.n*|.a.n+b.n.|
  proof
    let n be Nat;
    now
      per cases;
      case
A20:    |.a.n+b.n.|=0;
        thus ab.n=|.a.n+ b.n.| to_power p by A3
          .= x.n * |.a.n+b.n.| by A1,A20,POWER:def 2;
      end;
      case
A21:    |.a.n+b.n.| <> 0;
A22:    0 <= |.a.n+b.n.| by COMPLEX1:46;
        thus ab.n =|.a.n+ b.n.| to_power ((p-1)+1) by A3
          .= |.a.n+ b.n.| to_power (p-1) * |.a.n+ b.n.| to_power 1 by A21,A22
,POWER:27
          .=(|.a.n+ b.n.| to_power (p-1)) * |.a.n+ b.n.| by POWER:25
          .= x.n * |.a.n+b.n.| by A8;
      end;
    end;
    hence thesis;
  end;
A23: for n be Nat holds ab.n <= ( x(#)abs(a)+x(#)abs(b) ).n
  proof
    let n be Nat;
A24: x.n * (|.a.n.|+|.b.n.|) = x.n * (|.a.n.|)+x.n * (|.b.n.|)
      .= x.n * (abs(a).n)+x.n * (|.b.n.|) by SEQ_1:12
      .= x.n * (abs(a).n)+x.n * (abs(b).n) by SEQ_1:12
      .= (x(#)abs(a)).n +x.n * (abs(b).n) by SEQ_1:8
      .= (x(#)abs(a)).n +(x(#)abs(b)).n by SEQ_1:8
      .= (x(#)abs(a) +x(#)abs(b)).n by SEQ_1:7;
    0 <= x.n & ab.n=x.n*|.a.n+b.n.| by A10,A19;
    hence thesis by A24,COMPLEX1:56,XREAL_1:64;
  end;
A25: 0 < q by A16,A14;
A26: for n be Nat holds |.x.n.| to_power q = ab.n
  proof
    let n be Nat;
    0 <= x.n by A10;
    then |.x.n.|=x.n by ABSVALUE:def 1;
    then
A27: |.x.n.| to_power q = (|.a.n+b.n.| to_power (p-1)) to_power q by A8;
    now
      per cases;
      case
A28:    |.a.n+b.n.|=0;
        then
A29:    ab.n = 0 to_power p by A3
          .= 0 by A1,POWER:def 2;
        |.x.n.| to_power q =0 to_power q by A9,A27,A28,POWER:def 2
          .=0 by A25,POWER:def 2;
        hence thesis by A29;
      end;
      case
        |.a.n+b.n.| <> 0;
        then 0 < |.a.n+b.n.| by COMPLEX1:46;
        hence |.x.n.| to_power q = |.a.n+b.n.| to_power ((p-1)*q) by A27,
POWER:33
          .=ab.n by A3,A18;
      end;
    end;
    hence thesis;
  end;
A30: for n be Nat holds (x(#)abs(a)).n= |.a.n*x.n.|
  proof
    let n be Nat;
    0 <= x.n by A10;
    then
A31: |.x.n.|=x.n by ABSVALUE:def 1;
    thus (x(#)abs(a)).n =x.n * abs(a).n by SEQ_1:8
      .=x.n * |.a.n.| by SEQ_1:12
      .=|.a.n*x.n.| by A31,COMPLEX1:65;
  end;
A32: for n be Nat holds Partial_Sums(ab).n <= ( ((Partial_Sums(ap
).n) to_power (1/p)) + ((Partial_Sums(bp).n) to_power (1/p))) * ( (Partial_Sums
  (ab).n) to_power (1/q) )
  proof
    let n be Nat;
A33: (Partial_Sums(x(#)abs(a)+x(#)abs(b))).n =(Partial_Sums(x(#)abs(a))+
    Partial_Sums(x(#)abs(b))).n by SERIES_1:5
      .=Partial_Sums(x(#)abs(a)).n+Partial_Sums(x(#)abs(b)).n by SEQ_1:7;
    Partial_Sums(x(#)abs(a)).n <= ( (Partial_Sums(ap).n) to_power (1/p) )
* ( ( Partial_Sums(ab).n) to_power (1/q) ) & Partial_Sums(x(#)abs(b)).n <= ( (
Partial_Sums(bp).n) to_power (1/p) ) * ( (Partial_Sums(ab).n) to_power (1/q) )
    by A1,A3,A15,A30,A12,A26,Th6;
    then
A34: Partial_Sums(x(#)abs(a)).n + Partial_Sums(x(#)abs(b)).n <= ( (
Partial_Sums(ap).n) to_power (1/p) ) * ( (Partial_Sums(ab).n) to_power (1/q) )
+ ( (Partial_Sums(bp).n) to_power (1/p) ) * ( (Partial_Sums(ab).n) to_power (1/
    q) ) by XREAL_1:7;
    Partial_Sums(ab).n <= Partial_Sums(x(#)abs(a)+x(#)abs(b)).n by A23,
SERIES_1:14;
    hence thesis by A33,A34,XXREAL_0:2;
  end;
A35: for n be Nat holds 0 <= ab.n
  proof
    let n be Nat;
    0 <= |.a.n+b.n.| by COMPLEX1:46;
    then
A36: 0 to_power p <= |.a.n+b.n.| to_power p by A1,Th3;
    ab.n=|.a.n+b.n.| to_power p by A3;
    hence thesis by A1,A36,POWER:def 2;
  end;
  now
    let n be Nat;
    set A=Partial_Sums(ab).n;
    set C= ( ((Partial_Sums(ap).n) to_power (1/p)) + ((Partial_Sums(bp).n)
    to_power (1/p)));
    set D= ( A to_power (1/q) );
A37: 0 <= A by A35,Lm2;
    0 <= Partial_Sums(bp).n by A6,Lm2;
    then 0 to_power (1/p) <= (Partial_Sums(bp).n) to_power (1/p) by A2,Th3;
    then
A38: 0 <= (Partial_Sums(bp).n) to_power (1/p) by A2,POWER:def 2;
    0 <= Partial_Sums(ap).n by A4,Lm2;
    then 0 to_power (1/p) <= (Partial_Sums(ap).n) to_power (1/p) by A2,Th3;
    then 0 <= (Partial_Sums(ap).n) to_power (1/p) by A2,POWER:def 2;
    then
A39: 0+0 <= (Partial_Sums(ap).n) to_power (1/p) + (Partial_Sums(bp).n)
    to_power (1/p) by A38;
    now
      per cases;
      case
        A=0;
        hence A to_power (1/p) <= C by A2,A39,POWER:def 2;
      end;
      case
A40:    A<>0;
        set B=1/D;
A41:    0 < D by A37,A40,POWER:34;
        then
A42:    0 < B by XREAL_1:139;
A43:    C*D*B = C* (D *B) .= C*1 by A41,XCMPLX_1:87
          .= C;
        A *B =A/D by XCMPLX_1:99
          .=(A to_power 1) / D by POWER:25
          .=A to_power (1-(1/q)) by A37,A40,POWER:29
          .= A to_power (1/p) by A14;
        hence A to_power (1/p) <= (Partial_Sums(ap).n) to_power (1/p) + (
        Partial_Sums(bp).n) to_power (1/p) by A32,A42,A43,XREAL_1:64;
      end;
    end;
    hence (Partial_Sums(ab).n) to_power (1/p) <= (Partial_Sums(ap).n) to_power
    (1/p) + (Partial_Sums(bp).n) to_power (1/p);
  end;
  hence thesis;
end;
