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

Theorem swrdccat3blem 14689
Description: Lemma for swrdccat3b 14690. (Contributed by AV, 30-May-2018.)
Hypothesis
Ref Expression
swrdccatin2.l 𝐿 = (♯‘𝐴)
Assertion
Ref Expression
swrdccat3blem ((((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ (𝐿 + (♯‘𝐵)) ≤ 𝐿) → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩))

Proof of Theorem swrdccat3blem
StepHypRef Expression
1 lencl 14483 . . . . . . . 8 (𝐵 ∈ Word 𝑉 → (♯‘𝐵) ∈ ℕ0)
2 nn0le0eq0 12500 . . . . . . . . 9 ((♯‘𝐵) ∈ ℕ0 → ((♯‘𝐵) ≤ 0 ↔ (♯‘𝐵) = 0))
32biimpd 228 . . . . . . . 8 ((♯‘𝐵) ∈ ℕ0 → ((♯‘𝐵) ≤ 0 → (♯‘𝐵) = 0))
41, 3syl 17 . . . . . . 7 (𝐵 ∈ Word 𝑉 → ((♯‘𝐵) ≤ 0 → (♯‘𝐵) = 0))
54adantl 483 . . . . . 6 ((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) → ((♯‘𝐵) ≤ 0 → (♯‘𝐵) = 0))
6 hasheq0 14323 . . . . . . . . . . 11 (𝐵 ∈ Word 𝑉 → ((♯‘𝐵) = 0 ↔ 𝐵 = ∅))
76biimpd 228 . . . . . . . . . 10 (𝐵 ∈ Word 𝑉 → ((♯‘𝐵) = 0 → 𝐵 = ∅))
87adantl 483 . . . . . . . . 9 ((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) → ((♯‘𝐵) = 0 → 𝐵 = ∅))
98imp 408 . . . . . . . 8 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (♯‘𝐵) = 0) → 𝐵 = ∅)
10 lencl 14483 . . . . . . . . . . . . . . . 16 (𝐴 ∈ Word 𝑉 → (♯‘𝐴) ∈ ℕ0)
11 swrdccatin2.l . . . . . . . . . . . . . . . . . . 19 𝐿 = (♯‘𝐴)
1211eqcomi 2742 . . . . . . . . . . . . . . . . . 18 (♯‘𝐴) = 𝐿
1312eleq1i 2825 . . . . . . . . . . . . . . . . 17 ((♯‘𝐴) ∈ ℕ0𝐿 ∈ ℕ0)
14 nn0re 12481 . . . . . . . . . . . . . . . . . 18 (𝐿 ∈ ℕ0𝐿 ∈ ℝ)
15 elfz2nn0 13592 . . . . . . . . . . . . . . . . . . 19 (𝑀 ∈ (0...(𝐿 + 0)) ↔ (𝑀 ∈ ℕ0 ∧ (𝐿 + 0) ∈ ℕ0𝑀 ≤ (𝐿 + 0)))
16 recn 11200 . . . . . . . . . . . . . . . . . . . . . . . . . 26 (𝐿 ∈ ℝ → 𝐿 ∈ ℂ)
1716addridd 11414 . . . . . . . . . . . . . . . . . . . . . . . . 25 (𝐿 ∈ ℝ → (𝐿 + 0) = 𝐿)
1817breq2d 5161 . . . . . . . . . . . . . . . . . . . . . . . 24 (𝐿 ∈ ℝ → (𝑀 ≤ (𝐿 + 0) ↔ 𝑀𝐿))
19 nn0re 12481 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 (𝑀 ∈ ℕ0𝑀 ∈ ℝ)
2019anim1i 616 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 ((𝑀 ∈ ℕ0𝐿 ∈ ℝ) → (𝑀 ∈ ℝ ∧ 𝐿 ∈ ℝ))
2120ancoms 460 . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 ((𝐿 ∈ ℝ ∧ 𝑀 ∈ ℕ0) → (𝑀 ∈ ℝ ∧ 𝐿 ∈ ℝ))
22 letri3 11299 . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 ((𝑀 ∈ ℝ ∧ 𝐿 ∈ ℝ) → (𝑀 = 𝐿 ↔ (𝑀𝐿𝐿𝑀)))
2321, 22syl 17 . . . . . . . . . . . . . . . . . . . . . . . . . . 27 ((𝐿 ∈ ℝ ∧ 𝑀 ∈ ℕ0) → (𝑀 = 𝐿 ↔ (𝑀𝐿𝐿𝑀)))
2423biimprd 247 . . . . . . . . . . . . . . . . . . . . . . . . . 26 ((𝐿 ∈ ℝ ∧ 𝑀 ∈ ℕ0) → ((𝑀𝐿𝐿𝑀) → 𝑀 = 𝐿))
2524exp4b 432 . . . . . . . . . . . . . . . . . . . . . . . . 25 (𝐿 ∈ ℝ → (𝑀 ∈ ℕ0 → (𝑀𝐿 → (𝐿𝑀𝑀 = 𝐿))))
2625com23 86 . . . . . . . . . . . . . . . . . . . . . . . 24 (𝐿 ∈ ℝ → (𝑀𝐿 → (𝑀 ∈ ℕ0 → (𝐿𝑀𝑀 = 𝐿))))
2718, 26sylbid 239 . . . . . . . . . . . . . . . . . . . . . . 23 (𝐿 ∈ ℝ → (𝑀 ≤ (𝐿 + 0) → (𝑀 ∈ ℕ0 → (𝐿𝑀𝑀 = 𝐿))))
2827com3l 89 . . . . . . . . . . . . . . . . . . . . . 22 (𝑀 ≤ (𝐿 + 0) → (𝑀 ∈ ℕ0 → (𝐿 ∈ ℝ → (𝐿𝑀𝑀 = 𝐿))))
2928impcom 409 . . . . . . . . . . . . . . . . . . . . 21 ((𝑀 ∈ ℕ0𝑀 ≤ (𝐿 + 0)) → (𝐿 ∈ ℝ → (𝐿𝑀𝑀 = 𝐿)))
30293adant2 1132 . . . . . . . . . . . . . . . . . . . 20 ((𝑀 ∈ ℕ0 ∧ (𝐿 + 0) ∈ ℕ0𝑀 ≤ (𝐿 + 0)) → (𝐿 ∈ ℝ → (𝐿𝑀𝑀 = 𝐿)))
3130com12 32 . . . . . . . . . . . . . . . . . . 19 (𝐿 ∈ ℝ → ((𝑀 ∈ ℕ0 ∧ (𝐿 + 0) ∈ ℕ0𝑀 ≤ (𝐿 + 0)) → (𝐿𝑀𝑀 = 𝐿)))
3215, 31biimtrid 241 . . . . . . . . . . . . . . . . . 18 (𝐿 ∈ ℝ → (𝑀 ∈ (0...(𝐿 + 0)) → (𝐿𝑀𝑀 = 𝐿)))
3314, 32syl 17 . . . . . . . . . . . . . . . . 17 (𝐿 ∈ ℕ0 → (𝑀 ∈ (0...(𝐿 + 0)) → (𝐿𝑀𝑀 = 𝐿)))
3413, 33sylbi 216 . . . . . . . . . . . . . . . 16 ((♯‘𝐴) ∈ ℕ0 → (𝑀 ∈ (0...(𝐿 + 0)) → (𝐿𝑀𝑀 = 𝐿)))
3510, 34syl 17 . . . . . . . . . . . . . . 15 (𝐴 ∈ Word 𝑉 → (𝑀 ∈ (0...(𝐿 + 0)) → (𝐿𝑀𝑀 = 𝐿)))
3635imp 408 . . . . . . . . . . . . . 14 ((𝐴 ∈ Word 𝑉𝑀 ∈ (0...(𝐿 + 0))) → (𝐿𝑀𝑀 = 𝐿))
37 elfznn0 13594 . . . . . . . . . . . . . . . 16 (𝑀 ∈ (0...(𝐿 + 0)) → 𝑀 ∈ ℕ0)
38 swrd00 14594 . . . . . . . . . . . . . . . . . . . . . 22 (∅ substr ⟨0, 0⟩) = ∅
39 swrd00 14594 . . . . . . . . . . . . . . . . . . . . . 22 (𝐴 substr ⟨𝐿, 𝐿⟩) = ∅
4038, 39eqtr4i 2764 . . . . . . . . . . . . . . . . . . . . 21 (∅ substr ⟨0, 0⟩) = (𝐴 substr ⟨𝐿, 𝐿⟩)
41 nn0cn 12482 . . . . . . . . . . . . . . . . . . . . . . . 24 (𝐿 ∈ ℕ0𝐿 ∈ ℂ)
4241subidd 11559 . . . . . . . . . . . . . . . . . . . . . . 23 (𝐿 ∈ ℕ0 → (𝐿𝐿) = 0)
4342opeq1d 4880 . . . . . . . . . . . . . . . . . . . . . 22 (𝐿 ∈ ℕ0 → ⟨(𝐿𝐿), 0⟩ = ⟨0, 0⟩)
4443oveq2d 7425 . . . . . . . . . . . . . . . . . . . . 21 (𝐿 ∈ ℕ0 → (∅ substr ⟨(𝐿𝐿), 0⟩) = (∅ substr ⟨0, 0⟩))
4541addridd 11414 . . . . . . . . . . . . . . . . . . . . . . 23 (𝐿 ∈ ℕ0 → (𝐿 + 0) = 𝐿)
4645opeq2d 4881 . . . . . . . . . . . . . . . . . . . . . 22 (𝐿 ∈ ℕ0 → ⟨𝐿, (𝐿 + 0)⟩ = ⟨𝐿, 𝐿⟩)
4746oveq2d 7425 . . . . . . . . . . . . . . . . . . . . 21 (𝐿 ∈ ℕ0 → (𝐴 substr ⟨𝐿, (𝐿 + 0)⟩) = (𝐴 substr ⟨𝐿, 𝐿⟩))
4840, 44, 473eqtr4a 2799 . . . . . . . . . . . . . . . . . . . 20 (𝐿 ∈ ℕ0 → (∅ substr ⟨(𝐿𝐿), 0⟩) = (𝐴 substr ⟨𝐿, (𝐿 + 0)⟩))
4948a1i 11 . . . . . . . . . . . . . . . . . . 19 (𝑀 = 𝐿 → (𝐿 ∈ ℕ0 → (∅ substr ⟨(𝐿𝐿), 0⟩) = (𝐴 substr ⟨𝐿, (𝐿 + 0)⟩)))
50 eleq1 2822 . . . . . . . . . . . . . . . . . . 19 (𝑀 = 𝐿 → (𝑀 ∈ ℕ0𝐿 ∈ ℕ0))
51 oveq1 7416 . . . . . . . . . . . . . . . . . . . . . 22 (𝑀 = 𝐿 → (𝑀𝐿) = (𝐿𝐿))
5251opeq1d 4880 . . . . . . . . . . . . . . . . . . . . 21 (𝑀 = 𝐿 → ⟨(𝑀𝐿), 0⟩ = ⟨(𝐿𝐿), 0⟩)
5352oveq2d 7425 . . . . . . . . . . . . . . . . . . . 20 (𝑀 = 𝐿 → (∅ substr ⟨(𝑀𝐿), 0⟩) = (∅ substr ⟨(𝐿𝐿), 0⟩))
54 opeq1 4874 . . . . . . . . . . . . . . . . . . . . 21 (𝑀 = 𝐿 → ⟨𝑀, (𝐿 + 0)⟩ = ⟨𝐿, (𝐿 + 0)⟩)
5554oveq2d 7425 . . . . . . . . . . . . . . . . . . . 20 (𝑀 = 𝐿 → (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩) = (𝐴 substr ⟨𝐿, (𝐿 + 0)⟩))
5653, 55eqeq12d 2749 . . . . . . . . . . . . . . . . . . 19 (𝑀 = 𝐿 → ((∅ substr ⟨(𝑀𝐿), 0⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩) ↔ (∅ substr ⟨(𝐿𝐿), 0⟩) = (𝐴 substr ⟨𝐿, (𝐿 + 0)⟩)))
5749, 50, 563imtr4d 294 . . . . . . . . . . . . . . . . . 18 (𝑀 = 𝐿 → (𝑀 ∈ ℕ0 → (∅ substr ⟨(𝑀𝐿), 0⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩)))
5857com12 32 . . . . . . . . . . . . . . . . 17 (𝑀 ∈ ℕ0 → (𝑀 = 𝐿 → (∅ substr ⟨(𝑀𝐿), 0⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩)))
5958a1d 25 . . . . . . . . . . . . . . . 16 (𝑀 ∈ ℕ0 → (𝐴 ∈ Word 𝑉 → (𝑀 = 𝐿 → (∅ substr ⟨(𝑀𝐿), 0⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))))
6037, 59syl 17 . . . . . . . . . . . . . . 15 (𝑀 ∈ (0...(𝐿 + 0)) → (𝐴 ∈ Word 𝑉 → (𝑀 = 𝐿 → (∅ substr ⟨(𝑀𝐿), 0⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))))
6160impcom 409 . . . . . . . . . . . . . 14 ((𝐴 ∈ Word 𝑉𝑀 ∈ (0...(𝐿 + 0))) → (𝑀 = 𝐿 → (∅ substr ⟨(𝑀𝐿), 0⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩)))
6236, 61syld 47 . . . . . . . . . . . . 13 ((𝐴 ∈ Word 𝑉𝑀 ∈ (0...(𝐿 + 0))) → (𝐿𝑀 → (∅ substr ⟨(𝑀𝐿), 0⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩)))
6362imp 408 . . . . . . . . . . . 12 (((𝐴 ∈ Word 𝑉𝑀 ∈ (0...(𝐿 + 0))) ∧ 𝐿𝑀) → (∅ substr ⟨(𝑀𝐿), 0⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
64 swrdcl 14595 . . . . . . . . . . . . . . . 16 (𝐴 ∈ Word 𝑉 → (𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉)
65 ccatrid 14537 . . . . . . . . . . . . . . . 16 ((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅) = (𝐴 substr ⟨𝑀, 𝐿⟩))
6664, 65syl 17 . . . . . . . . . . . . . . 15 (𝐴 ∈ Word 𝑉 → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅) = (𝐴 substr ⟨𝑀, 𝐿⟩))
6713, 41sylbi 216 . . . . . . . . . . . . . . . . . . 19 ((♯‘𝐴) ∈ ℕ0𝐿 ∈ ℂ)
6810, 67syl 17 . . . . . . . . . . . . . . . . . 18 (𝐴 ∈ Word 𝑉𝐿 ∈ ℂ)
69 addrid 11394 . . . . . . . . . . . . . . . . . . 19 (𝐿 ∈ ℂ → (𝐿 + 0) = 𝐿)
7069eqcomd 2739 . . . . . . . . . . . . . . . . . 18 (𝐿 ∈ ℂ → 𝐿 = (𝐿 + 0))
7168, 70syl 17 . . . . . . . . . . . . . . . . 17 (𝐴 ∈ Word 𝑉𝐿 = (𝐿 + 0))
7271opeq2d 4881 . . . . . . . . . . . . . . . 16 (𝐴 ∈ Word 𝑉 → ⟨𝑀, 𝐿⟩ = ⟨𝑀, (𝐿 + 0)⟩)
7372oveq2d 7425 . . . . . . . . . . . . . . 15 (𝐴 ∈ Word 𝑉 → (𝐴 substr ⟨𝑀, 𝐿⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
7466, 73eqtrd 2773 . . . . . . . . . . . . . 14 (𝐴 ∈ Word 𝑉 → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
7574adantr 482 . . . . . . . . . . . . 13 ((𝐴 ∈ Word 𝑉𝑀 ∈ (0...(𝐿 + 0))) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
7675adantr 482 . . . . . . . . . . . 12 (((𝐴 ∈ Word 𝑉𝑀 ∈ (0...(𝐿 + 0))) ∧ ¬ 𝐿𝑀) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
7763, 76ifeqda 4565 . . . . . . . . . . 11 ((𝐴 ∈ Word 𝑉𝑀 ∈ (0...(𝐿 + 0))) → if(𝐿𝑀, (∅ substr ⟨(𝑀𝐿), 0⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅)) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
7877ex 414 . . . . . . . . . 10 (𝐴 ∈ Word 𝑉 → (𝑀 ∈ (0...(𝐿 + 0)) → if(𝐿𝑀, (∅ substr ⟨(𝑀𝐿), 0⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅)) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩)))
7978ad3antrrr 729 . . . . . . . . 9 ((((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (♯‘𝐵) = 0) ∧ 𝐵 = ∅) → (𝑀 ∈ (0...(𝐿 + 0)) → if(𝐿𝑀, (∅ substr ⟨(𝑀𝐿), 0⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅)) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩)))
80 oveq2 7417 . . . . . . . . . . . . . 14 ((♯‘𝐵) = 0 → (𝐿 + (♯‘𝐵)) = (𝐿 + 0))
8180oveq2d 7425 . . . . . . . . . . . . 13 ((♯‘𝐵) = 0 → (0...(𝐿 + (♯‘𝐵))) = (0...(𝐿 + 0)))
8281eleq2d 2820 . . . . . . . . . . . 12 ((♯‘𝐵) = 0 → (𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) ↔ 𝑀 ∈ (0...(𝐿 + 0))))
8382adantr 482 . . . . . . . . . . 11 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → (𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) ↔ 𝑀 ∈ (0...(𝐿 + 0))))
84 simpr 486 . . . . . . . . . . . . . 14 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → 𝐵 = ∅)
85 opeq2 4875 . . . . . . . . . . . . . . 15 ((♯‘𝐵) = 0 → ⟨(𝑀𝐿), (♯‘𝐵)⟩ = ⟨(𝑀𝐿), 0⟩)
8685adantr 482 . . . . . . . . . . . . . 14 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → ⟨(𝑀𝐿), (♯‘𝐵)⟩ = ⟨(𝑀𝐿), 0⟩)
8784, 86oveq12d 7427 . . . . . . . . . . . . 13 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩) = (∅ substr ⟨(𝑀𝐿), 0⟩))
88 oveq2 7417 . . . . . . . . . . . . . 14 (𝐵 = ∅ → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵) = ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅))
8988adantl 483 . . . . . . . . . . . . 13 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵) = ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅))
9087, 89ifeq12d 4550 . . . . . . . . . . . 12 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = if(𝐿𝑀, (∅ substr ⟨(𝑀𝐿), 0⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅)))
9180opeq2d 4881 . . . . . . . . . . . . . 14 ((♯‘𝐵) = 0 → ⟨𝑀, (𝐿 + (♯‘𝐵))⟩ = ⟨𝑀, (𝐿 + 0)⟩)
9291oveq2d 7425 . . . . . . . . . . . . 13 ((♯‘𝐵) = 0 → (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
9392adantr 482 . . . . . . . . . . . 12 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
9490, 93eqeq12d 2749 . . . . . . . . . . 11 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → (if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩) ↔ if(𝐿𝑀, (∅ substr ⟨(𝑀𝐿), 0⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅)) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩)))
9583, 94imbi12d 345 . . . . . . . . . 10 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → ((𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩)) ↔ (𝑀 ∈ (0...(𝐿 + 0)) → if(𝐿𝑀, (∅ substr ⟨(𝑀𝐿), 0⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅)) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))))
9695adantll 713 . . . . . . . . 9 ((((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (♯‘𝐵) = 0) ∧ 𝐵 = ∅) → ((𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩)) ↔ (𝑀 ∈ (0...(𝐿 + 0)) → if(𝐿𝑀, (∅ substr ⟨(𝑀𝐿), 0⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅)) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))))
9779, 96mpbird 257 . . . . . . . 8 ((((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (♯‘𝐵) = 0) ∧ 𝐵 = ∅) → (𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩)))
989, 97mpdan 686 . . . . . . 7 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (♯‘𝐵) = 0) → (𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩)))
9998ex 414 . . . . . 6 ((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) → ((♯‘𝐵) = 0 → (𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩))))
1005, 99syld 47 . . . . 5 ((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) → ((♯‘𝐵) ≤ 0 → (𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩))))
101100com23 86 . . . 4 ((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) → (𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) → ((♯‘𝐵) ≤ 0 → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩))))
102101imp 408 . . 3 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) → ((♯‘𝐵) ≤ 0 → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩)))
103102adantr 482 . 2 ((((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ (𝐿 + (♯‘𝐵)) ≤ 𝐿) → ((♯‘𝐵) ≤ 0 → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩)))
10411eleq1i 2825 . . . . . . . 8 (𝐿 ∈ ℕ0 ↔ (♯‘𝐴) ∈ ℕ0)
105104, 14sylbir 234 . . . . . . 7 ((♯‘𝐴) ∈ ℕ0𝐿 ∈ ℝ)
10610, 105syl 17 . . . . . 6 (𝐴 ∈ Word 𝑉𝐿 ∈ ℝ)
1071nn0red 12533 . . . . . 6 (𝐵 ∈ Word 𝑉 → (♯‘𝐵) ∈ ℝ)
108 leaddle0 11729 . . . . . 6 ((𝐿 ∈ ℝ ∧ (♯‘𝐵) ∈ ℝ) → ((𝐿 + (♯‘𝐵)) ≤ 𝐿 ↔ (♯‘𝐵) ≤ 0))
109106, 107, 108syl2an 597 . . . . 5 ((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) → ((𝐿 + (♯‘𝐵)) ≤ 𝐿 ↔ (♯‘𝐵) ≤ 0))
110 pm2.24 124 . . . . 5 ((♯‘𝐵) ≤ 0 → (¬ (♯‘𝐵) ≤ 0 → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩)))
111109, 110syl6bi 253 . . . 4 ((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) → ((𝐿 + (♯‘𝐵)) ≤ 𝐿 → (¬ (♯‘𝐵) ≤ 0 → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩))))
112111adantr 482 . . 3 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) → ((𝐿 + (♯‘𝐵)) ≤ 𝐿 → (¬ (♯‘𝐵) ≤ 0 → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩))))
113112imp 408 . 2 ((((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ (𝐿 + (♯‘𝐵)) ≤ 𝐿) → (¬ (♯‘𝐵) ≤ 0 → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩)))
114103, 113pm2.61d 179 1 ((((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ (𝐿 + (♯‘𝐵)) ≤ 𝐿) → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩))
Colors of variables: wff setvar class
Syntax hints:  ¬ wn 3  wi 4  wb 205  wa 397  w3a 1088   = wceq 1542  wcel 2107  c0 4323  ifcif 4529  cop 4635   class class class wbr 5149  cfv 6544  (class class class)co 7409  cc 11108  cr 11109  0cc0 11110   + caddc 11113  cle 11249  cmin 11444  0cn0 12472  ...cfz 13484  chash 14290  Word cword 14464   ++ cconcat 14520   substr csubstr 14590
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1798  ax-4 1812  ax-5 1914  ax-6 1972  ax-7 2012  ax-8 2109  ax-9 2117  ax-10 2138  ax-11 2155  ax-12 2172  ax-ext 2704  ax-rep 5286  ax-sep 5300  ax-nul 5307  ax-pow 5364  ax-pr 5428  ax-un 7725  ax-cnex 11166  ax-resscn 11167  ax-1cn 11168  ax-icn 11169  ax-addcl 11170  ax-addrcl 11171  ax-mulcl 11172  ax-mulrcl 11173  ax-mulcom 11174  ax-addass 11175  ax-mulass 11176  ax-distr 11177  ax-i2m1 11178  ax-1ne0 11179  ax-1rid 11180  ax-rnegex 11181  ax-rrecex 11182  ax-cnre 11183  ax-pre-lttri 11184  ax-pre-lttrn 11185  ax-pre-ltadd 11186  ax-pre-mulgt0 11187
This theorem depends on definitions:  df-bi 206  df-an 398  df-or 847  df-3or 1089  df-3an 1090  df-tru 1545  df-fal 1555  df-ex 1783  df-nf 1787  df-sb 2069  df-mo 2535  df-eu 2564  df-clab 2711  df-cleq 2725  df-clel 2811  df-nfc 2886  df-ne 2942  df-nel 3048  df-ral 3063  df-rex 3072  df-reu 3378  df-rab 3434  df-v 3477  df-sbc 3779  df-csb 3895  df-dif 3952  df-un 3954  df-in 3956  df-ss 3966  df-pss 3968  df-nul 4324  df-if 4530  df-pw 4605  df-sn 4630  df-pr 4632  df-op 4636  df-uni 4910  df-int 4952  df-iun 5000  df-br 5150  df-opab 5212  df-mpt 5233  df-tr 5267  df-id 5575  df-eprel 5581  df-po 5589  df-so 5590  df-fr 5632  df-we 5634  df-xp 5683  df-rel 5684  df-cnv 5685  df-co 5686  df-dm 5687  df-rn 5688  df-res 5689  df-ima 5690  df-pred 6301  df-ord 6368  df-on 6369  df-lim 6370  df-suc 6371  df-iota 6496  df-fun 6546  df-fn 6547  df-f 6548  df-f1 6549  df-fo 6550  df-f1o 6551  df-fv 6552  df-riota 7365  df-ov 7412  df-oprab 7413  df-mpo 7414  df-om 7856  df-1st 7975  df-2nd 7976  df-frecs 8266  df-wrecs 8297  df-recs 8371  df-rdg 8410  df-1o 8466  df-er 8703  df-en 8940  df-dom 8941  df-sdom 8942  df-fin 8943  df-card 9934  df-pnf 11250  df-mnf 11251  df-xr 11252  df-ltxr 11253  df-le 11254  df-sub 11446  df-neg 11447  df-nn 12213  df-n0 12473  df-z 12559  df-uz 12823  df-fz 13485  df-fzo 13628  df-hash 14291  df-word 14465  df-concat 14521  df-substr 14591
This theorem is referenced by:  swrdccat3b  14690
  Copyright terms: Public domain W3C validator