reserve n,m for Nat,
  r,r1,r2,s,t for Real,
  x,y for set;

theorem Th78:
  for D be non empty set, F,G be PartFunc of D,REAL, X be set, Y
being finite set st Y = dom(F|X) & dom(F|X) = dom(G|X) holds Sum(F+G,X) = Sum(F
  ,X) + Sum(G,X)
proof
  let D be non empty set;
  let F,G be PartFunc of D,REAL, X be set, Y be finite set such that
A1: Y = dom(F|X);
  defpred P[Nat] means for F,G be PartFunc of D,REAL, X be set, Y
being finite set st card(Y) = $1 & Y = dom(F|X) & dom(F|X) = dom(G|X) holds Sum
  (F+G,X) = Sum(F,X) + Sum(G,X);
A2: card(Y)=card(Y);
A3: for n st P[n] holds P[n+1]
  proof
    let n;
    assume
A4: P[n];
    let F,G be PartFunc of D,REAL, X be set, dx be finite set;
    set gx = dom(G|X);
    assume that
A5: card(dx) = n+1 and
A6: dx = dom(F|X) and
A7: dom(F|X) = dom(G|X);
    set x = the Element of dx;
    reconsider x as Element of D by A5,A6,CARD_1:27,TARSKI:def 3;
A8: dx=dom F /\ X by A6,RELAT_1:61;
    then
A9: x in dom F by A5,CARD_1:27,XBOOLE_0:def 4;
    set Y = X\{x}, dy = dom(F|Y), gy = dom(G|Y);
A10: gx=dom G /\ X by RELAT_1:61;
    then x in dom G by A5,A6,A7,CARD_1:27,XBOOLE_0:def 4;
    then x in dom F /\ dom G by A9,XBOOLE_0:def 4;
    then
A11: x in dom(F+G) by VALUED_1:def 1;
A12: dy=dom F /\ Y by RELAT_1:61;
A13: dy = dx \ {x}
    proof
      thus dy c= dx \ {x}
      proof
        let y be object;
        assume
A14:    y in dy;
        then y in X \ {x} by A12,XBOOLE_0:def 4;
        then
A15:    not y in {x} by XBOOLE_0:def 5;
        y in dom F by A12,A14,XBOOLE_0:def 4;
        then y in dx by A12,A8,A14,XBOOLE_0:def 4;
        hence thesis by A15,XBOOLE_0:def 5;
      end;
      let y be object;
      assume
A16:  y in dx \{x};
      then ( not y in {x})& y in X by A8,XBOOLE_0:def 4,def 5;
      then
A17:  y in Y by XBOOLE_0:def 5;
      y in dom F by A8,A16,XBOOLE_0:def 4;
      hence thesis by A12,A17,XBOOLE_0:def 4;
    end;
    then reconsider dy as finite set;
A18: gy= dom G /\ Y by RELAT_1:61;
A19: dy = gy
    proof
      thus dy c= gy
      proof
        let y be object;
        assume
A20:    y in dy;
        then y in dom F by A12,XBOOLE_0:def 4;
        then y in gx by A6,A7,A12,A8,A20,XBOOLE_0:def 4;
        then
A21:    y in dom G by A10,XBOOLE_0:def 4;
        y in Y by A12,A20,XBOOLE_0:def 4;
        hence thesis by A18,A21,XBOOLE_0:def 4;
      end;
      let y be object;
      assume
A22:  y in gy;
      then y in dom G by A18,XBOOLE_0:def 4;
      then y in dx by A6,A7,A18,A10,A22,XBOOLE_0:def 4;
      then
A23:  y in dom F by A8,XBOOLE_0:def 4;
      y in Y by A18,A22,XBOOLE_0:def 4;
      hence thesis by A12,A23,XBOOLE_0:def 4;
    end;
    {x} c= dx by A5,CARD_1:27,ZFMISC_1:31;
    then card(dy) = card(dx) - card {x} by A13,CARD_2:44
      .=n+1-1 by A5,CARD_1:30
      .= n;
    then
A24: Sum(F+G,Y) = Sum(F,Y) + Sum(G,Y) by A4,A19;
A25: dom((F+G)|X) = dom(F|X + G|X) by RFUNCT_1:44
      .= dx /\ gx by A6,VALUED_1:def 1;
    then
A26: FinS(F+G,X), (F+G)|X are_fiberwise_equipotent by Def13;
    x in X by A5,A8,CARD_1:27,XBOOLE_0:def 4;
    then x in dom(F+G) /\ X by A11,XBOOLE_0:def 4;
    then x in dom ((F+G)|X) by RELAT_1:61;
    then
A27: FinS(F+G,Y)^<*(F+G).x*>, (F+G)|X are_fiberwise_equipotent by A25,Th66;
    reconsider Fx = <*F.x*>, Gx = <*G.x*>, FGx = <*(F+G).x*>
      as FinSequence of REAL by RVSUM_1:145;
    FinS(F,Y)^<*F.x*>, F|X are_fiberwise_equipotent & FinS(F,X), F|X
    are_fiberwise_equipotent by A5,A6,Def13,Th66,CARD_1:27;
    then
A28: Sum(F,X) = Sum (FinS(F,Y) ^ Fx) by CLASSES1:76,RFINSEQ:9
      .= Sum(F,Y) + F.x by RVSUM_1:74;
    FinS(G,Y)^<*G.x*>, G|X are_fiberwise_equipotent & FinS(G,X), G|X
    are_fiberwise_equipotent by A5,A6,A7,Def13,Th66,CARD_1:27;
    then Sum(G,X) = Sum (FinS(G,Y)^Gx) by CLASSES1:76,RFINSEQ:9
      .= Sum(G,Y) + G.x by RVSUM_1:74;
    hence Sum(F,X)+ Sum(G,X) = Sum FinS(F+G,Y) + (F.x + G.x) by A24,A28
      .= Sum FinS(F+G,Y) + (F+G).x by A11,VALUED_1:def 1
      .= Sum(FinS(F+G,Y)^FGx) by RVSUM_1:74
      .= Sum(F+G,X) by A27,A26,CLASSES1:76,RFINSEQ:9;
  end;
A29: P[ 0 ]
  proof
    let F,G be PartFunc of D,REAL, X be set, Y be finite set;
    assume that
A30: card(Y) = 0 and
A31: Y = dom(F|X) and
A32: dom(F|X) = dom(G|X);
    dom(F|X) = {} by A30,A31;
    then
A33: rng(F|X) = {} by RELAT_1:42;
    (F+G)|X = F|X + G|X by RFUNCT_1:44;
    then dom((F+G)|X) = dom(F|X) /\ dom(G|X) by VALUED_1:def 1
      .= {} by A30,A31,A32;
    then
    rng ((F+G)|X) = {} & FinS(F+G,X), (F+G)|X are_fiberwise_equipotent by Def13
,RELAT_1:42;
    then
A34: rng FinS(F+G,X) = {} by CLASSES1:75;
    FinS(F,X), F|X are_fiberwise_equipotent by A31,Def13;
    then rng FinS(F,X) = {} by A33,CLASSES1:75;
    then
A35: Sum(F,X) = 0 by RELAT_1:41,RVSUM_1:72;
    dom(G|X) = {} by A30,A31,A32;
    then
A36: rng(G|X) = {} by RELAT_1:42;
    FinS(G,X), G|X are_fiberwise_equipotent by A31,A32,Def13;
    then rng FinS(G,X) = {} by A36,CLASSES1:75;
    then Sum(F,X) + Sum(G,X) = 0+0 by A35,RELAT_1:41,RVSUM_1:72;
    hence thesis by A34,RELAT_1:41,RVSUM_1:72;
  end;
A37: for n holds P[n] from NAT_1:sch 2(A29,A3);
  assume dom(F|X) = dom(G|X);
  hence thesis by A1,A37,A2;
end;
