Section ListMaps.
Context {A B : Type} {A_eq : EqDec A} {d : Inhabitant B}.
Definition map_Znth i (L : A -> option (list B)) k := option_map (fun v => Znth i v) (L k).

(* Specifications: *)
Lemma map_Znth_single : forall i (k : A) (v : list B),
map_Znth i (singleton k v) = singleton k (Znth i v).
Lemma map_Znth_add : forall (m1 m2 : A -> option (list B)) i,
map_Znth i (map_add m1 m2) = map_add (map_Znth i m1) (map_Znth i m2).
Lemma map_Znth_eq : forall (L : A -> option (list B)) k vs (Hlength : forall vs', L k = Some vs' -> Zlength vs' = Zlength vs)
(Hnz : vs <> []) (Hall : forall i, 0 <= i < Zlength vs -> map_Znth i L k = Some (Znth i vs)),
L k = Some vs.
Lemma map_Znth_upd : forall (m : A -> option (list B)) k v i,
map_Znth i (map_upd m k v) = map_upd (map_Znth i m) k (Znth i v).
Lemma map_incl_Znth : forall (m1 m2 : A -> option (list B)) i, map_incl m1 m2 ->
map_incl (map_Znth i m1) (map_Znth i m2).