Questions regarding the well-definedness of a function often arise when the defining equation of a function refers not only to the arguments themselves, but also to elements of the arguments, serving as
representatives. This is sometimes unavoidable when the arguments are
cosets and when the equation refers to coset representatives. The result of a function application must then not depend on the choice of representative.
Functions with one argument For example, consider the following function: : \begin{matrix} f : & \Z/8\Z & \to & \Z/4\Z\\ & \overline{n}_8 & \mapsto & \overline{n}_4, \end{matrix} where n\in\Z, m\in \{4,8\} and \Z/m\Z are the
integers modulo m and \overline{n}_m denotes the
congruence class of
n mod
m. N.B.: \overline{n}_4 is a reference to the element n \in \overline{n}_8, and \overline{n}_8 is the argument of
f. The function
f is well defined, because: :n \equiv n' \bmod 8 \; \Leftrightarrow \; 8 \text{ divides } (n-n') \Rightarrow \; 4 \text{ divides } (n-n') \; \Leftrightarrow \; n \equiv n' \bmod 4. As a counter example, the converse definition: : \begin{matrix} g : & \Z/4\Z & \to & \Z/8\Z\\ & \overline{n}_4 & \mapsto & \overline{n}_8, \end{matrix} does not lead to a well-defined function, since e.g. \overline{1}_4 equals \overline{5}_4 in \Z/4\Z, but the first would be mapped by g to \overline{1}_8, while the second would be mapped to \overline{5}_8, and \overline{1}_8 and \overline{5}_8 are unequal in \Z/8\Z.
Operations In particular, the term
well-defined is used with respect to (binary)
operations on cosets. In this case, one can view the operation as a function of two variables, and the property of being well-defined is the same as that for a function. For example, addition on the integers modulo some
n can be defined naturally in terms of integer addition. :[a]\oplus[b] = [a+b] The fact that this is well-defined follows from the fact that we can write any representative of [a] as a+kn, where k is an integer. Therefore, :[a]\oplus[b] = [a+kn]\oplus[b] = [(a+kn)+b] = [(a+b)+kn] = [a+b]; similar holds for any representative of [b], thereby making [a+b] the same, irrespective of the choice of representative. ==Well-defined notation==