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

Theorem swrdsymbeq 12624
Description: If two words have the same prefix, their symbols are identical within this prefix. (Contributed by Alexander van der Vekens, 5-Jul-2018.)
Assertion
Ref Expression
swrdsymbeq  |-  ( ( ( U  e. Word  V  /\  W  e. Word  V )  /\  ( N  e. 
NN0  /\  N  <_  (
# `  U )  /\  N  <_  ( # `  W ) ) )  ->  ( ( U substr  <. 0 ,  N >. )  =  ( W substr  <. 0 ,  N >. )  ->  A. i  e.  ( 0..^ N ) ( U `  i
)  =  ( W `
 i ) ) )
Distinct variable groups:    i, N    U, i    i, V    i, W

Proof of Theorem swrdsymbeq
StepHypRef Expression
1 swrdcl 12598 . . . . 5  |-  ( U  e. Word  V  ->  ( U substr  <. 0 ,  N >. )  e. Word  V )
2 swrdcl 12598 . . . . 5  |-  ( W  e. Word  V  ->  ( W substr  <. 0 ,  N >. )  e. Word  V )
31, 2anim12i 566 . . . 4  |-  ( ( U  e. Word  V  /\  W  e. Word  V )  ->  ( ( U substr  <. 0 ,  N >. )  e. Word  V  /\  ( W substr  <. 0 ,  N >. )  e. Word  V
) )
43adantr 465 . . 3  |-  ( ( ( U  e. Word  V  /\  W  e. Word  V )  /\  ( N  e. 
NN0  /\  N  <_  (
# `  U )  /\  N  <_  ( # `  W ) ) )  ->  ( ( U substr  <. 0 ,  N >. )  e. Word  V  /\  ( W substr  <. 0 ,  N >. )  e. Word  V ) )
5 eqwrd 12536 . . 3  |-  ( ( ( U substr  <. 0 ,  N >. )  e. Word  V  /\  ( W substr  <. 0 ,  N >. )  e. Word  V
)  ->  ( ( U substr  <. 0 ,  N >. )  =  ( W substr  <. 0 ,  N >. )  <-> 
( ( # `  ( U substr  <. 0 ,  N >. ) )  =  (
# `  ( W substr  <.
0 ,  N >. ) )  /\  A. i  e.  ( 0..^ ( # `  ( U substr  <. 0 ,  N >. ) ) ) ( ( U substr  <. 0 ,  N >. ) `  i
)  =  ( ( W substr  <. 0 ,  N >. ) `  i ) ) ) )
64, 5syl 16 . 2  |-  ( ( ( U  e. Word  V  /\  W  e. Word  V )  /\  ( N  e. 
NN0  /\  N  <_  (
# `  U )  /\  N  <_  ( # `  W ) ) )  ->  ( ( U substr  <. 0 ,  N >. )  =  ( W substr  <. 0 ,  N >. )  <->  ( ( # `
 ( U substr  <. 0 ,  N >. ) )  =  ( # `  ( W substr  <. 0 ,  N >. ) )  /\  A. i  e.  ( 0..^ ( # `  ( U substr  <. 0 ,  N >. ) ) ) ( ( U substr  <. 0 ,  N >. ) `  i
)  =  ( ( W substr  <. 0 ,  N >. ) `  i ) ) ) )
7 simpll 753 . . . . . . . . . 10  |-  ( ( ( U  e. Word  V  /\  W  e. Word  V )  /\  ( N  e. 
NN0  /\  N  <_  (
# `  U )  /\  N  <_  ( # `  W ) ) )  ->  U  e. Word  V
)
8 simpr1 997 . . . . . . . . . . 11  |-  ( ( ( U  e. Word  V  /\  W  e. Word  V )  /\  ( N  e. 
NN0  /\  N  <_  (
# `  U )  /\  N  <_  ( # `  W ) ) )  ->  N  e.  NN0 )
9 lencl 12517 . . . . . . . . . . . 12  |-  ( U  e. Word  V  ->  ( # `
 U )  e. 
NN0 )
109ad2antrr 725 . . . . . . . . . . 11  |-  ( ( ( U  e. Word  V  /\  W  e. Word  V )  /\  ( N  e. 
NN0  /\  N  <_  (
# `  U )  /\  N  <_  ( # `  W ) ) )  ->  ( # `  U
)  e.  NN0 )
11 simpr2 998 . . . . . . . . . . 11  |-  ( ( ( U  e. Word  V  /\  W  e. Word  V )  /\  ( N  e. 
NN0  /\  N  <_  (
# `  U )  /\  N  <_  ( # `  W ) ) )  ->  N  <_  ( # `
 U ) )
12 elfz2nn0 11759 . . . . . . . . . . 11  |-  ( N  e.  ( 0 ... ( # `  U
) )  <->  ( N  e.  NN0  /\  ( # `  U )  e.  NN0  /\  N  <_  ( # `  U
) ) )
138, 10, 11, 12syl3anbrc 1175 . . . . . . . . . 10  |-  ( ( ( U  e. Word  V  /\  W  e. Word  V )  /\  ( N  e. 
NN0  /\  N  <_  (
# `  U )  /\  N  <_  ( # `  W ) ) )  ->  N  e.  ( 0 ... ( # `  U ) ) )
147, 13jca 532 . . . . . . . . 9  |-  ( ( ( U  e. Word  V  /\  W  e. Word  V )  /\  ( N  e. 
NN0  /\  N  <_  (
# `  U )  /\  N  <_  ( # `  W ) ) )  ->  ( U  e. Word  V  /\  N  e.  ( 0 ... ( # `  U ) ) ) )
1514adantr 465 . . . . . . . 8  |-  ( ( ( ( U  e. Word  V  /\  W  e. Word  V
)  /\  ( N  e.  NN0  /\  N  <_ 
( # `  U )  /\  N  <_  ( # `
 W ) ) )  /\  ( # `  ( U substr  <. 0 ,  N >. ) )  =  ( # `  ( W substr  <. 0 ,  N >. ) ) )  -> 
( U  e. Word  V  /\  N  e.  (
0 ... ( # `  U
) ) ) )
16 swrd0len 12601 . . . . . . . 8  |-  ( ( U  e. Word  V  /\  N  e.  ( 0 ... ( # `  U
) ) )  -> 
( # `  ( U substr  <. 0 ,  N >. ) )  =  N )
1715, 16syl 16 . . . . . . 7  |-  ( ( ( ( U  e. Word  V  /\  W  e. Word  V
)  /\  ( N  e.  NN0  /\  N  <_ 
( # `  U )  /\  N  <_  ( # `
 W ) ) )  /\  ( # `  ( U substr  <. 0 ,  N >. ) )  =  ( # `  ( W substr  <. 0 ,  N >. ) ) )  -> 
( # `  ( U substr  <. 0 ,  N >. ) )  =  N )
1817oveq2d 6293 . . . . . 6  |-  ( ( ( ( U  e. Word  V  /\  W  e. Word  V
)  /\  ( N  e.  NN0  /\  N  <_ 
( # `  U )  /\  N  <_  ( # `
 W ) ) )  /\  ( # `  ( U substr  <. 0 ,  N >. ) )  =  ( # `  ( W substr  <. 0 ,  N >. ) ) )  -> 
( 0..^ ( # `  ( U substr  <. 0 ,  N >. ) ) )  =  ( 0..^ N ) )
1918raleqdv 3059 . . . . 5  |-  ( ( ( ( U  e. Word  V  /\  W  e. Word  V
)  /\  ( N  e.  NN0  /\  N  <_ 
( # `  U )  /\  N  <_  ( # `
 W ) ) )  /\  ( # `  ( U substr  <. 0 ,  N >. ) )  =  ( # `  ( W substr  <. 0 ,  N >. ) ) )  -> 
( A. i  e.  ( 0..^ ( # `  ( U substr  <. 0 ,  N >. ) ) ) ( ( U substr  <. 0 ,  N >. ) `  i
)  =  ( ( W substr  <. 0 ,  N >. ) `  i )  <->  A. i  e.  (
0..^ N ) ( ( U substr  <. 0 ,  N >. ) `  i
)  =  ( ( W substr  <. 0 ,  N >. ) `  i ) ) )
207ad2antrr 725 . . . . . . . 8  |-  ( ( ( ( ( U  e. Word  V  /\  W  e. Word  V )  /\  ( N  e.  NN0  /\  N  <_  ( # `  U
)  /\  N  <_  (
# `  W )
) )  /\  ( # `
 ( U substr  <. 0 ,  N >. ) )  =  ( # `  ( W substr  <. 0 ,  N >. ) ) )  /\  i  e.  ( 0..^ N ) )  ->  U  e. Word  V )
2113ad2antrr 725 . . . . . . . 8  |-  ( ( ( ( ( U  e. Word  V  /\  W  e. Word  V )  /\  ( N  e.  NN0  /\  N  <_  ( # `  U
)  /\  N  <_  (
# `  W )
) )  /\  ( # `
 ( U substr  <. 0 ,  N >. ) )  =  ( # `  ( W substr  <. 0 ,  N >. ) ) )  /\  i  e.  ( 0..^ N ) )  ->  N  e.  ( 0 ... ( # `  U
) ) )
22 simpr 461 . . . . . . . 8  |-  ( ( ( ( ( U  e. Word  V  /\  W  e. Word  V )  /\  ( N  e.  NN0  /\  N  <_  ( # `  U
)  /\  N  <_  (
# `  W )
) )  /\  ( # `
 ( U substr  <. 0 ,  N >. ) )  =  ( # `  ( W substr  <. 0 ,  N >. ) ) )  /\  i  e.  ( 0..^ N ) )  -> 
i  e.  ( 0..^ N ) )
23 swrd0fv 12618 . . . . . . . 8  |-  ( ( U  e. Word  V  /\  N  e.  ( 0 ... ( # `  U
) )  /\  i  e.  ( 0..^ N ) )  ->  ( ( U substr  <. 0 ,  N >. ) `  i )  =  ( U `  i ) )
2420, 21, 22, 23syl3anc 1223 . . . . . . 7  |-  ( ( ( ( ( U  e. Word  V  /\  W  e. Word  V )  /\  ( N  e.  NN0  /\  N  <_  ( # `  U
)  /\  N  <_  (
# `  W )
) )  /\  ( # `
 ( U substr  <. 0 ,  N >. ) )  =  ( # `  ( W substr  <. 0 ,  N >. ) ) )  /\  i  e.  ( 0..^ N ) )  -> 
( ( U substr  <. 0 ,  N >. ) `  i
)  =  ( U `
 i ) )
25 simp-4r 766 . . . . . . . 8  |-  ( ( ( ( ( U  e. Word  V  /\  W  e. Word  V )  /\  ( N  e.  NN0  /\  N  <_  ( # `  U
)  /\  N  <_  (
# `  W )
) )  /\  ( # `
 ( U substr  <. 0 ,  N >. ) )  =  ( # `  ( W substr  <. 0 ,  N >. ) ) )  /\  i  e.  ( 0..^ N ) )  ->  W  e. Word  V )
26 lencl 12517 . . . . . . . . . . 11  |-  ( W  e. Word  V  ->  ( # `
 W )  e. 
NN0 )
2726ad2antlr 726 . . . . . . . . . 10  |-  ( ( ( U  e. Word  V  /\  W  e. Word  V )  /\  ( N  e. 
NN0  /\  N  <_  (
# `  U )  /\  N  <_  ( # `  W ) ) )  ->  ( # `  W
)  e.  NN0 )
28 simpr3 999 . . . . . . . . . 10  |-  ( ( ( U  e. Word  V  /\  W  e. Word  V )  /\  ( N  e. 
NN0  /\  N  <_  (
# `  U )  /\  N  <_  ( # `  W ) ) )  ->  N  <_  ( # `
 W ) )
29 elfz2nn0 11759 . . . . . . . . . 10  |-  ( N  e.  ( 0 ... ( # `  W
) )  <->  ( N  e.  NN0  /\  ( # `  W )  e.  NN0  /\  N  <_  ( # `  W
) ) )
308, 27, 28, 29syl3anbrc 1175 . . . . . . . . 9  |-  ( ( ( U  e. Word  V  /\  W  e. Word  V )  /\  ( N  e. 
NN0  /\  N  <_  (
# `  U )  /\  N  <_  ( # `  W ) ) )  ->  N  e.  ( 0 ... ( # `  W ) ) )
3130ad2antrr 725 . . . . . . . 8  |-  ( ( ( ( ( U  e. Word  V  /\  W  e. Word  V )  /\  ( N  e.  NN0  /\  N  <_  ( # `  U
)  /\  N  <_  (
# `  W )
) )  /\  ( # `
 ( U substr  <. 0 ,  N >. ) )  =  ( # `  ( W substr  <. 0 ,  N >. ) ) )  /\  i  e.  ( 0..^ N ) )  ->  N  e.  ( 0 ... ( # `  W
) ) )
32 swrd0fv 12618 . . . . . . . 8  |-  ( ( W  e. Word  V  /\  N  e.  ( 0 ... ( # `  W
) )  /\  i  e.  ( 0..^ N ) )  ->  ( ( W substr  <. 0 ,  N >. ) `  i )  =  ( W `  i ) )
3325, 31, 22, 32syl3anc 1223 . . . . . . 7  |-  ( ( ( ( ( U  e. Word  V  /\  W  e. Word  V )  /\  ( N  e.  NN0  /\  N  <_  ( # `  U
)  /\  N  <_  (
# `  W )
) )  /\  ( # `
 ( U substr  <. 0 ,  N >. ) )  =  ( # `  ( W substr  <. 0 ,  N >. ) ) )  /\  i  e.  ( 0..^ N ) )  -> 
( ( W substr  <. 0 ,  N >. ) `  i
)  =  ( W `
 i ) )
3424, 33eqeq12d 2484 . . . . . 6  |-  ( ( ( ( ( U  e. Word  V  /\  W  e. Word  V )  /\  ( N  e.  NN0  /\  N  <_  ( # `  U
)  /\  N  <_  (
# `  W )
) )  /\  ( # `
 ( U substr  <. 0 ,  N >. ) )  =  ( # `  ( W substr  <. 0 ,  N >. ) ) )  /\  i  e.  ( 0..^ N ) )  -> 
( ( ( U substr  <. 0 ,  N >. ) `
 i )  =  ( ( W substr  <. 0 ,  N >. ) `  i
)  <->  ( U `  i )  =  ( W `  i ) ) )
3534ralbidva 2895 . . . . 5  |-  ( ( ( ( U  e. Word  V  /\  W  e. Word  V
)  /\  ( N  e.  NN0  /\  N  <_ 
( # `  U )  /\  N  <_  ( # `
 W ) ) )  /\  ( # `  ( U substr  <. 0 ,  N >. ) )  =  ( # `  ( W substr  <. 0 ,  N >. ) ) )  -> 
( A. i  e.  ( 0..^ N ) ( ( U substr  <. 0 ,  N >. ) `  i
)  =  ( ( W substr  <. 0 ,  N >. ) `  i )  <->  A. i  e.  (
0..^ N ) ( U `  i )  =  ( W `  i ) ) )
3619, 35bitrd 253 . . . 4  |-  ( ( ( ( U  e. Word  V  /\  W  e. Word  V
)  /\  ( N  e.  NN0  /\  N  <_ 
( # `  U )  /\  N  <_  ( # `
 W ) ) )  /\  ( # `  ( U substr  <. 0 ,  N >. ) )  =  ( # `  ( W substr  <. 0 ,  N >. ) ) )  -> 
( A. i  e.  ( 0..^ ( # `  ( U substr  <. 0 ,  N >. ) ) ) ( ( U substr  <. 0 ,  N >. ) `  i
)  =  ( ( W substr  <. 0 ,  N >. ) `  i )  <->  A. i  e.  (
0..^ N ) ( U `  i )  =  ( W `  i ) ) )
3736biimpd 207 . . 3  |-  ( ( ( ( U  e. Word  V  /\  W  e. Word  V
)  /\  ( N  e.  NN0  /\  N  <_ 
( # `  U )  /\  N  <_  ( # `
 W ) ) )  /\  ( # `  ( U substr  <. 0 ,  N >. ) )  =  ( # `  ( W substr  <. 0 ,  N >. ) ) )  -> 
( A. i  e.  ( 0..^ ( # `  ( U substr  <. 0 ,  N >. ) ) ) ( ( U substr  <. 0 ,  N >. ) `  i
)  =  ( ( W substr  <. 0 ,  N >. ) `  i )  ->  A. i  e.  ( 0..^ N ) ( U `  i )  =  ( W `  i ) ) )
3837expimpd 603 . 2  |-  ( ( ( U  e. Word  V  /\  W  e. Word  V )  /\  ( N  e. 
NN0  /\  N  <_  (
# `  U )  /\  N  <_  ( # `  W ) ) )  ->  ( ( (
# `  ( U substr  <.
0 ,  N >. ) )  =  ( # `  ( W substr  <. 0 ,  N >. ) )  /\  A. i  e.  ( 0..^ ( # `  ( U substr  <. 0 ,  N >. ) ) ) ( ( U substr  <. 0 ,  N >. ) `  i
)  =  ( ( W substr  <. 0 ,  N >. ) `  i ) )  ->  A. i  e.  ( 0..^ N ) ( U `  i
)  =  ( W `
 i ) ) )
396, 38sylbid 215 1  |-  ( ( ( U  e. Word  V  /\  W  e. Word  V )  /\  ( N  e. 
NN0  /\  N  <_  (
# `  U )  /\  N  <_  ( # `  W ) ) )  ->  ( ( U substr  <. 0 ,  N >. )  =  ( W substr  <. 0 ,  N >. )  ->  A. i  e.  ( 0..^ N ) ( U `  i
)  =  ( W `
 i ) ) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    <-> wb 184    /\ wa 369    /\ w3a 968    = wceq 1374    e. wcel 1762   A.wral 2809   <.cop 4028   class class class wbr 4442   ` cfv 5581  (class class class)co 6277   0cc0 9483    <_ cle 9620   NN0cn0 10786   ...cfz 11663  ..^cfzo 11783   #chash 12362  Word cword 12489   substr csubstr 12493
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1596  ax-4 1607  ax-5 1675  ax-6 1714  ax-7 1734  ax-8 1764  ax-9 1766  ax-10 1781  ax-11 1786  ax-12 1798  ax-13 1963  ax-ext 2440  ax-rep 4553  ax-sep 4563  ax-nul 4571  ax-pow 4620  ax-pr 4681  ax-un 6569  ax-cnex 9539  ax-resscn 9540  ax-1cn 9541  ax-icn 9542  ax-addcl 9543  ax-addrcl 9544  ax-mulcl 9545  ax-mulrcl 9546  ax-mulcom 9547  ax-addass 9548  ax-mulass 9549  ax-distr 9550  ax-i2m1 9551  ax-1ne0 9552  ax-1rid 9553  ax-rnegex 9554  ax-rrecex 9555  ax-cnre 9556  ax-pre-lttri 9557  ax-pre-lttrn 9558  ax-pre-ltadd 9559  ax-pre-mulgt0 9560
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 969  df-3an 970  df-tru 1377  df-ex 1592  df-nf 1595  df-sb 1707  df-eu 2274  df-mo 2275  df-clab 2448  df-cleq 2454  df-clel 2457  df-nfc 2612  df-ne 2659  df-nel 2660  df-ral 2814  df-rex 2815  df-reu 2816  df-rab 2818  df-v 3110  df-sbc 3327  df-csb 3431  df-dif 3474  df-un 3476  df-in 3478  df-ss 3485  df-pss 3487  df-nul 3781  df-if 3935  df-pw 4007  df-sn 4023  df-pr 4025  df-tp 4027  df-op 4029  df-uni 4241  df-int 4278  df-iun 4322  df-br 4443  df-opab 4501  df-mpt 4502  df-tr 4536  df-eprel 4786  df-id 4790  df-po 4795  df-so 4796  df-fr 4833  df-we 4835  df-ord 4876  df-on 4877  df-lim 4878  df-suc 4879  df-xp 5000  df-rel 5001  df-cnv 5002  df-co 5003  df-dm 5004  df-rn 5005  df-res 5006  df-ima 5007  df-iota 5544  df-fun 5583  df-fn 5584  df-f 5585  df-f1 5586  df-fo 5587  df-f1o 5588  df-fv 5589  df-riota 6238  df-ov 6280  df-oprab 6281  df-mpt2 6282  df-om 6674  df-1st 6776  df-2nd 6777  df-recs 7034  df-rdg 7068  df-1o 7122  df-oadd 7126  df-er 7303  df-en 7509  df-dom 7510  df-sdom 7511  df-fin 7512  df-card 8311  df-pnf 9621  df-mnf 9622  df-xr 9623  df-ltxr 9624  df-le 9625  df-sub 9798  df-neg 9799  df-nn 10528  df-n0 10787  df-z 10856  df-uz 11074  df-fz 11664  df-fzo 11784  df-hash 12363  df-word 12497  df-substr 12501
This theorem is referenced by:  clwlkf1clwwlklem  24513
  Copyright terms: Public domain W3C validator