Solution (source code)

= Solution

A <Möbius transformation> has the form $M(z)=(az+b)/(cz+d)$ with $ad-bc\ne0$, extended to the <Riemann sphere> by its limiting values at its pole and at infinity. If $c\ne0$, it sends $-d/c$ to infinity and infinity to $a/c$; if $c=0$, infinity maps to infinity.

Represent $M$ by the invertible matrix $\begin{pmatrix}a&b\\c&d\end{pmatrix}$, with nonzero scalar multiples representing the same map. Substitution shows that composition corresponds to matrix multiplication. The product determinant is the product of two nonzero determinants, so the composition is again a Möbius transformation. Solving $w=M(z)$ gives
$$
\boxed{M^{-1}(w)=\frac{dw-b}{a-cw},}
$$
with the same extended-value convention. This inverse proves that $M$ is a <bijection> of the extended complex plane.