1
$\begingroup$

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.

  • 1
    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$.2012-05-03
  • 0
    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.2012-05-03
  • 0
    On the other hand, if you're trying to write English rather than a program, Mark's answer is good.2012-05-03
  • 0
    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.2012-05-03
  • 0
    @freitass: So you are writing a program?2012-05-03
  • 0
    @TaraB: yes, a pseudo-algorithm.2012-05-03

2 Answers 2