Dimension of vector spaces as a measure Let $X$ be a set with a collection of subsets $\mathcal{A}$. A finitely additive measure on $(X, \mathcal{A})$ is a function $\mu: \mathcal{A} \to \mathbb{R}_{\geq 0}$ such that for any two subsets $A, B \in \mathcal{A}$ we have $\mu(A \cup B) = \mu(A) + \mu(B) - \mu(A \cap B)$. 
Now consider the set $\mathcal{L}$ of all linear subspaces of a given finite dimensional vector space $V$. The dimension of subspaces satisfies an equality similar to a finitely additive measure. That is, for any two subspaces $W, U \in \mathcal{L}$ we have $\dim(U+W) = \dim(U) + \dim(W) - \dim(U \cap W)$.
My question: Is there a generalized notion of measure which includes dimension of vector spaces (and one can define analogues of integration for it)? For example is there a generalized notion of a measure on a lattice (where intersection and union are replaced with meet and join)?
Thanks
 A: Let $V$ be a finite-dimensional complex inner product space. We can equip the lattice $\mathcal{C}$ of closed subspaces with an involutive operation, mapping a subspace $a$ to its orthogonal complement $a^\perp$. This makes it into an orthomodular lattice. Unlike the case of Boolean algebras, this complement is a structure, not a property (it depends on the inner product used, but the lattice structure only depends on the underlying vector space).
A state is a mapping $\phi : \mathcal{C} \rightarrow [0,1]$ such that $\phi(V) = 1$, and if $a,b \in \mathcal{C}$ are orthogonal ($a \subseteq b^\perp$, or vice versa), then $\phi(a \lor b) = \phi(a) + \phi(b)$.
We can also allow maps $\phi : \mathcal{C} \rightarrow \mathbb{R}_{\geq 0}$ if we like (then it is necessary to require $\phi(\{0\}) = 0$). Then the dimension is such a map. The dimension, scaled down so that $\phi(V) = 1$, is a state. 
There is a satisfactory notion of integration as long as $\dim(V) \neq 2$. This is Gleason's theorem -- every state $\phi$ is the restriction of a positive unital map $\psi : L(V) \rightarrow \mathbb{C}$. To clarify, $L(V)$ is the space of linear operators $V \rightarrow V$, positive and unital means that $\psi$ maps positive semidefinite operators to nonnegative reals and the identity operator to $1$, and the elements of $\mathcal{C}$ can be identified with their corresponding self-adjoint projection operators. 
If we take $\phi$ to be $\dim$, then $\psi$ is the trace. 
The way things go wrong in 2 dimensions is that there are too many states on $\mathcal{C}(\mathbb{C}^2)$, additivity on orthogonal lines is not a strong enough condition to get a positive linear map $L(\mathbb{C}^2) \rightarrow \mathbb{C}$. 
All of the above has a generalization to von Neumann algebras, where there is the interesting type $\mathrm{II}_1$ case, where $\dim$ takes on all the values in $[0,1]$. 
