Discrete function is also a math function?
Focus on the idea that the sets can be finite. They don't need to be defined by a formula. Any set of ordered pairs is a relation. If there is a unique second element for any given first element then it is a function.

For example, the set of pairs {(5,2), (5,4)} is not a function, since the value associated with 5 is not unique. This is a relation: a set of ordered pairs.

But {(5,2), (6,2)} IS a function since the value associated with 5 is unique and the same is true of 6. It is a constant function, by the way, since all values map to 2. 

Additionally {(5, 2), (6, 3)} is a function and its inverse is {(2, 5), (3, 6)} which is also a function. Thus the original here is called invertible.  

You don't need Lambda Calculus or any mathematics to show what a function is. Finite functions can be computed by table lookup or by hash maps. An array is a function from a certain set of integers to some other set (the values). 

Actually functions defined by formulas in computing are often problematic since computations of many values (say Real Values) are only approximate.