Proving $f(x)=|x|$ is onto












2












$begingroup$


I've been working on proving that this is a onto function:



$f$ : $mathbb R$ $to$ $mathbb R^{geq0}$ is defined by $f(x)=|x|$



My proof so far: Let $yinmathbb R$.



Rough work: $|x|=y Rightarrow sqrt {x^2}=y Rightarrow n^2=y^2 Rightarrow pm x=pm y$



Suppose $f(pm y)=|pm y|=y$.



I know that this function is definitely onto given the co-domain of $mathbb R^{geq0}$, but I feel like my proof is flawed. Am I supposed to individually account for the $-x$ and the $+x$ from $pm x=pm y$ when trying to solve $f(x) = y$?



Thanks!










share|cite|improve this question











$endgroup$








  • 1




    $begingroup$
    Let $ain mathbb R ^{geq 0}$. Then by definition, $|a|=a$. Therefore, $a$ is in the image of $f:xmapsto |x|$.
    $endgroup$
    – Arrow
    Mar 24 at 15:23






  • 6




    $begingroup$
    You proof is wrong from the beginning. You need to assume y is in the nonnegative reals and show you can find a real x that maps to it.
    $endgroup$
    – symplectomorphic
    Mar 24 at 15:24
















2












$begingroup$


I've been working on proving that this is a onto function:



$f$ : $mathbb R$ $to$ $mathbb R^{geq0}$ is defined by $f(x)=|x|$



My proof so far: Let $yinmathbb R$.



Rough work: $|x|=y Rightarrow sqrt {x^2}=y Rightarrow n^2=y^2 Rightarrow pm x=pm y$



Suppose $f(pm y)=|pm y|=y$.



I know that this function is definitely onto given the co-domain of $mathbb R^{geq0}$, but I feel like my proof is flawed. Am I supposed to individually account for the $-x$ and the $+x$ from $pm x=pm y$ when trying to solve $f(x) = y$?



Thanks!










share|cite|improve this question











$endgroup$








  • 1




    $begingroup$
    Let $ain mathbb R ^{geq 0}$. Then by definition, $|a|=a$. Therefore, $a$ is in the image of $f:xmapsto |x|$.
    $endgroup$
    – Arrow
    Mar 24 at 15:23






  • 6




    $begingroup$
    You proof is wrong from the beginning. You need to assume y is in the nonnegative reals and show you can find a real x that maps to it.
    $endgroup$
    – symplectomorphic
    Mar 24 at 15:24














2












2








2


2



$begingroup$


I've been working on proving that this is a onto function:



$f$ : $mathbb R$ $to$ $mathbb R^{geq0}$ is defined by $f(x)=|x|$



My proof so far: Let $yinmathbb R$.



Rough work: $|x|=y Rightarrow sqrt {x^2}=y Rightarrow n^2=y^2 Rightarrow pm x=pm y$



Suppose $f(pm y)=|pm y|=y$.



I know that this function is definitely onto given the co-domain of $mathbb R^{geq0}$, but I feel like my proof is flawed. Am I supposed to individually account for the $-x$ and the $+x$ from $pm x=pm y$ when trying to solve $f(x) = y$?



Thanks!










share|cite|improve this question











$endgroup$




I've been working on proving that this is a onto function:



$f$ : $mathbb R$ $to$ $mathbb R^{geq0}$ is defined by $f(x)=|x|$



My proof so far: Let $yinmathbb R$.



Rough work: $|x|=y Rightarrow sqrt {x^2}=y Rightarrow n^2=y^2 Rightarrow pm x=pm y$



Suppose $f(pm y)=|pm y|=y$.



I know that this function is definitely onto given the co-domain of $mathbb R^{geq0}$, but I feel like my proof is flawed. Am I supposed to individually account for the $-x$ and the $+x$ from $pm x=pm y$ when trying to solve $f(x) = y$?



Thanks!







proof-verification elementary-set-theory






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Mar 25 at 8:00









YuiTo Cheng

2,1512937




2,1512937










asked Mar 24 at 15:21









Nick SabiaNick Sabia

285




285








  • 1




    $begingroup$
    Let $ain mathbb R ^{geq 0}$. Then by definition, $|a|=a$. Therefore, $a$ is in the image of $f:xmapsto |x|$.
    $endgroup$
    – Arrow
    Mar 24 at 15:23






  • 6




    $begingroup$
    You proof is wrong from the beginning. You need to assume y is in the nonnegative reals and show you can find a real x that maps to it.
    $endgroup$
    – symplectomorphic
    Mar 24 at 15:24














  • 1




    $begingroup$
    Let $ain mathbb R ^{geq 0}$. Then by definition, $|a|=a$. Therefore, $a$ is in the image of $f:xmapsto |x|$.
    $endgroup$
    – Arrow
    Mar 24 at 15:23






  • 6




    $begingroup$
    You proof is wrong from the beginning. You need to assume y is in the nonnegative reals and show you can find a real x that maps to it.
    $endgroup$
    – symplectomorphic
    Mar 24 at 15:24








1




1




$begingroup$
Let $ain mathbb R ^{geq 0}$. Then by definition, $|a|=a$. Therefore, $a$ is in the image of $f:xmapsto |x|$.
$endgroup$
– Arrow
Mar 24 at 15:23




$begingroup$
Let $ain mathbb R ^{geq 0}$. Then by definition, $|a|=a$. Therefore, $a$ is in the image of $f:xmapsto |x|$.
$endgroup$
– Arrow
Mar 24 at 15:23




6




6




$begingroup$
You proof is wrong from the beginning. You need to assume y is in the nonnegative reals and show you can find a real x that maps to it.
$endgroup$
– symplectomorphic
Mar 24 at 15:24




$begingroup$
You proof is wrong from the beginning. You need to assume y is in the nonnegative reals and show you can find a real x that maps to it.
$endgroup$
– symplectomorphic
Mar 24 at 15:24










5 Answers
5






active

oldest

votes


















21












$begingroup$

In order to show that the function is onto (surjective) it is enough to argue that for each $y$ in the codomain there is at least one $x$ in the domain that maps to it.



You seem to be trying to find all of the $x$ such that $f(x)=y$, which is more work than you need to do and creates a rather large detour.



You could just say:




Let $yinmathbb R^{ge 0}$ be given. Then $f(y)=|y|=y$, so by setting $x=y$ we find an $xinmathbb R$ such that $f(x)=y$. Since $y$ was arbitrary this proves that $f$ is surjective.




(Even this is more verbose than it really needs to be, but in exercises at this elementary level it is good to be explicit about the details, to show that you know what you're doing).






share|cite|improve this answer









$endgroup$









  • 2




    $begingroup$
    (+1) Because this is a vey pedagogical answer.
    $endgroup$
    – José Carlos Santos
    Mar 24 at 15:33



















4












$begingroup$


Am I supposed to individually account for the -x and the +x from ±x=±y when trying to solve f(x)=y?




No.



You are simply supposed to show that for any general arbitrary $y in mathbb R^{ge 0}$ that there is, at least (you don't have to find them all), one $xin mathbb R$ so that $|x| = y$.



As $|y| = y$ this is very easy. And you are done.



The proof is two lines:



1) Let $y in mathbb R^{ge 0}$.



2) $f(y) = |y| = y$.






share|cite|improve this answer









$endgroup$





















    2












    $begingroup$

    You should not start with $yinmathbb R$ but rather with $yinmathbb{R}^{geqslant0}$. Then $y=f(y)$. Since this happens for every $yinmathbb{R}^{geqslant 0}$, $f$ is onto.






    share|cite|improve this answer











    $endgroup$





















      0












      $begingroup$

      Well, you want to show that $f$ is onto. So take an arbitrary element $yin{Bbb R}_{geq 0}$ from the image set and find a preimage. Here a preimage is $y$ itself or even $-y$, since $|-y|=y$.






      share|cite|improve this answer









      $endgroup$





















        0












        $begingroup$

        More generally, If $B subseteq A$ and $f: A rightarrow B$ is a continuous mapping with $f(b) = b$ for all $b in B$ then $f$ is called a retraction of $A$ onto $B$. It is trivial that any such $f$ is onto since $f(b) = b$ for all $b in B$ immediately implies that all such $b$ are in the range. Note that continuity really plays no role in this. Thinking of $|x|$ as a retraction is perhaps overkill, but shows that the proof that it is onto the nonnegative reals is a special case of a more general (and equally easy to prove) result.






        share|cite|improve this answer









        $endgroup$














          Your Answer





          StackExchange.ifUsing("editor", function () {
          return StackExchange.using("mathjaxEditing", function () {
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
          });
          });
          }, "mathjax-editing");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "69"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          noCode: true, onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3160658%2fproving-fx-x-is-onto%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          5 Answers
          5






          active

          oldest

          votes








          5 Answers
          5






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          21












          $begingroup$

          In order to show that the function is onto (surjective) it is enough to argue that for each $y$ in the codomain there is at least one $x$ in the domain that maps to it.



          You seem to be trying to find all of the $x$ such that $f(x)=y$, which is more work than you need to do and creates a rather large detour.



          You could just say:




          Let $yinmathbb R^{ge 0}$ be given. Then $f(y)=|y|=y$, so by setting $x=y$ we find an $xinmathbb R$ such that $f(x)=y$. Since $y$ was arbitrary this proves that $f$ is surjective.




          (Even this is more verbose than it really needs to be, but in exercises at this elementary level it is good to be explicit about the details, to show that you know what you're doing).






          share|cite|improve this answer









          $endgroup$









          • 2




            $begingroup$
            (+1) Because this is a vey pedagogical answer.
            $endgroup$
            – José Carlos Santos
            Mar 24 at 15:33
















          21












          $begingroup$

          In order to show that the function is onto (surjective) it is enough to argue that for each $y$ in the codomain there is at least one $x$ in the domain that maps to it.



          You seem to be trying to find all of the $x$ such that $f(x)=y$, which is more work than you need to do and creates a rather large detour.



          You could just say:




          Let $yinmathbb R^{ge 0}$ be given. Then $f(y)=|y|=y$, so by setting $x=y$ we find an $xinmathbb R$ such that $f(x)=y$. Since $y$ was arbitrary this proves that $f$ is surjective.




          (Even this is more verbose than it really needs to be, but in exercises at this elementary level it is good to be explicit about the details, to show that you know what you're doing).






          share|cite|improve this answer









          $endgroup$









          • 2




            $begingroup$
            (+1) Because this is a vey pedagogical answer.
            $endgroup$
            – José Carlos Santos
            Mar 24 at 15:33














          21












          21








          21





          $begingroup$

          In order to show that the function is onto (surjective) it is enough to argue that for each $y$ in the codomain there is at least one $x$ in the domain that maps to it.



          You seem to be trying to find all of the $x$ such that $f(x)=y$, which is more work than you need to do and creates a rather large detour.



          You could just say:




          Let $yinmathbb R^{ge 0}$ be given. Then $f(y)=|y|=y$, so by setting $x=y$ we find an $xinmathbb R$ such that $f(x)=y$. Since $y$ was arbitrary this proves that $f$ is surjective.




          (Even this is more verbose than it really needs to be, but in exercises at this elementary level it is good to be explicit about the details, to show that you know what you're doing).






          share|cite|improve this answer









          $endgroup$



          In order to show that the function is onto (surjective) it is enough to argue that for each $y$ in the codomain there is at least one $x$ in the domain that maps to it.



          You seem to be trying to find all of the $x$ such that $f(x)=y$, which is more work than you need to do and creates a rather large detour.



          You could just say:




          Let $yinmathbb R^{ge 0}$ be given. Then $f(y)=|y|=y$, so by setting $x=y$ we find an $xinmathbb R$ such that $f(x)=y$. Since $y$ was arbitrary this proves that $f$ is surjective.




          (Even this is more verbose than it really needs to be, but in exercises at this elementary level it is good to be explicit about the details, to show that you know what you're doing).







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          answered Mar 24 at 15:25









          Henning MakholmHenning Makholm

          242k17308552




          242k17308552








          • 2




            $begingroup$
            (+1) Because this is a vey pedagogical answer.
            $endgroup$
            – José Carlos Santos
            Mar 24 at 15:33














          • 2




            $begingroup$
            (+1) Because this is a vey pedagogical answer.
            $endgroup$
            – José Carlos Santos
            Mar 24 at 15:33








          2




          2




          $begingroup$
          (+1) Because this is a vey pedagogical answer.
          $endgroup$
          – José Carlos Santos
          Mar 24 at 15:33




          $begingroup$
          (+1) Because this is a vey pedagogical answer.
          $endgroup$
          – José Carlos Santos
          Mar 24 at 15:33











          4












          $begingroup$


          Am I supposed to individually account for the -x and the +x from ±x=±y when trying to solve f(x)=y?




          No.



          You are simply supposed to show that for any general arbitrary $y in mathbb R^{ge 0}$ that there is, at least (you don't have to find them all), one $xin mathbb R$ so that $|x| = y$.



          As $|y| = y$ this is very easy. And you are done.



          The proof is two lines:



          1) Let $y in mathbb R^{ge 0}$.



          2) $f(y) = |y| = y$.






          share|cite|improve this answer









          $endgroup$


















            4












            $begingroup$


            Am I supposed to individually account for the -x and the +x from ±x=±y when trying to solve f(x)=y?




            No.



            You are simply supposed to show that for any general arbitrary $y in mathbb R^{ge 0}$ that there is, at least (you don't have to find them all), one $xin mathbb R$ so that $|x| = y$.



            As $|y| = y$ this is very easy. And you are done.



            The proof is two lines:



            1) Let $y in mathbb R^{ge 0}$.



            2) $f(y) = |y| = y$.






            share|cite|improve this answer









            $endgroup$
















              4












              4








              4





              $begingroup$


              Am I supposed to individually account for the -x and the +x from ±x=±y when trying to solve f(x)=y?




              No.



              You are simply supposed to show that for any general arbitrary $y in mathbb R^{ge 0}$ that there is, at least (you don't have to find them all), one $xin mathbb R$ so that $|x| = y$.



              As $|y| = y$ this is very easy. And you are done.



              The proof is two lines:



              1) Let $y in mathbb R^{ge 0}$.



              2) $f(y) = |y| = y$.






              share|cite|improve this answer









              $endgroup$




              Am I supposed to individually account for the -x and the +x from ±x=±y when trying to solve f(x)=y?




              No.



              You are simply supposed to show that for any general arbitrary $y in mathbb R^{ge 0}$ that there is, at least (you don't have to find them all), one $xin mathbb R$ so that $|x| = y$.



              As $|y| = y$ this is very easy. And you are done.



              The proof is two lines:



              1) Let $y in mathbb R^{ge 0}$.



              2) $f(y) = |y| = y$.







              share|cite|improve this answer












              share|cite|improve this answer



              share|cite|improve this answer










              answered Mar 24 at 16:04









              fleabloodfleablood

              73.6k22891




              73.6k22891























                  2












                  $begingroup$

                  You should not start with $yinmathbb R$ but rather with $yinmathbb{R}^{geqslant0}$. Then $y=f(y)$. Since this happens for every $yinmathbb{R}^{geqslant 0}$, $f$ is onto.






                  share|cite|improve this answer











                  $endgroup$


















                    2












                    $begingroup$

                    You should not start with $yinmathbb R$ but rather with $yinmathbb{R}^{geqslant0}$. Then $y=f(y)$. Since this happens for every $yinmathbb{R}^{geqslant 0}$, $f$ is onto.






                    share|cite|improve this answer











                    $endgroup$
















                      2












                      2








                      2





                      $begingroup$

                      You should not start with $yinmathbb R$ but rather with $yinmathbb{R}^{geqslant0}$. Then $y=f(y)$. Since this happens for every $yinmathbb{R}^{geqslant 0}$, $f$ is onto.






                      share|cite|improve this answer











                      $endgroup$



                      You should not start with $yinmathbb R$ but rather with $yinmathbb{R}^{geqslant0}$. Then $y=f(y)$. Since this happens for every $yinmathbb{R}^{geqslant 0}$, $f$ is onto.







                      share|cite|improve this answer














                      share|cite|improve this answer



                      share|cite|improve this answer








                      edited Mar 24 at 15:41









                      J. W. Tanner

                      4,0171320




                      4,0171320










                      answered Mar 24 at 15:26









                      José Carlos SantosJosé Carlos Santos

                      171k23132240




                      171k23132240























                          0












                          $begingroup$

                          Well, you want to show that $f$ is onto. So take an arbitrary element $yin{Bbb R}_{geq 0}$ from the image set and find a preimage. Here a preimage is $y$ itself or even $-y$, since $|-y|=y$.






                          share|cite|improve this answer









                          $endgroup$


















                            0












                            $begingroup$

                            Well, you want to show that $f$ is onto. So take an arbitrary element $yin{Bbb R}_{geq 0}$ from the image set and find a preimage. Here a preimage is $y$ itself or even $-y$, since $|-y|=y$.






                            share|cite|improve this answer









                            $endgroup$
















                              0












                              0








                              0





                              $begingroup$

                              Well, you want to show that $f$ is onto. So take an arbitrary element $yin{Bbb R}_{geq 0}$ from the image set and find a preimage. Here a preimage is $y$ itself or even $-y$, since $|-y|=y$.






                              share|cite|improve this answer









                              $endgroup$



                              Well, you want to show that $f$ is onto. So take an arbitrary element $yin{Bbb R}_{geq 0}$ from the image set and find a preimage. Here a preimage is $y$ itself or even $-y$, since $|-y|=y$.







                              share|cite|improve this answer












                              share|cite|improve this answer



                              share|cite|improve this answer










                              answered Mar 24 at 15:24









                              WuestenfuxWuestenfux

                              5,3231513




                              5,3231513























                                  0












                                  $begingroup$

                                  More generally, If $B subseteq A$ and $f: A rightarrow B$ is a continuous mapping with $f(b) = b$ for all $b in B$ then $f$ is called a retraction of $A$ onto $B$. It is trivial that any such $f$ is onto since $f(b) = b$ for all $b in B$ immediately implies that all such $b$ are in the range. Note that continuity really plays no role in this. Thinking of $|x|$ as a retraction is perhaps overkill, but shows that the proof that it is onto the nonnegative reals is a special case of a more general (and equally easy to prove) result.






                                  share|cite|improve this answer









                                  $endgroup$


















                                    0












                                    $begingroup$

                                    More generally, If $B subseteq A$ and $f: A rightarrow B$ is a continuous mapping with $f(b) = b$ for all $b in B$ then $f$ is called a retraction of $A$ onto $B$. It is trivial that any such $f$ is onto since $f(b) = b$ for all $b in B$ immediately implies that all such $b$ are in the range. Note that continuity really plays no role in this. Thinking of $|x|$ as a retraction is perhaps overkill, but shows that the proof that it is onto the nonnegative reals is a special case of a more general (and equally easy to prove) result.






                                    share|cite|improve this answer









                                    $endgroup$
















                                      0












                                      0








                                      0





                                      $begingroup$

                                      More generally, If $B subseteq A$ and $f: A rightarrow B$ is a continuous mapping with $f(b) = b$ for all $b in B$ then $f$ is called a retraction of $A$ onto $B$. It is trivial that any such $f$ is onto since $f(b) = b$ for all $b in B$ immediately implies that all such $b$ are in the range. Note that continuity really plays no role in this. Thinking of $|x|$ as a retraction is perhaps overkill, but shows that the proof that it is onto the nonnegative reals is a special case of a more general (and equally easy to prove) result.






                                      share|cite|improve this answer









                                      $endgroup$



                                      More generally, If $B subseteq A$ and $f: A rightarrow B$ is a continuous mapping with $f(b) = b$ for all $b in B$ then $f$ is called a retraction of $A$ onto $B$. It is trivial that any such $f$ is onto since $f(b) = b$ for all $b in B$ immediately implies that all such $b$ are in the range. Note that continuity really plays no role in this. Thinking of $|x|$ as a retraction is perhaps overkill, but shows that the proof that it is onto the nonnegative reals is a special case of a more general (and equally easy to prove) result.







                                      share|cite|improve this answer












                                      share|cite|improve this answer



                                      share|cite|improve this answer










                                      answered Mar 24 at 20:31









                                      John ColemanJohn Coleman

                                      3,98311224




                                      3,98311224






























                                          draft saved

                                          draft discarded




















































                                          Thanks for contributing an answer to Mathematics Stack Exchange!


                                          • Please be sure to answer the question. Provide details and share your research!

                                          But avoid



                                          • Asking for help, clarification, or responding to other answers.

                                          • Making statements based on opinion; back them up with references or personal experience.


                                          Use MathJax to format equations. MathJax reference.


                                          To learn more, see our tips on writing great answers.




                                          draft saved


                                          draft discarded














                                          StackExchange.ready(
                                          function () {
                                          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3160658%2fproving-fx-x-is-onto%23new-answer', 'question_page');
                                          }
                                          );

                                          Post as a guest















                                          Required, but never shown





















































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown

































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown







                                          Popular posts from this blog

                                          Plaza Victoria

                                          Puebla de Zaragoza

                                          Musa