\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{geometry}
\geometry{margin=1in}
\usepackage{parskip}

\title{Thermodynamics --- Math Walk-Through}
\author{}
\date{}

\begin{document}

\maketitle

This is the math walk-through for the Thermodynamics pillar. It stays VMS-first and picks up from the Bridge: count routes, use the right multipliers, minimize the right free-energy. No imported constitutive laws. No new dimensional dials beyond the single action scale $S_0 = \hbar$ (and $k_B$ as an acceptance lock). We move from micro counting $\to$ macro levers $\to$ fluctuation--response $\to$ transport kernels $\to$ phase onset, and we pin each ladder to the Thermodynamics Math Appendix for full detail.

\section*{0) Setup \& Locks}

\begin{itemize}
\item Single dimensional scale: $S_0 = \hbar$ (SI-locked; fixed once and never tuned).

\item Acceptance lock: $k_B$ appears only as the acceptance multiplier for energy; it calibrates the thermometer, not the theory.

\item Counting object: route weights use multipliers; when we need phase we use $S[\text{path}] = \int A_d \, ds$, but this pillar is mostly ratios and counts.

\item Scope discipline: near-equilibrium, weak gradients, locally stationary statistics; far-from-equilibrium and turbulence live in branches.
\end{itemize}

\subsection*{No imports (what we do NOT assume)}

We do not assume ideal-gas, Fourier/Fick/Newton, Navier--Stokes, or mean-field templates. When those forms appear, they are dictionaries of our counting and kernels---not starting axioms.

\subsection*{Classical bridge --- smooth-limit dictionary}

In the short-memory and smooth-profile limit, our kernels reduce to the familiar forms: Fourier $q = -\kappa \nabla T$, Fick $J = -D \nabla c$, and Newton $\tau = \eta \nabla v$. The coefficients ($\kappa$, $D$, $\eta$) are Green--Kubo integrals of fluctuations.

\section*{1) Route counting $\to$ entropy, temperature, and the fundamental relation}

We start with a count $\Omega$ of compatible route-arrangements under macroscopic constraints (energy $E$, volume $V$, particle number $N$). The entropy is the logarithm of that count; the multipliers that weight routes become the thermodynamic variables.

\begin{align}
S &= k_B \cdot \ln \Omega \\
\beta &= \frac{1}{k_B T} \quad \text{(energy multiplier)}
\end{align}

Maximize $S$ subject to fixed $E, V, N$ with multipliers $(\beta, \beta p, -\beta \mu)$. The stationary point gives the familiar fundamental relation.

\begin{equation}
dU = T \, dS - p \, dV + \mu \, dN
\end{equation}

Read this in VMS terms: the multipliers we used to weight routes ($T, p, \mu$) are the levers that tie micro counts to the macro changes. We did not assume them---we got them by extremizing the count. (Thermo Appendix §1.)

\section*{2) Legendre transform ladder and Maxwell relations (full algebra)}

\begin{enumerate}

\item \textbf{Helmholtz:} $F = U - T S$. Differentiate using the product rule:
\begin{align}
dF &= dU - T \, dS - S \, dT = (T \, dS - p \, dV + \mu \, dN) - T \, dS - S \, dT \\
\Rightarrow dF &= -S \, dT - p \, dV + \mu \, dN
\end{align}

\item Read off slopes: $S = -\left(\frac{\partial F}{\partial T}\right)_{V,N}$, $p = -\left(\frac{\partial F}{\partial V}\right)_{T,N}$, $\mu = \left(\frac{\partial F}{\partial N}\right)_{T,V}$.

\item Maxwell from equality of mixed partials of $F(T,V,N)$:
\begin{equation}
\left(\frac{\partial S}{\partial V}\right)_T = -\frac{\partial}{\partial V}\bigg|_T \frac{\partial F}{\partial T}\bigg|_{V,N} = -\frac{\partial}{\partial T}\bigg|_V \frac{\partial F}{\partial V}\bigg|_{T,N} = \left(\frac{\partial p}{\partial T}\right)_V
\end{equation}

Pick the scorecard that matches what you're holding fixed. Legendre transforms swap a fluctuating extensive for its multiplier.

\begin{align}
F(T,V,N) &= U - T S \\
G(T,p,N) &= H - T S = F + pV \\
\Omega(T,V,\mu) &= U - TS - \mu N
\end{align}

Write the differentials and take mixed partials to generate the Maxwell relations (all are Jacobian identities).

\begin{equation}
\left(\frac{\partial S}{\partial V}\right)_T = \left(\frac{\partial p}{\partial T}\right)_V ; \quad \left(\frac{\partial S}{\partial N}\right)_T = -\left(\frac{\partial \mu}{\partial T}\right)_N ; \quad \left(\frac{\partial \mu}{\partial V}\right)_T = -\left(\frac{\partial p}{\partial N}\right)_T \; \ldots
\end{equation}

\end{enumerate}

\subsection*{What this means (plain talk)}

Once you pick the scorecard ($F, G$, or $\Omega$), everything you call an EoS number is a slope or curvature. Maxwell relations are symmetry statements about those slopes---pure bookkeeping from consistent multipliers. (Thermo Appendix §2.)

\section*{3) Euler homogeneity and Gibbs--Duhem}

\begin{enumerate}

\item Assume first-order homogeneity: $U(\lambda S, \lambda V, \lambda N) = \lambda U(S,V,N)$. Differentiate w.r.t.\ $\lambda$ and set $\lambda=1$:
\begin{equation}
U = \left(\frac{\partial U}{\partial S}\right)_{V,N} S + \left(\frac{\partial U}{\partial V}\right)_{S,N} V + \left(\frac{\partial U}{\partial N}\right)_{S,V} N = T S - p V + \mu N
\end{equation}

\item Differentiate Euler and compare with $dU = T \, dS - p \, dV + \mu \, dN$ to eliminate $dU$ and get:
\begin{equation}
S \, dT - V \, dp + N \, d\mu = 0 \quad \text{(Gibbs--Duhem)}
\end{equation}

For simple systems the extensive variables scale together. That homogeneity gives the Euler form and Gibbs--Duhem constraint.

\begin{align}
U &= T S - p V + \mu N \\
S \, dT - V \, dp + N \, d\mu &= 0
\end{align}

The first says energy is the weighted sum of the conserved tallies; the second says the multipliers are not independent once you fix a material. (Thermo Appendix §3.)

\end{enumerate}

\section*{4) From geometry budgets to an EoS (no new scales)}

\begin{enumerate}

\item Start with $f = f_0 + a_T \mathcal{T} + a_S \mathcal{S} + a_C \mathfrak{C} + \cdots$. A small state change shifts $(\mathcal{T}, \mathcal{S}, \mathfrak{C})$:

$\mathcal{T} = \text{torsion}$, $\mathcal{S} = \text{shear}$, $\mathfrak{C} = \text{closure}$; the $a_\bullet$ are dimensionless weights fixed in this pillar.

\begin{equation}
df = a_T \, d\mathcal{T} + a_S \, d\mathcal{S} + a_C \, d\mathfrak{C} + \cdots \quad \text{with} \quad d\mathcal{T} = \left(\frac{\partial \mathcal{T}}{\partial T}\right) dT + \left(\frac{\partial \mathcal{T}}{\partial p}\right) dp + \cdots
\end{equation}

Combine to $dF = \int df \, dV$ and read EoS outputs from slopes of $F$ ($P, \kappa_T, C_V, \ldots$).

\item \textbf{Indices \& chain rule (one-liners):}
\begin{equation}
df = \left(\frac{\partial f}{\partial \mathcal{T}}\right) d\mathcal{T} + \left(\frac{\partial f}{\partial \mathcal{S}}\right) d\mathcal{S} + \left(\frac{\partial f}{\partial \mathfrak{C}}\right) d\mathfrak{C} + \cdots = a_T \, d\mathcal{T} + a_S \, d\mathcal{S} + a_C \, d\mathfrak{C} + \cdots
\end{equation}

\item Each index responds to the control knobs ($T, p, \ldots$):
\begin{align}
d\mathcal{T} &= \left(\frac{\partial \mathcal{T}}{\partial T}\right) dT + \left(\frac{\partial \mathcal{T}}{\partial p}\right) dp + \cdots \\
d\mathcal{S} &= \cdots \\
d\mathfrak{C} &= \cdots
\end{align}

\item Combine to form $dF = \int df \, dV$, then read off EoS quantities from slopes of $F$. Ratios across nearby states cancel calibration constants.

\end{enumerate}

We do not guess an equation of state. We write a free-energy density from our geometry budgets (torsion $\mathcal{T}$, shear $\mathcal{S}$, closure $\mathfrak{C}$) with dimensionless coefficients fixed in this pillar, and then differentiate. That's it.

\begin{equation}
f = f_0 + a_T \cdot \mathcal{T} + a_S \cdot \mathcal{S} + a_C \cdot \mathfrak{C} + \cdots \quad (a_\bullet \text{ dimensionless; no new scales})
\end{equation}

Nudge $T$ or $p \to \mathcal{T}, \mathcal{S}, \mathfrak{C}$ shift a little $\to$ the slopes of $F = \int f \, dV$ convert those geometric nudges into EoS outputs ($P, \kappa_T, C_V, \ldots$). The Appendix carries full worked examples and validity bands. (Thermo Appendix §4.)

\subsection*{Classical bridge --- ideal forms as a dictionary}

Ideal-gas and simple-fluid expressions appear when $\mathcal{T}, \mathcal{S}, \mathfrak{C}$ take their smooth-limit values. We don't import those laws; we land them when the geometry is bland enough.

\section*{5) Fluctuation identities (variance $\leftrightarrow$ susceptibility)}

Canonical energy variance: start with $Z(\beta) = \sum e^{-\beta E_i}$, $\ln Z$ derivatives give averages.

\begin{align}
\langle E \rangle &= -\frac{\partial \ln Z}{\partial \beta} , \quad \text{Var}(E) = \frac{\partial^2 \ln Z}{\partial \beta^2}
\end{align}

Chain rule $\beta = 1/(k_B T) \Rightarrow \partial/\partial\beta = -k_B T^2 \partial/\partial T$, hence:

\begin{equation}
\text{Var}(E) = k_B T^2 C_V , \quad C_V = \left(\frac{\partial \langle E \rangle}{\partial T}\right)_V
\end{equation}

Grand canonical particle variance: $\Xi = \sum e^{-\beta(E_i - \mu N_i)}$:

\begin{align}
\langle N \rangle &= \frac{1}{\beta} \frac{\partial \ln \Xi}{\partial \mu} , \quad \text{Var}(N) = \frac{1}{\beta} \frac{\partial \langle N \rangle}{\partial \mu} = k_B T \left(\frac{\partial N}{\partial \mu}\right)_{T,V}
\end{align}

Cross-covariance $(E,N)$: mixed derivatives of $\ln \Xi$ yield:

\begin{equation}
\text{Cov}(E,N) = k_B T^2 \left(\frac{\partial N}{\partial T}\right)_{\mu,V}
\end{equation}

Route-counting variances give you the static responses---two faces of the same coin. This is why noise levels lock down response strengths.

\begin{align}
\text{Var}(E) &= k_B T^2 \cdot C_V \\
\text{Var}(N) &= k_B T \cdot \left(\frac{\partial N}{\partial \mu}\right)_{T,V} \\
\text{Cov}(E,N) &= k_B T^2 \cdot \left(\frac{\partial N}{\partial T}\right)_{\mu,V}
\end{align}

Pack these into a covariance matrix and you have the full static susceptibility block. These are data-friendly because variances and covariances are measured directly. (Thermo Appendix §5.)

\section*{6) Green--Kubo kernels and Onsager reciprocity (time-domain view)}

\begin{enumerate}

\item Start from entropy production rate $\sigma = \sum_a J_a X_a$. Linear response posits $J = L \cdot X$.

\item Kubo: a small time-dependent tilt $X$ drives a mean current $\langle J_a(t) \rangle$ proportional to an equilibrium correlation:
\begin{equation}
L_{ab} = \int_0^\infty \langle J_a(0) J_b(t) \rangle_{\text{eq}} \, dt
\end{equation}

\item Onsager symmetry: under time reversal, currents change sign; microscopic reversibility of route weights enforces $L_{ab} = L_{ba}$.

\end{enumerate}

Linear response says small drifts are proportional to small tilts. The coefficients are correlation integrals of spontaneous fluctuations.

\begin{align}
L_{ab} &= \int_0^\infty \langle J_a(0) J_b(t) \rangle_{\text{eq}} \, dt \\
J_a &= \sum_b L_{ab} \cdot X_b , \quad L_{ab} = L_{ba}
\end{align}

Here $X_b$ are the right gradients (multipliers' gradients): $X_T = \nabla(1/T)$, $X_N = -\nabla(\mu/T)$, $X_{\text{mom}} \propto \nabla v$. Time-reversal of the route weights gives $L_{ab} = L_{ba}$ (Onsager). (Thermo Appendix §6.)

\subsection*{Classical bridge --- why Fourier/Fick/Newton appear}

Short memory + local stationarity $\to$ the integrals collapse to constants ($\kappa, D, \eta$) and the kernels reduce to $q = -\kappa \nabla T$, $J = -D \nabla c$, $\tau = \eta \nabla v$.

\section*{7) Cross-effects ($2 \times 2$ block and names you know)}

Write the coupled system and identify reciprocity explicitly:

\begin{equation}
\begin{bmatrix} J_q \\ J_N \end{bmatrix}^T = \begin{bmatrix} L_{qq} & L_{qN} \\ L_{Nq} & L_{NN} \end{bmatrix} \begin{bmatrix} \nabla(1/T) \\ -\nabla(\mu/T) \end{bmatrix} , \quad L_{qN} = L_{Nq}
\end{equation}

Names map onto off-diagonal gates: Seebeck/Peltier (heat--charge), Soret/Dufour (heat--mass). We compute $L$'s from correlation integrals.

Couple two conserved tallies and write the force--flux block explicitly. The off-diagonal gates come in Onsager-paired matches.

\begin{equation}
\begin{bmatrix} J_q \\ J_N \end{bmatrix}^T = \begin{bmatrix} L_{qq} & L_{qN} \\ L_{Nq} & L_{NN} \end{bmatrix} \begin{bmatrix} \nabla(1/T) \\ -\nabla(\mu/T) \end{bmatrix}
\end{equation}

Names you know live here as dictionaries: Seebeck/Thomson/Peltier (thermoelectric), Soret/Dufour (heat--mass). We compute the $L$'s via correlation integrals; the names attach in the smooth limit. (Thermo Appendix §7.)

\section*{8) Worked numerics (illustrative, ratio-first)}

\subsection*{A) Diffusion (Einstein)}

$\mu_d = 5.0 \times 10^{-9}$ m$^2\cdot$N$^{-1}\cdot$s$^{-1}$, $T = 298$ K.

\begin{align}
k_B T &= (1.380649 \times 10^{-23})(298) = 4.114 \times 10^{-21} \text{ J} \\
D &= \mu_d k_B T = (5.0 \times 10^{-9})(4.114 \times 10^{-21}) = 2.06 \times 10^{-29} \text{ m}^2/\text{s} \quad \text{(illustrative numbers)}
\end{align}

\subsection*{B) Thermal conductivity (Green--Kubo)}

Suppose the integral gives $0.28$ W$\cdot$m$^{-1}\cdot$K$^{-1}$ for your volume and $T$:

\begin{equation}
\kappa = \frac{1}{k_B T^2 V} \int_0^\infty \langle J_q(0) J_q(t) \rangle \, dt \quad \to \quad \kappa \approx 0.28 \text{ W}\cdot\text{m}^{-1}\cdot\text{K}^{-1}
\end{equation}

\subsection*{C) Viscosity (stress autocorrelation)}

Report $\eta$ from the measured integral and meta-data:

\begin{equation}
\eta = \frac{V}{k_B T} \int_0^\infty \langle P_{xy}(0) P_{xy}(t) \rangle \, dt
\end{equation}

We prefer ratio-first checks; absolutes are shown for scale only. These three micro-examples are fully reproducible with the Appendix code.

\subsection*{A) Diffusion from mobility (Einstein relation)}

Take $\mu_d = 5.0 \times 10^{-9}$ m$^2\cdot$N$^{-1}\cdot$s$^{-1}$ at $T = 298$ K.

\begin{equation}
D = \mu_d k_B T \approx (5.0 \times 10^{-9})(1.380649 \times 10^{-23})(298) \approx 2.06 \times 10^{-29} \text{ m}^2/\text{s}
\end{equation}

Ratio-first: repeat at $T_2$ and publish $D(T_2)/D(T_1)$; most calibration nuisances divide out. (Thermo Appendix §8A.)

\subsection*{B) Thermal conductivity from a heat-current autocorrelation}

Suppose a finite-volume run yields $\int_0^\infty \langle J_q(0)J_q(t) \rangle \, dt / (k_B T^2 V) = 0.28$ W$\cdot$m$^{-1}\cdot$K$^{-1}$ (illustrative).

\begin{equation}
\kappa = \frac{1}{k_B T^2 V} \int_0^\infty \langle J_q(0) J_q(t) \rangle \, dt \quad \to \quad \kappa \approx 0.28 \text{ W}\cdot\text{m}^{-1}\cdot\text{K}^{-1}
\end{equation}

Show $\kappa(T_2)/\kappa(T_1)$ for robustness; absolute $\kappa$ can be posted as secondary. (Thermo Appendix §8B.)

\subsection*{C) Shear viscosity from stress correlations}

For a simple shear, use $P_{xy}$ and integrate its autocorrelation over time:

\begin{equation}
\eta = \frac{V}{k_B T} \int_0^\infty \langle P_{xy}(0) P_{xy}(t) \rangle \, dt
\end{equation}

Insert your measured integral and volume/temperature to report $\eta$; again, ratio-first across nearby states is cleaner. (Thermo Appendix §8C.)

\section*{9) Validity, limits, and failure modes}

Where this kernel picture holds: near-equilibrium, weak gradients, local stationarity, short to moderate memory. Where to be cautious: strong gradients, turbulence, critical opalescence (long memory), and far-from-equilibrium drives. We call those out explicitly in the Appendix so tests don't over-reach.

\section*{10) Pointers into the Thermodynamics Math Appendix (exact sections)}

\begin{itemize}
\item §1 Counting and multipliers $\to$ $S, T$, ensembles
\item §2 Legendre ladder $\to$ Maxwell relations (worked Jacobians)
\item §3 Euler homogeneity $\to$ Gibbs--Duhem
\item §4 Geometry budgets $\to$ $f(\mathcal{T}, \mathcal{S}, \mathfrak{C}) \to$ EoS examples
\item §5 Fluctuation identities $\to$ variance--susceptibility blocks
\item §6 Green--Kubo + Onsager $\to$ transport kernels
\item §7 Cross-effects $2 \times 2 \to$ naming dictionary
\item §8 Worked numerics ($D, \kappa, \eta$) with ratio-first checks
\end{itemize}

\section*{Bottom line}

Same ontology, one scale ($S_0 = \hbar$), and $k_B$ as an acceptance lock. Temperatures and pressures are multipliers, not magic. Transport coefficients are fluctuation integrals, not knobs. Phase onset is sign flips in a clean expansion, not a new law. We publish ratios first, calibrate where needed, and keep falsifiers explicit.

\section*{Appendix --- Cheat Sheet (Thermo, VMS)}

\begin{itemize}
\item \textbf{Validity strip:} near-equilibrium, weak gradients, local stationarity; short-to-moderate memory.

\item \textbf{Smooth-limit dictionary:} $q = -\kappa \nabla T$, $J = -D \nabla c$, $\tau = \eta \nabla v$ ($\kappa, D, \eta$ are Green--Kubo integrals).

\item \textbf{Forces (multipliers' gradients):} $X_T = \nabla(1/T)$, $X_N = -\nabla(\mu/T)$, $X_{\text{mom}} \propto \nabla v$.

\item \textbf{Kernels:} $J_a = \sum_b L_{ab} \cdot X_b$; $L_{ab} = L_{ba}$; $L_{ab} = \int_0^\infty \langle J_a(0) J_b(t) \rangle \, dt$.

\item \textbf{Symbols \& locks:} $S_0 = \hbar$ (single dimensional scale); $k_B$ (acceptance lock); $\mathcal{T}$ (torsion), $\mathcal{S}$ (shear), $\mathfrak{C}$ (closure).
\end{itemize}

\end{document}
