transmini said:
I have multiple problems in the current homework set that say something along the lines of "try to define a function f: S -> S by the rule f(n) = n^2 for each n in S. Then it asks a couple questions such as "is the function well defined" or "is it one-to-one/onto"
I'm just confused on what its actually wanting me to do. Could someone give like an example of what they mean? Because I would've though the rule that gave WAS the function.
When a book asks "is the function well-defined?", what they usually mean is "Does the above actually define a function?" In the case of the original question, the answer depends on whether it's clear from the context what multiplication operation is involved in the definition of the notation n^2.
It's usually obvious if a statement defines a function or not. When it's not, there's often an equivalence relation involved. Suppose that ~ is an equivalence relation on some set X. Then each element of X belongs to exactly one equivalence class. The equivalence class that contains x is denoted by [x]. The set of all equivalence classes is denoted by X/~. We can
try to define a function f with domain X/~ by specifying what we want f([x]) to be for each equivalence class [x], but if that specification is an expression that involves x rather than [x], then it might be hard to tell if the statement defines a function or not. You would have to try replacing the x in that expression with a variable that represents an arbitrary element of [x], and see if you can prove that the new expression represents the same thing as the old one.
In set theory, a function isn't a rule. It's useful to
think of it as a rule, but it's really a set, like everything else. There are several slightly different ways to define the term "function" in set theory. This one is appropriate for the problems you're working with:
Definition 1: A triple ##(X,Y,G)## such that ##G\subseteq X\times Y## is said to be a function from X into Y if
(a) For all x in X, there's a y in Y such that (x,y) is in G.
(b) For all y,z in Y, if (x,y)=(x,z) then y=z.
If f=(X,Y,G) is a function in the sense of definition 1, then X is called the domain of f, Y is called the codomain of f, and G is called the graph of f.
This one is also nice:
Definition 2: A set f of ordered pairs is said to be a function the following statement holds for all (x,y), (w,z) in f: If x=w then y=z.
The domain of f is then defined as the set of all x such that there's a y such that (x,y) is in f. (A more complicated statement is needed to make it clear that the definition of "domain" doesn't violate any set theory axioms, but this definition is accurate enough for our purposes).
What definition 2 calls a function is what definition 1 calls the graph of a function. The terms "codomain" and "surjective" are kind of pointless if you're using definition 2. That's why I think definition 1 is more appropriate for you.