Is this proof valid? I'm not 100% sure.
${\textit Proof}$. The line with endpoints $(a,c)$ and $(b,d)$ is the diagonal of $[a,b]\times[c,d]$. The slope is $\frac{d-c}{b-a}$, so the equation of the line is $y=\frac{d-c}{b-a}x+b$ and we can solve for the y-intercept by substituting in $(a,c)$: $$c=\frac{d-c}{b-a}a+b$$ then $$b=c-\frac{d-c}{b-a}a=\frac{cb-ad}{b-a}$$ so we have a linear function $f:[a,b]\to[c,d]:x\mapsto\frac{d-c}{b-a}x+\frac{cb-ad}{b-a}$. Since linear functions are bijective, we have $[a,b]\sim[c,d]$.
Is it ok to conclude $f:[a,b]\to[c,d]:x\mapsto\frac{d-c}{b-a}x+\frac{cb-ad}{b-a}$? Since the line we are considering is the diagonal of $[a,b]\times[c,d]$, so the line has domain $[a,b]$ and codomain $[c,d]$; the part I was worried about was that is it clear that everything in $[a,b]$ actually maps to $[c,d]$.