The language of abstract algebra in $ab=a, ab=b$ implies $a=b$ I am struggling to better understand the language of a basic proof in abstract algebra, namely that groups have a unique identity. The proof is presented as follows: Let $G$ be a group and $a,b \in G$ be identity elements. Because $a$ is an identity, $ab=b$. Because $b$ is an identity, $ab=a$. This implies $a=b$. Therefore, since any two identities are equal, there is only one identity in $G$.
I think I can understand the fundamental fact of the proof, but not according to the language above. I have to use a proof of contradiction: Assume $G$ has two different identities. Then the expression $ab$ maps to two different elements, which is impossible. Therefore, $G$ can have only one identity.
I am wondering if anyone has suggestions regarding how to bridge the gap between my current understanding of the proof and an understanding that makes use of the language in the "official" proof.
 A: This is based on the principle, things that are equal to the same thing are themselves equal. Both $a$ and $b$ are equal to $a b$.
A: It may be slightly easier if you remove the "by contradiction"

Assume $a$ is an identity element of $G$, and $b$ is an identity element of $G$. Then [follow the given proof] and therefore $a=b$. Therefore if we have two members of $G$ which are identity elements, the two members are in fact the same. This implies that there is only one identity.

Also, the argument in the given proof is slightly incorrect. $ab=a$ because --$b$-- is an identity, but your proof says it is because $a$ is an identity.
A: Let $e$ be the neutral element given by axioms. Let $e'$ be in $G$ which satisfies $xe'=xe'=x\ ,\ \forall x\in G$ also, then $e=ee'=e'$
A: Let $X$ denote a set, and $P$ denote a unary predicate on $X$. Then by definition, the following sentences are equivalent.


*

*There is at most one $x \in X$ satisfying $P$.

*For all $x,y \in X,$ we have that if both $x$ and $y$ satisfy $P$, then $x=y$.


Therefore, to prove that every group $G$ has at most one identity element, we may proceed as follows. Let $x$ and $y$ denote fixed but arbitrary elements of $G$ satisfying "I am an identity element." Then show that $x=y$.
That is exactly what the proof has done.
A: I think your problem is not one of algebra, but of logic.
When we say, in ordinary English: "There is only one doohickey", this can be interpreted in formal logic as either

There does not exist $a$ and $b$ such that $a\neq b$ and $a$ and $b$ are both doohickeys.
  $$ \text{symbolically:}\qquad \neg\exists a\exists b(a\neq b \land D(a) \land D(b)) \tag{1}$$

or

For all $a$ and $b$ it holds that if $a$ is a doohickey and $b$ is a doohickey, then $a=b$.
  $$ \text{symbolically:}\qquad \forall a\forall b(D(a)\land D(b) \implies a=b) \tag{2}$$

It is a fairly simple exercise in symbolic logic to show that these two formalizations are in fact logically equivalent, but they suggest different proof strategies.
Your preferred proof follows the structure of (1): You want to prove something is not true, so an indirect proof is the natural plan of attack: Assume the something and reach a contradiction.
However, mathematicians tend to favor formulation (2): It is arguably a bit more removed from most people's intuition, because it depends on having the two different letters $a$ and $b$ stand for the same thing, but that is not a formal problem. Once you get used to that, however, it is a better way to think about "there's only one X" properties, because there are fewer negations in it and it is natural to prove it directly instead of indirectly. See this question for explanations of why that is a good thing.
A: Both are equivalent ways to prove that a nonempty set $\rm\, S\,$ has a single element
$\rm(1)\quad  \forall\, a,b \in S\!:\ Hypotheses\ \Rightarrow\ a = b$
$\rm(2)\quad \forall\, a,b \in S\!:\ Hypotheses\ \ \&\ \ a\neq b\ \Rightarrow\ Contradiction$
Note the the second is simply the first recast as a proof by contradiction.
A: You are given the fact that $ab=a$ and that $ab=b$. Now $ab=ab$ since every element is equal to itself. This implies that $a=b$, where the first $ab$ is replaced by $a$ and the second $ab$ by $b$. This completes the stated proof.
Now what you have stated as your understanding of the proof is exactly the same the given proof. So instead of trying to force a contradiction by saying that $ab$ cannot map to two different elements (where the term map is ambiguous), we try to generate a contradiction in the system provided by showing that $a=b$ and therefore we cannot have two different inverses.
