Show that $(a, b]$ and $[c, d)$ have the same cardinality, where $a, b, c,d$ are real numbers and $a <b, c<d.$
This is a well-known classical question in real analysis, if I am not wrong. The thing is, these problems are new to me and I am interested in learning some general approaches to establish such statements.
I could prove that any two closed intervals in $\Bbb R$ have the same cardinality, but till now, I haven't been able to solve this problem (above).
But, I have a feeling that all real intervals be it open intervals or closed intervals all have the same cardinality.
I hereby post an (incomplete) solution, I devised, for proving that $(a,b]$ and $(c,d]$ have the same cardinality:
We want to prove, that $(a, b]$ and $[c, d)$ have the same cardinality. We proceed by some linear transformations:
$(1)$ We transform, $(a,b]\to (0,b-a]$ using the transformation $t\to t - a$ then,
$(2)$ We consider the following shifting, i.e $(0,b -a]\to (0, 1]$ using the transformation $t\to\frac{t}{b-a}.$
$(3)$ Then we carry on, with some analogous reverse transformations, i.e $(0, 1] \to (0,d - c]$ using the transformation $t\to (d - c)t$ and
$(4)$ This last shifting, i.e $(0,d- c]\to (c, d]$ using the transformation $t\to t + c,$ let's us land to the desired place.
Now, as all of these transformations are bijections, so their composition is also so, which means, $(a, b]$ and $(c, d]$ does have the same cardinality. The bijection between them, as mentioned which is composition of these transformations in an ordered way, is precisely, $t\to \frac{d-c}{b-a}(t-a)+c$.
Now, I try to write the (above ) proof formally. This is as:
We consider a mapping $f:(a,b]\to (c,d]$ defined via, $$f(x)=\frac{d-c}{b-a}(x-a)+c.$$ Now, we must prove, that the function has it's range in $(c,d].$
If, $c\gt \frac{d-c}{b-a}(x-a)+c\implies a\lt x,$which is true. Similarly, if $\frac{d-c}{b-a}(x-a)+c\leq d\implies x\leq b$, which again is true, and these results let's us conclude, that $$c\lt \frac{d-c}{b-a}(x-a)+c\leq d.$$
Now, we claim: $f$ is well-defined, and a bijective mapping.
If we can prove, that $f$ is a bijection, we don't have to worry about any thing else. So, our aim is proving this as a bijection.
First, we try proving, that $f$ is an injection. If $x,y\in (a,b]$ such that $$f(x)=f(y)\implies \frac{d-c}{b-a}(x-a)+c=\frac{d-c}{b-a}(y-a)+c\implies \frac{d-c}{b-a}(x-a)=\frac{d-c}{b-a}(x-a)\implies x=y.$$ This proves, $f$ as an injection.
Our next ain, is to prove that $f$ is onto. We consider, $y\in(c,d],$ then if, $\exists x\in (a,b]$ such that $f(x)=y$ , it simply means that there exists an $x$ that satisfies $\frac{d-c}{b-a}(x-a)+c=y$ which further leads to the conclusion that $x=\frac{b-a}{d-c}(y-c)+a.$ This is true, if $\frac{b-a}{d-c}(y-c)+a$ satisfies the inequality, $a\lt x\leq b\implies $a\lt\frac{b-a}{d-c}(y-c)+a\leq b.$
Now, if this is true, then, for $a\lt \frac{b-a}{d-c}(y-c)+a\implies c\lt y,$ is true, , which is true. Also, if $\frac{b-a}{d-c}(y-c)+a\leq b$ is true, it means, $\frac{b-a}{d-c}(y-c)+a\lt b\implies y\lt d$, is true, which is true. So, $a\lt\frac{b-a}{d-c}(y-c)+a\leq b$ is true. It simply means, that $f$ is onto.
So, $f$ is a bijection. Hence, we get, $(a,b]$ and $(c,d]$ have the same cardinality.
Now, I want to know whether the thing I did, is a legit way or not?
If this stands, correct, then how do I proceed to prove that $(a, b]$ and $[c, d)$ have the same cardinality?