
theorem Th28:
  for G being real-weighted WGraph, L be PRIM:Labeling of G st
  PRIM:NextBestEdges(L) <> {} holds ex v being Vertex of G st not v in L`1 &
  PRIM:Step(L) = [ L`1 \/ {v},
    L`2 \/ {the Element of PRIM:NextBestEdges(L)} ]
proof
  let G be real-weighted WGraph, L be PRIM:Labeling of G;
  set G2 = PRIM:Step(L);
  set e = the Element of PRIM:NextBestEdges(L);
  set src = (the_Source_of G).e, tar = (the_Target_of G).e;
  assume
A1: PRIM:NextBestEdges(L) <> {};
  then e in PRIM:NextBestEdges(L);
  then reconsider src,tar as Vertex of G by FUNCT_2:5;
A2: e SJoins L`1, the_Vertices_of G \ L`1, G by A1,Def13;
  now
    per cases;
    suppose
A3:   src in L`1;
      take tar;
      not src in the_Vertices_of G \ L`1 by A3,XBOOLE_0:def 5;
      then tar in the_Vertices_of G \ L`1 by A2;
      hence not tar in L`1 by XBOOLE_0:def 5;
      thus G2 = [L`1 \/ {tar}, L`2 \/ {e}] by A1,A3,Def15;
    end;
    suppose
A4:   not src in L`1;
      take src;
      thus not src in L`1 by A4;
      thus G2 = [L`1 \/ {src}, L`2 \/ {e}] by A1,A4,Def15;
    end;
  end;
  hence thesis;
end;
