reserve n,m,i,j,k for Nat,
  x,y,e,X,V,U for set,
  W,f,g for Function;
reserve p,q for FinSequence;
reserve G for Graph,
  pe,qe for FinSequence of the carrier' of G;
reserve v,v1,v2,v3 for Element of G;
reserve p,q for oriented Chain of G;

theorem Th52:
  W is_weight_of G implies cost(pe^qe,W) = cost(pe,W) + cost(qe,W)
proof
  set r=pe^qe, f=RealSequence(pe^qe,W), g=RealSequence(pe,W), h=RealSequence(
  qe,W);
  assume
A1: W is_weight_of G;
  then
A2: dom pe = dom g by Def15;
  then
A3: len pe = len g by FINSEQ_3:29;
A4: dom qe = dom h by A1,Def15;
  then
A5: len qe = len h by FINSEQ_3:29;
A6: dom r = dom f by A1,Def15;
  then len f = len r by FINSEQ_3:29;
  then
A7: len f =len g + len h by A3,A5,FINSEQ_1:22;
A8: now
    let i be Nat;
    assume
A9: i in dom h;
    then 1 <= i by FINSEQ_3:25;
    then
A10: 1 <= len g +i by NAT_1:12;
    i <= len h by A9,FINSEQ_3:25;
    then len g +i <= len f by A7,XREAL_1:7;
    then
A11: len g + i in dom f by A10,FINSEQ_3:25;
    h.i=W.(qe.i) & r.(len g +i) = qe.i by A1,A4,A3,A9,Def15,FINSEQ_1:def 7;
    hence f.(len g +i) = h.i by A1,A6,A11,Def15;
  end;
  now
    let i be Nat;
    assume
A12: i in dom g;
    then i <= len g by FINSEQ_3:25;
    then
A13: i <= len f by A7,NAT_1:12;
    1 <= i by A12,FINSEQ_3:25;
    then
A14: i in dom f by A13,FINSEQ_3:25;
    g.i=W.(pe.i) & r.i = pe.i by A1,A2,A12,Def15,FINSEQ_1:def 7;
    hence f.i = g.i by A1,A6,A14,Def15;
  end;
  then f=g^h by A7,A8,FINSEQ_3:38;
  hence thesis by RVSUM_1:75;
end;
