I don’t think it’s fair to call {}-> injective just because no two inputs map to the same output. That’s vacuous.
Edit: Removed incorrect claim that |B| > |A| sufficed for the counter example.
It's also the definitions the book supplies though (and the standard ones). Mathematics works over definitions. Everyone is free to do math over whatever definitions they want - but what is or isn't true follows from them. Lots of definitions and theorems exclude things like empty-set cases because they're weird, but that has to be explicit (otherwise someone will apply a theorem to the empty set and it will lead them to incorrect conclusions).
It's true precisely because it's vacuous. If you quantify over the empty set, anything is true.
In other words, the statement "for every x in {} it holds that <anything>" is always true.
But that is the definition of injective.
Generally mathematicians treat vacuous statements as true.
I believe it doesn't make any difference to any meaningful result. It merely makes it easier to write theorems without specifying exceptions.