# one set to be another but with each element modified

For example:

$$a = \{\mathbf{true, true, false}\}$$ $$b = \{ 0.8, 0.8, 0\}$$

In this case each $\bf true$ in $a$ has become a $0.8$ in $b$ wheras the $\bf false$ values have resulted in $0$ s.

What would I write to express this for creating $b$ from any set $a$ as in the above example?

-
What do you mean by creating? I suppose you could write $b=f[a]$ where $f(true)=0.8,f(false)=0$. –  tomasz Aug 21 '12 at 14:40
Create like $a = 4$ or $a = b$ if there was no $a$ before that definition. What do the [] represent? –  alan2here Aug 21 '12 at 14:46
What's wrong with $b = \{ 0.8, 0.8, 0\}$? $[]$ represent image. See e.g. math.stackexchange.com/questions/109942/…. –  tomasz Aug 21 '12 at 14:51
the '$b =$' line should work with any $a$, not just this example $true, true, false$. –  alan2here Aug 21 '12 at 14:59
Then you should edit your question to make it clear what you want exactly. If it's image, then my comment already answers your question (and I will post it as an answer so that you can accept it). –  tomasz Aug 21 '12 at 15:00

First observe that sets ignore repetitions. Namely, $\{x,x,y\}=\{x,y\}$.

Now you have some $f\colon a\to b$, and you want to say that $f(x)=0.8$, then you can write $f^{-1}(0.8)=x$, or if you prefer $x\in f^{-1}[0.8]$ to suggest that $f(x)=0.8$ but possibly other elements are mapped to $0.8$ as well.

In the same manner, $y\in f^{-1}[0]$ is to say that $f(y)=0$.

To put this into your particular example, $\text{true}=f^{-1}(0.8),\text{false}=f^{-1}(0)$.

-
Sorry if this is obvious, is it also correct as f(0.8) = true, f(0) = false? Perhaps $a$ is a list and not a set because its entites are ordered and it contains duplicates? –  alan2here Aug 21 '12 at 15:09
@alan2here: If those are lists, then the function from the underlying set can be extended to the lists in the obvious way. –  Asaf Karagila Aug 21 '12 at 15:10
Given a = {true, true, false}, is the following ok to change the values in $a$? $a'(0.8) = true$, $a'(0) = false$. Also, I'd prefer to avoid the part in your example that appears as if $f$ to the power of -1 is being calculated. –  alan2here Aug 21 '12 at 15:12
@alan2here: I'm not sure what that means. However if you wish that all the elements which have the value $0.8$ in the first list will correspond to elements with value $\text{true}$ in the second list, then setting $f(0.8)=\text{true}$ is fine. –  Asaf Karagila Aug 21 '12 at 15:14
Thank you. $a'$ means "$a$ afterwards" or "$a$ becomes". –  alan2here Aug 21 '12 at 15:17

First, note that you are working with multisets rather than sets, since you are allowing repeated elements.

What you have in the example is a function $f: a \rightarrow b$ defined by $$f(x) = \begin{cases} 0.8 & \text{if } x = \text{true}\\ 0 & \text{if } x = \text{false}. \end{cases}$$

You can replace the domain $a$ with any multiset of $0.8$'s and $0$'s. If you want to introduce new elements, you will need to specify how $f$ acts on them.

-