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

Theorem clwlkisclwwlk2 25530
Description: A closed walk corresponds to a closed walk as word in an undirected graph. (Contributed by Alexander van der Vekens, 22-Jun-2018.)
Assertion
Ref Expression
clwlkisclwwlk2  |-  ( ( V USGrph  E  /\  P  e. Word  V  /\  1  <_  ( # `
 P ) )  ->  ( E. f 
f ( V ClWalks  E
) ( P ++  <" ( P `  0
) "> )  <->  P  e.  ( V ClWWalks  E ) ) )
Distinct variable groups:    f, E    P, f    f, V

Proof of Theorem clwlkisclwwlk2
StepHypRef Expression
1 lswccats1fst 12767 . . . 4  |-  ( ( P  e. Word  V  /\  1  <_  ( # `  P
) )  ->  ( lastS  `  ( P ++  <" ( P `  0 ) "> ) )  =  ( ( P ++  <" ( P `  0
) "> ) `  0 ) )
213adant1 1027 . . 3  |-  ( ( V USGrph  E  /\  P  e. Word  V  /\  1  <_  ( # `
 P ) )  ->  ( lastS  `  ( P ++ 
<" ( P ` 
0 ) "> ) )  =  ( ( P ++  <" ( P `  0 ) "> ) `  0
) )
32biantrurd 515 . 2  |-  ( ( V USGrph  E  /\  P  e. Word  V  /\  1  <_  ( # `
 P ) )  ->  ( ( ( P ++  <" ( P `
 0 ) "> ) substr  <. 0 ,  ( ( # `  ( P ++  <" ( P `
 0 ) "> ) )  - 
1 ) >. )  e.  ( V ClWWalks  E )  <->  ( ( lastS  `  ( P ++  <" ( P ` 
0 ) "> ) )  =  ( ( P ++  <" ( P `  0 ) "> ) `  0
)  /\  ( ( P ++  <" ( P `
 0 ) "> ) substr  <. 0 ,  ( ( # `  ( P ++  <" ( P `
 0 ) "> ) )  - 
1 ) >. )  e.  ( V ClWWalks  E )
) ) )
4 simpl 463 . . . . . . . . 9  |-  ( ( P  e. Word  V  /\  1  <_  ( # `  P
) )  ->  P  e. Word  V )
5 wrdsymb1 12702 . . . . . . . . 9  |-  ( ( P  e. Word  V  /\  1  <_  ( # `  P
) )  ->  ( P `  0 )  e.  V )
6 wrdlenccats1lenm1 12755 . . . . . . . . 9  |-  ( ( P  e. Word  V  /\  ( P `  0 )  e.  V )  -> 
( # `  P )  =  ( ( # `  ( P ++  <" ( P `  0 ) "> ) )  - 
1 ) )
74, 5, 6syl2anc 671 . . . . . . . 8  |-  ( ( P  e. Word  V  /\  1  <_  ( # `  P
) )  ->  ( # `
 P )  =  ( ( # `  ( P ++  <" ( P `
 0 ) "> ) )  - 
1 ) )
87eqcomd 2458 . . . . . . 7  |-  ( ( P  e. Word  V  /\  1  <_  ( # `  P
) )  ->  (
( # `  ( P ++ 
<" ( P ` 
0 ) "> ) )  -  1 )  =  ( # `  P ) )
98opeq2d 4143 . . . . . 6  |-  ( ( P  e. Word  V  /\  1  <_  ( # `  P
) )  ->  <. 0 ,  ( ( # `  ( P ++  <" ( P `  0 ) "> ) )  - 
1 ) >.  =  <. 0 ,  ( # `  P
) >. )
109oveq2d 6292 . . . . 5  |-  ( ( P  e. Word  V  /\  1  <_  ( # `  P
) )  ->  (
( P ++  <" ( P `  0 ) "> ) substr  <. 0 ,  ( ( # `  ( P ++  <" ( P `
 0 ) "> ) )  - 
1 ) >. )  =  ( ( P ++ 
<" ( P ` 
0 ) "> ) substr  <. 0 ,  (
# `  P ) >. ) )
115s1cld 12740 . . . . . 6  |-  ( ( P  e. Word  V  /\  1  <_  ( # `  P
) )  ->  <" ( P `  0 ) ">  e. Word  V )
12 eqidd 2453 . . . . . 6  |-  ( ( P  e. Word  V  /\  1  <_  ( # `  P
) )  ->  ( # `
 P )  =  ( # `  P
) )
13 swrdccatid 12852 . . . . . 6  |-  ( ( P  e. Word  V  /\  <" ( P ` 
0 ) ">  e. Word  V  /\  ( # `  P )  =  (
# `  P )
)  ->  ( ( P ++  <" ( P `
 0 ) "> ) substr  <. 0 ,  ( # `  P
) >. )  =  P )
144, 11, 12, 13syl3anc 1271 . . . . 5  |-  ( ( P  e. Word  V  /\  1  <_  ( # `  P
) )  ->  (
( P ++  <" ( P `  0 ) "> ) substr  <. 0 ,  ( # `  P
) >. )  =  P )
1510, 14eqtr2d 2487 . . . 4  |-  ( ( P  e. Word  V  /\  1  <_  ( # `  P
) )  ->  P  =  ( ( P ++ 
<" ( P ` 
0 ) "> ) substr  <. 0 ,  ( ( # `  ( P ++  <" ( P `
 0 ) "> ) )  - 
1 ) >. )
)
16153adant1 1027 . . 3  |-  ( ( V USGrph  E  /\  P  e. Word  V  /\  1  <_  ( # `
 P ) )  ->  P  =  ( ( P ++  <" ( P `  0 ) "> ) substr  <. 0 ,  ( ( # `  ( P ++  <" ( P `
 0 ) "> ) )  - 
1 ) >. )
)
1716eleq1d 2514 . 2  |-  ( ( V USGrph  E  /\  P  e. Word  V  /\  1  <_  ( # `
 P ) )  ->  ( P  e.  ( V ClWWalks  E )  <->  ( ( P ++  <" ( P `  0 ) "> ) substr  <. 0 ,  ( ( # `  ( P ++  <" ( P `
 0 ) "> ) )  - 
1 ) >. )  e.  ( V ClWWalks  E )
) )
18 simp1 1009 . . 3  |-  ( ( V USGrph  E  /\  P  e. Word  V  /\  1  <_  ( # `
 P ) )  ->  V USGrph  E )
19 simp2 1010 . . . 4  |-  ( ( V USGrph  E  /\  P  e. Word  V  /\  1  <_  ( # `
 P ) )  ->  P  e. Word  V
)
20113adant1 1027 . . . 4  |-  ( ( V USGrph  E  /\  P  e. Word  V  /\  1  <_  ( # `
 P ) )  ->  <" ( P `
 0 ) ">  e. Word  V )
21 ccatcl 12718 . . . 4  |-  ( ( P  e. Word  V  /\  <" ( P ` 
0 ) ">  e. Word  V )  ->  ( P ++  <" ( P `
 0 ) "> )  e. Word  V
)
2219, 20, 21syl2anc 671 . . 3  |-  ( ( V USGrph  E  /\  P  e. Word  V  /\  1  <_  ( # `
 P ) )  ->  ( P ++  <" ( P `  0
) "> )  e. Word  V )
23 lencl 12684 . . . . . . . 8  |-  ( P  e. Word  V  ->  ( # `
 P )  e. 
NN0 )
24 1e2m1 10714 . . . . . . . . . . 11  |-  1  =  ( 2  -  1 )
2524a1i 11 . . . . . . . . . 10  |-  ( (
# `  P )  e.  NN0  ->  1  =  ( 2  -  1 ) )
2625breq1d 4384 . . . . . . . . 9  |-  ( (
# `  P )  e.  NN0  ->  ( 1  <_  ( # `  P
)  <->  ( 2  -  1 )  <_  ( # `
 P ) ) )
27 2re 10668 . . . . . . . . . . 11  |-  2  e.  RR
2827a1i 11 . . . . . . . . . 10  |-  ( (
# `  P )  e.  NN0  ->  2  e.  RR )
29 1red 9645 . . . . . . . . . 10  |-  ( (
# `  P )  e.  NN0  ->  1  e.  RR )
30 nn0re 10868 . . . . . . . . . 10  |-  ( (
# `  P )  e.  NN0  ->  ( # `  P
)  e.  RR )
3128, 29, 30lesubaddd 10199 . . . . . . . . 9  |-  ( (
# `  P )  e.  NN0  ->  ( (
2  -  1 )  <_  ( # `  P
)  <->  2  <_  (
( # `  P )  +  1 ) ) )
3226, 31bitrd 261 . . . . . . . 8  |-  ( (
# `  P )  e.  NN0  ->  ( 1  <_  ( # `  P
)  <->  2  <_  (
( # `  P )  +  1 ) ) )
3323, 32syl 17 . . . . . . 7  |-  ( P  e. Word  V  ->  (
1  <_  ( # `  P
)  <->  2  <_  (
( # `  P )  +  1 ) ) )
3433biimpa 491 . . . . . 6  |-  ( ( P  e. Word  V  /\  1  <_  ( # `  P
) )  ->  2  <_  ( ( # `  P
)  +  1 ) )
35 s1len 12742 . . . . . . 7  |-  ( # `  <" ( P `
 0 ) "> )  =  1
3635oveq2i 6287 . . . . . 6  |-  ( (
# `  P )  +  ( # `  <" ( P `  0
) "> )
)  =  ( (
# `  P )  +  1 )
3734, 36syl6breqr 4415 . . . . 5  |-  ( ( P  e. Word  V  /\  1  <_  ( # `  P
) )  ->  2  <_  ( ( # `  P
)  +  ( # `  <" ( P `
 0 ) "> ) ) )
38373adant1 1027 . . . 4  |-  ( ( V USGrph  E  /\  P  e. Word  V  /\  1  <_  ( # `
 P ) )  ->  2  <_  (
( # `  P )  +  ( # `  <" ( P `  0
) "> )
) )
394, 11jca 539 . . . . . 6  |-  ( ( P  e. Word  V  /\  1  <_  ( # `  P
) )  ->  ( P  e. Word  V  /\  <" ( P `  0
) ">  e. Word  V ) )
40393adant1 1027 . . . . 5  |-  ( ( V USGrph  E  /\  P  e. Word  V  /\  1  <_  ( # `
 P ) )  ->  ( P  e. Word  V  /\  <" ( P `
 0 ) ">  e. Word  V )
)
41 ccatlen 12719 . . . . 5  |-  ( ( P  e. Word  V  /\  <" ( P ` 
0 ) ">  e. Word  V )  ->  ( # `
 ( P ++  <" ( P `  0
) "> )
)  =  ( (
# `  P )  +  ( # `  <" ( P `  0
) "> )
) )
4240, 41syl 17 . . . 4  |-  ( ( V USGrph  E  /\  P  e. Word  V  /\  1  <_  ( # `
 P ) )  ->  ( # `  ( P ++  <" ( P `
 0 ) "> ) )  =  ( ( # `  P
)  +  ( # `  <" ( P `
 0 ) "> ) ) )
4338, 42breqtrrd 4401 . . 3  |-  ( ( V USGrph  E  /\  P  e. Word  V  /\  1  <_  ( # `
 P ) )  ->  2  <_  ( # `
 ( P ++  <" ( P `  0
) "> )
) )
44 clwlkisclwwlk 25529 . . 3  |-  ( ( V USGrph  E  /\  ( P ++  <" ( P `
 0 ) "> )  e. Word  V  /\  2  <_  ( # `  ( P ++  <" ( P `  0 ) "> ) ) )  ->  ( E. f 
f ( V ClWalks  E
) ( P ++  <" ( P `  0
) "> )  <->  ( ( lastS  `  ( P ++  <" ( P ` 
0 ) "> ) )  =  ( ( P ++  <" ( P `  0 ) "> ) `  0
)  /\  ( ( P ++  <" ( P `
 0 ) "> ) substr  <. 0 ,  ( ( # `  ( P ++  <" ( P `
 0 ) "> ) )  - 
1 ) >. )  e.  ( V ClWWalks  E )
) ) )
4518, 22, 43, 44syl3anc 1271 . 2  |-  ( ( V USGrph  E  /\  P  e. Word  V  /\  1  <_  ( # `
 P ) )  ->  ( E. f 
f ( V ClWalks  E
) ( P ++  <" ( P `  0
) "> )  <->  ( ( lastS  `  ( P ++  <" ( P ` 
0 ) "> ) )  =  ( ( P ++  <" ( P `  0 ) "> ) `  0
)  /\  ( ( P ++  <" ( P `
 0 ) "> ) substr  <. 0 ,  ( ( # `  ( P ++  <" ( P `
 0 ) "> ) )  - 
1 ) >. )  e.  ( V ClWWalks  E )
) ) )
463, 17, 453bitr4rd 294 1  |-  ( ( V USGrph  E  /\  P  e. Word  V  /\  1  <_  ( # `
 P ) )  ->  ( E. f 
f ( V ClWalks  E
) ( P ++  <" ( P `  0
) "> )  <->  P  e.  ( V ClWWalks  E ) ) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    <-> wb 189    /\ wa 375    /\ w3a 986    = wceq 1448   E.wex 1667    e. wcel 1891   <.cop 3942   class class class wbr 4374   ` cfv 5561  (class class class)co 6276   RRcr 9525   0cc0 9526   1c1 9527    + caddc 9529    <_ cle 9663    - cmin 9847   2c2 10648   NN0cn0 10859   #chash 12509  Word cword 12651   lastS clsw 12652   ++ cconcat 12653   <"cs1 12654   substr csubstr 12655   USGrph cusg 25069   ClWalks cclwlk 25487   ClWWalks cclwwlk 25488
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1673  ax-4 1686  ax-5 1762  ax-6 1809  ax-7 1855  ax-8 1893  ax-9 1900  ax-10 1919  ax-11 1924  ax-12 1937  ax-13 2092  ax-ext 2432  ax-rep 4487  ax-sep 4497  ax-nul 4506  ax-pow 4554  ax-pr 4612  ax-un 6571  ax-cnex 9582  ax-resscn 9583  ax-1cn 9584  ax-icn 9585  ax-addcl 9586  ax-addrcl 9587  ax-mulcl 9588  ax-mulrcl 9589  ax-mulcom 9590  ax-addass 9591  ax-mulass 9592  ax-distr 9593  ax-i2m1 9594  ax-1ne0 9595  ax-1rid 9596  ax-rnegex 9597  ax-rrecex 9598  ax-cnre 9599  ax-pre-lttri 9600  ax-pre-lttrn 9601  ax-pre-ltadd 9602  ax-pre-mulgt0 9603
This theorem depends on definitions:  df-bi 190  df-or 376  df-an 377  df-3or 987  df-3an 988  df-tru 1451  df-ex 1668  df-nf 1672  df-sb 1802  df-eu 2304  df-mo 2305  df-clab 2439  df-cleq 2445  df-clel 2448  df-nfc 2582  df-ne 2624  df-nel 2625  df-ral 2742  df-rex 2743  df-reu 2744  df-rmo 2745  df-rab 2746  df-v 3015  df-sbc 3236  df-csb 3332  df-dif 3375  df-un 3377  df-in 3379  df-ss 3386  df-pss 3388  df-nul 3700  df-if 3850  df-pw 3921  df-sn 3937  df-pr 3939  df-tp 3941  df-op 3943  df-uni 4169  df-int 4205  df-iun 4250  df-br 4375  df-opab 4434  df-mpt 4435  df-tr 4470  df-eprel 4723  df-id 4727  df-po 4733  df-so 4734  df-fr 4771  df-we 4773  df-xp 4818  df-rel 4819  df-cnv 4820  df-co 4821  df-dm 4822  df-rn 4823  df-res 4824  df-ima 4825  df-pred 5359  df-ord 5405  df-on 5406  df-lim 5407  df-suc 5408  df-iota 5525  df-fun 5563  df-fn 5564  df-f 5565  df-f1 5566  df-fo 5567  df-f1o 5568  df-fv 5569  df-riota 6238  df-ov 6279  df-oprab 6280  df-mpt2 6281  df-om 6681  df-1st 6781  df-2nd 6782  df-wrecs 7015  df-recs 7077  df-rdg 7115  df-1o 7169  df-oadd 7173  df-er 7350  df-map 7461  df-pm 7462  df-en 7557  df-dom 7558  df-sdom 7559  df-fin 7560  df-card 8360  df-cda 8585  df-pnf 9664  df-mnf 9665  df-xr 9666  df-ltxr 9667  df-le 9668  df-sub 9849  df-neg 9850  df-nn 10599  df-2 10657  df-n0 10860  df-z 10928  df-uz 11150  df-rp 11293  df-fz 11776  df-fzo 11909  df-hash 12510  df-word 12659  df-lsw 12660  df-concat 12661  df-s1 12662  df-substr 12663  df-usgra 25072  df-wlk 25248  df-clwlk 25490  df-clwwlk 25491
This theorem is referenced by:  clwlkfoclwwlk  25585
  Copyright terms: Public domain W3C validator