Metamath Proof Explorer < Previous   Next > Nearby theorems Mirrors  >  Home  >  MPE Home  >  Th. List  >  cusgrsize Structured version   Visualization version   GIF version

Theorem cusgrsize 26237
 Description: The size of a finite complete simple graph with 𝑛 vertices (𝑛 ∈ ℕ0) is (𝑛C2) ("𝑛 choose 2") resp. (((𝑛 − 1)∗𝑛) / 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.)
Hypotheses
Ref Expression
cusgrsizeindb0.v 𝑉 = (Vtx‘𝐺)
cusgrsizeindb0.e 𝐸 = (Edg‘𝐺)
Assertion
Ref Expression
cusgrsize ((𝐺 ∈ ComplUSGraph ∧ 𝑉 ∈ Fin) → (#‘𝐸) = ((#‘𝑉)C2))

Proof of Theorem cusgrsize
Dummy variables 𝑒 𝑓 𝑛 𝑣 𝑐 𝑤 𝑦 are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 cusgrsizeindb0.e . . . . 5 𝐸 = (Edg‘𝐺)
2 edgval 25841 . . . . 5 (𝐺 ∈ ComplUSGraph → (Edg‘𝐺) = ran (iEdg‘𝐺))
31, 2syl5eq 2667 . . . 4 (𝐺 ∈ ComplUSGraph → 𝐸 = ran (iEdg‘𝐺))
43adantr 481 . . 3 ((𝐺 ∈ ComplUSGraph ∧ 𝑉 ∈ Fin) → 𝐸 = ran (iEdg‘𝐺))
54fveq2d 6152 . 2 ((𝐺 ∈ ComplUSGraph ∧ 𝑉 ∈ Fin) → (#‘𝐸) = (#‘ran (iEdg‘𝐺)))
6 cusgrsizeindb0.v . . . . 5 𝑉 = (Vtx‘𝐺)
76opeq1i 4373 . . . 4 𝑉, (iEdg‘𝐺)⟩ = ⟨(Vtx‘𝐺), (iEdg‘𝐺)⟩
8 cusgrop 26221 . . . 4 (𝐺 ∈ ComplUSGraph → ⟨(Vtx‘𝐺), (iEdg‘𝐺)⟩ ∈ ComplUSGraph)
97, 8syl5eqel 2702 . . 3 (𝐺 ∈ ComplUSGraph → ⟨𝑉, (iEdg‘𝐺)⟩ ∈ ComplUSGraph)
10 fvex 6158 . . . 4 (iEdg‘𝐺) ∈ V
11 fvex 6158 . . . . 5 (Edg‘⟨𝑣, 𝑒⟩) ∈ V
12 rabexg 4772 . . . . . 6 ((Edg‘⟨𝑣, 𝑒⟩) ∈ V → {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐} ∈ V)
1312resiexd 6434 . . . . 5 ((Edg‘⟨𝑣, 𝑒⟩) ∈ V → ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}) ∈ V)
1411, 13ax-mp 5 . . . 4 ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}) ∈ V
15 rneq 5311 . . . . . 6 (𝑒 = (iEdg‘𝐺) → ran 𝑒 = ran (iEdg‘𝐺))
1615fveq2d 6152 . . . . 5 (𝑒 = (iEdg‘𝐺) → (#‘ran 𝑒) = (#‘ran (iEdg‘𝐺)))
17 fveq2 6148 . . . . . 6 (𝑣 = 𝑉 → (#‘𝑣) = (#‘𝑉))
1817oveq1d 6619 . . . . 5 (𝑣 = 𝑉 → ((#‘𝑣)C2) = ((#‘𝑉)C2))
1916, 18eqeqan12rd 2639 . . . 4 ((𝑣 = 𝑉𝑒 = (iEdg‘𝐺)) → ((#‘ran 𝑒) = ((#‘𝑣)C2) ↔ (#‘ran (iEdg‘𝐺)) = ((#‘𝑉)C2)))
20 rneq 5311 . . . . . 6 (𝑒 = 𝑓 → ran 𝑒 = ran 𝑓)
2120fveq2d 6152 . . . . 5 (𝑒 = 𝑓 → (#‘ran 𝑒) = (#‘ran 𝑓))
22 fveq2 6148 . . . . . 6 (𝑣 = 𝑤 → (#‘𝑣) = (#‘𝑤))
2322oveq1d 6619 . . . . 5 (𝑣 = 𝑤 → ((#‘𝑣)C2) = ((#‘𝑤)C2))
2421, 23eqeqan12rd 2639 . . . 4 ((𝑣 = 𝑤𝑒 = 𝑓) → ((#‘ran 𝑒) = ((#‘𝑣)C2) ↔ (#‘ran 𝑓) = ((#‘𝑤)C2)))
25 vex 3189 . . . . . . 7 𝑣 ∈ V
26 vex 3189 . . . . . . 7 𝑒 ∈ V
27 opvtxfv 25784 . . . . . . 7 ((𝑣 ∈ V ∧ 𝑒 ∈ V) → (Vtx‘⟨𝑣, 𝑒⟩) = 𝑣)
2825, 26, 27mp2an 707 . . . . . 6 (Vtx‘⟨𝑣, 𝑒⟩) = 𝑣
2928eqcomi 2630 . . . . 5 𝑣 = (Vtx‘⟨𝑣, 𝑒⟩)
30 eqid 2621 . . . . 5 (Edg‘⟨𝑣, 𝑒⟩) = (Edg‘⟨𝑣, 𝑒⟩)
31 eqid 2621 . . . . 5 {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐} = {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}
32 eqid 2621 . . . . 5 ⟨(𝑣 ∖ {𝑛}), ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})⟩ = ⟨(𝑣 ∖ {𝑛}), ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})⟩
3329, 30, 31, 32cusgrres 26231 . . . 4 ((⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ 𝑛𝑣) → ⟨(𝑣 ∖ {𝑛}), ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})⟩ ∈ ComplUSGraph)
34 rneq 5311 . . . . . . 7 (𝑓 = ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}) → ran 𝑓 = ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}))
3534fveq2d 6152 . . . . . 6 (𝑓 = ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}) → (#‘ran 𝑓) = (#‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})))
3635adantl 482 . . . . 5 ((𝑤 = (𝑣 ∖ {𝑛}) ∧ 𝑓 = ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) → (#‘ran 𝑓) = (#‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})))
37 fveq2 6148 . . . . . . 7 (𝑤 = (𝑣 ∖ {𝑛}) → (#‘𝑤) = (#‘(𝑣 ∖ {𝑛})))
3837adantr 481 . . . . . 6 ((𝑤 = (𝑣 ∖ {𝑛}) ∧ 𝑓 = ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) → (#‘𝑤) = (#‘(𝑣 ∖ {𝑛})))
3938oveq1d 6619 . . . . 5 ((𝑤 = (𝑣 ∖ {𝑛}) ∧ 𝑓 = ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) → ((#‘𝑤)C2) = ((#‘(𝑣 ∖ {𝑛}))C2))
4036, 39eqeq12d 2636 . . . 4 ((𝑤 = (𝑣 ∖ {𝑛}) ∧ 𝑓 = ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) → ((#‘ran 𝑓) = ((#‘𝑤)C2) ↔ (#‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) = ((#‘(𝑣 ∖ {𝑛}))C2)))
41 edgopval 25842 . . . . . . . . 9 ((𝑣 ∈ V ∧ 𝑒 ∈ V) → (Edg‘⟨𝑣, 𝑒⟩) = ran 𝑒)
4225, 26, 41mp2an 707 . . . . . . . 8 (Edg‘⟨𝑣, 𝑒⟩) = ran 𝑒
4342a1i 11 . . . . . . 7 ((⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (#‘𝑣) = 0) → (Edg‘⟨𝑣, 𝑒⟩) = ran 𝑒)
4443eqcomd 2627 . . . . . 6 ((⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (#‘𝑣) = 0) → ran 𝑒 = (Edg‘⟨𝑣, 𝑒⟩))
4544fveq2d 6152 . . . . 5 ((⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (#‘𝑣) = 0) → (#‘ran 𝑒) = (#‘(Edg‘⟨𝑣, 𝑒⟩)))
46 cusgrusgr 26202 . . . . . . 7 (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph → ⟨𝑣, 𝑒⟩ ∈ USGraph )
47 usgruhgr 25971 . . . . . . 7 (⟨𝑣, 𝑒⟩ ∈ USGraph → ⟨𝑣, 𝑒⟩ ∈ UHGraph )
4846, 47syl 17 . . . . . 6 (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph → ⟨𝑣, 𝑒⟩ ∈ UHGraph )
4929, 30cusgrsizeindb0 26232 . . . . . 6 ((⟨𝑣, 𝑒⟩ ∈ UHGraph ∧ (#‘𝑣) = 0) → (#‘(Edg‘⟨𝑣, 𝑒⟩)) = ((#‘𝑣)C2))
5048, 49sylan 488 . . . . 5 ((⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (#‘𝑣) = 0) → (#‘(Edg‘⟨𝑣, 𝑒⟩)) = ((#‘𝑣)C2))
5145, 50eqtrd 2655 . . . 4 ((⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (#‘𝑣) = 0) → (#‘ran 𝑒) = ((#‘𝑣)C2))
52 rnresi 5438 . . . . . . . . . 10 ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}) = {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}
5352fveq2i 6151 . . . . . . . . 9 (#‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) = (#‘{𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})
5442a1i 11 . . . . . . . . . . 11 (((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (#‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) → (Edg‘⟨𝑣, 𝑒⟩) = ran 𝑒)
5554rabeqdv 3180 . . . . . . . . . 10 (((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (#‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) → {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐} = {𝑐 ∈ ran 𝑒𝑛𝑐})
5655fveq2d 6152 . . . . . . . . 9 (((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (#‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) → (#‘{𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}) = (#‘{𝑐 ∈ ran 𝑒𝑛𝑐}))
5753, 56syl5eq 2667 . . . . . . . 8 (((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (#‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) → (#‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) = (#‘{𝑐 ∈ ran 𝑒𝑛𝑐}))
5857eqeq1d 2623 . . . . . . 7 (((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (#‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) → ((#‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) = ((#‘(𝑣 ∖ {𝑛}))C2) ↔ (#‘{𝑐 ∈ ran 𝑒𝑛𝑐}) = ((#‘(𝑣 ∖ {𝑛}))C2)))
5958biimpd 219 . . . . . 6 (((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (#‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) → ((#‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) = ((#‘(𝑣 ∖ {𝑛}))C2) → (#‘{𝑐 ∈ ran 𝑒𝑛𝑐}) = ((#‘(𝑣 ∖ {𝑛}))C2)))
6059imdistani 725 . . . . 5 ((((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (#‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) ∧ (#‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) = ((#‘(𝑣 ∖ {𝑛}))C2)) → (((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (#‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) ∧ (#‘{𝑐 ∈ ran 𝑒𝑛𝑐}) = ((#‘(𝑣 ∖ {𝑛}))C2)))
6142eqcomi 2630 . . . . . . 7 ran 𝑒 = (Edg‘⟨𝑣, 𝑒⟩)
62 eqid 2621 . . . . . . 7 {𝑐 ∈ ran 𝑒𝑛𝑐} = {𝑐 ∈ ran 𝑒𝑛𝑐}
6329, 61, 62cusgrsize2inds 26236 . . . . . 6 ((𝑦 + 1) ∈ ℕ0 → ((⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (#‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣) → ((#‘{𝑐 ∈ ran 𝑒𝑛𝑐}) = ((#‘(𝑣 ∖ {𝑛}))C2) → (#‘ran 𝑒) = ((#‘𝑣)C2))))
6463imp31 448 . . . . 5 ((((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (#‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) ∧ (#‘{𝑐 ∈ ran 𝑒𝑛𝑐}) = ((#‘(𝑣 ∖ {𝑛}))C2)) → (#‘ran 𝑒) = ((#‘𝑣)C2))
6560, 64syl 17 . . . 4 ((((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (#‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) ∧ (#‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) = ((#‘(𝑣 ∖ {𝑛}))C2)) → (#‘ran 𝑒) = ((#‘𝑣)C2))
6610, 14, 19, 24, 33, 40, 51, 65opfi1ind 13223 . . 3 ((⟨𝑉, (iEdg‘𝐺)⟩ ∈ ComplUSGraph ∧ 𝑉 ∈ Fin) → (#‘ran (iEdg‘𝐺)) = ((#‘𝑉)C2))
679, 66sylan 488 . 2 ((𝐺 ∈ ComplUSGraph ∧ 𝑉 ∈ Fin) → (#‘ran (iEdg‘𝐺)) = ((#‘𝑉)C2))
685, 67eqtrd 2655 1 ((𝐺 ∈ ComplUSGraph ∧ 𝑉 ∈ Fin) → (#‘𝐸) = ((#‘𝑉)C2))
 Colors of variables: wff setvar class Syntax hints:   → wi 4   ∧ wa 384   ∧ w3a 1036   = wceq 1480   ∈ wcel 1987   ∉ wnel 2893  {crab 2911  Vcvv 3186   ∖ cdif 3552  {csn 4148  ⟨cop 4154   I cid 4984  ran crn 5075   ↾ cres 5076  ‘cfv 5847  (class class class)co 6604  Fincfn 7899  0cc0 9880  1c1 9881   + caddc 9883  2c2 11014  ℕ0cn0 11236  Ccbc 13029  #chash 13057  Vtxcvtx 25774  iEdgciedg 25775  Edgcedg 25839   UHGraph cuhgr 25847   USGraph cusgr 25937  ComplUSGraphccusgr 26114 This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1719  ax-4 1734  ax-5 1836  ax-6 1885  ax-7 1932  ax-8 1989  ax-9 1996  ax-10 2016  ax-11 2031  ax-12 2044  ax-13 2245  ax-ext 2601  ax-rep 4731  ax-sep 4741  ax-nul 4749  ax-pow 4803  ax-pr 4867  ax-un 6902  ax-cnex 9936  ax-resscn 9937  ax-1cn 9938  ax-icn 9939  ax-addcl 9940  ax-addrcl 9941  ax-mulcl 9942  ax-mulrcl 9943  ax-mulcom 9944  ax-addass 9945  ax-mulass 9946  ax-distr 9947  ax-i2m1 9948  ax-1ne0 9949  ax-1rid 9950  ax-rnegex 9951  ax-rrecex 9952  ax-cnre 9953  ax-pre-lttri 9954  ax-pre-lttrn 9955  ax-pre-ltadd 9956  ax-pre-mulgt0 9957 This theorem depends on definitions:  df-bi 197  df-or 385  df-an 386  df-3or 1037  df-3an 1038  df-tru 1483  df-fal 1486  df-ex 1702  df-nf 1707  df-sb 1878  df-eu 2473  df-mo 2474  df-clab 2608  df-cleq 2614  df-clel 2617  df-nfc 2750  df-ne 2791  df-nel 2894  df-ral 2912  df-rex 2913  df-reu 2914  df-rmo 2915  df-rab 2916  df-v 3188  df-sbc 3418  df-csb 3515  df-dif 3558  df-un 3560  df-in 3562  df-ss 3569  df-pss 3571  df-nul 3892  df-if 4059  df-pw 4132  df-sn 4149  df-pr 4151  df-tp 4153  df-op 4155  df-uni 4403  df-int 4441  df-iun 4487  df-br 4614  df-opab 4674  df-mpt 4675  df-tr 4713  df-eprel 4985  df-id 4989  df-po 4995  df-so 4996  df-fr 5033  df-we 5035  df-xp 5080  df-rel 5081  df-cnv 5082  df-co 5083  df-dm 5084  df-rn 5085  df-res 5086  df-ima 5087  df-pred 5639  df-ord 5685  df-on 5686  df-lim 5687  df-suc 5688  df-iota 5810  df-fun 5849  df-fn 5850  df-f 5851  df-f1 5852  df-fo 5853  df-f1o 5854  df-fv 5855  df-riota 6565  df-ov 6607  df-oprab 6608  df-mpt2 6609  df-om 7013  df-1st 7113  df-2nd 7114  df-wrecs 7352  df-recs 7413  df-rdg 7451  df-1o 7505  df-2o 7506  df-oadd 7509  df-er 7687  df-en 7900  df-dom 7901  df-sdom 7902  df-fin 7903  df-card 8709  df-cda 8934  df-pnf 10020  df-mnf 10021  df-xr 10022  df-ltxr 10023  df-le 10024  df-sub 10212  df-neg 10213  df-div 10629  df-nn 10965  df-2 11023  df-n0 11237  df-xnn0 11308  df-z 11322  df-uz 11632  df-rp 11777  df-fz 12269  df-seq 12742  df-fac 13001  df-bc 13030  df-hash 13058  df-vtx 25776  df-iedg 25777  df-edg 25840  df-uhgr 25849  df-upgr 25873  df-umgr 25874  df-uspgr 25938  df-usgr 25939  df-fusgr 26097  df-nbgr 26115  df-uvtxa 26117  df-cplgr 26118  df-cusgr 26119 This theorem is referenced by:  fusgrmaxsize  26247
 Copyright terms: Public domain W3C validator