Optimality conditions for discrete-time optimal control on infinite horizon