Piecewise function with set builder notation

functions

I want to define a function takes takes a set, and outputs another set while modifying some elements. The question is, how do I express such a function using set builder notation?

Let $g:B\to A$, $g(S)$ is a set that contains $(x+1)$ for every $x$ in $S$ that is bigger or equal to $7$ and $x$ for every $x$ in $S$ that is less than $7$.

Also, given $A\ =\ P\left(N\backslash7\right),\ B\ =\ P\left(N\right)\ \backslash\ P\left(\left\{7\right\}\right)$, how would you prove the function is injective? Because it feels kind of trivial which makes it a pain for me to prove..

Best Answer

Let

$$f(x):=\begin{cases}x< 7\to x,\\x\ge7\to x+1\end{cases}.$$

Then

$$A=\{x\in S:f(x)\}.$$