Question 1184157
.
Construct two examples of bijective function from ZxZ to Q where Z is set 
of all integers and Q is set of rational numbers?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~



        In his post,  @CPhill states and insists that there is no bijective function from  Z×Z  to  Q. 

        "The difference in their  " denseness "  properties prevents such a mapping from being constructed."


        It is not correct,  and below I explain  {{{highlight(highlight(WHY))}}}.



<pre>
The set ZxZ is countably infinite.  It means that there is a bijection 

    f: ZxZ  <---> Z


The set Q is also countably infinite. It means that there is a bijection

    g: Z <---> Q


It  {{{highlight(highlight(IMPLIES))}}}  that the composition  gof  is the bijection ZxZ and Q

            f             g
    ZxZ <--------> Z <--------> Q.



It disproves the statement by @CPhill.
</pre>


Another question is IF it is possible to construct an explicit bijective function .

    

I asked Google.  Google AI created this response under this link


https://www.google.com/search?q=Construct+two+examples+of+bijective+function+from+ZxZ+to+Q+where+Z+is+set+of+all+integers+and+Q+is+set+of+rational+numbers%3F&rlz=1C1CHBF_enUS1071US1071&oq=Construct+two+examples+of+bijective+function+from+ZxZ+to+Q+where+Z+is+set+of+all+integers+and+Q+is+set+of+rational+numbers%3F&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIGCAEQRRhA0gEJMTg1NWowajE1qAIIsAIB8QXIg8hlL4FHy_EFyIPIZS-BR8s&sourceid=chrome&ie=UTF-8



<pre>
             - - - START of the Google response - - - (of 2/21/2025)


Two examples of bijective functions from ℤxℤ to ℚ (where ℤ is the set of all integers and ℚ is the set 
of all rational numbers) are: 

Example 1: Function using a numerator-denominator pairing 

• Definition: f(m, n) = 
	• If n ≠ 0, then f(m, n) = m/n 
	• If n = 0, then f(m, n) = m 



Explanation: 

• This function maps each ordered pair (m, n) from ℤxℤ to a unique rational number. 
• When n is not zero, it represents the rational number "m/n". 
• When n is zero, the function effectively maps the pair to infinity (or any other fixed value depending on your interpretation of division by zero). 

Example 2: Function using a "diagonal" mapping with a sign convention 

• Definition: f(m, n) = (2m + n) / (2*(abs(n) + 1)) 

Explanation: 

• This function creates a unique mapping by leveraging the "diagonal" pattern of adding 2m and n, while ensuring that the denominator always has a positive even value. 
• The absolute value of n in the denominator is used to handle cases where n is negative, preventing duplicate values. 

Key points about bijective functions: [1, 2]  

• A bijective function needs to be both injective (one-to-one) and surjective (onto), meaning each element in the domain maps to a unique element in the codomain, and every element in the codomain is reached by some element in the domain. [1, 2]  


Generative AI is experimental.


             - - - END of the Google response - - - 
</pre>


           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Below is my comment about the Google AI response



Example 1 above is &nbsp;INCORRECT.  &nbsp;The function defined in &nbsp;Example 1 is &nbsp;NOT &nbsp;bijective.

It is not bijective,  &nbsp;since the pairs &nbsp;(m,1) &nbsp;and &nbsp;(m,0) map into the same rational/(integer) &nbsp;number &nbsp;m.



&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Surely, &nbsp;I reported to &nbsp;Google about it.



Example 2 &nbsp;looks like to be correct.  &nbsp;At least, &nbsp;I do not see the way to disprove it.