theorem
  f is nonnegative implies f|Y is nonnegative
proof
  assume f is nonnegative;
  then
A1: rng f is nonnegative;
  now
    let y be ExtReal;
    assume y in rng(f|Y);
    then consider x be object such that
A2: x in dom(f|Y) and
A3: (f|Y).x = y by FUNCT_1:def 3;
    x in dom f /\ Y by A2,RELAT_1:61;
    then
A4: x in dom f by XBOOLE_0:def 4;
    (f|Y).x = f.x by A2,FUNCT_1:47;
    then (f|Y).x in rng f by A4,FUNCT_1:3;
    hence 0. <= y by A1,A3;
  end;
  then rng(f|Y) is nonnegative;
  hence thesis;
end;
