The well-known inclusion-exclusion principle states that for two finite sets $A$ and $B$, $$|A| + |B| = |A \cap B| + |A \cup B|$$
It is also a simple result that given positive natural numbers $a$ and $b$, $$ab = \gcd(a, b) \cdot \operatorname{lcm}(a, b)$$
I was struck by the similarity between these two formulae, especially considering that $\cap$ and $\cup$ are the meet and join operations in the poset of sets ordered by inclusion, while $\gcd$ and $\operatorname{lcm}$ are the meet and join operations in the poset of numbers ordered by divisibility. Is there some general principle at work here?