Derived sets from a base set

77 Views Asked by At

Let's say we have a set $B$. Some of its elements can have two versions, let's say $b^+$ and $b^-$, while the rest can only have one: $b^+$.

Now I want to build a set that contains the two versions of those elements that can have them, and the only one version for those elements which have only one.

So my question is: How do I build "derived" sets ? Which formalizes:

  • $X$: The set of "$^+$" versions of all elements of $B$
  • $Y$: The set of "$^-$" versions of the elements of $B$ which can have them (assume there is a predicate that can be used to detect them)
  • Implies $X\cup Y \neq B$

Example:

$B$ can be a set of cars, some of which come in 4wd or 2wd versions, and some only come in 2wd. I'd like to build the set of all possible car versions.

1

There are 1 best solutions below

3
On BEST ANSWER

The usual ordered pair (x,y) = {{x}, {x,y}}.
Your question is not about sets; it is about multisets or bags.
A simulation of a bag for your problem is
T×{0,1} $\cup$ S×{0},
where T is the set of two version elements
and S is the set of one version elements.