Metamath Proof Explorer


Theorem clwlkclwwlkf

Description: F is a function from the nonempty closed walks into the closed walks as word in a simple pseudograph. (Contributed by AV, 23-May-2022) (Revised by AV, 29-Oct-2022)

Ref Expression
Hypotheses clwlkclwwlkf.c 𝐶 = { 𝑤 ∈ ( ClWalks ‘ 𝐺 ) ∣ 1 ≤ ( ♯ ‘ ( 1st𝑤 ) ) }
clwlkclwwlkf.f 𝐹 = ( 𝑐𝐶 ↦ ( ( 2nd𝑐 ) prefix ( ( ♯ ‘ ( 2nd𝑐 ) ) − 1 ) ) )
Assertion clwlkclwwlkf ( 𝐺 ∈ USPGraph → 𝐹 : 𝐶 ⟶ ( ClWWalks ‘ 𝐺 ) )

Proof

Step Hyp Ref Expression
1 clwlkclwwlkf.c 𝐶 = { 𝑤 ∈ ( ClWalks ‘ 𝐺 ) ∣ 1 ≤ ( ♯ ‘ ( 1st𝑤 ) ) }
2 clwlkclwwlkf.f 𝐹 = ( 𝑐𝐶 ↦ ( ( 2nd𝑐 ) prefix ( ( ♯ ‘ ( 2nd𝑐 ) ) − 1 ) ) )
3 eqid ( 1st𝑐 ) = ( 1st𝑐 )
4 eqid ( 2nd𝑐 ) = ( 2nd𝑐 )
5 1 3 4 clwlkclwwlkflem ( 𝑐𝐶 → ( ( 1st𝑐 ) ( Walks ‘ 𝐺 ) ( 2nd𝑐 ) ∧ ( ( 2nd𝑐 ) ‘ 0 ) = ( ( 2nd𝑐 ) ‘ ( ♯ ‘ ( 1st𝑐 ) ) ) ∧ ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℕ ) )
6 isclwlk ( ( 1st𝑐 ) ( ClWalks ‘ 𝐺 ) ( 2nd𝑐 ) ↔ ( ( 1st𝑐 ) ( Walks ‘ 𝐺 ) ( 2nd𝑐 ) ∧ ( ( 2nd𝑐 ) ‘ 0 ) = ( ( 2nd𝑐 ) ‘ ( ♯ ‘ ( 1st𝑐 ) ) ) ) )
7 fvex ( 1st𝑐 ) ∈ V
8 breq1 ( 𝑓 = ( 1st𝑐 ) → ( 𝑓 ( ClWalks ‘ 𝐺 ) ( 2nd𝑐 ) ↔ ( 1st𝑐 ) ( ClWalks ‘ 𝐺 ) ( 2nd𝑐 ) ) )
9 7 8 spcev ( ( 1st𝑐 ) ( ClWalks ‘ 𝐺 ) ( 2nd𝑐 ) → ∃ 𝑓 𝑓 ( ClWalks ‘ 𝐺 ) ( 2nd𝑐 ) )
10 6 9 sylbir ( ( ( 1st𝑐 ) ( Walks ‘ 𝐺 ) ( 2nd𝑐 ) ∧ ( ( 2nd𝑐 ) ‘ 0 ) = ( ( 2nd𝑐 ) ‘ ( ♯ ‘ ( 1st𝑐 ) ) ) ) → ∃ 𝑓 𝑓 ( ClWalks ‘ 𝐺 ) ( 2nd𝑐 ) )
11 10 3adant3 ( ( ( 1st𝑐 ) ( Walks ‘ 𝐺 ) ( 2nd𝑐 ) ∧ ( ( 2nd𝑐 ) ‘ 0 ) = ( ( 2nd𝑐 ) ‘ ( ♯ ‘ ( 1st𝑐 ) ) ) ∧ ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℕ ) → ∃ 𝑓 𝑓 ( ClWalks ‘ 𝐺 ) ( 2nd𝑐 ) )
12 11 adantl ( ( 𝐺 ∈ USPGraph ∧ ( ( 1st𝑐 ) ( Walks ‘ 𝐺 ) ( 2nd𝑐 ) ∧ ( ( 2nd𝑐 ) ‘ 0 ) = ( ( 2nd𝑐 ) ‘ ( ♯ ‘ ( 1st𝑐 ) ) ) ∧ ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℕ ) ) → ∃ 𝑓 𝑓 ( ClWalks ‘ 𝐺 ) ( 2nd𝑐 ) )
13 simpl ( ( 𝐺 ∈ USPGraph ∧ ( ( 1st𝑐 ) ( Walks ‘ 𝐺 ) ( 2nd𝑐 ) ∧ ( ( 2nd𝑐 ) ‘ 0 ) = ( ( 2nd𝑐 ) ‘ ( ♯ ‘ ( 1st𝑐 ) ) ) ∧ ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℕ ) ) → 𝐺 ∈ USPGraph )
14 eqid ( Vtx ‘ 𝐺 ) = ( Vtx ‘ 𝐺 )
15 14 wlkpwrd ( ( 1st𝑐 ) ( Walks ‘ 𝐺 ) ( 2nd𝑐 ) → ( 2nd𝑐 ) ∈ Word ( Vtx ‘ 𝐺 ) )
16 15 3ad2ant1 ( ( ( 1st𝑐 ) ( Walks ‘ 𝐺 ) ( 2nd𝑐 ) ∧ ( ( 2nd𝑐 ) ‘ 0 ) = ( ( 2nd𝑐 ) ‘ ( ♯ ‘ ( 1st𝑐 ) ) ) ∧ ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℕ ) → ( 2nd𝑐 ) ∈ Word ( Vtx ‘ 𝐺 ) )
17 16 adantl ( ( 𝐺 ∈ USPGraph ∧ ( ( 1st𝑐 ) ( Walks ‘ 𝐺 ) ( 2nd𝑐 ) ∧ ( ( 2nd𝑐 ) ‘ 0 ) = ( ( 2nd𝑐 ) ‘ ( ♯ ‘ ( 1st𝑐 ) ) ) ∧ ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℕ ) ) → ( 2nd𝑐 ) ∈ Word ( Vtx ‘ 𝐺 ) )
18 elnnnn0c ( ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℕ ↔ ( ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℕ0 ∧ 1 ≤ ( ♯ ‘ ( 1st𝑐 ) ) ) )
19 nn0re ( ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℕ0 → ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℝ )
20 1e2m1 1 = ( 2 − 1 )
21 20 breq1i ( 1 ≤ ( ♯ ‘ ( 1st𝑐 ) ) ↔ ( 2 − 1 ) ≤ ( ♯ ‘ ( 1st𝑐 ) ) )
22 21 biimpi ( 1 ≤ ( ♯ ‘ ( 1st𝑐 ) ) → ( 2 − 1 ) ≤ ( ♯ ‘ ( 1st𝑐 ) ) )
23 2re 2 ∈ ℝ
24 1re 1 ∈ ℝ
25 lesubadd ( ( 2 ∈ ℝ ∧ 1 ∈ ℝ ∧ ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℝ ) → ( ( 2 − 1 ) ≤ ( ♯ ‘ ( 1st𝑐 ) ) ↔ 2 ≤ ( ( ♯ ‘ ( 1st𝑐 ) ) + 1 ) ) )
26 23 24 25 mp3an12 ( ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℝ → ( ( 2 − 1 ) ≤ ( ♯ ‘ ( 1st𝑐 ) ) ↔ 2 ≤ ( ( ♯ ‘ ( 1st𝑐 ) ) + 1 ) ) )
27 22 26 syl5ib ( ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℝ → ( 1 ≤ ( ♯ ‘ ( 1st𝑐 ) ) → 2 ≤ ( ( ♯ ‘ ( 1st𝑐 ) ) + 1 ) ) )
28 19 27 syl ( ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℕ0 → ( 1 ≤ ( ♯ ‘ ( 1st𝑐 ) ) → 2 ≤ ( ( ♯ ‘ ( 1st𝑐 ) ) + 1 ) ) )
29 28 adantl ( ( ( 1st𝑐 ) ( Walks ‘ 𝐺 ) ( 2nd𝑐 ) ∧ ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℕ0 ) → ( 1 ≤ ( ♯ ‘ ( 1st𝑐 ) ) → 2 ≤ ( ( ♯ ‘ ( 1st𝑐 ) ) + 1 ) ) )
30 wlklenvp1 ( ( 1st𝑐 ) ( Walks ‘ 𝐺 ) ( 2nd𝑐 ) → ( ♯ ‘ ( 2nd𝑐 ) ) = ( ( ♯ ‘ ( 1st𝑐 ) ) + 1 ) )
31 30 adantr ( ( ( 1st𝑐 ) ( Walks ‘ 𝐺 ) ( 2nd𝑐 ) ∧ ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℕ0 ) → ( ♯ ‘ ( 2nd𝑐 ) ) = ( ( ♯ ‘ ( 1st𝑐 ) ) + 1 ) )
32 31 breq2d ( ( ( 1st𝑐 ) ( Walks ‘ 𝐺 ) ( 2nd𝑐 ) ∧ ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℕ0 ) → ( 2 ≤ ( ♯ ‘ ( 2nd𝑐 ) ) ↔ 2 ≤ ( ( ♯ ‘ ( 1st𝑐 ) ) + 1 ) ) )
33 29 32 sylibrd ( ( ( 1st𝑐 ) ( Walks ‘ 𝐺 ) ( 2nd𝑐 ) ∧ ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℕ0 ) → ( 1 ≤ ( ♯ ‘ ( 1st𝑐 ) ) → 2 ≤ ( ♯ ‘ ( 2nd𝑐 ) ) ) )
34 33 expimpd ( ( 1st𝑐 ) ( Walks ‘ 𝐺 ) ( 2nd𝑐 ) → ( ( ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℕ0 ∧ 1 ≤ ( ♯ ‘ ( 1st𝑐 ) ) ) → 2 ≤ ( ♯ ‘ ( 2nd𝑐 ) ) ) )
35 18 34 syl5bi ( ( 1st𝑐 ) ( Walks ‘ 𝐺 ) ( 2nd𝑐 ) → ( ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℕ → 2 ≤ ( ♯ ‘ ( 2nd𝑐 ) ) ) )
36 35 a1d ( ( 1st𝑐 ) ( Walks ‘ 𝐺 ) ( 2nd𝑐 ) → ( ( ( 2nd𝑐 ) ‘ 0 ) = ( ( 2nd𝑐 ) ‘ ( ♯ ‘ ( 1st𝑐 ) ) ) → ( ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℕ → 2 ≤ ( ♯ ‘ ( 2nd𝑐 ) ) ) ) )
37 36 3imp ( ( ( 1st𝑐 ) ( Walks ‘ 𝐺 ) ( 2nd𝑐 ) ∧ ( ( 2nd𝑐 ) ‘ 0 ) = ( ( 2nd𝑐 ) ‘ ( ♯ ‘ ( 1st𝑐 ) ) ) ∧ ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℕ ) → 2 ≤ ( ♯ ‘ ( 2nd𝑐 ) ) )
38 37 adantl ( ( 𝐺 ∈ USPGraph ∧ ( ( 1st𝑐 ) ( Walks ‘ 𝐺 ) ( 2nd𝑐 ) ∧ ( ( 2nd𝑐 ) ‘ 0 ) = ( ( 2nd𝑐 ) ‘ ( ♯ ‘ ( 1st𝑐 ) ) ) ∧ ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℕ ) ) → 2 ≤ ( ♯ ‘ ( 2nd𝑐 ) ) )
39 eqid ( iEdg ‘ 𝐺 ) = ( iEdg ‘ 𝐺 )
40 14 39 clwlkclwwlk ( ( 𝐺 ∈ USPGraph ∧ ( 2nd𝑐 ) ∈ Word ( Vtx ‘ 𝐺 ) ∧ 2 ≤ ( ♯ ‘ ( 2nd𝑐 ) ) ) → ( ∃ 𝑓 𝑓 ( ClWalks ‘ 𝐺 ) ( 2nd𝑐 ) ↔ ( ( lastS ‘ ( 2nd𝑐 ) ) = ( ( 2nd𝑐 ) ‘ 0 ) ∧ ( ( 2nd𝑐 ) prefix ( ( ♯ ‘ ( 2nd𝑐 ) ) − 1 ) ) ∈ ( ClWWalks ‘ 𝐺 ) ) ) )
41 13 17 38 40 syl3anc ( ( 𝐺 ∈ USPGraph ∧ ( ( 1st𝑐 ) ( Walks ‘ 𝐺 ) ( 2nd𝑐 ) ∧ ( ( 2nd𝑐 ) ‘ 0 ) = ( ( 2nd𝑐 ) ‘ ( ♯ ‘ ( 1st𝑐 ) ) ) ∧ ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℕ ) ) → ( ∃ 𝑓 𝑓 ( ClWalks ‘ 𝐺 ) ( 2nd𝑐 ) ↔ ( ( lastS ‘ ( 2nd𝑐 ) ) = ( ( 2nd𝑐 ) ‘ 0 ) ∧ ( ( 2nd𝑐 ) prefix ( ( ♯ ‘ ( 2nd𝑐 ) ) − 1 ) ) ∈ ( ClWWalks ‘ 𝐺 ) ) ) )
42 12 41 mpbid ( ( 𝐺 ∈ USPGraph ∧ ( ( 1st𝑐 ) ( Walks ‘ 𝐺 ) ( 2nd𝑐 ) ∧ ( ( 2nd𝑐 ) ‘ 0 ) = ( ( 2nd𝑐 ) ‘ ( ♯ ‘ ( 1st𝑐 ) ) ) ∧ ( ♯ ‘ ( 1st𝑐 ) ) ∈ ℕ ) ) → ( ( lastS ‘ ( 2nd𝑐 ) ) = ( ( 2nd𝑐 ) ‘ 0 ) ∧ ( ( 2nd𝑐 ) prefix ( ( ♯ ‘ ( 2nd𝑐 ) ) − 1 ) ) ∈ ( ClWWalks ‘ 𝐺 ) ) )
43 5 42 sylan2 ( ( 𝐺 ∈ USPGraph ∧ 𝑐𝐶 ) → ( ( lastS ‘ ( 2nd𝑐 ) ) = ( ( 2nd𝑐 ) ‘ 0 ) ∧ ( ( 2nd𝑐 ) prefix ( ( ♯ ‘ ( 2nd𝑐 ) ) − 1 ) ) ∈ ( ClWWalks ‘ 𝐺 ) ) )
44 43 simprd ( ( 𝐺 ∈ USPGraph ∧ 𝑐𝐶 ) → ( ( 2nd𝑐 ) prefix ( ( ♯ ‘ ( 2nd𝑐 ) ) − 1 ) ) ∈ ( ClWWalks ‘ 𝐺 ) )
45 44 2 fmptd ( 𝐺 ∈ USPGraph → 𝐹 : 𝐶 ⟶ ( ClWWalks ‘ 𝐺 ) )