In Whitehead and Russell's Principia, domain is the referents of relation; converse domain is the relata. Modern function in mathematics is just one special case of relation whose referent is unique when the relatum is given.
I notice that what is called in modern function "domain" is called "converse domain" in PM, and what is called "codomain" in modern function is actually called "domain" in PM. Because I am so used to modern concept, PM section D become unnecessarily difficult for me.
What's more astonishing is that y in PM takes the place of x (arguments) in modern math, and x in PM takes the place of y (value of a function). Coincidence beyond a point is impossible. If the person who made this twist does not have a good reason, I cannot rule out malice.
Russell knew fully well about the relation between habits and intelligence. If the convention existed before PM, Russell would never have redefined it backwards.
Best Answer
I've made some research, but I've found few elements.
I think that the source for codomain is PM's usage of converse domain.
Note (October 2016) : thanks to Bram28 for an early source from Cassius Jackson Keyser's Mathematical Philosophy, a Study of Fate and Freedom (1922), page 168 :
In Alonzo Church, Introduction to Mathematical Logic (1956), page 316, footnote 517, we have :
In Nicolas Bourbaki, Théorie des ensembles, page II.10 speaks of :
The english translation (1957) of Felix Hausdorff, Set theory (german ed 1937), page 16, speaks only of :
Paul Bernays, Axiomatic set theory (1958), page 609 :
Paul Halmos, Naive Set Theory (1960), page 27 :
Patrick Suppes, Axiomatic Set Theory (1960), page 58, use domain and range of a relation $R$.
JDonald Monk, Introduction to Set Theory (1969), page 21 :
Note - expanded April, 20.
W&R's usage of domain and converse domain is not different from "modern" one; see page 33-34 :
Indeed there is a difference, but one of (so to say) "style" only. See page 31 :
We are accustomed to symbolizing mathematical functions $f(x)=y$, where $x$ "range over" the domain of definition of the function and $y$ "span over" the codomain. In the "sin", we usually think to the graph of the trigonometric function $sin(x)$, where $x$ is the abscissa.
In PM, page 31, R&W use two examples of a (binary) relation R : the relation of son to father ("$x$ is the father of y") and the relation "$x$ is the sin of $y$"; in this second example, compared to usual mathematical usage, they have "exchanged the roles" of $x$ and $y$: if we "plot" the graph of this relation, the $y$ is the abscissa, while $x$ will describe the function sin.
Taking into account this particular choice of the symbols, consider page 32 :
Thus, if we apply it to sin, we have that its domain of definition will be the class of those arguments $y$ for which there is one $x$, and no more, having the relation sin to $y$, i.e.for which there is one and only one $x$ such that $x$ is the sin of $y$, i.e. $x= sin(y)$.
And this is no more nor less than "our" use of domain.
This is perfectly consistent with the definition of converse domain "$\hat y \{ \exists ! R‘y \} = D_C‘R$" [where I use $D_C$ in place of the "inverted-D"]. See page 34 :
But in our example, the relation is "$x$ is the sin of $y$" where $y$ is the argument which "range over" the domain. Thus $x$ is the value of the function $x=sin(y)$, which spans over the converse domain.