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

Theorem cusgrsize 27399
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 26997 . . . . 5 (Edg‘𝐺) = ran (iEdg‘𝐺)
31, 2eqtri 2762 . . . 4 𝐸 = ran (iEdg‘𝐺)
43a1i 11 . . 3 ((𝐺 ∈ ComplUSGraph ∧ 𝑉 ∈ Fin) → 𝐸 = ran (iEdg‘𝐺))
54fveq2d 6681 . 2 ((𝐺 ∈ ComplUSGraph ∧ 𝑉 ∈ Fin) → (♯‘𝐸) = (♯‘ran (iEdg‘𝐺)))
6 cusgrsizeindb0.v . . . . 5 𝑉 = (Vtx‘𝐺)
76opeq1i 4765 . . . 4 𝑉, (iEdg‘𝐺)⟩ = ⟨(Vtx‘𝐺), (iEdg‘𝐺)⟩
8 cusgrop 27383 . . . 4 (𝐺 ∈ ComplUSGraph → ⟨(Vtx‘𝐺), (iEdg‘𝐺)⟩ ∈ ComplUSGraph)
97, 8eqeltrid 2838 . . 3 (𝐺 ∈ ComplUSGraph → ⟨𝑉, (iEdg‘𝐺)⟩ ∈ ComplUSGraph)
10 fvex 6690 . . . 4 (iEdg‘𝐺) ∈ V
11 fvex 6690 . . . . 5 (Edg‘⟨𝑣, 𝑒⟩) ∈ V
12 rabexg 5200 . . . . . 6 ((Edg‘⟨𝑣, 𝑒⟩) ∈ V → {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐} ∈ V)
1312resiexd 6992 . . . . 5 ((Edg‘⟨𝑣, 𝑒⟩) ∈ V → ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}) ∈ V)
1411, 13ax-mp 5 . . . 4 ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}) ∈ V
15 rneq 5780 . . . . . 6 (𝑒 = (iEdg‘𝐺) → ran 𝑒 = ran (iEdg‘𝐺))
1615fveq2d 6681 . . . . 5 (𝑒 = (iEdg‘𝐺) → (♯‘ran 𝑒) = (♯‘ran (iEdg‘𝐺)))
17 fveq2 6677 . . . . . 6 (𝑣 = 𝑉 → (♯‘𝑣) = (♯‘𝑉))
1817oveq1d 7188 . . . . 5 (𝑣 = 𝑉 → ((♯‘𝑣)C2) = ((♯‘𝑉)C2))
1916, 18eqeqan12rd 2758 . . . 4 ((𝑣 = 𝑉𝑒 = (iEdg‘𝐺)) → ((♯‘ran 𝑒) = ((♯‘𝑣)C2) ↔ (♯‘ran (iEdg‘𝐺)) = ((♯‘𝑉)C2)))
20 rneq 5780 . . . . . 6 (𝑒 = 𝑓 → ran 𝑒 = ran 𝑓)
2120fveq2d 6681 . . . . 5 (𝑒 = 𝑓 → (♯‘ran 𝑒) = (♯‘ran 𝑓))
22 fveq2 6677 . . . . . 6 (𝑣 = 𝑤 → (♯‘𝑣) = (♯‘𝑤))
2322oveq1d 7188 . . . . 5 (𝑣 = 𝑤 → ((♯‘𝑣)C2) = ((♯‘𝑤)C2))
2421, 23eqeqan12rd 2758 . . . 4 ((𝑣 = 𝑤𝑒 = 𝑓) → ((♯‘ran 𝑒) = ((♯‘𝑣)C2) ↔ (♯‘ran 𝑓) = ((♯‘𝑤)C2)))
25 vex 3403 . . . . . . 7 𝑣 ∈ V
26 vex 3403 . . . . . . 7 𝑒 ∈ V
2725, 26opvtxfvi 26957 . . . . . 6 (Vtx‘⟨𝑣, 𝑒⟩) = 𝑣
2827eqcomi 2748 . . . . 5 𝑣 = (Vtx‘⟨𝑣, 𝑒⟩)
29 eqid 2739 . . . . 5 (Edg‘⟨𝑣, 𝑒⟩) = (Edg‘⟨𝑣, 𝑒⟩)
30 eqid 2739 . . . . 5 {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐} = {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}
31 eqid 2739 . . . . 5 ⟨(𝑣 ∖ {𝑛}), ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})⟩ = ⟨(𝑣 ∖ {𝑛}), ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})⟩
3228, 29, 30, 31cusgrres 27393 . . . 4 ((⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ 𝑛𝑣) → ⟨(𝑣 ∖ {𝑛}), ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})⟩ ∈ ComplUSGraph)
33 rneq 5780 . . . . . . 7 (𝑓 = ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}) → ran 𝑓 = ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}))
3433fveq2d 6681 . . . . . 6 (𝑓 = ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}) → (♯‘ran 𝑓) = (♯‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})))
3534adantl 485 . . . . 5 ((𝑤 = (𝑣 ∖ {𝑛}) ∧ 𝑓 = ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) → (♯‘ran 𝑓) = (♯‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})))
36 fveq2 6677 . . . . . . 7 (𝑤 = (𝑣 ∖ {𝑛}) → (♯‘𝑤) = (♯‘(𝑣 ∖ {𝑛})))
3736adantr 484 . . . . . 6 ((𝑤 = (𝑣 ∖ {𝑛}) ∧ 𝑓 = ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) → (♯‘𝑤) = (♯‘(𝑣 ∖ {𝑛})))
3837oveq1d 7188 . . . . 5 ((𝑤 = (𝑣 ∖ {𝑛}) ∧ 𝑓 = ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) → ((♯‘𝑤)C2) = ((♯‘(𝑣 ∖ {𝑛}))C2))
3935, 38eqeq12d 2755 . . . 4 ((𝑤 = (𝑣 ∖ {𝑛}) ∧ 𝑓 = ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) → ((♯‘ran 𝑓) = ((♯‘𝑤)C2) ↔ (♯‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) = ((♯‘(𝑣 ∖ {𝑛}))C2)))
40 edgopval 26999 . . . . . . . . 9 ((𝑣 ∈ V ∧ 𝑒 ∈ V) → (Edg‘⟨𝑣, 𝑒⟩) = ran 𝑒)
4140el2v 3407 . . . . . . . 8 (Edg‘⟨𝑣, 𝑒⟩) = ran 𝑒
4241a1i 11 . . . . . . 7 ((⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = 0) → (Edg‘⟨𝑣, 𝑒⟩) = ran 𝑒)
4342eqcomd 2745 . . . . . 6 ((⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = 0) → ran 𝑒 = (Edg‘⟨𝑣, 𝑒⟩))
4443fveq2d 6681 . . . . 5 ((⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = 0) → (♯‘ran 𝑒) = (♯‘(Edg‘⟨𝑣, 𝑒⟩)))
45 cusgrusgr 27364 . . . . . . 7 (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph → ⟨𝑣, 𝑒⟩ ∈ USGraph)
46 usgruhgr 27131 . . . . . . 7 (⟨𝑣, 𝑒⟩ ∈ USGraph → ⟨𝑣, 𝑒⟩ ∈ UHGraph)
4745, 46syl 17 . . . . . 6 (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph → ⟨𝑣, 𝑒⟩ ∈ UHGraph)
4828, 29cusgrsizeindb0 27394 . . . . . 6 ((⟨𝑣, 𝑒⟩ ∈ UHGraph ∧ (♯‘𝑣) = 0) → (♯‘(Edg‘⟨𝑣, 𝑒⟩)) = ((♯‘𝑣)C2))
4947, 48sylan 583 . . . . 5 ((⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = 0) → (♯‘(Edg‘⟨𝑣, 𝑒⟩)) = ((♯‘𝑣)C2))
5044, 49eqtrd 2774 . . . 4 ((⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = 0) → (♯‘ran 𝑒) = ((♯‘𝑣)C2))
51 rnresi 5918 . . . . . . . . . 10 ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}) = {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}
5251fveq2i 6680 . . . . . . . . 9 (♯‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) = (♯‘{𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})
5341a1i 11 . . . . . . . . . . 11 (((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) → (Edg‘⟨𝑣, 𝑒⟩) = ran 𝑒)
5453rabeqdv 3387 . . . . . . . . . 10 (((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) → {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐} = {𝑐 ∈ ran 𝑒𝑛𝑐})
5554fveq2d 6681 . . . . . . . . 9 (((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) → (♯‘{𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}) = (♯‘{𝑐 ∈ ran 𝑒𝑛𝑐}))
5652, 55syl5eq 2786 . . . . . . . 8 (((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) → (♯‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) = (♯‘{𝑐 ∈ ran 𝑒𝑛𝑐}))
5756eqeq1d 2741 . . . . . . 7 (((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) → ((♯‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) = ((♯‘(𝑣 ∖ {𝑛}))C2) ↔ (♯‘{𝑐 ∈ ran 𝑒𝑛𝑐}) = ((♯‘(𝑣 ∖ {𝑛}))C2)))
5857biimpd 232 . . . . . 6 (((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) → ((♯‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) = ((♯‘(𝑣 ∖ {𝑛}))C2) → (♯‘{𝑐 ∈ ran 𝑒𝑛𝑐}) = ((♯‘(𝑣 ∖ {𝑛}))C2)))
5958imdistani 572 . . . . 5 ((((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) ∧ (♯‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) = ((♯‘(𝑣 ∖ {𝑛}))C2)) → (((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) ∧ (♯‘{𝑐 ∈ ran 𝑒𝑛𝑐}) = ((♯‘(𝑣 ∖ {𝑛}))C2)))
6041eqcomi 2748 . . . . . . 7 ran 𝑒 = (Edg‘⟨𝑣, 𝑒⟩)
61 eqid 2739 . . . . . . 7 {𝑐 ∈ ran 𝑒𝑛𝑐} = {𝑐 ∈ ran 𝑒𝑛𝑐}
6228, 60, 61cusgrsize2inds 27398 . . . . . 6 ((𝑦 + 1) ∈ ℕ0 → ((⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣) → ((♯‘{𝑐 ∈ ran 𝑒𝑛𝑐}) = ((♯‘(𝑣 ∖ {𝑛}))C2) → (♯‘ran 𝑒) = ((♯‘𝑣)C2))))
6362imp31 421 . . . . 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 13957 . . 3 ((⟨𝑉, (iEdg‘𝐺)⟩ ∈ ComplUSGraph ∧ 𝑉 ∈ Fin) → (♯‘ran (iEdg‘𝐺)) = ((♯‘𝑉)C2))
669, 65sylan 583 . 2 ((𝐺 ∈ ComplUSGraph ∧ 𝑉 ∈ Fin) → (♯‘ran (iEdg‘𝐺)) = ((♯‘𝑉)C2))
675, 66eqtrd 2774 1 ((𝐺 ∈ ComplUSGraph ∧ 𝑉 ∈ Fin) → (♯‘𝐸) = ((♯‘𝑉)C2))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 399  w3a 1088   = wceq 1542  wcel 2114  wnel 3039  {crab 3058  Vcvv 3399  cdif 3841  {csn 4517  cop 4523   I cid 5429  ran crn 5527  cres 5528  cfv 6340  (class class class)co 7173  Fincfn 8558  0cc0 10618  1c1 10619   + caddc 10621  2c2 11774  0cn0 11979  Ccbc 13757  chash 13785  Vtxcvtx 26944  iEdgciedg 26945  Edgcedg 26995  UHGraphcuhgr 27004  USGraphcusgr 27097  ComplUSGraphccusgr 27355
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1802  ax-4 1816  ax-5 1917  ax-6 1975  ax-7 2020  ax-8 2116  ax-9 2124  ax-10 2145  ax-11 2162  ax-12 2179  ax-ext 2711  ax-rep 5155  ax-sep 5168  ax-nul 5175  ax-pow 5233  ax-pr 5297  ax-un 7482  ax-cnex 10674  ax-resscn 10675  ax-1cn 10676  ax-icn 10677  ax-addcl 10678  ax-addrcl 10679  ax-mulcl 10680  ax-mulrcl 10681  ax-mulcom 10682  ax-addass 10683  ax-mulass 10684  ax-distr 10685  ax-i2m1 10686  ax-1ne0 10687  ax-1rid 10688  ax-rnegex 10689  ax-rrecex 10690  ax-cnre 10691  ax-pre-lttri 10692  ax-pre-lttrn 10693  ax-pre-ltadd 10694  ax-pre-mulgt0 10695
This theorem depends on definitions:  df-bi 210  df-an 400  df-or 847  df-3or 1089  df-3an 1090  df-tru 1545  df-fal 1555  df-ex 1787  df-nf 1791  df-sb 2075  df-mo 2541  df-eu 2571  df-clab 2718  df-cleq 2731  df-clel 2812  df-nfc 2882  df-ne 2936  df-nel 3040  df-ral 3059  df-rex 3060  df-reu 3061  df-rmo 3062  df-rab 3063  df-v 3401  df-sbc 3682  df-csb 3792  df-dif 3847  df-un 3849  df-in 3851  df-ss 3861  df-pss 3863  df-nul 4213  df-if 4416  df-pw 4491  df-sn 4518  df-pr 4520  df-tp 4522  df-op 4524  df-uni 4798  df-int 4838  df-iun 4884  df-br 5032  df-opab 5094  df-mpt 5112  df-tr 5138  df-id 5430  df-eprel 5435  df-po 5443  df-so 5444  df-fr 5484  df-we 5486  df-xp 5532  df-rel 5533  df-cnv 5534  df-co 5535  df-dm 5536  df-rn 5537  df-res 5538  df-ima 5539  df-pred 6130  df-ord 6176  df-on 6177  df-lim 6178  df-suc 6179  df-iota 6298  df-fun 6342  df-fn 6343  df-f 6344  df-f1 6345  df-fo 6346  df-f1o 6347  df-fv 6348  df-riota 7130  df-ov 7176  df-oprab 7177  df-mpo 7178  df-om 7603  df-1st 7717  df-2nd 7718  df-wrecs 7979  df-recs 8040  df-rdg 8078  df-1o 8134  df-2o 8135  df-oadd 8138  df-er 8323  df-en 8559  df-dom 8560  df-sdom 8561  df-fin 8562  df-dju 9406  df-card 9444  df-pnf 10758  df-mnf 10759  df-xr 10760  df-ltxr 10761  df-le 10762  df-sub 10953  df-neg 10954  df-div 11379  df-nn 11720  df-2 11782  df-n0 11980  df-xnn0 12052  df-z 12066  df-uz 12328  df-rp 12476  df-fz 12985  df-seq 13464  df-fac 13729  df-bc 13758  df-hash 13786  df-vtx 26946  df-iedg 26947  df-edg 26996  df-uhgr 27006  df-upgr 27030  df-umgr 27031  df-uspgr 27098  df-usgr 27099  df-fusgr 27262  df-nbgr 27278  df-uvtx 27331  df-cplgr 27356  df-cusgr 27357
This theorem is referenced by:  fusgrmaxsize  27409
  Copyright terms: Public domain W3C validator