How to define the subset with the two smallest elements

33 Views Asked by At

I am having a bit of trouble with basic notation.

I have a set of color value pairs e.g. CV = {(blue, 3), (orange,54), (red, 1), (brown, 43), (yellow,7)} and I want to define the subset that contains the lowest two values. In our case that would be Subset = {(blue, 3), (red, 1)}.

Thanks in advance.

1

There are 1 best solutions below

0
On

$S \in \mathcal P(A) \land |S| = 2 \land (\exists (a,b) \in S \implies (b = \min{S[\mathrm{Dom}\, f]} \lor b = \min{(S[\mathrm{Dom} \, f] / \min{S[\mathrm{Dom} \,f]})})$.

Whew. I wonder why you need this, tho. Note that this set must exist by the axiom of specification.