![]() |
Metamath
Proof Explorer Theorem List (p. 135 of 426) | < Previous Next > |
Bad symbols? Try the
GIF version. |
||
Mirrors > Metamath Home Page > MPE Home Page > Theorem List Contents > Recent Proofs This page: Page List |
Color key: | ![]() (1-27775) |
![]() (27776-29300) |
![]() (29301-42551) |
Type | Label | Description |
---|---|---|
Statement | ||
Theorem | ccatw2s1cl 13401 | The concatenation of a word with two singleton words is a word. (Contributed by Alexander van der Vekens, 22-Sep-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑋 ∈ 𝑉 ∧ 𝑌 ∈ 𝑉) → ((𝑊 ++ 〈“𝑋”〉) ++ 〈“𝑌”〉) ∈ Word 𝑉) | ||
Theorem | ccatw2s1len 13402 | The length of the concatenation of a word with two singleton words. (Contributed by Alexander van der Vekens, 22-Sep-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑋 ∈ 𝑉 ∧ 𝑌 ∈ 𝑉) → (#‘((𝑊 ++ 〈“𝑋”〉) ++ 〈“𝑌”〉)) = ((#‘𝑊) + 2)) | ||
Theorem | ccats1val1 13403 | Value of a symbol in the left half of a word concatenated with a single symbol. (Contributed by Alexander van der Vekens, 5-Aug-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑆 ∈ 𝑉 ∧ 𝐼 ∈ (0..^(#‘𝑊))) → ((𝑊 ++ 〈“𝑆”〉)‘𝐼) = (𝑊‘𝐼)) | ||
Theorem | ccats1val2 13404 | Value of the symbol concatenated with a word. (Contributed by Alexander van der Vekens, 5-Aug-2018.) (Proof shortened by Alexander van der Vekens, 14-Oct-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑆 ∈ 𝑉 ∧ 𝐼 = (#‘𝑊)) → ((𝑊 ++ 〈“𝑆”〉)‘𝐼) = 𝑆) | ||
Theorem | ccat2s1p1 13405 | Extract the first of two concatenated singleton words. (Contributed by Alexander van der Vekens, 22-Sep-2018.) |
⊢ ((𝑋 ∈ 𝑉 ∧ 𝑌 ∈ 𝑉) → ((〈“𝑋”〉 ++ 〈“𝑌”〉)‘0) = 𝑋) | ||
Theorem | ccat2s1p2 13406 | Extract the second of two concatenated singleton words. (Contributed by Alexander van der Vekens, 22-Sep-2018.) |
⊢ ((𝑋 ∈ 𝑉 ∧ 𝑌 ∈ 𝑉) → ((〈“𝑋”〉 ++ 〈“𝑌”〉)‘1) = 𝑌) | ||
Theorem | ccatw2s1ass 13407 | Associative law for a concatenation of a word with two singleton words. (Contributed by Alexander van der Vekens, 22-Sep-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑋 ∈ 𝑉 ∧ 𝑌 ∈ 𝑉) → ((𝑊 ++ 〈“𝑋”〉) ++ 〈“𝑌”〉) = (𝑊 ++ (〈“𝑋”〉 ++ 〈“𝑌”〉))) | ||
Theorem | ccatws1lenrevOLD 13408 | Obsolete theorem as of 24-Jun-2022. Use wrdlenccats1lenm1 13399 instead. The length of a word concatenated with a singleton word. (Contributed by Alexander van der Vekens, 3-Oct-2018.) (New usage is discouraged.) (Proof modification is discouraged.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑋 ∈ 𝑉) → ((#‘(𝑊 ++ 〈“𝑋”〉)) = 𝑁 → (#‘𝑊) = (𝑁 − 1))) | ||
Theorem | ccatws1n0 13409 | The concatenation of a word with a singleton word is not the empty set. (Contributed by Alexander van der Vekens, 29-Sep-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑋 ∈ 𝑉) → (𝑊 ++ 〈“𝑋”〉) ≠ ∅) | ||
Theorem | ccatws1ls 13410 | The last symbol of the concatenation of a word with a singleton word is the symbol of the singleton word. (Contributed by AV, 29-Sep-2018.) (Proof shortened by AV, 14-Oct-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑋 ∈ 𝑉) → ((𝑊 ++ 〈“𝑋”〉)‘(#‘𝑊)) = 𝑋) | ||
Theorem | lswccats1 13411 | The last symbol of a word concatenated with a singleton word is the symbol of the singleton word. (Contributed by AV, 6-Aug-2018.) (Proof shortened by AV, 22-Oct-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑆 ∈ 𝑉) → ( lastS ‘(𝑊 ++ 〈“𝑆”〉)) = 𝑆) | ||
Theorem | lswccats1fst 13412 | The last symbol of a nonempty word concatenated with its first symbol is the first symbol. (Contributed by AV, 28-Jun-2018.) (Proof shortened by AV, 1-May-2020.) |
⊢ ((𝑃 ∈ Word 𝑉 ∧ 1 ≤ (#‘𝑃)) → ( lastS ‘(𝑃 ++ 〈“(𝑃‘0)”〉)) = ((𝑃 ++ 〈“(𝑃‘0)”〉)‘0)) | ||
Theorem | ccatw2s1p1 13413 | Extract the symbol of the first singleton word of a word concatenated with this singleton word and another singleton word. (Contributed by Alexander van der Vekens, 22-Sep-2018.) (Proof shortened by AV, 1-May-2020.) |
⊢ (((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) = 𝑁) ∧ (𝑋 ∈ 𝑉 ∧ 𝑌 ∈ 𝑉)) → (((𝑊 ++ 〈“𝑋”〉) ++ 〈“𝑌”〉)‘𝑁) = 𝑋) | ||
Theorem | ccatw2s1p2 13414 | Extract the second of two single symbols concatenated with a word. (Contributed by Alexander van der Vekens, 22-Sep-2018.) (Proof shortened by AV, 1-May-2020.) |
⊢ (((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) = 𝑁) ∧ (𝑋 ∈ 𝑉 ∧ 𝑌 ∈ 𝑉)) → (((𝑊 ++ 〈“𝑋”〉) ++ 〈“𝑌”〉)‘(𝑁 + 1)) = 𝑌) | ||
Theorem | ccat2s1fvw 13415 | Extract a symbol of a word from the concatenation of the word with two single symbols. (Contributed by AV, 22-Sep-2018.) (Revised by AV, 13-Jan-2020.) (Proof shortened by AV, 1-May-2020.) |
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝐼 ∈ ℕ0 ∧ 𝐼 < (#‘𝑊)) ∧ (𝑋 ∈ 𝑉 ∧ 𝑌 ∈ 𝑉)) → (((𝑊 ++ 〈“𝑋”〉) ++ 〈“𝑌”〉)‘𝐼) = (𝑊‘𝐼)) | ||
Theorem | ccat2s1fst 13416 | The first symbol of the concatenation of a word with two single symbols. (Contributed by Alexander van der Vekens, 22-Sep-2018.) |
⊢ (((𝑊 ∈ Word 𝑉 ∧ 0 < (#‘𝑊)) ∧ (𝑋 ∈ 𝑉 ∧ 𝑌 ∈ 𝑉)) → (((𝑊 ++ 〈“𝑋”〉) ++ 〈“𝑌”〉)‘0) = (𝑊‘0)) | ||
Theorem | swrdval 13417* | Value of a subword. (Contributed by Stefan O'Rear, 15-Aug-2015.) |
⊢ ((𝑆 ∈ 𝑉 ∧ 𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → (𝑆 substr 〈𝐹, 𝐿〉) = if((𝐹..^𝐿) ⊆ dom 𝑆, (𝑥 ∈ (0..^(𝐿 − 𝐹)) ↦ (𝑆‘(𝑥 + 𝐹))), ∅)) | ||
Theorem | swrd00 13418 | A zero length substring. (Contributed by Stefan O'Rear, 27-Aug-2015.) |
⊢ (𝑆 substr 〈𝑋, 𝑋〉) = ∅ | ||
Theorem | swrdcl 13419 | Closure of the subword extractor. (Contributed by Stefan O'Rear, 16-Aug-2015.) (Revised by Mario Carneiro, 26-Feb-2016.) |
⊢ (𝑆 ∈ Word 𝐴 → (𝑆 substr 〈𝐹, 𝐿〉) ∈ Word 𝐴) | ||
Theorem | swrdval2 13420* | Value of the subword extractor in its intended domain. (Contributed by Stefan O'Rear, 15-Aug-2015.) (Proof shortened by AV, 2-May-2020.) |
⊢ ((𝑆 ∈ Word 𝐴 ∧ 𝐹 ∈ (0...𝐿) ∧ 𝐿 ∈ (0...(#‘𝑆))) → (𝑆 substr 〈𝐹, 𝐿〉) = (𝑥 ∈ (0..^(𝐿 − 𝐹)) ↦ (𝑆‘(𝑥 + 𝐹)))) | ||
Theorem | swrd0val 13421 | Value of the subword extractor for left-anchored subwords. (Contributed by Stefan O'Rear, 24-Aug-2015.) |
⊢ ((𝑆 ∈ Word 𝐴 ∧ 𝐿 ∈ (0...(#‘𝑆))) → (𝑆 substr 〈0, 𝐿〉) = (𝑆 ↾ (0..^𝐿))) | ||
Theorem | swrd0len 13422 | Length of a left-anchored subword. (Contributed by Stefan O'Rear, 24-Aug-2015.) |
⊢ ((𝑆 ∈ Word 𝐴 ∧ 𝐿 ∈ (0...(#‘𝑆))) → (#‘(𝑆 substr 〈0, 𝐿〉)) = 𝐿) | ||
Theorem | swrdlen 13423 | Length of an extracted subword. (Contributed by Stefan O'Rear, 16-Aug-2015.) |
⊢ ((𝑆 ∈ Word 𝐴 ∧ 𝐹 ∈ (0...𝐿) ∧ 𝐿 ∈ (0...(#‘𝑆))) → (#‘(𝑆 substr 〈𝐹, 𝐿〉)) = (𝐿 − 𝐹)) | ||
Theorem | swrdfv 13424 | A symbol in an extracted subword, indexed using the subword's indices. (Contributed by Stefan O'Rear, 16-Aug-2015.) |
⊢ (((𝑆 ∈ Word 𝐴 ∧ 𝐹 ∈ (0...𝐿) ∧ 𝐿 ∈ (0...(#‘𝑆))) ∧ 𝑋 ∈ (0..^(𝐿 − 𝐹))) → ((𝑆 substr 〈𝐹, 𝐿〉)‘𝑋) = (𝑆‘(𝑋 + 𝐹))) | ||
Theorem | swrdf 13425 | A subword of a word is a function from a half-open range of nonnegative integers of the same length as the subword to the set of symbols for the original word. (Contributed by AV, 13-Nov-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) → (𝑊 substr 〈𝑀, 𝑁〉):(0..^(𝑁 − 𝑀))⟶𝑉) | ||
Theorem | swrdvalfn 13426 | Value of the subword extractor as function with domain. (Contributed by Alexander van der Vekens, 28-Mar-2018.) (Proof shortened by AV, 2-May-2020.) |
⊢ ((𝑆 ∈ Word 𝑉 ∧ 𝐹 ∈ (0...𝐿) ∧ 𝐿 ∈ (0...(#‘𝑆))) → (𝑆 substr 〈𝐹, 𝐿〉) Fn (0..^(𝐿 − 𝐹))) | ||
Theorem | swrd0f 13427 | A left-anchored subword of a word is a function from a half-open range of nonnegative integers of the same length as the subword to the set of symbols for the original word. (Contributed by AV, 2-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ (0...(#‘𝑊))) → (𝑊 substr 〈0, 𝑁〉):(0..^𝑁)⟶𝑉) | ||
Theorem | swrdid 13428 | A word is a subword of itself. (Contributed by Stefan O'Rear, 16-Aug-2015.) (Proof shortened by AV, 2-May-2020.) |
⊢ (𝑆 ∈ Word 𝐴 → (𝑆 substr 〈0, (#‘𝑆)〉) = 𝑆) | ||
Theorem | swrdrn 13429 | The range of a subword of a word is a subset of the set of symbols for the word. (Contributed by AV, 13-Nov-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝑊))) → ran (𝑊 substr 〈𝑀, 𝑁〉) ⊆ 𝑉) | ||
Theorem | swrdn0 13430 | A prefixing subword consisting of at least one symbol is not empty. (Contributed by Alexander van der Vekens, 4-Aug-2018.) (Proof shortened by AV, 2-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ ℕ ∧ 𝑁 ≤ (#‘𝑊)) → (𝑊 substr 〈0, 𝑁〉) ≠ ∅) | ||
Theorem | swrdlend 13431 | The value of the subword extractor is the empty set (undefined) if the range is not valid. (Contributed by Alexander van der Vekens, 16-Mar-2018.) (Proof shortened by AV, 2-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → (𝐿 ≤ 𝐹 → (𝑊 substr 〈𝐹, 𝐿〉) = ∅)) | ||
Theorem | swrdnd 13432 | The value of the subword extractor is the empty set (undefined) if the range is not valid. (Contributed by Alexander van der Vekens, 16-Mar-2018.) (Proof shortened by AV, 2-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐹 ∈ ℤ ∧ 𝐿 ∈ ℤ) → ((𝐹 < 0 ∨ 𝐿 ≤ 𝐹 ∨ (#‘𝑊) < 𝐿) → (𝑊 substr 〈𝐹, 𝐿〉) = ∅)) | ||
Theorem | swrdnd2 13433 | Value of the subword extractor outside its intended domain. (Contributed by Alexander van der Vekens, 24-May-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ) → ((𝐵 ≤ 𝐴 ∨ (#‘𝑊) ≤ 𝐴 ∨ 𝐵 ≤ 0) → (𝑊 substr 〈𝐴, 𝐵〉) = ∅)) | ||
Theorem | swrd0 13434 | A subword of an empty set is always the empty set. (Contributed by AV, 31-Mar-2018.) (Revised by AV, 20-Oct-2018.) (Proof shortened by AV, 2-May-2020.) |
⊢ (∅ substr 〈𝐹, 𝐿〉) = ∅ | ||
Theorem | swrdrlen 13435 | Length of a right-anchored subword. (Contributed by Alexander van der Vekens, 5-Apr-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐼 ∈ (0...(#‘𝑊))) → (#‘(𝑊 substr 〈𝐼, (#‘𝑊)〉)) = ((#‘𝑊) − 𝐼)) | ||
Theorem | swrd0len0 13436 | Length of a prefix of a word reduced by a single symbol, analogous to swrd0len 13422. (Contributed by AV, 4-Aug-2018.) (Proof shortened by AV, 14-Oct-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ ℕ0 ∧ (#‘𝑊) = (𝑁 + 1)) → (#‘(𝑊 substr 〈0, 𝑁〉)) = 𝑁) | ||
Theorem | addlenrevswrd 13437 | The sum of the lengths of two reversed parts of a word is the length of the word. (Contributed by Alexander van der Vekens, 1-Apr-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑀 ∈ (0...(#‘𝑊))) → ((#‘(𝑊 substr 〈𝑀, (#‘𝑊)〉)) + (#‘(𝑊 substr 〈0, 𝑀〉))) = (#‘𝑊)) | ||
Theorem | addlenswrd 13438 | The sum of the lengths of two parts of a word is the length of the word. (Contributed by AV, 21-Oct-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑀 ∈ (0...(#‘𝑊))) → ((#‘(𝑊 substr 〈0, 𝑀〉)) + (#‘(𝑊 substr 〈𝑀, (#‘𝑊)〉))) = (#‘𝑊)) | ||
Theorem | swrd0fv 13439 | A symbol in an left-anchored subword, indexed using the subword's indices. (Contributed by Alexander van der Vekens, 16-Jun-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐿 ∈ (0...(#‘𝑊)) ∧ 𝐼 ∈ (0..^𝐿)) → ((𝑊 substr 〈0, 𝐿〉)‘𝐼) = (𝑊‘𝐼)) | ||
Theorem | swrd0fv0 13440 | The first symbol in a left-anchored subword. (Contributed by Alexander van der Vekens, 16-Jun-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐼 ∈ (1...(#‘𝑊))) → ((𝑊 substr 〈0, 𝐼〉)‘0) = (𝑊‘0)) | ||
Theorem | swrdtrcfv 13441 | A symbol in a word truncated by one symbol. (Contributed by Alexander van der Vekens, 16-Jun-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑊 ≠ ∅ ∧ 𝐼 ∈ (0..^((#‘𝑊) − 1))) → ((𝑊 substr 〈0, ((#‘𝑊) − 1)〉)‘𝐼) = (𝑊‘𝐼)) | ||
Theorem | swrdtrcfv0 13442 | The first symbol in a word truncated by one symbol. (Contributed by Alexander van der Vekens, 16-Jun-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 2 ≤ (#‘𝑊)) → ((𝑊 substr 〈0, ((#‘𝑊) − 1)〉)‘0) = (𝑊‘0)) | ||
Theorem | swrd0fvlsw 13443 | The last symbol in a left-anchored subword. (Contributed by Alexander van der Vekens, 24-Jun-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐿 ∈ (1...(#‘𝑊))) → ( lastS ‘(𝑊 substr 〈0, 𝐿〉)) = (𝑊‘(𝐿 − 1))) | ||
Theorem | swrdeq 13444* | Two subwords of words are equal iff they have the same length and the same symbols at each position. (Contributed by Alexander van der Vekens, 7-Aug-2018.) |
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉) ∧ (𝑀 ∈ ℕ0 ∧ 𝑁 ∈ ℕ0) ∧ (𝑀 ≤ (#‘𝑊) ∧ 𝑁 ≤ (#‘𝑈))) → ((𝑊 substr 〈0, 𝑀〉) = (𝑈 substr 〈0, 𝑁〉) ↔ (𝑀 = 𝑁 ∧ ∀𝑖 ∈ (0..^𝑀)(𝑊‘𝑖) = (𝑈‘𝑖)))) | ||
Theorem | swrdlen2 13445 | Length of an extracted subword. (Contributed by AV, 5-May-2020.) |
⊢ ((𝑆 ∈ Word 𝑉 ∧ (𝐹 ∈ ℕ0 ∧ 𝐿 ∈ (ℤ≥‘𝐹)) ∧ 𝐿 ≤ (#‘𝑆)) → (#‘(𝑆 substr 〈𝐹, 𝐿〉)) = (𝐿 − 𝐹)) | ||
Theorem | swrdfv2 13446 | A symbol in an extracted subword, indexed using the word's indices. (Contributed by AV, 5-May-2020.) |
⊢ (((𝑆 ∈ Word 𝑉 ∧ (𝐹 ∈ ℕ0 ∧ 𝐿 ∈ (ℤ≥‘𝐹)) ∧ 𝐿 ≤ (#‘𝑆)) ∧ 𝑋 ∈ (𝐹..^𝐿)) → ((𝑆 substr 〈𝐹, 𝐿〉)‘(𝑋 − 𝐹)) = (𝑆‘𝑋)) | ||
Theorem | swrdsb0eq 13447 | Two subwords with the same bounds are equal if the range is not valid. (Contributed by AV, 4-May-2020.) |
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉) ∧ (𝑀 ∈ ℕ0 ∧ 𝑁 ∈ ℕ0) ∧ 𝑁 ≤ 𝑀) → (𝑊 substr 〈𝑀, 𝑁〉) = (𝑈 substr 〈𝑀, 𝑁〉)) | ||
Theorem | swrdsbslen 13448 | Two subwords with the same bounds have the same length. (Contributed by AV, 4-May-2020.) |
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉) ∧ (𝑀 ∈ ℕ0 ∧ 𝑁 ∈ ℕ0) ∧ (𝑁 ≤ (#‘𝑊) ∧ 𝑁 ≤ (#‘𝑈))) → (#‘(𝑊 substr 〈𝑀, 𝑁〉)) = (#‘(𝑈 substr 〈𝑀, 𝑁〉))) | ||
Theorem | swrdspsleq 13449* | Two words have a common subword (starting at the same position with the same length) iff they have the same symbols at each position. (Contributed by Alexander van der Vekens, 7-Aug-2018.) (Proof shortened by AV, 7-May-2020.) |
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉) ∧ (𝑀 ∈ ℕ0 ∧ 𝑁 ∈ ℕ0) ∧ (𝑁 ≤ (#‘𝑊) ∧ 𝑁 ≤ (#‘𝑈))) → ((𝑊 substr 〈𝑀, 𝑁〉) = (𝑈 substr 〈𝑀, 𝑁〉) ↔ ∀𝑖 ∈ (𝑀..^𝑁)(𝑊‘𝑖) = (𝑈‘𝑖))) | ||
Theorem | swrdtrcfvl 13450 | The last symbol in a word truncated by one symbol. (Contributed by AV, 16-Jun-2018.) (Proof shortened by Mario Carneiro/AV, 14-Oct-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 2 ≤ (#‘𝑊)) → ( lastS ‘(𝑊 substr 〈0, ((#‘𝑊) − 1)〉)) = (𝑊‘((#‘𝑊) − 2))) | ||
Theorem | swrds1 13451 | Extract a single symbol from a word. (Contributed by Stefan O'Rear, 23-Aug-2015.) |
⊢ ((𝑊 ∈ Word 𝐴 ∧ 𝐼 ∈ (0..^(#‘𝑊))) → (𝑊 substr 〈𝐼, (𝐼 + 1)〉) = 〈“(𝑊‘𝐼)”〉) | ||
Theorem | swrdlsw 13452 | Extract the last single symbol from a word. (Contributed by Alexander van der Vekens, 23-Sep-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑊 ≠ ∅) → (𝑊 substr 〈((#‘𝑊) − 1), (#‘𝑊)〉) = 〈“( lastS ‘𝑊)”〉) | ||
Theorem | 2swrdeqwrdeq 13453 | Two words are equal if and only if they have the same prefix and the same suffix. (Contributed by Alexander van der Vekens, 23-Sep-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑆 ∈ Word 𝑉 ∧ 𝐼 ∈ (0..^(#‘𝑊))) → (𝑊 = 𝑆 ↔ ((#‘𝑊) = (#‘𝑆) ∧ ((𝑊 substr 〈0, 𝐼〉) = (𝑆 substr 〈0, 𝐼〉) ∧ (𝑊 substr 〈𝐼, (#‘𝑊)〉) = (𝑆 substr 〈𝐼, (#‘𝑊)〉))))) | ||
Theorem | 2swrd1eqwrdeq 13454 | Two (nonempty) words are equal if and only if they have the same prefix and the same single symbol suffix. (Contributed by Alexander van der Vekens, 23-Sep-2018.) (Revised by Mario Carneiro/AV, 23-Oct-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑊)) → (𝑊 = 𝑈 ↔ ((#‘𝑊) = (#‘𝑈) ∧ ((𝑊 substr 〈0, ((#‘𝑊) − 1)〉) = (𝑈 substr 〈0, ((#‘𝑊) − 1)〉) ∧ ( lastS ‘𝑊) = ( lastS ‘𝑈))))) | ||
Theorem | disjxwrd 13455* | Sets of words are disjoint if each set contains extensions of distinct words of a fixed length. (Contributed by AV, 29-Jul-2018.) (Proof shortened by AV, 7-May-2020.) |
⊢ Disj 𝑦 ∈ 𝑊 {𝑥 ∈ Word 𝑉 ∣ (𝑥 substr 〈0, 𝑁〉) = 𝑦} | ||
Theorem | ccatswrd 13456 | Joining two adjacent subwords makes a longer subword. (Contributed by Stefan O'Rear, 20-Aug-2015.) |
⊢ ((𝑆 ∈ Word 𝐴 ∧ (𝑋 ∈ (0...𝑌) ∧ 𝑌 ∈ (0...𝑍) ∧ 𝑍 ∈ (0...(#‘𝑆)))) → ((𝑆 substr 〈𝑋, 𝑌〉) ++ (𝑆 substr 〈𝑌, 𝑍〉)) = (𝑆 substr 〈𝑋, 𝑍〉)) | ||
Theorem | swrdccat1 13457 | Recover the left half of a concatenated word. (Contributed by Mario Carneiro, 27-Sep-2015.) |
⊢ ((𝑆 ∈ Word 𝐵 ∧ 𝑇 ∈ Word 𝐵) → ((𝑆 ++ 𝑇) substr 〈0, (#‘𝑆)〉) = 𝑆) | ||
Theorem | swrdccat2 13458 | Recover the right half of a concatenated word. (Contributed by Mario Carneiro, 27-Sep-2015.) |
⊢ ((𝑆 ∈ Word 𝐵 ∧ 𝑇 ∈ Word 𝐵) → ((𝑆 ++ 𝑇) substr 〈(#‘𝑆), ((#‘𝑆) + (#‘𝑇))〉) = 𝑇) | ||
Theorem | swrdswrdlem 13459 | Lemma for swrdswrd 13460. (Contributed by Alexander van der Vekens, 4-Apr-2018.) |
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ (0...(#‘𝑊)) ∧ 𝑀 ∈ (0...𝑁)) ∧ (𝐾 ∈ (0...(𝑁 − 𝑀)) ∧ 𝐿 ∈ (𝐾...(𝑁 − 𝑀)))) → (𝑊 ∈ Word 𝑉 ∧ (𝑀 + 𝐾) ∈ (0...(𝑀 + 𝐿)) ∧ (𝑀 + 𝐿) ∈ (0...(#‘𝑊)))) | ||
Theorem | swrdswrd 13460 | A subword of a subword. (Contributed by Alexander van der Vekens, 4-Apr-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ (0...(#‘𝑊)) ∧ 𝑀 ∈ (0...𝑁)) → ((𝐾 ∈ (0...(𝑁 − 𝑀)) ∧ 𝐿 ∈ (𝐾...(𝑁 − 𝑀))) → ((𝑊 substr 〈𝑀, 𝑁〉) substr 〈𝐾, 𝐿〉) = (𝑊 substr 〈(𝑀 + 𝐾), (𝑀 + 𝐿)〉))) | ||
Theorem | swrd0swrd 13461 | A prefix of a subword. (Contributed by AV, 2-Apr-2018.) (Proof shortened by AV, 21-Oct-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ (0...(#‘𝑊)) ∧ 𝑀 ∈ (0...𝑁)) → (𝐿 ∈ (0...(𝑁 − 𝑀)) → ((𝑊 substr 〈𝑀, 𝑁〉) substr 〈0, 𝐿〉) = (𝑊 substr 〈𝑀, (𝑀 + 𝐿)〉))) | ||
Theorem | swrdswrd0 13462 | A subword of a prefix. (Contributed by Alexander van der Vekens, 6-Apr-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ (0...(#‘𝑊))) → ((𝐾 ∈ (0...𝑁) ∧ 𝐿 ∈ (𝐾...𝑁)) → ((𝑊 substr 〈0, 𝑁〉) substr 〈𝐾, 𝐿〉) = (𝑊 substr 〈𝐾, 𝐿〉))) | ||
Theorem | swrd0swrd0 13463 | A prefix of a prefix. (Contributed by Alexander van der Vekens, 7-Apr-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ (0...(#‘𝑊)) ∧ 𝐿 ∈ (0...𝑁)) → ((𝑊 substr 〈0, 𝑁〉) substr 〈0, 𝐿〉) = (𝑊 substr 〈0, 𝐿〉)) | ||
Theorem | swrd0swrdid 13464 | A prefix of a prefix with the same length is the prefix. (Contributed by AV, 5-Apr-2018.) (Proof shortened by AV, 14-Oct-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ (0...(#‘𝑊))) → ((𝑊 substr 〈0, 𝑁〉) substr 〈0, 𝑁〉) = (𝑊 substr 〈0, 𝑁〉)) | ||
Theorem | wrdcctswrd 13465 | The concatenation of two parts of a word yields the word itself. (Contributed by AV, 21-Oct-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑀 ∈ (0...(#‘𝑊))) → ((𝑊 substr 〈0, 𝑀〉) ++ (𝑊 substr 〈𝑀, (#‘𝑊)〉)) = 𝑊) | ||
Theorem | lencctswrd 13466 | The length of two concatenated parts of a word is the length of the word. (Contributed by AV, 21-Oct-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑀 ∈ (0...(#‘𝑊))) → (#‘((𝑊 substr 〈0, 𝑀〉) ++ (𝑊 substr 〈𝑀, (#‘𝑊)〉))) = (#‘𝑊)) | ||
Theorem | lenrevcctswrd 13467 | The length of two reversely concatenated parts of a word is the length of the word. (Contributed by Alexander van der Vekens, 1-Apr-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑀 ∈ (0...(#‘𝑊))) → (#‘((𝑊 substr 〈𝑀, (#‘𝑊)〉) ++ (𝑊 substr 〈0, 𝑀〉))) = (#‘𝑊)) | ||
Theorem | swrdccatwrd 13468 | Reconstruct a nonempty word from its prefix and last symbol. (Contributed by Alexander van der Vekens, 5-Aug-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑊 ≠ ∅) → ((𝑊 substr 〈0, ((#‘𝑊) − 1)〉) ++ 〈“( lastS ‘𝑊)”〉) = 𝑊) | ||
Theorem | ccats1swrdeq 13469 | The last symbol of a word concatenated with the subword of the word having length less by 1 than the word results in the word itself. (Contributed by Alexander van der Vekens, 24-Oct-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ (#‘𝑈) = ((#‘𝑊) + 1)) → (𝑊 = (𝑈 substr 〈0, (#‘𝑊)〉) → 𝑈 = (𝑊 ++ 〈“( lastS ‘𝑈)”〉))) | ||
Theorem | ccatopth 13470 | An opth 4945-like theorem for recovering the two halves of a concatenated word. (Contributed by Mario Carneiro, 1-Oct-2015.) |
⊢ (((𝐴 ∈ Word 𝑋 ∧ 𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋 ∧ 𝐷 ∈ Word 𝑋) ∧ (#‘𝐴) = (#‘𝐶)) → ((𝐴 ++ 𝐵) = (𝐶 ++ 𝐷) ↔ (𝐴 = 𝐶 ∧ 𝐵 = 𝐷))) | ||
Theorem | ccatopth2 13471 | An opth 4945-like theorem for recovering the two halves of a concatenated word. (Contributed by Mario Carneiro, 1-Oct-2015.) |
⊢ (((𝐴 ∈ Word 𝑋 ∧ 𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋 ∧ 𝐷 ∈ Word 𝑋) ∧ (#‘𝐵) = (#‘𝐷)) → ((𝐴 ++ 𝐵) = (𝐶 ++ 𝐷) ↔ (𝐴 = 𝐶 ∧ 𝐵 = 𝐷))) | ||
Theorem | ccatlcan 13472 | Concatenation of words is left-cancellative. (Contributed by Mario Carneiro, 2-Oct-2015.) |
⊢ ((𝐴 ∈ Word 𝑋 ∧ 𝐵 ∈ Word 𝑋 ∧ 𝐶 ∈ Word 𝑋) → ((𝐶 ++ 𝐴) = (𝐶 ++ 𝐵) ↔ 𝐴 = 𝐵)) | ||
Theorem | ccatrcan 13473 | Concatenation of words is right-cancellative. (Contributed by Mario Carneiro, 2-Oct-2015.) |
⊢ ((𝐴 ∈ Word 𝑋 ∧ 𝐵 ∈ Word 𝑋 ∧ 𝐶 ∈ Word 𝑋) → ((𝐴 ++ 𝐶) = (𝐵 ++ 𝐶) ↔ 𝐴 = 𝐵)) | ||
Theorem | wrdeqs1cat 13474 | Decompose a nonempty word by separating off the first symbol. (Contributed by Stefan O'Rear, 25-Aug-2015.) (Revised by Mario Carneiro, 1-Oct-2015.) (Proof shortened by AV, 9-May-2020.) |
⊢ ((𝑊 ∈ Word 𝐴 ∧ 𝑊 ≠ ∅) → 𝑊 = (〈“(𝑊‘0)”〉 ++ (𝑊 substr 〈1, (#‘𝑊)〉))) | ||
Theorem | cats1un 13475 | Express a word with an extra symbol as the union of the word and the new value. (Contributed by Mario Carneiro, 28-Feb-2016.) |
⊢ ((𝐴 ∈ Word 𝑋 ∧ 𝐵 ∈ 𝑋) → (𝐴 ++ 〈“𝐵”〉) = (𝐴 ∪ {〈(#‘𝐴), 𝐵〉})) | ||
Theorem | wrdind 13476* | Perform induction over the structure of a word. (Contributed by Mario Carneiro, 27-Sep-2015.) (Revised by Mario Carneiro, 26-Feb-2016.) |
⊢ (𝑥 = ∅ → (𝜑 ↔ 𝜓)) & ⊢ (𝑥 = 𝑦 → (𝜑 ↔ 𝜒)) & ⊢ (𝑥 = (𝑦 ++ 〈“𝑧”〉) → (𝜑 ↔ 𝜃)) & ⊢ (𝑥 = 𝐴 → (𝜑 ↔ 𝜏)) & ⊢ 𝜓 & ⊢ ((𝑦 ∈ Word 𝐵 ∧ 𝑧 ∈ 𝐵) → (𝜒 → 𝜃)) ⇒ ⊢ (𝐴 ∈ Word 𝐵 → 𝜏) | ||
Theorem | wrd2ind 13477* | Perform induction over the structure of two words of the same length. (Contributed by AV, 23-Jan-2019.) |
⊢ ((𝑥 = ∅ ∧ 𝑤 = ∅) → (𝜑 ↔ 𝜓)) & ⊢ ((𝑥 = 𝑦 ∧ 𝑤 = 𝑢) → (𝜑 ↔ 𝜒)) & ⊢ ((𝑥 = (𝑦 ++ 〈“𝑧”〉) ∧ 𝑤 = (𝑢 ++ 〈“𝑠”〉)) → (𝜑 ↔ 𝜃)) & ⊢ (𝑥 = 𝐴 → (𝜌 ↔ 𝜏)) & ⊢ (𝑤 = 𝐵 → (𝜑 ↔ 𝜌)) & ⊢ 𝜓 & ⊢ (((𝑦 ∈ Word 𝑋 ∧ 𝑧 ∈ 𝑋) ∧ (𝑢 ∈ Word 𝑌 ∧ 𝑠 ∈ 𝑌) ∧ (#‘𝑦) = (#‘𝑢)) → (𝜒 → 𝜃)) ⇒ ⊢ ((𝐴 ∈ Word 𝑋 ∧ 𝐵 ∈ Word 𝑌 ∧ (#‘𝐴) = (#‘𝐵)) → 𝜏) | ||
Theorem | ccats1swrdeqrex 13478* | There exists a symbol such that its concatenation with the subword obtained by deleting the last symbol of a nonempty word results in the word itself. (Contributed by AV, 5-Oct-2018.) (Proof shortened by AV, 24-Oct-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ (#‘𝑈) = ((#‘𝑊) + 1)) → (𝑊 = (𝑈 substr 〈0, (#‘𝑊)〉) → ∃𝑠 ∈ 𝑉 𝑈 = (𝑊 ++ 〈“𝑠”〉))) | ||
Theorem | reuccats1lem 13479* | Lemma for reuccats1 13480. (Contributed by Alexander van der Vekens, 5-Oct-2018.) (Proof shortened by AV, 15-Jan-2020.) |
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ 𝑋 ∧ (𝑊 ++ 〈“𝑆”〉) ∈ 𝑋) ∧ (∀𝑠 ∈ 𝑉 ((𝑊 ++ 〈“𝑠”〉) ∈ 𝑋 → 𝑆 = 𝑠) ∧ ∀𝑥 ∈ 𝑋 (𝑥 ∈ Word 𝑉 ∧ (#‘𝑥) = ((#‘𝑊) + 1)))) → (𝑊 = (𝑈 substr 〈0, (#‘𝑊)〉) → 𝑈 = (𝑊 ++ 〈“𝑆”〉))) | ||
Theorem | reuccats1 13480* | A set of words having the length of a given word increased by 1 contains a unique word with the given word as prefix if there is a unique symbol which extends the given word to be a word of the set. (Contributed by Alexander van der Vekens, 6-Oct-2018.) (Revised by AV, 21-Jan-2022.) |
⊢ Ⅎ𝑣𝑋 ⇒ ⊢ ((𝑊 ∈ Word 𝑉 ∧ ∀𝑥 ∈ 𝑋 (𝑥 ∈ Word 𝑉 ∧ (#‘𝑥) = ((#‘𝑊) + 1))) → (∃!𝑣 ∈ 𝑉 (𝑊 ++ 〈“𝑣”〉) ∈ 𝑋 → ∃!𝑥 ∈ 𝑋 𝑊 = (𝑥 substr 〈0, (#‘𝑊)〉))) | ||
Theorem | reuccats1v 13481* | A set of words having the length of a given word increased by 1 contains a unique word with the given word as prefix if there is a unique symbol which extends the given word to be a word of the set. (Contributed by Alexander van der Vekens, 6-Oct-2018.) (Proof shortened by AV, 21-Jan-2022.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ ∀𝑥 ∈ 𝑋 (𝑥 ∈ Word 𝑉 ∧ (#‘𝑥) = ((#‘𝑊) + 1))) → (∃!𝑣 ∈ 𝑉 (𝑊 ++ 〈“𝑣”〉) ∈ 𝑋 → ∃!𝑥 ∈ 𝑋 𝑊 = (𝑥 substr 〈0, (#‘𝑊)〉))) | ||
Theorem | swrdccatfn 13482 | The subword of a concatenation as function. (Contributed by Alexander van der Vekens, 27-May-2018.) |
⊢ (((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...((#‘𝐴) + (#‘𝐵))))) → ((𝐴 ++ 𝐵) substr 〈𝑀, 𝑁〉) Fn (0..^(𝑁 − 𝑀))) | ||
Theorem | swrdccatin1 13483 | The subword of a concatenation of two words within the first of the concatenated words. (Contributed by Alexander van der Vekens, 28-Mar-2018.) |
⊢ ((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) → ((𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘𝐴))) → ((𝐴 ++ 𝐵) substr 〈𝑀, 𝑁〉) = (𝐴 substr 〈𝑀, 𝑁〉))) | ||
Theorem | swrdccatin12lem1 13484 | Lemma 1 for swrdccatin12 13491. (Contributed by Alexander van der Vekens, 30-Mar-2018.) (Revised by Alexander van der Vekens, 23-May-2018.) |
⊢ ((𝐿 ∈ ℕ0 ∧ 𝑀 ∈ ℕ0 ∧ 𝑁 ∈ ℤ) → ((𝐾 ∈ (0..^(𝑁 − 𝑀)) ∧ ¬ 𝐾 ∈ (0..^(𝐿 − 𝑀))) → 𝐾 ∈ ((𝐿 − 𝑀)..^((𝐿 − 𝑀) + (𝑁 − 𝐿))))) | ||
Theorem | swrdccatin12lem2a 13485 | Lemma 1 for swrdccatin12lem2 13489. (Contributed by AV, 30-Mar-2018.) (Revised by AV, 27-May-2018.) |
⊢ ((𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...𝑋)) → ((𝐾 ∈ (0..^(𝑁 − 𝑀)) ∧ ¬ 𝐾 ∈ (0..^(𝐿 − 𝑀))) → (𝐾 + 𝑀) ∈ (𝐿..^𝑋))) | ||
Theorem | swrdccatin12lem2b 13486 | Lemma 2 for swrdccatin12lem2 13489. (Contributed by AV, 30-Mar-2018.) (Revised by AV, 27-May-2018.) |
⊢ ((𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...𝑋)) → ((𝐾 ∈ (0..^(𝑁 − 𝑀)) ∧ ¬ 𝐾 ∈ (0..^(𝐿 − 𝑀))) → (𝐾 − (𝐿 − 𝑀)) ∈ (0..^((𝑁 − 𝐿) − 0)))) | ||
Theorem | swrdccatin2 13487 | The subword of a concatenation of two words within the second of the concatenated words. (Contributed by Alexander van der Vekens, 28-Mar-2018.) (Revised by Alexander van der Vekens, 27-May-2018.) |
⊢ 𝐿 = (#‘𝐴) ⇒ ⊢ ((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) → ((𝑀 ∈ (𝐿...𝑁) ∧ 𝑁 ∈ (𝐿...(𝐿 + (#‘𝐵)))) → ((𝐴 ++ 𝐵) substr 〈𝑀, 𝑁〉) = (𝐵 substr 〈(𝑀 − 𝐿), (𝑁 − 𝐿)〉))) | ||
Theorem | swrdccatin12lem2c 13488 | Lemma for swrdccatin12lem2 13489 and swrdccatin12lem3 13490. (Contributed by AV, 30-Mar-2018.) (Revised by AV, 27-May-2018.) |
⊢ 𝐿 = (#‘𝐴) ⇒ ⊢ (((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (#‘𝐵))))) → ((𝐴 ++ 𝐵) ∈ Word 𝑉 ∧ 𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(#‘(𝐴 ++ 𝐵))))) | ||
Theorem | swrdccatin12lem2 13489 | Lemma 2 for swrdccatin12 13491. (Contributed by AV, 30-Mar-2018.) (Revised by AV, 27-May-2018.) |
⊢ 𝐿 = (#‘𝐴) ⇒ ⊢ (((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (#‘𝐵))))) → ((𝐾 ∈ (0..^(𝑁 − 𝑀)) ∧ ¬ 𝐾 ∈ (0..^(𝐿 − 𝑀))) → (((𝐴 ++ 𝐵) substr 〈𝑀, 𝑁〉)‘𝐾) = ((𝐵 substr 〈0, (𝑁 − 𝐿)〉)‘(𝐾 − (#‘(𝐴 substr 〈𝑀, 𝐿〉)))))) | ||
Theorem | swrdccatin12lem3 13490 | Lemma 3 for swrdccatin12 13491. (Contributed by AV, 30-Mar-2018.) (Revised by AV, 27-May-2018.) |
⊢ 𝐿 = (#‘𝐴) ⇒ ⊢ (((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (#‘𝐵))))) → ((𝐾 ∈ (0..^(𝑁 − 𝑀)) ∧ 𝐾 ∈ (0..^(𝐿 − 𝑀))) → (((𝐴 ++ 𝐵) substr 〈𝑀, 𝑁〉)‘𝐾) = ((𝐴 substr 〈𝑀, 𝐿〉)‘𝐾))) | ||
Theorem | swrdccatin12 13491 | The subword of a concatenation of two words within both of the concatenated words. (Contributed by Alexander van der Vekens, 5-Apr-2018.) (Revised by Alexander van der Vekens, 27-May-2018.) |
⊢ 𝐿 = (#‘𝐴) ⇒ ⊢ ((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) → ((𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (#‘𝐵)))) → ((𝐴 ++ 𝐵) substr 〈𝑀, 𝑁〉) = ((𝐴 substr 〈𝑀, 𝐿〉) ++ (𝐵 substr 〈0, (𝑁 − 𝐿)〉)))) | ||
Theorem | swrdccat3 13492 | The subword of a concatenation is either a subword of the first concatenated word or a subword of the second concatenated word or a concatenation of a suffix of the first word with a prefix of the second word. (Contributed by Alexander van der Vekens, 30-Mar-2018.) (Revised by Alexander van der Vekens, 28-May-2018.) |
⊢ 𝐿 = (#‘𝐴) ⇒ ⊢ ((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) → ((𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(𝐿 + (#‘𝐵)))) → ((𝐴 ++ 𝐵) substr 〈𝑀, 𝑁〉) = if(𝑁 ≤ 𝐿, (𝐴 substr 〈𝑀, 𝑁〉), if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), (𝑁 − 𝐿)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ (𝐵 substr 〈0, (𝑁 − 𝐿)〉)))))) | ||
Theorem | swrdccat 13493 | The subword of a concatenation of two words as concatenation of subwords of the two concatenated words. (Contributed by Alexander van der Vekens, 29-May-2018.) |
⊢ 𝐿 = (#‘𝐴) ⇒ ⊢ ((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) → ((𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(𝐿 + (#‘𝐵)))) → ((𝐴 ++ 𝐵) substr 〈𝑀, 𝑁〉) = ((𝐴 substr 〈𝑀, if(𝑁 ≤ 𝐿, 𝑁, 𝐿)〉) ++ (𝐵 substr 〈if(0 ≤ (𝑀 − 𝐿), (𝑀 − 𝐿), 0), (𝑁 − 𝐿)〉)))) | ||
Theorem | swrdccat3a 13494 | A prefix of a concatenation is either a prefix of the first concatenated word or a concatenation of the first word with a prefix of the second word. (Contributed by Alexander van der Vekens, 31-Mar-2018.) (Revised by Alexander van der Vekens, 29-May-2018.) |
⊢ 𝐿 = (#‘𝐴) ⇒ ⊢ ((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) → (𝑁 ∈ (0...(𝐿 + (#‘𝐵))) → ((𝐴 ++ 𝐵) substr 〈0, 𝑁〉) = if(𝑁 ≤ 𝐿, (𝐴 substr 〈0, 𝑁〉), (𝐴 ++ (𝐵 substr 〈0, (𝑁 − 𝐿)〉))))) | ||
Theorem | swrdccat3blem 13495 | Lemma for swrdccat3b 13496. (Contributed by AV, 30-May-2018.) |
⊢ 𝐿 = (#‘𝐴) ⇒ ⊢ ((((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (#‘𝐵)))) ∧ (𝐿 + (#‘𝐵)) ≤ 𝐿) → if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), (#‘𝐵)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ 𝐵)) = (𝐴 substr 〈𝑀, (𝐿 + (#‘𝐵))〉)) | ||
Theorem | swrdccat3b 13496 | A suffix of a concatenation is either a suffix of the second concatenated word or a concatenation of a suffix of the first word with the second word. (Contributed by Alexander van der Vekens, 31-Mar-2018.) (Revised by Alexander van der Vekens, 30-May-2018.) |
⊢ 𝐿 = (#‘𝐴) ⇒ ⊢ ((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) → (𝑀 ∈ (0...(𝐿 + (#‘𝐵))) → ((𝐴 ++ 𝐵) substr 〈𝑀, (𝐿 + (#‘𝐵))〉) = if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), (#‘𝐵)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ 𝐵)))) | ||
Theorem | swrdccatid 13497 | A prefix of a concatenation of length of the first concatenated word is the first word itself. (Contributed by Alexander van der Vekens, 20-Sep-2018.) |
⊢ ((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉 ∧ 𝑁 = (#‘𝐴)) → ((𝐴 ++ 𝐵) substr 〈0, 𝑁〉) = 𝐴) | ||
Theorem | ccats1swrdeqbi 13498 | A word is a prefix of a word with length greater by 1 than the first word iff the second word is the first word concatenated with the last symbol of the second word. (Contributed by AV, 24-Oct-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ (#‘𝑈) = ((#‘𝑊) + 1)) → (𝑊 = (𝑈 substr 〈0, (#‘𝑊)〉) ↔ 𝑈 = (𝑊 ++ 〈“( lastS ‘𝑈)”〉))) | ||
Theorem | swrdccatin1d 13499 | The subword of a concatenation of two words within the first of the concatenated words. (Contributed by AV, 31-May-2018.) (Revised by Mario Carneiro/AV, 21-Oct-2018.) |
⊢ (𝜑 → (#‘𝐴) = 𝐿) & ⊢ (𝜑 → (𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉)) & ⊢ (𝜑 → 𝑀 ∈ (0...𝑁)) & ⊢ (𝜑 → 𝑁 ∈ (0...𝐿)) ⇒ ⊢ (𝜑 → ((𝐴 ++ 𝐵) substr 〈𝑀, 𝑁〉) = (𝐴 substr 〈𝑀, 𝑁〉)) | ||
Theorem | swrdccatin2d 13500 | The subword of a concatenation of two words within the second of the concatenated words. (Contributed by AV, 31-May-2018.) (Revised by Mario Carneiro/AV, 21-Oct-2018.) |
⊢ (𝜑 → (#‘𝐴) = 𝐿) & ⊢ (𝜑 → (𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉)) & ⊢ (𝜑 → 𝑀 ∈ (𝐿...𝑁)) & ⊢ (𝜑 → 𝑁 ∈ (𝐿...(𝐿 + (#‘𝐵)))) ⇒ ⊢ (𝜑 → ((𝐴 ++ 𝐵) substr 〈𝑀, 𝑁〉) = (𝐵 substr 〈(𝑀 − 𝐿), (𝑁 − 𝐿)〉)) |
< Previous Next > |
Copyright terms: Public domain | < Previous Next > |