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

Theorem swrdccat3blem 14380
Description: Lemma for swrdccat3b 14381. (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 14164 . . . . . . . 8 (𝐵 ∈ Word 𝑉 → (♯‘𝐵) ∈ ℕ0)
2 nn0le0eq0 12191 . . . . . . . . 9 ((♯‘𝐵) ∈ ℕ0 → ((♯‘𝐵) ≤ 0 ↔ (♯‘𝐵) = 0))
32biimpd 228 . . . . . . . 8 ((♯‘𝐵) ∈ ℕ0 → ((♯‘𝐵) ≤ 0 → (♯‘𝐵) = 0))
41, 3syl 17 . . . . . . 7 (𝐵 ∈ Word 𝑉 → ((♯‘𝐵) ≤ 0 → (♯‘𝐵) = 0))
54adantl 481 . . . . . 6 ((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) → ((♯‘𝐵) ≤ 0 → (♯‘𝐵) = 0))
6 hasheq0 14006 . . . . . . . . . . 11 (𝐵 ∈ Word 𝑉 → ((♯‘𝐵) = 0 ↔ 𝐵 = ∅))
76biimpd 228 . . . . . . . . . 10 (𝐵 ∈ Word 𝑉 → ((♯‘𝐵) = 0 → 𝐵 = ∅))
87adantl 481 . . . . . . . . 9 ((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) → ((♯‘𝐵) = 0 → 𝐵 = ∅))
98imp 406 . . . . . . . 8 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (♯‘𝐵) = 0) → 𝐵 = ∅)
10 lencl 14164 . . . . . . . . . . . . . . . 16 (𝐴 ∈ Word 𝑉 → (♯‘𝐴) ∈ ℕ0)
11 swrdccatin2.l . . . . . . . . . . . . . . . . . . 19 𝐿 = (♯‘𝐴)
1211eqcomi 2747 . . . . . . . . . . . . . . . . . 18 (♯‘𝐴) = 𝐿
1312eleq1i 2829 . . . . . . . . . . . . . . . . 17 ((♯‘𝐴) ∈ ℕ0𝐿 ∈ ℕ0)
14 nn0re 12172 . . . . . . . . . . . . . . . . . 18 (𝐿 ∈ ℕ0𝐿 ∈ ℝ)
15 elfz2nn0 13276 . . . . . . . . . . . . . . . . . . 19 (𝑀 ∈ (0...(𝐿 + 0)) ↔ (𝑀 ∈ ℕ0 ∧ (𝐿 + 0) ∈ ℕ0𝑀 ≤ (𝐿 + 0)))
16 recn 10892 . . . . . . . . . . . . . . . . . . . . . . . . . 26 (𝐿 ∈ ℝ → 𝐿 ∈ ℂ)
1716addid1d 11105 . . . . . . . . . . . . . . . . . . . . . . . . 25 (𝐿 ∈ ℝ → (𝐿 + 0) = 𝐿)
1817breq2d 5082 . . . . . . . . . . . . . . . . . . . . . . . 24 (𝐿 ∈ ℝ → (𝑀 ≤ (𝐿 + 0) ↔ 𝑀𝐿))
19 nn0re 12172 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 (𝑀 ∈ ℕ0𝑀 ∈ ℝ)
2019anim1i 614 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 ((𝑀 ∈ ℕ0𝐿 ∈ ℝ) → (𝑀 ∈ ℝ ∧ 𝐿 ∈ ℝ))
2120ancoms 458 . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 ((𝐿 ∈ ℝ ∧ 𝑀 ∈ ℕ0) → (𝑀 ∈ ℝ ∧ 𝐿 ∈ ℝ))
22 letri3 10991 . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 ((𝑀 ∈ ℝ ∧ 𝐿 ∈ ℝ) → (𝑀 = 𝐿 ↔ (𝑀𝐿𝐿𝑀)))
2321, 22syl 17 . . . . . . . . . . . . . . . . . . . . . . . . . . 27 ((𝐿 ∈ ℝ ∧ 𝑀 ∈ ℕ0) → (𝑀 = 𝐿 ↔ (𝑀𝐿𝐿𝑀)))
2423biimprd 247 . . . . . . . . . . . . . . . . . . . . . . . . . 26 ((𝐿 ∈ ℝ ∧ 𝑀 ∈ ℕ0) → ((𝑀𝐿𝐿𝑀) → 𝑀 = 𝐿))
2524exp4b 430 . . . . . . . . . . . . . . . . . . . . . . . . 25 (𝐿 ∈ ℝ → (𝑀 ∈ ℕ0 → (𝑀𝐿 → (𝐿𝑀𝑀 = 𝐿))))
2625com23 86 . . . . . . . . . . . . . . . . . . . . . . . 24 (𝐿 ∈ ℝ → (𝑀𝐿 → (𝑀 ∈ ℕ0 → (𝐿𝑀𝑀 = 𝐿))))
2718, 26sylbid 239 . . . . . . . . . . . . . . . . . . . . . . 23 (𝐿 ∈ ℝ → (𝑀 ≤ (𝐿 + 0) → (𝑀 ∈ ℕ0 → (𝐿𝑀𝑀 = 𝐿))))
2827com3l 89 . . . . . . . . . . . . . . . . . . . . . 22 (𝑀 ≤ (𝐿 + 0) → (𝑀 ∈ ℕ0 → (𝐿 ∈ ℝ → (𝐿𝑀𝑀 = 𝐿))))
2928impcom 407 . . . . . . . . . . . . . . . . . . . . 21 ((𝑀 ∈ ℕ0𝑀 ≤ (𝐿 + 0)) → (𝐿 ∈ ℝ → (𝐿𝑀𝑀 = 𝐿)))
30293adant2 1129 . . . . . . . . . . . . . . . . . . . 20 ((𝑀 ∈ ℕ0 ∧ (𝐿 + 0) ∈ ℕ0𝑀 ≤ (𝐿 + 0)) → (𝐿 ∈ ℝ → (𝐿𝑀𝑀 = 𝐿)))
3130com12 32 . . . . . . . . . . . . . . . . . . 19 (𝐿 ∈ ℝ → ((𝑀 ∈ ℕ0 ∧ (𝐿 + 0) ∈ ℕ0𝑀 ≤ (𝐿 + 0)) → (𝐿𝑀𝑀 = 𝐿)))
3215, 31syl5bi 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 406 . . . . . . . . . . . . . 14 ((𝐴 ∈ Word 𝑉𝑀 ∈ (0...(𝐿 + 0))) → (𝐿𝑀𝑀 = 𝐿))
37 elfznn0 13278 . . . . . . . . . . . . . . . 16 (𝑀 ∈ (0...(𝐿 + 0)) → 𝑀 ∈ ℕ0)
38 swrd00 14285 . . . . . . . . . . . . . . . . . . . . . 22 (∅ substr ⟨0, 0⟩) = ∅
39 swrd00 14285 . . . . . . . . . . . . . . . . . . . . . 22 (𝐴 substr ⟨𝐿, 𝐿⟩) = ∅
4038, 39eqtr4i 2769 . . . . . . . . . . . . . . . . . . . . 21 (∅ substr ⟨0, 0⟩) = (𝐴 substr ⟨𝐿, 𝐿⟩)
41 nn0cn 12173 . . . . . . . . . . . . . . . . . . . . . . . 24 (𝐿 ∈ ℕ0𝐿 ∈ ℂ)
4241subidd 11250 . . . . . . . . . . . . . . . . . . . . . . 23 (𝐿 ∈ ℕ0 → (𝐿𝐿) = 0)
4342opeq1d 4807 . . . . . . . . . . . . . . . . . . . . . 22 (𝐿 ∈ ℕ0 → ⟨(𝐿𝐿), 0⟩ = ⟨0, 0⟩)
4443oveq2d 7271 . . . . . . . . . . . . . . . . . . . . 21 (𝐿 ∈ ℕ0 → (∅ substr ⟨(𝐿𝐿), 0⟩) = (∅ substr ⟨0, 0⟩))
4541addid1d 11105 . . . . . . . . . . . . . . . . . . . . . . 23 (𝐿 ∈ ℕ0 → (𝐿 + 0) = 𝐿)
4645opeq2d 4808 . . . . . . . . . . . . . . . . . . . . . 22 (𝐿 ∈ ℕ0 → ⟨𝐿, (𝐿 + 0)⟩ = ⟨𝐿, 𝐿⟩)
4746oveq2d 7271 . . . . . . . . . . . . . . . . . . . . 21 (𝐿 ∈ ℕ0 → (𝐴 substr ⟨𝐿, (𝐿 + 0)⟩) = (𝐴 substr ⟨𝐿, 𝐿⟩))
4840, 44, 473eqtr4a 2805 . . . . . . . . . . . . . . . . . . . 20 (𝐿 ∈ ℕ0 → (∅ substr ⟨(𝐿𝐿), 0⟩) = (𝐴 substr ⟨𝐿, (𝐿 + 0)⟩))
4948a1i 11 . . . . . . . . . . . . . . . . . . 19 (𝑀 = 𝐿 → (𝐿 ∈ ℕ0 → (∅ substr ⟨(𝐿𝐿), 0⟩) = (𝐴 substr ⟨𝐿, (𝐿 + 0)⟩)))
50 eleq1 2826 . . . . . . . . . . . . . . . . . . 19 (𝑀 = 𝐿 → (𝑀 ∈ ℕ0𝐿 ∈ ℕ0))
51 oveq1 7262 . . . . . . . . . . . . . . . . . . . . . 22 (𝑀 = 𝐿 → (𝑀𝐿) = (𝐿𝐿))
5251opeq1d 4807 . . . . . . . . . . . . . . . . . . . . 21 (𝑀 = 𝐿 → ⟨(𝑀𝐿), 0⟩ = ⟨(𝐿𝐿), 0⟩)
5352oveq2d 7271 . . . . . . . . . . . . . . . . . . . 20 (𝑀 = 𝐿 → (∅ substr ⟨(𝑀𝐿), 0⟩) = (∅ substr ⟨(𝐿𝐿), 0⟩))
54 opeq1 4801 . . . . . . . . . . . . . . . . . . . . 21 (𝑀 = 𝐿 → ⟨𝑀, (𝐿 + 0)⟩ = ⟨𝐿, (𝐿 + 0)⟩)
5554oveq2d 7271 . . . . . . . . . . . . . . . . . . . 20 (𝑀 = 𝐿 → (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩) = (𝐴 substr ⟨𝐿, (𝐿 + 0)⟩))
5653, 55eqeq12d 2754 . . . . . . . . . . . . . . . . . . 19 (𝑀 = 𝐿 → ((∅ substr ⟨(𝑀𝐿), 0⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩) ↔ (∅ substr ⟨(𝐿𝐿), 0⟩) = (𝐴 substr ⟨𝐿, (𝐿 + 0)⟩)))
5749, 50, 563imtr4d 293 . . . . . . . . . . . . . . . . . 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 407 . . . . . . . . . . . . . 14 ((𝐴 ∈ Word 𝑉𝑀 ∈ (0...(𝐿 + 0))) → (𝑀 = 𝐿 → (∅ substr ⟨(𝑀𝐿), 0⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩)))
6236, 61syld 47 . . . . . . . . . . . . 13 ((𝐴 ∈ Word 𝑉𝑀 ∈ (0...(𝐿 + 0))) → (𝐿𝑀 → (∅ substr ⟨(𝑀𝐿), 0⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩)))
6362imp 406 . . . . . . . . . . . 12 (((𝐴 ∈ Word 𝑉𝑀 ∈ (0...(𝐿 + 0))) ∧ 𝐿𝑀) → (∅ substr ⟨(𝑀𝐿), 0⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
64 swrdcl 14286 . . . . . . . . . . . . . . . 16 (𝐴 ∈ Word 𝑉 → (𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉)
65 ccatrid 14220 . . . . . . . . . . . . . . . 16 ((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅) = (𝐴 substr ⟨𝑀, 𝐿⟩))
6664, 65syl 17 . . . . . . . . . . . . . . 15 (𝐴 ∈ Word 𝑉 → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅) = (𝐴 substr ⟨𝑀, 𝐿⟩))
6713, 41sylbi 216 . . . . . . . . . . . . . . . . . . 19 ((♯‘𝐴) ∈ ℕ0𝐿 ∈ ℂ)
6810, 67syl 17 . . . . . . . . . . . . . . . . . 18 (𝐴 ∈ Word 𝑉𝐿 ∈ ℂ)
69 addid1 11085 . . . . . . . . . . . . . . . . . . 19 (𝐿 ∈ ℂ → (𝐿 + 0) = 𝐿)
7069eqcomd 2744 . . . . . . . . . . . . . . . . . 18 (𝐿 ∈ ℂ → 𝐿 = (𝐿 + 0))
7168, 70syl 17 . . . . . . . . . . . . . . . . 17 (𝐴 ∈ Word 𝑉𝐿 = (𝐿 + 0))
7271opeq2d 4808 . . . . . . . . . . . . . . . 16 (𝐴 ∈ Word 𝑉 → ⟨𝑀, 𝐿⟩ = ⟨𝑀, (𝐿 + 0)⟩)
7372oveq2d 7271 . . . . . . . . . . . . . . 15 (𝐴 ∈ Word 𝑉 → (𝐴 substr ⟨𝑀, 𝐿⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
7466, 73eqtrd 2778 . . . . . . . . . . . . . 14 (𝐴 ∈ Word 𝑉 → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
7574adantr 480 . . . . . . . . . . . . 13 ((𝐴 ∈ Word 𝑉𝑀 ∈ (0...(𝐿 + 0))) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
7675adantr 480 . . . . . . . . . . . 12 (((𝐴 ∈ Word 𝑉𝑀 ∈ (0...(𝐿 + 0))) ∧ ¬ 𝐿𝑀) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
7763, 76ifeqda 4492 . . . . . . . . . . 11 ((𝐴 ∈ Word 𝑉𝑀 ∈ (0...(𝐿 + 0))) → if(𝐿𝑀, (∅ substr ⟨(𝑀𝐿), 0⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅)) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
7877ex 412 . . . . . . . . . 10 (𝐴 ∈ Word 𝑉 → (𝑀 ∈ (0...(𝐿 + 0)) → if(𝐿𝑀, (∅ substr ⟨(𝑀𝐿), 0⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅)) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩)))
7978ad3antrrr 726 . . . . . . . . 9 ((((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (♯‘𝐵) = 0) ∧ 𝐵 = ∅) → (𝑀 ∈ (0...(𝐿 + 0)) → if(𝐿𝑀, (∅ substr ⟨(𝑀𝐿), 0⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅)) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩)))
80 oveq2 7263 . . . . . . . . . . . . . 14 ((♯‘𝐵) = 0 → (𝐿 + (♯‘𝐵)) = (𝐿 + 0))
8180oveq2d 7271 . . . . . . . . . . . . 13 ((♯‘𝐵) = 0 → (0...(𝐿 + (♯‘𝐵))) = (0...(𝐿 + 0)))
8281eleq2d 2824 . . . . . . . . . . . 12 ((♯‘𝐵) = 0 → (𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) ↔ 𝑀 ∈ (0...(𝐿 + 0))))
8382adantr 480 . . . . . . . . . . 11 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → (𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) ↔ 𝑀 ∈ (0...(𝐿 + 0))))
84 simpr 484 . . . . . . . . . . . . . 14 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → 𝐵 = ∅)
85 opeq2 4802 . . . . . . . . . . . . . . 15 ((♯‘𝐵) = 0 → ⟨(𝑀𝐿), (♯‘𝐵)⟩ = ⟨(𝑀𝐿), 0⟩)
8685adantr 480 . . . . . . . . . . . . . 14 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → ⟨(𝑀𝐿), (♯‘𝐵)⟩ = ⟨(𝑀𝐿), 0⟩)
8784, 86oveq12d 7273 . . . . . . . . . . . . 13 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩) = (∅ substr ⟨(𝑀𝐿), 0⟩))
88 oveq2 7263 . . . . . . . . . . . . . 14 (𝐵 = ∅ → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵) = ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅))
8988adantl 481 . . . . . . . . . . . . 13 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵) = ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅))
9087, 89ifeq12d 4477 . . . . . . . . . . . 12 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = if(𝐿𝑀, (∅ substr ⟨(𝑀𝐿), 0⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅)))
9180opeq2d 4808 . . . . . . . . . . . . . 14 ((♯‘𝐵) = 0 → ⟨𝑀, (𝐿 + (♯‘𝐵))⟩ = ⟨𝑀, (𝐿 + 0)⟩)
9291oveq2d 7271 . . . . . . . . . . . . 13 ((♯‘𝐵) = 0 → (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
9392adantr 480 . . . . . . . . . . . 12 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
9490, 93eqeq12d 2754 . . . . . . . . . . 11 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → (if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩) ↔ if(𝐿𝑀, (∅ substr ⟨(𝑀𝐿), 0⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅)) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩)))
9583, 94imbi12d 344 . . . . . . . . . 10 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → ((𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩)) ↔ (𝑀 ∈ (0...(𝐿 + 0)) → if(𝐿𝑀, (∅ substr ⟨(𝑀𝐿), 0⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅)) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))))
9695adantll 710 . . . . . . . . 9 ((((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (♯‘𝐵) = 0) ∧ 𝐵 = ∅) → ((𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩)) ↔ (𝑀 ∈ (0...(𝐿 + 0)) → if(𝐿𝑀, (∅ substr ⟨(𝑀𝐿), 0⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅)) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))))
9779, 96mpbird 256 . . . . . . . 8 ((((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (♯‘𝐵) = 0) ∧ 𝐵 = ∅) → (𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩)))
989, 97mpdan 683 . . . . . . 7 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (♯‘𝐵) = 0) → (𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩)))
9998ex 412 . . . . . 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 406 . . 3 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) → ((♯‘𝐵) ≤ 0 → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩)))
103102adantr 480 . 2 ((((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ (𝐿 + (♯‘𝐵)) ≤ 𝐿) → ((♯‘𝐵) ≤ 0 → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩)))
10411eleq1i 2829 . . . . . . . 8 (𝐿 ∈ ℕ0 ↔ (♯‘𝐴) ∈ ℕ0)
105104, 14sylbir 234 . . . . . . 7 ((♯‘𝐴) ∈ ℕ0𝐿 ∈ ℝ)
10610, 105syl 17 . . . . . 6 (𝐴 ∈ Word 𝑉𝐿 ∈ ℝ)
1071nn0red 12224 . . . . . 6 (𝐵 ∈ Word 𝑉 → (♯‘𝐵) ∈ ℝ)
108 leaddle0 11420 . . . . . 6 ((𝐿 ∈ ℝ ∧ (♯‘𝐵) ∈ ℝ) → ((𝐿 + (♯‘𝐵)) ≤ 𝐿 ↔ (♯‘𝐵) ≤ 0))
109106, 107, 108syl2an 595 . . . . 5 ((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) → ((𝐿 + (♯‘𝐵)) ≤ 𝐿 ↔ (♯‘𝐵) ≤ 0))
110 pm2.24 124 . . . . 5 ((♯‘𝐵) ≤ 0 → (¬ (♯‘𝐵) ≤ 0 → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩)))
111109, 110syl6bi 252 . . . 4 ((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) → ((𝐿 + (♯‘𝐵)) ≤ 𝐿 → (¬ (♯‘𝐵) ≤ 0 → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩))))
112111adantr 480 . . 3 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) → ((𝐿 + (♯‘𝐵)) ≤ 𝐿 → (¬ (♯‘𝐵) ≤ 0 → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩))))
113112imp 406 . 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 395  w3a 1085   = wceq 1539  wcel 2108  c0 4253  ifcif 4456  cop 4564   class class class wbr 5070  cfv 6418  (class class class)co 7255  cc 10800  cr 10801  0cc0 10802   + caddc 10805  cle 10941  cmin 11135  0cn0 12163  ...cfz 13168  chash 13972  Word cword 14145   ++ cconcat 14201   substr csubstr 14281
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1799  ax-4 1813  ax-5 1914  ax-6 1972  ax-7 2012  ax-8 2110  ax-9 2118  ax-10 2139  ax-11 2156  ax-12 2173  ax-ext 2709  ax-rep 5205  ax-sep 5218  ax-nul 5225  ax-pow 5283  ax-pr 5347  ax-un 7566  ax-cnex 10858  ax-resscn 10859  ax-1cn 10860  ax-icn 10861  ax-addcl 10862  ax-addrcl 10863  ax-mulcl 10864  ax-mulrcl 10865  ax-mulcom 10866  ax-addass 10867  ax-mulass 10868  ax-distr 10869  ax-i2m1 10870  ax-1ne0 10871  ax-1rid 10872  ax-rnegex 10873  ax-rrecex 10874  ax-cnre 10875  ax-pre-lttri 10876  ax-pre-lttrn 10877  ax-pre-ltadd 10878  ax-pre-mulgt0 10879
This theorem depends on definitions:  df-bi 206  df-an 396  df-or 844  df-3or 1086  df-3an 1087  df-tru 1542  df-fal 1552  df-ex 1784  df-nf 1788  df-sb 2069  df-mo 2540  df-eu 2569  df-clab 2716  df-cleq 2730  df-clel 2817  df-nfc 2888  df-ne 2943  df-nel 3049  df-ral 3068  df-rex 3069  df-reu 3070  df-rab 3072  df-v 3424  df-sbc 3712  df-csb 3829  df-dif 3886  df-un 3888  df-in 3890  df-ss 3900  df-pss 3902  df-nul 4254  df-if 4457  df-pw 4532  df-sn 4559  df-pr 4561  df-tp 4563  df-op 4565  df-uni 4837  df-int 4877  df-iun 4923  df-br 5071  df-opab 5133  df-mpt 5154  df-tr 5188  df-id 5480  df-eprel 5486  df-po 5494  df-so 5495  df-fr 5535  df-we 5537  df-xp 5586  df-rel 5587  df-cnv 5588  df-co 5589  df-dm 5590  df-rn 5591  df-res 5592  df-ima 5593  df-pred 6191  df-ord 6254  df-on 6255  df-lim 6256  df-suc 6257  df-iota 6376  df-fun 6420  df-fn 6421  df-f 6422  df-f1 6423  df-fo 6424  df-f1o 6425  df-fv 6426  df-riota 7212  df-ov 7258  df-oprab 7259  df-mpo 7260  df-om 7688  df-1st 7804  df-2nd 7805  df-frecs 8068  df-wrecs 8099  df-recs 8173  df-rdg 8212  df-1o 8267  df-er 8456  df-en 8692  df-dom 8693  df-sdom 8694  df-fin 8695  df-card 9628  df-pnf 10942  df-mnf 10943  df-xr 10944  df-ltxr 10945  df-le 10946  df-sub 11137  df-neg 11138  df-nn 11904  df-n0 12164  df-z 12250  df-uz 12512  df-fz 13169  df-fzo 13312  df-hash 13973  df-word 14146  df-concat 14202  df-substr 14282
This theorem is referenced by:  swrdccat3b  14381
  Copyright terms: Public domain W3C validator