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

Theorem cats1un 13719
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 13587 . . . . 5 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ++ ⟨“𝐵”⟩) ∈ Word 𝑋)
2 wrdf 13491 . . . . 5 ((𝐴 ++ ⟨“𝐵”⟩) ∈ Word 𝑋 → (𝐴 ++ ⟨“𝐵”⟩):(0..^(♯‘(𝐴 ++ ⟨“𝐵”⟩)))⟶𝑋)
31, 2syl 17 . . . 4 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ++ ⟨“𝐵”⟩):(0..^(♯‘(𝐴 ++ ⟨“𝐵”⟩)))⟶𝑋)
4 ccatws1len 13591 . . . . . . . 8 (𝐴 ∈ Word 𝑋 → (♯‘(𝐴 ++ ⟨“𝐵”⟩)) = ((♯‘𝐴) + 1))
54adantr 472 . . . . . . 7 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (♯‘(𝐴 ++ ⟨“𝐵”⟩)) = ((♯‘𝐴) + 1))
65oveq2d 6858 . . . . . 6 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (0..^(♯‘(𝐴 ++ ⟨“𝐵”⟩))) = (0..^((♯‘𝐴) + 1)))
7 lencl 13505 . . . . . . . . 9 (𝐴 ∈ Word 𝑋 → (♯‘𝐴) ∈ ℕ0)
87adantr 472 . . . . . . . 8 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (♯‘𝐴) ∈ ℕ0)
9 nn0uz 11922 . . . . . . . 8 0 = (ℤ‘0)
108, 9syl6eleq 2854 . . . . . . 7 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (♯‘𝐴) ∈ (ℤ‘0))
11 fzosplitsn 12784 . . . . . . 7 ((♯‘𝐴) ∈ (ℤ‘0) → (0..^((♯‘𝐴) + 1)) = ((0..^(♯‘𝐴)) ∪ {(♯‘𝐴)}))
1210, 11syl 17 . . . . . 6 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (0..^((♯‘𝐴) + 1)) = ((0..^(♯‘𝐴)) ∪ {(♯‘𝐴)}))
136, 12eqtrd 2799 . . . . 5 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (0..^(♯‘(𝐴 ++ ⟨“𝐵”⟩))) = ((0..^(♯‘𝐴)) ∪ {(♯‘𝐴)}))
1413feq2d 6209 . . . 4 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((𝐴 ++ ⟨“𝐵”⟩):(0..^(♯‘(𝐴 ++ ⟨“𝐵”⟩)))⟶𝑋 ↔ (𝐴 ++ ⟨“𝐵”⟩):((0..^(♯‘𝐴)) ∪ {(♯‘𝐴)})⟶𝑋))
153, 14mpbid 223 . . 3 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ++ ⟨“𝐵”⟩):((0..^(♯‘𝐴)) ∪ {(♯‘𝐴)})⟶𝑋)
1615ffnd 6224 . 2 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ++ ⟨“𝐵”⟩) Fn ((0..^(♯‘𝐴)) ∪ {(♯‘𝐴)}))
17 wrdf 13491 . . . . 5 (𝐴 ∈ Word 𝑋𝐴:(0..^(♯‘𝐴))⟶𝑋)
1817adantr 472 . . . 4 ((𝐴 ∈ Word 𝑋𝐵𝑋) → 𝐴:(0..^(♯‘𝐴))⟶𝑋)
19 eqid 2765 . . . . . 6 {⟨(♯‘𝐴), 𝐵⟩} = {⟨(♯‘𝐴), 𝐵⟩}
20 fsng 6595 . . . . . 6 (((♯‘𝐴) ∈ ℕ0𝐵𝑋) → ({⟨(♯‘𝐴), 𝐵⟩}:{(♯‘𝐴)}⟶{𝐵} ↔ {⟨(♯‘𝐴), 𝐵⟩} = {⟨(♯‘𝐴), 𝐵⟩}))
2119, 20mpbiri 249 . . . . 5 (((♯‘𝐴) ∈ ℕ0𝐵𝑋) → {⟨(♯‘𝐴), 𝐵⟩}:{(♯‘𝐴)}⟶{𝐵})
227, 21sylan 575 . . . 4 ((𝐴 ∈ Word 𝑋𝐵𝑋) → {⟨(♯‘𝐴), 𝐵⟩}:{(♯‘𝐴)}⟶{𝐵})
23 fzonel 12691 . . . . . 6 ¬ (♯‘𝐴) ∈ (0..^(♯‘𝐴))
2423a1i 11 . . . . 5 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ¬ (♯‘𝐴) ∈ (0..^(♯‘𝐴)))
25 disjsn 4402 . . . . 5 (((0..^(♯‘𝐴)) ∩ {(♯‘𝐴)}) = ∅ ↔ ¬ (♯‘𝐴) ∈ (0..^(♯‘𝐴)))
2624, 25sylibr 225 . . . 4 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((0..^(♯‘𝐴)) ∩ {(♯‘𝐴)}) = ∅)
27 fun 6248 . . . 4 (((𝐴:(0..^(♯‘𝐴))⟶𝑋 ∧ {⟨(♯‘𝐴), 𝐵⟩}:{(♯‘𝐴)}⟶{𝐵}) ∧ ((0..^(♯‘𝐴)) ∩ {(♯‘𝐴)}) = ∅) → (𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩}):((0..^(♯‘𝐴)) ∪ {(♯‘𝐴)})⟶(𝑋 ∪ {𝐵}))
2818, 22, 26, 27syl21anc 866 . . 3 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩}):((0..^(♯‘𝐴)) ∪ {(♯‘𝐴)})⟶(𝑋 ∪ {𝐵}))
2928ffnd 6224 . 2 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩}) Fn ((0..^(♯‘𝐴)) ∪ {(♯‘𝐴)}))
30 elun 3915 . . 3 (𝑥 ∈ ((0..^(♯‘𝐴)) ∪ {(♯‘𝐴)}) ↔ (𝑥 ∈ (0..^(♯‘𝐴)) ∨ 𝑥 ∈ {(♯‘𝐴)}))
31 ccats1val1 13600 . . . . . 6 ((𝐴 ∈ Word 𝑋𝐵𝑋𝑥 ∈ (0..^(♯‘𝐴))) → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = (𝐴𝑥))
32313expa 1147 . . . . 5 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ (0..^(♯‘𝐴))) → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = (𝐴𝑥))
33 simpr 477 . . . . . . . 8 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ (0..^(♯‘𝐴))) → 𝑥 ∈ (0..^(♯‘𝐴)))
34 nelne2 3034 . . . . . . . 8 ((𝑥 ∈ (0..^(♯‘𝐴)) ∧ ¬ (♯‘𝐴) ∈ (0..^(♯‘𝐴))) → 𝑥 ≠ (♯‘𝐴))
3533, 23, 34sylancl 580 . . . . . . 7 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ (0..^(♯‘𝐴))) → 𝑥 ≠ (♯‘𝐴))
3635necomd 2992 . . . . . 6 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ (0..^(♯‘𝐴))) → (♯‘𝐴) ≠ 𝑥)
37 fvunsn 6638 . . . . . 6 ((♯‘𝐴) ≠ 𝑥 → ((𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩})‘𝑥) = (𝐴𝑥))
3836, 37syl 17 . . . . 5 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ (0..^(♯‘𝐴))) → ((𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩})‘𝑥) = (𝐴𝑥))
3932, 38eqtr4d 2802 . . . 4 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ (0..^(♯‘𝐴))) → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = ((𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩})‘𝑥))
40 fvexd 6390 . . . . . . . 8 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (♯‘𝐴) ∈ V)
41 elex 3365 . . . . . . . . 9 (𝐵𝑋𝐵 ∈ V)
4241adantl 473 . . . . . . . 8 ((𝐴 ∈ Word 𝑋𝐵𝑋) → 𝐵 ∈ V)
4318fdmd 6232 . . . . . . . . . 10 ((𝐴 ∈ Word 𝑋𝐵𝑋) → dom 𝐴 = (0..^(♯‘𝐴)))
4443eleq2d 2830 . . . . . . . . 9 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((♯‘𝐴) ∈ dom 𝐴 ↔ (♯‘𝐴) ∈ (0..^(♯‘𝐴))))
4523, 44mtbiri 318 . . . . . . . 8 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ¬ (♯‘𝐴) ∈ dom 𝐴)
46 fsnunfv 6646 . . . . . . . 8 (((♯‘𝐴) ∈ V ∧ 𝐵 ∈ V ∧ ¬ (♯‘𝐴) ∈ dom 𝐴) → ((𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩})‘(♯‘𝐴)) = 𝐵)
4740, 42, 45, 46syl3anc 1490 . . . . . . 7 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩})‘(♯‘𝐴)) = 𝐵)
48 simpl 474 . . . . . . . . 9 ((𝐴 ∈ Word 𝑋𝐵𝑋) → 𝐴 ∈ Word 𝑋)
49 s1cl 13573 . . . . . . . . . 10 (𝐵𝑋 → ⟨“𝐵”⟩ ∈ Word 𝑋)
5049adantl 473 . . . . . . . . 9 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ⟨“𝐵”⟩ ∈ Word 𝑋)
51 s1len 13577 . . . . . . . . . . . 12 (♯‘⟨“𝐵”⟩) = 1
52 1nn 11287 . . . . . . . . . . . 12 1 ∈ ℕ
5351, 52eqeltri 2840 . . . . . . . . . . 11 (♯‘⟨“𝐵”⟩) ∈ ℕ
5453a1i 11 . . . . . . . . . 10 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (♯‘⟨“𝐵”⟩) ∈ ℕ)
55 lbfzo0 12716 . . . . . . . . . 10 (0 ∈ (0..^(♯‘⟨“𝐵”⟩)) ↔ (♯‘⟨“𝐵”⟩) ∈ ℕ)
5654, 55sylibr 225 . . . . . . . . 9 ((𝐴 ∈ Word 𝑋𝐵𝑋) → 0 ∈ (0..^(♯‘⟨“𝐵”⟩)))
57 ccatval3 13550 . . . . . . . . 9 ((𝐴 ∈ Word 𝑋 ∧ ⟨“𝐵”⟩ ∈ Word 𝑋 ∧ 0 ∈ (0..^(♯‘⟨“𝐵”⟩))) → ((𝐴 ++ ⟨“𝐵”⟩)‘(0 + (♯‘𝐴))) = (⟨“𝐵”⟩‘0))
5848, 50, 56, 57syl3anc 1490 . . . . . . . 8 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((𝐴 ++ ⟨“𝐵”⟩)‘(0 + (♯‘𝐴))) = (⟨“𝐵”⟩‘0))
59 s1fv 13581 . . . . . . . . 9 (𝐵𝑋 → (⟨“𝐵”⟩‘0) = 𝐵)
6059adantl 473 . . . . . . . 8 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (⟨“𝐵”⟩‘0) = 𝐵)
6158, 60eqtrd 2799 . . . . . . 7 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((𝐴 ++ ⟨“𝐵”⟩)‘(0 + (♯‘𝐴))) = 𝐵)
628nn0cnd 11600 . . . . . . . . 9 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (♯‘𝐴) ∈ ℂ)
6362addid2d 10491 . . . . . . . 8 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (0 + (♯‘𝐴)) = (♯‘𝐴))
6463fveq2d 6379 . . . . . . 7 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((𝐴 ++ ⟨“𝐵”⟩)‘(0 + (♯‘𝐴))) = ((𝐴 ++ ⟨“𝐵”⟩)‘(♯‘𝐴)))
6547, 61, 643eqtr2rd 2806 . . . . . 6 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((𝐴 ++ ⟨“𝐵”⟩)‘(♯‘𝐴)) = ((𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩})‘(♯‘𝐴)))
66 elsni 4351 . . . . . . . 8 (𝑥 ∈ {(♯‘𝐴)} → 𝑥 = (♯‘𝐴))
6766fveq2d 6379 . . . . . . 7 (𝑥 ∈ {(♯‘𝐴)} → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = ((𝐴 ++ ⟨“𝐵”⟩)‘(♯‘𝐴)))
6866fveq2d 6379 . . . . . . 7 (𝑥 ∈ {(♯‘𝐴)} → ((𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩})‘𝑥) = ((𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩})‘(♯‘𝐴)))
6967, 68eqeq12d 2780 . . . . . 6 (𝑥 ∈ {(♯‘𝐴)} → (((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = ((𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩})‘𝑥) ↔ ((𝐴 ++ ⟨“𝐵”⟩)‘(♯‘𝐴)) = ((𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩})‘(♯‘𝐴))))
7065, 69syl5ibrcom 238 . . . . 5 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝑥 ∈ {(♯‘𝐴)} → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = ((𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩})‘𝑥)))
7170imp 395 . . . 4 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ {(♯‘𝐴)}) → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = ((𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩})‘𝑥))
7239, 71jaodan 980 . . 3 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ (𝑥 ∈ (0..^(♯‘𝐴)) ∨ 𝑥 ∈ {(♯‘𝐴)})) → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = ((𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩})‘𝑥))
7330, 72sylan2b 587 . 2 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ ((0..^(♯‘𝐴)) ∪ {(♯‘𝐴)})) → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = ((𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩})‘𝑥))
7416, 29, 73eqfnfvd 6504 1 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ++ ⟨“𝐵”⟩) = (𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩}))
Colors of variables: wff setvar class
Syntax hints:  ¬ wn 3  wi 4  wa 384  wo 873   = wceq 1652  wcel 2155  wne 2937  Vcvv 3350  cun 3730  cin 3731  c0 4079  {csn 4334  cop 4340  dom cdm 5277  wf 6064  cfv 6068  (class class class)co 6842  0cc0 10189  1c1 10190   + caddc 10192  cn 11274  0cn0 11538  cuz 11886  ..^cfzo 12673  chash 13321  Word cword 13486   ++ cconcat 13541  ⟨“cs1 13566
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1890  ax-4 1904  ax-5 2005  ax-6 2070  ax-7 2105  ax-8 2157  ax-9 2164  ax-10 2183  ax-11 2198  ax-12 2211  ax-13 2352  ax-ext 2743  ax-rep 4930  ax-sep 4941  ax-nul 4949  ax-pow 5001  ax-pr 5062  ax-un 7147  ax-cnex 10245  ax-resscn 10246  ax-1cn 10247  ax-icn 10248  ax-addcl 10249  ax-addrcl 10250  ax-mulcl 10251  ax-mulrcl 10252  ax-mulcom 10253  ax-addass 10254  ax-mulass 10255  ax-distr 10256  ax-i2m1 10257  ax-1ne0 10258  ax-1rid 10259  ax-rnegex 10260  ax-rrecex 10261  ax-cnre 10262  ax-pre-lttri 10263  ax-pre-lttrn 10264  ax-pre-ltadd 10265  ax-pre-mulgt0 10266
This theorem depends on definitions:  df-bi 198  df-an 385  df-or 874  df-3or 1108  df-3an 1109  df-tru 1656  df-ex 1875  df-nf 1879  df-sb 2063  df-mo 2565  df-eu 2582  df-clab 2752  df-cleq 2758  df-clel 2761  df-nfc 2896  df-ne 2938  df-nel 3041  df-ral 3060  df-rex 3061  df-reu 3062  df-rab 3064  df-v 3352  df-sbc 3597  df-csb 3692  df-dif 3735  df-un 3737  df-in 3739  df-ss 3746  df-pss 3748  df-nul 4080  df-if 4244  df-pw 4317  df-sn 4335  df-pr 4337  df-tp 4339  df-op 4341  df-uni 4595  df-int 4634  df-iun 4678  df-br 4810  df-opab 4872  df-mpt 4889  df-tr 4912  df-id 5185  df-eprel 5190  df-po 5198  df-so 5199  df-fr 5236  df-we 5238  df-xp 5283  df-rel 5284  df-cnv 5285  df-co 5286  df-dm 5287  df-rn 5288  df-res 5289  df-ima 5290  df-pred 5865  df-ord 5911  df-on 5912  df-lim 5913  df-suc 5914  df-iota 6031  df-fun 6070  df-fn 6071  df-f 6072  df-f1 6073  df-fo 6074  df-f1o 6075  df-fv 6076  df-riota 6803  df-ov 6845  df-oprab 6846  df-mpt2 6847  df-om 7264  df-1st 7366  df-2nd 7367  df-wrecs 7610  df-recs 7672  df-rdg 7710  df-1o 7764  df-oadd 7768  df-er 7947  df-en 8161  df-dom 8162  df-sdom 8163  df-fin 8164  df-card 9016  df-pnf 10330  df-mnf 10331  df-xr 10332  df-ltxr 10333  df-le 10334  df-sub 10522  df-neg 10523  df-nn 11275  df-n0 11539  df-z 11625  df-uz 11887  df-fz 12534  df-fzo 12674  df-hash 13322  df-word 13487  df-concat 13542  df-s1 13567
This theorem is referenced by:  s2prop  13936  s3tpop  13938  s4prop  13939  pgpfaclem1  18747  vdegp1ai  26723  vdegp1bi  26724  wwlksnext  27096
  Copyright terms: Public domain W3C validator