I’d like to show that $$\sum_{j=0}^{2J+1} (-1)^j \sum_{d|(m,n)\\ \omega(d)=j} 1 \le 1_m (n)$$ for any integer $J\ge 0$,
where $\omega(d)$ is the number of distinct prime factors of $d$ and $1_m(n) = 1$ if and only if $(m,n)=1$, otherwise it is $0$.
All I have done is the followings:
I know that
$$\sum_{j=0}^{2J+1} {k \choose j}(-1)^j \le 1_m(n)=(1-1)^k$$
where $k$ is the number of prime factors of $(m,n)$.
and
$$\sum_{d|(m,n) \\ \omega(d)=j} 1 \le {k \choose j}$$
What I want to show is “alternating sum” of above terms,
I’ve tried to use above two inequalities, but I couldn’t proceed it further.
And a few calculation by hands convinces me it is true.
Any hint and suggestion will be appreciated.
Edit:
I've shown that if $(m,n)={p_1}^{a_1}{p_2}^{a_2}\dots{p_l}^{a_l}$, where $p_i$ are primes and $l$ is odd, then
$$\sum_{j=0}^{l}(-1)^j \sum_{d|(m,n) \\ \omega(d)=j} 1 = A \prod_{i=1}^{j} \left(\frac{1}{a_i} -1\right), $$
where $A := \prod_{i=1}^{j} a_i$.
so if $l$ is odd, then the above sum should be non-positive.
then what I'd like to show follows.
But it left the case $2J+1 < l$.
The problem is equivalent to proving
$$ \sum_{j=0}^{2J+1}(-1)^j\sum_{\substack{d|n\\\omega(d)=j}}1\le \begin{cases} 1 & n=1 \\ 0 & n>1 \end{cases} $$
Suppose $\omega(n)=k$. Then the LHS can be written using binomial coefficients:
$$ \sum_{j=0}^{2J+1}(-1)^j\sum_{\substack{d|n\\\omega(d)=j}}1=\sum_{j=0}^{2J+1}(-1)^j\binom kj $$
To obtain a closed form for the RHS, we define the following sequence:
$$ a_{t,k}=\sum_{0\le j\le t}(-1)^j\binom kj, $$
so that its generating function can be written as
\begin{aligned} \sum_{t\ge0}a_{t,k}z^t &=\sum_{j\ge0}(-1)^j\binom kj\sum_{t\ge j}z^t=\sum_{j\ge0}(-1)^j\binom kj{z^j\over1-z} \\ &=-(1-z)^{k-1}=-\sum_{0\le t\le k-1}\binom{k-1}t(-z)^t. \end{aligned}
Comparing coefficients gives
$$ a_{t,k}=(-1)^t\binom{k-1}t\quad k\ge1, $$
Plugging $t=2J+1$ into this expression yields the desired inequality.