reserve Z for set;

theorem
  for n be Element of NAT, A be non empty closed_interval Subset of REAL, f be
  PartFunc of REAL,REAL n, g be Function of A,REAL n st f|A = g holds f
  is_integrable_on A iff g is integrable
proof
  let n be Element of NAT, A be non empty closed_interval Subset of REAL,
  f be PartFunc
  of REAL,REAL n, g be Function of A,REAL n;
  assume
A1: f|A = g;
  thus f is_integrable_on A implies g is integrable
  proof
    assume
A2: f is_integrable_on A;
    for i be Element of NAT st i in Seg n holds (proj(i,n)*g) is integrable
    proof
      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));
      then
A3:   dom(proj(i,n)*f) = dom f by RELAT_1:27;
      A = dom g by FUNCT_2:def 1
        .= dom f /\ A by A1,RELAT_1:61;
      then (proj(i,n)*f)||A is total by A3,INTEGRA5:6,XBOOLE_1:17;
      then reconsider F = (proj(i,n)*f)|A as Function of A,REAL;
      assume i in Seg n;
      then (proj(i,n)*f) is_integrable_on A by A2;
      then F is integrable;
      hence thesis by A1,Lm6;
    end;
    hence thesis;
  end;
  assume
A4: g is integrable;
  for i be Element of NAT st i in Seg n holds (proj(i,n)*f) is_integrable_on A
  proof
    let i be Element of NAT;
    assume
A5: i in Seg n;
    proj(i,n)*g = (proj(i,n)*f)|A by A1,Lm6;
    then (proj(i,n)*f)||A is integrable by A4,A5;
    hence thesis;
  end;
  hence thesis;
end;
