reserve x,X,Y for set;
reserve g,r,r1,r2,p,p1,p2 for Real;
reserve R for Subset of REAL;
reserve seq,seq1,seq2,seq3 for Real_Sequence;
reserve Ns for increasing sequence of NAT;
reserve n for Nat;
reserve W for non empty set;
reserve h,h1,h2 for PartFunc of W,REAL;
reserve e1,e2 for ExtReal;
reserve h,h1,h2 for PartFunc of REAL,REAL;

theorem
  (h|Y is decreasing & 0<r implies (r(#)h)|Y is decreasing) & (h|Y is
  decreasing & r<0 implies (r(#)h)|Y is increasing)
proof
  thus h|Y is decreasing & 0<r implies (r(#)h)|Y is decreasing
  proof
    assume that
A1: h|Y is decreasing and
A2: 0<r;
    now
      let r1,r2;
      assume that
A3:   r1 in Y /\ dom(r(#)h) and
A4:   r2 in Y /\ dom(r(#) h) and
A5:   r1<r2;
A6:   r2 in Y by A4,XBOOLE_0:def 4;
A7:   r2 in dom (r(#) h) by A4,XBOOLE_0:def 4;
      then r2 in dom h by VALUED_1:def 5;
      then
A8:   r2 in Y /\ dom h by A6,XBOOLE_0:def 4;
A9:   r1 in Y by A3,XBOOLE_0:def 4;
A10:  r1 in dom (r(#)h) by A3,XBOOLE_0:def 4;
      then r1 in dom h by VALUED_1:def 5;
      then r1 in Y /\ dom h by A9,XBOOLE_0:def 4;
      then h.r2 < h.r1 by A1,A5,A8,Th21;
      then r * h.r2 < r * h.r1 by A2,XREAL_1:68;
      then (r(#)h).r2 < r * h.r1 by A7,VALUED_1:def 5;
      hence (r(#)h).r2 < (r(#)h).r1 by A10,VALUED_1:def 5;
    end;
    hence thesis by Th21;
  end;
  assume that
A11: h|Y is decreasing and
A12: r<0;
  now
    let r1,r2;
    assume that
A13: r1 in Y /\ dom(r(#)h) and
A14: r2 in Y /\ dom(r(#) h) and
A15: r1<r2;
A16: r2 in Y by A14,XBOOLE_0:def 4;
A17: r2 in dom (r(#) h) by A14,XBOOLE_0:def 4;
    then r2 in dom h by VALUED_1:def 5;
    then
A18: r2 in Y /\ dom h by A16,XBOOLE_0:def 4;
A19: r1 in Y by A13,XBOOLE_0:def 4;
A20: r1 in dom (r(#)h) by A13,XBOOLE_0:def 4;
    then r1 in dom h by VALUED_1:def 5;
    then r1 in Y /\ dom h by A19,XBOOLE_0:def 4;
    then h.r2 < h.r1 by A11,A15,A18,Th21;
    then r* h.r1 < r* h.r2 by A12,XREAL_1:69;
    then (r(#) h).r1 < r* h.r2 by A20,VALUED_1:def 5;
    hence (r(#) h).r1 < (r(#) h).r2 by A17,VALUED_1:def 5;
  end;
  hence thesis by Th20;
end;
