# How to remove, from a set, a single element that satisfies a property?

How do I pick a single element from a set that satisfies a property? For instance, I want to write something like this:

$$S = S - \{s \in S \ | \ s \text{ is pretty}\}$$

But with $\{s \in S \ | \ s \text{ is pretty}\}$ I want to pick a single element (any of the pretty ones).

Edit: If possible, the answer should be in a syntax similar to the definition of a set.

• Your question is not clear, at all. If $S$ is equal to $S$ without a subset of $S$ then that subset was empty, in particular this means that there are not "pretty" $s$ in $S$. May 3, 2012 at 14:20
• It would help if you specified the situation a bit more. I'm guessing that what you are doing is writing a program, in which case Mark's answer might not be exactly what you are looking for. If you let us know exactly what you're trying to do, we can probably help. May 3, 2012 at 14:31
• On the other hand, if you're trying to write English rather than a program, Mark's answer is good. May 3, 2012 at 14:32
• Thank you for the comments. Please, assume = is an assignment. In that case, S will be the result of S minus one of its pretty elements. After that being "processed", the resulting |S| (size of S) will be the former |S| - 1. I am looking for a formal way to describe that. May 3, 2012 at 15:42
• @freitass: So you are writing a program? May 3, 2012 at 16:38

You say "Let $p$ be a pretty element of $S$, and let $S' = S - \{p\}$".

Of course you have to show first that $S$ does have at least one pretty element.

• You are on the right path @Mark Dominus! Is there a shorter (leaner) way to describe that? May 3, 2012 at 15:44
• @freitass: This is a perfectly good answer to your question as asked. If you want something different, you should edit the question to explain what you're looking for. May 3, 2012 at 16:37
• @freitass: This is about as short and simple as you can make it. May 3, 2012 at 17:02
• @freitass: Why on earth would you want to do that if you're writing mathematics? It might make sense if you're doing some kind of programming, but then you need to tell us what the context is. May 3, 2012 at 19:42
• How about this: "Let$p$beaprettyelementof$S$andlet$S^\prime\!\!=\!\!S\!\!−\!\!\{\!p\!\}$"
– MJD
May 3, 2012 at 21:12

I'm still not entirely sure just what you want, but perhaps you could define an operator Arb on sets such that Arb(S) returns an arbitrary member of $S$ if $S\ne\varnothing$; then you can have assignments like $$S'=S\setminus\Big\{\operatorname{Arb}\{s\in S:s\text{ is pretty}\}\Big\}\;.$$

• Just one thing. What is this "\"? Does it have the same effect as a "-"? May 4, 2012 at 13:26