English
Equivalent reformulation of mem_pullSub_long with bidirectional equivalence depending on the structural definition.
Русский
Переформулирование mem_pullSub_long с эквивалентностью-взаимно однозначной зависимостью от определения структуры.
LaTeX
$$$ \\forall x,y,\\; x.length \\le y.length \\Rightarrow (y \\in \\mathrm{pullSub}(T,x) \\iff \\exists z\\in T, y = x ++ z) $$$
Lean4
theorem mem_pullSub_long (hl : x.length ≤ y.length) : y ∈ pullSub T x ↔ ∃ z ∈ T, y = x ++ z
where
mp := by
intro ⟨h1, h2⟩; use y.drop x.length, h2
nth_rw 1 [← List.take_append_drop x.length y]
simpa [-List.take_append_drop, List.prefix_iff_eq_take, hl] using h1
mpr := by simp +contextual [pullSub]