English
In a totally ordered type with decidable ≤, inserting x into t via insert' yields a valid tree when t is valid.
Русский
При полностью упорядоченном типе с разрешимой ≤, вставка x в t через insert' yields валидное дерево при валидности t.
LaTeX
$$$\\forall x,\\ {t}:\\mathrm{Ordnode},\\ t\\text{ валидно} \\Rightarrow \\mathrm{insert'} x t\\text{ валидно}$$$
Lean4
theorem valid [IsTotal α (· ≤ ·)] [DecidableLE α] (x : α) {t} (h : Valid t) : Valid (insert' x t) := by
rw [insert'_eq_insertWith]; exact insertWith.valid _ _ (fun _ => id) h