{'fraction_non_alphanumeric': 0.04145015105740181, 'fraction_numerical': 0.008217522658610272, 'mean_word_length': 4.709037599172128, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Stochastic Dynamics, Large Deviations Principle, and Non-equilibrium Thermodynamics

By examining the deterministic limit of a general $\epsilon$-dependent generator for Markovian dynamics, which includes the continuous Fokker-Planck equations and discrete chemical master equations as two special cases, the intrinsic connections among mesoscopic stochastic dynamics, deterministic ODEs or PDEs, large deviations rate function, and macroscopic thermodynamic potential are established. Our result not only solves the long-lasting question on the origin of entropy function in classical irreversible thermodynamics, but also reveals an emergent feature that arises automatically during the deterministic limit, through its large deviations rate function, with both time-reversible dynamics equipped with a Hamiltonian function and time-irreversible dynamics equipped with an entropy function.


Introduction
Statistical equilibrium thermodynamics in terms of the theory of ensembles, as formulated originally by Gibbs, has a more fundamental origin; there is a growing consensus that the description of large deviations from the theory of probability provides a mathematical foundation for the subject [1]. See [2,3,4], and the references within, for some of the recent developments. One of the most important insights from [3] is that one is able to derive nonequilibrium steady-state chemical thermodynamics using the same approach.
In a nutshell, the large deviations theory says that if a sequence of probability distributions has a deterministic limit, there exists concomitantly a scalar rate function for the convergence, which is defined on the entire state space. This rate function provides a variational principle akin to those associated with various thermodynamic potentials for different ensembles [5,6,7,8]. The existence of a "thermodynamic potential" such as entropy, in addition to being justified through Clausius equality in traditional thermodynamics, and the logarithm of thermodynamic Wahrscheinlichkeit as Boltzmann did in the mechanical theory of heat, could be hidden in the assumption of the sequence of probability distributions and its deterministic limit. We remind the readers that, according to Boltzmann's approach, the existence of a thermodynamic potential function, regardless of its specific form, is the only prerequisite for developing thermodynamics: Thermodynamic forces are introduced as conjugate variables, work as "the force times the displacement" then automatically becomes a part of the energy change.
It is well-known that the large deviations principle plays a key role in the equilibrium statistical mechanics [1,17]. In this study, we are going to show that it also acts as the statistical foundation of nonequilibrium thermodynamics, to be exact the Classical Irreversible Thermodynamics (CIT).
CIT was developed by Onsager, Prigogine, de Groot and Mazur, et al. since 1930s, as a natural generalization of concepts from equilibrium to nonequilibrium thermodynamics by introducing (i) the local equilibrium assumption which secures a spatiotemporal entropy density function and (ii) a linear thermodynamic force-flux relationships [18]. However, so far a solid and general theoretical foundation of CIT has not been established with a bottom-up approach. In this manuscript, we propose a bridge between the CIT and the application of large deviations principle (LDP) in the small-noise limit for a wide class of stochastic dynamics, representing by both diffusion and jump processes.
The existence of a nonequilibrium steady state is essential for our construction and its role cannot be overemphasized. In fact, a key step of our approach is to examine the stationary solution to a Hamilton-Jacobi equation satisfied by the large deviations rate function (LDRF), which has been rigorously demonstrated for many cases in the limiting process of stochastic to deterministic nonlinear dynamics [19]. The latter is the macroscopic dynamics covered by CIT, for which the stationary large deviations rate function turns to be the (relative) entropy function.
To make our statement clear, the paper is organized as follows. In Section II, a very generaldependent generator for Markovian dynamics, which includes the continuous Fokker-Planck equations and discrete chemical master equations as two special cases, is introduced. By examining the macroscopic limit, deterministic nonlinear ODEs and PDEs, which are widely used in modeling nonequilibrium processes, are derived from the Markovian dynamics as the noise level → 0.
Most importantly, during this limit process, stationary large deviations rate functions emerges automatically and serves as the entropy foundation for classical irreversible thermodynamics as shown in Section III. This conclusion is further justified through several concrete exactly-solvable examples. Since the present paper is a synthesis of several lines of researches into a coherent theory for nonequilibrium thermodynamics, in Section IV, we discuss the relations between previous work and ours. The last section contains general discussions about entropy, energy, dissipative dynamics and conservative dynamics.

Large deviations principle and stochastic dynamics
Most stochastic dynamics has a natural deterministic limit; which can and should be understood as a form of the Law of Large Numbers (LLN) in the theory of probability. If one uses an to represent this limiting process and denote the stochastic dynamics as Y (t), then one has where y(t) represents a deterministic dynamics. By envisioning the y(t) as the limit of a sequence of Y (t), there is an emergent variational principle associated with the deterministic y(t): This is the essence of our new thermodynamics. One example of the type of limit theorems in (1) is given by Kurtz. According to [9], for any finite time the volume averaged trajectories of particle numbers inside a given chemical reaction system, which follows a pure jump Markov process, will converge in probability to the solution of a set of deterministic ordinary differential equations (ODEs) in the limit of infinitely large particle number and volume (with the volume per particle being ) while keeping a finite ratio between the two: the concentration. One can find details of this result in the texts by van Kampen [10], Gardiner [11], or Keizer [12].
In general Y (t) can be either discrete or continuous: For Markov dynamics, it can be a diffusion process driven by a stochastic Wiener process W (t), or an integer-valued, continuous-time jump process on the lattice Z N driven by a stochastic Poisson process Ξ(t). In the former case, √ is the amplitude of the W (t); and for the latter, the jump size is proportional to , which means we taking the continuum limit. For a spatiotemporal dynamics Y (x, t), the well-known examples are the solution to a stochastic partial differential equation (SPDE) with scaled white noise and interacting particle systems (IPS) [13]. The corresponding limit law as in (1) is called the hydrodynamic limit: In this case, the limit y(x, t) usually satisfies a nonlinear partial differential equation [14,15,16].

-dependent Markov transition probability
Let us now consider the situation that a continuous-time stochastic, Markov Y (t) is not given explicitly, but only in terms of a dynamic equation, as its generator: This is a special form of the Chapman-Kolmogorov equation for Markov dynamics, assuming a time-homogeneous rate for the transition probability. ρ (z; t) denotes the probability density of the system in state z at time t, with 1 as a small parameter indicating the strength of randomness.
T (z|ξ; ) is the transition probability from state ξ to state z, which has the following essential properties. For z, ξ ∈ R n and > 0, The first two are standard properties for an infinitesimal Markov generator, the third one indicates a deterministic (weak-noise) limit as → 0: which represents a nonlinear ODE Note that (i) and (ii) imply that T (z|ξ; ) has a negative signed Dirac-δ atomic measure at z = ξ.
However, for finite , there could be other positive signed atomic measure at z − ξ = 0 in the form in which the amplitude R(ξ) is non-negative and location ν can be positive or negative. We therefore assume the following general form for the Markov generator T (z|ξ; ): 1 in which A, δ ∈ R n are vectors and D, δ ∈ R n × R n , D being a positive definite matrix; ν = −ν − . As a concrete example, it is noted that the term in (6a) is the generator for chemical master equations with scaled jump size and time, leading to the ν and −1 R [22], while the last two terms are those for the drift and scaled diffusion terms in the Fokker-Planck equation.
It is noted that in the above formula the mechanical and chemical contributions to the dynamics (respectively given by the A, D and the R's) scale with the same small parameter . However, as 1 The theory of Lévy processes gives a more rigorous treatment of a Markov process whose probability of increments changes continuously in time [20,21]. Our assumption here amounts to a class of diffusion with jumps in units of .
the from chemical contribution originates from the infinitely large population limit; while the in the diffusion process represents thermal fluctuations in mechanical movements, they have not to be the same thing. This means in general we need to deal with a double-limit problem when studying its asymptotic behaviors (see footnote 1). Here, for simplicity, we just use the same small parameter for both processes, since in order to have a macroscopic chemomechanics they have to be infinitesimals on the same order.
In the limit of → 0, the generator in (6) gives This provides a unified treatment of weak-noise limit of continuous diffusion processes as well as Kurtz's limit of jump process. The latter is modelled by a Poisson process Y (t; λ) with rate λ to represent the particle number change during each chemical reaction in a stochastic way. As → 0, It in general contains discontinuous jumps. In the limit of → 0, it converges to the Heaviside-step function H x − ξ − B(ξ)dt .

Large deviations principle and Hamiltonian dynamics
Besides the LLN, it is well-known that associated with the probability of Y at time t, there exists in which non-negative ϕ(η, t), called the large deviations rate function, has a global minimum zero when η = y(t).
Now if one uses the result in (9) as the basis for an assumption like the WKB ansatz: and substitutes this expression into (2a), one has the leading order terms 1 : With respect to the Hamilton-Jacobi equation in (11), it becomes possible to introduce a Hamiltonian function 1 Notice the subtlety for the following double limit as → 0 and → 0, which is singular: Actually, the limit does not exist if taking → 0 first. and the corresponding Hamiltonian dynamics Clearly, the above Hamiltonian system accepts the zero-noise dynamics (4) and (7) as a solution when the momentum equals to zero (y = 0). So that it corresponds to the relaxation dynamics towards an attractor. All other solutions to the Hamiltonian system with y = 0 corresponds to rare events which are impossible in the deterministic dynamics and are only populated in fluctuations.
Meanwhile, according to classical mechanics, we can also construct a variational principle by considering the Lagrangian function in which y as a function of z andż is obtained from solving the implicit equation (13). Clearly, H(z, y) and L(z,ż) are Legendre transforms of each other. In terms of L(z,ż), the conjugate variable y = ∂L(z,ż)/∂ż. Consequently, the most probable path in consistent with above Hamiltonian dynamics with given z(0) and z(T ) are given through the lease action principle

−ϕ ss as an entropy functional
We now show that the stationary solution to Eq. (11) is an entropy functional for the nonlinear differential equation (4): where ϕ ss (z) satisfies From (18), and using inequality e a − 1 − a ≥ 0 for all a ∈ R, Therefore, the PDE (11) is the equation one seeks to define an entropy, thus a nonequilibrium thermodynamics of the nonlinear system (4).
It is important to identify −dϕ ss /dt not as entropy production rate, rather as the instantaneous rate of entropy change. Then one has [3, 23]  (20) According to (18), the last term representing chemomechanical exchange can also be expressed as By "chemomechanics", we mean the continuous variables describing mechanical movements and the discrete jump processes representing chemical reactions as discrete events. From the standpoint of all the atoms as point masses in the molecules, the distinction between mechanics and chemistry disappears; the latter is an emergent phenomenon of a very complex particle "diffusion" in a potential force field as first elucidated by H. A. Kramers [24].
Let us now consider the specific situation in which both the mechanical and chemical parts are in detailed balance on their own [3,23]: ln in which U (z) is a "mechanical" potential function, and G(z) is the Gibbs function for a chemical part. Substituting these two potential conditions into (4) and (7), we have Eq. (11) becomes

PDEs as deterministic limits
Our previous derivations can be formally extended to nonlinear PDEs, which are most widely used models in nonequilibrium thermodynamics. PDEs originally rose from treating fluid dynamics in terms of Newtonian mechanics; the thermodynamics of continuum thus naturally follows. There is a long tradition in the physics of nonequilibrium thermodynamics in terms of continuum theory [18] at one hand, and in formulating mathematical theory of PDEs in terms of ideas from thermodynamics [25,26] on the other hand. Ultimately, with a statistical foundation of thermodynamics in mind, a system of PDEs can be understood as the hydrodynamic limit of a SPDE or IPS. For example, nonequilibrium thermodynamics emerges in the asymptotic limit via the law of large deviations in the interaction particle system [55]; generalized Gibbsian chemical thermodynamics emerges in the asymptotic limit of Kurtz's theorem [9]; and so does the chemomechanics we outlined in Sec. 2 above.
To begin with, let us consider a spatiotemporal stochastic process Y (x, t), where x ∈ Ω ⊂ R, whose probability distribution for the entire function of x at a give time t, is given by a Chapman-Kolmogorov equation Similarly, the transition probability T z(x) ξ(x) is assumed to take the following general where represent functional (or variational) derivatives of Dirac-δ functions defined as With respect to this generator, in the limit of → 0, we have with functional therefore, This equation for the functional ρ 0 [z(x); t] actually represents a nonlinear partial differential equa- in which F maps a function space to which z(x, t) belongs to R.

Conservation dissipation formalism
We shall now assume a more concrete form for F up to the second-order spatial derivative of . This corresponds to a rather broad class of nonlinear PDEs in which z x denotes ∂z(x, t)/∂x. A PDE in which the F = −∇ · j(z x , z, x) + s(x) is called a transport equation; F without the z xx term is called hyperbolic, and with z xx term is called parabolic. F without the z is called the Hamilton-Jacobi equation (HJE). When F does not contain z xx , the nonlinear first-order PDE can be solved by the method of characteristics [27,28,29]; for an HJE this method gives rise to a Hamiltonian system.
In particular, a group of first-order PDEs in a form of where are of great interest in both nonequilibrium thermodynamics and mathematical physics.
is a set of independent variables used for characterizing the system under study. J i (z) are fluxes along the x i direction, while q(z) = 0 represents nonzero source or sink terms. We notice terms in Q(z) corresponding to z are all zeros, which means variables z s obey local conservation laws. The theoretical significance of local conservation laws is that they point out which kind of variables (an integration of z s in the whole space) do not change with time. In contrast, since the source terms for z d are nonzero, the spacial integration of z d is no more constant. This gives a natural classification of z s and z d variables.
With respect to above equations, a very general mathematical formulation -Conservation Dissipation Formalism [30], for modeling nonequilibrium processes was constructed, two key assumptions of which read • There is a strictly concave smooth function η = η(z), called entropy, such that η zz · J iz (z) is symmetric for each i and for all z = (z s , z d ) under consideration; • There is a positive definite matrix M (z), called dissipation matrix, such that q(z) = M (z) · η z d (z).
The first assumption is the famous entropy condition for hyperbolic conservation laws due to Godunov [31], Friedrichs and Lax [32] and et al., which ensures the system is globally symmetrizable hyperbolic. Then the Poincare lemma implies that there is a function The second condition is a nonlinearization of the celebrated Onsager's reciprocal relation [33,34], which ensures that the states far away from equilibrium tend to equilibrium in the long time.
Now it is easy to see that, for F [z(x, t)] in (33) which meet the two requirements of CDF, −ϕ ss turns to be the desired entropy function. And its corresponding time evolution is given through the following balance equation where K i (z) is the entropy flux, and σ(z) = ∂ϕ ss (z) ∂t M (z) ∂ϕ ss (z) ∂z ≥ 0 is the entropy production rate. This result establishes an interesting connection among stochastic thermodynamics, large deviations rate function and macroscopic nonequilibrium thermodynamics. As the formulation for CDF looks similar to what we did for CIT in the next section, no more details will be presented here. Interesting readers may work it out by themselves.
3 Large deviations principle and classical irreversible thermodynamics 3.1 The logical structure of CIT In contrast to the deterministic limit of stochastic processes discussed in previous sections, which provides a direct linkage between mesoscopic and macroscopic dynamics, there are also other schools, like classical irreversible thermodynamics, trying to derive the governing equations for macroscopic deterministic dynamics directly from a thermodynamic point of view. The mathematics of macroscopic classical irreversible thermodynamics, as presented in [18], has a very elegant and clear logical structure, which we summarize here.
(i) First, one considers the macroscopic system is locally fully specified by several quantities, say u i , v i , w i , i ∈ S, which are called "state variables". For example, in classical hydrodynamics, the fluid density ρ, velocity v and total energy e are most often used ones. This assumption is generally referred to as the "local equilibrium hypothesis" in literature, which allows the application of concepts and methodology in equilibrium thermodynamics directly to nonequilibrium systems.
In CIT, another remarkable feature of state variables is that each of them satisfies a system of conservation law of its own, which means u(t) = {u i (t), i ∈ S} follows where J

(u)
ij ≥ 0 is a one-way flux. (ii) The local equilibrium hypothesis also guarantees the existence of a local strictly convex entropy function s i ≡ S(u i , v i , w i ). Then by differential calculus (or Gibbs relation in thermodynamics) one has in which the net entropy flux due to transport of ξ: Eq. (37) has established a local entropy balance law in the form given by (35). If ξ represents energy, volume, or the concentration of a chemical species, then (∂s i /∂ξ i ) ≡ (∂S/∂ξ) i , i ∈ S, will be 1/T i , p i /T i , and µ i /T i respectively, with T i , p i and µ i being local temperature, pressure, and chemical potential. Then the corresponding thermodynamic forces between states i and j are (iii) Eq. (37b), which splits (37a) into a symmetric and an antisymmetric terms, is actually a discrete version of the integration by parts in differential calculus, which is employed in the third step of CIT based on continuous variables. We recognize j∈S J ij − J ji as a discrete analogue of a divergence term, in which J ij ≥ 0 is a one-way flux. Thus we have The last term is again a divergence term, which is determined by only boundary values when summed over a set of i's. Interestingly, if we identify (s j /ξ j − s i /ξ i ) as a "thermodynamic force" between states i and j, the term (s j /ξ j − s i /ξ i )J ji is not consistent with Onsager's entropy production rate: According to his theory a "thermodynamics flux" is the net flux (J ij − J ji ), not one-way flux [35]. This observation suggests that instead of Eq. (38), we should make J ij and J ji symmetric: This is precisely the Eq. (37b).
(iv) Now the fourth step in CIT is to introduce a thermodynamic force-flux relationship: where M ij is a 3 × 3 positive definite symmetric matrix. With this assumption, the local entropy production rate in (37) is strictly positive except all forces and fluxes are zero. When M ij (u, v, w) is evaluated at an equilibrium (J ij = J ji ), it becomes a constant matrix. In that case, Eq. (40) is called Onsager's near equilibrium linear force-flux relationship, which can be derived from the principle of detailed balance.
The force-flux relation needs not to be linear. Another well-known example is This is Gibbs' chemical affinity-flux relationship. It implies for each and every set of cyclic indices which is known as chemical detailed balance. The three zeros in (42)  ji for all i, j ∈ S and ξ = u, v, w.

CIT for master equations
Let us now follow the same steps (i) to (iv) for a master equation which conserves the probability Introducing a local entropy function s i = −p i ln p i . Then Now introducing an affinity-flux relationship ln( It is easy to show that each element of M is strictly positive if and only if q ij = q ji . When q ij = q ji , the above simple entropy function that is independent of {q ij } can no longer be a valid choice. Rather, a proper entropy function has to be informed by the dynamics in (43).
One of the best known examples is to consider the stationary probability distribution to (43) {π i }: . This is the fundamental idea of free energy. Instead of (44) one then has One therefore has an affinity-flux relationship ln The matrixM is symmetric and semi-positive definite if and only if the detailed balance condition holds π i q ij = π j q ji (see e.g. Ref. [57] for a rigorous proof).

ϕ ss as the statistical foundation of CIT
The entropy function plays a key role during the formulation of CIT, however its origin is a mystery in macroscopic thermodynamics and CIT does not provide an answer to it. Interestingly, the large deviation rate function obtained from the limit process of mesoscopic stochastic dynamics turns out to be the desired entropy function for the macroscopic thermodynamic modeling, and thus it provides a solid statistical foundation for CIT.
To make this point clear, we start with the stationary large deviation function (or the free energy function in this case) and examine its full time derivative in accordance with CIT  It is seen that σ 1 ≥ 0 by Bernoulli's inequality. While to keep σ 2 ≥ 2 in accordance with the second law of thermodynamics, CIT suggests to take derived from CIT are not completely specified unless the entropy production rate is given too (which means M [z] is given). This ambiguity is arised from the fact that a dissipative process is not fully specified by the entropy function, but also by its dissipation rate.

Fokker-Planck equations for the Ornstein-Uhlenbeck process
By taking R(ξ) = 0, A(ξ) = −az, D(ξ) = D in the generator in (6), we arrive at the famous Fokker-Planck equation It corresponds to the Ornstein-Uhlenbeck process (OUP), a particular realization of the general Langevin dynamics, which reads under the meaning of Itô's calculus. In this case, the distribution function could be exactly solved with respect to the initial condition p (z, 0) = δ(z).
It is straightforward to show the large deviations rate function ϕ(z, t) = az 2 /[2D(1 − e −2at )] and its stationary solution ϕ ss (z) = az 2 /(2D). With respect to these formulas, we can repeat previous derivations of CIT. And it is easy to check that the relation dz/dt = −az guarantees a positive entropy production. On the other hand, as suggested by the large deviations principle, we can also introduce a Hamiltonian dynamics with a Hamiltonian function H(z, y) = Dy 2 − azy, which is equivalent to a Lagrangian dynamics given by the Lagrangian function L(z,ż) = (ż + az) 2 /(4D). Noticeably, both dynamics are time-reversible generalizations of dz/dt = −az.

Chemical reactions under complex balance condition
In the next example, we consider a discrete generator with A(ξ) = 0, D(ξ) = 0. In this case, the chemical master equations are obtained, whose deterministic limit gives usual ODEs for m chemical reactions with general rate functions R (z). z = (z 1 , z 2 , · · · , z n ) are the concentrations of the n species, and stoichiometric coefficients ν = (ν 1 , ν 2 , · · · , ν n ).
Thanks to the condition of complex balance, a concept first introduced by Horn and Jackson in 1972 [36], for a class of chemical reactions with laws of mass action, it can be shown that the kinetics equation above has a unique stationary solution z ss [37], and the stationary large deviations rate function [3] ϕ ss (z) = is a solution to m =1 R (z) e ν ∇ϕ ss (z) − 1 + R − (z) e −ν ∇ϕ ss (z) − 1 = 0.
Then according to CIT, a possible dissipative extension of (56) is which, however, requires a preknowledge of the stationary solution z ss and is nearly impossible for real applications. In contrast, the conservative extension does not require such kind of information.
It is noted that when the momentum y = 0, we recover original kinetic equations in (56), which is in fact dissipative and time irreversible in nature.

Slow chemomechanical coupling near equilibrium
Compared to purely diffusive or purely chemical processes, the non-trivial chemomechanical coupling is far more interesting. In this case, we need to solve the stationary Hamilton-Jacobi equation in the full form, which for most situations can only be solved numerically.
We now consider the problem in which both the mechanical and chemical parts are in rapid equilibrium, e.g., detailed balance, on their own: but the chemomechanical conversion is slow and is not yet in equilibrium; thus U (z) = G(z); the ϕ ss (z) then is equal to neither. Substituting these two into (62), we have The terms ∇(ϕ ss − U ) and ∇(ϕ ss − G) are thermomechanical force and thermochemical force respectively. A true equilibrium has both being zero. We see that if ∇(U − ϕ ss ) > 0, then ∇(G − ϕ ss ) < 0. This implies a net mechanical to chemical energy conversion.
Near equilibrium, the last factor on the right-hand side of (63) can be approximated by Taylor expansion. In the special case of For chemical reactions with the mass-action law in equilibrium, an explicit formula for G(z) is known, that is G(z) = n i=1 z i ln(z i /z ss i ) − z i + z ss i (see the second example above). As a consequence, U (z) = n i=1 z i ln(z i /z ss i ) −z i + z ss i and A(z) = −D(z) · ln(z/z ss ). It is worth noting that the term n i=1 z i ln z i , which appears in both G(z) and U (z), has different interpretations in chemistry and in mechanics: The former is caused by chemical affinities, while the latter, according to Flory and Huggins, is an entropic effect reflecting the tendency of particle mixing.

Relations to previous work
There are three lines of researches that are highly relevant, and with respect to which the current work is seeking a synthesis.
(i) The investigations of statistical behavior of a stochastic system, its fluctuations and its entropy productions. The classical theory of Einstein, Landau, Onsager-Machlup, etc. for equilibrium fluctuations with detailed balance, Keizer's for nonequilibrium steady-state fluctuations [12], and recently developed stochastic thermodynamics of finite trajectories [38] are well-known landmarks. See [39] for a recent development.
(ii) The study of large deviations beyond (i) for a sequence of stochastic systems with a LLN; the focuses here are to secure the existence of a rate function, and to derive its particular form.
Mathematical work tends to focus on the former while physics literature on the latter. For the mathematical method, we refer interested readers to the comprehensive reviews written for physicists [5,6,7,8,17]. The traditional Gaussian fluctuation theory is simply the local Hessian structure near the global minimum of the rate function.
Along this direction, the weak-noise limit of Markovian dynamics, e.g.
→ 0 discussed in Sec. 2, has been discussed many times in the past, both rigorously and applied. We shall particularly mention the extensive studies carried out by Graham and Tél [40,41]  (iii) The parallel work for spatiotemporal, infinite-dimensional, stochastic system is technically much more demanding. The demonstration of a deterministic limit and its form, usually a nonlinear PDE, is already a challenging task. There is a large literature on obtaining the hydrodynamic limit.
Its history, since 1980s, dates back to the pioneering works of Liggett [13], Guo et. al. [14], and many others. On discrete IPS, the exact results on Asymmetric Simple Exclusion Process is particularly worth mentioning [45]. See [46] for a more recent study. A very related approach is the reaction diffusion master equation (RDME) in continuous time: See the earlier work of Keizer [12] on the fluctuating Boltzmann equation, Vance and Ross [47] on fluctuating Turing patterns, and the more recent [48] in connection to numerical computations. On continuous space-time SPDE, Graham and Tél also investigated Ginzburg-Landau equation with weak noise [49]; Gonçalves and Jara have studied the nonequilibrium fluctuations of Kardar-Parisi-Zhang equation in terms of an Einstein relation [50]. With the LLN in hand, a systematic treatment of the fluctuations of hydrodynamic equations was carried out in Macroscopic Fluctuation Theory [51,52]. Results on large deviations followed [53,54,55].
In contradistinction to the abovementioned (i)-(iii), our present work is a part of the recent development on setting the large-deviation structure, being a limiting law for a sequence of Markov processes, as the mathematical foundation for nonequilibrium stochastic thermodynamics, beyond the studies of a Markov process. This type of limit laws is to thermodynamic behavior what the central limit theorem is to the Gaussian fluctuation theory. The focus is on the mathematical origin of thermodynamic behavior itself: To our best knowledge, it is the first time to combine all these results together, by using an -dependent Markov generator, in providing a unified mathematical physics in which the LDT serves the statistical foundation of general nonequilibrium thermodynamics, like CIT and CDF. This synthesis is missing from most of the previous studies. One exception is the Macroscopic Fluctuation Theory, developed by Jona-Lasinio and coworkers, in which thermodynamic relationships among force, work, and quasi-potential as energy were discussed; another is a study from us on extended irreversible thermodynamics [56].
Because of the nature of synthesis, in Sec. 2.4 we discuss how to derive PDEs as the deterministic limits from a spatiotemporal stochastic process, in order to incorporate the general theory of CDF which includes both time and space. The work in (iii) above provides the more advanced, in depth materials for this section. We merely give a heuristic coverage before moving toward the main purpose of our current work: Go beyond the law of large numbers, e.g., the proper hydrodynamic limit, and focus on the entropy structure on top of those hydrodynamic equations.

Conclusion
The macroscopic limit of mesoscopic stochastic dynamics, especially the Markovian dynamics with either continuous or discrete state space, is well understood since the pioneering works of Kurtz, Guo et. al., and many others. On the other hand, the fact that the large deviations principle, which emerges concomitantly during the limit process and provides the entropy as a macroscopic potential function of nonequilibrium thermodynamics, was not fully appreciated in the past. In In our study, an amazing observation is that both the dissipative dynamics equipped with a (relative) entropy function and the conservative dynamics equipped with a Hamiltonian function arise automatically from the large deviations principle of mesoscopic stochastic dynamics. This emergent phenomena not only highlights the inseparable nature of the first law and the second law of thermodynamics, which state the essential roles of energy and entropy in a thermodynamical view of dynamics, but also provides a practical way for constructing either conservative or dissipative dynamics of any given deterministic dynamics by considering its stochastic correspondence.