
theorem Th9:
  for G being _finite real-weighted WGraph, EL being FF:ELabeling of
  G, source being Vertex of G, v being set holds v in dom AP:FindAugPath(EL,
  source) iff ex P being Path of G st P is_Walk_from source,v & P
  is_augmenting_wrt EL
proof
  let G be _finite real-weighted WGraph, EL be FF:ELabeling of G, source be
  Vertex of G, v be set;
  set CS = AP:CompSeq(EL,source), V = dom AP:FindAugPath(EL,source);
  hereby
    assume v in V;
    then ex P being Path of G st P is_augmenting_wrt EL & P is_Walk_from
    source,v & P.vertices() c= V by Th8;
    hence
    ex P being Path of G st P is_Walk_from source,v & P is_augmenting_wrt EL;
  end;
  given P being Path of G such that
A1: P is_Walk_from source,v and
A2: P is_augmenting_wrt EL;
  now
    P.(2*0+1) = source by A1,GLIB_001:17;
    then P.(2*0+1) in {source} by TARSKI:def 1;
    then
A3: P.(2*0+1) in dom (CS.0) by Th4;
    set Gn = CS.(CS.Lifespan()), Gn1 = CS.(CS.Lifespan()+1);
    defpred P[Nat] means $1 is odd & $1 <= len P & not P.$1 in V;
    assume
A4: not v in V;
    P.(len P) = v by A1,GLIB_001:17;
    then
A5: ex n being Nat st P[n] by A4;
    consider n being Nat such that
A6: P[n] & for k being Nat st P[k] holds n <= k from NAT_1:sch 5(A5);
    reconsider n9=n as odd Element of NAT by A6,ORDINAL1:def 12;
A7: 1 <= n by A6,ABIAN:12;
    dom (CS.0) c= V by Th5;
    then n <> 1 by A6,A3;
    then 1 < n by A7,XXREAL_0:1;
    then 1+1 <= n by NAT_1:13;
    then reconsider n2 = n9-2*1 as odd Element of NAT by INT_1:5;
A8: n2 < n - 0 by XREAL_1:15;
    then
A9: n2 < len P by A6,XXREAL_0:2;
    then
A10: P.n2 in V by A6,A8;
    set Next = AP:NextBestEdges(Gn), en = the Element of Next;
    AP:CompSeq(EL,source) is halting by Th6;
    then
A11: Gn = CS.(CS.Lifespan()+1) by GLIB_000:def 56;
    set e = P.(n2+1);
A12: P.(n2+2) = P.n;
    then
A13: e Joins P.n2, P.n, G by A9,GLIB_001:def 3;
A14: now
      per cases;
      suppose
A15:    e DJoins P.n2, P.n, G;
        then
A16:    (the_Source_of G).e in dom Gn by A10;
A17:    e in the_Edges_of G by A15;
A18:    not (the_Target_of G).e in dom Gn by A6,A15;
        (EL).e<(the_Weight_of G).e by A2,A9,A12,A15;
        then e is_forward_edge_wrt Gn by A17,A16,A18;
        hence Next <> {} by Def9;
      end;
      suppose
A19:    not e DJoins P.n2,P.n, G;
        then
A20:    e DJoins P.n,P.n2,G by A13;
        then
A21:    e in the_Edges_of G;
A22:    (the_Target_of G).e in dom Gn by A10,A20;
A23:    not (the_Source_of G).e in dom Gn by A6,A20;
        0 < (EL).e by A2,A9,A12,A19;
        then e is_backward_edge_wrt Gn by A21,A23,A22;
        hence Next <> {} by Def9;
      end;
    end;
A24: Gn1 = AP:Step(Gn) by Def12;
    now
      per cases;
      suppose
A25:    not (the_Source_of G).en in dom Gn;
        then Gn = Gn+*((the_Source_of G).en .--> en) by A24,A11,A14,Def10;
        then
A26:    dom Gn = dom Gn \/ {(the_Source_of G).en} by Lm1;
        (the_Source_of G).en in {(the_Source_of G).en} by TARSKI:def 1;
        hence contradiction by A25,A26,XBOOLE_0:def 3;
      end;
      suppose
A27:    (the_Source_of G).en in dom Gn;
        en is_forward_edge_wrt Gn or en is_backward_edge_wrt Gn by A14,Def9;
        then
A28:    not (the_Target_of G).en in dom Gn by A27;
        Gn = Gn+*((the_Target_of G).en .--> en) by A24,A11,A14,A27,Def10;
        then
A29:    dom Gn = dom Gn \/ {(the_Target_of G).en} by Lm1;
        (the_Target_of G).en in {(the_Target_of G).en} by TARSKI:def 1;
        hence contradiction by A28,A29,XBOOLE_0:def 3;
      end;
    end;
    hence contradiction;
  end;
  hence thesis;
end;
