reserve i,n,m for Nat;

theorem Th5:
for f1,f2 be PartFunc of REAL m,REAL n,
    g1,g2 be PartFunc of REAL-NS m,REAL-NS n st
 f1 = g1 & f2 = g2 holds f1 - f2 = g1 - g2
proof
   let f1,f2 be PartFunc of REAL m,REAL n,
       g1,g2 be PartFunc of REAL-NS m,REAL-NS n;
   assume
A1: f1 = g1 & f2 = g2;
   the carrier of REAL-NS m = REAL m &
   the carrier of REAL-NS n = REAL n by REAL_NS1:def 4; then
   reconsider g12 = g1 - g2 as PartFunc of REAL m,REAL n;
A2: dom f1 /\ dom f2 = dom g12 by A1,VFUNCT_1:def 2;
A3: f1<-->f2 = f1-f2 by INTEGR15:def 10;
   for c be object st c in dom g12 holds (g1-g2).c = f1.c - f2.c
   proof
    let c be object;
    assume
A4: c in dom g12;
    then
A5: c in dom (g1-g2);
    c in dom f1 & c in dom f2 by A2,A4,XBOOLE_0:def 4;
    then
A6: f1/.c = f1.c & f2/.c = f2.c by PARTFUN1:def 6;
A7:f1/.c = g1/.c & f2/.c = g2/.c by A1,REAL_NS1:def 4;
    g12.c = (g1 - g2)/.c by A4,PARTFUN1:def 6
    .= g1/.c - g2/.c by A5,VFUNCT_1:def 2;
    hence thesis by A6,A7,REAL_NS1:5;
   end;
   hence thesis by A2,A3,VALUED_2:def 46;
end;
