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

Theorem ccatopth2 13695
Description: An opth 5134-like theorem for recovering the two halves of a concatenated word. (Contributed by Mario Carneiro, 1-Oct-2015.)
Assertion
Ref Expression
ccatopth2 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐵) = (♯‘𝐷)) → ((𝐴 ++ 𝐵) = (𝐶 ++ 𝐷) ↔ (𝐴 = 𝐶𝐵 = 𝐷)))

Proof of Theorem ccatopth2
StepHypRef Expression
1 fveq2 6408 . . . 4 ((𝐴 ++ 𝐵) = (𝐶 ++ 𝐷) → (♯‘(𝐴 ++ 𝐵)) = (♯‘(𝐶 ++ 𝐷)))
2 ccatlen 13572 . . . . . . . 8 ((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) → (♯‘(𝐴 ++ 𝐵)) = ((♯‘𝐴) + (♯‘𝐵)))
323ad2ant1 1156 . . . . . . 7 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐵) = (♯‘𝐷)) → (♯‘(𝐴 ++ 𝐵)) = ((♯‘𝐴) + (♯‘𝐵)))
4 simp3 1161 . . . . . . . 8 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐵) = (♯‘𝐷)) → (♯‘𝐵) = (♯‘𝐷))
54oveq2d 6890 . . . . . . 7 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐵) = (♯‘𝐷)) → ((♯‘𝐴) + (♯‘𝐵)) = ((♯‘𝐴) + (♯‘𝐷)))
63, 5eqtrd 2840 . . . . . 6 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐵) = (♯‘𝐷)) → (♯‘(𝐴 ++ 𝐵)) = ((♯‘𝐴) + (♯‘𝐷)))
7 ccatlen 13572 . . . . . . 7 ((𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) → (♯‘(𝐶 ++ 𝐷)) = ((♯‘𝐶) + (♯‘𝐷)))
873ad2ant2 1157 . . . . . 6 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐵) = (♯‘𝐷)) → (♯‘(𝐶 ++ 𝐷)) = ((♯‘𝐶) + (♯‘𝐷)))
96, 8eqeq12d 2821 . . . . 5 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐵) = (♯‘𝐷)) → ((♯‘(𝐴 ++ 𝐵)) = (♯‘(𝐶 ++ 𝐷)) ↔ ((♯‘𝐴) + (♯‘𝐷)) = ((♯‘𝐶) + (♯‘𝐷))))
10 simp1l 1247 . . . . . . . 8 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐵) = (♯‘𝐷)) → 𝐴 ∈ Word 𝑋)
11 lencl 13535 . . . . . . . 8 (𝐴 ∈ Word 𝑋 → (♯‘𝐴) ∈ ℕ0)
1210, 11syl 17 . . . . . . 7 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐵) = (♯‘𝐷)) → (♯‘𝐴) ∈ ℕ0)
1312nn0cnd 11619 . . . . . 6 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐵) = (♯‘𝐷)) → (♯‘𝐴) ∈ ℂ)
14 simp2l 1249 . . . . . . . 8 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐵) = (♯‘𝐷)) → 𝐶 ∈ Word 𝑋)
15 lencl 13535 . . . . . . . 8 (𝐶 ∈ Word 𝑋 → (♯‘𝐶) ∈ ℕ0)
1614, 15syl 17 . . . . . . 7 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐵) = (♯‘𝐷)) → (♯‘𝐶) ∈ ℕ0)
1716nn0cnd 11619 . . . . . 6 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐵) = (♯‘𝐷)) → (♯‘𝐶) ∈ ℂ)
18 simp2r 1250 . . . . . . . 8 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐵) = (♯‘𝐷)) → 𝐷 ∈ Word 𝑋)
19 lencl 13535 . . . . . . . 8 (𝐷 ∈ Word 𝑋 → (♯‘𝐷) ∈ ℕ0)
2018, 19syl 17 . . . . . . 7 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐵) = (♯‘𝐷)) → (♯‘𝐷) ∈ ℕ0)
2120nn0cnd 11619 . . . . . 6 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐵) = (♯‘𝐷)) → (♯‘𝐷) ∈ ℂ)
2213, 17, 21addcan2d 10525 . . . . 5 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐵) = (♯‘𝐷)) → (((♯‘𝐴) + (♯‘𝐷)) = ((♯‘𝐶) + (♯‘𝐷)) ↔ (♯‘𝐴) = (♯‘𝐶)))
239, 22bitrd 270 . . . 4 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐵) = (♯‘𝐷)) → ((♯‘(𝐴 ++ 𝐵)) = (♯‘(𝐶 ++ 𝐷)) ↔ (♯‘𝐴) = (♯‘𝐶)))
241, 23syl5ib 235 . . 3 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐵) = (♯‘𝐷)) → ((𝐴 ++ 𝐵) = (𝐶 ++ 𝐷) → (♯‘𝐴) = (♯‘𝐶)))
25 ccatopth 13694 . . . . . . 7 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐴) = (♯‘𝐶)) → ((𝐴 ++ 𝐵) = (𝐶 ++ 𝐷) ↔ (𝐴 = 𝐶𝐵 = 𝐷)))
2625biimpd 220 . . . . . 6 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐴) = (♯‘𝐶)) → ((𝐴 ++ 𝐵) = (𝐶 ++ 𝐷) → (𝐴 = 𝐶𝐵 = 𝐷)))
27263expia 1143 . . . . 5 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋)) → ((♯‘𝐴) = (♯‘𝐶) → ((𝐴 ++ 𝐵) = (𝐶 ++ 𝐷) → (𝐴 = 𝐶𝐵 = 𝐷))))
2827com23 86 . . . 4 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋)) → ((𝐴 ++ 𝐵) = (𝐶 ++ 𝐷) → ((♯‘𝐴) = (♯‘𝐶) → (𝐴 = 𝐶𝐵 = 𝐷))))
29283adant3 1155 . . 3 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐵) = (♯‘𝐷)) → ((𝐴 ++ 𝐵) = (𝐶 ++ 𝐷) → ((♯‘𝐴) = (♯‘𝐶) → (𝐴 = 𝐶𝐵 = 𝐷))))
3024, 29mpdd 43 . 2 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐵) = (♯‘𝐷)) → ((𝐴 ++ 𝐵) = (𝐶 ++ 𝐷) → (𝐴 = 𝐶𝐵 = 𝐷)))
31 oveq12 6883 . 2 ((𝐴 = 𝐶𝐵 = 𝐷) → (𝐴 ++ 𝐵) = (𝐶 ++ 𝐷))
3230, 31impbid1 216 1 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐵) = (♯‘𝐷)) → ((𝐴 ++ 𝐵) = (𝐶 ++ 𝐷) ↔ (𝐴 = 𝐶𝐵 = 𝐷)))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wb 197  wa 384  w3a 1100   = wceq 1637  wcel 2156  cfv 6101  (class class class)co 6874   + caddc 10224  0cn0 11559  chash 13337  Word cword 13502   ++ cconcat 13504
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1877  ax-4 1894  ax-5 2001  ax-6 2068  ax-7 2104  ax-8 2158  ax-9 2165  ax-10 2185  ax-11 2201  ax-12 2214  ax-13 2420  ax-ext 2784  ax-rep 4964  ax-sep 4975  ax-nul 4983  ax-pow 5035  ax-pr 5096  ax-un 7179  ax-cnex 10277  ax-resscn 10278  ax-1cn 10279  ax-icn 10280  ax-addcl 10281  ax-addrcl 10282  ax-mulcl 10283  ax-mulrcl 10284  ax-mulcom 10285  ax-addass 10286  ax-mulass 10287  ax-distr 10288  ax-i2m1 10289  ax-1ne0 10290  ax-1rid 10291  ax-rnegex 10292  ax-rrecex 10293  ax-cnre 10294  ax-pre-lttri 10295  ax-pre-lttrn 10296  ax-pre-ltadd 10297  ax-pre-mulgt0 10298
This theorem depends on definitions:  df-bi 198  df-an 385  df-or 866  df-3or 1101  df-3an 1102  df-tru 1641  df-ex 1860  df-nf 1864  df-sb 2061  df-eu 2634  df-mo 2635  df-clab 2793  df-cleq 2799  df-clel 2802  df-nfc 2937  df-ne 2979  df-nel 3082  df-ral 3101  df-rex 3102  df-reu 3103  df-rab 3105  df-v 3393  df-sbc 3634  df-csb 3729  df-dif 3772  df-un 3774  df-in 3776  df-ss 3783  df-pss 3785  df-nul 4117  df-if 4280  df-pw 4353  df-sn 4371  df-pr 4373  df-tp 4375  df-op 4377  df-uni 4631  df-int 4670  df-iun 4714  df-br 4845  df-opab 4907  df-mpt 4924  df-tr 4947  df-id 5219  df-eprel 5224  df-po 5232  df-so 5233  df-fr 5270  df-we 5272  df-xp 5317  df-rel 5318  df-cnv 5319  df-co 5320  df-dm 5321  df-rn 5322  df-res 5323  df-ima 5324  df-pred 5893  df-ord 5939  df-on 5940  df-lim 5941  df-suc 5942  df-iota 6064  df-fun 6103  df-fn 6104  df-f 6105  df-f1 6106  df-fo 6107  df-f1o 6108  df-fv 6109  df-riota 6835  df-ov 6877  df-oprab 6878  df-mpt2 6879  df-om 7296  df-1st 7398  df-2nd 7399  df-wrecs 7642  df-recs 7704  df-rdg 7742  df-1o 7796  df-oadd 7800  df-er 7979  df-en 8193  df-dom 8194  df-sdom 8195  df-fin 8196  df-card 9048  df-pnf 10361  df-mnf 10362  df-xr 10363  df-ltxr 10364  df-le 10365  df-sub 10553  df-neg 10554  df-nn 11306  df-n0 11560  df-z 11644  df-uz 11905  df-fz 12550  df-fzo 12690  df-hash 13338  df-word 13510  df-concat 13512  df-substr 13514
This theorem is referenced by:  ccatrcan  13697
  Copyright terms: Public domain W3C validator