TITLE: An inequality for the dimension of the sum of subspaces
QUESTION [6 upvotes]: The answer with the most of upvotes on MO is this answer on $\dim(U+V+W)$.
Question:
1. Is it nonetheless true that every three vector subspaces $U$, $V$ and $W$ of a vector space $M$ satisfy $$ \dim(U +V + W) \le $$ $$ \dim U + \dim V + \dim W - \dim (U \cap V) - \dim (U \cap W) - \dim (V \cap W) + \dim(U \cap V \cap W) $$ ?
2. And, more generally, that $$\dim(\sum_{i = 1}^{n} U_i) \le \sum_{r=1}^{n} (-1)^{r+1} \sum_{i_1 < i_2 < \dots < i_r} \dim(\bigcap_{s=1}^{r}U_{i_s}) ? $$

REPLY [4 votes]: The answer to question 2. is No for every $n\geq4$.
Here is a counterexample for $n=4$:
Let $\mathbf{k}$ be a field, and let $M=\mathbf{k}^{6}$.
Let $U_{1}=\left\{  \left(  a,b,c,d,e,f\right)  \in M\ \mid\ a=b\text{ and
}d=e\right\}  $.
Let $U_{2}=\left\{  \left(  a,b,c,d,e,f\right)  \in M\ \mid\ b=c\text{ and
}e=f\right\}  $.
Let $U_{3}=\left\{  \left(  a,b,c,d,e,f\right)  \in M\ \mid\ c=d\text{ and
}f=a\right\}  $.
Let $U_{4}=\left\{  \left(  a,b,c,d,e,f\right)  \in M\ \mid
\ a+c+e=b+d+f\right\}  $.
Then, your inequality becomes
$6\leq4+4+4+5-2-2-2-3-3-3+1+1+1+1-1$,
which is false.
To get counterexamples for any $n\geq4$, extend this by setting $U_{5}
=U_{6}=\cdots=U_{n}=0$.