let G1 be finite connected real-weighted WGraph; for G2 being inducedWSubgraph of G1,(PRIM:MST G1) `1 ,(PRIM:MST G1) `2 holds G2 is minimumSpanningTree of G1
set PMST = PRIM:MST G1;
let G2 be inducedWSubgraph of G1,(PRIM:MST G1) `1 ,(PRIM:MST G1) `2 ; G2 is minimumSpanningTree of G1
reconsider G29 = G2 as Tree-like _Graph by Th38;
set VG1 = the_Vertices_of G1;
set EG1 = the_Edges_of G1;
set WG1 = the_Weight_of G1;
set PCS = PRIM:CompSeq G1;
A1:
(PRIM:MST G1) `1 = the_Vertices_of G1
by Th39;
(PRIM:MST G1) `2 in bool (the_Edges_of G1)
by MCART_1:10;
then
(PRIM:MST G1) `2 c= the_Edges_of G1
;
then A2:
(PRIM:MST G1) `2 c= G1 .edgesBetween ((PRIM:MST G1) `1 )
by A1, GLIB_000:37;
A3:
(PRIM:MST G1) `1 c= the_Vertices_of G1
by Th39;
then A4:
the_Vertices_of G2 = the_Vertices_of G1
by A1, A2, GLIB_000:def 39;
A5:
the_Edges_of G2 = (PRIM:MST G1) `2
by A1, A2, A3, GLIB_000:def 39;
A6:
G2 is Tree-like
by Th38;
now set X =
{ x where x is Element of G1 .allWSubgraphs() : x is minimumSpanningTree of G1 } ;
then reconsider X =
{ x where x is Element of G1 .allWSubgraphs() : x is minimumSpanningTree of G1 } as
finite Subset of
(G1 .allWSubgraphs() ) by TARSKI:def 3;
defpred S1[
finite _Graph,
Nat]
means ( not
((PRIM:CompSeq G1) . ($2 + 1)) `2 c= the_Edges_of $1 & ( for
n being
Nat st
n <= $2 holds
((PRIM:CompSeq G1) . n) `2 c= the_Edges_of $1 ) );
defpred S2[
finite _Graph,
finite _Graph]
means (
card ((the_Edges_of $1) /\ (the_Edges_of G2)) > card ((the_Edges_of $2) /\ (the_Edges_of G2)) or (
card ((the_Edges_of $1) /\ (the_Edges_of G2)) = card ((the_Edges_of $2) /\ (the_Edges_of G2)) & ( for
k1,
k2 being
Nat st
S1[$1,
k1] &
S1[$2,
k2] holds
k1 >= k2 ) ) );
A7:
G1 .edgesBetween (the_Vertices_of G1) = the_Edges_of G1
by GLIB_000:37;
then reconsider X =
X as non
empty finite Subset of
(G1 .allWSubgraphs() ) ;
assume A8:
G2 is not
minimumSpanningTree of
G1
;
contradictionnow let x,
y,
z be
Element of
X;
( S2[x,y] & S2[y,z] implies S2[x,z] )assume that A19:
S2[
x,
y]
and A20:
S2[
y,
z]
;
S2[x,z]
y in X
;
then consider y9 being
WSubgraph of
G1 such that A21:
y9 = y
and
dom y9 = WGraphSelectors
by Def5;
set CY =
card ((the_Edges_of y9) /\ (the_Edges_of G2));
x in X
;
then consider x9 being
WSubgraph of
G1 such that A22:
x9 = x
and
dom x9 = WGraphSelectors
by Def5;
z in X
;
then consider z9 being
WSubgraph of
G1 such that A23:
z9 = z
and
dom z9 = WGraphSelectors
by Def5;
set CZ =
card ((the_Edges_of z9) /\ (the_Edges_of G2));
set CX =
card ((the_Edges_of x9) /\ (the_Edges_of G2));
now per cases
( card ((the_Edges_of x9) /\ (the_Edges_of G2)) > card ((the_Edges_of y9) /\ (the_Edges_of G2)) or ( card ((the_Edges_of x9) /\ (the_Edges_of G2)) = card ((the_Edges_of y9) /\ (the_Edges_of G2)) & ( for kx, ky being Nat st S1[x9,kx] & S1[y9,ky] holds
kx >= ky ) ) )
by A19, A22, A21;
suppose A25:
(
card ((the_Edges_of x9) /\ (the_Edges_of G2)) = card ((the_Edges_of y9) /\ (the_Edges_of G2)) & ( for
kx,
ky being
Nat st
S1[
x9,
kx] &
S1[
y9,
ky] holds
kx >= ky ) )
;
S2[x,z]now per cases
( card ((the_Edges_of y9) /\ (the_Edges_of G2)) > card ((the_Edges_of z9) /\ (the_Edges_of G2)) or ( card ((the_Edges_of y9) /\ (the_Edges_of G2)) = card ((the_Edges_of z9) /\ (the_Edges_of G2)) & ( for ky, kz being Nat st S1[y9,ky] & S1[z9,kz] holds
ky >= kz ) ) )
by A20, A21, A23;
suppose A26:
(
card ((the_Edges_of y9) /\ (the_Edges_of G2)) = card ((the_Edges_of z9) /\ (the_Edges_of G2)) & ( for
ky,
kz being
Nat st
S1[
y9,
ky] &
S1[
z9,
kz] holds
ky >= kz ) )
;
S2[x,z]consider zy being
Nat such that A27:
S1[
y,
zy]
by A9;
now let kx,
kz be
Nat;
( S1[x9,kx] & S1[z9,kz] implies kx >= kz )assume
(
S1[
x9,
kx] &
S1[
z9,
kz] )
;
kx >= kzthen
(
kx >= zy &
zy >= kz )
by A21, A25, A26, A27;
hence
kx >= kz
by XXREAL_0:2;
verum end; hence
S2[
x,
z]
by A22, A23, A25, A26;
verumconsider zz being
Nat;
consider zx being
Nat;
end; end; end; hence
S2[
x,
z]
;
verum end; end; end; hence
S2[
x,
z]
;
verum end; then A28:
for
x,
y,
z being
Element of
X st
S2[
x,
y] &
S2[
y,
z] holds
S2[
x,
z]
;
A29:
now let G be
Element of
X;
for k1, k2 being Nat st S1[G,k1] & S1[G,k2] holds
k1 = k2let k1,
k2 be
Nat;
( S1[G,k1] & S1[G,k2] implies k1 = k2 )assume A30:
(
S1[
G,
k1] &
S1[
G,
k2] )
;
k1 = k2then
k2 + 1
> k1
;
then A31:
k2 >= k1
by NAT_1:13;
k1 + 1
> k2
by A30;
then
k1 >= k2
by NAT_1:13;
hence
k1 = k2
by A31, XXREAL_0:1;
verum end; now let x,
y be
Element of
X;
( S2[x,y] or S2[y,x] )
x in X
;
then consider x9 being
WSubgraph of
G1 such that A32:
x9 = x
and
dom x9 = WGraphSelectors
by Def5;
set CX =
card ((the_Edges_of x9) /\ (the_Edges_of G2));
y in X
;
then consider y9 being
WSubgraph of
G1 such that A33:
y9 = y
and
dom y9 = WGraphSelectors
by Def5;
set CY =
card ((the_Edges_of y9) /\ (the_Edges_of G2));
now per cases
( card ((the_Edges_of x9) /\ (the_Edges_of G2)) < card ((the_Edges_of y9) /\ (the_Edges_of G2)) or card ((the_Edges_of y9) /\ (the_Edges_of G2)) = card ((the_Edges_of x9) /\ (the_Edges_of G2)) or card ((the_Edges_of x9) /\ (the_Edges_of G2)) > card ((the_Edges_of y9) /\ (the_Edges_of G2)) )
by XXREAL_0:1;
suppose A34:
card ((the_Edges_of y9) /\ (the_Edges_of G2)) = card ((the_Edges_of x9) /\ (the_Edges_of G2))
;
( S2[x,y] or S2[y,x] )consider k1 being
Nat such that A35:
S1[
x,
k1]
by A9;
consider k2 being
Nat such that A36:
S1[
y,
k2]
by A9;
now per cases
( k1 >= k2 or k1 < k2 )
;
suppose A37:
k1 >= k2
;
( S2[x,y] or S2[y,x] )now let z1,
z2 be
Nat;
( S1[x,z1] & S1[y,z2] implies z1 >= z2 )assume that A38:
S1[
x,
z1]
and A39:
S1[
y,
z2]
;
z1 >= z2
z1 = k1
by A29, A35, A38;
hence
z1 >= z2
by A29, A36, A37, A39;
verum end; hence
(
S2[
x,
y] or
S2[
y,
x] )
by A32, A33, A34;
verum end; suppose A40:
k1 < k2
;
( S2[x,y] or S2[y,x] )now let z1,
z2 be
Nat;
( S1[x,z1] & S1[y,z2] implies z1 <= z2 )assume that A41:
S1[
x,
z1]
and A42:
S1[
y,
z2]
;
z1 <= z2
z1 = k1
by A29, A35, A41;
hence
z1 <= z2
by A29, A36, A40, A42;
verum end; hence
(
S2[
x,
y] or
S2[
y,
x] )
by A32, A33, A34;
verum end; end; end; hence
(
S2[
x,
y] or
S2[
y,
x] )
;
verum end; end; end; hence
(
S2[
x,
y] or
S2[
y,
x] )
;
verum end; then A43:
for
x,
y being
Element of
X holds
(
S2[
x,
y] or
S2[
y,
x] )
;
A44:
(
X is
finite &
X <> {} &
X c= X )
;
consider M being
Element of
X such that A45:
(
M in X & ( for
y being
Element of
X st
y in X holds
S2[
M,
y] ) )
from CQC_SIM1:sch 4(A44, A43, A28);
ex
x being
Element of
G1 .allWSubgraphs() st
(
M = x &
x is
minimumSpanningTree of
G1 )
by A45;
then reconsider M =
M as
minimumSpanningTree of
G1 ;
defpred S3[
Nat]
means not
((PRIM:CompSeq G1) . $1) `2 c= the_Edges_of M;
A46:
the_Vertices_of G2 = the_Vertices_of M
by A4, GLIB_000:def 35;
then A50:
ex
k being
Nat st
S3[
k]
by A5;
consider k being
Nat such that A51:
(
S3[
k] & ( for
n being
Nat st
S3[
n] holds
k <= n ) )
from NAT_1:sch 5(A50);
then consider k1o being
Nat such that A53:
k = k1o + 1
by NAT_1:6;
set Gk1b =
(PRIM:CompSeq G1) . k1o;
set Gk =
(PRIM:CompSeq G1) . k;
(k1o + 1) - 1
< k - 0
by A53, XREAL_1:17;
then A54:
((PRIM:CompSeq G1) . k1o) `2 c= the_Edges_of M
by A51;
set Next =
PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o);
set ep =
choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o));
A55:
(PRIM:CompSeq G1) . k = PRIM:Step ((PRIM:CompSeq G1) . k1o)
by A53, Def17;
then A56:
PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o) <> {}
by A51, A54, Def15;
then A57:
choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)) SJoins ((PRIM:CompSeq G1) . k1o) `1 ,
(the_Vertices_of G1) \ (((PRIM:CompSeq G1) . k1o) `1 ),
G1
by Def13;
ex
v being
Vertex of
G1 st
( not
v in ((PRIM:CompSeq G1) . k1o) `1 &
(PRIM:CompSeq G1) . k = [((((PRIM:CompSeq G1) . k1o) `1 ) \/ {v}),((((PRIM:CompSeq G1) . k1o) `2 ) \/ {(choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))})] )
by A55, A56, Th28;
then A58:
((PRIM:CompSeq G1) . k) `2 = (((PRIM:CompSeq G1) . k1o) `2 ) \/ {(choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))}
by MCART_1:7;
then A59:
not
{(choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))} c= the_Edges_of M
by A51, A54, XBOOLE_1:8;
then A60:
not
choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)) in the_Edges_of M
by ZFMISC_1:37;
consider Mep being
inducedWSubgraph of
G1,
the_Vertices_of G1,
(the_Edges_of M) \/ {(choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))};
A61:
choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)) in PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)
by A56;
then
{(choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))} c= the_Edges_of G1
by ZFMISC_1:37;
then
(the_Edges_of M) \/ {(choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))} c= the_Edges_of G1
by XBOOLE_1:8;
then A62:
(
the_Vertices_of G1 c= the_Vertices_of G1 &
(the_Edges_of M) \/ {(choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))} c= G1 .edgesBetween (the_Vertices_of G1) )
by GLIB_000:37;
then A63:
the_Vertices_of Mep = the_Vertices_of G1
by GLIB_000:def 39;
the_Vertices_of G1 = the_Vertices_of M
by GLIB_000:def 35;
then
(
the_Vertices_of G1 c= the_Vertices_of G1 &
M is
inducedWSubgraph of
G1,
the_Vertices_of G1,
the_Edges_of M )
by A7, GLIB_000:def 39;
then A64:
Mep .cost() = (M .cost() ) + ((the_Weight_of G1) . (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o))))
by A61, A60, A7, Th11;
set MG2 =
(the_Edges_of M) /\ (the_Edges_of G2);
A65:
((PRIM:CompSeq G1) . k) `2 c= (PRIM:MST G1) `2
by Th42;
choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)) in {(choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))}
by TARSKI:def 1;
then A66:
choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)) in ((PRIM:CompSeq G1) . k) `2
by A58, XBOOLE_0:def 3;
then A67:
{(choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))} /\ (the_Edges_of G2) = {(choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))}
by A5, A65, ZFMISC_1:52;
then A70:
(the_Edges_of M) /\ (the_Edges_of G2) misses {(choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))}
by XBOOLE_0:def 7;
set v1 =
(the_Source_of Mep) . (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)));
set v2 =
(the_Target_of Mep) . (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)));
set V =
((PRIM:CompSeq G1) . k1o) `1 ;
A71:
the_Weight_of Mep = (the_Weight_of G1) | (the_Edges_of Mep)
by GLIB_003:def 10;
A72:
the_Vertices_of G1 = the_Vertices_of M
by GLIB_000:def 35;
then reconsider V =
((PRIM:CompSeq G1) . k1o) `1 as non
empty Subset of
(the_Vertices_of M) by Th30;
A73:
the_Edges_of Mep = (the_Edges_of M) \/ {(choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))}
by A62, GLIB_000:def 39;
the_Vertices_of M c= the_Vertices_of Mep
by A63;
then reconsider M9 =
M as
connected Subgraph of
Mep by A73, GLIB_000:47, XBOOLE_1:7;
choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)) in {(choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))}
by TARSKI:def 1;
then A74:
choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)) in the_Edges_of Mep
by A73, XBOOLE_0:def 3;
the_Vertices_of Mep = the_Vertices_of M
by A63, GLIB_000:def 35;
then reconsider v1 =
(the_Source_of Mep) . (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o))),
v2 =
(the_Target_of Mep) . (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o))) as
Vertex of
M by A74, FUNCT_2:7;
consider W being
Walk of
M9 such that A75:
W is_Walk_from v2,
v1
by GLIB_002:def 1;
consider PW being
Path of
W;
reconsider P =
PW as
Path of
Mep by GLIB_001:176;
A76:
PW is_Walk_from v2,
v1
by A75, GLIB_001:161;
then A77:
P is_Walk_from v2,
v1
by GLIB_001:20;
A82:
choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)) Joins v1,
v2,
Mep
by A74, GLIB_000:def 15;
then A83:
choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)) Joins P .last() ,
v2,
Mep
by A77, GLIB_001:def 23;
choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)) Joins v1,
v2,
G1
by A82, GLIB_000:75;
then A84:
choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)) Joins v1,
v2,
G29
by A5, A66, A65, GLIB_000:76;
then
( (
(the_Source_of G2) . (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o))) = v1 &
(the_Target_of G2) . (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o))) = v2 ) or (
(the_Target_of G2) . (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o))) = v1 &
(the_Source_of G2) . (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o))) = v2 ) )
by GLIB_000:def 15;
then
v1 <> v2
by A5, A66, A65, A84, GLIB_000:def 20;
then
v1 <> P .first()
by A77, GLIB_001:def 23;
then
P .last() <> P .first()
by A77, GLIB_001:def 23;
then A85:
not
P is
closed
by GLIB_001:def 24;
PW .edges() c= the_Edges_of M
;
then
P .edges() c= the_Edges_of M
by GLIB_001:111;
then
not
choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)) in P .edges()
by A59, ZFMISC_1:37;
then A86:
P .addEdge (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o))) is
Path-like
by A85, A83, A78, GLIB_001:151;
P .addEdge (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o))) is_Walk_from v2,
v2
by A77, A82, GLIB_001:67;
then A87:
P .addEdge (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o))) is
closed
by GLIB_001:120;
the_Vertices_of M c= the_Vertices_of Mep
by A63;
then reconsider M9 =
M as
connected Subgraph of
Mep by A73, GLIB_000:47, XBOOLE_1:7;
the_Vertices_of M9 = the_Vertices_of Mep
by A63, GLIB_000:def 35;
then
M9 is
spanning
by GLIB_000:def 35;
then A88:
Mep is
connected
by GLIB_002:23;
A89:
v2 = P . 1
by A76, GLIB_001:18;
set C =
P .addEdge (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)));
A90:
v1 = P . (len P)
by A76, GLIB_001:18;
A91:
(
(the_Source_of G1) . (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o))) = v1 &
(the_Target_of G1) . (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o))) = v2 )
by A74, GLIB_000:def 34;
now per cases
( ( v1 in ((PRIM:CompSeq G1) . k1o) `1 & v2 in (the_Vertices_of G1) \ (((PRIM:CompSeq G1) . k1o) `1 ) ) or ( v2 in ((PRIM:CompSeq G1) . k1o) `1 & v1 in (the_Vertices_of G1) \ (((PRIM:CompSeq G1) . k1o) `1 ) ) )
by A57, A91, GLIB_000:def 17;
suppose A92:
(
v1 in ((PRIM:CompSeq G1) . k1o) `1 &
v2 in (the_Vertices_of G1) \ (((PRIM:CompSeq G1) . k1o) `1 ) )
;
ex em being set st
( em in (P .addEdge (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))) .edges() & em <> choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)) & em SJoins V,(the_Vertices_of M) \ V,M )A93:
(
len (P .addEdge (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))) = (len P) + 2 &
(P .addEdge (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))) . ((len P) + 1) = choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)) )
by A83, GLIB_001:65, GLIB_001:66;
defpred S4[
Nat]
means ( not $1 is
even & $1
<= len P &
P . $1
in ((PRIM:CompSeq G1) . k1o) `1 );
A94:
ex
n being
Nat st
S4[
n]
by A90, A92;
consider m being
Nat such that A95:
(
S4[
m] & ( for
n being
Nat st
S4[
n] holds
m <= n ) )
from NAT_1:sch 5(A94);
reconsider m =
m as
odd Element of
NAT by A95, ORDINAL1:def 13;
( 1
<= m &
m <> 1 )
by A89, A92, A95, HEYTING3:1, XBOOLE_0:def 5;
then
1
< m
by XXREAL_0:1;
then
1
+ 1
<= m
by NAT_1:13;
then reconsider m2k =
m - (2 * 1) as
odd Element of
NAT by INT_1:18;
A96:
m2k < m - 0
by XREAL_1:17;
then A97:
m2k < len P
by A95, XXREAL_0:2;
then A98:
not
P . m2k in ((PRIM:CompSeq G1) . k1o) `1
by A95, A96;
set em =
P . (m2k + 1);
A99:
P . (m2k + 1) in P .edges()
by A97, GLIB_001:101;
then consider i being
even Element of
NAT such that A100:
1
<= i
and A101:
i <= len P
and A102:
P . i = P . (m2k + 1)
by GLIB_001:100;
i in dom P
by A100, A101, FINSEQ_3:27;
then A103:
(P .addEdge (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))) . i = P . (m2k + 1)
by A83, A102, GLIB_001:66;
take em =
P . (m2k + 1);
( em in (P .addEdge (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))) .edges() & em <> choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)) & em SJoins V,(the_Vertices_of M) \ V,M )
(P .addEdge (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))) .edges() = (P .edges() ) \/ {(choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))}
by A83, GLIB_001:112;
hence
em in (P .addEdge (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))) .edges()
by A99, XBOOLE_0:def 3;
( em <> choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)) & em SJoins V,(the_Vertices_of M) \ V,M )A104:
(len P) + 1
<= (len P) + 2
by XREAL_1:9;
(len P) + 0 < (len P) + 1
by XREAL_1:10;
then
i < (len P) + 1
by A101, XXREAL_0:2;
hence
em <> choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o))
by A86, A100, A103, A93, A104, GLIB_001:139;
em SJoins V,(the_Vertices_of M) \ V,M
m2k + 2
= m
;
then A105:
em Joins PW . m2k,
PW . m,
M
by A97, GLIB_001:def 3;
then
PW . m2k in the_Vertices_of M
by GLIB_000:16;
then
PW . m2k in (the_Vertices_of M) \ (((PRIM:CompSeq G1) . k1o) `1 )
by A98, XBOOLE_0:def 5;
hence
em SJoins V,
(the_Vertices_of M) \ V,
M
by A95, A105, GLIB_000:20;
verum end; suppose A106:
(
v2 in ((PRIM:CompSeq G1) . k1o) `1 &
v1 in (the_Vertices_of G1) \ (((PRIM:CompSeq G1) . k1o) `1 ) )
;
ex em being set st
( em in (P .addEdge (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))) .edges() & em <> choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)) & em SJoins V,(the_Vertices_of M) \ V,M )A107:
(
len (P .addEdge (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))) = (len P) + 2 &
(P .addEdge (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))) . ((len P) + 1) = choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)) )
by A83, GLIB_001:65, GLIB_001:66;
defpred S4[
Nat]
means ( not $1 is
even & $1
<= len P &
P . $1
in (the_Vertices_of G1) \ (((PRIM:CompSeq G1) . k1o) `1 ) );
A108:
ex
n being
Nat st
S4[
n]
by A90, A106;
consider m being
Nat such that A109:
(
S4[
m] & ( for
n being
Nat st
S4[
n] holds
m <= n ) )
from NAT_1:sch 5(A108);
reconsider m =
m as
odd Element of
NAT by A109, ORDINAL1:def 13;
( 1
<= m &
m <> 1 )
by A89, A106, A109, HEYTING3:1, XBOOLE_0:def 5;
then
1
< m
by XXREAL_0:1;
then
1
+ 1
<= m
by NAT_1:13;
then reconsider m2k =
m - (2 * 1) as
odd Element of
NAT by INT_1:18;
A110:
m2k < m - 0
by XREAL_1:17;
then A111:
m2k < len P
by A109, XXREAL_0:2;
set em =
P . (m2k + 1);
A114:
P . (m2k + 1) in P .edges()
by A111, GLIB_001:101;
then consider i being
even Element of
NAT such that A115:
1
<= i
and A116:
i <= len P
and A117:
P . i = P . (m2k + 1)
by GLIB_001:100;
i in dom P
by A115, A116, FINSEQ_3:27;
then A118:
(P .addEdge (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))) . i = P . (m2k + 1)
by A83, A117, GLIB_001:66;
take em =
P . (m2k + 1);
( em in (P .addEdge (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))) .edges() & em <> choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)) & em SJoins V,(the_Vertices_of M) \ V,M )
(P .addEdge (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))) .edges() = (P .edges() ) \/ {(choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))}
by A83, GLIB_001:112;
hence
em in (P .addEdge (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))) .edges()
by A114, XBOOLE_0:def 3;
( em <> choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)) & em SJoins V,(the_Vertices_of M) \ V,M )A119:
(len P) + 1
<= (len P) + 2
by XREAL_1:9;
(len P) + 0 < (len P) + 1
by XREAL_1:10;
then
i < (len P) + 1
by A116, XXREAL_0:2;
hence
em <> choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o))
by A86, A115, A118, A107, A119, GLIB_001:139;
em SJoins V,(the_Vertices_of M) \ V,M
m2k + 2
= m
;
then
em Joins PW . m2k,
PW . m,
M
by A111, GLIB_001:def 3;
hence
em SJoins V,
(the_Vertices_of M) \ V,
M
by A72, A109, A112, GLIB_000:20;
verum end; end; end; then consider em being
set such that A120:
em in (P .addEdge (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))) .edges()
and A121:
em <> choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o))
and A122:
em SJoins V,
(the_Vertices_of M) \ V,
M
;
consider M2 being
[Weighted] weight-inheriting removeEdge of
Mep,
em;
reconsider M2 =
M2 as
WSubgraph of
G1 by GLIB_003:16;
A123:
M2 .order() =
card (the_Vertices_of G1)
by A63, GLIB_000:56
.=
M .order()
by GLIB_000:def 35
;
A124:
em SJoins V,
(the_Vertices_of G1) \ V,
G1
by A72, A122, GLIB_000:75;
then A125:
(the_Weight_of G1) . (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o))) <= (the_Weight_of G1) . em
by A56, Def13;
set M29 =
M2 .strict WGraphSelectors ;
A126:
M2 .strict WGraphSelectors == M2
by Lm4;
A127:
the_Edges_of M2 = ((the_Edges_of M) \/ {(choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))}) \ {em}
by A73, GLIB_000:54;
then A128:
the_Edges_of (M2 .strict WGraphSelectors ) = ((the_Edges_of M) \/ {(choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))}) \ {em}
by A126, GLIB_000:def 36;
{em} c= (the_Edges_of M) \/ {(choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))}
by A73, A120, ZFMISC_1:37;
then M2 .size() =
(card ((the_Edges_of M) \/ {(choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))})) - (card {em})
by A127, CARD_2:63
.=
(card ((the_Edges_of M) \/ {(choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))})) - 1
by CARD_1:50
.=
((card (the_Edges_of M)) + 1) - 1
by A60, CARD_2:54
.=
M .size()
;
then A129:
M2 .order() = (M2 .size() ) + 1
by A123, GLIB_002:46;
A130:
the_Weight_of (M2 .strict WGraphSelectors ) = the_Weight_of M2
by Lm4;
then reconsider M29 =
M2 .strict WGraphSelectors as
WSubgraph of
G1 by A126, GLIB_003:15;
A131:
the_Vertices_of M29 =
the_Vertices_of M2
by A126, GLIB_000:def 36
.=
the_Vertices_of G1
by A63, GLIB_000:56
;
not
P .addEdge (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o))) is
trivial
by A83, GLIB_001:133;
then
P .addEdge (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o))) is
Cycle-like
by A86, A87, GLIB_001:def 31;
then
M2 is
connected
by A120, A88, GLIB_002:5;
then
M2 is
Tree-like
by A129, GLIB_002:47;
then
M29 is
Tree-like
by Lm4, GLIB_002:48;
then reconsider M29 =
M29 as
spanning Tree-like WSubgraph of
G1 by A131, GLIB_000:def 35;
(M2 .cost() ) + ((the_Weight_of Mep) . em) = Mep .cost()
by A120, Th10;
then
M2 .cost() = (Mep .cost() ) - ((the_Weight_of Mep) . em)
;
then
M2 .cost() = ((M .cost() ) + ((the_Weight_of G1) . (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o))))) - ((the_Weight_of G1) . em)
by A120, A64, A71, FUNCT_1:72;
then
M29 .cost() = ((M .cost() ) + ((the_Weight_of G1) . (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o))))) - ((the_Weight_of G1) . em)
by A126, A130, GLIB_000:def 36;
then A132:
((M29 .cost() ) + ((the_Weight_of G1) . em)) - ((the_Weight_of G1) . em) <= ((M .cost() ) + ((the_Weight_of G1) . (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o))))) - ((the_Weight_of G1) . (choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o))))
by A125, XREAL_1:15;
then reconsider M29 =
M29 as
minimumSpanningTree of
G1 by Def19;
set MG29 =
(the_Edges_of M29) /\ (the_Edges_of G2);
A133:
(the_Edges_of M29) /\ (the_Edges_of G2) = (((the_Edges_of M) \/ {(choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))}) /\ (the_Edges_of G2)) \ ({em} /\ (the_Edges_of G2))
by A128, XBOOLE_1:50;
dom M29 = WGraphSelectors
by Lm5;
then
M29 in G1 .allWSubgraphs()
by Def5;
then A134:
M29 in X
;
A136:
now consider k2 being
Nat such that A137:
S1[
M29,
k2]
by A9, A134;
then A145:
((PRIM:CompSeq G1) . k) `2 c= the_Edges_of M29
by TARSKI:def 3;
assume A147:
em in the_Edges_of G2
;
contradictionthen A148:
{em} c= ((the_Edges_of M) \/ {(choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))}) /\ (the_Edges_of G2)
by TARSKI:def 3;
(the_Edges_of M29) /\ (the_Edges_of G2) = (((the_Edges_of M) \/ {(choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))}) /\ (the_Edges_of G2)) \ {em}
by A133, A147, ZFMISC_1:52;
then card ((the_Edges_of M29) /\ (the_Edges_of G2)) =
(card ((the_Edges_of Mep) /\ (the_Edges_of G2))) - (card {em})
by A73, A148, CARD_2:63
.=
(card ((the_Edges_of Mep) /\ (the_Edges_of G2))) - 1
by CARD_1:50
.=
(card (((the_Edges_of M) /\ (the_Edges_of G2)) \/ {(choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))})) - 1
by A73, A67, XBOOLE_1:23
.=
((card ((the_Edges_of M) /\ (the_Edges_of G2))) + (card {(choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))})) - 1
by A70, CARD_2:53
.=
((card ((the_Edges_of M) /\ (the_Edges_of G2))) + 1) - 1
by CARD_1:50
.=
card ((the_Edges_of M) /\ (the_Edges_of G2))
;
then A149:
k1o >= k2
by A45, A134, A135, A137;
(k1o + 1) - 1
< k - 0
by A53, XREAL_1:17;
hence
contradiction
by A146, A149, XXREAL_0:2;
verum end; then A151:
(the_Edges_of M29) /\ (the_Edges_of G2) = ((the_Edges_of M) /\ (the_Edges_of G2)) \/ ({(choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))} /\ (the_Edges_of G2))
by A133, XBOOLE_1:23;
then
(the_Edges_of M) /\ (the_Edges_of G2) misses {(choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))}
by XBOOLE_0:def 7;
then card ((the_Edges_of M29) /\ (the_Edges_of G2)) =
(card ((the_Edges_of M) /\ (the_Edges_of G2))) + (card {(choose (PRIM:NextBestEdges ((PRIM:CompSeq G1) . k1o)))})
by A67, A151, CARD_2:53
.=
(card ((the_Edges_of M) /\ (the_Edges_of G2))) + 1
by CARD_1:50
;
then
(card ((the_Edges_of M) /\ (the_Edges_of G2))) + 0 >= (card ((the_Edges_of M) /\ (the_Edges_of G2))) + 1
by A45, A134;
hence
contradiction
by XREAL_1:8;
verum end;
hence
G2 is minimumSpanningTree of G1
; verum