Fixpoint fill_list_nat{T: Type}(n: nat)(f: nat -> T): list T := match n with
| O => []
| S m => (fill_list_nat m f) ++ [f m]
end.
Definition fill_list{T: Type}(n: Z)(f: Z -> T): list T :=
fill_list_nat (Z.to_nat n) (fun i => f (Z.of_nat i)).

Lemma fill_list_step: forall {T: Type} (n: Z) (f: Z -> T),
0 <= n ->
fill_list (n + 1) f = fill_list n f ++ [f n].