mapFinIdx #
theorem
Array.mapFinIdx_induction.go
{α : Type u_1}
{β : Type u_2}
(as : Array α)
(f : Fin as.size → α → β)
(motive : Nat → Prop)
(p : Fin as.size → β → Prop)
(hs : ∀ (i : Fin as.size), motive ↑i → p i (f i as[i]) ∧ motive (↑i + 1))
{bs : Array β}
{i : Nat}
{j : Nat}
{h : i + j = as.size}
(h₁ : j = bs.size)
(h₂ : ∀ (i : Nat) (h : i < as.size) (h' : i < bs.size), p ⟨i, h⟩ bs[i])
(hm : motive j)
:
let arr := Array.mapFinIdxM.map as f i j h bs;
motive as.size ∧ ∃ (eq : arr.size = as.size), ∀ (i_1 : Nat) (h : i_1 < as.size), p ⟨i_1, h⟩ arr[i_1]
@[simp]
mapIdx #
@[simp]
theorem
Array.getElem?_mapIdx
{α : Type u_1}
{β : Type u_2}
(a : Array α)
(f : Nat → α → β)
(i : Nat)
:
(a.mapIdx f)[i]? = Option.map (f i) a[i]?