Metamath Proof Explorer


Theorem cusgrsize

Description: The size of a finite complete simple graph with n vertices ( n e. NN0 ) is ( n _C 2 ) (" n choose 2") resp. ( ( ( n - 1 ) * n ) / 2 ) , see definition in section I.1 of Bollobas p. 3 . (Contributed by Alexander van der Vekens, 11-Jan-2018) (Revised by AV, 10-Nov-2020)

Ref Expression
Hypotheses cusgrsizeindb0.v V = Vtx G
cusgrsizeindb0.e E = Edg G
Assertion cusgrsize G ComplUSGraph V Fin E = ( V 2 )

Proof

Step Hyp Ref Expression
1 cusgrsizeindb0.v V = Vtx G
2 cusgrsizeindb0.e E = Edg G
3 edgval Edg G = ran iEdg G
4 2 3 eqtri E = ran iEdg G
5 4 a1i G ComplUSGraph V Fin E = ran iEdg G
6 5 fveq2d G ComplUSGraph V Fin E = ran iEdg G
7 1 opeq1i V iEdg G = Vtx G iEdg G
8 cusgrop G ComplUSGraph Vtx G iEdg G ComplUSGraph
9 7 8 eqeltrid G ComplUSGraph V iEdg G ComplUSGraph
10 fvex iEdg G V
11 fvex Edg v e V
12 rabexg Edg v e V c Edg v e | n c V
13 12 resiexd Edg v e V I c Edg v e | n c V
14 11 13 ax-mp I c Edg v e | n c V
15 rneq e = iEdg G ran e = ran iEdg G
16 15 fveq2d e = iEdg G ran e = ran iEdg G
17 fveq2 v = V v = V
18 17 oveq1d v = V ( v 2 ) = ( V 2 )
19 16 18 eqeqan12rd v = V e = iEdg G ran e = ( v 2 ) ran iEdg G = ( V 2 )
20 rneq e = f ran e = ran f
21 20 fveq2d e = f ran e = ran f
22 fveq2 v = w v = w
23 22 oveq1d v = w ( v 2 ) = ( w 2 )
24 21 23 eqeqan12rd v = w e = f ran e = ( v 2 ) ran f = ( w 2 )
25 vex v V
26 vex e V
27 25 26 opvtxfvi Vtx v e = v
28 27 eqcomi v = Vtx v e
29 eqid Edg v e = Edg v e
30 eqid c Edg v e | n c = c Edg v e | n c
31 eqid v n I c Edg v e | n c = v n I c Edg v e | n c
32 28 29 30 31 cusgrres v e ComplUSGraph n v v n I c Edg v e | n c ComplUSGraph
33 rneq f = I c Edg v e | n c ran f = ran I c Edg v e | n c
34 33 fveq2d f = I c Edg v e | n c ran f = ran I c Edg v e | n c
35 34 adantl w = v n f = I c Edg v e | n c ran f = ran I c Edg v e | n c
36 fveq2 w = v n w = v n
37 36 adantr w = v n f = I c Edg v e | n c w = v n
38 37 oveq1d w = v n f = I c Edg v e | n c ( w 2 ) = ( v n 2 )
39 35 38 eqeq12d w = v n f = I c Edg v e | n c ran f = ( w 2 ) ran I c Edg v e | n c = ( v n 2 )
40 edgopval v V e V Edg v e = ran e
41 40 el2v Edg v e = ran e
42 41 a1i v e ComplUSGraph v = 0 Edg v e = ran e
43 42 eqcomd v e ComplUSGraph v = 0 ran e = Edg v e
44 43 fveq2d v e ComplUSGraph v = 0 ran e = Edg v e
45 cusgrusgr v e ComplUSGraph v e USGraph
46 usgruhgr v e USGraph v e UHGraph
47 45 46 syl v e ComplUSGraph v e UHGraph
48 28 29 cusgrsizeindb0 v e UHGraph v = 0 Edg v e = ( v 2 )
49 47 48 sylan v e ComplUSGraph v = 0 Edg v e = ( v 2 )
50 44 49 eqtrd v e ComplUSGraph v = 0 ran e = ( v 2 )
51 rnresi ran I c Edg v e | n c = c Edg v e | n c
52 51 fveq2i ran I c Edg v e | n c = c Edg v e | n c
53 41 a1i y + 1 0 v e ComplUSGraph v = y + 1 n v Edg v e = ran e
54 53 rabeqdv y + 1 0 v e ComplUSGraph v = y + 1 n v c Edg v e | n c = c ran e | n c
55 54 fveq2d y + 1 0 v e ComplUSGraph v = y + 1 n v c Edg v e | n c = c ran e | n c
56 52 55 syl5eq y + 1 0 v e ComplUSGraph v = y + 1 n v ran I c Edg v e | n c = c ran e | n c
57 56 eqeq1d y + 1 0 v e ComplUSGraph v = y + 1 n v ran I c Edg v e | n c = ( v n 2 ) c ran e | n c = ( v n 2 )
58 57 biimpd y + 1 0 v e ComplUSGraph v = y + 1 n v ran I c Edg v e | n c = ( v n 2 ) c ran e | n c = ( v n 2 )
59 58 imdistani y + 1 0 v e ComplUSGraph v = y + 1 n v ran I c Edg v e | n c = ( v n 2 ) y + 1 0 v e ComplUSGraph v = y + 1 n v c ran e | n c = ( v n 2 )
60 41 eqcomi ran e = Edg v e
61 eqid c ran e | n c = c ran e | n c
62 28 60 61 cusgrsize2inds y + 1 0 v e ComplUSGraph v = y + 1 n v c ran e | n c = ( v n 2 ) ran e = ( v 2 )
63 62 imp31 y + 1 0 v e ComplUSGraph v = y + 1 n v c ran e | n c = ( v n 2 ) ran e = ( v 2 )
64 59 63 syl y + 1 0 v e ComplUSGraph v = y + 1 n v ran I c Edg v e | n c = ( v n 2 ) ran e = ( v 2 )
65 10 14 19 24 32 39 50 64 opfi1ind V iEdg G ComplUSGraph V Fin ran iEdg G = ( V 2 )
66 9 65 sylan G ComplUSGraph V Fin ran iEdg G = ( V 2 )
67 6 66 eqtrd G ComplUSGraph V Fin E = ( V 2 )