Why $f\colon \mathbb{Z}_n^\times \to \mathbb{Z}_m^\times$ is surjective? [duplicate]

If $m|n$. Why the map $f\colon \mathbb{Z}_n^\times \to \mathbb{Z}_m^\times$ given by $a \mod{n}\mapsto a \mod m$ is a surjective homomorphism of groups?

Attempt: I proved it is well a well defined homomorphism because the canonical projection $\overline{f}\colon \mathbb{Z}_n \to \mathbb{Z}_m$ is a surjective ring homomorphism, it extends $f$ and maps units to units.

But I can't prove surjectiveness. Given $a\in\mathbb{Z}$ such that $(a,m)=1$ I'm looking for a $k\in\mathbb{Z}$ such that $(a+k\cdot m,n)=1$. I don't know why one of the $n/m$ candidates for such $k$ makes the number $a+k\cdot m$ an unit modulo $n$.


When $n$ is a power of a prime, it's easy because $$ \gcd(a,p^k)>1 \implies \gcd(a,p)>1 $$

In the general case, use the Chinese Remainder Theorem.


Let $n=p_1^{\alpha_1}\cdots p_k^{\alpha_k}$ and $m=p_1^{\beta_1}\cdots p_k^{\beta_k}$, with $\alpha_i\geq \beta _i$. Then $$\Bbb Z_n^\times =\prod^{k}_{i=1} \Bbb Z_{p_i^{\alpha_i}}^\times\text{ and }\Bbb Z_m^\times = \prod^{k}_{i=1} \Bbb Z_{p_i^{\beta_i}}^\times$$

The surjectivity of $\Bbb Z_m^\times \to \Bbb Z_n^\times$ follows from the surjectivity of $\Bbb Z^\times_{p_i^{\alpha_i}}\to\Bbb Z^\times_{p_i^{\beta_i}}$.


I don't know an elementary answer, but it is true that any ring surjection $f : R \to S$ where $R$ is a finite ring, induces a surjective group homomorphism $f^\times : R^\times \to S^\times$. For a proof, see my answer on MO (which has a very short proof of a more general statement, using only the Chinese Remainder Theorem).