# Distint $S$-integers are still distinct modulo all but finitely many prime ideals

Let $k$ be a number field, $S$ be a finite set of places of $k$ containing all the infinite places of $k$, $R_S := \{x \in K : |x|_v \leq 1 \;\forall v \notin S\}$ be the ring of $S$-integers of $k$, and $a_1, \ldots, a_t$ be pairwise distinct elements of $R_S$. For any prime number $p$ and any prime ideal $P$ of $R_S$ lying above $p$, we have that for $i=1,\ldots,t$ it holds $a_i \equiv a_i^\prime$ in $R_S / P$, for some rational integer $a^\prime_i$. Is it true that $a_1^\prime, \ldots, a_t^\prime$ are NOT pairwire distinct only for finitely many prime $p$?

I think the answer should be YES, but I am stuck on this problem for a while.

For any given choice of any set of distinct, rational integers, solutions to a congruence with some given $S$-integers or not you will only ever have congruences among them for a finite number of primes. For if $a_i'-a_j'\equiv 0$ for infinitely many primes, then $(a_i'-a_j')$ is divisible by an infinite number of prime ideals in $\Bbb Z$, and so it must be the $0$ ideal because number rings have unique factorization (into a finite number of ideals).
But then this divisibility holds for $\mathfrak{p}|(p)$ in $R$, so $(a_i'-a_j')$ is divisible by infinitely many primes, even if we exclude those from the finite set $S$. Hence there are infinitely primes dividing $\mathfrak{a} = (a_i-a_j)$ in $R_S$ and--by multiplying by some non-zero integer, $m$--we produce an ideal of $\mathfrak{a}' = (m(a_i-a_j))\subseteq R$ divisible by infinitely many primes, i.e. $\mathfrak{a}'=0$.
Since $R_S$ is an integral domain $m(a_i-a_j)=0\implies a_i=a_j$, a contradiction.