  This paper studies a mathematical formalism of nonequilibrium thermodynamics
for chemical reaction models with $N$ species, $M$ reactions, and general rate
law. We establish a mathematical basis for J. W. Gibbs' macroscopic chemical
thermodynamics under G. N. Lewis' kinetic law of entire equilibrium (detailed
balance in nonlinear chemistry kinetics). In doing so, the equilibrium
thermodynamics is then naturally generalized to nonequilibrium settings without
detailed balance. The kinetic models are represented by a Markovian jumping
process. A generalized macroscopic chemical free energy function and its
associated balance equation with nonnegative source and sink are the major
discoveries. The proof is based on the large deviation principle of this type
of Markov processes. A general fluctuation dissipation theorem for stochastic
reaction kinetics is also proved. The mathematical theory illustrates how a
novel macroscopic dynamic law can emerges from the mesoscopic kinetics in a
multi-scale system.
