English
Inserting at the last position yields a Snoc construction: (last n).insertNth x p = snoc (λ j, cast (succAbove_last_apply j) (p j)) x.
Русский
Вставка в последнюю позицию даёт конструкцию snoc: (last n).insertNth x p = snoc (λ j, cast (succAbove_last_apply j) (p j)) x.
LaTeX
$$$(Fin.last\ n).insertNth x p = \mathrm{snoc}\big(\lambda j. cast\; (succAbove_last_apply\ j)\; (p\ j)\big)\; x$$
Lean4
theorem insertNth_zero (x : α 0) (p : ∀ j : Fin n, α (succAbove 0 j)) :
insertNth 0 x p = cons x fun j ↦ _root_.cast (congr_arg α (congr_fun succAbove_zero j)) (p j) :=
by
refine insertNth_eq_iff.2 ⟨by simp, ?_⟩
ext j
convert (cons_succ x p j).symm