Apologies for the uninformative title, feel free to amend.
Let $A$ be any infinite set. Let $n$ be a positive integer.
Is there a simple characterization the functions
$$\displaystyle f:{A\choose n}\to{\mathbb N}$$
such that for some $B\subseteq A$
$$f(a)=|a\cap B|\ \textrm{ for every }\ a\in {A\choose n}$$
The set $B$ above is uniquely determined by $f$ (right?). Can we easily obtain it from $f\ $?
EDIT: As an example, you can think of $A={\mathbb N}$ and as $B$ the set of even numbers, the set of prime numbers, etc. (but the question is general). I need a property that characterize these functions without mentioning $B$ but only sets of cardinality $a$. (I want a first-order property in the proper language.)
The answer to both questions is positive:
case: There is some $a \in {A \choose n}$ such that $f(a) = 0$. Then $$ B = \{ b \in \mathbb N \mid f(\{b\} \cup a \setminus \{ \min a \}) = 1 \}. $$
case: Otherwise there is some $a \in {A \choose n}$ such that $f(a) = n$. Then $$ A \setminus B = \{ b \in \mathbb N \mid f(\{b\} \cup a \setminus \{\min a \}) < n \} $$ and $B = \mathbb N \setminus \left( A \setminus B \right)$.
edit: Note that $A$ can be read of easily from $f$ -- so it's appearance as a parameter isn't necessary.
Right now I don't have time to carefully check this but I think the following might characterize such functions:
Let $f \colon {A \choose n} \to \mathbb N$ be a function such that
Let $$ B = \{ x \in A \mid \forall y \in A \forall a \in {A \setminus\{x,y\} \choose n} f(a \cup \{x\}) \ge f(a \cup \{y\}) \} $$ Then $$ f(a) = |B \cap a | $$ for all $a \in {A \choose n}$.