Let $\mathbb{B}, \mathbb{V}$ two sets. I have defined a function $f: \mathbb{B} \rightarrow \mathbb{V}$.
$\mathcal{P}(\mathbb{B})$ means the power set of $\mathbb{B}$, I am looking for a function $g: (\mathbb{B} \rightarrow \mathbb{V}) \times \mathcal{P}(\mathbb{B}) \rightarrow (\mathcal{P}(\mathbb{B}) \rightarrow \mathbb{V})$ which can filter the domain of $f$ by a subset of $\mathbb{B}$, that means $g: (f, \mathbb{S}) \mapsto h$ such that the domain of $h$ is $\mathbb{S}$ and $\forall x \in \mathbb{S}, h(x) = f(x)$.
I am wondering if this kind of function exists already. If not, is there a better way to define it?
Could anyone help?