Section Graph.
Variable (A : finType) (B : Type) (f : A -> B).
Set Default Proof Using "Type".
Definition graph_of_fun : list (A*B) := map (fun x => (x, f x)) enum.
End Graph.

(* map keys injectively and values arbitrarily *)
Lemma lookup_map (X X' : eqType) (Y Y' : Type) (lst : list (X*Y)) (f : X -> X') (g : Y -> Y') (x : X) (y : Y) :
injective f ->
lookup x lst = Some y ->
lookup (f x) (map (map_pair f g) lst) = Some (g y).