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

Theorem numclwwlkqhash 27566
Description: In a 𝐾-regular graph, the size of the set of walks of length 𝑁 starting with a fixed vertex 𝑋 and ending not at this vertex is the difference between 𝐾 to the power of 𝑁 and the size of the set of closed walks of length 𝑁 on vertex 𝑋. (Contributed by Alexander van der Vekens, 30-Sep-2018.) (Revised by AV, 30-May-2021.) (Revised by AV, 5-Mar-2022.) (Proof shortened by AV, 7-Jul-2022.)
Hypotheses
Ref Expression
numclwwlk.v 𝑉 = (Vtx‘𝐺)
numclwwlk.q 𝑄 = (𝑣𝑉, 𝑛 ∈ ℕ ↦ {𝑤 ∈ (𝑛 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ (lastS‘𝑤) ≠ 𝑣)})
Assertion
Ref Expression
numclwwlkqhash (((𝐺RegUSGraph𝐾𝑉 ∈ Fin) ∧ (𝑋𝑉𝑁 ∈ ℕ)) → (♯‘(𝑋𝑄𝑁)) = ((𝐾𝑁) − (♯‘(𝑋(ClWWalksNOn‘𝐺)𝑁))))
Distinct variable groups:   𝑛,𝐺,𝑣,𝑤   𝑛,𝑁,𝑣,𝑤   𝑛,𝑉,𝑣   𝑛,𝑋,𝑣,𝑤   𝑤,𝐾   𝑤,𝑉
Allowed substitution hints:   𝑄(𝑤,𝑣,𝑛)   𝐾(𝑣,𝑛)

Proof of Theorem numclwwlkqhash
Dummy variable 𝑓 is distinct from all other variables.
StepHypRef Expression
1 numclwwlk.v . . . . 5 𝑉 = (Vtx‘𝐺)
2 numclwwlk.q . . . . 5 𝑄 = (𝑣𝑉, 𝑛 ∈ ℕ ↦ {𝑤 ∈ (𝑛 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑣 ∧ (lastS‘𝑤) ≠ 𝑣)})
31, 2numclwwlkovq 27565 . . . 4 ((𝑋𝑉𝑁 ∈ ℕ) → (𝑋𝑄𝑁) = {𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑋 ∧ (lastS‘𝑤) ≠ 𝑋)})
43adantl 467 . . 3 (((𝐺RegUSGraph𝐾𝑉 ∈ Fin) ∧ (𝑋𝑉𝑁 ∈ ℕ)) → (𝑋𝑄𝑁) = {𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑋 ∧ (lastS‘𝑤) ≠ 𝑋)})
54fveq2d 6337 . 2 (((𝐺RegUSGraph𝐾𝑉 ∈ Fin) ∧ (𝑋𝑉𝑁 ∈ ℕ)) → (♯‘(𝑋𝑄𝑁)) = (♯‘{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑋 ∧ (lastS‘𝑤) ≠ 𝑋)}))
6 nnnn0 11506 . . . 4 (𝑁 ∈ ℕ → 𝑁 ∈ ℕ0)
7 eqid 2771 . . . . 5 {𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑋 ∧ (lastS‘𝑤) ≠ 𝑋)} = {𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑋 ∧ (lastS‘𝑤) ≠ 𝑋)}
8 eqid 2771 . . . . 5 (𝑋(𝑁 WWalksNOn 𝐺)𝑋) = (𝑋(𝑁 WWalksNOn 𝐺)𝑋)
97, 8, 1clwwlknclwwlkdifnum 27128 . . . 4 (((𝐺RegUSGraph𝐾𝑉 ∈ Fin) ∧ (𝑋𝑉𝑁 ∈ ℕ0)) → (♯‘{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑋 ∧ (lastS‘𝑤) ≠ 𝑋)}) = ((𝐾𝑁) − (♯‘(𝑋(𝑁 WWalksNOn 𝐺)𝑋))))
106, 9sylanr2 662 . . 3 (((𝐺RegUSGraph𝐾𝑉 ∈ Fin) ∧ (𝑋𝑉𝑁 ∈ ℕ)) → (♯‘{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑋 ∧ (lastS‘𝑤) ≠ 𝑋)}) = ((𝐾𝑁) − (♯‘(𝑋(𝑁 WWalksNOn 𝐺)𝑋))))
111iswwlksnon 26982 . . . . . . 7 (𝑋(𝑁 WWalksNOn 𝐺)𝑋) = {𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑋 ∧ (𝑤𝑁) = 𝑋)}
12 wwlknlsw 26976 . . . . . . . . . . 11 (𝑤 ∈ (𝑁 WWalksN 𝐺) → (𝑤𝑁) = (lastS‘𝑤))
13 eqcom 2778 . . . . . . . . . . . 12 ((𝑤‘0) = 𝑋𝑋 = (𝑤‘0))
1413biimpi 206 . . . . . . . . . . 11 ((𝑤‘0) = 𝑋𝑋 = (𝑤‘0))
1512, 14eqeqan12d 2787 . . . . . . . . . 10 ((𝑤 ∈ (𝑁 WWalksN 𝐺) ∧ (𝑤‘0) = 𝑋) → ((𝑤𝑁) = 𝑋 ↔ (lastS‘𝑤) = (𝑤‘0)))
1615pm5.32da 568 . . . . . . . . 9 (𝑤 ∈ (𝑁 WWalksN 𝐺) → (((𝑤‘0) = 𝑋 ∧ (𝑤𝑁) = 𝑋) ↔ ((𝑤‘0) = 𝑋 ∧ (lastS‘𝑤) = (𝑤‘0))))
17 ancom 448 . . . . . . . . 9 (((𝑤‘0) = 𝑋 ∧ (lastS‘𝑤) = (𝑤‘0)) ↔ ((lastS‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋))
1816, 17syl6bb 276 . . . . . . . 8 (𝑤 ∈ (𝑁 WWalksN 𝐺) → (((𝑤‘0) = 𝑋 ∧ (𝑤𝑁) = 𝑋) ↔ ((lastS‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋)))
1918rabbiia 3334 . . . . . . 7 {𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑋 ∧ (𝑤𝑁) = 𝑋)} = {𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ ((lastS‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋)}
2011, 19eqtri 2793 . . . . . 6 (𝑋(𝑁 WWalksNOn 𝐺)𝑋) = {𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ ((lastS‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋)}
2120fveq2i 6336 . . . . 5 (♯‘(𝑋(𝑁 WWalksNOn 𝐺)𝑋)) = (♯‘{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ ((lastS‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋)})
2221a1i 11 . . . 4 (((𝐺RegUSGraph𝐾𝑉 ∈ Fin) ∧ (𝑋𝑉𝑁 ∈ ℕ)) → (♯‘(𝑋(𝑁 WWalksNOn 𝐺)𝑋)) = (♯‘{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ ((lastS‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋)}))
2322oveq2d 6812 . . 3 (((𝐺RegUSGraph𝐾𝑉 ∈ Fin) ∧ (𝑋𝑉𝑁 ∈ ℕ)) → ((𝐾𝑁) − (♯‘(𝑋(𝑁 WWalksNOn 𝐺)𝑋))) = ((𝐾𝑁) − (♯‘{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ ((lastS‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋)})))
2410, 23eqtrd 2805 . 2 (((𝐺RegUSGraph𝐾𝑉 ∈ Fin) ∧ (𝑋𝑉𝑁 ∈ ℕ)) → (♯‘{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ ((𝑤‘0) = 𝑋 ∧ (lastS‘𝑤) ≠ 𝑋)}) = ((𝐾𝑁) − (♯‘{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ ((lastS‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋)})))
25 ovex 6827 . . . . 5 (𝑁 WWalksN 𝐺) ∈ V
2625rabex 4947 . . . 4 {𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ ((lastS‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋)} ∈ V
27 clwwlkvbij 27289 . . . . 5 ((𝑋𝑉𝑁 ∈ ℕ) → ∃𝑓 𝑓:{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ ((lastS‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋)}–1-1-onto→(𝑋(ClWWalksNOn‘𝐺)𝑁))
2827adantl 467 . . . 4 (((𝐺RegUSGraph𝐾𝑉 ∈ Fin) ∧ (𝑋𝑉𝑁 ∈ ℕ)) → ∃𝑓 𝑓:{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ ((lastS‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋)}–1-1-onto→(𝑋(ClWWalksNOn‘𝐺)𝑁))
29 hasheqf1oi 13344 . . . 4 ({𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ ((lastS‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋)} ∈ V → (∃𝑓 𝑓:{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ ((lastS‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋)}–1-1-onto→(𝑋(ClWWalksNOn‘𝐺)𝑁) → (♯‘{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ ((lastS‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋)}) = (♯‘(𝑋(ClWWalksNOn‘𝐺)𝑁))))
3026, 28, 29mpsyl 68 . . 3 (((𝐺RegUSGraph𝐾𝑉 ∈ Fin) ∧ (𝑋𝑉𝑁 ∈ ℕ)) → (♯‘{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ ((lastS‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋)}) = (♯‘(𝑋(ClWWalksNOn‘𝐺)𝑁)))
3130oveq2d 6812 . 2 (((𝐺RegUSGraph𝐾𝑉 ∈ Fin) ∧ (𝑋𝑉𝑁 ∈ ℕ)) → ((𝐾𝑁) − (♯‘{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ ((lastS‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋)})) = ((𝐾𝑁) − (♯‘(𝑋(ClWWalksNOn‘𝐺)𝑁))))
325, 24, 313eqtrd 2809 1 (((𝐺RegUSGraph𝐾𝑉 ∈ Fin) ∧ (𝑋𝑉𝑁 ∈ ℕ)) → (♯‘(𝑋𝑄𝑁)) = ((𝐾𝑁) − (♯‘(𝑋(ClWWalksNOn‘𝐺)𝑁))))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 382   = wceq 1631  wex 1852  wcel 2145  wne 2943  {crab 3065  Vcvv 3351   class class class wbr 4787  1-1-ontowf1o 6029  cfv 6030  (class class class)co 6796  cmpt2 6798  Fincfn 8113  0cc0 10142  cmin 10472  cn 11226  0cn0 11499  cexp 13067  chash 13321  lastSclsw 13488  Vtxcvtx 26095  RegUSGraphcrusgr 26687   WWalksN cwwlksn 26954   WWalksNOn cwwlksnon 26955  ClWWalksNOncclwwlknon 27259
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1870  ax-4 1885  ax-5 1991  ax-6 2057  ax-7 2093  ax-8 2147  ax-9 2154  ax-10 2174  ax-11 2190  ax-12 2203  ax-13 2408  ax-ext 2751  ax-rep 4905  ax-sep 4916  ax-nul 4924  ax-pow 4975  ax-pr 5035  ax-un 7100  ax-inf2 8706  ax-cnex 10198  ax-resscn 10199  ax-1cn 10200  ax-icn 10201  ax-addcl 10202  ax-addrcl 10203  ax-mulcl 10204  ax-mulrcl 10205  ax-mulcom 10206  ax-addass 10207  ax-mulass 10208  ax-distr 10209  ax-i2m1 10210  ax-1ne0 10211  ax-1rid 10212  ax-rnegex 10213  ax-rrecex 10214  ax-cnre 10215  ax-pre-lttri 10216  ax-pre-lttrn 10217  ax-pre-ltadd 10218  ax-pre-mulgt0 10219  ax-pre-sup 10220
This theorem depends on definitions:  df-bi 197  df-an 383  df-or 837  df-3or 1072  df-3an 1073  df-tru 1634  df-fal 1637  df-ex 1853  df-nf 1858  df-sb 2050  df-eu 2622  df-mo 2623  df-clab 2758  df-cleq 2764  df-clel 2767  df-nfc 2902  df-ne 2944  df-nel 3047  df-ral 3066  df-rex 3067  df-reu 3068  df-rmo 3069  df-rab 3070  df-v 3353  df-sbc 3588  df-csb 3683  df-dif 3726  df-un 3728  df-in 3730  df-ss 3737  df-pss 3739  df-nul 4064  df-if 4227  df-pw 4300  df-sn 4318  df-pr 4320  df-tp 4322  df-op 4324  df-uni 4576  df-int 4613  df-iun 4657  df-disj 4756  df-br 4788  df-opab 4848  df-mpt 4865  df-tr 4888  df-id 5158  df-eprel 5163  df-po 5171  df-so 5172  df-fr 5209  df-se 5210  df-we 5211  df-xp 5256  df-rel 5257  df-cnv 5258  df-co 5259  df-dm 5260  df-rn 5261  df-res 5262  df-ima 5263  df-pred 5822  df-ord 5868  df-on 5869  df-lim 5870  df-suc 5871  df-iota 5993  df-fun 6032  df-fn 6033  df-f 6034  df-f1 6035  df-fo 6036  df-f1o 6037  df-fv 6038  df-isom 6039  df-riota 6757  df-ov 6799  df-oprab 6800  df-mpt2 6801  df-om 7217  df-1st 7319  df-2nd 7320  df-wrecs 7563  df-recs 7625  df-rdg 7663  df-1o 7717  df-2o 7718  df-oadd 7721  df-er 7900  df-map 8015  df-pm 8016  df-en 8114  df-dom 8115  df-sdom 8116  df-fin 8117  df-sup 8508  df-oi 8575  df-card 8969  df-cda 9196  df-pnf 10282  df-mnf 10283  df-xr 10284  df-ltxr 10285  df-le 10286  df-sub 10474  df-neg 10475  df-div 10891  df-nn 11227  df-2 11285  df-3 11286  df-n0 11500  df-xnn0 11571  df-z 11585  df-uz 11894  df-rp 12036  df-xadd 12152  df-fz 12534  df-fzo 12674  df-seq 13009  df-exp 13068  df-hash 13322  df-word 13495  df-lsw 13496  df-concat 13497  df-s1 13498  df-substr 13499  df-cj 14047  df-re 14048  df-im 14049  df-sqrt 14183  df-abs 14184  df-clim 14427  df-sum 14625  df-vtx 26097  df-iedg 26098  df-edg 26161  df-uhgr 26174  df-ushgr 26175  df-upgr 26198  df-umgr 26199  df-uspgr 26267  df-usgr 26268  df-fusgr 26432  df-nbgr 26448  df-vtxdg 26597  df-rgr 26688  df-rusgr 26689  df-wwlks 26958  df-wwlksn 26959  df-wwlksnon 26960  df-clwwlk 27132  df-clwwlkn 27176  df-clwwlknon 27260
This theorem is referenced by:  numclwwlk2  27572  numclwwlk2OLD  27579
  Copyright terms: Public domain W3C validator