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 Th53:
  qe is one-to-one & rng qe c= rng pe & W is_weight>=0of G implies
  cost(qe,W) <= cost(pe,W)
proof
  set D=the carrier' of G;
  assume that
A1: qe is one-to-one & rng qe c= rng pe and
A2: W is_weight>=0of G;
  defpred P[Nat] means for p, q being FinSequence of D st q is one-to-one &
  rng q c= rng p & len q = $1 holds cost(q,W) <= cost(p,W);
A3: for k being Nat st P[k] holds P[k + 1]
  proof
    let k be Nat;
    assume
A4: P[k];
    now
      let p, q be FinSequence of D;
      assume that
A5:   q is one-to-one and
A6:   rng q c= rng p and
A7:   len q = k+1;
      consider q1 being FinSequence, x being object such that
A8:   q = q1^<*x*> by A7,FINSEQ_2:18;
A9:   k+1= len q1 +1 by A7,A8,FINSEQ_2:16;
      consider p1,p2 being FinSequence such that
A10:  p=p1^<*x*>^p2 and
A11:  rng q1 c= rng (p1^p2) by A5,A6,A8,Th7;
      reconsider q1 as FinSequence of D by A8,FINSEQ_1:36;
A12:  p1^<*x*> is FinSequence of D by A10,FINSEQ_1:36;
      then reconsider y=<*x*> as FinSequence of D by FINSEQ_1:36;
      reconsider p2 as FinSequence of D by A10,FINSEQ_1:36;
      reconsider p1 as FinSequence of D by A12,FINSEQ_1:36;
      q1 is one-to-one by A5,A8,FINSEQ_3:91;
      then
A13:  cost(q1,W) <= cost(p1^p2,W) by A4,A11,A9;
A14:  cost(q,W)=cost(q1,W)+cost(y,W) by A2,A8,Th44,Th52;
      cost(p,W)=cost(p1^y,W)+cost(p2,W) by A2,A10,Th44,Th52
        .=cost(p1,W)+cost(y,W)+cost(p2,W) by A2,Th44,Th52
        .=cost(p1,W)+cost(p2,W)+cost(y,W)
        .=cost(p1^p2,W)+cost(y,W) by A2,Th44,Th52;
      hence cost(q,W) <= cost(p,W) by A14,A13,XREAL_1:7;
    end;
    hence thesis;
  end;
A15: P[0]
  proof
    let p, q be FinSequence of D;
    assume that
    q is one-to-one and
    rng q c= rng p and
A16: len q = 0;
    q = {} by A16;
    then cost(q,W) = 0 by A2,Th44,Th49;
    hence thesis by A2,Th48;
  end;
  for k being Nat holds P[k] from NAT_1:sch 2(A15,A3);
  then P[len qe];
  hence thesis by A1;
end;
