 reserve a,b,r for Real;
 reserve A for non empty set;
 reserve X,x for set;
 reserve f,g,F,G for PartFunc of REAL,REAL;
 reserve n for Element of NAT;

theorem Th2:
  for a,b,c,d be Real,
      f be PartFunc of REAL,REAL
  st a <= b & c <= d
   & [.a,b.] c= dom f
   & c in [.a,b.] & d in [.a,b.]
   & f | ['a,b'] is continuous
   & for t be Real st t in [.c,d.] holds 0 <= f.t
  holds 0 <= integral(f,c,d)
proof
  let a,b,c,d be Real,
      f be PartFunc of REAL,REAL;
  assume
  A1: a <= b & c <= d
    & [.a,b.] c= dom f
    & c in [.a,b.] & d in [.a,b.]
    & f | ['a,b'] is continuous
    & for t be Real st t in [.c,d.] holds 0 <= f.t; then

  A2: ['a,b'] = [.a,b.] by INTEGRA5:def 3; then

  f | ['a,b'] is bounded & f is_integrable_on ['a,b']
    by A1,INTEGRA5:10,11; then
  A3: ['c,d'] c= dom (abs f)
    & abs f is_integrable_on ['c,d']
    & (abs f) | ['c,d'] is bounded
    & |.integral(f,c,d).| <= integral(abs f,c,d)
    & |.integral(f,d,c).| <= integral(abs f,c,d)
    by A1,A2,INTEGRA6:22;

  A5: dom((abs f) || ['c,d']) = ['c,d'] by A3,RELAT_1:62;
  A4: dom abs f = dom f by VALUED_1:def 11; then
  A6: dom(f || ['c,d']) = ['c,d'] by A3,RELAT_1:62;

  A7: for x be object st x in dom(f || ['c,d'])
      holds (f || ['c,d']).x = ((abs f) || ['c,d']).x
  proof
    let x be object;
    assume
    A8: x in dom (f || ['c,d']); then
    A9: (f || ['c,d']).x = f.x by FUNCT_1:47;
    x in dom f by A8,RELAT_1:57; then
    A10: x in dom(abs f) by VALUED_1:def 11;
    x in [.c,d.] by A1,A6,A8,INTEGRA5:def 3; then
    |.f.x.| = f.x by A1,COMPLEX1:43; then
    f.x = (abs f).x by A10,VALUED_1:def 11;
    hence thesis by A5,A8,A9,FUNCT_1:47;
  end;

  integral(abs f,c,d)
    = integral(abs f,['c,d']) by A1,INTEGRA5:def 4
  .= integral(f,['c,d']) by A3,A4,A5,A7,FUNCT_1:2,RELAT_1:62
  .= integral(f,c,d) by A1,INTEGRA5:def 4;
  hence 0 <= integral(f,c,d) by A3,COMPLEX1:46;
end;
