So i have a little bit problems proofing this.  |A| ≤ |B| iff |B| ≥ |A|   i know, that if |A| ≤ |B| =&gt; f: A =&gt; B, must be injective and likewise, that if |B| ≥ |A| =&gt; g: B =&gt; A, A = ø or it must be surjective. Good, but how do i exactly do this proof? I am a little bit lost on how to write it down in a mathematical accurate way. Would anyone be able to help me out? Thanks in advance
Theorem. Let $X$ and $Y$ be sets with $X$ nonempty. Then (P) there exists an injection $f:X\rightarrow Y$ if and only if (Q) there exists a surjection $g:Y\rightarrow X$.  For the P $\implies$ Q part, I know you can get a surjection $Y\to X$ by mapping $y$ to $x$ if $y=f(x)$ for some $x\in X$ and mapping $y$ to some arbitrary $\alpha\in X$ if $y\in Y\setminus f(X)$. But I don't know about the Q $\implies$ P part.  Could someone give an elementary proof of the theorem?
My current prompt is colorized and edited as so -  #!/bin/bash  # GIT Prompt help if tput setaf 1 &amp;&gt; /dev/null; then     tput sgr0; # reset colors     bold=$(tput bold);     reset=$(tput sgr0);     txtund=$(tput sgr 0 1);     black=$(tput setaf 0);     blue=$(tput setaf 33);     cyan=$(tput setaf 37);     green=$(tput setaf 64);     orange=$(tput setaf 166);     purple=$(tput setaf 125);     red=$(tput setaf 124);     violet=$(tput setaf 61);     white=$(tput setaf 15);     yellow=$(tput setaf 136); else     bold='';     reset="\e[0m";     black="\e[1;30m";     blue="\e[1;34m";     cyan="\e[1;36m";     green="\e[1;32m";     orange="\e[1;33m";     purple="\e[1;35m";     red="\e[1;31m";     violet="\e[1;35m";     white="\e[1;37m";     yellow="\e[1;33m"; fi; ORIG=$PS1 HOST=$HOSTNAME PS1="\[${txtund}${green}\]${HOST}\[\[${reset}\]"; PS1+="\$(prompt_git \"\[${white}\] on \[${violet}\]\")"; PS1+="\[${reset}\]"; PS1+="\[ at - ${orange}\W\]"; PS1+="\[${reset}\]"; PS1+="\[ - \u \]"; PS1+="\n\$ ";   I know that the line  PS1+="[ - \u ]"; will show me my current user. However, I want that section to be red if it is root. All other users should be the default color of gray. Is there a way to change the color in that section based off of current user or should I just declare a variable and use an IF statement to insert that section or a modified section with red as a color?  My expected output is gray named user for all normal users. Root should be red. This is BASH. Is there a terminal command that will log you out of your current desktop session and take you back to the login screen? Is there a way to have a copy of any message sent from a Gmail account sent to another address?  I've got any messages coming to my address copied to another (see  for one solution, setting up filters is another), but I haven't yet found a way to have outbound messages automatically copied.  Is there a way? Change password on root user and user account If I change the password for the root user is that going to automatically change the password for the user account?   I found this link for root:    How do I change the user account password? Guinier regime for form factor Why is it such a good idea to plot the logarithm of the form factor vs $Q^2$ in . It seems arbitrary to me. How do I create a deb package for a single python script? I have a single python script that I want to distribute as a deb package. It is a  which shows local date in Unity panel. I did follow  but I could not create a deb package because it fails.   Can someone give me a step-by-step instruction on what I should do? As far as I know this script depends on python-appindicator.   NOTE: I do not want any links to Debian/Ubuntu packaging instructions. I have seen most of them. I don't find them beginner friendly. Where does the energy required to stop a moving body come from and go? For a long time, I have been thinking about this: In order to stop a moving body, I have to apply impulse to change the existing momentum to $0$. For the impulse I have to impart force on the moving body . That means I have to eliminate all the kinetic energy associated with the moving object in order to bring it to a halt. Thus, work is done on the object, right? If work is done, energy must be given by me...  Here is where my confusion arises:   If I eliminate the associated kinetic energy of the body, where does this energy go? The work(?) done by me on the moving object to stop it obviously uses energy from me. Again, where does this energy go? How to put terms in lexicographic order? Links being changed to cppreference.com Someone just edited a link in one of my answers to point to a 'better reference'.    I've no problem with links being changed in general, but this smells like part of a concerted attempt to redirect traffic.   Is this kind of activity acceptable on SO? My PC has 8 Gb of ram. Is there any way to make ubuntu use most of it? I mean rarely drop caches and keep once opened programms in ram longer, preload apps on boot, etc. How to make nautilus use file-roller in 17.10 like in 17.04? In Ubuntu 17.10 ubuntu upgraded Nautilus (File Browser) to version 3.26.0. New nautilus is not using file-roller anymore, it has  to an integrated compression mechanism.     This makes it complicated to create encrypted archives and/or different types compression archives that file-roller does provide.  How to make nautilus use file-roller as before?  Related question: Can I sync bookmarks between Firefox and Chromium? So, Firefox has turned so resource intensive that my netbook can't run it without making me want to pull my hair out. Thus, I have been trying Chromium with quite some success (I have managed to find proper equivalents for my firefox plugins), the only thing I'm lacking is my bookmarks, which are stored in my Firefox Sync account. Point is I don't want to use Google Bookmarks, mostly because of the whole thing with encryption.  Is there any way to use Firefox Sync with Chromium?, or is there any secure alternative? How to programmatically click a button in WPF? How to divide the money based on the below conditions? Let's say I have a class that has a member called data which is a list.    I want to be able to initialize the class with, for example, a filename (which contains data to initialize the list) or with an actual list.  What's your technique for doing this?  Do you just check the type by looking at __class__?  Is there some trick I might be missing?  I'm used to C++ where overloading by argument type is easy. Huge close votes review queue on Stack Overflow Today, the size of the close-votes queue is 55k questions and growing. Is that a problem?   Which action could be taken to clean it up? It seems to be growing faster than Stack&nbsp;Overflow members are capable to handle it. Website is under maintenance - how to restrict access? Updated DNS zone can't be seen from my local network What is "Best Practice" For Comparing Two Instances of a Reference Type? I came across this recently, up until now I have been happily overriding the equality operator (==) and/or Equals method in order to see if two references types actually contained the same data (i.e. two different instances that look the same). I have been using this even more since I have been getting more in to automated testing (comparing reference/expected data against that returned). While looking over some of the  I came across an  that advises against it. Now I understand why the article is saying this (because they are not the same instance) but it does not answer the question:  What is the best way to compare two reference types? Should we implement ? (I have also seen mention that this should be reserved for value types only). Is there some interface I don't know about? Should we just roll our own?!  Many Thanks ^_^ Update Looks like I had mis-read some of the documentation (it's been a long day) and overriding  may be the way to go..  If you are implementing reference types, you should consider overriding the Equals method on a reference type if your type looks like a base type such as a Point, String, BigNumber, and so on. Most reference types should not overload the equality operator, even if they override Equals. However, if you are implementing a reference type that is intended to have value semantics, such as a complex number type, you should override the equality operator. What uses are there for "placement new"?