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

Theorem cats1un 13270
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 13192 . . . . 5 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ++ ⟨“𝐵”⟩) ∈ Word 𝑋)
2 wrdf 13108 . . . . 5 ((𝐴 ++ ⟨“𝐵”⟩) ∈ Word 𝑋 → (𝐴 ++ ⟨“𝐵”⟩):(0..^(#‘(𝐴 ++ ⟨“𝐵”⟩)))⟶𝑋)
31, 2syl 17 . . . 4 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ++ ⟨“𝐵”⟩):(0..^(#‘(𝐴 ++ ⟨“𝐵”⟩)))⟶𝑋)
4 ccatws1len 13194 . . . . . . 7 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (#‘(𝐴 ++ ⟨“𝐵”⟩)) = ((#‘𝐴) + 1))
54oveq2d 6540 . . . . . 6 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (0..^(#‘(𝐴 ++ ⟨“𝐵”⟩))) = (0..^((#‘𝐴) + 1)))
6 lencl 13122 . . . . . . . . 9 (𝐴 ∈ Word 𝑋 → (#‘𝐴) ∈ ℕ0)
76adantr 479 . . . . . . . 8 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (#‘𝐴) ∈ ℕ0)
8 nn0uz 11551 . . . . . . . 8 0 = (ℤ‘0)
97, 8syl6eleq 2694 . . . . . . 7 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (#‘𝐴) ∈ (ℤ‘0))
10 fzosplitsn 12394 . . . . . . 7 ((#‘𝐴) ∈ (ℤ‘0) → (0..^((#‘𝐴) + 1)) = ((0..^(#‘𝐴)) ∪ {(#‘𝐴)}))
119, 10syl 17 . . . . . 6 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (0..^((#‘𝐴) + 1)) = ((0..^(#‘𝐴)) ∪ {(#‘𝐴)}))
125, 11eqtrd 2640 . . . . 5 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (0..^(#‘(𝐴 ++ ⟨“𝐵”⟩))) = ((0..^(#‘𝐴)) ∪ {(#‘𝐴)}))
1312feq2d 5927 . . . 4 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((𝐴 ++ ⟨“𝐵”⟩):(0..^(#‘(𝐴 ++ ⟨“𝐵”⟩)))⟶𝑋 ↔ (𝐴 ++ ⟨“𝐵”⟩):((0..^(#‘𝐴)) ∪ {(#‘𝐴)})⟶𝑋))
143, 13mpbid 220 . . 3 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ++ ⟨“𝐵”⟩):((0..^(#‘𝐴)) ∪ {(#‘𝐴)})⟶𝑋)
15 ffn 5941 . . 3 ((𝐴 ++ ⟨“𝐵”⟩):((0..^(#‘𝐴)) ∪ {(#‘𝐴)})⟶𝑋 → (𝐴 ++ ⟨“𝐵”⟩) Fn ((0..^(#‘𝐴)) ∪ {(#‘𝐴)}))
1614, 15syl 17 . 2 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ++ ⟨“𝐵”⟩) Fn ((0..^(#‘𝐴)) ∪ {(#‘𝐴)}))
17 wrdf 13108 . . . . 5 (𝐴 ∈ Word 𝑋𝐴:(0..^(#‘𝐴))⟶𝑋)
1817adantr 479 . . . 4 ((𝐴 ∈ Word 𝑋𝐵𝑋) → 𝐴:(0..^(#‘𝐴))⟶𝑋)
19 eqid 2606 . . . . . 6 {⟨(#‘𝐴), 𝐵⟩} = {⟨(#‘𝐴), 𝐵⟩}
20 fsng 6292 . . . . . 6 (((#‘𝐴) ∈ ℕ0𝐵𝑋) → ({⟨(#‘𝐴), 𝐵⟩}:{(#‘𝐴)}⟶{𝐵} ↔ {⟨(#‘𝐴), 𝐵⟩} = {⟨(#‘𝐴), 𝐵⟩}))
2119, 20mpbiri 246 . . . . 5 (((#‘𝐴) ∈ ℕ0𝐵𝑋) → {⟨(#‘𝐴), 𝐵⟩}:{(#‘𝐴)}⟶{𝐵})
226, 21sylan 486 . . . 4 ((𝐴 ∈ Word 𝑋𝐵𝑋) → {⟨(#‘𝐴), 𝐵⟩}:{(#‘𝐴)}⟶{𝐵})
23 fzonel 12304 . . . . . 6 ¬ (#‘𝐴) ∈ (0..^(#‘𝐴))
2423a1i 11 . . . . 5 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ¬ (#‘𝐴) ∈ (0..^(#‘𝐴)))
25 disjsn 4188 . . . . 5 (((0..^(#‘𝐴)) ∩ {(#‘𝐴)}) = ∅ ↔ ¬ (#‘𝐴) ∈ (0..^(#‘𝐴)))
2624, 25sylibr 222 . . . 4 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((0..^(#‘𝐴)) ∩ {(#‘𝐴)}) = ∅)
27 fun 5962 . . . 4 (((𝐴:(0..^(#‘𝐴))⟶𝑋 ∧ {⟨(#‘𝐴), 𝐵⟩}:{(#‘𝐴)}⟶{𝐵}) ∧ ((0..^(#‘𝐴)) ∩ {(#‘𝐴)}) = ∅) → (𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩}):((0..^(#‘𝐴)) ∪ {(#‘𝐴)})⟶(𝑋 ∪ {𝐵}))
2818, 22, 26, 27syl21anc 1316 . . 3 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩}):((0..^(#‘𝐴)) ∪ {(#‘𝐴)})⟶(𝑋 ∪ {𝐵}))
29 ffn 5941 . . 3 ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩}):((0..^(#‘𝐴)) ∪ {(#‘𝐴)})⟶(𝑋 ∪ {𝐵}) → (𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩}) Fn ((0..^(#‘𝐴)) ∪ {(#‘𝐴)}))
3028, 29syl 17 . 2 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩}) Fn ((0..^(#‘𝐴)) ∪ {(#‘𝐴)}))
31 elun 3711 . . 3 (𝑥 ∈ ((0..^(#‘𝐴)) ∪ {(#‘𝐴)}) ↔ (𝑥 ∈ (0..^(#‘𝐴)) ∨ 𝑥 ∈ {(#‘𝐴)}))
32 ccats1val1 13198 . . . . . 6 ((𝐴 ∈ Word 𝑋𝐵𝑋𝑥 ∈ (0..^(#‘𝐴))) → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = (𝐴𝑥))
33323expa 1256 . . . . 5 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ (0..^(#‘𝐴))) → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = (𝐴𝑥))
34 simpr 475 . . . . . . . 8 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ (0..^(#‘𝐴))) → 𝑥 ∈ (0..^(#‘𝐴)))
35 nelne2 2875 . . . . . . . 8 ((𝑥 ∈ (0..^(#‘𝐴)) ∧ ¬ (#‘𝐴) ∈ (0..^(#‘𝐴))) → 𝑥 ≠ (#‘𝐴))
3634, 23, 35sylancl 692 . . . . . . 7 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ (0..^(#‘𝐴))) → 𝑥 ≠ (#‘𝐴))
3736necomd 2833 . . . . . 6 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ (0..^(#‘𝐴))) → (#‘𝐴) ≠ 𝑥)
38 fvunsn 6325 . . . . . 6 ((#‘𝐴) ≠ 𝑥 → ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩})‘𝑥) = (𝐴𝑥))
3937, 38syl 17 . . . . 5 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ (0..^(#‘𝐴))) → ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩})‘𝑥) = (𝐴𝑥))
4033, 39eqtr4d 2643 . . . 4 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ (0..^(#‘𝐴))) → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩})‘𝑥))
41 fvex 6095 . . . . . . . . 9 (#‘𝐴) ∈ V
4241a1i 11 . . . . . . . 8 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (#‘𝐴) ∈ V)
43 elex 3181 . . . . . . . . 9 (𝐵𝑋𝐵 ∈ V)
4443adantl 480 . . . . . . . 8 ((𝐴 ∈ Word 𝑋𝐵𝑋) → 𝐵 ∈ V)
45 fdm 5947 . . . . . . . . . . 11 (𝐴:(0..^(#‘𝐴))⟶𝑋 → dom 𝐴 = (0..^(#‘𝐴)))
4618, 45syl 17 . . . . . . . . . 10 ((𝐴 ∈ Word 𝑋𝐵𝑋) → dom 𝐴 = (0..^(#‘𝐴)))
4746eleq2d 2669 . . . . . . . . 9 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((#‘𝐴) ∈ dom 𝐴 ↔ (#‘𝐴) ∈ (0..^(#‘𝐴))))
4823, 47mtbiri 315 . . . . . . . 8 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ¬ (#‘𝐴) ∈ dom 𝐴)
49 fsnunfv 6333 . . . . . . . 8 (((#‘𝐴) ∈ V ∧ 𝐵 ∈ V ∧ ¬ (#‘𝐴) ∈ dom 𝐴) → ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩})‘(#‘𝐴)) = 𝐵)
5042, 44, 48, 49syl3anc 1317 . . . . . . 7 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩})‘(#‘𝐴)) = 𝐵)
51 simpl 471 . . . . . . . . 9 ((𝐴 ∈ Word 𝑋𝐵𝑋) → 𝐴 ∈ Word 𝑋)
52 s1cl 13178 . . . . . . . . . 10 (𝐵𝑋 → ⟨“𝐵”⟩ ∈ Word 𝑋)
5352adantl 480 . . . . . . . . 9 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ⟨“𝐵”⟩ ∈ Word 𝑋)
54 s1len 13181 . . . . . . . . . . . 12 (#‘⟨“𝐵”⟩) = 1
55 1nn 10875 . . . . . . . . . . . 12 1 ∈ ℕ
5654, 55eqeltri 2680 . . . . . . . . . . 11 (#‘⟨“𝐵”⟩) ∈ ℕ
5756a1i 11 . . . . . . . . . 10 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (#‘⟨“𝐵”⟩) ∈ ℕ)
58 lbfzo0 12327 . . . . . . . . . 10 (0 ∈ (0..^(#‘⟨“𝐵”⟩)) ↔ (#‘⟨“𝐵”⟩) ∈ ℕ)
5957, 58sylibr 222 . . . . . . . . 9 ((𝐴 ∈ Word 𝑋𝐵𝑋) → 0 ∈ (0..^(#‘⟨“𝐵”⟩)))
60 ccatval3 13159 . . . . . . . . 9 ((𝐴 ∈ Word 𝑋 ∧ ⟨“𝐵”⟩ ∈ Word 𝑋 ∧ 0 ∈ (0..^(#‘⟨“𝐵”⟩))) → ((𝐴 ++ ⟨“𝐵”⟩)‘(0 + (#‘𝐴))) = (⟨“𝐵”⟩‘0))
6151, 53, 59, 60syl3anc 1317 . . . . . . . 8 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((𝐴 ++ ⟨“𝐵”⟩)‘(0 + (#‘𝐴))) = (⟨“𝐵”⟩‘0))
62 s1fv 13186 . . . . . . . . 9 (𝐵𝑋 → (⟨“𝐵”⟩‘0) = 𝐵)
6362adantl 480 . . . . . . . 8 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (⟨“𝐵”⟩‘0) = 𝐵)
6461, 63eqtrd 2640 . . . . . . 7 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((𝐴 ++ ⟨“𝐵”⟩)‘(0 + (#‘𝐴))) = 𝐵)
657nn0cnd 11197 . . . . . . . . 9 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (#‘𝐴) ∈ ℂ)
6665addid2d 10085 . . . . . . . 8 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (0 + (#‘𝐴)) = (#‘𝐴))
6766fveq2d 6089 . . . . . . 7 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((𝐴 ++ ⟨“𝐵”⟩)‘(0 + (#‘𝐴))) = ((𝐴 ++ ⟨“𝐵”⟩)‘(#‘𝐴)))
6850, 64, 673eqtr2rd 2647 . . . . . 6 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((𝐴 ++ ⟨“𝐵”⟩)‘(#‘𝐴)) = ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩})‘(#‘𝐴)))
69 elsni 4138 . . . . . . . 8 (𝑥 ∈ {(#‘𝐴)} → 𝑥 = (#‘𝐴))
7069fveq2d 6089 . . . . . . 7 (𝑥 ∈ {(#‘𝐴)} → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = ((𝐴 ++ ⟨“𝐵”⟩)‘(#‘𝐴)))
7169fveq2d 6089 . . . . . . 7 (𝑥 ∈ {(#‘𝐴)} → ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩})‘𝑥) = ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩})‘(#‘𝐴)))
7270, 71eqeq12d 2621 . . . . . 6 (𝑥 ∈ {(#‘𝐴)} → (((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩})‘𝑥) ↔ ((𝐴 ++ ⟨“𝐵”⟩)‘(#‘𝐴)) = ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩})‘(#‘𝐴))))
7368, 72syl5ibrcom 235 . . . . 5 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝑥 ∈ {(#‘𝐴)} → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩})‘𝑥)))
7473imp 443 . . . 4 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ {(#‘𝐴)}) → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩})‘𝑥))
7540, 74jaodan 821 . . 3 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ (𝑥 ∈ (0..^(#‘𝐴)) ∨ 𝑥 ∈ {(#‘𝐴)})) → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩})‘𝑥))
7631, 75sylan2b 490 . 2 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ ((0..^(#‘𝐴)) ∪ {(#‘𝐴)})) → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = ((𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩})‘𝑥))
7716, 30, 76eqfnfvd 6204 1 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ++ ⟨“𝐵”⟩) = (𝐴 ∪ {⟨(#‘𝐴), 𝐵⟩}))
Colors of variables: wff setvar class
Syntax hints:  ¬ wn 3  wi 4  wo 381  wa 382   = wceq 1474  wcel 1976  wne 2776  Vcvv 3169  cun 3534  cin 3535  c0 3870  {csn 4121  cop 4127  dom cdm 5025   Fn wfn 5782  wf 5783  cfv 5787  (class class class)co 6524  0cc0 9789  1c1 9790   + caddc 9792  cn 10864  0cn0 11136  cuz 11516  ..^cfzo 12286  #chash 12931  Word cword 13089   ++ cconcat 13091  ⟨“cs1 13092
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1712  ax-4 1727  ax-5 1826  ax-6 1874  ax-7 1921  ax-8 1978  ax-9 1985  ax-10 2005  ax-11 2020  ax-12 2032  ax-13 2229  ax-ext 2586  ax-rep 4690  ax-sep 4700  ax-nul 4709  ax-pow 4761  ax-pr 4825  ax-un 6821  ax-cnex 9845  ax-resscn 9846  ax-1cn 9847  ax-icn 9848  ax-addcl 9849  ax-addrcl 9850  ax-mulcl 9851  ax-mulrcl 9852  ax-mulcom 9853  ax-addass 9854  ax-mulass 9855  ax-distr 9856  ax-i2m1 9857  ax-1ne0 9858  ax-1rid 9859  ax-rnegex 9860  ax-rrecex 9861  ax-cnre 9862  ax-pre-lttri 9863  ax-pre-lttrn 9864  ax-pre-ltadd 9865  ax-pre-mulgt0 9866
This theorem depends on definitions:  df-bi 195  df-or 383  df-an 384  df-3or 1031  df-3an 1032  df-tru 1477  df-ex 1695  df-nf 1700  df-sb 1867  df-eu 2458  df-mo 2459  df-clab 2593  df-cleq 2599  df-clel 2602  df-nfc 2736  df-ne 2778  df-nel 2779  df-ral 2897  df-rex 2898  df-reu 2899  df-rab 2901  df-v 3171  df-sbc 3399  df-csb 3496  df-dif 3539  df-un 3541  df-in 3543  df-ss 3550  df-pss 3552  df-nul 3871  df-if 4033  df-pw 4106  df-sn 4122  df-pr 4124  df-tp 4126  df-op 4128  df-uni 4364  df-int 4402  df-iun 4448  df-br 4575  df-opab 4635  df-mpt 4636  df-tr 4672  df-eprel 4936  df-id 4940  df-po 4946  df-so 4947  df-fr 4984  df-we 4986  df-xp 5031  df-rel 5032  df-cnv 5033  df-co 5034  df-dm 5035  df-rn 5036  df-res 5037  df-ima 5038  df-pred 5580  df-ord 5626  df-on 5627  df-lim 5628  df-suc 5629  df-iota 5751  df-fun 5789  df-fn 5790  df-f 5791  df-f1 5792  df-fo 5793  df-f1o 5794  df-fv 5795  df-riota 6486  df-ov 6527  df-oprab 6528  df-mpt2 6529  df-om 6932  df-1st 7033  df-2nd 7034  df-wrecs 7268  df-recs 7329  df-rdg 7367  df-1o 7421  df-oadd 7425  df-er 7603  df-en 7816  df-dom 7817  df-sdom 7818  df-fin 7819  df-card 8622  df-pnf 9929  df-mnf 9930  df-xr 9931  df-ltxr 9932  df-le 9933  df-sub 10116  df-neg 10117  df-nn 10865  df-n0 11137  df-z 11208  df-uz 11517  df-fz 12150  df-fzo 12287  df-hash 12932  df-word 13097  df-concat 13099  df-s1 13100
This theorem is referenced by:  s2prop  13445  s3tpop  13447  s4prop  13448  pgpfaclem1  18246  wwlknext  26015  vdegp1ai  26274  vdegp1bi  26275  vdegp1ai-av  40751  vdegp1bi-av  40752  wwlksnext  41098
  Copyright terms: Public domain W3C validator