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

Theorem wlksnwwlknvbij 27047
 Description: There is a bijection between the set of walks of a fixed length and the set of walks represented by words of the same length and starting at the same vertex. (Contributed by Alexander van der Vekens, 30-Sep-2018.) (Revised by AV, 20-Apr-2021.)
Assertion
Ref Expression
wlksnwwlknvbij ((𝐺 ∈ USGraph ∧ 𝑁 ∈ ℕ0𝑋 ∈ (Vtx‘𝐺)) → ∃𝑓 𝑓:{𝑝 ∈ (Walks‘𝐺) ∣ ((♯‘(1st𝑝)) = 𝑁 ∧ ((2nd𝑝)‘0) = 𝑋)}–1-1-onto→{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ (𝑤‘0) = 𝑋})
Distinct variable groups:   𝑓,𝐺,𝑝,𝑤   𝑓,𝑁,𝑝,𝑤   𝑓,𝑋,𝑝,𝑤

Proof of Theorem wlksnwwlknvbij
Dummy variables 𝑞 𝑠 𝑡 are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 fvex 6363 . . . . 5 (Walks‘𝐺) ∈ V
21mptrabex 6653 . . . 4 (𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ↦ (2nd𝑝)) ∈ V
32resex 5601 . . 3 ((𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ↦ (2nd𝑝)) ↾ {𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ∣ ((2nd𝑝)‘0) = 𝑋}) ∈ V
4 eqid 2760 . . . 4 (𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ↦ (2nd𝑝)) = (𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ↦ (2nd𝑝))
5 usgruspgr 26293 . . . . . 6 (𝐺 ∈ USGraph → 𝐺 ∈ USPGraph)
6 fveq2 6353 . . . . . . . . . 10 (𝑞 = 𝑡 → (1st𝑞) = (1st𝑡))
76fveq2d 6357 . . . . . . . . 9 (𝑞 = 𝑡 → (♯‘(1st𝑞)) = (♯‘(1st𝑡)))
87eqeq1d 2762 . . . . . . . 8 (𝑞 = 𝑡 → ((♯‘(1st𝑞)) = 𝑁 ↔ (♯‘(1st𝑡)) = 𝑁))
98cbvrabv 3339 . . . . . . 7 {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} = {𝑡 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑡)) = 𝑁}
10 eqid 2760 . . . . . . 7 (𝑁 WWalksN 𝐺) = (𝑁 WWalksN 𝐺)
11 fveq2 6353 . . . . . . . 8 (𝑝 = 𝑠 → (2nd𝑝) = (2nd𝑠))
1211cbvmptv 4902 . . . . . . 7 (𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ↦ (2nd𝑝)) = (𝑠 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ↦ (2nd𝑠))
139, 10, 12wlknwwlksnbij 27021 . . . . . 6 ((𝐺 ∈ USPGraph ∧ 𝑁 ∈ ℕ0) → (𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ↦ (2nd𝑝)):{𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁}–1-1-onto→(𝑁 WWalksN 𝐺))
145, 13sylan 489 . . . . 5 ((𝐺 ∈ USGraph ∧ 𝑁 ∈ ℕ0) → (𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ↦ (2nd𝑝)):{𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁}–1-1-onto→(𝑁 WWalksN 𝐺))
15143adant3 1127 . . . 4 ((𝐺 ∈ USGraph ∧ 𝑁 ∈ ℕ0𝑋 ∈ (Vtx‘𝐺)) → (𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ↦ (2nd𝑝)):{𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁}–1-1-onto→(𝑁 WWalksN 𝐺))
16 fveq1 6352 . . . . . 6 (𝑤 = (2nd𝑝) → (𝑤‘0) = ((2nd𝑝)‘0))
1716eqeq1d 2762 . . . . 5 (𝑤 = (2nd𝑝) → ((𝑤‘0) = 𝑋 ↔ ((2nd𝑝)‘0) = 𝑋))
18173ad2ant3 1130 . . . 4 (((𝐺 ∈ USGraph ∧ 𝑁 ∈ ℕ0𝑋 ∈ (Vtx‘𝐺)) ∧ 𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ∧ 𝑤 = (2nd𝑝)) → ((𝑤‘0) = 𝑋 ↔ ((2nd𝑝)‘0) = 𝑋))
194, 15, 18f1oresrab 6559 . . 3 ((𝐺 ∈ USGraph ∧ 𝑁 ∈ ℕ0𝑋 ∈ (Vtx‘𝐺)) → ((𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ↦ (2nd𝑝)) ↾ {𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ∣ ((2nd𝑝)‘0) = 𝑋}):{𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ∣ ((2nd𝑝)‘0) = 𝑋}–1-1-onto→{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ (𝑤‘0) = 𝑋})
20 f1oeq1 6289 . . . 4 (𝑓 = ((𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ↦ (2nd𝑝)) ↾ {𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ∣ ((2nd𝑝)‘0) = 𝑋}) → (𝑓:{𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ∣ ((2nd𝑝)‘0) = 𝑋}–1-1-onto→{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ (𝑤‘0) = 𝑋} ↔ ((𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ↦ (2nd𝑝)) ↾ {𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ∣ ((2nd𝑝)‘0) = 𝑋}):{𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ∣ ((2nd𝑝)‘0) = 𝑋}–1-1-onto→{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ (𝑤‘0) = 𝑋}))
2120spcegv 3434 . . 3 (((𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ↦ (2nd𝑝)) ↾ {𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ∣ ((2nd𝑝)‘0) = 𝑋}) ∈ V → (((𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ↦ (2nd𝑝)) ↾ {𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ∣ ((2nd𝑝)‘0) = 𝑋}):{𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ∣ ((2nd𝑝)‘0) = 𝑋}–1-1-onto→{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ (𝑤‘0) = 𝑋} → ∃𝑓 𝑓:{𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ∣ ((2nd𝑝)‘0) = 𝑋}–1-1-onto→{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ (𝑤‘0) = 𝑋}))
223, 19, 21mpsyl 68 . 2 ((𝐺 ∈ USGraph ∧ 𝑁 ∈ ℕ0𝑋 ∈ (Vtx‘𝐺)) → ∃𝑓 𝑓:{𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ∣ ((2nd𝑝)‘0) = 𝑋}–1-1-onto→{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ (𝑤‘0) = 𝑋})
23 df-rab 3059 . . . . 5 {𝑝 ∈ (Walks‘𝐺) ∣ ((♯‘(1st𝑝)) = 𝑁 ∧ ((2nd𝑝)‘0) = 𝑋)} = {𝑝 ∣ (𝑝 ∈ (Walks‘𝐺) ∧ ((♯‘(1st𝑝)) = 𝑁 ∧ ((2nd𝑝)‘0) = 𝑋))}
24 anass 684 . . . . . . 7 (((𝑝 ∈ (Walks‘𝐺) ∧ (♯‘(1st𝑝)) = 𝑁) ∧ ((2nd𝑝)‘0) = 𝑋) ↔ (𝑝 ∈ (Walks‘𝐺) ∧ ((♯‘(1st𝑝)) = 𝑁 ∧ ((2nd𝑝)‘0) = 𝑋)))
2524bicomi 214 . . . . . 6 ((𝑝 ∈ (Walks‘𝐺) ∧ ((♯‘(1st𝑝)) = 𝑁 ∧ ((2nd𝑝)‘0) = 𝑋)) ↔ ((𝑝 ∈ (Walks‘𝐺) ∧ (♯‘(1st𝑝)) = 𝑁) ∧ ((2nd𝑝)‘0) = 𝑋))
2625abbii 2877 . . . . 5 {𝑝 ∣ (𝑝 ∈ (Walks‘𝐺) ∧ ((♯‘(1st𝑝)) = 𝑁 ∧ ((2nd𝑝)‘0) = 𝑋))} = {𝑝 ∣ ((𝑝 ∈ (Walks‘𝐺) ∧ (♯‘(1st𝑝)) = 𝑁) ∧ ((2nd𝑝)‘0) = 𝑋)}
27 fveq2 6353 . . . . . . . . . . . 12 (𝑞 = 𝑝 → (1st𝑞) = (1st𝑝))
2827fveq2d 6357 . . . . . . . . . . 11 (𝑞 = 𝑝 → (♯‘(1st𝑞)) = (♯‘(1st𝑝)))
2928eqeq1d 2762 . . . . . . . . . 10 (𝑞 = 𝑝 → ((♯‘(1st𝑞)) = 𝑁 ↔ (♯‘(1st𝑝)) = 𝑁))
3029elrab 3504 . . . . . . . . 9 (𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ↔ (𝑝 ∈ (Walks‘𝐺) ∧ (♯‘(1st𝑝)) = 𝑁))
3130anbi1i 733 . . . . . . . 8 ((𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ∧ ((2nd𝑝)‘0) = 𝑋) ↔ ((𝑝 ∈ (Walks‘𝐺) ∧ (♯‘(1st𝑝)) = 𝑁) ∧ ((2nd𝑝)‘0) = 𝑋))
3231bicomi 214 . . . . . . 7 (((𝑝 ∈ (Walks‘𝐺) ∧ (♯‘(1st𝑝)) = 𝑁) ∧ ((2nd𝑝)‘0) = 𝑋) ↔ (𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ∧ ((2nd𝑝)‘0) = 𝑋))
3332abbii 2877 . . . . . 6 {𝑝 ∣ ((𝑝 ∈ (Walks‘𝐺) ∧ (♯‘(1st𝑝)) = 𝑁) ∧ ((2nd𝑝)‘0) = 𝑋)} = {𝑝 ∣ (𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ∧ ((2nd𝑝)‘0) = 𝑋)}
34 df-rab 3059 . . . . . 6 {𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ∣ ((2nd𝑝)‘0) = 𝑋} = {𝑝 ∣ (𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ∧ ((2nd𝑝)‘0) = 𝑋)}
3533, 34eqtr4i 2785 . . . . 5 {𝑝 ∣ ((𝑝 ∈ (Walks‘𝐺) ∧ (♯‘(1st𝑝)) = 𝑁) ∧ ((2nd𝑝)‘0) = 𝑋)} = {𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ∣ ((2nd𝑝)‘0) = 𝑋}
3623, 26, 353eqtri 2786 . . . 4 {𝑝 ∈ (Walks‘𝐺) ∣ ((♯‘(1st𝑝)) = 𝑁 ∧ ((2nd𝑝)‘0) = 𝑋)} = {𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ∣ ((2nd𝑝)‘0) = 𝑋}
37 f1oeq2 6290 . . . 4 ({𝑝 ∈ (Walks‘𝐺) ∣ ((♯‘(1st𝑝)) = 𝑁 ∧ ((2nd𝑝)‘0) = 𝑋)} = {𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ∣ ((2nd𝑝)‘0) = 𝑋} → (𝑓:{𝑝 ∈ (Walks‘𝐺) ∣ ((♯‘(1st𝑝)) = 𝑁 ∧ ((2nd𝑝)‘0) = 𝑋)}–1-1-onto→{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ (𝑤‘0) = 𝑋} ↔ 𝑓:{𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ∣ ((2nd𝑝)‘0) = 𝑋}–1-1-onto→{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ (𝑤‘0) = 𝑋}))
3836, 37mp1i 13 . . 3 ((𝐺 ∈ USGraph ∧ 𝑁 ∈ ℕ0𝑋 ∈ (Vtx‘𝐺)) → (𝑓:{𝑝 ∈ (Walks‘𝐺) ∣ ((♯‘(1st𝑝)) = 𝑁 ∧ ((2nd𝑝)‘0) = 𝑋)}–1-1-onto→{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ (𝑤‘0) = 𝑋} ↔ 𝑓:{𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ∣ ((2nd𝑝)‘0) = 𝑋}–1-1-onto→{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ (𝑤‘0) = 𝑋}))
3938exbidv 1999 . 2 ((𝐺 ∈ USGraph ∧ 𝑁 ∈ ℕ0𝑋 ∈ (Vtx‘𝐺)) → (∃𝑓 𝑓:{𝑝 ∈ (Walks‘𝐺) ∣ ((♯‘(1st𝑝)) = 𝑁 ∧ ((2nd𝑝)‘0) = 𝑋)}–1-1-onto→{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ (𝑤‘0) = 𝑋} ↔ ∃𝑓 𝑓:{𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (♯‘(1st𝑞)) = 𝑁} ∣ ((2nd𝑝)‘0) = 𝑋}–1-1-onto→{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ (𝑤‘0) = 𝑋}))
4022, 39mpbird 247 1 ((𝐺 ∈ USGraph ∧ 𝑁 ∈ ℕ0𝑋 ∈ (Vtx‘𝐺)) → ∃𝑓 𝑓:{𝑝 ∈ (Walks‘𝐺) ∣ ((♯‘(1st𝑝)) = 𝑁 ∧ ((2nd𝑝)‘0) = 𝑋)}–1-1-onto→{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ (𝑤‘0) = 𝑋})
 Colors of variables: wff setvar class Syntax hints:   → wi 4   ↔ wb 196   ∧ wa 383   ∧ w3a 1072   = wceq 1632  ∃wex 1853   ∈ wcel 2139  {cab 2746  {crab 3054  Vcvv 3340   ↦ cmpt 4881   ↾ cres 5268  –1-1-onto→wf1o 6048  ‘cfv 6049  (class class class)co 6814  1st c1st 7332  2nd c2nd 7333  0cc0 10148  ℕ0cn0 11504  ♯chash 13331  Vtxcvtx 26094  USPGraphcuspgr 26263  USGraphcusgr 26264  Walkscwlks 26723   WWalksN cwwlksn 26950 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 7115  ax-cnex 10204  ax-resscn 10205  ax-1cn 10206  ax-icn 10207  ax-addcl 10208  ax-addrcl 10209  ax-mulcl 10210  ax-mulrcl 10211  ax-mulcom 10212  ax-addass 10213  ax-mulass 10214  ax-distr 10215  ax-i2m1 10216  ax-1ne0 10217  ax-1rid 10218  ax-rnegex 10219  ax-rrecex 10220  ax-cnre 10221  ax-pre-lttri 10222  ax-pre-lttrn 10223  ax-pre-ltadd 10224  ax-pre-mulgt0 10225 This theorem depends on definitions:  df-bi 197  df-or 384  df-an 385  df-ifp 1051  df-3or 1073  df-3an 1074  df-tru 1635  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 6775  df-ov 6817  df-oprab 6818  df-mpt2 6819  df-om 7232  df-1st 7334  df-2nd 7335  df-wrecs 7577  df-recs 7638  df-rdg 7676  df-1o 7730  df-2o 7731  df-oadd 7734  df-er 7913  df-map 8027  df-pm 8028  df-en 8124  df-dom 8125  df-sdom 8126  df-fin 8127  df-card 8975  df-cda 9202  df-pnf 10288  df-mnf 10289  df-xr 10290  df-ltxr 10291  df-le 10292  df-sub 10480  df-neg 10481  df-nn 11233  df-2 11291  df-n0 11505  df-xnn0 11576  df-z 11590  df-uz 11900  df-fz 12540  df-fzo 12680  df-hash 13332  df-word 13505  df-edg 26160  df-uhgr 26173  df-upgr 26197  df-uspgr 26265  df-usgr 26266  df-wlks 26726  df-wwlks 26954  df-wwlksn 26955 This theorem is referenced by:  rusgrnumwlkg  27120
 Copyright terms: Public domain W3C validator