Proper definition of a function I'm sorry if this is a pedantic question, but I want to be sure I'm using terminology correctly.
Without a second thought, I would make statements of the following form: "Consider the function $f: A \to B$ defined by $f(a) = b$."
This isn't fully correct, however, because the full definition of the function $f$ should be the domain, codomain, and the rule. Without one, the definition is ambiguous.
Am I incorrect on this, or is this a commonly accepted shorthand? Would it make more sense to say "consider the function $f: A \to B$ given by" or "governed by"?
 A: Introduction
Here is the formal definition of a function.
You need two sets $A,B$ (domain, codomain) and a subset $f$ of $A\times B$, that is, a collection of pairs of the form $(a,b)$. A pair $(a,b)$ in this set means that "$a$ is in relation to $b$". To obtain a function you need two additional constraints:

*

*every element of $A$ is in relation to at least one element of $B$ (i.e. the function is defined on all of the domain)

*an element of $A$ can be in relation to only one element of $B$ (i.e. you can compute $f(a)$ unambiguously)

If the subset $f$ of the set $A\times B$ satisfies all of these rules it's called a function and we write $f: A\rightarrow B$ and define the notation "$f(a)=b$" $\iff (a,b) \in A\times B$.
This definition makes sense if we view functions as being arrows that put in relation elements of the domain to elements of the codomain.

Answer
TLDR: the "rule of computation" is not sufficient to define a function.
TL: if you consider "$f$ is defined by the rule $f(a)=b$" to also encode the information about domain and codomain than the definition is complete.
Sometimes domain and codomain are know from the context or declared in advance and omitted.
But if you want to define a function correctly, the only way is to specify domain, codomain and rule.

Examples
Consider the rule $x\mapsto \exp(x)$. If viewed from $\mathbb{R}\rightarrow \mathbb{R}$ it defines a function that is not surjective. If viewed from $\mathbb{R}\rightarrow (0,+\infty)$ it's a function that is surjective. So you can already see that giving only the computation rule is not sufficient.
And lasly, if the same computation rule is seen from $M_{\mathbb{R}}(n,n) \rightarrow M_{\mathbb{R}}(n,n)$ then we have a totally different object ($M_{\mathbb{R}}(n,n)$ is the set of real $n\times n$ matrices. See the matrix exponential map for more details about this last example: https://en.wikipedia.org/wiki/Matrix_exponential).
A: You should say "with $f(a)=b$" or  "satisfying $f(a)=b$". Some people might say  "where $f(a)=b$", but I recommend "where" Immediately before definitions.
A: Saying "given by", "verifying", "satisfying", etc. is more suitable for defining functions using words. Otherwise, remember that you can also use the notation:
\begin{align*}
f: & A  \longrightarrow  B \\
& a  \longmapsto f(a)=b
\end{align*}
And we'll say it's well defined if any point $a\in A$ has an image through $f$ that satisfies $f(a)\in B$, and also that it gives no contradiction, to be said: $a=a'$ implies $f(a)=f(a')$. If that's not verified, we say it's not well defined, and you may better change it's definition to make clear where does $f$ have sense. For example, the function
\begin{align*}
f: & \mathbb{R}  \longrightarrow  \mathbb{R}_+ \\
& x  \longmapsto f(x)=1/x
\end{align*}
isn't really well defined, since $x=0$ has no image, and not al images from points in $\mathbb{R}$ are positive, so a right definition of it will be
\begin{align*}
f:  \mathbb{R}\setminus\{0\} & \longrightarrow  \mathbb{R} \\
 x \ \ \ & \longmapsto  \ f(x)=1/x
\end{align*}
though sometimes domain and codomain specifications are omitted because they can be deduced by the rule or the context
