2

The exercise is to give an example for two sets $M$ and $N$, and functions $f$ and $g$, for which $f \circ g = id_M$, but $g \circ f \ne id_N$.

My idea is a bit based on my computer programming background, where (x/2)*2 is 0 for integers. Here it is:

$$M=N=\mathbb{N_0}.$$ $$f: \mathbb{N_0} \rightarrow \mathbb{N_0}, g: \mathbb{N_0} \rightarrow \mathbb{N_0}.$$ $$f(x) = 2x, g(x) = x \div 2.$$

Thus,

$$(g\circ f)(x) = g(f(x)) = g(2x) = 2x\div 2 = x = id_\mathbb{N_0}$$ $$(f\circ g)(x) = f(g(x)) = f(x\div2) = (x\div2)\cdot2 \ne id_\mathbb{N_0}$$

Because if $f(g(1)) = f(0) = (0\div 2)\cdot2 = 0$, and $0\ne 1$, it follows that $(f\circ g) \ne id_\mathbb{N_0}$

Is my example valid?

phresnel
  • 143
  • What is $g(1)$? – Arthur Oct 22 '13 at 15:37
  • 1
    The example almost works, but we usually write $\left\lfloor\dfrac{x}{2}\right\rfloor$ instead of $x\div 2$, and you have swapped $f$ and $g$. – Daniel Fischer Oct 22 '13 at 15:39
  • @Arthur: Oh, that was actually my intention. – phresnel Oct 22 '13 at 15:39
  • 1
    @phresnel I think Arthur's $\mathbb{N}$ starts with $1$. It's not universally agreed upon whether $0$ is a natural number. – Daniel Fischer Oct 22 '13 at 15:40
  • I was assuming that $\mathbb{N}$ started with $1$ because it was specified so in the OP. The example works for $\mathbb{N} = {0,1,\ldots}$. – Arthur Oct 22 '13 at 15:41
  • In my example, $\mathbb{N}$ excludes $0$. – phresnel Oct 22 '13 at 15:43
  • Yes, this property is "$f$ has a left inverse" or "$g$ has a right inverse". A function is injective iff it has a left inverse (like $x \mapsto 2x$), and a function is surjective iff* it has a right inverse (like $x \mapsto \lfloor \frac{x}{2} \rfloor$). *Well, assuming the Axiom of Choice. – Henry Swanson Oct 22 '13 at 15:51
  • @tfwcantintomath: I thought it makes sense, because if some $x\notin \mathbb{N}$, then it is not valid "input" to mentioned functions. – phresnel Oct 22 '13 at 16:05
  • The example still does not work. If $g$ is a function with codomain $\mathbb{N}$, then you cannot have $g(1) = 0$, as $0$ is not an element of the codomain. A simple way to fix this is to take $M = N = \mathbb{N}_0 = {0,1,2,\ldots}$. Then you still have $f(g(1)) = 0 \neq 1 = g(f(1))$. – Arthur Oct 22 '13 at 16:24
  • @Arthur: I have for now settled to $\mathbb{N_0}$. For my initial version, excluding $0$s, would the argument "$f(g(1)) = f(0) = undefined$" be valid? – phresnel Oct 22 '13 at 16:29
  • There is no such thing as undefined. For a function, every element of the domain has to be mapped somewhere. So your original $g$ was not a function. – Arthur Oct 22 '13 at 16:30
  • @Arthur: Just to clarify the terminology: If I have $g: \mathbb{N_0} \rightarrow \mathbb{N_0}$, then I say "$g(-1)$ is not a function"? – phresnel Oct 22 '13 at 16:33

2 Answers2

2

Yes, your example is valid, and your overall argument for it is good. You have a few minor errors in details and notation, though. $\newcommand{\id}{\mathit{id}} \newcommand{\N}{\mathbb{N}}$

  • In your line “$(g \circ f)(x) = \cdots = x = \id_\mathbb{N}$”, the last item should be not $\id_\mathbb{N}$, but $\id_\mathbb{N}(x)$. All the earlier terms in this sequence of equalities are values of the function; $\id_\N$ refers to the whole function, not just the individual value.

  • In the line “$(f \circ g)(x) = \cdots \neq \id_\N$”, you again need to be more careful distinguishing between whole functions and individual values. At the level of individual values, it’s not always true that $(f \circ g)(x) \neq \id_\N(x)$; there are some values of $x$, e.g. $x = 2$, that make them equal. The key point is that there are some values, e.g. $x = 3$, that make them non-equal — $(f \cdot g)(3) = 2 \neq \id_\N 3$ — which implies that as functions, $(f \cdot g) \neq \id_\N$.

  • As others have said, your function $x \div 2$ would usually be called $\lfloor \frac{x}{2} \rfloor$. Since you explicitly define what you mean by $x \div 2$, though, I wouldn’t really consider this an error, just an issue of style.

0

A simpler example might be $M=[0,\infty)$ and $N = \mathbb{R}$ with $f(x) = \sqrt{x}$ and $g(x)=x^2$. You can check the details.

  • 1
    To me as a computer programmer with my integers, mine looks simpler :) However, I want to understand your example: Is yours a valid example, because for some $x$, $\sqrt{x} \in \mathbb{R\setminus Q}$? – phresnel Oct 22 '13 at 16:24
  • @phresnel: Why would $\sqrt{x}$ being irrational matter? What matters is that $(\sqrt{x})^2 = x$ for all $x \ge 0$, but it's not always the case that $\sqrt{x^2}=x$ for $x \in \mathbb{R}$, since e.g. $\sqrt{(-1)^2} = \sqrt{1} = 1$. – Clive Newstead Oct 22 '13 at 17:38