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

Theorem cats1un 14078
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 13965 . . . . 5 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ++ ⟨“𝐵”⟩) ∈ Word 𝑋)
2 wrdf 13861 . . . . 5 ((𝐴 ++ ⟨“𝐵”⟩) ∈ Word 𝑋 → (𝐴 ++ ⟨“𝐵”⟩):(0..^(♯‘(𝐴 ++ ⟨“𝐵”⟩)))⟶𝑋)
31, 2syl 17 . . . 4 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ++ ⟨“𝐵”⟩):(0..^(♯‘(𝐴 ++ ⟨“𝐵”⟩)))⟶𝑋)
4 ccatws1len 13969 . . . . . . . 8 (𝐴 ∈ Word 𝑋 → (♯‘(𝐴 ++ ⟨“𝐵”⟩)) = ((♯‘𝐴) + 1))
54oveq2d 7166 . . . . . . 7 (𝐴 ∈ Word 𝑋 → (0..^(♯‘(𝐴 ++ ⟨“𝐵”⟩))) = (0..^((♯‘𝐴) + 1)))
6 lencl 13878 . . . . . . . . 9 (𝐴 ∈ Word 𝑋 → (♯‘𝐴) ∈ ℕ0)
7 nn0uz 12274 . . . . . . . . 9 0 = (ℤ‘0)
86, 7syl6eleq 2928 . . . . . . . 8 (𝐴 ∈ Word 𝑋 → (♯‘𝐴) ∈ (ℤ‘0))
9 fzosplitsn 13140 . . . . . . . 8 ((♯‘𝐴) ∈ (ℤ‘0) → (0..^((♯‘𝐴) + 1)) = ((0..^(♯‘𝐴)) ∪ {(♯‘𝐴)}))
108, 9syl 17 . . . . . . 7 (𝐴 ∈ Word 𝑋 → (0..^((♯‘𝐴) + 1)) = ((0..^(♯‘𝐴)) ∪ {(♯‘𝐴)}))
115, 10eqtrd 2861 . . . . . 6 (𝐴 ∈ Word 𝑋 → (0..^(♯‘(𝐴 ++ ⟨“𝐵”⟩))) = ((0..^(♯‘𝐴)) ∪ {(♯‘𝐴)}))
1211adantr 481 . . . . 5 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (0..^(♯‘(𝐴 ++ ⟨“𝐵”⟩))) = ((0..^(♯‘𝐴)) ∪ {(♯‘𝐴)}))
1312feq2d 6499 . . . 4 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((𝐴 ++ ⟨“𝐵”⟩):(0..^(♯‘(𝐴 ++ ⟨“𝐵”⟩)))⟶𝑋 ↔ (𝐴 ++ ⟨“𝐵”⟩):((0..^(♯‘𝐴)) ∪ {(♯‘𝐴)})⟶𝑋))
143, 13mpbid 233 . . 3 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ++ ⟨“𝐵”⟩):((0..^(♯‘𝐴)) ∪ {(♯‘𝐴)})⟶𝑋)
1514ffnd 6514 . 2 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ++ ⟨“𝐵”⟩) Fn ((0..^(♯‘𝐴)) ∪ {(♯‘𝐴)}))
16 wrdf 13861 . . . . 5 (𝐴 ∈ Word 𝑋𝐴:(0..^(♯‘𝐴))⟶𝑋)
1716adantr 481 . . . 4 ((𝐴 ∈ Word 𝑋𝐵𝑋) → 𝐴:(0..^(♯‘𝐴))⟶𝑋)
18 eqid 2826 . . . . . 6 {⟨(♯‘𝐴), 𝐵⟩} = {⟨(♯‘𝐴), 𝐵⟩}
19 fsng 6897 . . . . . 6 (((♯‘𝐴) ∈ ℕ0𝐵𝑋) → ({⟨(♯‘𝐴), 𝐵⟩}:{(♯‘𝐴)}⟶{𝐵} ↔ {⟨(♯‘𝐴), 𝐵⟩} = {⟨(♯‘𝐴), 𝐵⟩}))
2018, 19mpbiri 259 . . . . 5 (((♯‘𝐴) ∈ ℕ0𝐵𝑋) → {⟨(♯‘𝐴), 𝐵⟩}:{(♯‘𝐴)}⟶{𝐵})
216, 20sylan 580 . . . 4 ((𝐴 ∈ Word 𝑋𝐵𝑋) → {⟨(♯‘𝐴), 𝐵⟩}:{(♯‘𝐴)}⟶{𝐵})
22 fzodisjsn 13070 . . . . 5 ((0..^(♯‘𝐴)) ∩ {(♯‘𝐴)}) = ∅
2322a1i 11 . . . 4 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((0..^(♯‘𝐴)) ∩ {(♯‘𝐴)}) = ∅)
24 fun 6539 . . . 4 (((𝐴:(0..^(♯‘𝐴))⟶𝑋 ∧ {⟨(♯‘𝐴), 𝐵⟩}:{(♯‘𝐴)}⟶{𝐵}) ∧ ((0..^(♯‘𝐴)) ∩ {(♯‘𝐴)}) = ∅) → (𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩}):((0..^(♯‘𝐴)) ∪ {(♯‘𝐴)})⟶(𝑋 ∪ {𝐵}))
2517, 21, 23, 24syl21anc 835 . . 3 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩}):((0..^(♯‘𝐴)) ∪ {(♯‘𝐴)})⟶(𝑋 ∪ {𝐵}))
2625ffnd 6514 . 2 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩}) Fn ((0..^(♯‘𝐴)) ∪ {(♯‘𝐴)}))
27 elun 4129 . . 3 (𝑥 ∈ ((0..^(♯‘𝐴)) ∪ {(♯‘𝐴)}) ↔ (𝑥 ∈ (0..^(♯‘𝐴)) ∨ 𝑥 ∈ {(♯‘𝐴)}))
28 ccats1val1 13976 . . . . . 6 ((𝐴 ∈ Word 𝑋𝑥 ∈ (0..^(♯‘𝐴))) → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = (𝐴𝑥))
2928adantlr 711 . . . . 5 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ (0..^(♯‘𝐴))) → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = (𝐴𝑥))
30 simpr 485 . . . . . . . 8 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ (0..^(♯‘𝐴))) → 𝑥 ∈ (0..^(♯‘𝐴)))
31 fzonel 13046 . . . . . . . 8 ¬ (♯‘𝐴) ∈ (0..^(♯‘𝐴))
32 nelne2 3120 . . . . . . . 8 ((𝑥 ∈ (0..^(♯‘𝐴)) ∧ ¬ (♯‘𝐴) ∈ (0..^(♯‘𝐴))) → 𝑥 ≠ (♯‘𝐴))
3330, 31, 32sylancl 586 . . . . . . 7 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ (0..^(♯‘𝐴))) → 𝑥 ≠ (♯‘𝐴))
3433necomd 3076 . . . . . 6 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ (0..^(♯‘𝐴))) → (♯‘𝐴) ≠ 𝑥)
35 fvunsn 6939 . . . . . 6 ((♯‘𝐴) ≠ 𝑥 → ((𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩})‘𝑥) = (𝐴𝑥))
3634, 35syl 17 . . . . 5 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ (0..^(♯‘𝐴))) → ((𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩})‘𝑥) = (𝐴𝑥))
3729, 36eqtr4d 2864 . . . 4 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ (0..^(♯‘𝐴))) → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = ((𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩})‘𝑥))
38 fvexd 6684 . . . . . . . 8 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (♯‘𝐴) ∈ V)
39 simpr 485 . . . . . . . 8 ((𝐴 ∈ Word 𝑋𝐵𝑋) → 𝐵𝑋)
4017fdmd 6522 . . . . . . . . . 10 ((𝐴 ∈ Word 𝑋𝐵𝑋) → dom 𝐴 = (0..^(♯‘𝐴)))
4140eleq2d 2903 . . . . . . . . 9 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((♯‘𝐴) ∈ dom 𝐴 ↔ (♯‘𝐴) ∈ (0..^(♯‘𝐴))))
4231, 41mtbiri 328 . . . . . . . 8 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ¬ (♯‘𝐴) ∈ dom 𝐴)
43 fsnunfv 6947 . . . . . . . 8 (((♯‘𝐴) ∈ V ∧ 𝐵𝑋 ∧ ¬ (♯‘𝐴) ∈ dom 𝐴) → ((𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩})‘(♯‘𝐴)) = 𝐵)
4438, 39, 42, 43syl3anc 1365 . . . . . . 7 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩})‘(♯‘𝐴)) = 𝐵)
45 simpl 483 . . . . . . . . 9 ((𝐴 ∈ Word 𝑋𝐵𝑋) → 𝐴 ∈ Word 𝑋)
46 s1cl 13951 . . . . . . . . . 10 (𝐵𝑋 → ⟨“𝐵”⟩ ∈ Word 𝑋)
4746adantl 482 . . . . . . . . 9 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ⟨“𝐵”⟩ ∈ Word 𝑋)
48 s1len 13955 . . . . . . . . . . . 12 (♯‘⟨“𝐵”⟩) = 1
49 1nn 11643 . . . . . . . . . . . 12 1 ∈ ℕ
5048, 49eqeltri 2914 . . . . . . . . . . 11 (♯‘⟨“𝐵”⟩) ∈ ℕ
51 lbfzo0 13072 . . . . . . . . . . 11 (0 ∈ (0..^(♯‘⟨“𝐵”⟩)) ↔ (♯‘⟨“𝐵”⟩) ∈ ℕ)
5250, 51mpbir 232 . . . . . . . . . 10 0 ∈ (0..^(♯‘⟨“𝐵”⟩))
5352a1i 11 . . . . . . . . 9 ((𝐴 ∈ Word 𝑋𝐵𝑋) → 0 ∈ (0..^(♯‘⟨“𝐵”⟩)))
54 ccatval3 13928 . . . . . . . . 9 ((𝐴 ∈ Word 𝑋 ∧ ⟨“𝐵”⟩ ∈ Word 𝑋 ∧ 0 ∈ (0..^(♯‘⟨“𝐵”⟩))) → ((𝐴 ++ ⟨“𝐵”⟩)‘(0 + (♯‘𝐴))) = (⟨“𝐵”⟩‘0))
5545, 47, 53, 54syl3anc 1365 . . . . . . . 8 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((𝐴 ++ ⟨“𝐵”⟩)‘(0 + (♯‘𝐴))) = (⟨“𝐵”⟩‘0))
56 s1fv 13959 . . . . . . . . 9 (𝐵𝑋 → (⟨“𝐵”⟩‘0) = 𝐵)
5756adantl 482 . . . . . . . 8 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (⟨“𝐵”⟩‘0) = 𝐵)
5855, 57eqtrd 2861 . . . . . . 7 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((𝐴 ++ ⟨“𝐵”⟩)‘(0 + (♯‘𝐴))) = 𝐵)
596adantr 481 . . . . . . . . . 10 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (♯‘𝐴) ∈ ℕ0)
6059nn0cnd 11951 . . . . . . . . 9 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (♯‘𝐴) ∈ ℂ)
6160addid2d 10835 . . . . . . . 8 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (0 + (♯‘𝐴)) = (♯‘𝐴))
6261fveq2d 6673 . . . . . . 7 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((𝐴 ++ ⟨“𝐵”⟩)‘(0 + (♯‘𝐴))) = ((𝐴 ++ ⟨“𝐵”⟩)‘(♯‘𝐴)))
6344, 58, 623eqtr2rd 2868 . . . . . 6 ((𝐴 ∈ Word 𝑋𝐵𝑋) → ((𝐴 ++ ⟨“𝐵”⟩)‘(♯‘𝐴)) = ((𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩})‘(♯‘𝐴)))
64 elsni 4581 . . . . . . . 8 (𝑥 ∈ {(♯‘𝐴)} → 𝑥 = (♯‘𝐴))
6564fveq2d 6673 . . . . . . 7 (𝑥 ∈ {(♯‘𝐴)} → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = ((𝐴 ++ ⟨“𝐵”⟩)‘(♯‘𝐴)))
6664fveq2d 6673 . . . . . . 7 (𝑥 ∈ {(♯‘𝐴)} → ((𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩})‘𝑥) = ((𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩})‘(♯‘𝐴)))
6765, 66eqeq12d 2842 . . . . . 6 (𝑥 ∈ {(♯‘𝐴)} → (((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = ((𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩})‘𝑥) ↔ ((𝐴 ++ ⟨“𝐵”⟩)‘(♯‘𝐴)) = ((𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩})‘(♯‘𝐴))))
6863, 67syl5ibrcom 248 . . . . 5 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝑥 ∈ {(♯‘𝐴)} → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = ((𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩})‘𝑥)))
6968imp 407 . . . 4 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ {(♯‘𝐴)}) → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = ((𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩})‘𝑥))
7037, 69jaodan 953 . . 3 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ (𝑥 ∈ (0..^(♯‘𝐴)) ∨ 𝑥 ∈ {(♯‘𝐴)})) → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = ((𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩})‘𝑥))
7127, 70sylan2b 593 . 2 (((𝐴 ∈ Word 𝑋𝐵𝑋) ∧ 𝑥 ∈ ((0..^(♯‘𝐴)) ∪ {(♯‘𝐴)})) → ((𝐴 ++ ⟨“𝐵”⟩)‘𝑥) = ((𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩})‘𝑥))
7215, 26, 71eqfnfvd 6803 1 ((𝐴 ∈ Word 𝑋𝐵𝑋) → (𝐴 ++ ⟨“𝐵”⟩) = (𝐴 ∪ {⟨(♯‘𝐴), 𝐵⟩}))
Colors of variables: wff setvar class
Syntax hints:  ¬ wn 3  wi 4  wa 396  wo 843   = wceq 1530  wcel 2107  wne 3021  Vcvv 3500  cun 3938  cin 3939  c0 4295  {csn 4564  cop 4570  dom cdm 5554  wf 6350  cfv 6354  (class class class)co 7150  0cc0 10531  1c1 10532   + caddc 10534  cn 11632  0cn0 11891  cuz 12237  ..^cfzo 13028  chash 13685  Word cword 13856   ++ cconcat 13917  ⟨“cs1 13944
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1789  ax-4 1803  ax-5 1904  ax-6 1963  ax-7 2008  ax-8 2109  ax-9 2117  ax-10 2138  ax-11 2153  ax-12 2169  ax-ext 2798  ax-rep 5187  ax-sep 5200  ax-nul 5207  ax-pow 5263  ax-pr 5326  ax-un 7455  ax-cnex 10587  ax-resscn 10588  ax-1cn 10589  ax-icn 10590  ax-addcl 10591  ax-addrcl 10592  ax-mulcl 10593  ax-mulrcl 10594  ax-mulcom 10595  ax-addass 10596  ax-mulass 10597  ax-distr 10598  ax-i2m1 10599  ax-1ne0 10600  ax-1rid 10601  ax-rnegex 10602  ax-rrecex 10603  ax-cnre 10604  ax-pre-lttri 10605  ax-pre-lttrn 10606  ax-pre-ltadd 10607  ax-pre-mulgt0 10608
This theorem depends on definitions:  df-bi 208  df-an 397  df-or 844  df-3or 1082  df-3an 1083  df-tru 1533  df-ex 1774  df-nf 1778  df-sb 2063  df-mo 2620  df-eu 2652  df-clab 2805  df-cleq 2819  df-clel 2898  df-nfc 2968  df-ne 3022  df-nel 3129  df-ral 3148  df-rex 3149  df-reu 3150  df-rab 3152  df-v 3502  df-sbc 3777  df-csb 3888  df-dif 3943  df-un 3945  df-in 3947  df-ss 3956  df-pss 3958  df-nul 4296  df-if 4471  df-pw 4544  df-sn 4565  df-pr 4567  df-tp 4569  df-op 4571  df-uni 4838  df-int 4875  df-iun 4919  df-br 5064  df-opab 5126  df-mpt 5144  df-tr 5170  df-id 5459  df-eprel 5464  df-po 5473  df-so 5474  df-fr 5513  df-we 5515  df-xp 5560  df-rel 5561  df-cnv 5562  df-co 5563  df-dm 5564  df-rn 5565  df-res 5566  df-ima 5567  df-pred 6147  df-ord 6193  df-on 6194  df-lim 6195  df-suc 6196  df-iota 6313  df-fun 6356  df-fn 6357  df-f 6358  df-f1 6359  df-fo 6360  df-f1o 6361  df-fv 6362  df-riota 7108  df-ov 7153  df-oprab 7154  df-mpo 7155  df-om 7574  df-1st 7685  df-2nd 7686  df-wrecs 7943  df-recs 8004  df-rdg 8042  df-1o 8098  df-oadd 8102  df-er 8284  df-en 8504  df-dom 8505  df-sdom 8506  df-fin 8507  df-card 9362  df-pnf 10671  df-mnf 10672  df-xr 10673  df-ltxr 10674  df-le 10675  df-sub 10866  df-neg 10867  df-nn 11633  df-n0 11892  df-z 11976  df-uz 12238  df-fz 12888  df-fzo 13029  df-hash 13686  df-word 13857  df-concat 13918  df-s1 13945
This theorem is referenced by:  s2prop  14264  s3tpop  14266  s4prop  14267  pgpfaclem1  19139  vdegp1ai  27251  vdegp1bi  27252  wwlksnext  27604
  Copyright terms: Public domain W3C validator