I need help solving the following exercise:
Let $X$ be a set with $|X| = n\in \mathbb N_0$, $f:\mathcal P(X) \to \{k\in \mathbb N_0: 0 \leq k \leq n\}$ satisfying
a) $\forall Y \in \mathcal P(X), Y \neq \emptyset: f(Y) > 0$
b) $\forall Y, Z \in \mathcal P(X): f(Y \cup Z) = f(Y \cap Z) + f((Y \cup Z)\backslash (Y \cap Z))$
Show that $\forall Y \in \mathcal P(X): f(Y) = |Y|$
I already proved that $f(\emptyset) = 0$ by choosing $Y = X$ and $Z = \emptyset$ using the second rule, but I don't know how to continue from here, since I know nothing about the cardinality but that it's $>0$ for all $Y \neq \emptyset$. Would appreciate any hint.
HINT: Show first that if $A,B\subseteq X$ are disjoint, then $f(A\cup B)=f(A)+f(B)$. Then show by induction on $k$ that if $A_1,\ldots,A_k$ are pairwise disjoint, $f\left(\bigcup_{i=1}^kA_k\right)=\sum_{i=1}^kf(A_i)$. Finally, let $X=\{x_k:k=1,\ldots,n\}$, and consider $f(X)=f\left(\bigcup_{k=1}^n\{x_k\}\right)$, bearing in mind that the codomain of $f$ is $\{0,1,\ldots,n\}$.