There are some functions f that can be composed with themselves. But is there a function which can be applied to itself? In other words, is there a function f such that f is an element of Domain(f)?
-
5This is actually quite an interesting question. I'm very surprised at the vote to close. Shame on you, whoever voted to close! – MPW Sep 10 '14 at 02:54
-
This might depend on the technical definition you adopt of what a function is. Is a function from $A$ to $B$ a triple $(\Gamma,A,B)$ for example, where $\Gamma$ is the graph of the function (following Bourbaki)? Or is it just $\Gamma$ (following most set theorists)? Either way, I think it contradicts the Axiom of Foundation, but it's better to fix one possibile definition if anyone wants to give a proof. – Dave Sep 10 '14 at 02:57
-
1I'm not certain it's a duplicate, but this earlier question seems similar: http://math.stackexchange.com/q/248372/137524 – Semiclassical Sep 10 '14 at 03:01
-
@Dave What do you mean by the axiom of foundation? I'm not sure I know that the set theory axiom you refer to by that name. – Mathemagician1234 Sep 10 '14 at 03:01
-
http://en.wikipedia.org/wiki/Axiom_of_regularity – Dave Sep 10 '14 at 03:02
-
My definition is the "set of ordered pairs" definition. – user107952 Sep 10 '14 at 03:03
-
That would just be $\Gamma$. – Dave Sep 10 '14 at 03:03
-
@user107952 The ordered pair definition is the correct definition of function,regardless of what the category theorists think. – Mathemagician1234 Sep 10 '14 at 03:05
-
1I like that you'd get a completely different kind of answer if you asked this exact question on stack overflow. – Hao Ye Sep 10 '14 at 08:02
-
@MPW: Yeah, you would just like to find those people and punish them for being so ignorant! Lol! ^^ – HelloGoodbye Sep 10 '14 at 12:41
-
5@HaoYe If you asked this question on stackoverflow, you wouldn't be able to work out if the discussion would ever halt. – Tom Tanner Sep 10 '14 at 13:00
-
I think I've heard that in combinatory logic (whick I am know from nothing) thee are things like functions which can be applied to themselves. If somebody reading this knows if that's so and what it means, please comment. – bof Sep 11 '14 at 11:51
-
1@bof: this is closely related to my answer; combinatory logic is (more or less) a more complicated version of the basic $\lambda$ calculus. – Carl Mummert Sep 15 '14 at 00:09
4 Answers
The answer is no, if the axiom of foundation is accepted as part of set theory. (If it isn't, then this question possibly becomes much more difficult and interesting, and too difficult for me.)
For assume we have a pair $(f,y)$ that belongs to $f$. We have $(f,y) = \{ \{f\},\{f,y\} \}$ Then:
$$f \in \{ f \} \in (f,y) \in f$$
Thus the nonempty set $C = \{ f, \{f\}, (f,y) \}$ doesn't have an $\in$-minimal element. That is, there is no element $x$ of $C$ such that $x \cap C = \emptyset$. This contradicts the axiom of foundation.
- 2,157
-
I don't see how you can have a consistent set theory without the axiom of regularity, Dave. The important thing to keep in mind here is that the questioner didn't ask about composition of maps,but whether or not a map itself can be a member of it's own domain. That's really where confusion can come in if you're not careful and for exactly the reason you give,the answer's no. – Mathemagician1234 Sep 10 '14 at 03:17
-
11@Mathemagician1234 You can't make a theory inconsistent by removing an axiom. It only widens the possibilities of what could happen. Jech's book Set Theory considers models of set theory in which the axiom of foundation is violated, but I'm not competent to discuss the methods of constructing them. Let me add that I'm not sure I understand what you're getting at with your comment. My answer doesn't concern composition of maps; it concerns whether $f(f)$ is something that can exist or not. – Dave Sep 10 '14 at 03:20
-
That was precisely my point. A beginner could easily confuse the 2 and miss that the questioner was asking a much deeper question. And you're correct-I should have used the term WORKING rather then consistent,whicb of course has a technical meaning in mathematics. My bad,I should know better by now. – Mathemagician1234 Sep 10 '14 at 04:34
-
5The axiom of foundation can be dropped from set theory and you can still do a lot (virtually all of "normal" mathematics). Only set theorists would miss it. – Dave Sep 10 '14 at 04:35
-
it looks to me like even w/o foundation you get the result thanks to Joel Bosveld's observation about cardinality in the other answer – hunter Sep 10 '14 at 11:22
-
1Hunter, it seems to me that in mathematical terms, Joel Bosveld is answering a different question. Without judging whether it is a legitimate interpretation of the OP's question, it doesn't answer the question the way I've interpreted it. – Dave Sep 10 '14 at 11:39
-
What about this function? $$f(x) = \begin{cases} 1 & \mbox{if } x = f \ 0 & \mbox{otherwise} \end{cases}$$ – HelloGoodbye Sep 10 '14 at 12:48
-
@HelloGoodbye: In set theory, a function always has a set, called its domain, on which it it defined (and standard ZF set theory does not allow a function to be defined on "the set of all sets", because no such set exists in ZF). The axiom of foundation implies that no function can be part of its own domain. Of course, you're still free to define a function $f$ as above on some domain that doesn't include $f$, but then the definition just becomes equivalent to $f(x) = 0$ for all $x$. – Ilmari Karonen Sep 10 '14 at 15:35
-
1Anyway, in some set theories without foundation, you can have functions that belong to their own domain. Even if such functions are allowed, though, self-referential definitions can be tricky. For example, consider the functions $$f(x) = \begin{cases} 1 & \text{if } x = f \ 0 & \text{otherwise,} \end{cases} \quad g(x) = \begin{cases} 1 & \text{if } x = g \ 0 & \text{otherwise} \end{cases}$$ defined on some domain known to include both $f$ and $g$; is $f = g$ or not? Absent additional axioms or assumptions, I believe either possibility should be consistent with ZF minus foundation. – Ilmari Karonen Sep 10 '14 at 15:44
-
@IlmariKaronen: Okay, I see the dilemma. But don't you have the same problem for ordinary functions? Say $f(x) = \sin(x),\ g(x) = \sin(x)$; are $f$ and $g$ the same function? – HelloGoodbye Sep 10 '14 at 20:59
-
@HelloGoodbye: In standard set theory, yes they are, by the axiom of extensionality. (While you can, sort of, do set theory without extensionality, things get even muddier than just without foundation. Basically, it gets really hard to define anything uniquely, if you can't be sure that two things with exactly the same properties are really the same thing.) – Ilmari Karonen Sep 10 '14 at 21:35
-
@HelloGoodbye The problem with your definition is that the function $f$ is defined for all sets $x$. (Every object is a set in conventional set theory.) Thus $f$ is what can be called a class function with domain $V$, the universal class, that is, the class of all sets. The universal class $V$ is not a set (a proof of this is based on Russell's paradox), and it follows that the function $f$ itself cannot be a set. But it's worse than that: since $f$ is a proper class, rather than a set, $f$ does not even belong to $V$, and so does not belong to the domain of $f$. – Dave Sep 11 '14 at 00:59
-
Since I always have to chime in with things like this, in NF(U) it's easy to construct examples of such functions (NF violates both foundation and Cantor's theorem). Let $g$ be any permutation of $V$, and let $Q$ be ${\langle f,g\circ f\rangle : f\in Funct}$. $Q$ is a function itself, hence it's in $Funct$, and therefore a member of its own domain. – Malice Vidrine Sep 11 '14 at 11:58
-
What about $ZF$ without the axiom of foundation? Is the OP's statement consistent with that theory? – Dave Sep 11 '14 at 21:45
-
As several people have pointed out, this is impossible when we view a function as a "set of ordered pairs". But, if we view a function instead as an algorithm, then it is perfectly possible. For example, I can write a python program that takes a string of characters as input and returns the number of characters in the string. I can then apply this program to itself to determine how many characters it has.
This concept is pushed to the limit in functional programming languages such as Scheme and in the untyped $\lambda$ calculus. These languages eliminate the difference between "code" and "data".
One challenge in finding semantic models for these languages is the set theoretic difficulties mentioned above. But there are, in fact, semantic models for these languages. This is what user322483 referred to in his or her answer.
- 84,178
Yes, see http://en.wikipedia.org/wiki/Domain_theory .
It will not work for the set theoretic definition of a function $f: A\to B \in B^A$ since $B^A \cap A = \emptyset$ when constructed in the category $\cal Set$. This construction is possible in the category of domains, though.
- 59
A function $f:A\to B$ can be seen as an element of the set $B^A$. For a function to act on itself, we need a map $g:B^A\to A$. We would also want this map to be a bijection, so that elements of $B^A$ are identified with elements of $A$.
This would require $|B|^{|A|}=|A|$, so $|A|=1$ and $|B|\in\{0,1\}$.
If we have $\mathbb{id}:\{\mathbb{1}\}\to\{\mathbb{1}\}$, given by $\mathbb{1}\mapsto\mathbb{id}(\mathbb{1})=\mathbb{1}$. If we identify $\mathbb{id}$ with $\mathbb{1}$, then $\mathbb{1}(\mathbb{1})=\mathbb{1}$ makes some amount of sense.
So the answer is no, except in some way for trivial cases.
- 738
- 5
- 10
-
There's is one thing that isn't obvious to me: why do we need a map $g : B^A \mapsto A$? I don't understand what it is for. – Paul Manta Sep 10 '14 at 10:05
-
@PaulManta, the function is an element of $B^A$ and acts on the elements of $A$. For the function to act on itself, we need a way of identifying elements of $B^A$ with elements of $A$ (so that the function can be considered as an element of its domain); that is, we need a bijection $g:B^A\to A$. – Joel Bosveld Sep 10 '14 at 10:57
-
I think I disagree that a bijection $B^A = A$ is good enough for OP; OP wants literal equality of sets. However, your cardinality obstruction is still true and I think answers the question even when we drop the axiom of foundation. See the other answer. – hunter Sep 10 '14 at 11:23
-
6I don't agree that you need to identify all elements of $B^A$ with elements of $A$. Just because $f(f)$ is defined doesn't mean that $f(h)$ needs to be defined for all functions $h$ with the same domain and target set as $f$. – Dave Sep 10 '14 at 11:38
-
1However, if you restrict yourself to continuous functions only, $B^A\simeq A$ may hold. That's why untyped lambda-calculus, where self-application is allowed, has a set-theoretic model. – Joker_vD Sep 10 '14 at 11:50
-
1I agree with Dave. If we had no axiom of regularity, but instead had, for instance, some version of Aczel's anti-foundation axiom, we could extend any function to a function with itself in its domain (as a fixed point, for example). – tomasz Sep 10 '14 at 12:31