When we are writing reaction equations, it seems that we are regarding the chemicals as some sort of algebraic objects.

To disambiguate, “element” refers to element in math, while “chemical element” refers to element in chemistry.

For convenience, if there is no ambiguity, denote the zero element in all kinds of algebraic structures as 00.

From the perspective of algebra, mm different chemical elements forms a free Z\mathbb Z-module M\mathscr M, whose rank (a.k.a. dimension) is mm. Chemicals (whether pures or mixtures) consisting of these chemical elements can be regarded as elements in M\mathscr M.

Suppose the basis of M\mathscr M is BMmB\in\mathscr M^m, whose components are the respective chemical elements. Then, any cMc\in\mathscr M can be represented as an inner product c=<p,B>c=\left<p,B\right>, where pZmp\in\mathbb Z^m.

With the isomorphism f:p<p,B>f:p\mapsto\left<p,B\right>, one can find that MZm\mathscr M\simeq\mathbb Z^m.

Suppose a chemical reaction equation involves nn chemicals CMnC\in\mathscr M^n. Then, balancing the equation is in fact to find xZnx\in\mathbb Z^n such that <x,C>=0\left<x,C\right>=0. In other words, it is to solve the homogeneous linear equation <x,C>=0\left<x,C\right>=0. The solution xx is the “signed stoichiometries”. Chemicals with positive stoichiometries and those with negative ones stay at different side of the chemical reaction equation.

One can define the concept of “rank” in Mn\mathscr M^n. Let rrankCr\coloneqq\operatorname{rank}C.

  1. rnr\ge n. In this case, xx has the only solution x=0x=0. A mistake made when writing out the reaction equation may lead to this case.
  2. r=n1r=n-1. In this case, xx has infinite solutions, all with the form x=tsx=ts, where sZns\in\mathbb Z^n is the solution basis, and tZt\in\mathbb Z is an arbitrary parameter. Then ss is the result of balancing. Usually, it is required that components of ss be mutually prime. Such chemical reactions can be called “simple reactions”.
  3. r<n1r<n-1. In this case, xx has infinite solutions, with multiple (to be clear, nrn-r) solution basis. Such chemical reactions can be called “complicated reactions”. This means the reaction equation can be decomposed into nrn-r linearly independent simple reaction equations, where the stoichiometries are the solution basis we previously solved out.

Note that the solution basis of a complicated reaction are not unique, so you may derive conclusions of completely different chemical meanings.