Let $E$ be a finite (non-empty) set. Find all functions $f: \mathcal{P} \rightarrow \mathbb{R}$ such that for all subsets $A$ and $B$ of $E, f(A \cap B)+f(A \cup B)=f(A)+f(B)$, and for any bijection $\sigma: E \rightarrow E$ and any subset $A$ of $E, f(\sigma(A))=f(A)$.
We will show that the solutions are affine functions in the cardinality, i.e., of the form $f(A)=a \cdot \operatorname{Card}(A)+b$. First, if $A=\{x\}, f(A)$ does not depend on $x$. Indeed, there is a bijection $\sigma$ from $E$ to $E$ such that $\sigma(x)=y$, for any $x$ and $y$. Let $b=f(\emptyset)$ and $a=f(\{x\})$ for some $x \in E$ (this is independent of the choice of $x$). Then by induction on card $(A)$, $f(A)=a \cdot \operatorname{Card}(A)+b$. Indeed, if $x \in A, A=(A \backslash\{x\}) \cup\{x\}$. Therefore, $f(A)=f(A \backslash\{x\})+f(\{x\})=$ $a \cdot(\operatorname{Card}(A)-1)+b+a=a \cdot \operatorname{Card}(A)+b$.