refine Nat.fold'_induction (motive := fun k (x : Array β) => x.size = k) as.size _ #[] rfl ?_
α : Type u
β : Type v
p : α → Prop
f : (a : α) → p a → β
as : Array α
h : ∀ (i : Nat) (hi : i < size as), p as[i]
⊢ size (Nat.fold' (size as) (fun i x => push x (f as[i.val] (_ : p as[i.val]))) #[]) = size as
α : Type u
β : Type v
p : α → Prop
f : (a : α) → p a → β
as : Array α
h : ∀ (i : Nat) (hi : i < size as), p as[i]
⊢ ∀ (i : Nat) (hi : i < size as) (a : Array β),
    (fun k x => size x = k) i a →
      (fun k x => size x = k) (i + 1)
        (push a (f as[{ val := i, isLt := hi }.val] (_ : p as[{ val := i, isLt := hi }.val])))