Why are algebraic structures preserved under intersection but not union?
Solution 1:
I wouldn't call it "deep", but here's an intuitive reasoning.
Intersections have elements that come from both sets, so they have the properties of both sets. If, for each of the component sets, there is some element(s) guaranteed to exist within that set, then such element(s) must necessarily exist in the intersection. For example, if $A$ and $B$ are closed under addition, then any pair of elements $x,y\in A\cap B$ is in each of $A$ and $B$, so the sum $x+y$ must be in each of $A$ and $B$, and so $x+y\in A\cap B$. This line of reasoning holds for basically any "structure" property out there, simply by virtue of the fact that all elements come from a collection of sets that simultaneously have that property.
Unions, on the other hand, have some elements from only one set or the other. In a sense, these elements only have one piece of the puzzle, i.e. they only have the properties of one set rather than both. Even if the statement of those properties is the same, like "closure under addition", the actual mechanics of those properties is different from set to set, and may not be compatible. Given $x\in A$ and $y\in B$, we have $x,y\in A\cup B$, but there's no reason to believe that $x+y \in A\cup B$. Sometimes it's simply not true, such as $\Bbb{N}\cup i\Bbb{N}$, where $i\Bbb{N} = \{ z \in \Bbb{C} \ | \ z = in \text{ for some } n\in\Bbb{N} \}$. In this case, the closure under addition which is guaranteed for each of the component sets is not compatible with one another, so you get sums like $1+i$ which isn't in either set. On the other hand, sometimes you do have sets with compatible structure, such as $\Bbb{N}\cup -\Bbb{N}$ (considering $0\in\Bbb{N}$), where any sum of elements from this union still lies in the union.
Solution 2:
Algebraic structures are typically defined by universal statements. For example, a group is a structure $(G,\cdot,^{-1},e)$, where $\cdot$ is a binary function, $^{-1}$ is a unary function, and $e$ is a nullary function, satisfying the following axioms:
- $\forall x,y,z \; (x\cdot y)\cdot z = x\cdot(y\cdot z)$.
- $\forall x \; x \cdot x^{-1} = x^{-1} \cdot x = e$.
- $\forall x \; x \cdot e = e \cdot x = x$.
Universal axioms are preserved under intersection but not under union.
Solution 3:
Since no one has explained this from a categorical perspective yet, let me try to offer another point of view. Each of the types of objects you mention (groups, rings, fields, vector spaces) form a concrete category. That is, every group, ring, field, or vector space is a set equipped with the data of extra structure, and the homomorphisms between them are set maps which preserve that extra structure.
Another way we might say the above is that if $\mathcal{C}$ is the category of any of the above algebraic objects and their morphisms, we have a forgetful functor \begin{align*} U : \mathcal{C}&\to\mathsf{Set}\\ A&\mapsto UA, \end{align*} which sends each algebraic structure $A$ to its underlying set $UA$ and each homomorphism of algebraic structures $f : A\to B$ to the underlying function on sets $Uf : UA\to UB.$
In each of these situations (well, except when $\mathcal{C}$ is the category of fields), the forgetful functor has a left adjoint - the free object functor. Explicitly, this means that if you're given a group, ring, or vector space (more generally module) $A$ and a set $S,$ then there is a natural bijection $$ \{\textrm{homomorphisms of algebraic structures }f : F(S)\to A\}\cong\{\textrm{maps of sets }g : S\to UA\}, $$ where $F(S)$ denotes the free [group, ring, vector space, module...] on $S.$ This is essentially the definition of a free object: to give a homomorphism of the free group, ring, or vector space $F(S)$ on a set $S$ to another group, ring, or vector space $A,$ you need to give a map of sets $S\to UA.$ Think of $S$ as being the set of generators of $F(S),$ and the "freeness" means that there are no relations between these generators other than the relations forced by the axioms of the algebraic structure.
For example, the free vector space on a set $S$ may be described as the vector space $F(S)$ with basis $\{e_s\mid s\in S\}$ indexed by the elements of $s.$ To give a map from $F(S)$ to any other vector space $V,$ you need only specify where the basis elements $e_s$ are sent, and this is completely determined by a set map $S\to UV$ (again, $UV$ is the underlying set of the vector space $V$).
As another example, the free commutative ring on a set $S$ is the ring $\Bbb Z[x_s\mid s\in S]$ - the polynomial ring over $\Bbb Z$ with one variable for each element of $s.$
Now that I've set this up, the point is that intersections are limits in the category of sets, and that forgetful functors (or more generally, right adjoints) play nicely with limits. In particular, if $S$ and $T$ are subsets of some set $X,$ then we may consider the diagram
$$ \require{AMScd} \begin{CD} Y @>>> S\\ @VVV @VVV \\ T @>>> X, \end{CD} $$ where $Y$ is some unspecified set together with maps such that the diagram commutes. The intersection $S\cap T$ has the nice property that any set $Y$ with maps to $S$ and $T$ as in the diagram will factor uniquely through a map $Y\to S\cap T.$ This is the statement that $S\cap T$ is the limit of the diagram above (without the $Y$).
By abstract nonsense arguments, right adjoints (like the forgetful functor in these cases) preserve limits. (We also sometimes have even nicer results, but let me not get in too deep.) Preservation of limits means that if we have a limit of algebras $\varprojlim A_i$ over some diagram, then the underlying set of the limit is canonically isomorphic to the limit $\varprojlim UA_i$ (in the category of sets) of the underlying sets of the algebras.
So, if you have subalgebras $A_1,A_2$ of a given algebra $A,$ and you consider the limit $B$ of these inclusions as we did for sets: $$ \require{AMScd} \begin{CD} B @>>> A_1\\ @VVV @VVV \\ A_2 @>>> A, \end{CD} $$
then the underlying set of the limit $B$ is the limit of the underlying sets $U A_1$ and $UA_2,$ which is simply the intersection $UA_1\cap UA_2.$
The other punchline is that the union of two sets $S$ and $T$ (which are subsets of some ambient set $X$) is the colimit of an appropriate diagram. However, if $S$ and $T$ are the underlying sets of some algebraic objects $S = UA_1,$ $T = UA_2,$ the forgetful functor does not preserve colimits (even if $X$ is the underlying set of some large algebra $X = UA$). So, unless you are surprisingly lucky, the smallest algebra containing two given algebras $A_1$ and $A_2$ (which is a colimit) will not be the same as the smallest set containing $UA_1$ and $UA_2.$
Many others have already expressed that this is also related to the fact that products and intersections commute but the same is not true of products and unions: this is also a categorical fact! Products and intersections are both examples of limits, but unions are colimits. Limits commute with limits, but limits do not necessarily commute with colimits, unless certain nice conditions hold.
All in all, the failure of existence of an algebraic structure on a union is a combination of a number of categorical facts, which are much more general than the specific situations you mention. While proving that the forgetful functors described have the properties I claim essentially come down to making arguments like in the other answers, I prefer this perspective because taking "unions" or "intersections" is somehow an unnatural thing to do when you have things which aren't sets - you want to combine your algebraic objects in ways that result in objects with the same algebraic structure (e.g., via taking limits and colimits or using other categorical constructions). The fact that the underlying set of a limit coincides with the limits of the underlying sets is a result of nice properties that the forgetful functor in question has.
Note: I said we didn't consider fields above, and that is because the category of fields is particularly badly behaved, because fields are rather restrictive.
Solution 4:
Let $X$ be a set, and let $Y$ and $Z$ be subsets of $X$. Let $f: X^2 \to X$ be a binary function, and assume that the restrictions of $f$ to $Y$ and $Z$ are also functions (i.e. $f|_{Y^2} \subseteq Y$ and $f|{Z^2} \subseteq Z$).
Is it the case that $f|_{(Y \cap Z)^2} \subseteq Y \cap Z$? Yes, it is: if $a, b \in Y \cap Z$ then $f(a, b) \in Y$ because $f|_{Y^2} \subseteq Y$ and $f(a, b) \in Z$ because $f|_{Z^2} \subseteq Z$, so $f(a, b) \in Y \cap Z$.
Is it the case that $f|_{(Y \cup Z)^2} \subseteq Y \cup Z$? Not necessarily: if $a \in Y$ and $b \in Z$ then we know nothing at all about $f(a, b)$.
(Almost?) any structure we would call "algebraic" has some binary function (group multiplication, vector space addition, etc) which runs into this problem.