2

Let's say we have two pairs of integer coprime numbers: $m,n$ are coprime and $k,l$ are coprime. Define $q=ml-nk$ and let's assume $q>0$. (In the original problem I consider 3 points of integer lattice $\mathbb{Z}^2$ one of which is $(0,0)$, other two are visible from $(0,0)$ and they can't be collinear, so $q\neq0$, but the two can have labels switched, so we can assume $q>0$.) After some experimentation I'm convinced that there exists unique $p\in\{1,...,q\}$ such that $$ pn+l\equiv0\hspace{2mm}(\text{mod}\hspace{2mm}q)\hspace{4mm}\land\hspace{4mm} pm+k\equiv0\hspace{2mm}(\text{mod}\hspace{2mm}q) $$ But I can't seem to find any argument that would confirm that, let alone an elegant one. I will appreciate any proof, suggestion or counterexample. Thank you!

John Omielan
  • 47,976

2 Answers2

3

$n,m\,$ coprime $\,\Rightarrow\, \color{#c00}{in}\!-\!\color{#0a0}{jm} = 1\,$ for some $\,i,j\in\Bbb Z\,$ by $\color{#90f}{\rm Bezout}$. If $\,p\,$ is $\rm\color{#08f}{any}$ solution, by hypothesis $\!\bmod \:\!q\!:\:\!\ 0 \equiv \color{#c00}i(\color{#c00}np\!+\!l)-\color{#0a0}j(\color{#0a0}mp\!+\!k)\equiv p+il\!-\!jk,\,$ so $\,\color{#08f}{p \equiv} jk\!-\!il,\,$ $\rm\color{#08f}{thus}\:\!$ if $\, p_1,\:\!p_2\:\!$ are solutions then $\,\color{#08f}{p_1}\equiv jk\!-\!il\color{#08f}{\equiv p_2}$ (uniqueness). It is trivial to verify $\,jk\!-\!il\,$ is a solution, see below. $\:\small\bf QED$

Bill Dubuque
  • 272,048
  • It's a special case of denominator descent: $,n,m,$ are denominators for $,p,$ thus so too is their gcd $(n,m)=1.,$ This is the descent step in the generalization of Gaussian elimination to $\Bbb Z,,$ cf. Hemite/Smith normal form algorithms in the linked post. – Bill Dubuque Aug 09 '23 at 23:57
  • @John Uniqueness is immediate (cf. my edit and here). The method in your comment is a special case of the fact that the particular solution is unique since the homogeneous solution $,p_0\equiv 0,,$ i.e. $,np_0\equiv 0\equiv m p_0\Rightarrow 0\equiv (\color{#c00}{in}!-!\color{#0a0}{jm})p_0\equiv p_0\ \ $ – Bill Dubuque Aug 10 '23 at 07:41
  • Verification $\ {-}pn \equiv \underbrace{(il!-!j\color{#c00}k):!\color{#c00}n\equiv (!!!!!\overbrace{in!-!j\color{#0a0}m}^{=, 1\ \ \color{#90f}{\rm by\ Bezout}}!!!!!):!\color{#0a0}l}_{\textstyle \color{#c00}{kn},\equiv\color{#0a0}{ml}},\ \equiv l.\ $ Similarly $,{-}pm\equiv k.$ $\tag{}$ Alternatively* we can derive the unique solution by Hermite reduction as here. $\ \ $ – Bill Dubuque Aug 22 '23 at 20:39
2

Yes, your conjecture is correct, i.e., that

... there exists a unique $p\in\{1,...,q\}$ such that $$ pn+l\equiv0\hspace{2mm}(\text{mod}\hspace{2mm}q)\hspace{4mm}\land\hspace{4mm} pm+k\equiv0\hspace{2mm}(\text{mod}\hspace{2mm}q) $$

First, consider

$$\gcd(n,l)=d, \;\; n = dn_1, \;\; l=dl_1, \;\; \gcd(n_1,l_1)=1 \tag{1}\label{eq1A}$$

Thus, we also have

$$d \mid q, \;\; q = dq_1, \;\; q_1 = ml_1 - n_{1}k \tag{2}\label{eq2A}$$

In addition, $\gcd(n_1,ml_1) = 1$ since a problem condition is that $m$ and $n$ are coprime, and \eqref{eq1A} gives $\gcd(n_1,l_1)=1$. Thus, from \eqref{eq2A}, we get $\gcd(n_1,q_1)=1$. Therefore, $n_1$ has a unique multiplicative inverse modulo $q_1$ and, thus, there's a unique $0 \le p_1 \le q_1 - 1$ with

$$p_{1} \equiv -n_{1}^{-1}l_{1} \pmod{q_1} \to p_{1}n_{1} + l_{1} \equiv 0 \pmod{q_1} \to p_{1}n + l \equiv 0 \pmod{q} \tag{3}\label{eq3A}$$

There's then also

$$pn + l \equiv 0 \pmod{q} \;\forall\; p = p_1 + jq_1, \; 0\le j \le d-1 \tag{4}\label{eq4A}$$

From \eqref{eq3A}, plus using \eqref{eq2A} and that $\gcd(n_1,q_1)=1$ mentioned earlier, we get

$$\begin{equation}\begin{aligned} p_{1}mn_{1} + ml_{1} & \equiv 0 \pmod{q_1} \\ p_{1}mn_{1} + n_{1}k & \equiv 0 \pmod{q_1} \\ n_{1}(p_{1}m + k) & \equiv 0 \pmod{q_1} \\ p_{1}m + k & \equiv 0 \pmod{q_1} \end{aligned}\end{equation}\tag{5}\label{eq5A}$$

Thus, there's an integer $0 \le r \le d - 1$ where

$$p_{1}m + k \equiv rq_{1} \pmod{q} \tag{6}\label{eq6A}$$

From \eqref{eq4A}, we then have

$$\begin{equation}\begin{aligned} pm + k & \equiv (p_1 + jq_1)m + k \\ & \equiv (p_{1}m + k) + jmq_{1} \\ & \equiv rq_{1} + jmq_{1} \\ & \equiv (r + jm)q_{1} \pmod{q} \end{aligned}\end{equation}\tag{7}\label{eq7A}$$

Since \eqref{eq1A} shows $d \mid n$, and we're given that $m$ and $n$ are coprime, then $\gcd(m,d) = 1$. Thus, $m$ has an inverse modulo $d$, so there's a unique $0 \le j \le d-1$ where $r + jm \equiv 0\pmod{d}$. Using this $j$ in \eqref{eq7A} gives the required second condition, i.e., $pm + k \equiv 0 \pmod{q}$.

Thus, from $0 \le p_1 \le q_1-1$, and $p = p_1 + jq_1$, with $q = dq_1$, we get there's a unique $0 \le p \le q - 1$. If $p = 0$, then choose $p = q$ instead. This now confirms that your conjecture is correct.

John Omielan
  • 47,976