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

Theorem wlksnwwlknvbij 26689
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 6163 . . . . 5 (Walks‘𝐺) ∈ V
21mptrabex 6448 . . . 4 (𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (#‘(1st𝑞)) = 𝑁} ↦ (2nd𝑝)) ∈ V
32resex 5407 . . 3 ((𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (#‘(1st𝑞)) = 𝑁} ↦ (2nd𝑝)) ↾ {𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (#‘(1st𝑞)) = 𝑁} ∣ ((2nd𝑝)‘0) = 𝑋}) ∈ V
4 eqid 2621 . . . 4 (𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (#‘(1st𝑞)) = 𝑁} ↦ (2nd𝑝)) = (𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (#‘(1st𝑞)) = 𝑁} ↦ (2nd𝑝))
5 usgruspgr 25983 . . . . . 6 (𝐺 ∈ USGraph → 𝐺 ∈ USPGraph )
6 fveq2 6153 . . . . . . . . . 10 (𝑞 = 𝑡 → (1st𝑞) = (1st𝑡))
76fveq2d 6157 . . . . . . . . 9 (𝑞 = 𝑡 → (#‘(1st𝑞)) = (#‘(1st𝑡)))
87eqeq1d 2623 . . . . . . . 8 (𝑞 = 𝑡 → ((#‘(1st𝑞)) = 𝑁 ↔ (#‘(1st𝑡)) = 𝑁))
98cbvrabv 3188 . . . . . . 7 {𝑞 ∈ (Walks‘𝐺) ∣ (#‘(1st𝑞)) = 𝑁} = {𝑡 ∈ (Walks‘𝐺) ∣ (#‘(1st𝑡)) = 𝑁}
10 eqid 2621 . . . . . . 7 (𝑁 WWalksN 𝐺) = (𝑁 WWalksN 𝐺)
11 fveq2 6153 . . . . . . . 8 (𝑝 = 𝑠 → (2nd𝑝) = (2nd𝑠))
1211cbvmptv 4715 . . . . . . 7 (𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (#‘(1st𝑞)) = 𝑁} ↦ (2nd𝑝)) = (𝑠 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (#‘(1st𝑞)) = 𝑁} ↦ (2nd𝑠))
139, 10, 12wlknwwlksnbij 26663 . . . . . 6 ((𝐺 ∈ USPGraph ∧ 𝑁 ∈ ℕ0) → (𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (#‘(1st𝑞)) = 𝑁} ↦ (2nd𝑝)):{𝑞 ∈ (Walks‘𝐺) ∣ (#‘(1st𝑞)) = 𝑁}–1-1-onto→(𝑁 WWalksN 𝐺))
145, 13sylan 488 . . . . 5 ((𝐺 ∈ USGraph ∧ 𝑁 ∈ ℕ0) → (𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (#‘(1st𝑞)) = 𝑁} ↦ (2nd𝑝)):{𝑞 ∈ (Walks‘𝐺) ∣ (#‘(1st𝑞)) = 𝑁}–1-1-onto→(𝑁 WWalksN 𝐺))
15143adant3 1079 . . . 4 ((𝐺 ∈ USGraph ∧ 𝑁 ∈ ℕ0𝑋 ∈ (Vtx‘𝐺)) → (𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (#‘(1st𝑞)) = 𝑁} ↦ (2nd𝑝)):{𝑞 ∈ (Walks‘𝐺) ∣ (#‘(1st𝑞)) = 𝑁}–1-1-onto→(𝑁 WWalksN 𝐺))
16 fveq1 6152 . . . . . 6 (𝑤 = (2nd𝑝) → (𝑤‘0) = ((2nd𝑝)‘0))
1716eqeq1d 2623 . . . . 5 (𝑤 = (2nd𝑝) → ((𝑤‘0) = 𝑋 ↔ ((2nd𝑝)‘0) = 𝑋))
18173ad2ant3 1082 . . . 4 (((𝐺 ∈ USGraph ∧ 𝑁 ∈ ℕ0𝑋 ∈ (Vtx‘𝐺)) ∧ 𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (#‘(1st𝑞)) = 𝑁} ∧ 𝑤 = (2nd𝑝)) → ((𝑤‘0) = 𝑋 ↔ ((2nd𝑝)‘0) = 𝑋))
194, 15, 18f1oresrab 6356 . . 3 ((𝐺 ∈ USGraph ∧ 𝑁 ∈ ℕ0𝑋 ∈ (Vtx‘𝐺)) → ((𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (#‘(1st𝑞)) = 𝑁} ↦ (2nd𝑝)) ↾ {𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (#‘(1st𝑞)) = 𝑁} ∣ ((2nd𝑝)‘0) = 𝑋}):{𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (#‘(1st𝑞)) = 𝑁} ∣ ((2nd𝑝)‘0) = 𝑋}–1-1-onto→{𝑤 ∈ (𝑁 WWalksN 𝐺) ∣ (𝑤‘0) = 𝑋})
20 f1oeq1 6089 . . . 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 3283 . . 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 2916 . . . . 5 {𝑝 ∈ (Walks‘𝐺) ∣ ((#‘(1st𝑝)) = 𝑁 ∧ ((2nd𝑝)‘0) = 𝑋)} = {𝑝 ∣ (𝑝 ∈ (Walks‘𝐺) ∧ ((#‘(1st𝑝)) = 𝑁 ∧ ((2nd𝑝)‘0) = 𝑋))}
24 anass 680 . . . . . . 7 (((𝑝 ∈ (Walks‘𝐺) ∧ (#‘(1st𝑝)) = 𝑁) ∧ ((2nd𝑝)‘0) = 𝑋) ↔ (𝑝 ∈ (Walks‘𝐺) ∧ ((#‘(1st𝑝)) = 𝑁 ∧ ((2nd𝑝)‘0) = 𝑋)))
2524bicomi 214 . . . . . 6 ((𝑝 ∈ (Walks‘𝐺) ∧ ((#‘(1st𝑝)) = 𝑁 ∧ ((2nd𝑝)‘0) = 𝑋)) ↔ ((𝑝 ∈ (Walks‘𝐺) ∧ (#‘(1st𝑝)) = 𝑁) ∧ ((2nd𝑝)‘0) = 𝑋))
2625abbii 2736 . . . . 5 {𝑝 ∣ (𝑝 ∈ (Walks‘𝐺) ∧ ((#‘(1st𝑝)) = 𝑁 ∧ ((2nd𝑝)‘0) = 𝑋))} = {𝑝 ∣ ((𝑝 ∈ (Walks‘𝐺) ∧ (#‘(1st𝑝)) = 𝑁) ∧ ((2nd𝑝)‘0) = 𝑋)}
27 fveq2 6153 . . . . . . . . . . . 12 (𝑞 = 𝑝 → (1st𝑞) = (1st𝑝))
2827fveq2d 6157 . . . . . . . . . . 11 (𝑞 = 𝑝 → (#‘(1st𝑞)) = (#‘(1st𝑝)))
2928eqeq1d 2623 . . . . . . . . . 10 (𝑞 = 𝑝 → ((#‘(1st𝑞)) = 𝑁 ↔ (#‘(1st𝑝)) = 𝑁))
3029elrab 3350 . . . . . . . . 9 (𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (#‘(1st𝑞)) = 𝑁} ↔ (𝑝 ∈ (Walks‘𝐺) ∧ (#‘(1st𝑝)) = 𝑁))
3130anbi1i 730 . . . . . . . 8 ((𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (#‘(1st𝑞)) = 𝑁} ∧ ((2nd𝑝)‘0) = 𝑋) ↔ ((𝑝 ∈ (Walks‘𝐺) ∧ (#‘(1st𝑝)) = 𝑁) ∧ ((2nd𝑝)‘0) = 𝑋))
3231bicomi 214 . . . . . . 7 (((𝑝 ∈ (Walks‘𝐺) ∧ (#‘(1st𝑝)) = 𝑁) ∧ ((2nd𝑝)‘0) = 𝑋) ↔ (𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (#‘(1st𝑞)) = 𝑁} ∧ ((2nd𝑝)‘0) = 𝑋))
3332abbii 2736 . . . . . 6 {𝑝 ∣ ((𝑝 ∈ (Walks‘𝐺) ∧ (#‘(1st𝑝)) = 𝑁) ∧ ((2nd𝑝)‘0) = 𝑋)} = {𝑝 ∣ (𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (#‘(1st𝑞)) = 𝑁} ∧ ((2nd𝑝)‘0) = 𝑋)}
34 df-rab 2916 . . . . . 6 {𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (#‘(1st𝑞)) = 𝑁} ∣ ((2nd𝑝)‘0) = 𝑋} = {𝑝 ∣ (𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (#‘(1st𝑞)) = 𝑁} ∧ ((2nd𝑝)‘0) = 𝑋)}
3533, 34eqtr4i 2646 . . . . 5 {𝑝 ∣ ((𝑝 ∈ (Walks‘𝐺) ∧ (#‘(1st𝑝)) = 𝑁) ∧ ((2nd𝑝)‘0) = 𝑋)} = {𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (#‘(1st𝑞)) = 𝑁} ∣ ((2nd𝑝)‘0) = 𝑋}
3623, 26, 353eqtri 2647 . . . 4 {𝑝 ∈ (Walks‘𝐺) ∣ ((#‘(1st𝑝)) = 𝑁 ∧ ((2nd𝑝)‘0) = 𝑋)} = {𝑝 ∈ {𝑞 ∈ (Walks‘𝐺) ∣ (#‘(1st𝑞)) = 𝑁} ∣ ((2nd𝑝)‘0) = 𝑋}
37 f1oeq2 6090 . . . 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 1847 . 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 384  w3a 1036   = wceq 1480  wex 1701  wcel 1987  {cab 2607  {crab 2911  Vcvv 3189  cmpt 4678  cres 5081  1-1-ontowf1o 5851  cfv 5852  (class class class)co 6610  1st c1st 7118  2nd c2nd 7119  0cc0 9888  0cn0 11244  #chash 13065  Vtxcvtx 25791   USPGraph cuspgr 25953   USGraph cusgr 25954  Walkscwlks 26379   WWalksN cwwlksn 26604
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1719  ax-4 1734  ax-5 1836  ax-6 1885  ax-7 1932  ax-8 1989  ax-9 1996  ax-10 2016  ax-11 2031  ax-12 2044  ax-13 2245  ax-ext 2601  ax-rep 4736  ax-sep 4746  ax-nul 4754  ax-pow 4808  ax-pr 4872  ax-un 6909  ax-cnex 9944  ax-resscn 9945  ax-1cn 9946  ax-icn 9947  ax-addcl 9948  ax-addrcl 9949  ax-mulcl 9950  ax-mulrcl 9951  ax-mulcom 9952  ax-addass 9953  ax-mulass 9954  ax-distr 9955  ax-i2m1 9956  ax-1ne0 9957  ax-1rid 9958  ax-rnegex 9959  ax-rrecex 9960  ax-cnre 9961  ax-pre-lttri 9962  ax-pre-lttrn 9963  ax-pre-ltadd 9964  ax-pre-mulgt0 9965
This theorem depends on definitions:  df-bi 197  df-or 385  df-an 386  df-ifp 1012  df-3or 1037  df-3an 1038  df-tru 1483  df-ex 1702  df-nf 1707  df-sb 1878  df-eu 2473  df-mo 2474  df-clab 2608  df-cleq 2614  df-clel 2617  df-nfc 2750  df-ne 2791  df-nel 2894  df-ral 2912  df-rex 2913  df-reu 2914  df-rmo 2915  df-rab 2916  df-v 3191  df-sbc 3422  df-csb 3519  df-dif 3562  df-un 3564  df-in 3566  df-ss 3573  df-pss 3575  df-nul 3897  df-if 4064  df-pw 4137  df-sn 4154  df-pr 4156  df-tp 4158  df-op 4160  df-uni 4408  df-int 4446  df-iun 4492  df-br 4619  df-opab 4679  df-mpt 4680  df-tr 4718  df-eprel 4990  df-id 4994  df-po 5000  df-so 5001  df-fr 5038  df-we 5040  df-xp 5085  df-rel 5086  df-cnv 5087  df-co 5088  df-dm 5089  df-rn 5090  df-res 5091  df-ima 5092  df-pred 5644  df-ord 5690  df-on 5691  df-lim 5692  df-suc 5693  df-iota 5815  df-fun 5854  df-fn 5855  df-f 5856  df-f1 5857  df-fo 5858  df-f1o 5859  df-fv 5860  df-riota 6571  df-ov 6613  df-oprab 6614  df-mpt2 6615  df-om 7020  df-1st 7120  df-2nd 7121  df-wrecs 7359  df-recs 7420  df-rdg 7458  df-1o 7512  df-2o 7513  df-oadd 7516  df-er 7694  df-map 7811  df-pm 7812  df-en 7908  df-dom 7909  df-sdom 7910  df-fin 7911  df-card 8717  df-cda 8942  df-pnf 10028  df-mnf 10029  df-xr 10030  df-ltxr 10031  df-le 10032  df-sub 10220  df-neg 10221  df-nn 10973  df-2 11031  df-n0 11245  df-xnn0 11316  df-z 11330  df-uz 11640  df-fz 12277  df-fzo 12415  df-hash 13066  df-word 13246  df-edg 25857  df-uhgr 25866  df-upgr 25890  df-uspgr 25955  df-usgr 25956  df-wlks 26382  df-wwlks 26608  df-wwlksn 26609
This theorem is referenced by:  rusgrnumwlkg  26756
  Copyright terms: Public domain W3C validator