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

Theorem swrdccat3blem 14162
Description: Lemma for swrdccat3b 14163. (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 13946 . . . . . . . 8 (𝐵 ∈ Word 𝑉 → (♯‘𝐵) ∈ ℕ0)
2 nn0le0eq0 11976 . . . . . . . . 9 ((♯‘𝐵) ∈ ℕ0 → ((♯‘𝐵) ≤ 0 ↔ (♯‘𝐵) = 0))
32biimpd 232 . . . . . . . 8 ((♯‘𝐵) ∈ ℕ0 → ((♯‘𝐵) ≤ 0 → (♯‘𝐵) = 0))
41, 3syl 17 . . . . . . 7 (𝐵 ∈ Word 𝑉 → ((♯‘𝐵) ≤ 0 → (♯‘𝐵) = 0))
54adantl 485 . . . . . 6 ((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) → ((♯‘𝐵) ≤ 0 → (♯‘𝐵) = 0))
6 hasheq0 13788 . . . . . . . . . . 11 (𝐵 ∈ Word 𝑉 → ((♯‘𝐵) = 0 ↔ 𝐵 = ∅))
76biimpd 232 . . . . . . . . . 10 (𝐵 ∈ Word 𝑉 → ((♯‘𝐵) = 0 → 𝐵 = ∅))
87adantl 485 . . . . . . . . 9 ((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) → ((♯‘𝐵) = 0 → 𝐵 = ∅))
98imp 410 . . . . . . . 8 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (♯‘𝐵) = 0) → 𝐵 = ∅)
10 lencl 13946 . . . . . . . . . . . . . . . 16 (𝐴 ∈ Word 𝑉 → (♯‘𝐴) ∈ ℕ0)
11 swrdccatin2.l . . . . . . . . . . . . . . . . . . 19 𝐿 = (♯‘𝐴)
1211eqcomi 2768 . . . . . . . . . . . . . . . . . 18 (♯‘𝐴) = 𝐿
1312eleq1i 2843 . . . . . . . . . . . . . . . . 17 ((♯‘𝐴) ∈ ℕ0𝐿 ∈ ℕ0)
14 nn0re 11957 . . . . . . . . . . . . . . . . . 18 (𝐿 ∈ ℕ0𝐿 ∈ ℝ)
15 elfz2nn0 13061 . . . . . . . . . . . . . . . . . . 19 (𝑀 ∈ (0...(𝐿 + 0)) ↔ (𝑀 ∈ ℕ0 ∧ (𝐿 + 0) ∈ ℕ0𝑀 ≤ (𝐿 + 0)))
16 recn 10679 . . . . . . . . . . . . . . . . . . . . . . . . . 26 (𝐿 ∈ ℝ → 𝐿 ∈ ℂ)
1716addid1d 10892 . . . . . . . . . . . . . . . . . . . . . . . . 25 (𝐿 ∈ ℝ → (𝐿 + 0) = 𝐿)
1817breq2d 5049 . . . . . . . . . . . . . . . . . . . . . . . 24 (𝐿 ∈ ℝ → (𝑀 ≤ (𝐿 + 0) ↔ 𝑀𝐿))
19 nn0re 11957 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 (𝑀 ∈ ℕ0𝑀 ∈ ℝ)
2019anim1i 617 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 ((𝑀 ∈ ℕ0𝐿 ∈ ℝ) → (𝑀 ∈ ℝ ∧ 𝐿 ∈ ℝ))
2120ancoms 462 . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 ((𝐿 ∈ ℝ ∧ 𝑀 ∈ ℕ0) → (𝑀 ∈ ℝ ∧ 𝐿 ∈ ℝ))
22 letri3 10778 . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 ((𝑀 ∈ ℝ ∧ 𝐿 ∈ ℝ) → (𝑀 = 𝐿 ↔ (𝑀𝐿𝐿𝑀)))
2321, 22syl 17 . . . . . . . . . . . . . . . . . . . . . . . . . . 27 ((𝐿 ∈ ℝ ∧ 𝑀 ∈ ℕ0) → (𝑀 = 𝐿 ↔ (𝑀𝐿𝐿𝑀)))
2423biimprd 251 . . . . . . . . . . . . . . . . . . . . . . . . . 26 ((𝐿 ∈ ℝ ∧ 𝑀 ∈ ℕ0) → ((𝑀𝐿𝐿𝑀) → 𝑀 = 𝐿))
2524exp4b 434 . . . . . . . . . . . . . . . . . . . . . . . . 25 (𝐿 ∈ ℝ → (𝑀 ∈ ℕ0 → (𝑀𝐿 → (𝐿𝑀𝑀 = 𝐿))))
2625com23 86 . . . . . . . . . . . . . . . . . . . . . . . 24 (𝐿 ∈ ℝ → (𝑀𝐿 → (𝑀 ∈ ℕ0 → (𝐿𝑀𝑀 = 𝐿))))
2718, 26sylbid 243 . . . . . . . . . . . . . . . . . . . . . . 23 (𝐿 ∈ ℝ → (𝑀 ≤ (𝐿 + 0) → (𝑀 ∈ ℕ0 → (𝐿𝑀𝑀 = 𝐿))))
2827com3l 89 . . . . . . . . . . . . . . . . . . . . . 22 (𝑀 ≤ (𝐿 + 0) → (𝑀 ∈ ℕ0 → (𝐿 ∈ ℝ → (𝐿𝑀𝑀 = 𝐿))))
2928impcom 411 . . . . . . . . . . . . . . . . . . . . 21 ((𝑀 ∈ ℕ0𝑀 ≤ (𝐿 + 0)) → (𝐿 ∈ ℝ → (𝐿𝑀𝑀 = 𝐿)))
30293adant2 1129 . . . . . . . . . . . . . . . . . . . 20 ((𝑀 ∈ ℕ0 ∧ (𝐿 + 0) ∈ ℕ0𝑀 ≤ (𝐿 + 0)) → (𝐿 ∈ ℝ → (𝐿𝑀𝑀 = 𝐿)))
3130com12 32 . . . . . . . . . . . . . . . . . . 19 (𝐿 ∈ ℝ → ((𝑀 ∈ ℕ0 ∧ (𝐿 + 0) ∈ ℕ0𝑀 ≤ (𝐿 + 0)) → (𝐿𝑀𝑀 = 𝐿)))
3215, 31syl5bi 245 . . . . . . . . . . . . . . . . . 18 (𝐿 ∈ ℝ → (𝑀 ∈ (0...(𝐿 + 0)) → (𝐿𝑀𝑀 = 𝐿)))
3314, 32syl 17 . . . . . . . . . . . . . . . . 17 (𝐿 ∈ ℕ0 → (𝑀 ∈ (0...(𝐿 + 0)) → (𝐿𝑀𝑀 = 𝐿)))
3413, 33sylbi 220 . . . . . . . . . . . . . . . 16 ((♯‘𝐴) ∈ ℕ0 → (𝑀 ∈ (0...(𝐿 + 0)) → (𝐿𝑀𝑀 = 𝐿)))
3510, 34syl 17 . . . . . . . . . . . . . . 15 (𝐴 ∈ Word 𝑉 → (𝑀 ∈ (0...(𝐿 + 0)) → (𝐿𝑀𝑀 = 𝐿)))
3635imp 410 . . . . . . . . . . . . . 14 ((𝐴 ∈ Word 𝑉𝑀 ∈ (0...(𝐿 + 0))) → (𝐿𝑀𝑀 = 𝐿))
37 elfznn0 13063 . . . . . . . . . . . . . . . 16 (𝑀 ∈ (0...(𝐿 + 0)) → 𝑀 ∈ ℕ0)
38 swrd00 14067 . . . . . . . . . . . . . . . . . . . . . 22 (∅ substr ⟨0, 0⟩) = ∅
39 swrd00 14067 . . . . . . . . . . . . . . . . . . . . . 22 (𝐴 substr ⟨𝐿, 𝐿⟩) = ∅
4038, 39eqtr4i 2785 . . . . . . . . . . . . . . . . . . . . 21 (∅ substr ⟨0, 0⟩) = (𝐴 substr ⟨𝐿, 𝐿⟩)
41 nn0cn 11958 . . . . . . . . . . . . . . . . . . . . . . . 24 (𝐿 ∈ ℕ0𝐿 ∈ ℂ)
4241subidd 11037 . . . . . . . . . . . . . . . . . . . . . . 23 (𝐿 ∈ ℕ0 → (𝐿𝐿) = 0)
4342opeq1d 4773 . . . . . . . . . . . . . . . . . . . . . 22 (𝐿 ∈ ℕ0 → ⟨(𝐿𝐿), 0⟩ = ⟨0, 0⟩)
4443oveq2d 7173 . . . . . . . . . . . . . . . . . . . . 21 (𝐿 ∈ ℕ0 → (∅ substr ⟨(𝐿𝐿), 0⟩) = (∅ substr ⟨0, 0⟩))
4541addid1d 10892 . . . . . . . . . . . . . . . . . . . . . . 23 (𝐿 ∈ ℕ0 → (𝐿 + 0) = 𝐿)
4645opeq2d 4774 . . . . . . . . . . . . . . . . . . . . . 22 (𝐿 ∈ ℕ0 → ⟨𝐿, (𝐿 + 0)⟩ = ⟨𝐿, 𝐿⟩)
4746oveq2d 7173 . . . . . . . . . . . . . . . . . . . . 21 (𝐿 ∈ ℕ0 → (𝐴 substr ⟨𝐿, (𝐿 + 0)⟩) = (𝐴 substr ⟨𝐿, 𝐿⟩))
4840, 44, 473eqtr4a 2820 . . . . . . . . . . . . . . . . . . . 20 (𝐿 ∈ ℕ0 → (∅ substr ⟨(𝐿𝐿), 0⟩) = (𝐴 substr ⟨𝐿, (𝐿 + 0)⟩))
4948a1i 11 . . . . . . . . . . . . . . . . . . 19 (𝑀 = 𝐿 → (𝐿 ∈ ℕ0 → (∅ substr ⟨(𝐿𝐿), 0⟩) = (𝐴 substr ⟨𝐿, (𝐿 + 0)⟩)))
50 eleq1 2840 . . . . . . . . . . . . . . . . . . 19 (𝑀 = 𝐿 → (𝑀 ∈ ℕ0𝐿 ∈ ℕ0))
51 oveq1 7164 . . . . . . . . . . . . . . . . . . . . . 22 (𝑀 = 𝐿 → (𝑀𝐿) = (𝐿𝐿))
5251opeq1d 4773 . . . . . . . . . . . . . . . . . . . . 21 (𝑀 = 𝐿 → ⟨(𝑀𝐿), 0⟩ = ⟨(𝐿𝐿), 0⟩)
5352oveq2d 7173 . . . . . . . . . . . . . . . . . . . 20 (𝑀 = 𝐿 → (∅ substr ⟨(𝑀𝐿), 0⟩) = (∅ substr ⟨(𝐿𝐿), 0⟩))
54 opeq1 4765 . . . . . . . . . . . . . . . . . . . . 21 (𝑀 = 𝐿 → ⟨𝑀, (𝐿 + 0)⟩ = ⟨𝐿, (𝐿 + 0)⟩)
5554oveq2d 7173 . . . . . . . . . . . . . . . . . . . 20 (𝑀 = 𝐿 → (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩) = (𝐴 substr ⟨𝐿, (𝐿 + 0)⟩))
5653, 55eqeq12d 2775 . . . . . . . . . . . . . . . . . . 19 (𝑀 = 𝐿 → ((∅ substr ⟨(𝑀𝐿), 0⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩) ↔ (∅ substr ⟨(𝐿𝐿), 0⟩) = (𝐴 substr ⟨𝐿, (𝐿 + 0)⟩)))
5749, 50, 563imtr4d 297 . . . . . . . . . . . . . . . . . 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 411 . . . . . . . . . . . . . 14 ((𝐴 ∈ Word 𝑉𝑀 ∈ (0...(𝐿 + 0))) → (𝑀 = 𝐿 → (∅ substr ⟨(𝑀𝐿), 0⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩)))
6236, 61syld 47 . . . . . . . . . . . . 13 ((𝐴 ∈ Word 𝑉𝑀 ∈ (0...(𝐿 + 0))) → (𝐿𝑀 → (∅ substr ⟨(𝑀𝐿), 0⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩)))
6362imp 410 . . . . . . . . . . . 12 (((𝐴 ∈ Word 𝑉𝑀 ∈ (0...(𝐿 + 0))) ∧ 𝐿𝑀) → (∅ substr ⟨(𝑀𝐿), 0⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
64 swrdcl 14068 . . . . . . . . . . . . . . . 16 (𝐴 ∈ Word 𝑉 → (𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉)
65 ccatrid 14002 . . . . . . . . . . . . . . . 16 ((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅) = (𝐴 substr ⟨𝑀, 𝐿⟩))
6664, 65syl 17 . . . . . . . . . . . . . . 15 (𝐴 ∈ Word 𝑉 → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅) = (𝐴 substr ⟨𝑀, 𝐿⟩))
6713, 41sylbi 220 . . . . . . . . . . . . . . . . . . 19 ((♯‘𝐴) ∈ ℕ0𝐿 ∈ ℂ)
6810, 67syl 17 . . . . . . . . . . . . . . . . . 18 (𝐴 ∈ Word 𝑉𝐿 ∈ ℂ)
69 addid1 10872 . . . . . . . . . . . . . . . . . . 19 (𝐿 ∈ ℂ → (𝐿 + 0) = 𝐿)
7069eqcomd 2765 . . . . . . . . . . . . . . . . . 18 (𝐿 ∈ ℂ → 𝐿 = (𝐿 + 0))
7168, 70syl 17 . . . . . . . . . . . . . . . . 17 (𝐴 ∈ Word 𝑉𝐿 = (𝐿 + 0))
7271opeq2d 4774 . . . . . . . . . . . . . . . 16 (𝐴 ∈ Word 𝑉 → ⟨𝑀, 𝐿⟩ = ⟨𝑀, (𝐿 + 0)⟩)
7372oveq2d 7173 . . . . . . . . . . . . . . 15 (𝐴 ∈ Word 𝑉 → (𝐴 substr ⟨𝑀, 𝐿⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
7466, 73eqtrd 2794 . . . . . . . . . . . . . 14 (𝐴 ∈ Word 𝑉 → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
7574adantr 484 . . . . . . . . . . . . 13 ((𝐴 ∈ Word 𝑉𝑀 ∈ (0...(𝐿 + 0))) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
7675adantr 484 . . . . . . . . . . . 12 (((𝐴 ∈ Word 𝑉𝑀 ∈ (0...(𝐿 + 0))) ∧ ¬ 𝐿𝑀) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
7763, 76ifeqda 4460 . . . . . . . . . . 11 ((𝐴 ∈ Word 𝑉𝑀 ∈ (0...(𝐿 + 0))) → if(𝐿𝑀, (∅ substr ⟨(𝑀𝐿), 0⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅)) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
7877ex 416 . . . . . . . . . 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 7165 . . . . . . . . . . . . . 14 ((♯‘𝐵) = 0 → (𝐿 + (♯‘𝐵)) = (𝐿 + 0))
8180oveq2d 7173 . . . . . . . . . . . . 13 ((♯‘𝐵) = 0 → (0...(𝐿 + (♯‘𝐵))) = (0...(𝐿 + 0)))
8281eleq2d 2838 . . . . . . . . . . . 12 ((♯‘𝐵) = 0 → (𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) ↔ 𝑀 ∈ (0...(𝐿 + 0))))
8382adantr 484 . . . . . . . . . . 11 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → (𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) ↔ 𝑀 ∈ (0...(𝐿 + 0))))
84 simpr 488 . . . . . . . . . . . . . 14 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → 𝐵 = ∅)
85 opeq2 4767 . . . . . . . . . . . . . . 15 ((♯‘𝐵) = 0 → ⟨(𝑀𝐿), (♯‘𝐵)⟩ = ⟨(𝑀𝐿), 0⟩)
8685adantr 484 . . . . . . . . . . . . . 14 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → ⟨(𝑀𝐿), (♯‘𝐵)⟩ = ⟨(𝑀𝐿), 0⟩)
8784, 86oveq12d 7175 . . . . . . . . . . . . 13 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩) = (∅ substr ⟨(𝑀𝐿), 0⟩))
88 oveq2 7165 . . . . . . . . . . . . . 14 (𝐵 = ∅ → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵) = ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅))
8988adantl 485 . . . . . . . . . . . . 13 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵) = ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅))
9087, 89ifeq12d 4445 . . . . . . . . . . . 12 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = if(𝐿𝑀, (∅ substr ⟨(𝑀𝐿), 0⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅)))
9180opeq2d 4774 . . . . . . . . . . . . . 14 ((♯‘𝐵) = 0 → ⟨𝑀, (𝐿 + (♯‘𝐵))⟩ = ⟨𝑀, (𝐿 + 0)⟩)
9291oveq2d 7173 . . . . . . . . . . . . 13 ((♯‘𝐵) = 0 → (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
9392adantr 484 . . . . . . . . . . . 12 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
9490, 93eqeq12d 2775 . . . . . . . . . . 11 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → (if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩) ↔ if(𝐿𝑀, (∅ substr ⟨(𝑀𝐿), 0⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅)) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩)))
9583, 94imbi12d 348 . . . . . . . . . 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 260 . . . . . . . 8 ((((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (♯‘𝐵) = 0) ∧ 𝐵 = ∅) → (𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩)))
989, 97mpdan 686 . . . . . . 7 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (♯‘𝐵) = 0) → (𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩)))
9998ex 416 . . . . . 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 410 . . 3 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) → ((♯‘𝐵) ≤ 0 → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩)))
103102adantr 484 . 2 ((((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ (𝐿 + (♯‘𝐵)) ≤ 𝐿) → ((♯‘𝐵) ≤ 0 → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩)))
10411eleq1i 2843 . . . . . . . 8 (𝐿 ∈ ℕ0 ↔ (♯‘𝐴) ∈ ℕ0)
105104, 14sylbir 238 . . . . . . 7 ((♯‘𝐴) ∈ ℕ0𝐿 ∈ ℝ)
10610, 105syl 17 . . . . . 6 (𝐴 ∈ Word 𝑉𝐿 ∈ ℝ)
1071nn0red 12009 . . . . . 6 (𝐵 ∈ Word 𝑉 → (♯‘𝐵) ∈ ℝ)
108 leaddle0 11207 . . . . . 6 ((𝐿 ∈ ℝ ∧ (♯‘𝐵) ∈ ℝ) → ((𝐿 + (♯‘𝐵)) ≤ 𝐿 ↔ (♯‘𝐵) ≤ 0))
109106, 107, 108syl2an 598 . . . . 5 ((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) → ((𝐿 + (♯‘𝐵)) ≤ 𝐿 ↔ (♯‘𝐵) ≤ 0))
110 pm2.24 124 . . . . 5 ((♯‘𝐵) ≤ 0 → (¬ (♯‘𝐵) ≤ 0 → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩)))
111109, 110syl6bi 256 . . . 4 ((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) → ((𝐿 + (♯‘𝐵)) ≤ 𝐿 → (¬ (♯‘𝐵) ≤ 0 → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩))))
112111adantr 484 . . 3 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) → ((𝐿 + (♯‘𝐵)) ≤ 𝐿 → (¬ (♯‘𝐵) ≤ 0 → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩))))
113112imp 410 . 2 ((((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ (𝐿 + (♯‘𝐵)) ≤ 𝐿) → (¬ (♯‘𝐵) ≤ 0 → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩)))
114103, 113pm2.61d 182 1 ((((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ (𝐿 + (♯‘𝐵)) ≤ 𝐿) → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩))
Colors of variables: wff setvar class
Syntax hints:  ¬ wn 3  wi 4  wb 209  wa 399  w3a 1085   = wceq 1539  wcel 2112  c0 4228  ifcif 4424  cop 4532   class class class wbr 5037  cfv 6341  (class class class)co 7157  cc 10587  cr 10588  0cc0 10589   + caddc 10592  cle 10728  cmin 10922  0cn0 11948  ...cfz 12953  chash 13754  Word cword 13927   ++ cconcat 13983   substr csubstr 14063
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 1912  ax-6 1971  ax-7 2016  ax-8 2114  ax-9 2122  ax-10 2143  ax-11 2159  ax-12 2176  ax-ext 2730  ax-rep 5161  ax-sep 5174  ax-nul 5181  ax-pow 5239  ax-pr 5303  ax-un 7466  ax-cnex 10645  ax-resscn 10646  ax-1cn 10647  ax-icn 10648  ax-addcl 10649  ax-addrcl 10650  ax-mulcl 10651  ax-mulrcl 10652  ax-mulcom 10653  ax-addass 10654  ax-mulass 10655  ax-distr 10656  ax-i2m1 10657  ax-1ne0 10658  ax-1rid 10659  ax-rnegex 10660  ax-rrecex 10661  ax-cnre 10662  ax-pre-lttri 10663  ax-pre-lttrn 10664  ax-pre-ltadd 10665  ax-pre-mulgt0 10666
This theorem depends on definitions:  df-bi 210  df-an 400  df-or 845  df-3or 1086  df-3an 1087  df-tru 1542  df-fal 1552  df-ex 1783  df-nf 1787  df-sb 2071  df-mo 2558  df-eu 2589  df-clab 2737  df-cleq 2751  df-clel 2831  df-nfc 2902  df-ne 2953  df-nel 3057  df-ral 3076  df-rex 3077  df-reu 3078  df-rab 3080  df-v 3412  df-sbc 3700  df-csb 3809  df-dif 3864  df-un 3866  df-in 3868  df-ss 3878  df-pss 3880  df-nul 4229  df-if 4425  df-pw 4500  df-sn 4527  df-pr 4529  df-tp 4531  df-op 4533  df-uni 4803  df-int 4843  df-iun 4889  df-br 5038  df-opab 5100  df-mpt 5118  df-tr 5144  df-id 5435  df-eprel 5440  df-po 5448  df-so 5449  df-fr 5488  df-we 5490  df-xp 5535  df-rel 5536  df-cnv 5537  df-co 5538  df-dm 5539  df-rn 5540  df-res 5541  df-ima 5542  df-pred 6132  df-ord 6178  df-on 6179  df-lim 6180  df-suc 6181  df-iota 6300  df-fun 6343  df-fn 6344  df-f 6345  df-f1 6346  df-fo 6347  df-f1o 6348  df-fv 6349  df-riota 7115  df-ov 7160  df-oprab 7161  df-mpo 7162  df-om 7587  df-1st 7700  df-2nd 7701  df-wrecs 7964  df-recs 8025  df-rdg 8063  df-1o 8119  df-er 8306  df-en 8542  df-dom 8543  df-sdom 8544  df-fin 8545  df-card 9415  df-pnf 10729  df-mnf 10730  df-xr 10731  df-ltxr 10732  df-le 10733  df-sub 10924  df-neg 10925  df-nn 11689  df-n0 11949  df-z 12035  df-uz 12297  df-fz 12954  df-fzo 13097  df-hash 13755  df-word 13928  df-concat 13984  df-substr 14064
This theorem is referenced by:  swrdccat3b  14163
  Copyright terms: Public domain W3C validator