How to determine the gcd of a set I'm stuck at a question. 
The question states that $K$ is a field like $\mathbb Q, \mathbb R, \mathbb C$ or $\mathbb Z/p\mathbb Z$ with $p$ a prime. $R$ is used to give the ring $K[X]$. A subset $I$ of R is called an ideal if:
• $0 \in I$; 
• $a,b \in I \to a−b \in I$; 
• $a \in I$ $r \in R \to ra \in I$. 
Suppose $a_1,...,a_n \in R$. The ideal $<a_1,...,a_n>$ generated by $a_1,...,a_n$ is deﬁned as the intersection of all ideals which contain $a_1,...,a_n$. Prove that $⟨a_1,...,a_n⟩ = {r_1a_1 +···+ r_na_n | r_1,...,r_n \in R}$. 
 I proved this, but I got stuck on the one below:    

Prove that $⟨a_1,...,a_n⟩ = ⟨\gcd(a_1,...,a_n)⟩$
Because I know how to calculate the gcd, but how do I use it in this context? Because it now has more than two elements, so I don't know how to work with this
 A: Have you heard of Bezout's identity? Here
Observe that it says numbers of form $ax+by$ are multiples of $d$, where $d=gcd(a,b)$. This generalizes to $n$ numbers as well. 
A: It sounds like for elements $x,y\in R,$ you can find $\gcd(x,y),$ though you don't specify how you would do that. I suspect you'd use something like the Euclidean algorithm. Once we go through all the steps of the EA, we can back-substitute to obtain an equation of the form $$ax+by=\gcd(x,y)$$ for some $a,b\in R.$ From this, we immediately find (from your previous result) that $\gcd(x,y)\in\langle x,y\rangle,$ so that $$\bigl\langle\gcd(x,y)\bigr\rangle\subseteq\langle x,y\rangle.$$ Do you see why?
On the other hand, since $x=c\gcd(x,y)$ and $y=d\gcd(x,y)$ for some $c,d\in R,$ then we immediately have $x,y\in\bigl\langle\gcd(x,y)\bigr\rangle,$ so that $$\bigl\langle\gcd(x,y)\bigr\rangle\supseteq\langle x,y\rangle.$$ Do you see why?

You may not be familiar with the back-substitution idea I refer to above, so I'll demonstrate that, then talk about how the proof outline above generalizes.
For example, we can use the EA to find that $3=\gcd(180,51)$ as follows: $$180=3\cdot 51+27\\51=1\cdot 27+24\\27=1\cdot 24+3\\24=8\cdot 3.$$ The final equation just lets us know we're done with the algorithm, so let's look at the others. They can be rewritten equivalently as $$1\cdot180+(-3)\cdot 51=27\\51+(-1)\cdot27=24\\27+(-1)\cdot24=3.$$ Using the first of these to substitute for $27$ in the other two equations gives us (after gathering like terms) $$(-1)\cdot180+4\cdot51=24\\1\cdot180+(-3)\cdot51+(-1)\cdot24=3.$$ Using the first of these to substitute for $24$ in the other gives us $$2\cdot180+(-7)\cdot 51=3,$$ which has the desired form.

Here's the kicker that will let you get the rest of the way. Show that $\gcd(x,y,z)=\gcd\bigl(\gcd(x,y),z\bigr),$ so that $ax+by+cz=\gcd(x,y,z)$ for some $a,b,c\in R.$ From there, a straightforward proof by induction on $n$ lets us show that, given $x_1,...,x_n\in R,$ there exist $a_1,...,a_n\in R$ such that $$a_1x_1+\cdots+a_nx_n=\gcd(x_1,...,x_n),$$ thereby allowing us to follow the proof outline I gave above when dealing with more than two elements.
Let me know if you have any questions, get stuck with proving any of the helper-results, or just want to bounce your proof attempt(s) off of someone. Welcome to Math.SE!
A: The proof is essentially the same as in $\Bbb Z$ via Euclidean descent, i.e. by division with remainder.
It suffices to show $I = (a_1,\ldots,a_n) = (d)$ is principal, since then $\,a_i \in (d)$ implies $\,d\,$ is a common divisor of the $a_i,\,$ necessarily greatest since $\,d\in I\,\Rightarrow\, d = r_1 a_1 +\cdots + r_n a_n$ hence $c\mid a_i\,\Rightarrow\,c\mid d\,\Rightarrow\, \deg c\le \deg d$
Principality follows by Euclidean descent: $ $ if $d$ is a least degree element of $I$ then $d$ divides every $\,a\in I,\,$ else $\, 0\neq r = a\bmod d = a-qd\in I$ has $\,\deg r < \deg d,\,$ contra minimality of $d$. Therefore $\,(d)\supseteq (a_1,\ldots,a_n)\supseteq (d)$
Remark $ $ The same proof works for any domain enjoying division  with ("smaller") remainder. Such domains care called Euclidean, and the above proof shows they are PIDs - principal idea domains, with ideals generated by any element of least Euclidean value, and this generator is a gcd of all elements in the ideal. 
