# Is $x*y=x$ associative and/or commutative on $\Bbb Z$?

Let $$*:\mathbb{Z}\times\mathbb{Z}\rightarrow\mathbb{Z}$$ on the integers by the formula $$x*y=x$$ for any $$x,y\in\mathbb{Z}$$. Decide whether $$*$$ is associative and/or commutative.

To the best of my understanding this means I'm taking a Cartesian product $$(x,y)$$ and sending it to $$x$$. I think this would be both associative and commutative since it appears this only happens when the pair is $$(x,0)$$ with $$(0,0)$$.

Associativity means $$(x*y)*z=x*(y*z)$$. By this, if $$x=(x,0), y=(0,0)$$, then $$z$$ must also be $$(0,0)$$ by necessity which clearly is associative.

Commutativity means $$x*y=y*x$$. If $$x=(x,0)$$, then $$y$$ must be $$(0,0)$$. This is clearly commutative.

I'm struggling to put this into formal terminology. Are my thoughts correct? If not, what adjustments should I consider?

• $*$ is just some operation just as multiplication, addition are operations. When we write $3+4$, we don't usually think of a map from the Cartesian product $(3,4)$ to $7$, we just think of $3+4$. Same here. – copper.hat Jun 21 at 20:27
• You can never prove a general property with an example – Miguel Jun 21 at 20:28
• One way to approach it as just 'string' replacement. When you see $x * y$ replace it by $x$. Then $x * (y * z) = x * (y) = x * y = x$. – copper.hat Jun 21 at 20:29
• I don't understand "this only happens when the pair is $(x,0)$ with $(0,0)$." What does "this"mean here? I hope it doesn't refer to sending $(x,y)$ to $x$, since the problem says this happens "for any $x,y\in\mathbb Z$." Also "a Cartesian product $(x,y)$" doesn't make sense because $(x,y)$ is not a Cartesian product; it's one element of a Cartesian product. – Andreas Blass Jun 21 at 20:30
• Thanks, I misread the definition of $*$, all your responses make sense. – SprNtndoChlmrs Jun 22 at 2:24

It is associative, because for all $$x,y,z\in\mathbb{Z}$$, you have that $$x\star (y\star z)=x\star y=x=(x\star y)\star z$$ It is not commutative, for example because $$0\star 1=0\neq 1=1\star 0$$
• Last line starts with $0*1$ – Miguel Jun 21 at 20:27