Assume $A \subset \mathbb{N}^k, B\subset \mathbb{N}$ to be $\Sigma_1$-sets and $f:\mathbb{N}^k \rightarrow \mathbb{N}$ a partial or total function with a $\Sigma_1$-graph.
Prove that the image of $A$ and the preimage of $B$ are $\Sigma_1$-sets. I know how to prove this via the property, that every $\Sigma_1$ is r.e. but I am asked to give $\Sigma_1$ formulas and I appreciate a second opinion for my solution so far:
There are $\Sigma_0$-formulas $\varphi_A, \varphi_G$ such that
$A =\{\vec{n}\in \mathbb{N}^k: \mathbb{N}\vDash \exists l~\varphi_A(l,\vec{n})\}$
$Graph(f) = \{(\vec{n},m) \in \mathbb{N}^k \times \mathbb{N}: f(\vec{n})=m\}=\{(\vec{n},m) \in \mathbb{N}^k \times \mathbb{N}: \mathbb{N}\vDash \exists l~\varphi_G(l,\vec{n},m)\}$
My $\Sigma_1$-formula for the image is $\psi = \exists l~\varphi_A(l,\vec{n}) \land \varphi_G(l,\vec{n},m)$ which should give me: $f[A] = \{m\in \mathbb{N}: \vec{n} \in A, f(\vec{n})=m\}=\{m\in \mathbb{N}: \mathbb{N}\vDash \psi \}$
Firstly $\psi$ is clearly a $\Sigma_1$ function because $\Sigma_0$ is closed under join and meet. Secondly $\varphi_A$ reduces $\mathbb{N}^k$ to $A$ and $\varphi_G$ gives us the image of $A$. Is this correct? For the preimage of $B$, I use a similar approach.
In the first place, the graph of $f$ should be a set of $(k+1)$-tuples, namely the set of $(\vec n,m)$ such that $f(\vec n)=m$. Your formula for the graph of $f$ defines a set of numbers, a set that consists of a single $m$. And the set depends on an unspecified $\vec n$.
In the second place, the formula $\psi$ that is intended to define the image should not assume that the same $l$ serves as the witness in both $\phi_A$ and $\phi_G#.