reserve n,m for Nat;
reserve x,X,X1 for set;
reserve s,g,r,p for Real;
reserve S,T for RealNormSpace;
reserve f,f1,f2 for PartFunc of S,T;
reserve s1,s2 for sequence of S;
reserve x0,x1,x2 for Point of S;
reserve Y for Subset of S;

theorem Th25:
  for X,f1,f2 st f1 is_continuous_on X & f2 is_continuous_on X
  holds f1+f2 is_continuous_on X & f1-f2 is_continuous_on X
proof
  let X,f1,f2;
  assume
A1: f1 is_continuous_on X & f2 is_continuous_on X;
  then X c= dom f1 & X c= dom f2;
  then
A2: X c= dom f1 /\ dom f2 by XBOOLE_1:19;
  then
A3: X c= dom (f1+f2) by VFUNCT_1:def 1;
  now
    let s1;
    assume that
A4: rng s1 c= X and
A5: s1 is convergent and
A6: lim s1 in X;
A7: f1/*s1 is convergent & f2/*s1 is convergent by A1,A4,A5,A6,Th18;
    then
A8: (f1/*s1)+(f2/*s1) is convergent by NORMSP_1:19;
A9: rng s1 c= dom f1 /\ dom f2 by A2,A4;
    f1/.(lim s1) = lim (f1/*s1) & f2/.(lim s1) = lim (f2/*s1) by A1,A4,A5,A6
,Th18;
    then (f1+f2)/.(lim s1) = lim (f1/*s1) + lim (f2/*s1) by A3,A6,
VFUNCT_1:def 1
      .= lim (f1/*s1 + f2/*s1) by A7,NORMSP_1:25
      .= lim ((f1+f2)/*s1) by A9,Th12;
    hence
    (f1+f2)/*s1 is convergent & (f1+f2)/.(lim s1)=lim((f1+f2)/*s1) by A9,A8
,Th12;
  end;
  hence f1+f2 is_continuous_on X by A3,Th18;
A10: X c= dom (f1-f2) by A2,VFUNCT_1:def 2;
  now
    let s1;
    assume that
A11: rng s1 c= X and
A12: s1 is convergent and
A13: lim s1 in X;
A14: f1/*s1 is convergent & f2/*s1 is convergent by A1,A11,A12,A13,Th18;
    then
A15: (f1/*s1)-(f2/*s1) is convergent by NORMSP_1:20;
A16: rng s1 c= dom f1 /\ dom f2 by A2,A11;
    f1/.(lim s1) = lim (f1/*s1) & f2/.(lim s1) = lim (f2/*s1) by A1,A11,A12,A13
,Th18;
    then (f1-f2)/.(lim s1) = lim (f1/*s1) - lim (f2/*s1) by A10,A13,
VFUNCT_1:def 2
      .= lim (f1/*s1 - f2/*s1) by A14,NORMSP_1:26
      .= lim ((f1-f2)/*s1) by A16,Th12;
    hence
    (f1-f2)/*s1 is convergent & (f1-f2)/.(lim s1)=lim((f1-f2)/*s1) by A16,A15
,Th12;
  end;
  hence thesis by A10,Th18;
end;
