Definition get_op_input_keys (l : list op) : list K :=
    filterMap (fun x => match x with
                          | I k => Some k
                          | _ => None
                        end) l.

Lemma get_op_input_keys_defn : forall x l, get_op_input_keys (x :: l) = match x with | I k => k :: get_op_input_keys l | _ => get_op_input_keys l end.