reserve X for set;
reserve n,i for Element of NAT;
reserve a,b,c,d,e,r,x0 for Real;
reserve A for non empty closed_interval Subset of REAL;
reserve f,g,h for PartFunc of REAL,REAL n;
reserve E for Element of REAL n;

theorem Th32:
  (a<=b & f is_integrable_on ['a,b'] &
  f| ['a,b'] is bounded & ['a,b'] c= dom f & c in ['a,b'] &
  d in ['a,b'] & for x be Real st x in ['min(c,d),max(c,d)']
  holds |. f/.x .| <= e)
  implies |. integral(f,c,d) .| <= n*e * |.d-c.|
  proof
    assume A1: a<=b & f is_integrable_on ['a,b']  &
    f| ['a,b'] is bounded & ['a,b'] c= dom f & c in ['a,b'] &
    d in ['a,b'] & for x be Real st x in ['min(c,d),max(c,d)']
    holds |. f/.x .| <= e;
A2: now let i; set P = proj(i,n);
      assume A3: i in Seg n;
      dom P = REAL n by FUNCT_2:def 1;
      then rng f c= dom P;
      then
A4:   ['a,b'] c= dom (P*f) by A1,RELAT_1:27;
      set f1= P*f;
A5:   for x be Real st x in ['min(c,d),max(c,d)'] holds
      |. (P*f).x .| <= e
      proof
        let x be Real;
        assume A6: x in ['min(c,d),max(c,d)'];
        ['min(c,d),max(c,d)'] c= ['a,b'] by A1,Lm2;
        then
A7:     x in dom (P*f) by A4,A6;
        then
A8:     x in dom f by FUNCT_1:11;
A9:     |. f/.x .| <= e by A1,A6;
A10:    (P*f).x = P.(f.x) by A7,FUNCT_1:12
        .=P.(f/.x) by A8,PARTFUN1:def 6;
        1 <= i & i <= n by A3,FINSEQ_1:1;
        then |. P.(f/.x) .| <= |. f/.x .| by PDIFF_8:5;
        hence |. (P*f).x .| <= e by A10,A9,XXREAL_0:2;
      end;
A11:  f1 is_integrable_on ['a,b'] by A1,A3;
A12:  P*(f| ['a,b']) is bounded by A1,A3;
      (P*f) | ['a,b'] = P*(f| ['a,b']) by RELAT_1:83;
      hence |. integral (f1,c,d) .| <= e *|.d-c.| by A12,A1,A4,A5,A11,Lm4;
    end;
    now let i; set P = proj(i,n);
      assume 1 <=i & i <= n;
      then
A13:  i in Seg n;
      then |. integral ((P*f),c,d) .| <= e *|.d-c.|  by A2;
      hence |.(integral(f,c,d)).i .| <= e *|.d-c.| by A13,INTEGR15:def 18;
    end;
    then |. integral (f,c,d) .| <= n*(e *|.d-c.|) by PDIFF_8:15;
    hence thesis;
  end;
