Let me list a few formulas which should be well-known:
- (GCD-LCM product formula) For positive integers $n,m$, $$\operatorname{gcd}(n,m)\operatorname{lcm}(n,m)=nm.$$
- (Inclusion-exclusion principle) For sets $A,B$, $$\#(A\cap B)+\#(A\cup B)=\#A+\#B$$
- ("Linear inclusion-exclusion principle") For subspaces $W_1,W_2$ of a vector space $V$, $$\dim(W_1\cap W_2)+\dim(W_1+W_2)=\dim(W_1)+\dim(W_2)$$
All of these formulas have the same form: We have:
- A lattice $L$,
- A commutative ordered monoid $(M,\star,\leq)$,
- an order-preserving "size" function $S\colon L\to M$ such that $$S(a\land b)\star S(a\lor b)=S(a)\star S(b)\qquad\text{for all }a,b\in L.\tag{$\star$}$$
In the first example, $L=\mathbb{Z}_{>0}$ with the divisibility ordering ($n\leq m$ iff $n$ divides $m$); $M=\mathbb{Z}_{>0}$ with product and the usual order (or the divisibility ordering, doesn't matter); $S$ is the identity function of $\mathbb{Z}_{>0}$.
In the second example, $L$ is the power set of some universe, ordered by inclusion; $M$ is $\mathbb{Z}_{>0}$ with sum and the usual ordering; $S$ is the function which outputs the cardinality of a set.
In the third example, $L$ is the lattice of subspaces of $V$; $M$ is as in the second example; $S$ is the function mapping each subspace to its dimension.
Here are a few other examples of the same nature, which are more-or-less trivial but interesting nevertheless:
If $B_1$, $B_2$ are Boolean algebras is a Boolean Algebra and $S\colon B_1\to B_2$ is a homomorphism, then for all $a,b\in B_1$, $$S(a\land b)\lor S(a\lor b)=S(a)\lor S(b).$$
For bounded subsets $A,B$ of a complete lattice $L$, $$\sup(A\cap B)\lor\sup(A\cup B)=\sup(A)\lor\sup(B)$$
For real functions $f,g$ on $[0,1]$, $$\int_0^1\min(f,g)+\int_0^1\max(f,g)=\int_0^1f+\int_0^1g.$$
For subsets $A,B$ of a vector space $V$, $$\operatorname{span}(A\cap B)+\operatorname{span}(A\cup B)=\operatorname{span}(A)+\operatorname{span}(B).$$
(Examples 4, 5 and 7 are more trivial, as the commutative ordered monoid under consideration is simply a lattice with the join operation and the "size" function preserves joins)
Question: Is there a name for the kind of structure described as in $(\star)$? These seem to be reocurring in different areas concerning all kinds of interesting structures.