# How to update a set of pairs?

I am trying out operations on sets and i have become stuck on how you could update set of pairs, say I have a set $A$: $$A = \{(a,3),(b,5),(c,7)\}.$$

If I wanted to add a pair I would use the union of the two sets; $$A \cup \{(x,8)\}.$$ Or remove one I would use the set difference; $$A \setminus \{(b,5)\}$$ How do you go about updating $a$, $b$ in the pair $(a,b)$ in set $A$?

-
Just take out the old pair and insert the new one. If you do this a lot, you can define a specific, more compact, notation for the operation. –  Henning Makholm Oct 27 '11 at 18:23
@HenningMakholm, consider to post your comment as an answer. –  Oleksandr Kozlov Oct 28 '11 at 6:46
If you are after a shorter notation for this, it can be expressed using symmetric difference as $A\triangle\{(b,5),(x,8)\}$. Of course, this is not ideal - from this notation you don't see which pair is replaced by the other one. –  Martin Sleziak Oct 28 '11 at 9:54

There is no standard notation for this, but it is clear what to do: simply remove the old pair and then insert the new one: $$(A\setminus\{(a,b_1)\})\cup\{(a,b_2)\}$$ or possibly even (if your relation is known to be functional): $$\{(x,y)\in A\mid x\neq a\}\cup\{(a,b)\}$$ If you find yourself doing this a lot, you're free to define a more compact notation for it yourself. Just make sure to explain it to your reader before using it.