OctoInform Beta

OpenAI preprint, September 2026 · §3. Calculus on finite trees

Lemma 3.1: Additive tilting for measures and finite kernel towers, one-level logarithmic power-mean shifts, and derivatives of path scores and tree vertex potentials

Insertion calculus and differentiation on finite kernel towers.

Hover over a blue or green term in the text, or a node in the graph, to find it in the other. Select it to read its declaration both in Lean and in words.

The setting

In hierarchical trial laws for diluted spin glasses, free-energy comparisons and perturbation identities rely on inserting a multiplicative factor A=efA = e^f into the leaf weights of a finite-depth iterated power-mean recursion with exponents m1,…,mL−1m_1, \dots, m_{L-1}, tilted kernels K1,…,KL−1K_1, \dots, K_{L-1}, and terminal Gibbs kernel KLK_L. Multiplying leaf weights by AA shifts the root logarithm by a backward power-mean recursion, updates each conditional kernel by exponential tilting, and induces an explicit conditional joint density on any finite tree sampled from the kernels. Differentiating the resulting tilted expectations and logarithmic tree densities with respect to a scalar parameter yields the first- and second-order variational identities used in cavity expansions on finite trees.

One-level power means and tilting

Let 𝒳\mathcal{X} be a measurable space equipped with a probability measure μ\mu on 𝒳\mathcal{X}. For a function g:𝒳→ℝg \colon \mathcal{X} \to \mathbb{R}, the exponentially tilted measure μ(g)\mu^{(g)} is the probability measure on 𝒳\mathcal{X} with density proportional to ege^g with respect to μ\mu: dμ(g)dμ(x)=eg(x)∫𝒳eg(z)dμ(z).\frac{d\mu^{(g)}}{d\mu}(x) = \frac{e^{g(x)}}{\int_{\mathcal{X}} e^{g(z)} \, d\mu(z)}.(1) For a real exponent m∈ℝm \in \mathbb{R} and a function f:𝒳→ℝf \colon \mathcal{X} \to \mathbb{R}, the logarithmic power mean Λμ(m,f)\Lambda_\mu(m, f) is defined by Λμ(m,f)=1mlog⁡∫𝒳emf(x)dμ(x).\Lambda_\mu(m, f) = \frac{1}{m} \log \int_{\mathcal{X}} e^{m f(x)} \, d\mu(x).(2)

Finite kernel towers

Let Ω\Omega be a finite set. A finite probability law PP on Ω\Omega is a weight function wP:Ω→ℝw_P \colon \Omega \to \mathbb{R} satisfying wP(x)≥0w_P(x) \ge 0 for all x∈Ωx \in \Omega and ∑x∈ΩwP(x)=1\sum_{x \in \Omega} w_P(x) = 1.✦ The expectation of a function g:Ω→ℝg \colon \Omega \to \mathbb{R} under PP is EP[g]=∑x∈ΩwP(x)g(x),E_P[g] = \sum_{x \in \Omega} w_P(x) g(x),(3)✦ and its variance is Var⁡P(g)=EP[g2]−(EP[g])2\operatorname{Var}_P(g) = E_P[g^2] - (E_P[g])^2. For β∈ℝ\beta \in \mathbb{R}, the exponentially tilted finite law P(βg)P^{(\beta g)} on Ω\Omega assigns to each x∈Ωx \in \Omega the normalized weight wP(x)eβg(x)/∑z∈ΩwP(z)eβg(z)w_P(x) e^{\beta g(x)} / \sum_{z \in \Omega} w_P(z) e^{\beta g(z)}.

For a depth n∈ℕn \in \mathbb{N}, the finite path space Ω(n)\Omega^{(n)} is the singleton {∅}\{\emptyset\} when n=0n = 0 and the product Ω×Ω(n−1)\Omega \times \Omega^{(n-1)} when n≥1n \ge 1.✦

A kernel tower TT of depth nn on Ω\Omega is trivial when n=0n = 0, and for n+1n + 1 consists of a root finite probability law T0T_0 on Ω\Omega together with a family of depth-nn kernel towers (Tx)x∈Ω(T_x)_{x \in \Omega} indexed by the first step.✦ The tower path law PTP_T is the finite probability law on Ω(n)\Omega^{(n)} given by the point mass on ∅\emptyset when n=0n = 0, and for n+1n + 1 by drawing x∈Ωx \in \Omega from T0T_0 and the remaining path y∈Ω(n)y \in \Omega^{(n)} from PTxP_{T_x}.✦

Given a depth-nn kernel tower TT, exponents m=(m1,…,mn)∈ℝnm = (m_1, \dots, m_n) \in \mathbb{R}^n, and a path function f:Ω(n)→ℝf \colon \Omega^{(n)} \to \mathbb{R}, the backward logarithmic power mean Ψn(T,m,f)\Psi_n(T, m, f) is defined recursively from the terminal value Ψ0(T,m,f)=f(∅)\Psi_0(T, m, f) = f(\emptyset) by taking the one-level logarithmic power mean at each step: for depth n+1n + 1, with m′=(m2,…,mn+1)m' = (m_2, \dots, m_{n+1}), Ψn+1(T,m,f)=1m1log⁡∑x∈ΩwT0(x)×exp⁡(m1Ψn(Tx,m′,f(x,⋅))).\begin{aligned} \Psi_{n+1}(T, m, f) &= \frac{1}{m_1} \log \sum_{x \in \Omega} w_{T_0}(x) \\ &\quad \times \exp\bigl(m_1 \Psi_n(T_x, m', f(x, \cdot))\bigr). \end{aligned}(4) The tilted kernel tower T(m,f)T^{(m, f)} of depth nn is trivial when n=0n = 0, and for n+1n + 1 is defined recursively as the pair consisting of the tilted root law T0(m1g)T_0^{(m_1 g)} with g(x)=Ψn(Tx,m′,f(x,⋅))g(x) = \Psi_n(T_x, m', f(x, \cdot)) and the family of tilted subtowers (Tx(m′,f(x,⋅)))x∈Ω\bigl(T_x^{(m', f(x, \cdot))}\bigr)_{x \in \Omega}.✦

The weighted martingale energy ℰn(T,m,f)\mathcal{E}_n(T, m, f) of a path function f:Ω(n)→ℝf \colon \Omega^{(n)} \to \mathbb{R} is defined recursively by ℰ0(T,m,f)=0\mathcal{E}_0(T, m, f) = 0 and, for depth n+1n + 1 with m′=(m2,…,mn+1)m' = (m_2, \dots, m_{n+1}), ℰn+1(T,m,f)=m1Var⁡T0(x↦EPTx[f(x,⋅)])+ET0[x↦ℰn(Tx,m′,f(x,⋅))].\begin{aligned} \mathcal{E}_{n+1}(T, m, f) &= m_1 \operatorname{Var}_{T_0}\bigl(x \mapsto E_{P_{T_x}}[f(x, \cdot)]\bigr) \\ &\quad + E_{T_0}\bigl[x \mapsto \mathcal{E}_n(T_x, m', f(x, \cdot))\bigr]. \end{aligned}(5)✦

Prescribed trees and vertex potentials

A prescribed finite tree SS of depth n∈ℕn \in \mathbb{N} is a single leaf when n=0n = 0, and for n+1n + 1 is an internal root vertex with a positive integer branching number k≥1k \ge 1 and an ordered tuple of kk child prescribed trees (S1,…,Sk)(S_1, \dots, S_k) of depth nn.✦ A sample xx on SS with state space Ω\Omega is the trivial element ∅\emptyset when SS is a leaf, and for an internal node with children (S1,…,Sk)(S_1, \dots, S_k) is a tuple ((ω1,ξ1),…,(ωk,ξk))((\omega_1, \xi_1), \dots, (\omega_k, \xi_k)) where each ωi∈Ω\omega_i \in \Omega labels the ii-th outgoing edge and ξi\xi_i is a sample on SiS_i.✦

The tree vertex potential is the logarithm of the conditional joint density of the updated tree law when leaf weights are multiplied by an exponential insertion factor.

Given a prescribed tree SS of depth nn, a depth-nn kernel tower TT on Ω\Omega, exponents m=(m0,m1,…,mn)∈ℝn+1m = (m_0, m_1, \dots, m_n) \in \mathbb{R}^{n+1}, a path function f:Ω(n)→ℝf \colon \Omega^{(n)} \to \mathbb{R}, and a sample xx on SS, the tree vertex potential VS(T,m,f,x)V_S(T, m, f, x) is defined recursively by VS(T,m,f,∅)=m0f(∅)V_S(T, m, f, \emptyset) = m_0 f(\emptyset) when SS is a leaf and, for an internal node of depth n+1n + 1 with kk children (S1,…,Sk)(S_1, \dots, S_k) and sample x=((ω1,ξ1),…,(ωk,ξk))x = ((\omega_1, \xi_1), \dots, (\omega_k, \xi_k)), VS(T,m,f,x)=(m0−km1)Ψn+1(T,m′,f)+∑i=1kVSi(Tωi,m′,f(ωi,⋅),ξi),\begin{aligned} V_S(T, m, f, x) &= (m_0 - k m_1) \Psi_{n+1}(T, m', f) \\ &\quad + \sum_{i=1}^k V_{S_i}\bigl(T_{\omega_i}, m', f(\omega_i, \cdot), \xi_i\bigr), \end{aligned}(6) where m′=(m1,…,mn+1)m' = (m_1, \dots, m_{n+1}). For a second path function f′:Ω(n)→ℝf' \colon \Omega^{(n)} \to \mathbb{R}, the tree vertex score DS(T,m,f,f′,x)D_S(T, m, f, f', x) is defined recursively by DS(T,m,f,f′,∅)=m0f′(∅)D_S(T, m, f, f', \emptyset) = m_0 f'(\emptyset) when SS is a leaf and, for an internal node of depth n+1n + 1 with children (S1,…,Sk)(S_1, \dots, S_k) and sample x=((ω1,ξ1),…,(ωk,ξk))x = ((\omega_1, \xi_1), \dots, (\omega_k, \xi_k)), DS(T,m,f,f′,x)=(m0−km1)EPT(m′,f)[f′]+∑i=1kDSi(Tωi,m′,f(ωi,⋅),f′(ωi,⋅),ξi).\begin{aligned} D_S(T, m, f, f', x) &= (m_0 - k m_1) E_{P_{T^{(m', f)}}}[f'] \\ &\quad + \sum_{i=1}^k D_{S_i}\bigl(T_{\omega_i}, m', f(\omega_i, \cdot), f'(\omega_i, \cdot), \xi_i\bigr). \end{aligned}(7)✦

The claim

Lemma 3.1. Let Ω\Omega be a finite set, let n∈ℕn \in \mathbb{N}, let TT be a depth-nn kernel tower on Ω\Omega, let m=(m1,…,mn)∈ℝnm = (m_1, \dots, m_n) \in \mathbb{R}^n, and let f,a:Ω(n)→ℝf, a \colon \Omega^{(n)} \to \mathbb{R}. Then sequential tilting of the kernel tower is additive: (T(m,f))(m,a)=T(m,f+a).\bigl(T^{(m, f)}\bigr)^{(m, a)} = T^{(m, f + a)}.(8)✦

Let 𝒳\mathcal{X} be a measurable space equipped with a probability measure μ\mu on 𝒳\mathcal{X}. For any m∈ℝm \in \mathbb{R} with m≠0m \neq 0 and any measurable functions f,a:𝒳→ℝf, a \colon \mathcal{X} \to \mathbb{R} satisfying |f(x)|≤B|f(x)| \le B and |a(x)|≤C|a(x)| \le C for all x∈𝒳x \in \mathcal{X} and some real constants B,CB, C, Λμ(m,f+a)−Λμ(m,f)=Λμ(mf)(m,a).\Lambda_\mu(m, f + a) - \Lambda_\mu(m, f) = \Lambda_{\mu^{(m f)}}(m, a).(9)✦ Under the same measure μ\mu on 𝒳\mathcal{X}, for any m∈ℝm \in \mathbb{R}, any measurable function f:𝒳→ℝf \colon \mathcal{X} \to \mathbb{R} satisfying |f(x)|≤B|f(x)| \le B for all x∈𝒳x \in \mathcal{X} and some B∈ℝB \in \mathbb{R}, and any function a:𝒳→ℝa \colon \mathcal{X} \to \mathbb{R}, (μ(mf))(ma)=μ(m(f+a)).\bigl(\mu^{(m f)}\bigr)^{(m a)} = \mu^{(m(f + a))}.(10)✦

Return to a finite set Ω\Omega, a depth n∈ℕn \in \mathbb{N}, a depth-nn kernel tower TT on Ω\Omega, and exponents m=(m1,…,mn)∈ℝnm = (m_1, \dots, m_n) \in \mathbb{R}^n with mi≠0m_i \neq 0 for every i=1,…,ni = 1, \dots, n. Let f,f′:ℝ×Ω(n)→ℝf, f' \colon \mathbb{R} \times \Omega^{(n)} \to \mathbb{R}, let f″:Ω(n)→ℝf'' \colon \Omega^{(n)} \to \mathbb{R}, and let u∈ℝu \in \mathbb{R} be such that for every path x∈Ω(n)x \in \Omega^{(n)}, the map t↦ft(x)t \mapsto f_t(x) has derivative fu′(x)f'_u(x) at uu and the map t↦ft′(x)t \mapsto f'_t(x) has derivative f″(x)f''(x) at uu. Then the map t↦EPT(m,ft)[ft′]t \mapsto E_{P_{T^{(m, f_t)}}}[f'_t] is differentiable at uu with derivative ddtEPT(m,ft)[ft′]|t=u=EPT(m,fu)[f″]+ℰn(T(m,fu),m,fu′).\begin{aligned} \left.\frac{d}{dt} E_{P_{T^{(m, f_t)}}}[f'_t]\right|_{t=u} &= E_{P_{T^{(m, f_u)}}}[f''] \\ &\quad + \mathcal{E}_n\bigl(T^{(m, f_u)}, m, f'_u\bigr). \end{aligned}(11)✦

Finally, let SS be a prescribed finite tree of depth nn, let TT be a depth-nn kernel tower on Ω\Omega, and let m=(m0,m1,…,mn)∈ℝn+1m = (m_0, m_1, \dots, m_n) \in \mathbb{R}^{n+1} satisfy mj≠0m_j \neq 0 for every j=1,…,nj = 1, \dots, n. Let f:ℝ×Ω(n)→ℝf \colon \mathbb{R} \times \Omega^{(n)} \to \mathbb{R}, let f′:Ω(n)→ℝf' \colon \Omega^{(n)} \to \mathbb{R}, and let u∈ℝu \in \mathbb{R} be such that for every path y∈Ω(n)y \in \Omega^{(n)}, the map t↦ft(y)t \mapsto f_t(y) has derivative f′(y)f'(y) at uu. Then for every sample xx on SS, the map t↦VS(T,m,ft,x)t \mapsto V_S(T, m, f_t, x) is differentiable at uu with derivative ddtVS(T,m,ft,x)|t=u=DS(T,m,fu,f′,x).\left.\frac{d}{dt} V_S(T, m, f_t, x)\right|_{t=u} = D_S(T, m, f_u, f', x).(12)✦

In the paper, the result reads: for a single unified iterated power-mean recursion with exponents m1,…,mL−1m_1, \dots, m_{L-1}, tilted kernels K1,…,KL−1K_1, \dots, K_{L-1}, and terminal Gibbs kernel KLK_L, multiplying spin weights by a positive path function A=efA = e^f shifts the iterated root logarithm by log⁡Y0\log Y_0, updates the kernels by exponential tilting, and yields the conditional joint density of the updated tree law on any prescribed tree. The Lean library splits this unified calculus between general measure-valued hierarchies for the one-level shift and tilting identities and finite-state kernel towers for tower tilting, path-score variation, and vertex-potential differentiation.

What is checked

In the Lean library, Lemma 3.1 is stated over two settings: a measurable space 𝒳\mathcal{X} equipped with a probability measure μ\mu for the one-level logarithmic power-mean shift (9) and one-level tilting additivity (10), and a finite state space Ω\Omega equipped with a depth-nn kernel tower TT and a prescribed finite tree SS for tower tilting additivity (8), the path-score derivative (11), and the tree vertex-potential derivative (12). The one-level insertion identity assumes a nonzero real exponent and bounded measurable potentials, whereas one-level tilting additivity assumes only boundedness and measurability of the first potential; on finite kernel towers, tilting additivity requires no nonzero assumption on the exponents, while the two differentiation identities assume nonzero level exponents and pointwise differentiability of the path potentials.