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

Theorem cats1un 13429
 Description: Express a word with an extra symbol as the union of the word and the new value. (Contributed by Mario Carneiro, 28-Feb-2016.)
Assertion
Ref Expression
cats1un ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ++ ⟨“𝐵”⟩) = (𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩}))

Proof of Theorem cats1un
Dummy variable 𝑥 is distinct from all other variables.
StepHypRef Expression
1 ccatws1cl 13351 . . . . 5 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ++ ⟨“𝐵”⟩) ∈ Word 𝑋)
2 wrdf 13265 . . . . 5 ((𝐴 ++ ⟨“𝐵”⟩) ∈ Word 𝑋 → (𝐴 ++ ⟨“𝐵”⟩):(0..^(#‘(𝐴 ++ ⟨“𝐵”⟩)))⟶𝑋)
31, 2syl 17 . . . 4 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ++ ⟨“𝐵”⟩):(0..^(#‘(𝐴 ++ ⟨“𝐵”⟩)))⟶𝑋)
4 ccatws1len 13353 . . . . . . 7 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (#‘(𝐴 ++ ⟨“𝐵”⟩)) = ((#‘𝐴) + 1))
54oveq2d 6631 . . . . . 6 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (0..^(#‘(𝐴 ++ ⟨“𝐵”⟩))) = (0..^((#‘𝐴) + 1)))
6 lencl 13279 . . . . . . . . 9 (𝐴 ∈ Word 𝑋 → (#‘𝐴) ∈ ℕ0)
76adantr 481 . . . . . . . 8 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (#‘𝐴) ∈ ℕ0)
8 nn0uz 11682 . . . . . . . 8 0 = (ℤ‘0)
97, 8syl6eleq 2708 . . . . . . 7 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (#‘𝐴) ∈ (ℤ‘0))
10 fzosplitsn 12533 . . . . . . 7 ((#‘𝐴) ∈ (ℤ‘0) → (0..^((#‘𝐴) + 1)) = ((0..^(#‘𝐴)) ∪ {(#‘𝐴)}))
119, 10syl 17 . . . . . 6 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (0..^((#‘𝐴) + 1)) = ((0..^(#‘𝐴)) ∪ {(#‘𝐴)}))
125, 11eqtrd 2655 . . . . 5 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (0..^(#‘(𝐴 ++ ⟨“𝐵”⟩))) = ((0..^(#‘𝐴)) ∪ {(#‘𝐴)}))
1312feq2d 5998 . . . 4 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((𝐴 ++ ⟨“𝐵”⟩):(0..^(#‘(𝐴 ++ ⟨“𝐵”⟩)))⟶𝑋 ↔ (𝐴 ++ ⟨“𝐵”⟩):((0..^(#‘𝐴)) ∪ {(#‘𝐴)})⟶𝑋))
143, 13mpbid 222 . . 3 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ++ ⟨“𝐵”⟩):((0..^(#‘𝐴)) ∪ {(#‘𝐴)})⟶𝑋)
15 ffn 6012 . . 3 ((𝐴 ++ ⟨“𝐵”⟩):((0..^(#‘𝐴)) ∪ {(#‘𝐴)})⟶𝑋 → (𝐴 ++ ⟨“𝐵”⟩) Fn ((0..^(#‘𝐴)) ∪ {(#‘𝐴)}))
1614, 15syl 17 . 2 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ++ ⟨“𝐵”⟩) Fn ((0..^(#‘𝐴)) ∪ {(#‘𝐴)}))
17 wrdf 13265 . . . . 5 (𝐴 ∈ Word 𝑋𝐴:(0..^(#‘𝐴))⟶𝑋)
1817adantr 481 . . . 4 ((𝐴 ∈ Word 𝑋𝐵𝑋) → 𝐴:(0..^(#‘𝐴))⟶𝑋)
19 eqid 2621 . . . . . 6 {⟨(#‘𝐴), 𝐵⟩} = {⟨(#‘𝐴), 𝐵⟩}
20 fsng 6369 . . . . . 6 (((#‘𝐴) ∈ ℕ0𝐵𝑋) → ({⟨(#‘𝐴), 𝐵⟩}:{(#‘𝐴)}⟶{𝐵} ↔ {⟨(#‘𝐴), 𝐵⟩} = {⟨(#‘𝐴), 𝐵⟩}))
2119, 20mpbiri 248 . . . . 5 (((#‘𝐴) ∈ ℕ0𝐵𝑋) → {⟨(#‘𝐴), 𝐵⟩}:{(#‘𝐴)}⟶{𝐵})
226, 21sylan 488 . . . 4 ((𝐴 ∈ Word 𝑋𝐵𝑋) → {⟨(#‘𝐴), 𝐵⟩}:{(#‘𝐴)}⟶{𝐵})
23 fzonel 12440 . . . . . 6 ¬ (#‘𝐴) ∈ (0..^(#‘𝐴))
2423a1i 11 . . . . 5 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ¬ (#‘𝐴) ∈ (0..^(#‘𝐴)))
25 disjsn 4223 . . . . 5 (((0..^(#‘𝐴)) ∩ {(#‘𝐴)}) = ∅ ↔ ¬ (#‘𝐴) ∈ (0..^(#‘𝐴)))
2624, 25sylibr 224 . . . 4 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((0..^(#‘𝐴)) ∩ {(#‘𝐴)}) = ∅)
27 fun 6033 . . . 4 (((𝐴:(0..^(#‘𝐴))⟶𝑋 ∧ {⟨(#‘𝐴), 𝐵⟩}:{(#‘𝐴)}⟶{𝐵}) ∧ ((0..^(#‘𝐴)) ∩ {(#‘𝐴)}) = ∅) → (𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩}):((0..^(#‘𝐴)) ∪ {(#‘𝐴)})⟶(𝑋 ∪ {𝐵}))
2818, 22, 26, 27syl21anc 1322 . . 3 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩}):((0..^(#‘𝐴)) ∪ {(#‘𝐴)})⟶(𝑋 ∪ {𝐵}))
29 ffn 6012 . . 3 ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩}):((0..^(#‘𝐴)) ∪ {(#‘𝐴)})⟶(𝑋 ∪ {𝐵}) → (𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩}) Fn ((0..^(#‘𝐴)) ∪ {(#‘𝐴)}))
3028, 29syl 17 . 2 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩}) Fn ((0..^(#‘𝐴)) ∪ {(#‘𝐴)}))
31 elun 3737 . . 3 (𝑥 ∈ ((0..^(#‘𝐴)) ∪ {(#‘𝐴)}) ↔ (𝑥 ∈ (0..^(#‘𝐴)) ∨ 𝑥 ∈ {(#‘𝐴)}))
32 ccats1val1 13357 . . . . . 6 ((𝐴 ∈ Word 𝑋𝐵𝑋𝑥 ∈ (0..^(#‘𝐴))) → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = (𝐴𝑥))
33323expa 1262 . . . . 5 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ (0..^(#‘𝐴))) → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = (𝐴𝑥))
34 simpr 477 . . . . . . . 8 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ (0..^(#‘𝐴))) → 𝑥 ∈ (0..^(#‘𝐴)))
35 nelne2 2887 . . . . . . . 8 ((𝑥 ∈ (0..^(#‘𝐴)) ∧ ¬ (#‘𝐴) ∈ (0..^(#‘𝐴))) → 𝑥 ≠ (#‘𝐴))
3634, 23, 35sylancl 693 . . . . . . 7 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ (0..^(#‘𝐴))) → 𝑥 ≠ (#‘𝐴))
3736necomd 2845 . . . . . 6 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ (0..^(#‘𝐴))) → (#‘𝐴) ≠ 𝑥)
38 fvunsn 6410 . . . . . 6 ((#‘𝐴) ≠ 𝑥 → ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩})‘𝑥) = (𝐴𝑥))
3937, 38syl 17 . . . . 5 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ (0..^(#‘𝐴))) → ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩})‘𝑥) = (𝐴𝑥))
4033, 39eqtr4d 2658 . . . 4 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ (0..^(#‘𝐴))) → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩})‘𝑥))
41 fvexd 6170 . . . . . . . 8 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (#‘𝐴) ∈ V)
42 elex 3202 . . . . . . . . 9 (𝐵𝑋𝐵 ∈ V)
4342adantl 482 . . . . . . . 8 ((𝐴 ∈ Word 𝑋𝐵𝑋) → 𝐵 ∈ V)
44 fdm 6018 . . . . . . . . . . 11 (𝐴:(0..^(#‘𝐴))⟶𝑋 → dom 𝐴 = (0..^(#‘𝐴)))
4518, 44syl 17 . . . . . . . . . 10 ((𝐴 ∈ Word 𝑋𝐵𝑋) → dom 𝐴 = (0..^(#‘𝐴)))
4645eleq2d 2684 . . . . . . . . 9 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((#‘𝐴) ∈ dom 𝐴 ↔ (#‘𝐴) ∈ (0..^(#‘𝐴))))
4723, 46mtbiri 317 . . . . . . . 8 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ¬ (#‘𝐴) ∈ dom 𝐴)
48 fsnunfv 6418 . . . . . . . 8 (((#‘𝐴) ∈ V ∧ 𝐵 ∈ V ∧ ¬ (#‘𝐴) ∈ dom 𝐴) → ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩})‘(#‘𝐴)) = 𝐵)
4941, 43, 47, 48syl3anc 1323 . . . . . . 7 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩})‘(#‘𝐴)) = 𝐵)
50 simpl 473 . . . . . . . . 9 ((𝐴 ∈ Word 𝑋𝐵𝑋) → 𝐴 ∈ Word 𝑋)
51 s1cl 13337 . . . . . . . . . 10 (𝐵𝑋 → ⟨“𝐵”⟩ ∈ Word 𝑋)
5251adantl 482 . . . . . . . . 9 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ⟨“𝐵”⟩ ∈ Word 𝑋)
53 s1len 13340 . . . . . . . . . . . 12 (#‘⟨“𝐵”⟩) = 1
54 1nn 10991 . . . . . . . . . . . 12 1 ∈ ℕ
5553, 54eqeltri 2694 . . . . . . . . . . 11 (#‘⟨“𝐵”⟩) ∈ ℕ
5655a1i 11 . . . . . . . . . 10 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (#‘⟨“𝐵”⟩) ∈ ℕ)
57 lbfzo0 12464 . . . . . . . . . 10 (0 ∈ (0..^(#‘⟨“𝐵”⟩)) ↔ (#‘⟨“𝐵”⟩) ∈ ℕ)
5856, 57sylibr 224 . . . . . . . . 9 ((𝐴 ∈ Word 𝑋𝐵𝑋) → 0 ∈ (0..^(#‘⟨“𝐵”⟩)))
59 ccatval3 13318 . . . . . . . . 9 ((𝐴 ∈ Word 𝑋 ∧ ⟨“𝐵”⟩ ∈ Word 𝑋 ∧ 0 ∈ (0..^(#‘⟨“𝐵”⟩))) → ((𝐴 ++ ⟨“𝐵”⟩)‘(0 + (#‘𝐴))) = (⟨“𝐵”⟩‘0))
6050, 52, 58, 59syl3anc 1323 . . . . . . . 8 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((𝐴 ++ ⟨“𝐵”⟩)‘(0 + (#‘𝐴))) = (⟨“𝐵”⟩‘0))
61 s1fv 13345 . . . . . . . . 9 (𝐵𝑋 → (⟨“𝐵”⟩‘0) = 𝐵)
6261adantl 482 . . . . . . . 8 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (⟨“𝐵”⟩‘0) = 𝐵)
6360, 62eqtrd 2655 . . . . . . 7 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((𝐴 ++ ⟨“𝐵”⟩)‘(0 + (#‘𝐴))) = 𝐵)
647nn0cnd 11313 . . . . . . . . 9 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (#‘𝐴) ∈ ℂ)
6564addid2d 10197 . . . . . . . 8 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (0 + (#‘𝐴)) = (#‘𝐴))
6665fveq2d 6162 . . . . . . 7 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((𝐴 ++ ⟨“𝐵”⟩)‘(0 + (#‘𝐴))) = ((𝐴 ++ ⟨“𝐵”⟩)‘(#‘𝐴)))
6749, 63, 663eqtr2rd 2662 . . . . . 6 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((𝐴 ++ ⟨“𝐵”⟩)‘(#‘𝐴)) = ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩})‘(#‘𝐴)))
68 elsni 4172 . . . . . . . 8 (𝑥 ∈ {(#‘𝐴)} → 𝑥 = (#‘𝐴))
6968fveq2d 6162 . . . . . . 7 (𝑥 ∈ {(#‘𝐴)} → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = ((𝐴 ++ ⟨“𝐵”⟩)‘(#‘𝐴)))
7068fveq2d 6162 . . . . . . 7 (𝑥 ∈ {(#‘𝐴)} → ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩})‘𝑥) = ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩})‘(#‘𝐴)))
7169, 70eqeq12d 2636 . . . . . 6 (𝑥 ∈ {(#‘𝐴)} → (((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩})‘𝑥) ↔ ((𝐴 ++ ⟨“𝐵”⟩)‘(#‘𝐴)) = ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩})‘(#‘𝐴))))
7267, 71syl5ibrcom 237 . . . . 5 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝑥 ∈ {(#‘𝐴)} → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩})‘𝑥)))
7372imp 445 . . . 4 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ {(#‘𝐴)}) → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩})‘𝑥))
7440, 73jaodan 825 . . 3 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ (𝑥 ∈ (0..^(#‘𝐴)) ∨ 𝑥 ∈ {(#‘𝐴)})) → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩})‘𝑥))
7531, 74sylan2b 492 . 2 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ ((0..^(#‘𝐴)) ∪ {(#‘𝐴)})) → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩})‘𝑥))
7616, 30, 75eqfnfvd 6280 1 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ++ ⟨“𝐵”⟩) = (𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩}))
 Colors of variables: wff setvar class Syntax hints:  ¬ wn 3   → wi 4   ∨ wo 383   ∧ wa 384   = wceq 1480   ∈ wcel 1987   ≠ wne 2790  Vcvv 3190   ∪ cun 3558   ∩ cin 3559  ∅c0 3897  {csn 4155  ⟨cop 4161  dom cdm 5084   Fn wfn 5852  ⟶wf 5853  ‘cfv 5857  (class class class)co 6615  0cc0 9896  1c1 9897   + caddc 9899  ℕcn 10980  ℕ0cn0 11252  ℤ≥cuz 11647  ..^cfzo 12422  #chash 13073  Word cword 13246   ++ cconcat 13248  ⟨“cs1 13249 This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1719  ax-4 1734  ax-5 1836  ax-6 1885  ax-7 1932  ax-8 1989  ax-9 1996  ax-10 2016  ax-11 2031  ax-12 2044  ax-13 2245  ax-ext 2601  ax-rep 4741  ax-sep 4751  ax-nul 4759  ax-pow 4813  ax-pr 4877  ax-un 6914  ax-cnex 9952  ax-resscn 9953  ax-1cn 9954  ax-icn 9955  ax-addcl 9956  ax-addrcl 9957  ax-mulcl 9958  ax-mulrcl 9959  ax-mulcom 9960  ax-addass 9961  ax-mulass 9962  ax-distr 9963  ax-i2m1 9964  ax-1ne0 9965  ax-1rid 9966  ax-rnegex 9967  ax-rrecex 9968  ax-cnre 9969  ax-pre-lttri 9970  ax-pre-lttrn 9971  ax-pre-ltadd 9972  ax-pre-mulgt0 9973 This theorem depends on definitions:  df-bi 197  df-or 385  df-an 386  df-3or 1037  df-3an 1038  df-tru 1483  df-ex 1702  df-nf 1707  df-sb 1878  df-eu 2473  df-mo 2474  df-clab 2608  df-cleq 2614  df-clel 2617  df-nfc 2750  df-ne 2791  df-nel 2894  df-ral 2913  df-rex 2914  df-reu 2915  df-rab 2917  df-v 3192  df-sbc 3423  df-csb 3520  df-dif 3563  df-un 3565  df-in 3567  df-ss 3574  df-pss 3576  df-nul 3898  df-if 4065  df-pw 4138  df-sn 4156  df-pr 4158  df-tp 4160  df-op 4162  df-uni 4410  df-int 4448  df-iun 4494  df-br 4624  df-opab 4684  df-mpt 4685  df-tr 4723  df-eprel 4995  df-id 4999  df-po 5005  df-so 5006  df-fr 5043  df-we 5045  df-xp 5090  df-rel 5091  df-cnv 5092  df-co 5093  df-dm 5094  df-rn 5095  df-res 5096  df-ima 5097  df-pred 5649  df-ord 5695  df-on 5696  df-lim 5697  df-suc 5698  df-iota 5820  df-fun 5859  df-fn 5860  df-f 5861  df-f1 5862  df-fo 5863  df-f1o 5864  df-fv 5865  df-riota 6576  df-ov 6618  df-oprab 6619  df-mpt2 6620  df-om 7028  df-1st 7128  df-2nd 7129  df-wrecs 7367  df-recs 7428  df-rdg 7466  df-1o 7520  df-oadd 7524  df-er 7702  df-en 7916  df-dom 7917  df-sdom 7918  df-fin 7919  df-card 8725  df-pnf 10036  df-mnf 10037  df-xr 10038  df-ltxr 10039  df-le 10040  df-sub 10228  df-neg 10229  df-nn 10981  df-n0 11253  df-z 11338  df-uz 11648  df-fz 12285  df-fzo 12423  df-hash 13074  df-word 13254  df-concat 13256  df-s1 13257 This theorem is referenced by:  s2prop  13604  s3tpop  13606  s4prop  13607  pgpfaclem1  18420  vdegp1ai  26352  vdegp1bi  26353  wwlksnext  26691
 Copyright terms: Public domain W3C validator