I'm reading the proof of the multiplicative property of $$s_k(n)=\sum_{d|(n,k)}f(d)g\bigg( \frac kd\bigg)$$ The book wrote that in order to understand the proof, we need to know if $a,b,k,m$ are integers such that $(a,k)=(b,m)=1$, then $$(ab,km)=(a,m)(b,k).$$
I have written proof, but I don't know is it consistent, and this seems used more tools than it necessarily has to.
My proof: Let $$S_1=\{d: d|(a,m), d>0\}\\S_2=\{d: d|(b,k), d>0\}\\S=\{d:d|(ab,km), d>0\}.$$ I will prove the statement by showing that the function $\phi:S_1\times S_2\to S$ defined as $$\phi(d_1,d_2)=d_1d_2$$ is bijective, and complete the proof by connecting the maximal elements from these partial ordering sets.
Obviously, for $d_1\in S_1, d_2\in S_2$, this tells us $d_1 $ is both divisor of $a$ and $m$, and $d_2$ is both divisor of $b$ and $k$, hence $d_1d_2$ is both divisor of $ab$ and $km$, so we can tell $\phi(S_1\times S_2)\subseteq S$.
To show one-to-one, if we have $c_1,d_1\in S_1$ and $c_2,d_2\in S_2$ such that $$\phi(c_1,c_2)=\phi(d_1,d_2)$$ then $$c_1c_2=d_1d_2$$
In particular, $c_1|d_1d_2$, we need to show $c_1|d_1$. Indeed, if $(c_1,d_2)>1$, this implies $a,k$ have common factor larger than $1$, contradicts the assumption. Therefore $c_1|d_1$. A similar argument implies $d_1|c_1$, therefore $c_1=d_1$. Again a similar argument implies $c_2=d_2$, which shows one-to-one.
To show onto, let $d\in S$, since $d|ab$, we can split $d$ into $d_1d_2$ such that $d_1|a$ and $d_2|b$. Since $(a,k)=1$, we see $(d_1,k)=1$, by property of $S$ we see also $d_1|m$, therefore $d_1\in S_1$, a similar argument implies $d_2\in S_2$. So every number in $S$ has a preimage in $S_1\times S_2$
This completes the proof. Is there any mistake in the proof?
Edit: A proof about the statement: If $d|ab$ then there are $d_1,d_2$ such that $d=d_1d_2$ and $d_1|a, d_2|b$. Let $ab=p_1^{e_1}\cdots p_r^{e_r}$ for distinct prime factors $p_1,\cdots,p_r$, then we can write $$a=p_1^{x_1}\cdots p_r^{x_r}\\b=p_1^{y_1}\cdots p_r^{y_r}$$ where some of $x_i, y_i$ can be zero, and $x_i+y_i=e_i$ for all $i=1,\cdots,r$. Since $d|ab$, we can write $$d=p_1^{f_1}\cdots p_r^{f_r}$$ with $f_i\leq e_i$ for all $i=1,\cdots,r$. Then since $$f_i\leq x_i+y_i$$ Split into two cases:
Case 1: $f_i> x_i$, then we can choose $g_i=x_i$ and $h_i=f_i-x_i$.
Case 2: $f_i\leq x_i$, then we can choose $g_i=f_i$ and $h_i=0$.
Then the choice $$d_1=\prod_{i=1}^r p_i^{g_i}, \quad d_2=\prod_{i=1}^r p_i^{h_i}$$ will prove the statement.