# Specific question on lcm and gcd of rings.

I can't prove this statement:

Let $$a_1,a_2,...,a_n$$ and $$b_1,b_2,...,b_n$$ be non zero elements of an integral domain $$R$$ such that $$a_1b_1=a_2b_2=\cdots=a_nb_n=x$$

If $$gcd(ra_1,ra_2,...,ra_n)$$ exists for all $$0\neq r\in R$$, then $$lcm(b_1,b_2,...,b_n)$$ also exists and satisfies $$gcd(a_1,a_2,...,a_n)lcm(b_1b_2,...,b_n)=x$$

Any hints?

I use the following lemma:

Let $$a_1,a_2,...,a_n$$ and $$r$$ be nonzero elements of an integral domain $$R$$.

$$1)$$ if $$lcm(a_1,a_2,..a_n)$$ exists, then $$lcm(ra_1,ra_2,...,ra_n)$$ also exists and $$lcm(ra_1,ra_2,...ra_n)=rlcm(a_1,a_2,...,a_n)$$

$$2)$$ if $$gcd(ra_1,ra_2,...,ra_n)$$ exists, then $$gcd(a_1,a_2,...a_n)$$ also exists and $$gcd(ra_1,ra_2,...,ra_n)=rgcd(a_1,a_2,...,a_n).$$

My attemp: We suppose that $$gcd(ra_1,ra_2,...,ra_n)$$ exists, therefore $$a:=gcd(a_1,a_2,...,a_n)$$ exists for the lemma, and therefore $$a| a_i$$ for each $$i$$. Since $$x=a_ib_i$$ we obtain that $$ab_i |x$$. We easily can show that $$x=lcm(ab_1,ab_2,...,ab_n)$$ but i don't know how procede then.

Any hints?