reserve Z for set;

theorem
  for n be Element of NAT for r be Real
  for A be non empty closed_interval Subset
of REAL for f be PartFunc of REAL, REAL n st A c= dom f & f is_integrable_on A
  & f|A is bounded holds r(#)f is_integrable_on A & integral( (r(#)f) ,A) = r*
  integral(f,A)
proof
  let n be Element of NAT;
  let r be Real;
  let A be non empty closed_interval Subset of REAL;
  let f be PartFunc of REAL, REAL n;
  assume that
A1: A c= dom f and
A2: f is_integrable_on A and
A3: f|A is bounded;
A4: now
    let i be Element of NAT;
    dom proj(i,n) = REAL n by FUNCT_2:def 1;
    then rng f c= dom proj(i,n);
    hence A c= dom (proj(i,n)*f) by A1,RELAT_1:27;
  end;
A5: for i be Element of NAT st i in Seg n holds integral(r(#)(proj(i,n)*f),
  A)=r*integral((proj(i,n)*f), A)
  proof
    let i be Element of NAT;
    assume
A6: i in Seg n;
    (proj(i,n)*f)|A = proj(i,n)*(f|A) by Lm6;
    then
A7: (proj(i,n)*f)|A is bounded by A3,A6;
A8: A c= dom (proj(i,n)*f) by A4;
    (proj(i,n)*f) is_integrable_on A by A2,A6;
    hence thesis by A7,A8,INTEGRA6:9;
  end;
A9: for i be Element of NAT st i in Seg n holds (r*integral(f,A)).i = r*
  integral((proj(i,n)*f ),A)
  proof
    let i be Element of NAT;
    assume i in Seg n;
    then r*integral(f,A).i = r*integral((proj(i,n)*f ),A) by Def17;
    hence thesis by RVSUM_1:45;
  end;
A10: for i be Element of NAT st i in Seg n holds integral((r(#)f), A).i = (r*
  integral(f,A)).i
  proof
    let i be Element of NAT;
A11: integral(r(#)(proj(i,n)*f),A)=integral((proj(i,n)*(r(#)f)),A) by Th16;
    assume
A12: i in Seg n;
    then
    integral((r(#)f),A).i = integral((proj(i,n)*(r(#)f)),A) & (r*integral
    (f,A)).i = r*integral((proj(i,n)*f ),A) by A9,Def17;
    hence thesis by A5,A12,A11;
  end;
  for i be Element of NAT st i in Seg n holds (proj(i,n)*(r(#)f) )
  is_integrable_on A
  proof
    let i be Element of NAT;
    assume
A13: i in Seg n;
    (proj(i,n)*f)|A = proj(i,n)*(f|A) by Lm6;
    then
A14: (proj(i,n)*f)|A is bounded by A3,A13;
A15: A c= dom (proj(i,n)*f) by A4;
    (proj(i,n)*f ) is_integrable_on A by A2,A13;
    then r(#)(proj(i,n)*f ) is_integrable_on A by A14,A15,INTEGRA6:9;
    hence thesis by Th16;
  end;
  hence r(#)f is_integrable_on A;
A16: dom(integral((r(#)f),A)) = Seg n by FINSEQ_1:89;
  then dom(integral((r(#)f),A)) = dom(r*integral(f,A)) by FINSEQ_1:89;
  hence thesis by A10,A16,PARTFUN1:5;
end;
