[1] A function is well defined if it gives the same result when the representation of the input is changed without changing the value of the input.
takes real numbers as input, and if
[2] The term well-defined can also be used to indicate that a logical expression is unambiguous or uncontradictory.
is undefined, this does not mean that the function is not well defined; rather, 0 is not in the domain of
In order to avoid the quotation marks around "define" in the previous simple example, the "definition" of
could be broken down into two logical steps:
While the definition in step 1 is formulated with the freedom of any definition and is certainly effective (without the need to classify it as "well defined"), the assertion in step 2 has to be proven.
, which makes the binary relation
not functional (as defined in Binary relation#Special types of binary relations) and thus not well defined as a function.
is also called ambiguous at point
(although there is per definitionem never an "ambiguous function"), and the original "definition" is pointless.
Despite these subtle logical problems, it is quite common to use the term definition (without apostrophes) for "definitions" of this kind, for three reasons:
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.
The result of a function application must then not depend on the choice of representative.
denotes the congruence class of n mod m.
is well defined, because: As a counter example, the converse definition: does not lead to a well-defined function, since e.g.
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.
Therefore, similar holds for any representative of
the same, irrespective of the choice of representative.
For real numbers, the product
[1] This property, also known as associativity of multiplication, guarantees the result does not depend on the sequence of multiplications; therefore, a specification of the sequence can be omitted.
The subtraction operation is non-associative; despite that, there is a convention that
On the other hand, Division is non-associative, and in the case of
, parenthesization conventions are not well established; therefore, this expression is often considered ill-defined.
Unlike with functions, notational ambiguities can be overcome by means of additional definitions (e.g., rules of precedence, associativity of the operator).
For example, in the programming language C, the operator - for subtraction is left-to-right-associative, which means that a-b-c is defined as (a-b)-c, and the operator = for assignment is right-to-left-associative, which means that a=b=c is defined as a=(b=c).
[3] In the programming language APL there is only one rule: from right to left – but parentheses first.
A solution to a partial differential equation is said to be well-defined if it is continuously determined by boundary conditions as those boundary conditions are changed.