Given this theorem:

Let a,b ∈ Z, not both equal. Then a greatest common divisor d of a and b exists and is unique. Moreover, there exist integers x and y such that d = ax + by.

I need to prove the unique part of the theorem. I figured out the proof of the existance, but I have no idea how ot prove that the gcd of a and b is unique.

After that, I also need to prove the following:

Let a, b ∈ Z, not both zero. Let S = {n∈Z | n=ax + by, for some x, y ∈ Z}. Let d = (a,b) where (a,b) is the g.c.d of a and b. Prove that S is the set of all integer multiples of d.

I used the set S in the previous part to prove the first part of the theorem, and I'm guessing i need to use the theorem and manipulate it somehow to prove that S is the set of all integer multiples of d.

Can anyone help?