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

Theorem cusgrsize 26584
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 26161 . . . . 5 (Edg‘𝐺) = ran (iEdg‘𝐺)
31, 2eqtri 2792 . . . 4 𝐸 = ran (iEdg‘𝐺)
43a1i 11 . . 3 ((𝐺 ∈ ComplUSGraph ∧ 𝑉 ∈ Fin) → 𝐸 = ran (iEdg‘𝐺))
54fveq2d 6336 . 2 ((𝐺 ∈ ComplUSGraph ∧ 𝑉 ∈ Fin) → (♯‘𝐸) = (♯‘ran (iEdg‘𝐺)))
6 cusgrsizeindb0.v . . . . 5 𝑉 = (Vtx‘𝐺)
76opeq1i 4540 . . . 4 𝑉, (iEdg‘𝐺)⟩ = ⟨(Vtx‘𝐺), (iEdg‘𝐺)⟩
8 cusgrop 26568 . . . 4 (𝐺 ∈ ComplUSGraph → ⟨(Vtx‘𝐺), (iEdg‘𝐺)⟩ ∈ ComplUSGraph)
97, 8syl5eqel 2853 . . 3 (𝐺 ∈ ComplUSGraph → ⟨𝑉, (iEdg‘𝐺)⟩ ∈ ComplUSGraph)
10 fvex 6342 . . . 4 (iEdg‘𝐺) ∈ V
11 fvex 6342 . . . . 5 (Edg‘⟨𝑣, 𝑒⟩) ∈ V
12 rabexg 4942 . . . . . 6 ((Edg‘⟨𝑣, 𝑒⟩) ∈ V → {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐} ∈ V)
1312resiexd 6623 . . . . 5 ((Edg‘⟨𝑣, 𝑒⟩) ∈ V → ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}) ∈ V)
1411, 13ax-mp 5 . . . 4 ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}) ∈ V
15 rneq 5489 . . . . . 6 (𝑒 = (iEdg‘𝐺) → ran 𝑒 = ran (iEdg‘𝐺))
1615fveq2d 6336 . . . . 5 (𝑒 = (iEdg‘𝐺) → (♯‘ran 𝑒) = (♯‘ran (iEdg‘𝐺)))
17 fveq2 6332 . . . . . 6 (𝑣 = 𝑉 → (♯‘𝑣) = (♯‘𝑉))
1817oveq1d 6807 . . . . 5 (𝑣 = 𝑉 → ((♯‘𝑣)C2) = ((♯‘𝑉)C2))
1916, 18eqeqan12rd 2788 . . . 4 ((𝑣 = 𝑉𝑒 = (iEdg‘𝐺)) → ((♯‘ran 𝑒) = ((♯‘𝑣)C2) ↔ (♯‘ran (iEdg‘𝐺)) = ((♯‘𝑉)C2)))
20 rneq 5489 . . . . . 6 (𝑒 = 𝑓 → ran 𝑒 = ran 𝑓)
2120fveq2d 6336 . . . . 5 (𝑒 = 𝑓 → (♯‘ran 𝑒) = (♯‘ran 𝑓))
22 fveq2 6332 . . . . . 6 (𝑣 = 𝑤 → (♯‘𝑣) = (♯‘𝑤))
2322oveq1d 6807 . . . . 5 (𝑣 = 𝑤 → ((♯‘𝑣)C2) = ((♯‘𝑤)C2))
2421, 23eqeqan12rd 2788 . . . 4 ((𝑣 = 𝑤𝑒 = 𝑓) → ((♯‘ran 𝑒) = ((♯‘𝑣)C2) ↔ (♯‘ran 𝑓) = ((♯‘𝑤)C2)))
25 vex 3352 . . . . . . 7 𝑣 ∈ V
26 vex 3352 . . . . . . 7 𝑒 ∈ V
2725, 26opvtxfvi 26109 . . . . . 6 (Vtx‘⟨𝑣, 𝑒⟩) = 𝑣
2827eqcomi 2779 . . . . 5 𝑣 = (Vtx‘⟨𝑣, 𝑒⟩)
29 eqid 2770 . . . . 5 (Edg‘⟨𝑣, 𝑒⟩) = (Edg‘⟨𝑣, 𝑒⟩)
30 eqid 2770 . . . . 5 {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐} = {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}
31 eqid 2770 . . . . 5 ⟨(𝑣 ∖ {𝑛}), ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})⟩ = ⟨(𝑣 ∖ {𝑛}), ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})⟩
3228, 29, 30, 31cusgrres 26578 . . . 4 ((⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ 𝑛𝑣) → ⟨(𝑣 ∖ {𝑛}), ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})⟩ ∈ ComplUSGraph)
33 rneq 5489 . . . . . . 7 (𝑓 = ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}) → ran 𝑓 = ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}))
3433fveq2d 6336 . . . . . 6 (𝑓 = ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}) → (♯‘ran 𝑓) = (♯‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})))
3534adantl 467 . . . . 5 ((𝑤 = (𝑣 ∖ {𝑛}) ∧ 𝑓 = ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) → (♯‘ran 𝑓) = (♯‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})))
36 fveq2 6332 . . . . . . 7 (𝑤 = (𝑣 ∖ {𝑛}) → (♯‘𝑤) = (♯‘(𝑣 ∖ {𝑛})))
3736adantr 466 . . . . . 6 ((𝑤 = (𝑣 ∖ {𝑛}) ∧ 𝑓 = ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) → (♯‘𝑤) = (♯‘(𝑣 ∖ {𝑛})))
3837oveq1d 6807 . . . . 5 ((𝑤 = (𝑣 ∖ {𝑛}) ∧ 𝑓 = ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) → ((♯‘𝑤)C2) = ((♯‘(𝑣 ∖ {𝑛}))C2))
3935, 38eqeq12d 2785 . . . 4 ((𝑤 = (𝑣 ∖ {𝑛}) ∧ 𝑓 = ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) → ((♯‘ran 𝑓) = ((♯‘𝑤)C2) ↔ (♯‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) = ((♯‘(𝑣 ∖ {𝑛}))C2)))
40 edgopval 26164 . . . . . . . . 9 ((𝑣 ∈ V ∧ 𝑒 ∈ V) → (Edg‘⟨𝑣, 𝑒⟩) = ran 𝑒)
4125, 26, 40mp2an 664 . . . . . . . 8 (Edg‘⟨𝑣, 𝑒⟩) = ran 𝑒
4241a1i 11 . . . . . . 7 ((⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = 0) → (Edg‘⟨𝑣, 𝑒⟩) = ran 𝑒)
4342eqcomd 2776 . . . . . 6 ((⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = 0) → ran 𝑒 = (Edg‘⟨𝑣, 𝑒⟩))
4443fveq2d 6336 . . . . 5 ((⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = 0) → (♯‘ran 𝑒) = (♯‘(Edg‘⟨𝑣, 𝑒⟩)))
45 cusgrusgr 26549 . . . . . . 7 (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph → ⟨𝑣, 𝑒⟩ ∈ USGraph)
46 usgruhgr 26299 . . . . . . 7 (⟨𝑣, 𝑒⟩ ∈ USGraph → ⟨𝑣, 𝑒⟩ ∈ UHGraph)
4745, 46syl 17 . . . . . 6 (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph → ⟨𝑣, 𝑒⟩ ∈ UHGraph)
4828, 29cusgrsizeindb0 26579 . . . . . 6 ((⟨𝑣, 𝑒⟩ ∈ UHGraph ∧ (♯‘𝑣) = 0) → (♯‘(Edg‘⟨𝑣, 𝑒⟩)) = ((♯‘𝑣)C2))
4947, 48sylan 561 . . . . 5 ((⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = 0) → (♯‘(Edg‘⟨𝑣, 𝑒⟩)) = ((♯‘𝑣)C2))
5044, 49eqtrd 2804 . . . 4 ((⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = 0) → (♯‘ran 𝑒) = ((♯‘𝑣)C2))
51 rnresi 5620 . . . . . . . . . 10 ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}) = {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}
5251fveq2i 6335 . . . . . . . . 9 (♯‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) = (♯‘{𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})
5341a1i 11 . . . . . . . . . . 11 (((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) → (Edg‘⟨𝑣, 𝑒⟩) = ran 𝑒)
5453rabeqdv 3343 . . . . . . . . . 10 (((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) → {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐} = {𝑐 ∈ ran 𝑒𝑛𝑐})
5554fveq2d 6336 . . . . . . . . 9 (((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) → (♯‘{𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}) = (♯‘{𝑐 ∈ ran 𝑒𝑛𝑐}))
5652, 55syl5eq 2816 . . . . . . . 8 (((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) → (♯‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) = (♯‘{𝑐 ∈ ran 𝑒𝑛𝑐}))
5756eqeq1d 2772 . . . . . . 7 (((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) → ((♯‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) = ((♯‘(𝑣 ∖ {𝑛}))C2) ↔ (♯‘{𝑐 ∈ ran 𝑒𝑛𝑐}) = ((♯‘(𝑣 ∖ {𝑛}))C2)))
5857biimpd 219 . . . . . 6 (((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) → ((♯‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) = ((♯‘(𝑣 ∖ {𝑛}))C2) → (♯‘{𝑐 ∈ ran 𝑒𝑛𝑐}) = ((♯‘(𝑣 ∖ {𝑛}))C2)))
5958imdistani 550 . . . . 5 ((((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) ∧ (♯‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) = ((♯‘(𝑣 ∖ {𝑛}))C2)) → (((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) ∧ (♯‘{𝑐 ∈ ran 𝑒𝑛𝑐}) = ((♯‘(𝑣 ∖ {𝑛}))C2)))
6041eqcomi 2779 . . . . . . 7 ran 𝑒 = (Edg‘⟨𝑣, 𝑒⟩)
61 eqid 2770 . . . . . . 7 {𝑐 ∈ ran 𝑒𝑛𝑐} = {𝑐 ∈ ran 𝑒𝑛𝑐}
6228, 60, 61cusgrsize2inds 26583 . . . . . 6 ((𝑦 + 1) ∈ ℕ0 → ((⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣) → ((♯‘{𝑐 ∈ ran 𝑒𝑛𝑐}) = ((♯‘(𝑣 ∖ {𝑛}))C2) → (♯‘ran 𝑒) = ((♯‘𝑣)C2))))
6362imp31 404 . . . . 5 ((((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) ∧ (♯‘{𝑐 ∈ ran 𝑒𝑛𝑐}) = ((♯‘(𝑣 ∖ {𝑛}))C2)) → (♯‘ran 𝑒) = ((♯‘𝑣)C2))
6459, 63syl 17 . . . 4 ((((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) ∧ (♯‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) = ((♯‘(𝑣 ∖ {𝑛}))C2)) → (♯‘ran 𝑒) = ((♯‘𝑣)C2))
6510, 14, 19, 24, 32, 39, 50, 64opfi1ind 13485 . . 3 ((⟨𝑉, (iEdg‘𝐺)⟩ ∈ ComplUSGraph ∧ 𝑉 ∈ Fin) → (♯‘ran (iEdg‘𝐺)) = ((♯‘𝑉)C2))
669, 65sylan 561 . 2 ((𝐺 ∈ ComplUSGraph ∧ 𝑉 ∈ Fin) → (♯‘ran (iEdg‘𝐺)) = ((♯‘𝑉)C2))
675, 66eqtrd 2804 1 ((𝐺 ∈ ComplUSGraph ∧ 𝑉 ∈ Fin) → (♯‘𝐸) = ((♯‘𝑉)C2))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 382  w3a 1070   = wceq 1630  wcel 2144  wnel 3045  {crab 3064  Vcvv 3349  cdif 3718  {csn 4314  cop 4320   I cid 5156  ran crn 5250  cres 5251  cfv 6031  (class class class)co 6792  Fincfn 8108  0cc0 10137  1c1 10138   + caddc 10140  2c2 11271  0cn0 11493  Ccbc 13292  chash 13320  Vtxcvtx 26094  iEdgciedg 26095  Edgcedg 26159  UHGraphcuhgr 26171  USGraphcusgr 26265  ComplUSGraphccusgr 26539
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1869  ax-4 1884  ax-5 1990  ax-6 2056  ax-7 2092  ax-8 2146  ax-9 2153  ax-10 2173  ax-11 2189  ax-12 2202  ax-13 2407  ax-ext 2750  ax-rep 4902  ax-sep 4912  ax-nul 4920  ax-pow 4971  ax-pr 5034  ax-un 7095  ax-cnex 10193  ax-resscn 10194  ax-1cn 10195  ax-icn 10196  ax-addcl 10197  ax-addrcl 10198  ax-mulcl 10199  ax-mulrcl 10200  ax-mulcom 10201  ax-addass 10202  ax-mulass 10203  ax-distr 10204  ax-i2m1 10205  ax-1ne0 10206  ax-1rid 10207  ax-rnegex 10208  ax-rrecex 10209  ax-cnre 10210  ax-pre-lttri 10211  ax-pre-lttrn 10212  ax-pre-ltadd 10213  ax-pre-mulgt0 10214
This theorem depends on definitions:  df-bi 197  df-an 383  df-or 827  df-3or 1071  df-3an 1072  df-tru 1633  df-fal 1636  df-ex 1852  df-nf 1857  df-sb 2049  df-eu 2621  df-mo 2622  df-clab 2757  df-cleq 2763  df-clel 2766  df-nfc 2901  df-ne 2943  df-nel 3046  df-ral 3065  df-rex 3066  df-reu 3067  df-rmo 3068  df-rab 3069  df-v 3351  df-sbc 3586  df-csb 3681  df-dif 3724  df-un 3726  df-in 3728  df-ss 3735  df-pss 3737  df-nul 4062  df-if 4224  df-pw 4297  df-sn 4315  df-pr 4317  df-tp 4319  df-op 4321  df-uni 4573  df-int 4610  df-iun 4654  df-br 4785  df-opab 4845  df-mpt 4862  df-tr 4885  df-id 5157  df-eprel 5162  df-po 5170  df-so 5171  df-fr 5208  df-we 5210  df-xp 5255  df-rel 5256  df-cnv 5257  df-co 5258  df-dm 5259  df-rn 5260  df-res 5261  df-ima 5262  df-pred 5823  df-ord 5869  df-on 5870  df-lim 5871  df-suc 5872  df-iota 5994  df-fun 6033  df-fn 6034  df-f 6035  df-f1 6036  df-fo 6037  df-f1o 6038  df-fv 6039  df-riota 6753  df-ov 6795  df-oprab 6796  df-mpt2 6797  df-om 7212  df-1st 7314  df-2nd 7315  df-wrecs 7558  df-recs 7620  df-rdg 7658  df-1o 7712  df-2o 7713  df-oadd 7716  df-er 7895  df-en 8109  df-dom 8110  df-sdom 8111  df-fin 8112  df-card 8964  df-cda 9191  df-pnf 10277  df-mnf 10278  df-xr 10279  df-ltxr 10280  df-le 10281  df-sub 10469  df-neg 10470  df-div 10886  df-nn 11222  df-2 11280  df-n0 11494  df-xnn0 11565  df-z 11579  df-uz 11888  df-rp 12035  df-fz 12533  df-seq 13008  df-fac 13264  df-bc 13293  df-hash 13321  df-vtx 26096  df-iedg 26097  df-edg 26160  df-uhgr 26173  df-upgr 26197  df-umgr 26198  df-uspgr 26266  df-usgr 26267  df-fusgr 26431  df-nbgr 26447  df-uvtx 26510  df-cplgr 26540  df-cusgr 26541
This theorem is referenced by:  fusgrmaxsize  26594
  Copyright terms: Public domain W3C validator