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

Theorem cusgrsize 26560
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 26140 . . . . 5 (Edg‘𝐺) = ran (iEdg‘𝐺)
31, 2eqtri 2782 . . . 4 𝐸 = ran (iEdg‘𝐺)
43a1i 11 . . 3 ((𝐺 ∈ ComplUSGraph ∧ 𝑉 ∈ Fin) → 𝐸 = ran (iEdg‘𝐺))
54fveq2d 6356 . 2 ((𝐺 ∈ ComplUSGraph ∧ 𝑉 ∈ Fin) → (♯‘𝐸) = (♯‘ran (iEdg‘𝐺)))
6 cusgrsizeindb0.v . . . . 5 𝑉 = (Vtx‘𝐺)
76opeq1i 4556 . . . 4 𝑉, (iEdg‘𝐺)⟩ = ⟨(Vtx‘𝐺), (iEdg‘𝐺)⟩
8 cusgrop 26544 . . . 4 (𝐺 ∈ ComplUSGraph → ⟨(Vtx‘𝐺), (iEdg‘𝐺)⟩ ∈ ComplUSGraph)
97, 8syl5eqel 2843 . . 3 (𝐺 ∈ ComplUSGraph → ⟨𝑉, (iEdg‘𝐺)⟩ ∈ ComplUSGraph)
10 fvex 6362 . . . 4 (iEdg‘𝐺) ∈ V
11 fvex 6362 . . . . 5 (Edg‘⟨𝑣, 𝑒⟩) ∈ V
12 rabexg 4963 . . . . . 6 ((Edg‘⟨𝑣, 𝑒⟩) ∈ V → {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐} ∈ V)
1312resiexd 6644 . . . . 5 ((Edg‘⟨𝑣, 𝑒⟩) ∈ V → ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}) ∈ V)
1411, 13ax-mp 5 . . . 4 ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}) ∈ V
15 rneq 5506 . . . . . 6 (𝑒 = (iEdg‘𝐺) → ran 𝑒 = ran (iEdg‘𝐺))
1615fveq2d 6356 . . . . 5 (𝑒 = (iEdg‘𝐺) → (♯‘ran 𝑒) = (♯‘ran (iEdg‘𝐺)))
17 fveq2 6352 . . . . . 6 (𝑣 = 𝑉 → (♯‘𝑣) = (♯‘𝑉))
1817oveq1d 6828 . . . . 5 (𝑣 = 𝑉 → ((♯‘𝑣)C2) = ((♯‘𝑉)C2))
1916, 18eqeqan12rd 2778 . . . 4 ((𝑣 = 𝑉𝑒 = (iEdg‘𝐺)) → ((♯‘ran 𝑒) = ((♯‘𝑣)C2) ↔ (♯‘ran (iEdg‘𝐺)) = ((♯‘𝑉)C2)))
20 rneq 5506 . . . . . 6 (𝑒 = 𝑓 → ran 𝑒 = ran 𝑓)
2120fveq2d 6356 . . . . 5 (𝑒 = 𝑓 → (♯‘ran 𝑒) = (♯‘ran 𝑓))
22 fveq2 6352 . . . . . 6 (𝑣 = 𝑤 → (♯‘𝑣) = (♯‘𝑤))
2322oveq1d 6828 . . . . 5 (𝑣 = 𝑤 → ((♯‘𝑣)C2) = ((♯‘𝑤)C2))
2421, 23eqeqan12rd 2778 . . . 4 ((𝑣 = 𝑤𝑒 = 𝑓) → ((♯‘ran 𝑒) = ((♯‘𝑣)C2) ↔ (♯‘ran 𝑓) = ((♯‘𝑤)C2)))
25 vex 3343 . . . . . . 7 𝑣 ∈ V
26 vex 3343 . . . . . . 7 𝑒 ∈ V
2725, 26opvtxfvi 26088 . . . . . 6 (Vtx‘⟨𝑣, 𝑒⟩) = 𝑣
2827eqcomi 2769 . . . . 5 𝑣 = (Vtx‘⟨𝑣, 𝑒⟩)
29 eqid 2760 . . . . 5 (Edg‘⟨𝑣, 𝑒⟩) = (Edg‘⟨𝑣, 𝑒⟩)
30 eqid 2760 . . . . 5 {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐} = {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}
31 eqid 2760 . . . . 5 ⟨(𝑣 ∖ {𝑛}), ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})⟩ = ⟨(𝑣 ∖ {𝑛}), ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})⟩
3228, 29, 30, 31cusgrres 26554 . . . 4 ((⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ 𝑛𝑣) → ⟨(𝑣 ∖ {𝑛}), ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})⟩ ∈ ComplUSGraph)
33 rneq 5506 . . . . . . 7 (𝑓 = ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}) → ran 𝑓 = ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}))
3433fveq2d 6356 . . . . . 6 (𝑓 = ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}) → (♯‘ran 𝑓) = (♯‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})))
3534adantl 473 . . . . 5 ((𝑤 = (𝑣 ∖ {𝑛}) ∧ 𝑓 = ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) → (♯‘ran 𝑓) = (♯‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})))
36 fveq2 6352 . . . . . . 7 (𝑤 = (𝑣 ∖ {𝑛}) → (♯‘𝑤) = (♯‘(𝑣 ∖ {𝑛})))
3736adantr 472 . . . . . 6 ((𝑤 = (𝑣 ∖ {𝑛}) ∧ 𝑓 = ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) → (♯‘𝑤) = (♯‘(𝑣 ∖ {𝑛})))
3837oveq1d 6828 . . . . 5 ((𝑤 = (𝑣 ∖ {𝑛}) ∧ 𝑓 = ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) → ((♯‘𝑤)C2) = ((♯‘(𝑣 ∖ {𝑛}))C2))
3935, 38eqeq12d 2775 . . . 4 ((𝑤 = (𝑣 ∖ {𝑛}) ∧ 𝑓 = ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) → ((♯‘ran 𝑓) = ((♯‘𝑤)C2) ↔ (♯‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) = ((♯‘(𝑣 ∖ {𝑛}))C2)))
40 edgopval 26143 . . . . . . . . 9 ((𝑣 ∈ V ∧ 𝑒 ∈ V) → (Edg‘⟨𝑣, 𝑒⟩) = ran 𝑒)
4125, 26, 40mp2an 710 . . . . . . . 8 (Edg‘⟨𝑣, 𝑒⟩) = ran 𝑒
4241a1i 11 . . . . . . 7 ((⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = 0) → (Edg‘⟨𝑣, 𝑒⟩) = ran 𝑒)
4342eqcomd 2766 . . . . . 6 ((⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = 0) → ran 𝑒 = (Edg‘⟨𝑣, 𝑒⟩))
4443fveq2d 6356 . . . . 5 ((⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = 0) → (♯‘ran 𝑒) = (♯‘(Edg‘⟨𝑣, 𝑒⟩)))
45 cusgrusgr 26525 . . . . . . 7 (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph → ⟨𝑣, 𝑒⟩ ∈ USGraph)
46 usgruhgr 26277 . . . . . . 7 (⟨𝑣, 𝑒⟩ ∈ USGraph → ⟨𝑣, 𝑒⟩ ∈ UHGraph)
4745, 46syl 17 . . . . . 6 (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph → ⟨𝑣, 𝑒⟩ ∈ UHGraph)
4828, 29cusgrsizeindb0 26555 . . . . . 6 ((⟨𝑣, 𝑒⟩ ∈ UHGraph ∧ (♯‘𝑣) = 0) → (♯‘(Edg‘⟨𝑣, 𝑒⟩)) = ((♯‘𝑣)C2))
4947, 48sylan 489 . . . . 5 ((⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = 0) → (♯‘(Edg‘⟨𝑣, 𝑒⟩)) = ((♯‘𝑣)C2))
5044, 49eqtrd 2794 . . . 4 ((⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = 0) → (♯‘ran 𝑒) = ((♯‘𝑣)C2))
51 rnresi 5637 . . . . . . . . . 10 ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}) = {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}
5251fveq2i 6355 . . . . . . . . 9 (♯‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) = (♯‘{𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})
5341a1i 11 . . . . . . . . . . 11 (((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) → (Edg‘⟨𝑣, 𝑒⟩) = ran 𝑒)
5453rabeqdv 3334 . . . . . . . . . 10 (((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) → {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐} = {𝑐 ∈ ran 𝑒𝑛𝑐})
5554fveq2d 6356 . . . . . . . . 9 (((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) → (♯‘{𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐}) = (♯‘{𝑐 ∈ ran 𝑒𝑛𝑐}))
5652, 55syl5eq 2806 . . . . . . . 8 (((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) → (♯‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) = (♯‘{𝑐 ∈ ran 𝑒𝑛𝑐}))
5756eqeq1d 2762 . . . . . . 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 728 . . . . 5 ((((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) ∧ (♯‘ran ( I ↾ {𝑐 ∈ (Edg‘⟨𝑣, 𝑒⟩) ∣ 𝑛𝑐})) = ((♯‘(𝑣 ∖ {𝑛}))C2)) → (((𝑦 + 1) ∈ ℕ0 ∧ (⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣)) ∧ (♯‘{𝑐 ∈ ran 𝑒𝑛𝑐}) = ((♯‘(𝑣 ∖ {𝑛}))C2)))
6041eqcomi 2769 . . . . . . 7 ran 𝑒 = (Edg‘⟨𝑣, 𝑒⟩)
61 eqid 2760 . . . . . . 7 {𝑐 ∈ ran 𝑒𝑛𝑐} = {𝑐 ∈ ran 𝑒𝑛𝑐}
6228, 60, 61cusgrsize2inds 26559 . . . . . 6 ((𝑦 + 1) ∈ ℕ0 → ((⟨𝑣, 𝑒⟩ ∈ ComplUSGraph ∧ (♯‘𝑣) = (𝑦 + 1) ∧ 𝑛𝑣) → ((♯‘{𝑐 ∈ ran 𝑒𝑛𝑐}) = ((♯‘(𝑣 ∖ {𝑛}))C2) → (♯‘ran 𝑒) = ((♯‘𝑣)C2))))
6362imp31 447 . . . . 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 13476 . . 3 ((⟨𝑉, (iEdg‘𝐺)⟩ ∈ ComplUSGraph ∧ 𝑉 ∈ Fin) → (♯‘ran (iEdg‘𝐺)) = ((♯‘𝑉)C2))
669, 65sylan 489 . 2 ((𝐺 ∈ ComplUSGraph ∧ 𝑉 ∈ Fin) → (♯‘ran (iEdg‘𝐺)) = ((♯‘𝑉)C2))
675, 66eqtrd 2794 1 ((𝐺 ∈ ComplUSGraph ∧ 𝑉 ∈ Fin) → (♯‘𝐸) = ((♯‘𝑉)C2))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 383  w3a 1072   = wceq 1632  wcel 2139  wnel 3035  {crab 3054  Vcvv 3340  cdif 3712  {csn 4321  cop 4327   I cid 5173  ran crn 5267  cres 5268  cfv 6049  (class class class)co 6813  Fincfn 8121  0cc0 10128  1c1 10129   + caddc 10131  2c2 11262  0cn0 11484  Ccbc 13283  chash 13311  Vtxcvtx 26073  iEdgciedg 26074  Edgcedg 26138  UHGraphcuhgr 26150  USGraphcusgr 26243  ComplUSGraphccusgr 26515
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1871  ax-4 1886  ax-5 1988  ax-6 2054  ax-7 2090  ax-8 2141  ax-9 2148  ax-10 2168  ax-11 2183  ax-12 2196  ax-13 2391  ax-ext 2740  ax-rep 4923  ax-sep 4933  ax-nul 4941  ax-pow 4992  ax-pr 5055  ax-un 7114  ax-cnex 10184  ax-resscn 10185  ax-1cn 10186  ax-icn 10187  ax-addcl 10188  ax-addrcl 10189  ax-mulcl 10190  ax-mulrcl 10191  ax-mulcom 10192  ax-addass 10193  ax-mulass 10194  ax-distr 10195  ax-i2m1 10196  ax-1ne0 10197  ax-1rid 10198  ax-rnegex 10199  ax-rrecex 10200  ax-cnre 10201  ax-pre-lttri 10202  ax-pre-lttrn 10203  ax-pre-ltadd 10204  ax-pre-mulgt0 10205
This theorem depends on definitions:  df-bi 197  df-or 384  df-an 385  df-3or 1073  df-3an 1074  df-tru 1635  df-fal 1638  df-ex 1854  df-nf 1859  df-sb 2047  df-eu 2611  df-mo 2612  df-clab 2747  df-cleq 2753  df-clel 2756  df-nfc 2891  df-ne 2933  df-nel 3036  df-ral 3055  df-rex 3056  df-reu 3057  df-rmo 3058  df-rab 3059  df-v 3342  df-sbc 3577  df-csb 3675  df-dif 3718  df-un 3720  df-in 3722  df-ss 3729  df-pss 3731  df-nul 4059  df-if 4231  df-pw 4304  df-sn 4322  df-pr 4324  df-tp 4326  df-op 4328  df-uni 4589  df-int 4628  df-iun 4674  df-br 4805  df-opab 4865  df-mpt 4882  df-tr 4905  df-id 5174  df-eprel 5179  df-po 5187  df-so 5188  df-fr 5225  df-we 5227  df-xp 5272  df-rel 5273  df-cnv 5274  df-co 5275  df-dm 5276  df-rn 5277  df-res 5278  df-ima 5279  df-pred 5841  df-ord 5887  df-on 5888  df-lim 5889  df-suc 5890  df-iota 6012  df-fun 6051  df-fn 6052  df-f 6053  df-f1 6054  df-fo 6055  df-f1o 6056  df-fv 6057  df-riota 6774  df-ov 6816  df-oprab 6817  df-mpt2 6818  df-om 7231  df-1st 7333  df-2nd 7334  df-wrecs 7576  df-recs 7637  df-rdg 7675  df-1o 7729  df-2o 7730  df-oadd 7733  df-er 7911  df-en 8122  df-dom 8123  df-sdom 8124  df-fin 8125  df-card 8955  df-cda 9182  df-pnf 10268  df-mnf 10269  df-xr 10270  df-ltxr 10271  df-le 10272  df-sub 10460  df-neg 10461  df-div 10877  df-nn 11213  df-2 11271  df-n0 11485  df-xnn0 11556  df-z 11570  df-uz 11880  df-rp 12026  df-fz 12520  df-seq 12996  df-fac 13255  df-bc 13284  df-hash 13312  df-vtx 26075  df-iedg 26076  df-edg 26139  df-uhgr 26152  df-upgr 26176  df-umgr 26177  df-uspgr 26244  df-usgr 26245  df-fusgr 26408  df-nbgr 26424  df-uvtx 26486  df-cplgr 26516  df-cusgr 26517
This theorem is referenced by:  fusgrmaxsize  26570
  Copyright terms: Public domain W3C validator