Theorem 9. Two time bounds for consecutive copies of one substring
ProvedBackreferenceMatching.theorem_9For , decide whether where match , respectively. Let and . One algorithm takes time. A second takes time. Both match identical copies of .
import Definitions.Def_BackreferenceMatching_Algorithms
namespace BackreferenceMatching
theorem theorem_9 (q : ℕ) :
∃ (p₁ p₂ : Program) (a c : ℕ), 0 < c ∧
∀ (x y z : Reg q) (α : ℕ), 2 ≤ α → ∀ w : Word q,
let s := regSize x + regSize y + regSize z
let input := repetitionInput x y z α w
let goal := RepeatedBlock x y z α w
DecidesWithin p₁ a q input goal
((2 ^ (c * s^2) + α * 2 ^ (c * s)) * (w.length + 1) * logFactor w.length) ∧
DecidesWithin p₂ a q input goal
((s + α + 1)^c * (w.length + 1) * (logFactor w.length)^2) := by
sorry
end BackreferenceMatchingRead-back
What the Lean code literally says, in plain math · GPT-6
For every , there are two finite deterministic word-RAM programs , a natural number , and a positive integer . For every three regular expressions over , every integer , and every word over , both programs decide whether for some , , and . Write for the total number of syntax nodes in , , and . Program halts within instructions, and halts within instructions.
The middle factor consists of exactly consecutive copies of the same word . If accepts the empty word, may be empty for every such . The other factors may also be empty when their respective expressions allow it. The empty target is included and is the only possible target when . Each program's entire output is if a factorization exists and otherwise.
Both programs receive the same input and use the same . For an input of entries the word width is . The machine has initially zero writable cells and sequential and indexed input reads. Each executed instruction costs one, including a halt or an exhausted sequential read. An out-of-range program counter ends execution at no additional cost.
The input begins with copies of and one , followed by the prefix codes of in order and the numeric letters of . The tags for the empty language, the empty word, a letter, union, concatenation, and star are , respectively. A letter tag is followed by its numeric value, and an operator tag is followed by its operands' codes in order.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.