English
The Wbtw property is preserved under applying a map to a list: if l has Wbtw, then l.map f has Wbtw.
Русский
Свойство Wbtw сохраняется под применением отображения к списку: если l имеет Wbtw, то l.map f также имеет Wbtw.
LaTeX
$$$\\text{Wbtw}(R, l) \\implies \\text{Wbtw}(R, l.map f)$$$
Lean4
theorem wbtw {l : List R} (h : l.Sorted (· ≤ ·)) : l.Wbtw R := by
induction l with
| nil => simp
| cons head tail ih =>
rw [wbtw_cons]
refine ⟨?_, ih h.of_cons⟩
clear ih
induction tail with
| nil => simp
| cons head' tail' ih =>
rw [pairwise_cons]
refine ⟨?_, ih (h.sublist ?_)⟩
· rw [sorted_cons_cons, sorted_cons] at h
exact fun a ha ↦ .of_le_of_le h.1 (h.2.1 a ha)
· simp