Let $a_1< a_2< \cdots< a_n\leq x$ be a set of positive integers such that no $a_i$ divides the product of the others. Prove that $n\leq \pi(x)$.
I have tried to argue by contradiction, which I assume $n> \pi(x)$, then $a_1, a_2, \cdots,a_n$ cannot be mutually relatively prime, so some of $a_i$ must divides product of other $a$'s, but I cannot give a very accurate explanation about it. Any suggestion?
Since no $a_i$ divides the product of the others, then for each fixed index $i$ there must be some prime $p_i$ such that $i\neq j\implies v_{p_i}(a_i)>v_{p_i}(a_j)$. There may, of course, be several such primes...if so, let $p_i$ denote the least of them. Clearly $i\neq j\implies p_i\neq p_j$. In this way we have produced $n$ distinct primes, all less than $x$ so we are done.
Note: here, as usual, for a prime $p$ and a natural number $a$ we define $v_p(a)$ to be the order to which $p$ divides $a$. Thus, for example, $v_3(18)=2$ and $v_5(18)=0$.