let G be _Graph; G .numComponents() = card (G .allComponents())
defpred S1[ object , object ] means ex H being plain Component of G st
( $1 = H & $2 = the_Vertices_of H );
A1:
for x, y1, y2 being object st x in G .allComponents() & S1[x,y1] & S1[x,y2] holds
y1 = y2
;
A2:
for x being object st x in G .allComponents() holds
ex y being object st S1[x,y]
consider f being Function such that
A3:
dom f = G .allComponents()
and
A4:
for x being object st x in G .allComponents() holds
S1[x,f . x]
from FUNCT_1:sch 2(A1, A2);
now for y being object holds
( ( y in G .componentSet() implies ex x being object st
( x in dom f & y = f . x ) ) & ( ex x being object st
( x in dom f & y = f . x ) implies y in G .componentSet() ) )let y be
object ;
( ( y in G .componentSet() implies ex x being object st
( x in dom f & y = f . x ) ) & ( ex x being object st
( x in dom f & y = f . x ) implies y in G .componentSet() ) )thus
(
y in G .componentSet() implies ex
x being
object st
(
x in dom f &
y = f . x ) )
( ex x being object st
( x in dom f & y = f . x ) implies y in G .componentSet() )proof
assume
y in G .componentSet()
;
ex x being object st
( x in dom f & y = f . x )
then consider v being
Vertex of
G such that A5:
y = G .reachableFrom v
by GLIB_002:def 8;
set H = the
plain inducedSubgraph of
G,
(G .reachableFrom v);
take
the
plain inducedSubgraph of
G,
(G .reachableFrom v)
;
( the plain inducedSubgraph of G,(G .reachableFrom v) in dom f & y = f . the plain inducedSubgraph of G,(G .reachableFrom v) )
thus
the
plain inducedSubgraph of
G,
(G .reachableFrom v) in dom f
by A3, Th189;
y = f . the plain inducedSubgraph of G,(G .reachableFrom v)
then consider H9 being
plain Component of
G such that A6:
( the
plain inducedSubgraph of
G,
(G .reachableFrom v) = H9 &
f . the
plain inducedSubgraph of
G,
(G .reachableFrom v) = the_Vertices_of H9 )
by A3, A4;
thus
y = f . the
plain inducedSubgraph of
G,
(G .reachableFrom v)
by A5, A6, GLIB_000:def 37;
verum
end; given x being
object such that A7:
(
x in dom f &
y = f . x )
;
y in G .componentSet() consider H being
plain Component of
G such that A8:
(
x = H &
y = the_Vertices_of H )
by A3, A4, A7;
set v = the
Vertex of
H;
the_Vertices_of H c= the_Vertices_of G
;
then reconsider v = the
Vertex of
H as
Vertex of
G by TARSKI:def 3;
the_Vertices_of H = G .reachableFrom v
by GLIB_002:33;
hence
y in G .componentSet()
by A8, GLIB_002:def 8;
verum end;
then A9:
rng f = G .componentSet()
by FUNCT_1:def 3;
then
card (G .allComponents()) = card (G .componentSet())
by A3, A9, FUNCT_1:def 4, CARD_1:70;
hence
G .numComponents() = card (G .allComponents())
by GLIB_002:def 9; verum