Why does the carrier of an algebraic structure has to be closed under the operations of the algebraic structure?
One could also consider $(\mathbb{N}^*, \div)$. But why isn't that an algebraic structure?
Why does the carrier of an algebraic structure has to be closed under the operations of the algebraic structure?
One could also consider $(\mathbb{N}^*, \div)$. But why isn't that an algebraic structure?
It is perfectly valid to call (informally) algebraic structure a set endowed with a family of partial operations. In the example you give, division is a partial operation on $\mathbb {N}$ (defined for pairs $s, t $ such that $t $ divides $s $). In this sense, for instance, a category might be called an algebraic structure with a partial operation $\circ $ and several units.
Nevertheless, when you have operations defined on the whole base set, you can work more smoothly. As in Stefan's answer, you may define straightforwardly the notions of subalgebra, homomorphism, isomorphism, etc. Otherwise, you should be careful to check what happens if one expression is defined on one side of an equation and the other doesn't, and the like.
Finally, you might apply your idea of "the result is in another set" and go to multi-sorted structures. In this case, your operations may jump from one set to another, but you have to gather in advance all sets that will ever appear in this process (the sorts).
Several constructions in universal algebra lead to sets with partially defined operations (v.g, the clone of term operations). This can also be considered as a multi-sorted structure (one sort for each number of arguments).
As your initial question may be answered by saying that this is part of the definition, let me instead give you a reason for this. Say, we start with the structure $(\mathbb R^*; \cdot, \ ^{-1}, 1)$. Then $(\mathbb Q^* , \cdot, \ ^{-1}, 1)$ is a substructure, but what exactly do we mean by this?
We mean that
Now, consider $\mathbb N^*$. The first point still holds true and so does the 2nd and 4th. But there is a problem with the 3rd point of our list. If we want to know what $2^{-1}$ is, we cannot find such a value in $\mathbb N^*$, but we can in the other two structures. So there is no way to define a function $$ ^{-1} \colon \mathbb N^* \rightarrow \mathbb N^* $$ that agrees with the one on $\mathbb Q^*$ or $\mathbb R^*$ on their common domain.