reserve S,T,W,Y for RealNormSpace;
reserve f,f1,f2 for PartFunc of S,T;
reserve Z for Subset of S;
reserve i,n for Nat;

theorem
  for G be RealNormSpace-Sequence,
  F be RealNormSpace,
  i be set,
  f,g be PartFunc of product G,F,
  X be Subset of product G
  st X is open & i in dom G &
  f is_partial_differentiable_on X,i &
  g is_partial_differentiable_on X,i holds
  f-g is_partial_differentiable_on X,i &
  (f-g) `partial|(X,i) = f `partial|(X,i)- g `partial|(X,i)
  proof
    let G be RealNormSpace-Sequence;
    let F be RealNormSpace;
    let i be set;
    let f,g be PartFunc of product G,F;
    let X be Subset of product G;
    assume that
    O1:X is open and
    A0: i in dom G and
    A1:f is_partial_differentiable_on X,i and
    A2:g is_partial_differentiable_on X,i;
    set h = f-g;
    dom h = (dom f) /\ (dom g) by VFUNCT_1:def 2;
    then
    D1: X c= dom h by A1,A2,XBOOLE_1:19;
    X1: for x be Point of product G st x in X holds
    h is_partial_differentiable_in x,i &
    partdiff(h,x,i) = partdiff(f,x,i) - partdiff(g,x,i)
    proof
      let x be Point of product G;
      assume P5: x in X; then
      P6: f is_partial_differentiable_in x,i by A1,O1,NDIFF_5:24;
      g is_partial_differentiable_in x,i by A2,O1,P5,NDIFF_5:24;
      hence thesis by A0,NDIFF_5:29,P6;
    end; then
    for x be Point of product G st x in X holds
    h is_partial_differentiable_in x,i;
    hence P7:h is_partial_differentiable_on X,i by NDIFF_5:24,D1,O1;
    set fp = f`partial|(X,i);
    set gp = g`partial|(X,i);
    P8: dom fp = X &
    for x be Point of product G st x in X
    holds fp/.x = partdiff(f,x,i) by A1,NDIFF_5:def 9;
    P9: dom gp = X &
    for x be Point of product G st x in X
    holds gp/.x = partdiff(g,x,i) by A2,NDIFF_5:def 9;
    P10: dom (fp-gp) = X /\ X by P8,P9,VFUNCT_1:def 2
    .= X;
    for x be Point of product G st x in X
    holds (fp-gp)/.x = partdiff(h,x,i)
    proof
      let x be Point of product G;
      assume P11: x in X;
      Z1: fp/.x = partdiff(f,x,i) by A1,P11,NDIFF_5:def 9;
      thus (fp-gp)/.x = fp/.x - gp/.x by P11,P10,VFUNCT_1:def 2
      .= partdiff(f,x,i) - partdiff(g,x,i) by Z1,A2,P11,NDIFF_5:def 9
      .= partdiff(f-g,x,i) by P11,X1;
    end;
    hence thesis by P7,P10,NDIFF_5:def 9;
  end;
