# Using a function in set-builder notation?

I want to formulate a set $K$ with the set-builder notation, but I am not sure if I am "allowed" to use a function, $m$, as a predicate without explicitly defining the function.

I want to accomplish the following: Given two sets $A$ and $B$, I want to define set $K$ in way that members of $K$ are also members of either set $A$ or $B$, provided that the function $m$ of $k$ evaluates to $e$, where $k \in K$ and $e \in E$. Furthermore, the "inner workings" of $m$ are irrelevant, it only matters that $m$ maps members of $K$ to members of $E$.

I tried to formulate it as follows:

Suppose $m: K \rightarrow E$ and $e \in E$, then $K$ is:

$K = \{x \in (A \cup B)\ :\ e = m(x)\}$

• Your problem is that $m$ is given in terms of $K$ and $K$ is defined in terms of $m$. Is $m$ defined on all of $A \cup B$ (regardless of what its values are)? – Clive Newstead Jul 3 '18 at 20:12
• Thank you for your help! The function $m$ of $x$, does not evaluate to $e$ for every $x$, where $x \in (A \cup B)$, but only for specific ones, yet the details about the exact mapping should be irrelevant. Does this make sense? – John Doe Jul 3 '18 at 20:19
• It sounds like you just want to say $m:K\to E$ and $K\subseteq A\cup B$ and the set builder stuff is a red herring. – Mark S. Jul 3 '18 at 20:22
• @JohnDoe: What you're asking does make sense, but it also matters whether $m$ is a function whose domain is $A \cup B$ or not. Is $m(x)$ defined for each $x \in A \cup B$? If so, then $K$ is simply the preimage of $e$ under $m$, and the notation $K = \{ x \in A \cup B : e = m(x) \}$ is valid. – Clive Newstead Jul 3 '18 at 20:23
• If $m$ is not fixed but can vary so that $K$ depends on $m$ then you could make this explicit by writing $K(m)$ or $K_m$. – md2perpe Jul 3 '18 at 20:32

Since "$m(x)$ is defined for each $x\in A\cup B$", then the domain of $m$ must be $A\cup B$ (or some superset like $A\cup B\cup C$).

Since "$m(x)$ may either evaluate to $\{\}$ or [some] $e\in E$" and "$e\in E$ is not fixed", then the codomain of $m$ must contain at least the element $\{\}$ (which is a little odd**) and also all of $E$. So maybe the codomain is $\{\{\}\}\cup E$, or something larger.

Once you've set up your domain and codomain (e.g. "$m:A\cup B\to F$", where $A,B,F$ have been defined previously) then there's no circular reference and you can just define $K=\{x\in A\cup B\mid m(x)\in E\}$.

If the domain is only $A\cap B$, this $K$ is the "preimage" or "inverse image" of $E$ under $m$, sometimes written $m^{-1}(E)$ or $m^{-1}[E]$ or (very rarely) $m^{<}(E)$. If the domain of $m$ is bigger than $A\cup B$, then you want $m^{-1}[E]\cap \left(A\cup B\right)$.

**

If by $\{\}$ you didn't mean the empty set in particular, but just meant things not in $E$, then the codomain would just be some relevant superset of $E$.

If by $\{\}$ you didn't really care about it being the empty set in particular and just wanted to represent a sort of failure of the function to be defined, then you may want to read about partial functions.

• Shouldn't it be $m: A \cup B \to E$ instead of $F$? I want to represent that $m(x)$ can be undefined, so partial functions are the way to go. Thanks a lot for your help! – John Doe Jul 4 '18 at 8:36
• @John It can't be $\to E$ without extremely explicit specification that $m$ is a partial function. With standard function notation, the codomain has to be some $F\supseteq E\cup \{\{\}\}$. – Mark S. Jul 4 '18 at 12:06
• Okay, I see. When you say "extermely explicit specification" that $m$ is a partial function, do you mean that I would have to specify the exact case when $m(x)$ would be undefined or do you mean $m : A \cup B \not\to E$? – John Doe Jul 4 '18 at 13:19
• @John I meant something like $\not \to$. Maybe also with the words "partial function" for those who might not be familiar with that arrow convention. – Mark S. Jul 4 '18 at 13:44
• Perfect! Thank you so much! Have a nice day. – John Doe Jul 4 '18 at 13:52