An arithmetic function is maths that uses only the arithmetic operators, addition, subtraction, multiplication and division.
I already have a way of parsing the expressions into an AST, so what I’m imagining is a tree walking algorithm to determine this property.
For example:
x + 1
is injective.
x / x
is not.
x + x / x
is.
I'm not even sure where to start with functions of more than one input.
To reiterate the title of the question, is there an algorithm which takes as input an arithmetic function in the form of an ast and produces as output “true” if and only if that function is injective?
If so can you explain this algorithm in sufficient detail for it to be implemented?