Home | Metamath
Proof Explorer Theorem List (p. 141 of 449) | < 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: | Metamath Proof Explorer
(1-28623) |
Hilbert Space Explorer
(28624-30146) |
Users' Mathboxes
(30147-44804) |
Type | Label | Description |
---|---|---|
Statement | ||
Theorem | swrdfv0 14001 | The first symbol in an extracted subword. (Contributed by AV, 27-Apr-2022.) |
⊢ ((𝑆 ∈ Word 𝐴 ∧ 𝐹 ∈ (0..^𝐿) ∧ 𝐿 ∈ (0...(♯‘𝑆))) → ((𝑆 substr 〈𝐹, 𝐿〉)‘0) = (𝑆‘𝐹)) | ||
Theorem | swrdf 14002 | 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 14003 | 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 | swrdrn 14004 | 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 | swrdlend 14005 | 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 14006 | 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 14007 | Value of the subword extractor outside its intended domain. (Contributed by Alexander van der Vekens, 24-May-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ) → ((𝐵 ≤ 𝐴 ∨ (♯‘𝑊) ≤ 𝐴 ∨ 𝐵 ≤ 0) → (𝑊 substr 〈𝐴, 𝐵〉) = ∅)) | ||
Theorem | swrdnnn0nd 14008 | The value of a subword operation for arguments not being nonnegative integers is the empty set. (Contributed by AV, 2-Dec-2022.) |
⊢ ((𝑆 ∈ Word 𝑉 ∧ ¬ (𝐹 ∈ ℕ0 ∧ 𝐿 ∈ ℕ0)) → (𝑆 substr 〈𝐹, 𝐿〉) = ∅) | ||
Theorem | swrdnd0 14009 | The value of a subword operation for inproper arguments is the empty set. (Contributed by AV, 2-Dec-2022.) |
⊢ (𝑆 ∈ Word 𝑉 → (¬ (𝐹 ∈ (0...𝐿) ∧ 𝐿 ∈ (0...(♯‘𝑆))) → (𝑆 substr 〈𝐹, 𝐿〉) = ∅)) | ||
Theorem | swrd0 14010 | 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 14011 | Length of a right-anchored subword. (Contributed by Alexander van der Vekens, 5-Apr-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐼 ∈ (0...(♯‘𝑊))) → (♯‘(𝑊 substr 〈𝐼, (♯‘𝑊)〉)) = ((♯‘𝑊) − 𝐼)) | ||
Theorem | swrdlen2 14012 | Length of an extracted subword. (Contributed by AV, 5-May-2020.) |
⊢ ((𝑆 ∈ Word 𝑉 ∧ (𝐹 ∈ ℕ0 ∧ 𝐿 ∈ (ℤ≥‘𝐹)) ∧ 𝐿 ≤ (♯‘𝑆)) → (♯‘(𝑆 substr 〈𝐹, 𝐿〉)) = (𝐿 − 𝐹)) | ||
Theorem | swrdfv2 14013 | A symbol in an extracted subword, indexed using the word's indices. (Contributed by AV, 5-May-2020.) |
⊢ (((𝑆 ∈ Word 𝑉 ∧ (𝐹 ∈ ℕ0 ∧ 𝐿 ∈ (ℤ≥‘𝐹)) ∧ 𝐿 ≤ (♯‘𝑆)) ∧ 𝑋 ∈ (𝐹..^𝐿)) → ((𝑆 substr 〈𝐹, 𝐿〉)‘(𝑋 − 𝐹)) = (𝑆‘𝑋)) | ||
Theorem | swrdwrdsymb 14014 | A subword is a word over the symbols it consists of. (Contributed by AV, 2-Dec-2022.) |
⊢ (𝑆 ∈ Word 𝐴 → (𝑆 substr 〈𝑀, 𝑁〉) ∈ Word (𝑆 “ (𝑀..^𝑁))) | ||
Theorem | swrdsb0eq 14015 | 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 14016 | Two subwords with the same bounds have the same length. (Contributed by AV, 4-May-2020.) |
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉) ∧ (𝑀 ∈ ℕ0 ∧ 𝑁 ∈ ℕ0) ∧ (𝑁 ≤ (♯‘𝑊) ∧ 𝑁 ≤ (♯‘𝑈))) → (♯‘(𝑊 substr 〈𝑀, 𝑁〉)) = (♯‘(𝑈 substr 〈𝑀, 𝑁〉))) | ||
Theorem | swrdspsleq 14017* | 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 | swrds1 14018 | Extract a single symbol from a word. (Contributed by Stefan O'Rear, 23-Aug-2015.) |
⊢ ((𝑊 ∈ Word 𝐴 ∧ 𝐼 ∈ (0..^(♯‘𝑊))) → (𝑊 substr 〈𝐼, (𝐼 + 1)〉) = 〈“(𝑊‘𝐼)”〉) | ||
Theorem | swrdlsw 14019 | Extract the last single symbol from a word. (Contributed by Alexander van der Vekens, 23-Sep-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑊 ≠ ∅) → (𝑊 substr 〈((♯‘𝑊) − 1), (♯‘𝑊)〉) = 〈“(lastS‘𝑊)”〉) | ||
Theorem | ccatswrd 14020 | Joining two adjacent subwords makes a longer subword. (Contributed by Stefan O'Rear, 20-Aug-2015.) |
⊢ ((𝑆 ∈ Word 𝐴 ∧ (𝑋 ∈ (0...𝑌) ∧ 𝑌 ∈ (0...𝑍) ∧ 𝑍 ∈ (0...(♯‘𝑆)))) → ((𝑆 substr 〈𝑋, 𝑌〉) ++ (𝑆 substr 〈𝑌, 𝑍〉)) = (𝑆 substr 〈𝑋, 𝑍〉)) | ||
Theorem | swrdccat2 14021 | Recover the right half of a concatenated word. (Contributed by Mario Carneiro, 27-Sep-2015.) |
⊢ ((𝑆 ∈ Word 𝐵 ∧ 𝑇 ∈ Word 𝐵) → ((𝑆 ++ 𝑇) substr 〈(♯‘𝑆), ((♯‘𝑆) + (♯‘𝑇))〉) = 𝑇) | ||
Syntax | cpfx 14022 | Syntax for the prefix operator. |
class prefix | ||
Definition | df-pfx 14023* | Define an operation which extracts prefixes of words, i.e. subwords (or substrings) starting at the beginning of a word (or string). In other words, (𝑆 prefix 𝐿) is the prefix of the word 𝑆 of length 𝐿. Definition in Section 9.1 of [AhoHopUll] p. 318. See also Wikipedia "Substring" https://en.wikipedia.org/wiki/Substring#Prefix. (Contributed by AV, 2-May-2020.) |
⊢ prefix = (𝑠 ∈ V, 𝑙 ∈ ℕ0 ↦ (𝑠 substr 〈0, 𝑙〉)) | ||
Theorem | pfxnndmnd 14024 | The value of a prefix operation for out-of-domain arguments. (This is due to our definition of function values for out-of-domain arguments, see ndmfv 6694). (Contributed by AV, 3-Dec-2022.) (New usage is discouraged.) |
⊢ (¬ (𝑆 ∈ V ∧ 𝐿 ∈ ℕ0) → (𝑆 prefix 𝐿) = ∅) | ||
Theorem | pfxval 14025 | Value of a prefix operation. (Contributed by AV, 2-May-2020.) |
⊢ ((𝑆 ∈ 𝑉 ∧ 𝐿 ∈ ℕ0) → (𝑆 prefix 𝐿) = (𝑆 substr 〈0, 𝐿〉)) | ||
Theorem | pfx00 14026 | The zero length prefix is the empty set. (Contributed by AV, 2-May-2020.) |
⊢ (𝑆 prefix 0) = ∅ | ||
Theorem | pfx0 14027 | A prefix of an empty set is always the empty set. (Contributed by AV, 3-May-2020.) |
⊢ (∅ prefix 𝐿) = ∅ | ||
Theorem | pfxval0 14028 | Value of a prefix operation. This theorem should only be used in proofs if 𝐿 ∈ ℕ0 is not available. Otherwise (and usually), pfxval 14025 should be used. (Contributed by AV, 3-Dec-2022.) (New usage is discouraged.) |
⊢ (𝑆 ∈ Word 𝐴 → (𝑆 prefix 𝐿) = (𝑆 substr 〈0, 𝐿〉)) | ||
Theorem | pfxcl 14029 | Closure of the prefix extractor. (Contributed by AV, 2-May-2020.) |
⊢ (𝑆 ∈ Word 𝐴 → (𝑆 prefix 𝐿) ∈ Word 𝐴) | ||
Theorem | pfxmpt 14030* | Value of the prefix extractor as a mapping. (Contributed by AV, 2-May-2020.) |
⊢ ((𝑆 ∈ Word 𝐴 ∧ 𝐿 ∈ (0...(♯‘𝑆))) → (𝑆 prefix 𝐿) = (𝑥 ∈ (0..^𝐿) ↦ (𝑆‘𝑥))) | ||
Theorem | pfxres 14031 | Value of the subword extractor for left-anchored subwords. (Contributed by Stefan O'Rear, 24-Aug-2015.) (Revised by AV, 2-May-2020.) |
⊢ ((𝑆 ∈ Word 𝐴 ∧ 𝐿 ∈ (0...(♯‘𝑆))) → (𝑆 prefix 𝐿) = (𝑆 ↾ (0..^𝐿))) | ||
Theorem | pfxf 14032 | A prefix of a word is a function from a half-open range of nonnegative integers of the same length as the prefix to the set of symbols for the original word. (Contributed by AV, 2-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐿 ∈ (0...(♯‘𝑊))) → (𝑊 prefix 𝐿):(0..^𝐿)⟶𝑉) | ||
Theorem | pfxfn 14033 | Value of the prefix extractor as function with domain. (Contributed by AV, 2-May-2020.) |
⊢ ((𝑆 ∈ Word 𝑉 ∧ 𝐿 ∈ (0...(♯‘𝑆))) → (𝑆 prefix 𝐿) Fn (0..^𝐿)) | ||
Theorem | pfxfv 14034 | A symbol in a prefix of a word, indexed using the prefix' indices. (Contributed by Alexander van der Vekens, 16-Jun-2018.) (Revised by AV, 3-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐿 ∈ (0...(♯‘𝑊)) ∧ 𝐼 ∈ (0..^𝐿)) → ((𝑊 prefix 𝐿)‘𝐼) = (𝑊‘𝐼)) | ||
Theorem | pfxlen 14035 | Length of a prefix. (Contributed by Stefan O'Rear, 24-Aug-2015.) (Revised by AV, 2-May-2020.) |
⊢ ((𝑆 ∈ Word 𝐴 ∧ 𝐿 ∈ (0...(♯‘𝑆))) → (♯‘(𝑆 prefix 𝐿)) = 𝐿) | ||
Theorem | pfxid 14036 | A word is a prefix of itself. (Contributed by Stefan O'Rear, 16-Aug-2015.) (Revised by AV, 2-May-2020.) |
⊢ (𝑆 ∈ Word 𝐴 → (𝑆 prefix (♯‘𝑆)) = 𝑆) | ||
Theorem | pfxrn 14037 | The range of a prefix of a word is a subset of the set of symbols for the word. (Contributed by AV, 2-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐿 ∈ (0...(♯‘𝑊))) → ran (𝑊 prefix 𝐿) ⊆ 𝑉) | ||
Theorem | pfxn0 14038 | A prefix consisting of at least one symbol is not empty. (Contributed by Alexander van der Vekens, 4-Aug-2018.) (Revised by AV, 2-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐿 ∈ ℕ ∧ 𝐿 ≤ (♯‘𝑊)) → (𝑊 prefix 𝐿) ≠ ∅) | ||
Theorem | pfxnd 14039 | The value of a prefix operation for a length argument larger than the word length is the empty set. (This is due to our definition of function values for out-of-domain arguments, see ndmfv 6694). (Contributed by AV, 3-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐿 ∈ ℕ0 ∧ (♯‘𝑊) < 𝐿) → (𝑊 prefix 𝐿) = ∅) | ||
Theorem | pfxnd0 14040 | The value of a prefix operation for a length argument not in the range of the word length is the empty set. (This is due to our definition of function values for out-of-domain arguments, see ndmfv 6694). (Contributed by AV, 3-Dec-2022.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐿 ∉ (0...(♯‘𝑊))) → (𝑊 prefix 𝐿) = ∅) | ||
Theorem | pfxwrdsymb 14041 | A prefix of a word is a word over the symbols it consists of. (Contributed by AV, 3-Dec-2022.) |
⊢ (𝑆 ∈ Word 𝐴 → (𝑆 prefix 𝐿) ∈ Word (𝑆 “ (0..^𝐿))) | ||
Theorem | addlenrevpfx 14042 | 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.) (Revised by AV, 3-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑀 ∈ (0...(♯‘𝑊))) → ((♯‘(𝑊 substr 〈𝑀, (♯‘𝑊)〉)) + (♯‘(𝑊 prefix 𝑀))) = (♯‘𝑊)) | ||
Theorem | addlenpfx 14043 | The sum of the lengths of two parts of a word is the length of the word. (Contributed by AV, 21-Oct-2018.) (Revised by AV, 3-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑀 ∈ (0...(♯‘𝑊))) → ((♯‘(𝑊 prefix 𝑀)) + (♯‘(𝑊 substr 〈𝑀, (♯‘𝑊)〉))) = (♯‘𝑊)) | ||
Theorem | pfxfv0 14044 | The first symbol of a prefix is the first symbol of the word. (Contributed by Alexander van der Vekens, 16-Jun-2018.) (Revised by AV, 3-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐿 ∈ (1...(♯‘𝑊))) → ((𝑊 prefix 𝐿)‘0) = (𝑊‘0)) | ||
Theorem | pfxtrcfv 14045 | A symbol in a word truncated by one symbol. (Contributed by Alexander van der Vekens, 16-Jun-2018.) (Revised by AV, 3-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑊 ≠ ∅ ∧ 𝐼 ∈ (0..^((♯‘𝑊) − 1))) → ((𝑊 prefix ((♯‘𝑊) − 1))‘𝐼) = (𝑊‘𝐼)) | ||
Theorem | pfxtrcfv0 14046 | The first symbol in a word truncated by one symbol. (Contributed by Alexander van der Vekens, 16-Jun-2018.) (Revised by AV, 3-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 2 ≤ (♯‘𝑊)) → ((𝑊 prefix ((♯‘𝑊) − 1))‘0) = (𝑊‘0)) | ||
Theorem | pfxfvlsw 14047 | The last symbol in a nonempty prefix of a word. (Contributed by Alexander van der Vekens, 24-Jun-2018.) (Revised by AV, 3-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐿 ∈ (1...(♯‘𝑊))) → (lastS‘(𝑊 prefix 𝐿)) = (𝑊‘(𝐿 − 1))) | ||
Theorem | pfxeq 14048* | The prefixes of two 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.) (Revised by AV, 4-May-2020.) |
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉) ∧ (𝑀 ∈ ℕ0 ∧ 𝑁 ∈ ℕ0) ∧ (𝑀 ≤ (♯‘𝑊) ∧ 𝑁 ≤ (♯‘𝑈))) → ((𝑊 prefix 𝑀) = (𝑈 prefix 𝑁) ↔ (𝑀 = 𝑁 ∧ ∀𝑖 ∈ (0..^𝑀)(𝑊‘𝑖) = (𝑈‘𝑖)))) | ||
Theorem | pfxtrcfvl 14049 | The last symbol in a word truncated by one symbol. (Contributed by AV, 16-Jun-2018.) (Revised by AV, 5-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 2 ≤ (♯‘𝑊)) → (lastS‘(𝑊 prefix ((♯‘𝑊) − 1))) = (𝑊‘((♯‘𝑊) − 2))) | ||
Theorem | pfxsuffeqwrdeq 14050 | 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.) (Revised by AV, 5-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑆 ∈ Word 𝑉 ∧ 𝐼 ∈ (0..^(♯‘𝑊))) → (𝑊 = 𝑆 ↔ ((♯‘𝑊) = (♯‘𝑆) ∧ ((𝑊 prefix 𝐼) = (𝑆 prefix 𝐼) ∧ (𝑊 substr 〈𝐼, (♯‘𝑊)〉) = (𝑆 substr 〈𝐼, (♯‘𝑊)〉))))) | ||
Theorem | pfxsuff1eqwrdeq 14051 | 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 AV, 6-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) → (𝑊 = 𝑈 ↔ ((♯‘𝑊) = (♯‘𝑈) ∧ ((𝑊 prefix ((♯‘𝑊) − 1)) = (𝑈 prefix ((♯‘𝑊) − 1)) ∧ (lastS‘𝑊) = (lastS‘𝑈))))) | ||
Theorem | disjwrdpfx 14052* | Sets of words are disjoint if each set contains exactly the extensions of distinct words of a fixed length. Remark: A word 𝑊 is called an "extension" of a word 𝑃 if 𝑃 is a prefix of 𝑊. (Contributed by AV, 29-Jul-2018.) (Revised by AV, 6-May-2020.) |
⊢ Disj 𝑦 ∈ 𝑊 {𝑥 ∈ Word 𝑉 ∣ (𝑥 prefix 𝑁) = 𝑦} | ||
Theorem | ccatpfx 14053 | Concatenating a prefix with an adjacent subword makes a longer prefix. (Contributed by AV, 7-May-2020.) |
⊢ ((𝑆 ∈ Word 𝐴 ∧ 𝑌 ∈ (0...𝑍) ∧ 𝑍 ∈ (0...(♯‘𝑆))) → ((𝑆 prefix 𝑌) ++ (𝑆 substr 〈𝑌, 𝑍〉)) = (𝑆 prefix 𝑍)) | ||
Theorem | pfxccat1 14054 | Recover the left half of a concatenated word. (Contributed by Mario Carneiro, 27-Sep-2015.) (Revised by AV, 6-May-2020.) |
⊢ ((𝑆 ∈ Word 𝐵 ∧ 𝑇 ∈ Word 𝐵) → ((𝑆 ++ 𝑇) prefix (♯‘𝑆)) = 𝑆) | ||
Theorem | pfx1 14055 | The prefix of length one of a nonempty word expressed as a singleton word. (Contributed by AV, 15-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑊 ≠ ∅) → (𝑊 prefix 1) = 〈“(𝑊‘0)”〉) | ||
Theorem | swrdswrdlem 14056 | Lemma for swrdswrd 14057. (Contributed by Alexander van der Vekens, 4-Apr-2018.) |
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ (0...(♯‘𝑊)) ∧ 𝑀 ∈ (0...𝑁)) ∧ (𝐾 ∈ (0...(𝑁 − 𝑀)) ∧ 𝐿 ∈ (𝐾...(𝑁 − 𝑀)))) → (𝑊 ∈ Word 𝑉 ∧ (𝑀 + 𝐾) ∈ (0...(𝑀 + 𝐿)) ∧ (𝑀 + 𝐿) ∈ (0...(♯‘𝑊)))) | ||
Theorem | swrdswrd 14057 | A subword of a subword is a subword. (Contributed by Alexander van der Vekens, 4-Apr-2018.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ (0...(♯‘𝑊)) ∧ 𝑀 ∈ (0...𝑁)) → ((𝐾 ∈ (0...(𝑁 − 𝑀)) ∧ 𝐿 ∈ (𝐾...(𝑁 − 𝑀))) → ((𝑊 substr 〈𝑀, 𝑁〉) substr 〈𝐾, 𝐿〉) = (𝑊 substr 〈(𝑀 + 𝐾), (𝑀 + 𝐿)〉))) | ||
Theorem | pfxswrd 14058 | A prefix of a subword is a subword. (Contributed by AV, 2-Apr-2018.) (Revised by AV, 8-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ (0...(♯‘𝑊)) ∧ 𝑀 ∈ (0...𝑁)) → (𝐿 ∈ (0...(𝑁 − 𝑀)) → ((𝑊 substr 〈𝑀, 𝑁〉) prefix 𝐿) = (𝑊 substr 〈𝑀, (𝑀 + 𝐿)〉))) | ||
Theorem | swrdpfx 14059 | A subword of a prefix is a subword. (Contributed by Alexander van der Vekens, 6-Apr-2018.) (Revised by AV, 8-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ (0...(♯‘𝑊))) → ((𝐾 ∈ (0...𝑁) ∧ 𝐿 ∈ (𝐾...𝑁)) → ((𝑊 prefix 𝑁) substr 〈𝐾, 𝐿〉) = (𝑊 substr 〈𝐾, 𝐿〉))) | ||
Theorem | pfxpfx 14060 | A prefix of a prefix is a prefix. (Contributed by Alexander van der Vekens, 7-Apr-2018.) (Revised by AV, 8-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ (0...(♯‘𝑊)) ∧ 𝐿 ∈ (0...𝑁)) → ((𝑊 prefix 𝑁) prefix 𝐿) = (𝑊 prefix 𝐿)) | ||
Theorem | pfxpfxid 14061 | A prefix of a prefix with the same length is the original prefix. In other words, the operation "prefix of length 𝑁 " is idempotent. (Contributed by AV, 5-Apr-2018.) (Revised by AV, 8-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ (0...(♯‘𝑊))) → ((𝑊 prefix 𝑁) prefix 𝑁) = (𝑊 prefix 𝑁)) | ||
Theorem | pfxcctswrd 14062 | The concatenation of the prefix of a word and the rest of the word yields the word itself. (Contributed by AV, 21-Oct-2018.) (Revised by AV, 9-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑀 ∈ (0...(♯‘𝑊))) → ((𝑊 prefix 𝑀) ++ (𝑊 substr 〈𝑀, (♯‘𝑊)〉)) = 𝑊) | ||
Theorem | lenpfxcctswrd 14063 | The length of the concatenation of the prefix of a word and the rest of the word is the length of the word. (Contributed by AV, 21-Oct-2018.) (Revised by AV, 9-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑀 ∈ (0...(♯‘𝑊))) → (♯‘((𝑊 prefix 𝑀) ++ (𝑊 substr 〈𝑀, (♯‘𝑊)〉))) = (♯‘𝑊)) | ||
Theorem | lenrevpfxcctswrd 14064 | The length of the concatenation of the rest of a word and the prefix of the word is the length of the word. (Contributed by Alexander van der Vekens, 1-Apr-2018.) (Revised by AV, 9-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑀 ∈ (0...(♯‘𝑊))) → (♯‘((𝑊 substr 〈𝑀, (♯‘𝑊)〉) ++ (𝑊 prefix 𝑀))) = (♯‘𝑊)) | ||
Theorem | pfxlswccat 14065 | Reconstruct a nonempty word from its prefix and last symbol. (Contributed by Alexander van der Vekens, 5-Aug-2018.) (Revised by AV, 9-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑊 ≠ ∅) → ((𝑊 prefix ((♯‘𝑊) − 1)) ++ 〈“(lastS‘𝑊)”〉) = 𝑊) | ||
Theorem | ccats1pfxeq 14066 | The last symbol of a word concatenated with the word with the last symbol removed results in the word itself. (Contributed by Alexander van der Vekens, 24-Oct-2018.) (Revised by AV, 9-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ (♯‘𝑈) = ((♯‘𝑊) + 1)) → (𝑊 = (𝑈 prefix (♯‘𝑊)) → 𝑈 = (𝑊 ++ 〈“(lastS‘𝑈)”〉))) | ||
Theorem | ccats1pfxeqrex 14067* | There exists a symbol such that its concatenation after the prefix obtained by deleting the last symbol of a nonempty word results in the word itself. (Contributed by AV, 5-Oct-2018.) (Revised by AV, 9-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ (♯‘𝑈) = ((♯‘𝑊) + 1)) → (𝑊 = (𝑈 prefix (♯‘𝑊)) → ∃𝑠 ∈ 𝑉 𝑈 = (𝑊 ++ 〈“𝑠”〉))) | ||
Theorem | ccatopth 14068 | An opth 5360-like theorem for recovering the two halves of a concatenated word. (Contributed by Mario Carneiro, 1-Oct-2015.) (Proof shortened by AV, 12-Oct-2022.) |
⊢ (((𝐴 ∈ Word 𝑋 ∧ 𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋 ∧ 𝐷 ∈ Word 𝑋) ∧ (♯‘𝐴) = (♯‘𝐶)) → ((𝐴 ++ 𝐵) = (𝐶 ++ 𝐷) ↔ (𝐴 = 𝐶 ∧ 𝐵 = 𝐷))) | ||
Theorem | ccatopth2 14069 | An opth 5360-like theorem for recovering the two halves of a concatenated word. (Contributed by Mario Carneiro, 1-Oct-2015.) |
⊢ (((𝐴 ∈ Word 𝑋 ∧ 𝐵 ∈ Word 𝑋) ∧ (𝐶 ∈ Word 𝑋 ∧ 𝐷 ∈ Word 𝑋) ∧ (♯‘𝐵) = (♯‘𝐷)) → ((𝐴 ++ 𝐵) = (𝐶 ++ 𝐷) ↔ (𝐴 = 𝐶 ∧ 𝐵 = 𝐷))) | ||
Theorem | ccatlcan 14070 | Concatenation of words is left-cancellative. (Contributed by Mario Carneiro, 2-Oct-2015.) |
⊢ ((𝐴 ∈ Word 𝑋 ∧ 𝐵 ∈ Word 𝑋 ∧ 𝐶 ∈ Word 𝑋) → ((𝐶 ++ 𝐴) = (𝐶 ++ 𝐵) ↔ 𝐴 = 𝐵)) | ||
Theorem | ccatrcan 14071 | Concatenation of words is right-cancellative. (Contributed by Mario Carneiro, 2-Oct-2015.) |
⊢ ((𝐴 ∈ Word 𝑋 ∧ 𝐵 ∈ Word 𝑋 ∧ 𝐶 ∈ Word 𝑋) → ((𝐴 ++ 𝐶) = (𝐵 ++ 𝐶) ↔ 𝐴 = 𝐵)) | ||
Theorem | wrdeqs1cat 14072 | 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, 12-Oct-2022.) |
⊢ ((𝑊 ∈ Word 𝐴 ∧ 𝑊 ≠ ∅) → 𝑊 = (〈“(𝑊‘0)”〉 ++ (𝑊 substr 〈1, (♯‘𝑊)〉))) | ||
Theorem | cats1un 14073 | 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 14074* | Perform induction over the structure of a word. (Contributed by Mario Carneiro, 27-Sep-2015.) (Revised by Mario Carneiro, 26-Feb-2016.) (Proof shortened by AV, 12-Oct-2022.) |
⊢ (𝑥 = ∅ → (𝜑 ↔ 𝜓)) & ⊢ (𝑥 = 𝑦 → (𝜑 ↔ 𝜒)) & ⊢ (𝑥 = (𝑦 ++ 〈“𝑧”〉) → (𝜑 ↔ 𝜃)) & ⊢ (𝑥 = 𝐴 → (𝜑 ↔ 𝜏)) & ⊢ 𝜓 & ⊢ ((𝑦 ∈ Word 𝐵 ∧ 𝑧 ∈ 𝐵) → (𝜒 → 𝜃)) ⇒ ⊢ (𝐴 ∈ Word 𝐵 → 𝜏) | ||
Theorem | wrd2ind 14075* | Perform induction over the structure of two words of the same length. (Contributed by AV, 23-Jan-2019.) (Proof shortened by AV, 12-Oct-2022.) |
⊢ ((𝑥 = ∅ ∧ 𝑤 = ∅) → (𝜑 ↔ 𝜓)) & ⊢ ((𝑥 = 𝑦 ∧ 𝑤 = 𝑢) → (𝜑 ↔ 𝜒)) & ⊢ ((𝑥 = (𝑦 ++ 〈“𝑧”〉) ∧ 𝑤 = (𝑢 ++ 〈“𝑠”〉)) → (𝜑 ↔ 𝜃)) & ⊢ (𝑥 = 𝐴 → (𝜌 ↔ 𝜏)) & ⊢ (𝑤 = 𝐵 → (𝜑 ↔ 𝜌)) & ⊢ 𝜓 & ⊢ (((𝑦 ∈ Word 𝑋 ∧ 𝑧 ∈ 𝑋) ∧ (𝑢 ∈ Word 𝑌 ∧ 𝑠 ∈ 𝑌) ∧ (♯‘𝑦) = (♯‘𝑢)) → (𝜒 → 𝜃)) ⇒ ⊢ ((𝐴 ∈ Word 𝑋 ∧ 𝐵 ∈ Word 𝑌 ∧ (♯‘𝐴) = (♯‘𝐵)) → 𝜏) | ||
Theorem | swrdccatfn 14076 | 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 14077 | 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 | pfxccatin12lem4 14078 | Lemma 4 for pfxccatin12 14085. (Contributed by Alexander van der Vekens, 30-Mar-2018.) (Revised by Alexander van der Vekens, 23-May-2018.) |
⊢ ((𝐿 ∈ ℕ0 ∧ 𝑀 ∈ ℕ0 ∧ 𝑁 ∈ ℤ) → ((𝐾 ∈ (0..^(𝑁 − 𝑀)) ∧ ¬ 𝐾 ∈ (0..^(𝐿 − 𝑀))) → 𝐾 ∈ ((𝐿 − 𝑀)..^((𝐿 − 𝑀) + (𝑁 − 𝐿))))) | ||
Theorem | pfxccatin12lem2a 14079 | Lemma for pfxccatin12lem2 14083. (Contributed by AV, 30-Mar-2018.) (Revised by AV, 27-May-2018.) |
⊢ ((𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...𝑋)) → ((𝐾 ∈ (0..^(𝑁 − 𝑀)) ∧ ¬ 𝐾 ∈ (0..^(𝐿 − 𝑀))) → (𝐾 + 𝑀) ∈ (𝐿..^𝑋))) | ||
Theorem | pfxccatin12lem1 14080 | Lemma 1 for pfxccatin12 14085. (Contributed by AV, 30-Mar-2018.) (Revised by AV, 9-May-2020.) |
⊢ ((𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...𝑋)) → ((𝐾 ∈ (0..^(𝑁 − 𝑀)) ∧ ¬ 𝐾 ∈ (0..^(𝐿 − 𝑀))) → (𝐾 − (𝐿 − 𝑀)) ∈ (0..^(𝑁 − 𝐿)))) | ||
Theorem | swrdccatin2 14081 | 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 | pfxccatin12lem2c 14082 | Lemma for pfxccatin12lem2 14083 and pfxccatin12lem3 14084. (Contributed by AV, 30-Mar-2018.) (Revised by AV, 27-May-2018.) |
⊢ 𝐿 = (♯‘𝐴) ⇒ ⊢ (((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → ((𝐴 ++ 𝐵) ∈ Word 𝑉 ∧ 𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(♯‘(𝐴 ++ 𝐵))))) | ||
Theorem | pfxccatin12lem2 14083 | Lemma 2 for pfxccatin12 14085. (Contributed by AV, 30-Mar-2018.) (Revised by AV, 9-May-2020.) |
⊢ 𝐿 = (♯‘𝐴) ⇒ ⊢ (((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → ((𝐾 ∈ (0..^(𝑁 − 𝑀)) ∧ ¬ 𝐾 ∈ (0..^(𝐿 − 𝑀))) → (((𝐴 ++ 𝐵) substr 〈𝑀, 𝑁〉)‘𝐾) = ((𝐵 prefix (𝑁 − 𝐿))‘(𝐾 − (♯‘(𝐴 substr 〈𝑀, 𝐿〉)))))) | ||
Theorem | pfxccatin12lem3 14084 | Lemma 3 for pfxccatin12 14085. (Contributed by AV, 30-Mar-2018.) (Revised by AV, 27-May-2018.) |
⊢ 𝐿 = (♯‘𝐴) ⇒ ⊢ (((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → ((𝐾 ∈ (0..^(𝑁 − 𝑀)) ∧ 𝐾 ∈ (0..^(𝐿 − 𝑀))) → (((𝐴 ++ 𝐵) substr 〈𝑀, 𝑁〉)‘𝐾) = ((𝐴 substr 〈𝑀, 𝐿〉)‘𝐾))) | ||
Theorem | pfxccatin12 14085 | 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 AV, 9-May-2020.) |
⊢ 𝐿 = (♯‘𝐴) ⇒ ⊢ ((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) → ((𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵)))) → ((𝐴 ++ 𝐵) substr 〈𝑀, 𝑁〉) = ((𝐴 substr 〈𝑀, 𝐿〉) ++ (𝐵 prefix (𝑁 − 𝐿))))) | ||
Theorem | pfxccat3 14086 | 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 AV, 10-May-2020.) |
⊢ 𝐿 = (♯‘𝐴) ⇒ ⊢ ((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) → ((𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(𝐿 + (♯‘𝐵)))) → ((𝐴 ++ 𝐵) substr 〈𝑀, 𝑁〉) = if(𝑁 ≤ 𝐿, (𝐴 substr 〈𝑀, 𝑁〉), if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), (𝑁 − 𝐿)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ (𝐵 prefix (𝑁 − 𝐿))))))) | ||
Theorem | swrdccat 14087 | 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 | pfxccatpfx1 14088 | A prefix of a concatenation being a prefix of the first concatenated word. (Contributed by AV, 10-May-2020.) |
⊢ 𝐿 = (♯‘𝐴) ⇒ ⊢ ((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉 ∧ 𝑁 ∈ (0...𝐿)) → ((𝐴 ++ 𝐵) prefix 𝑁) = (𝐴 prefix 𝑁)) | ||
Theorem | pfxccatpfx2 14089 | A prefix of a concatenation of two words being the first word concatenated with a prefix of the second word. (Contributed by AV, 10-May-2020.) |
⊢ 𝐿 = (♯‘𝐴) & ⊢ 𝑀 = (♯‘𝐵) ⇒ ⊢ ((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉 ∧ 𝑁 ∈ ((𝐿 + 1)...(𝐿 + 𝑀))) → ((𝐴 ++ 𝐵) prefix 𝑁) = (𝐴 ++ (𝐵 prefix (𝑁 − 𝐿)))) | ||
Theorem | pfxccat3a 14090 | 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 AV, 10-May-2020.) |
⊢ 𝐿 = (♯‘𝐴) & ⊢ 𝑀 = (♯‘𝐵) ⇒ ⊢ ((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) → (𝑁 ∈ (0...(𝐿 + 𝑀)) → ((𝐴 ++ 𝐵) prefix 𝑁) = if(𝑁 ≤ 𝐿, (𝐴 prefix 𝑁), (𝐴 ++ (𝐵 prefix (𝑁 − 𝐿)))))) | ||
Theorem | swrdccat3blem 14091 | Lemma for swrdccat3b 14092. (Contributed by AV, 30-May-2018.) |
⊢ 𝐿 = (♯‘𝐴) ⇒ ⊢ ((((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ (𝐿 + (♯‘𝐵)) ≤ 𝐿) → if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), (♯‘𝐵)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ 𝐵)) = (𝐴 substr 〈𝑀, (𝐿 + (♯‘𝐵))〉)) | ||
Theorem | swrdccat3b 14092 | 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.) (Proof shortened by AV, 14-Oct-2022.) |
⊢ 𝐿 = (♯‘𝐴) ⇒ ⊢ ((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) → (𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) → ((𝐴 ++ 𝐵) substr 〈𝑀, (𝐿 + (♯‘𝐵))〉) = if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), (♯‘𝐵)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ 𝐵)))) | ||
Theorem | pfxccatid 14093 | 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.) (Revised by AV, 10-May-2020.) |
⊢ ((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉 ∧ 𝑁 = (♯‘𝐴)) → ((𝐴 ++ 𝐵) prefix 𝑁) = 𝐴) | ||
Theorem | ccats1pfxeqbi 14094 | 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.) (Revised by AV, 10-May-2020.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ (♯‘𝑈) = ((♯‘𝑊) + 1)) → (𝑊 = (𝑈 prefix (♯‘𝑊)) ↔ 𝑈 = (𝑊 ++ 〈“(lastS‘𝑈)”〉))) | ||
Theorem | swrdccatin1d 14095 | 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 14096 | 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 〈(𝑀 − 𝐿), (𝑁 − 𝐿)〉)) | ||
Theorem | pfxccatin12d 14097 | The subword of a concatenation of two words within both of the concatenated words. (Contributed by AV, 31-May-2018.) (Revised by AV, 10-May-2020.) |
⊢ (𝜑 → (♯‘𝐴) = 𝐿) & ⊢ (𝜑 → (𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉)) & ⊢ (𝜑 → 𝑀 ∈ (0...𝐿)) & ⊢ (𝜑 → 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵)))) ⇒ ⊢ (𝜑 → ((𝐴 ++ 𝐵) substr 〈𝑀, 𝑁〉) = ((𝐴 substr 〈𝑀, 𝐿〉) ++ (𝐵 prefix (𝑁 − 𝐿)))) | ||
Theorem | reuccatpfxs1lem 14098* | Lemma for reuccatpfxs1 14099. (Contributed by Alexander van der Vekens, 5-Oct-2018.) (Revised by AV, 9-May-2020.) |
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ 𝑋) ∧ ∀𝑠 ∈ 𝑉 ((𝑊 ++ 〈“𝑠”〉) ∈ 𝑋 → 𝑆 = 𝑠) ∧ ∀𝑥 ∈ 𝑋 (𝑥 ∈ Word 𝑉 ∧ (♯‘𝑥) = ((♯‘𝑊) + 1))) → (𝑊 = (𝑈 prefix (♯‘𝑊)) → 𝑈 = (𝑊 ++ 〈“𝑆”〉))) | ||
Theorem | reuccatpfxs1 14099* | There is a unique word having the length of a given word increased by 1 with the given word as prefix if there is a unique symbol which extends the given word. (Contributed by Alexander van der Vekens, 6-Oct-2018.) (Revised by AV, 21-Jan-2022.) (Revised by AV, 13-Oct-2022.) |
⊢ Ⅎ𝑣𝑋 ⇒ ⊢ ((𝑊 ∈ Word 𝑉 ∧ ∀𝑥 ∈ 𝑋 (𝑥 ∈ Word 𝑉 ∧ (♯‘𝑥) = ((♯‘𝑊) + 1))) → (∃!𝑣 ∈ 𝑉 (𝑊 ++ 〈“𝑣”〉) ∈ 𝑋 → ∃!𝑥 ∈ 𝑋 𝑊 = (𝑥 prefix (♯‘𝑊)))) | ||
Theorem | reuccatpfxs1v 14100* | There is a unique word having the length of a given word increased by 1 with the given word as prefix if there is a unique symbol which extends the given word. (Contributed by Alexander van der Vekens, 6-Oct-2018.) (Revised by AV, 21-Jan-2022.) (Revised by AV, 10-May-2022.) (Proof shortened by AV, 13-Oct-2022.) |
⊢ ((𝑊 ∈ Word 𝑉 ∧ ∀𝑥 ∈ 𝑋 (𝑥 ∈ Word 𝑉 ∧ (♯‘𝑥) = ((♯‘𝑊) + 1))) → (∃!𝑣 ∈ 𝑉 (𝑊 ++ 〈“𝑣”〉) ∈ 𝑋 → ∃!𝑥 ∈ 𝑋 𝑊 = (𝑥 prefix (♯‘𝑊)))) |
< Previous Next > |
Copyright terms: Public domain | < Previous Next > |