text: # When does injectivity imply surjectivity?
  
  I'm aware of the existence of this question: Surjectivity implies injectivity
  
  However, the question is regarding a finite set $S$. I was wondering, though: What happens when $S$ is an infinite set? Zhen Lin addresses this cases in his answer, by saying that it ceases to be necessarily true, for example $f:\mathbb{N}\rightarrow \mathbb{N}$ defined by $x \mapsto x+1$ is injective but not surjective.
  
  My question is: what happens if $S = \mathbb{R}$? Constructing a counterexample for $S=\mathbb{N}$ seems simple enough, but I'm struggling to find a function $f:\mathbb{R}\rightarrow \mathbb{R}$ that's injective but not surjective. Does such a function even exist? If so, how to construct it?
  
  And perhaps a more general question (maybe too broad): For which infinite sets $S$ there is a function $f:S\rightarrow S$ such that $f$ is injective but not surjective?
  
  • $\exp{}{}{}{}{}$ Jun 22, 2014 at 6:08
  • That every infinite set is Dedekind-infinite requires some very weak form of choice. For example, the assumption that every infinite set contains a countable subset is sufficient.
  – user123641
  Jun 22, 2014 at 6:23
  • If you already have such an $f$ for $\mathbb{N}$, just extend it to $\mathbb{R}$ by defining it as the identity on $\mathbb{R} \cap \mathbb{N}^C$ Jun 22, 2014 at 13:08
  • This is, to some extent, related: Equivalent characterisations of Dedekind-finite proof Nov 24, 2016 at 10:14
  
  The function $f(x) = \arctan x$ is injective but clearly not surjective on $\mathbb{R}$.
  $f(x)=\arctan x$, for example, is injective but not surjective.
  For your second question, let $S$ be an infinite set and $f:S\to S$ be any injection. Then fix some $x_0$ in $S$. Then, since $S$ is infinite, $|S|=|S\setminus\{x_0\}|$ ($|A|$ is the cardinal of a set $A$), so there exists a bijection $\phi$ of $S$ onto $S\setminus\{x_0\}$. Then $\phi\circ f$ seen as an application from $S$ into $S$ is injective but not surjective.
explanation: The provided text is a discussion about the conditions under which injectivity implies surjectivity, particularly for infinite sets. The user poses a specific question about the existence of a function \( f: \mathbb{R} \to \mathbb{R} \) that is injective but not surjective, and also asks a more general question about which infinite sets \( S \) have such functions. The text includes a response suggesting the function \( f(x) = \arctan x \) as an example for \( \mathbb{R} \), and a more general construction for any infinite set \( S \).
distilabel_metadata.content: Evaluate the user given text extract and determine if it contains a math question and optionally and answer to this question.
  
  Output rules:
  
  1. Briefly describe the document and mention if it contains a question or a question and answer.
  2. Finalize the output with: Label: no-question,question,question-and-answer,multiple-question,multiple-question-and-answer
distilabel_metadata.role: system
distilabel_metadata.content: # When does injectivity imply surjectivity?
  
  I'm aware of the existence of this question: Surjectivity implies injectivity
  
  However, the question is regarding a finite set $S$. I was wondering, though: What happens when $S$ is an infinite set? Zhen Lin addresses this cases in his answer, by saying that it ceases to be necessarily true, for example $f:\mathbb{N}\rightarrow \mathbb{N}$ defined by $x \mapsto x+1$ is injective but not surjective.
  
  My question is: what happens if $S = \mathbb{R}$? Constructing a counterexample for $S=\mathbb{N}$ seems simple enough, but I'm struggling to find a function $f:\mathbb{R}\rightarrow \mathbb{R}$ that's injective but not surjective. Does such a function even exist? If so, how to construct it?
  
  And perhaps a more general question (maybe too broad): For which infinite sets $S$ there is a function $f:S\rightarrow S$ such that $f$ is injective but not surjective?
  
  • $\exp{}{}{}{}{}$ Jun 22, 2014 at 6:08
  • That every infinite set is Dedekind-infinite requires some very weak form of choice. For example, the assumption that every infinite set contains a countable subset is sufficient.
  – user123641
  Jun 22, 2014 at 6:23
  • If you already have such an $f$ for $\mathbb{N}$, just extend it to $\mathbb{R}$ by defining it as the identity on $\mathbb{R} \cap \mathbb{N}^C$ Jun 22, 2014 at 13:08
  • This is, to some extent, related: Equivalent characterisations of Dedekind-finite proof Nov 24, 2016 at 10:14
  
  The function $f(x) = \arctan x$ is injective but clearly not surjective on $\mathbb{R}$.
  $f(x)=\arctan x$, for example, is injective but not surjective.
  For your second question, let $S$ be an infinite set and $f:S\to S$ be any injection. Then fix some $x_0$ in $S$. Then, since $S$ is infinite, $|S|=|S\setminus\{x_0\}|$ ($|A|$ is the cardinal of a set $A$), so there exists a bijection $\phi$ of $S$ onto $S\setminus\{x_0\}$. Then $\phi\circ f$ seen as an application from $S$ into $S$ is injective but not surjective.
distilabel_metadata.role: user
distilabel_metadata.raw_output_q_a_detector_0: The provided text is a discussion about the conditions under which injectivity implies surjectivity, particularly for infinite sets. The user poses a specific question about the existence of a function \( f: \mathbb{R} \to \mathbb{R} \) that is injective but not surjective, and also asks a more general question about which infinite sets \( S \) have such functions. The text includes a response suggesting the function \( f(x) = \arctan x \) as an example for \( \mathbb{R} \), and a more general construction for any infinite set \( S \).
  
  Label: question-and-answer