reserve a,b,c for positive Real,
  m,x,y,z for Real,
  n for Nat,
  s,s1,s2,s3,s4,s5 for Real_Sequence;

theorem :: Cauchy Inequality
  s3=s1(#)s2 & s4=s1(#)s1 & s5=s2(#)s2 implies for n holds ((
  Partial_Sums s3).n)^2<=(Partial_Sums s4).n*(Partial_Sums s5).n
proof
  assume that
A1: s3=s1(#)s2 and
A2: s4=s1(#)s1 and
A3: s5=s2(#)s2;
  let n;
A4: (Partial_Sums s3).0 =s3.0 by SERIES_1:def 1
    .=s1.0 * s2.0 by A1,SEQ_1:8;
  defpred X[Nat] means ((Partial_Sums s3).$1)^2<=(Partial_Sums s4).
  $1* (Partial_Sums s5).$1;
A5: for n st X[n] holds X[n+1]
  proof
    let n;
    set u=(Partial_Sums s3).n;
    set v=(Partial_Sums s4).n;
    set w=(Partial_Sums s5).n;
    set h=s1.(n+1);
    set j=s2.(n+1);
    assume
A6: ((Partial_Sums s3).n)^2<=(Partial_Sums s4).n*(Partial_Sums s5).n;
    then |.u.|<=sqrt(v*w) by Lm7;
    then
A7: (2*(|.j.|*|.h.|))*sqrt(v*w)>=(2*(|.j.|*|.h.|))*|.u.| by XREAL_1:64;
A8: w>=0 by A3,Th36;
    then
A9: w=(sqrt w)^2 by SQUARE_1:def 2;
    ((sqrt v)*j)^2+((sqrt w)*h)^2>=2*|.(sqrt v)*j.|*|.(sqrt w)*h.| by Th8;
    then ((sqrt v)*j)^2+((sqrt w)*h)^2>=2*(|.sqrt v.|*|.j.|)*|.(sqrt w)*h.|
    by COMPLEX1:65;
    then
A10: ((sqrt v)*j)^2+((sqrt w)*h)^2>=2*(|.sqrt v.|*|.j.|) *(|.(sqrt w).|*
    |.h.|) by COMPLEX1:65;
A11: v>=0 by A2,Th36;
    then sqrt v>=0 by SQUARE_1:def 2;
    then
A12: ((sqrt v)*j)^2+((sqrt w)*h)^2>=2*(sqrt v*|.j.|)*(|.(sqrt w).|*|.h.|)
    by A10,ABSVALUE:def 1;
    sqrt w>=0 by A8,SQUARE_1:def 2;
    then ((sqrt v)*j)^2+((sqrt w)*h)^2>=2*(sqrt v*|.j.|)*((sqrt w)*|.h.|) by
A12,ABSVALUE:def 1;
    then
A13: ((sqrt v)*j)^2+((sqrt(w))*h)^2>=2*(sqrt v*(sqrt(w)))*|.j.|*|.h.|;
    v=(sqrt(v))^2 by A11,SQUARE_1:def 2;
    then v*j^2+w*h^2>=2*(sqrt(v*w))*|.j.|*|.h.| by A11,A8,A9,A13,SQUARE_1:29;
    then v*j^2+w*h^2>=2*(|.u.|*|.j.|)*|.h.| by A7,XXREAL_0:2;
    then v*j^2+w*h^2>=2*(|.u*j.|)*|.h.| by COMPLEX1:65;
    then v*j^2+w*h^2>=2*((|.u*j.|)*|.h.|);
    then
A14: v*j^2+w*h^2>=2*|.u*j*h.| by COMPLEX1:65;
    2*|.u*j*h.|>=2*(u*j*h) by ABSVALUE:4,XREAL_1:64;
    then v*j^2+w*h^2>=2*u*j*h by A14,XXREAL_0:2;
    then
A15: v*j^2+w*h^2-2*u*j*h>=0 by XREAL_1:48;
    v*w-u^2>=0 by A6,XREAL_1:48;
    then
A16: v*w-u^2+(v*j^2+w*h^2-2*u*j*h)>=0 by A15;
    ((Partial_Sums(s3)).(n+1))=u+s3.(n+1) by SERIES_1:def 1;
    then ((Partial_Sums(s3)).(n+1))=u+h*s2.(n+1) by A1,SEQ_1:8;
    then
A17: ((Partial_Sums(s3)).(n+1))^2 =u^2+2*u*(h*j)+(h*j)^2;
    (Partial_Sums(s4)).(n+1)*(Partial_Sums(s5)).(n+1)= ((Partial_Sums(s4)
    ).n+s4.(n+1))*(Partial_Sums(s5)).(n+1) by SERIES_1:def 1;
    then
    (Partial_Sums(s4)).(n+1)*(Partial_Sums(s5)).(n+1)= (v+s4.(n+1))*(w+s5
    .(n+1)) by SERIES_1:def 1
      .=(v+h*h)*(w+s5.(n+1)) by A2,SEQ_1:8
      .=(v+h*h)*(w+s2.(n+1)*s2.(n+1)) by A3,SEQ_1:8
      .=v*w+v*j^2+w*h^2+h^2*j^2;
    then
    (Partial_Sums s4).(n+1)*(Partial_Sums(s5)).(n+1)- ((Partial_Sums s3).
    (n+1))^2 =v*w-u^2+v*j^2+w*h^2+h^2*j^2-2*u*(h*j)-(h*j)^2 by A17
      .=v*w-u^2+v*j^2+w*h^2-2*u*h*j;
    then
    (Partial_Sums s4).(n+1)*(Partial_Sums s5).(n+1)- ((Partial_Sums s3).(
    n+1))^2+((Partial_Sums s3).(n+1))^2>= 0+((Partial_Sums s3).(n+1))^2 by A16,
XREAL_1:6;
    hence thesis;
  end;
  (Partial_Sums s4).0*(Partial_Sums(s5)).0 =(s4.0)*(Partial_Sums(s5)).0 by
SERIES_1:def 1
    .=(s4.0)*(s5.0) by SERIES_1:def 1
    .=(s1.0)*(s1.0)*(s5.0) by A2,SEQ_1:8
    .=(s1.0)^2*(s2.0)^2 by A3,SEQ_1:8;
  then
A18: X[0] by A4;
  for n holds X[n] from NAT_1:sch 2(A18,A5);
  hence thesis;
end;
