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

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

Proof of Theorem ccatopth
StepHypRef Expression
1 oveq1 7146 . . . . 5 ((𝐴 ++ 𝐵) = (𝐶 ++ 𝐷) → ((𝐴 ++ 𝐵) prefix (♯‘𝐴)) = ((𝐶 ++ 𝐷) prefix (♯‘𝐴)))
2 pfxccat1 14059 . . . . . 6 ((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) → ((𝐴 ++ 𝐵) prefix (♯‘𝐴)) = 𝐴)
3 oveq2 7147 . . . . . . 7 ((♯‘𝐴) = (♯‘𝐶) → ((𝐶 ++ 𝐷) prefix (♯‘𝐴)) = ((𝐶 ++ 𝐷) prefix (♯‘𝐶)))
4 pfxccat1 14059 . . . . . . 7 ((𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) → ((𝐶 ++ 𝐷) prefix (♯‘𝐶)) = 𝐶)
53, 4sylan9eqr 2858 . . . . . 6 (((𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐴) = (♯‘𝐶)) → ((𝐶 ++ 𝐷) prefix (♯‘𝐴)) = 𝐶)
62, 5eqeqan12d 2818 . . . . 5 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ ((𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐴) = (♯‘𝐶))) → (((𝐴 ++ 𝐵) prefix (♯‘𝐴)) = ((𝐶 ++ 𝐷) prefix (♯‘𝐴)) ↔ 𝐴 = 𝐶))
71, 6syl5ib 247 . . . 4 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ ((𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐴) = (♯‘𝐶))) → ((𝐴 ++ 𝐵) = (𝐶 ++ 𝐷) → 𝐴 = 𝐶))
873impb 1112 . . 3 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐴) = (♯‘𝐶)) → ((𝐴 ++ 𝐵) = (𝐶 ++ 𝐷) → 𝐴 = 𝐶))
9 simpr 488 . . . . . 6 ((((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐴) = (♯‘𝐶)) ∧ (𝐴 ++ 𝐵) = (𝐶 ++ 𝐷)) → (𝐴 ++ 𝐵) = (𝐶 ++ 𝐷))
10 simpl3 1190 . . . . . . 7 ((((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐴) = (♯‘𝐶)) ∧ (𝐴 ++ 𝐵) = (𝐶 ++ 𝐷)) → (♯‘𝐴) = (♯‘𝐶))
119fveq2d 6653 . . . . . . . 8 ((((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐴) = (♯‘𝐶)) ∧ (𝐴 ++ 𝐵) = (𝐶 ++ 𝐷)) → (♯‘(𝐴 ++ 𝐵)) = (♯‘(𝐶 ++ 𝐷)))
12 simpl1 1188 . . . . . . . . 9 ((((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐴) = (♯‘𝐶)) ∧ (𝐴 ++ 𝐵) = (𝐶 ++ 𝐷)) → (𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋))
13 ccatlen 13922 . . . . . . . . 9 ((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) → (♯‘(𝐴 ++ 𝐵)) = ((♯‘𝐴) + (♯‘𝐵)))
1412, 13syl 17 . . . . . . . 8 ((((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐴) = (♯‘𝐶)) ∧ (𝐴 ++ 𝐵) = (𝐶 ++ 𝐷)) → (♯‘(𝐴 ++ 𝐵)) = ((♯‘𝐴) + (♯‘𝐵)))
15 simpl2 1189 . . . . . . . . 9 ((((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐴) = (♯‘𝐶)) ∧ (𝐴 ++ 𝐵) = (𝐶 ++ 𝐷)) → (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋))
16 ccatlen 13922 . . . . . . . . 9 ((𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) → (♯‘(𝐶 ++ 𝐷)) = ((♯‘𝐶) + (♯‘𝐷)))
1715, 16syl 17 . . . . . . . 8 ((((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐴) = (♯‘𝐶)) ∧ (𝐴 ++ 𝐵) = (𝐶 ++ 𝐷)) → (♯‘(𝐶 ++ 𝐷)) = ((♯‘𝐶) + (♯‘𝐷)))
1811, 14, 173eqtr3d 2844 . . . . . . 7 ((((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐴) = (♯‘𝐶)) ∧ (𝐴 ++ 𝐵) = (𝐶 ++ 𝐷)) → ((♯‘𝐴) + (♯‘𝐵)) = ((♯‘𝐶) + (♯‘𝐷)))
1910, 18opeq12d 4776 . . . . . 6 ((((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐴) = (♯‘𝐶)) ∧ (𝐴 ++ 𝐵) = (𝐶 ++ 𝐷)) → ⟨(♯‘𝐴), ((♯‘𝐴) + (♯‘𝐵))⟩ = ⟨(♯‘𝐶), ((♯‘𝐶) + (♯‘𝐷))⟩)
209, 19oveq12d 7157 . . . . 5 ((((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐴) = (♯‘𝐶)) ∧ (𝐴 ++ 𝐵) = (𝐶 ++ 𝐷)) → ((𝐴 ++ 𝐵) substr ⟨(♯‘𝐴), ((♯‘𝐴) + (♯‘𝐵))⟩) = ((𝐶 ++ 𝐷) substr ⟨(♯‘𝐶), ((♯‘𝐶) + (♯‘𝐷))⟩))
21 swrdccat2 14026 . . . . . 6 ((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) → ((𝐴 ++ 𝐵) substr ⟨(♯‘𝐴), ((♯‘𝐴) + (♯‘𝐵))⟩) = 𝐵)
2212, 21syl 17 . . . . 5 ((((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐴) = (♯‘𝐶)) ∧ (𝐴 ++ 𝐵) = (𝐶 ++ 𝐷)) → ((𝐴 ++ 𝐵) substr ⟨(♯‘𝐴), ((♯‘𝐴) + (♯‘𝐵))⟩) = 𝐵)
23 swrdccat2 14026 . . . . . 6 ((𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) → ((𝐶 ++ 𝐷) substr ⟨(♯‘𝐶), ((♯‘𝐶) + (♯‘𝐷))⟩) = 𝐷)
2415, 23syl 17 . . . . 5 ((((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐴) = (♯‘𝐶)) ∧ (𝐴 ++ 𝐵) = (𝐶 ++ 𝐷)) → ((𝐶 ++ 𝐷) substr ⟨(♯‘𝐶), ((♯‘𝐶) + (♯‘𝐷))⟩) = 𝐷)
2520, 22, 243eqtr3d 2844 . . . 4 ((((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐴) = (♯‘𝐶)) ∧ (𝐴 ++ 𝐵) = (𝐶 ++ 𝐷)) → 𝐵 = 𝐷)
2625ex 416 . . 3 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐴) = (♯‘𝐶)) → ((𝐴 ++ 𝐵) = (𝐶 ++ 𝐷) → 𝐵 = 𝐷))
278, 26jcad 516 . 2 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐴) = (♯‘𝐶)) → ((𝐴 ++ 𝐵) = (𝐶 ++ 𝐷) → (𝐴 = 𝐶𝐵 = 𝐷)))
28 oveq12 7148 . 2 ((𝐴 = 𝐶𝐵 = 𝐷) → (𝐴 ++ 𝐵) = (𝐶 ++ 𝐷))
2927, 28impbid1 228 1 (((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋𝐷 ∈ Word 𝑋) ∧ (♯‘𝐴) = (♯‘𝐶)) → ((𝐴 ++ 𝐵) = (𝐶 ++ 𝐷) ↔ (𝐴 = 𝐶𝐵 = 𝐷)))
 Colors of variables: wff setvar class Syntax hints:   → wi 4   ↔ wb 209   ∧ wa 399   ∧ w3a 1084   = wceq 1538   ∈ wcel 2112  ⟨cop 4534  ‘cfv 6328  (class class class)co 7139   + caddc 10533  ♯chash 13690  Word cword 13861   ++ cconcat 13917   substr csubstr 13997   prefix cpfx 14027 This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1797  ax-4 1811  ax-5 1911  ax-6 1970  ax-7 2015  ax-8 2114  ax-9 2122  ax-10 2143  ax-11 2159  ax-12 2176  ax-ext 2773  ax-rep 5157  ax-sep 5170  ax-nul 5177  ax-pow 5234  ax-pr 5298  ax-un 7445  ax-cnex 10586  ax-resscn 10587  ax-1cn 10588  ax-icn 10589  ax-addcl 10590  ax-addrcl 10591  ax-mulcl 10592  ax-mulrcl 10593  ax-mulcom 10594  ax-addass 10595  ax-mulass 10596  ax-distr 10597  ax-i2m1 10598  ax-1ne0 10599  ax-1rid 10600  ax-rnegex 10601  ax-rrecex 10602  ax-cnre 10603  ax-pre-lttri 10604  ax-pre-lttrn 10605  ax-pre-ltadd 10606  ax-pre-mulgt0 10607 This theorem depends on definitions:  df-bi 210  df-an 400  df-or 845  df-3or 1085  df-3an 1086  df-tru 1541  df-ex 1782  df-nf 1786  df-sb 2070  df-mo 2601  df-eu 2632  df-clab 2780  df-cleq 2794  df-clel 2873  df-nfc 2941  df-ne 2991  df-nel 3095  df-ral 3114  df-rex 3115  df-reu 3116  df-rab 3118  df-v 3446  df-sbc 3724  df-csb 3832  df-dif 3887  df-un 3889  df-in 3891  df-ss 3901  df-pss 3903  df-nul 4247  df-if 4429  df-pw 4502  df-sn 4529  df-pr 4531  df-tp 4533  df-op 4535  df-uni 4804  df-int 4842  df-iun 4886  df-br 5034  df-opab 5096  df-mpt 5114  df-tr 5140  df-id 5428  df-eprel 5433  df-po 5442  df-so 5443  df-fr 5482  df-we 5484  df-xp 5529  df-rel 5530  df-cnv 5531  df-co 5532  df-dm 5533  df-rn 5534  df-res 5535  df-ima 5536  df-pred 6120  df-ord 6166  df-on 6167  df-lim 6168  df-suc 6169  df-iota 6287  df-fun 6330  df-fn 6331  df-f 6332  df-f1 6333  df-fo 6334  df-f1o 6335  df-fv 6336  df-riota 7097  df-ov 7142  df-oprab 7143  df-mpo 7144  df-om 7565  df-1st 7675  df-2nd 7676  df-wrecs 7934  df-recs 7995  df-rdg 8033  df-1o 8089  df-oadd 8093  df-er 8276  df-en 8497  df-dom 8498  df-sdom 8499  df-fin 8500  df-card 9356  df-pnf 10670  df-mnf 10671  df-xr 10672  df-ltxr 10673  df-le 10674  df-sub 10865  df-neg 10866  df-nn 11630  df-n0 11890  df-z 11974  df-uz 12236  df-fz 12890  df-fzo 13033  df-hash 13691  df-word 13862  df-concat 13918  df-substr 13998  df-pfx 14028 This theorem is referenced by:  ccatopth2  14074  ccatlcan  14075  splval2  14114  s2eq2s1eq  14293  s3eqs2s1eq  14295  efgredleme  18865  efgredlemc  18867
 Copyright terms: Public domain W3C validator