# What is the proper term for a function where domain and codomain coincide?

What is the proper term for a function where domain and codomain coincide?

E.g. in programming languages a function f : Int => Int or f : Double => Double. Thanks.

-

Suppose we have a function $f:S\to S$, that is $f$ is a function from $S$ with image (range) in $S$. Such a function is called an endomorphism endofunction (endo comes from the greek or latin word for "within"). Sometimes people use the term codomain to mean the image (range) of a function. If $S$ is finite and the image of $f$ is the whole set $S$, then $f$ is a bijection. If $S$ is infinite, the situation is somewhat more complicated.

Edit: Thanks for the correction.

-
That is not correct. A morphism which maps a mathematical object $S$ to itself is called an endomorphism. A morphism is a function which preserves structure. A function is just a map - it doesn't care about structure. –  user1729 Nov 14 '11 at 10:25
How about endofunction? –  Frank Abagnale Nov 14 '11 at 10:47
This is the first time I heard of endofunction ever! –  lhf Nov 14 '11 at 10:56
@user1729: A rigorous definition of a morphism is found in category theory. A morphism need not even be a function. Answering "endomorphism (in $Set$)" is correct. –  sdcvvc Nov 14 '11 at 11:33
@user1729: As I said, in category Set, a morphism $X \to Y$ is (any) function from $X$ to $Y$. –  sdcvvc Nov 14 '11 at 12:58

I would like to add this as a comment, but I don't have enough reputation to do so.

A function $f:S\to S$ can be called an endomorphism in Set, and one doesn't have to worry about the structure-preservation that is implied by -morphism because sets have no additional structure to preserve.

However, it depends on the context: if I want to talk about any function $f:V\to V$, $V$ being a vector space, and I were to use the term endomorphism, it would be understood that $f$ is a linear transformation, because the morphisms in $K$-Vect are linear transformations.

-

I don't think there is a widespread term for that which is acceptable in all contexts, but a function $X\to X$ is sometimes called a function on $X$ or an operator on $X$ or a unary operation on $X$.

-