
theorem Th30:
  for G being _finite real-weighted WGraph, n being Nat holds (
PRIM:CompSeq(G).n)`1 is non empty Subset of the_Vertices_of G & (PRIM:CompSeq(G
  ).n)`2 c= G.edgesBetween((PRIM:CompSeq(G).n)`1)
proof
  let G be _finite real-weighted WGraph;
  set PCS = PRIM:CompSeq(G);
  defpred P[Nat] means (PCS.$1)`1 is non empty Subset of the_Vertices_of G & (
  PCS.$1)`2 c= G.edgesBetween((PCS.$1)`1);
A1: (PCS.0)`2 = (PRIM:Init(G))`2 by Def17
    .= {};
  now
    let n be Nat;
    assume
A2: P[n];
    set Gn = PCS.n, Gn1 = PCS.(n+1);
    set Next = PRIM:NextBestEdges(Gn), e = the Element of Next;
A3: Gn1 = PRIM:Step(Gn) by Def17;
    now
      per cases;
      suppose
        Next = {};
        then Gn1 = Gn by A3,Def15;
        hence P[n+1] by A2;
      end;
      suppose
A4:     Next <> {};
        set src = (the_Source_of G).e, tar = (the_Target_of G).e;
A5:     e in Next by A4;
A6:     e SJoins Gn`1, the_Vertices_of G \ Gn`1, G by A4,Def13;
        now
          per cases;
          suppose
A7:         (the_Source_of G).e in Gn`1;
            then
A8:         Gn1 = [Gn`1 \/ {tar}, Gn`2 \/ {e}] by A3,A4,Def15;
            then
A9:         Gn1`1 = Gn`1 \/ {tar};
            then
A10:        G.edgesBetween(Gn`1) c= G.edgesBetween(Gn1`1) by GLIB_000:36
,XBOOLE_1:7;
            thus Gn1`1 is non empty Subset of the_Vertices_of G by A8
;
A11:        Gn1`2 = Gn`2 \/ {e} by A8;
A12:        Gn`1 c= Gn1`1 by A9,XBOOLE_1:7;
            now
              let x be object;
              assume
A13:          x in Gn1`2;
              now
                per cases by A11,A13,XBOOLE_0:def 3;
                suppose
                  x in Gn`2;
                  then x in G.edgesBetween(Gn`1) by A2;
                  hence x in G.edgesBetween(Gn1`1) by A10;
                end;
                suppose
                  x in {e};
                  then
A14:              x = e by TARSKI:def 1;
                  then (the_Target_of G).x in {tar} by TARSKI:def 1;
                  then (the_Target_of G).x in Gn1`1 by A9,XBOOLE_0:def 3;
                  hence x in G.edgesBetween(Gn1`1) by A5,A7,A12,A14,GLIB_000:31
;
                end;
              end;
              hence x in G.edgesBetween(Gn1`1);
            end;
            hence Gn1`2 c= G.edgesBetween(Gn1`1);
          end;
          suppose
A15:        not (the_Source_of G).e in Gn`1;
            then
A16:        tar in Gn`1 by A6;
A17:        Gn1 = [Gn`1 \/ {(the_Source_of G).e}, Gn`2 \/ {e}] by A3,A4,A15
,Def15;
            then
A18:        Gn1`1 = Gn`1 \/ {src};
            then
A19:        G.edgesBetween(Gn`1) c= G.edgesBetween(Gn1`1) by GLIB_000:36
,XBOOLE_1:7;
            thus Gn1`1 is non empty Subset of the_Vertices_of G by A17;
A20:        Gn1`2 = Gn`2 \/ {e} by A17;
A21:        Gn`1 c= Gn1`1 by A18,XBOOLE_1:7;
            now
              let x be object;
              assume
A22:          x in Gn1`2;
              now
                per cases by A20,A22,XBOOLE_0:def 3;
                suppose
                  x in Gn`2;
                  then x in G.edgesBetween(Gn`1) by A2;
                  hence x in G.edgesBetween(Gn1`1) by A19;
                end;
                suppose
                  x in {e};
                  then
A23:              x = e by TARSKI:def 1;
                  then (the_Source_of G).x in {src} by TARSKI:def 1;
                  then (the_Source_of G).x in Gn1`1 by A18,XBOOLE_0:def 3;
                  hence x in G.edgesBetween(Gn1`1) by A5,A21,A16,A23,
GLIB_000:31;
                end;
              end;
              hence x in G.edgesBetween(Gn1`1);
            end;
            hence Gn1`2 c= G.edgesBetween(Gn1`1);
          end;
        end;
        hence P[n+1];
      end;
    end;
    hence P[n+1];
  end;
  then
A24: for n being Nat st P[n] holds P[n+1];
  (PCS.0)`1 = (PRIM:Init(G))`1 by Def17
    .= {the Element of the_Vertices_of G};
  then
A25: P[ 0 ] by A1,XBOOLE_1:2;
  for n being Nat holds P[n] from NAT_1:sch 2(A25,A24);
  hence thesis;
end;
