# Confusion with the formal definition of injective function

The formal definition of an injective function is defined as

$$\text{\forall a,b \in  A f(a)=f(b)\Rightarrow a=b}$$

My understanding of injective function is one that preserves distinctness. This means that for some function f that maps an element $$a_i$$ from the set A to an element $$b_i$$ in set B, there exists no other element $$a_i$$ in set A that could be mapped to the same $$b_i$$ in set B by the same function.

The formal definition of an injective function comes across to me as contrary to the definition of what injective really is. If $$f(a_1)=f(a_2)$$ then does this not imply that exists at least more than 1 element in set A that can be mapped to the same value in set B?

As an example, suppose the set $A=\{7,8,9\}$ and the set $B=\{1,2,3\}$ If $f(7)=f(8)=1$, then does this not contradict the definition of what 'injective' is? I must be missing something.

• yeah for anyone reading this and confused about how the formal definition is so weird. Here's an explanation. The intuition is "one to one". The definition basically just accounts for the edge case. "If there are two elements in the domain that map to the same element in the codomain, then that can't be the case and the two elements in the domain must be the same". This definition works because besides this edge case that the definition accounts for, anything is possible. You see this same pattern in the definition for antisymmetric relations. Apr 2 at 22:36

Your description is exactly what the formal statement you gave means. It says, for every a and b in A, if $f(a)=f(b)$ then $a$ must equal $b$. The condition is on the left of the arrow. That is the same notion of preserving distinctness, if they map to the same ($f(a)=f(b)$) then that implies they came from the same element ($a=b$).

• I have made an edit. May 2, 2015 at 7:47
• But this is ambiguous. $$f(a)=f(b)$$ implies a =b. But this can be very much interpreted as the the mapping of a and b, both of which belongs in set A, to the same image in set B. May 2, 2015 at 7:49
• I think you are just having some trouble with the way formal logic words things. Saying "for every $a$ and $b$" does not mean that both $a$ and $b$ cannot refer to the same element (i.e., it is allowable that $b$ is just a synonym for $a$). In this case, the condition is not saying two distinct elements have equal image.
– jack
May 2, 2015 at 7:49
• Also, a condition in an implication is not an assertion. Any implication can be valid. You could say $a=b\wedge a\neq b\rightarrow FALSE$, and that would be true, since the implication never happens and so the false conclusion never happens.
– jack
May 2, 2015 at 7:50
• @ user,you can think other way also, as it is simply saying that if images were assumed to be equal then what we got that elements were equal. Means if two elements are distinct,then there image will be distinct, which is same as your understanding.
– Sry
May 2, 2015 at 7:54

Both definitions are simply contrapositive of each other, and thus are equivalent.