
theorem Th19:
  for G being _finite real-weighted WGraph, src being Vertex of G,
  n being Nat holds dom (DIJK:CompSeq(src).n)`1 c= G.reachableDFrom(src)
proof
  let G be _finite real-weighted WGraph, src be Vertex of G;
  set DCS = DIJK:CompSeq(src);
  defpred P[Nat] means dom (DCS.$1)`1 c= G.reachableDFrom(src);
  DCS.0 = DIJK:Init(src) by Def11;
  then
A1: dom (DCS.0)`1 = {src};
  now
    let k be Nat such that
A2: dom (DCS.k)`1 c= G.reachableDFrom(src);
    set Gk = DCS.k, NextG = DCS.(k+1);
    set BestEdges = DIJK:NextBestEdges(Gk), e = the Element of BestEdges;
    set NextEG = Gk`2 \/ {e};
    set v1 = (the_Source_of G).e, target = (the_Target_of G).e;
    set pc = Gk`1.v1, ec = (the_Weight_of G).e;
A3: NextG = DIJK:Step(Gk) by Def11;
    now
      let x be object;
      assume
A4:   x in dom (DCS.(k+1))`1;
      now
        per cases;
        suppose
          BestEdges = {};
          then Gk = NextG by A3,Def8;
          hence x in G.reachableDFrom(src) by A2,A4;
        end;
        suppose
A5:       BestEdges <> {};
          set xx = x;
          reconsider xx as Vertex of G by A4;
          e DSJoins dom Gk`1,the_Vertices_of G \ dom Gk`1,G by A5,Def7;
          then
A6:       v1 in dom Gk`1;
          then reconsider v19 = v1 as Vertex of G;
          NextG = [Gk`1+*(target .--> (pc+ec)),NextEG] by A3,A5,Def8;
          then
A7:       NextG`1 = Gk`1+*(target .--> (pc+ec));
          now
            per cases;
            suppose
              xx in dom Gk`1;
              hence xx in G.reachableDFrom(src) by A2;
            end;
            suppose
A8:           not xx in dom Gk`1;
A9:           e in BestEdges by A5;
              (the_Target_of G). e = xx by A4,A7,A8,Lm2;
              then e DJoins v19,xx,G by A9;
              hence xx in G.reachableDFrom(src) by A2,A6,GLIB_002:19;
            end;
          end;
          hence x in G.reachableDFrom(src);
        end;
      end;
      hence x in G.reachableDFrom(src);
    end;
    hence dom (DCS.(k+1))`1 c= G.reachableDFrom(src);
  end;
  then
A10: for k being Nat st P[k] holds P[k+1];
  src in G.reachableDFrom(src) by GLIB_002:18;
  then
A11: P[ 0 ] by A1,ZFMISC_1:31;
  for n being Nat holds P[n] from NAT_1:sch 2(A11,A10);
  hence thesis;
end;
