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

Theorem swrdccat3blem 14452
Description: Lemma for swrdccat3b 14453. (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 14236 . . . . . . . 8 (𝐵 ∈ Word 𝑉 → (♯‘𝐵) ∈ ℕ0)
2 nn0le0eq0 12261 . . . . . . . . 9 ((♯‘𝐵) ∈ ℕ0 → ((♯‘𝐵) ≤ 0 ↔ (♯‘𝐵) = 0))
32biimpd 228 . . . . . . . 8 ((♯‘𝐵) ∈ ℕ0 → ((♯‘𝐵) ≤ 0 → (♯‘𝐵) = 0))
41, 3syl 17 . . . . . . 7 (𝐵 ∈ Word 𝑉 → ((♯‘𝐵) ≤ 0 → (♯‘𝐵) = 0))
54adantl 482 . . . . . 6 ((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) → ((♯‘𝐵) ≤ 0 → (♯‘𝐵) = 0))
6 hasheq0 14078 . . . . . . . . . . 11 (𝐵 ∈ Word 𝑉 → ((♯‘𝐵) = 0 ↔ 𝐵 = ∅))
76biimpd 228 . . . . . . . . . 10 (𝐵 ∈ Word 𝑉 → ((♯‘𝐵) = 0 → 𝐵 = ∅))
87adantl 482 . . . . . . . . 9 ((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) → ((♯‘𝐵) = 0 → 𝐵 = ∅))
98imp 407 . . . . . . . 8 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (♯‘𝐵) = 0) → 𝐵 = ∅)
10 lencl 14236 . . . . . . . . . . . . . . . 16 (𝐴 ∈ Word 𝑉 → (♯‘𝐴) ∈ ℕ0)
11 swrdccatin2.l . . . . . . . . . . . . . . . . . . 19 𝐿 = (♯‘𝐴)
1211eqcomi 2747 . . . . . . . . . . . . . . . . . 18 (♯‘𝐴) = 𝐿
1312eleq1i 2829 . . . . . . . . . . . . . . . . 17 ((♯‘𝐴) ∈ ℕ0𝐿 ∈ ℕ0)
14 nn0re 12242 . . . . . . . . . . . . . . . . . 18 (𝐿 ∈ ℕ0𝐿 ∈ ℝ)
15 elfz2nn0 13347 . . . . . . . . . . . . . . . . . . 19 (𝑀 ∈ (0...(𝐿 + 0)) ↔ (𝑀 ∈ ℕ0 ∧ (𝐿 + 0) ∈ ℕ0𝑀 ≤ (𝐿 + 0)))
16 recn 10961 . . . . . . . . . . . . . . . . . . . . . . . . . 26 (𝐿 ∈ ℝ → 𝐿 ∈ ℂ)
1716addid1d 11175 . . . . . . . . . . . . . . . . . . . . . . . . 25 (𝐿 ∈ ℝ → (𝐿 + 0) = 𝐿)
1817breq2d 5086 . . . . . . . . . . . . . . . . . . . . . . . 24 (𝐿 ∈ ℝ → (𝑀 ≤ (𝐿 + 0) ↔ 𝑀𝐿))
19 nn0re 12242 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 (𝑀 ∈ ℕ0𝑀 ∈ ℝ)
2019anim1i 615 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 ((𝑀 ∈ ℕ0𝐿 ∈ ℝ) → (𝑀 ∈ ℝ ∧ 𝐿 ∈ ℝ))
2120ancoms 459 . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 ((𝐿 ∈ ℝ ∧ 𝑀 ∈ ℕ0) → (𝑀 ∈ ℝ ∧ 𝐿 ∈ ℝ))
22 letri3 11060 . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 ((𝑀 ∈ ℝ ∧ 𝐿 ∈ ℝ) → (𝑀 = 𝐿 ↔ (𝑀𝐿𝐿𝑀)))
2321, 22syl 17 . . . . . . . . . . . . . . . . . . . . . . . . . . 27 ((𝐿 ∈ ℝ ∧ 𝑀 ∈ ℕ0) → (𝑀 = 𝐿 ↔ (𝑀𝐿𝐿𝑀)))
2423biimprd 247 . . . . . . . . . . . . . . . . . . . . . . . . . 26 ((𝐿 ∈ ℝ ∧ 𝑀 ∈ ℕ0) → ((𝑀𝐿𝐿𝑀) → 𝑀 = 𝐿))
2524exp4b 431 . . . . . . . . . . . . . . . . . . . . . . . . 25 (𝐿 ∈ ℝ → (𝑀 ∈ ℕ0 → (𝑀𝐿 → (𝐿𝑀𝑀 = 𝐿))))
2625com23 86 . . . . . . . . . . . . . . . . . . . . . . . 24 (𝐿 ∈ ℝ → (𝑀𝐿 → (𝑀 ∈ ℕ0 → (𝐿𝑀𝑀 = 𝐿))))
2718, 26sylbid 239 . . . . . . . . . . . . . . . . . . . . . . 23 (𝐿 ∈ ℝ → (𝑀 ≤ (𝐿 + 0) → (𝑀 ∈ ℕ0 → (𝐿𝑀𝑀 = 𝐿))))
2827com3l 89 . . . . . . . . . . . . . . . . . . . . . 22 (𝑀 ≤ (𝐿 + 0) → (𝑀 ∈ ℕ0 → (𝐿 ∈ ℝ → (𝐿𝑀𝑀 = 𝐿))))
2928impcom 408 . . . . . . . . . . . . . . . . . . . . 21 ((𝑀 ∈ ℕ0𝑀 ≤ (𝐿 + 0)) → (𝐿 ∈ ℝ → (𝐿𝑀𝑀 = 𝐿)))
30293adant2 1130 . . . . . . . . . . . . . . . . . . . 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 407 . . . . . . . . . . . . . 14 ((𝐴 ∈ Word 𝑉𝑀 ∈ (0...(𝐿 + 0))) → (𝐿𝑀𝑀 = 𝐿))
37 elfznn0 13349 . . . . . . . . . . . . . . . 16 (𝑀 ∈ (0...(𝐿 + 0)) → 𝑀 ∈ ℕ0)
38 swrd00 14357 . . . . . . . . . . . . . . . . . . . . . 22 (∅ substr ⟨0, 0⟩) = ∅
39 swrd00 14357 . . . . . . . . . . . . . . . . . . . . . 22 (𝐴 substr ⟨𝐿, 𝐿⟩) = ∅
4038, 39eqtr4i 2769 . . . . . . . . . . . . . . . . . . . . 21 (∅ substr ⟨0, 0⟩) = (𝐴 substr ⟨𝐿, 𝐿⟩)
41 nn0cn 12243 . . . . . . . . . . . . . . . . . . . . . . . 24 (𝐿 ∈ ℕ0𝐿 ∈ ℂ)
4241subidd 11320 . . . . . . . . . . . . . . . . . . . . . . 23 (𝐿 ∈ ℕ0 → (𝐿𝐿) = 0)
4342opeq1d 4810 . . . . . . . . . . . . . . . . . . . . . 22 (𝐿 ∈ ℕ0 → ⟨(𝐿𝐿), 0⟩ = ⟨0, 0⟩)
4443oveq2d 7291 . . . . . . . . . . . . . . . . . . . . 21 (𝐿 ∈ ℕ0 → (∅ substr ⟨(𝐿𝐿), 0⟩) = (∅ substr ⟨0, 0⟩))
4541addid1d 11175 . . . . . . . . . . . . . . . . . . . . . . 23 (𝐿 ∈ ℕ0 → (𝐿 + 0) = 𝐿)
4645opeq2d 4811 . . . . . . . . . . . . . . . . . . . . . 22 (𝐿 ∈ ℕ0 → ⟨𝐿, (𝐿 + 0)⟩ = ⟨𝐿, 𝐿⟩)
4746oveq2d 7291 . . . . . . . . . . . . . . . . . . . . 21 (𝐿 ∈ ℕ0 → (𝐴 substr ⟨𝐿, (𝐿 + 0)⟩) = (𝐴 substr ⟨𝐿, 𝐿⟩))
4840, 44, 473eqtr4a 2804 . . . . . . . . . . . . . . . . . . . 20 (𝐿 ∈ ℕ0 → (∅ substr ⟨(𝐿𝐿), 0⟩) = (𝐴 substr ⟨𝐿, (𝐿 + 0)⟩))
4948a1i 11 . . . . . . . . . . . . . . . . . . 19 (𝑀 = 𝐿 → (𝐿 ∈ ℕ0 → (∅ substr ⟨(𝐿𝐿), 0⟩) = (𝐴 substr ⟨𝐿, (𝐿 + 0)⟩)))
50 eleq1 2826 . . . . . . . . . . . . . . . . . . 19 (𝑀 = 𝐿 → (𝑀 ∈ ℕ0𝐿 ∈ ℕ0))
51 oveq1 7282 . . . . . . . . . . . . . . . . . . . . . 22 (𝑀 = 𝐿 → (𝑀𝐿) = (𝐿𝐿))
5251opeq1d 4810 . . . . . . . . . . . . . . . . . . . . 21 (𝑀 = 𝐿 → ⟨(𝑀𝐿), 0⟩ = ⟨(𝐿𝐿), 0⟩)
5352oveq2d 7291 . . . . . . . . . . . . . . . . . . . 20 (𝑀 = 𝐿 → (∅ substr ⟨(𝑀𝐿), 0⟩) = (∅ substr ⟨(𝐿𝐿), 0⟩))
54 opeq1 4804 . . . . . . . . . . . . . . . . . . . . 21 (𝑀 = 𝐿 → ⟨𝑀, (𝐿 + 0)⟩ = ⟨𝐿, (𝐿 + 0)⟩)
5554oveq2d 7291 . . . . . . . . . . . . . . . . . . . 20 (𝑀 = 𝐿 → (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩) = (𝐴 substr ⟨𝐿, (𝐿 + 0)⟩))
5653, 55eqeq12d 2754 . . . . . . . . . . . . . . . . . . 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 408 . . . . . . . . . . . . . 14 ((𝐴 ∈ Word 𝑉𝑀 ∈ (0...(𝐿 + 0))) → (𝑀 = 𝐿 → (∅ substr ⟨(𝑀𝐿), 0⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩)))
6236, 61syld 47 . . . . . . . . . . . . 13 ((𝐴 ∈ Word 𝑉𝑀 ∈ (0...(𝐿 + 0))) → (𝐿𝑀 → (∅ substr ⟨(𝑀𝐿), 0⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩)))
6362imp 407 . . . . . . . . . . . 12 (((𝐴 ∈ Word 𝑉𝑀 ∈ (0...(𝐿 + 0))) ∧ 𝐿𝑀) → (∅ substr ⟨(𝑀𝐿), 0⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
64 swrdcl 14358 . . . . . . . . . . . . . . . 16 (𝐴 ∈ Word 𝑉 → (𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉)
65 ccatrid 14292 . . . . . . . . . . . . . . . 16 ((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅) = (𝐴 substr ⟨𝑀, 𝐿⟩))
6664, 65syl 17 . . . . . . . . . . . . . . 15 (𝐴 ∈ Word 𝑉 → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅) = (𝐴 substr ⟨𝑀, 𝐿⟩))
6713, 41sylbi 216 . . . . . . . . . . . . . . . . . . 19 ((♯‘𝐴) ∈ ℕ0𝐿 ∈ ℂ)
6810, 67syl 17 . . . . . . . . . . . . . . . . . 18 (𝐴 ∈ Word 𝑉𝐿 ∈ ℂ)
69 addid1 11155 . . . . . . . . . . . . . . . . . . 19 (𝐿 ∈ ℂ → (𝐿 + 0) = 𝐿)
7069eqcomd 2744 . . . . . . . . . . . . . . . . . 18 (𝐿 ∈ ℂ → 𝐿 = (𝐿 + 0))
7168, 70syl 17 . . . . . . . . . . . . . . . . 17 (𝐴 ∈ Word 𝑉𝐿 = (𝐿 + 0))
7271opeq2d 4811 . . . . . . . . . . . . . . . 16 (𝐴 ∈ Word 𝑉 → ⟨𝑀, 𝐿⟩ = ⟨𝑀, (𝐿 + 0)⟩)
7372oveq2d 7291 . . . . . . . . . . . . . . 15 (𝐴 ∈ Word 𝑉 → (𝐴 substr ⟨𝑀, 𝐿⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
7466, 73eqtrd 2778 . . . . . . . . . . . . . 14 (𝐴 ∈ Word 𝑉 → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
7574adantr 481 . . . . . . . . . . . . 13 ((𝐴 ∈ Word 𝑉𝑀 ∈ (0...(𝐿 + 0))) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
7675adantr 481 . . . . . . . . . . . 12 (((𝐴 ∈ Word 𝑉𝑀 ∈ (0...(𝐿 + 0))) ∧ ¬ 𝐿𝑀) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
7763, 76ifeqda 4495 . . . . . . . . . . 11 ((𝐴 ∈ Word 𝑉𝑀 ∈ (0...(𝐿 + 0))) → if(𝐿𝑀, (∅ substr ⟨(𝑀𝐿), 0⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅)) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
7877ex 413 . . . . . . . . . 10 (𝐴 ∈ Word 𝑉 → (𝑀 ∈ (0...(𝐿 + 0)) → if(𝐿𝑀, (∅ substr ⟨(𝑀𝐿), 0⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅)) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩)))
7978ad3antrrr 727 . . . . . . . . 9 ((((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (♯‘𝐵) = 0) ∧ 𝐵 = ∅) → (𝑀 ∈ (0...(𝐿 + 0)) → if(𝐿𝑀, (∅ substr ⟨(𝑀𝐿), 0⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅)) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩)))
80 oveq2 7283 . . . . . . . . . . . . . 14 ((♯‘𝐵) = 0 → (𝐿 + (♯‘𝐵)) = (𝐿 + 0))
8180oveq2d 7291 . . . . . . . . . . . . 13 ((♯‘𝐵) = 0 → (0...(𝐿 + (♯‘𝐵))) = (0...(𝐿 + 0)))
8281eleq2d 2824 . . . . . . . . . . . 12 ((♯‘𝐵) = 0 → (𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) ↔ 𝑀 ∈ (0...(𝐿 + 0))))
8382adantr 481 . . . . . . . . . . 11 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → (𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) ↔ 𝑀 ∈ (0...(𝐿 + 0))))
84 simpr 485 . . . . . . . . . . . . . 14 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → 𝐵 = ∅)
85 opeq2 4805 . . . . . . . . . . . . . . 15 ((♯‘𝐵) = 0 → ⟨(𝑀𝐿), (♯‘𝐵)⟩ = ⟨(𝑀𝐿), 0⟩)
8685adantr 481 . . . . . . . . . . . . . 14 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → ⟨(𝑀𝐿), (♯‘𝐵)⟩ = ⟨(𝑀𝐿), 0⟩)
8784, 86oveq12d 7293 . . . . . . . . . . . . 13 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩) = (∅ substr ⟨(𝑀𝐿), 0⟩))
88 oveq2 7283 . . . . . . . . . . . . . 14 (𝐵 = ∅ → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵) = ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅))
8988adantl 482 . . . . . . . . . . . . 13 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵) = ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅))
9087, 89ifeq12d 4480 . . . . . . . . . . . 12 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = if(𝐿𝑀, (∅ substr ⟨(𝑀𝐿), 0⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ ∅)))
9180opeq2d 4811 . . . . . . . . . . . . . 14 ((♯‘𝐵) = 0 → ⟨𝑀, (𝐿 + (♯‘𝐵))⟩ = ⟨𝑀, (𝐿 + 0)⟩)
9291oveq2d 7291 . . . . . . . . . . . . 13 ((♯‘𝐵) = 0 → (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
9392adantr 481 . . . . . . . . . . . 12 (((♯‘𝐵) = 0 ∧ 𝐵 = ∅) → (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩) = (𝐴 substr ⟨𝑀, (𝐿 + 0)⟩))
9490, 93eqeq12d 2754 . . . . . . . . . . 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 711 . . . . . . . . 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 684 . . . . . . 7 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (♯‘𝐵) = 0) → (𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩)))
9998ex 413 . . . . . 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 407 . . 3 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) → ((♯‘𝐵) ≤ 0 → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩)))
103102adantr 481 . 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 12294 . . . . . 6 (𝐵 ∈ Word 𝑉 → (♯‘𝐵) ∈ ℝ)
108 leaddle0 11490 . . . . . 6 ((𝐿 ∈ ℝ ∧ (♯‘𝐵) ∈ ℝ) → ((𝐿 + (♯‘𝐵)) ≤ 𝐿 ↔ (♯‘𝐵) ≤ 0))
109106, 107, 108syl2an 596 . . . . 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 481 . . 3 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) → ((𝐿 + (♯‘𝐵)) ≤ 𝐿 → (¬ (♯‘𝐵) ≤ 0 → if(𝐿𝑀, (𝐵 substr ⟨(𝑀𝐿), (♯‘𝐵)⟩), ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ 𝐵)) = (𝐴 substr ⟨𝑀, (𝐿 + (♯‘𝐵))⟩))))
113112imp 407 . 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 396  w3a 1086   = wceq 1539  wcel 2106  c0 4256  ifcif 4459  cop 4567   class class class wbr 5074  cfv 6433  (class class class)co 7275  cc 10869  cr 10870  0cc0 10871   + caddc 10874  cle 11010  cmin 11205  0cn0 12233  ...cfz 13239  chash 14044  Word cword 14217   ++ cconcat 14273   substr csubstr 14353
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 1913  ax-6 1971  ax-7 2011  ax-8 2108  ax-9 2116  ax-10 2137  ax-11 2154  ax-12 2171  ax-ext 2709  ax-rep 5209  ax-sep 5223  ax-nul 5230  ax-pow 5288  ax-pr 5352  ax-un 7588  ax-cnex 10927  ax-resscn 10928  ax-1cn 10929  ax-icn 10930  ax-addcl 10931  ax-addrcl 10932  ax-mulcl 10933  ax-mulrcl 10934  ax-mulcom 10935  ax-addass 10936  ax-mulass 10937  ax-distr 10938  ax-i2m1 10939  ax-1ne0 10940  ax-1rid 10941  ax-rnegex 10942  ax-rrecex 10943  ax-cnre 10944  ax-pre-lttri 10945  ax-pre-lttrn 10946  ax-pre-ltadd 10947  ax-pre-mulgt0 10948
This theorem depends on definitions:  df-bi 206  df-an 397  df-or 845  df-3or 1087  df-3an 1088  df-tru 1542  df-fal 1552  df-ex 1783  df-nf 1787  df-sb 2068  df-mo 2540  df-eu 2569  df-clab 2716  df-cleq 2730  df-clel 2816  df-nfc 2889  df-ne 2944  df-nel 3050  df-ral 3069  df-rex 3070  df-reu 3072  df-rab 3073  df-v 3434  df-sbc 3717  df-csb 3833  df-dif 3890  df-un 3892  df-in 3894  df-ss 3904  df-pss 3906  df-nul 4257  df-if 4460  df-pw 4535  df-sn 4562  df-pr 4564  df-op 4568  df-uni 4840  df-int 4880  df-iun 4926  df-br 5075  df-opab 5137  df-mpt 5158  df-tr 5192  df-id 5489  df-eprel 5495  df-po 5503  df-so 5504  df-fr 5544  df-we 5546  df-xp 5595  df-rel 5596  df-cnv 5597  df-co 5598  df-dm 5599  df-rn 5600  df-res 5601  df-ima 5602  df-pred 6202  df-ord 6269  df-on 6270  df-lim 6271  df-suc 6272  df-iota 6391  df-fun 6435  df-fn 6436  df-f 6437  df-f1 6438  df-fo 6439  df-f1o 6440  df-fv 6441  df-riota 7232  df-ov 7278  df-oprab 7279  df-mpo 7280  df-om 7713  df-1st 7831  df-2nd 7832  df-frecs 8097  df-wrecs 8128  df-recs 8202  df-rdg 8241  df-1o 8297  df-er 8498  df-en 8734  df-dom 8735  df-sdom 8736  df-fin 8737  df-card 9697  df-pnf 11011  df-mnf 11012  df-xr 11013  df-ltxr 11014  df-le 11015  df-sub 11207  df-neg 11208  df-nn 11974  df-n0 12234  df-z 12320  df-uz 12583  df-fz 13240  df-fzo 13383  df-hash 14045  df-word 14218  df-concat 14274  df-substr 14354
This theorem is referenced by:  swrdccat3b  14453
  Copyright terms: Public domain W3C validator