Product chains mix at time
ProvedMarkovMixing.product_chain_mixingFor let be an irreducible, reversible Markov chain on a finite space of at least two states, with stationary distribution (detailed balance ). The product chain on picks a uniformly random coordinate and updates it by its own chain, ; its stationary distribution is the product . Mixing is measured in continuous time: with the heat kernel and the total variation distance , the continuous mixing time is the first real time at which . Each factor's spectral gap is , with the largest eigenvalue (Mission VII); irreducibility together with at least two states is what makes this the book's .
The theorem (Theorem 20.7 of Levin–Peres–Wilmer) asserts, for , :
- if every and every factor satisfies , then ;
- if moreover exactly for every , then .
The product of independent chains mixes at time , not : a coupon-collector logarithm beyond the obvious slowdown, because the last coordinate to equilibrate is what matters. This is the abstract form of the hypercube's (the hypercube is the product of two-state chains with ), and the template computation behind the cutoff of Mission XI.
import Definitions.Def_mm_continuous import Mathlib.Analysis.SpecialFunctions.Log.Basic
namespace MarkovMixing
/-- **Theorem 20.7** (LPW): mixing of continuous-time product chains. If
each factor has spectral gap at least `γ` and `√π^{(i)}_min ≥ c₀`, then
`t^{cont}_mix(ε) ≤ (2γ)⁻¹ n log n + γ⁻¹ n log(1/(c₀ε))`; if all gaps equal
`γ`, then also
`t^{cont}_mix(ε) ≥ (n/2γ)(log n − log(8 log(1/(1−ε))))`.
Each factor is hypothesized irreducible and to have at least two states, so
that its `spectralGap` is the book's `γᵢ = 1 − λ₂`. `lambdaTwo` is a supremum
over the eigenvalues different from `1`; for a one-state chain, or the identity
chain, that set is empty and `sSup ∅ = 0` reports a spectral gap of `1` for a
chain that does not mix at all — under which the lower bound (20.16) is
false. -/
theorem product_chain_mixing {n : ℕ} (hn : 2 ≤ n) {W : Fin n → Type*}
[∀ i, Fintype (W i)] [∀ i, DecidableEq (W i)] [∀ i, Nonempty (W i)]
(P : ∀ i, Matrix (W i) (W i) ℝ) (hP : ∀ i, IsStochastic (P i))
(hirr : ∀ i, Irreducible (P i)) (hcard : ∀ i, 2 ≤ Fintype.card (W i))
(π : ∀ i, W i → ℝ) (hπ : ∀ i, IsStationary (P i) (π i))
(hrev : ∀ i, DetailedBalance (P i) (π i))
(γ c₀ : ℝ) (hγ : 0 < γ) (hgap : ∀ i, γ ≤ spectralGap (P i))
(hc0 : 0 < c₀) (hmin : ∀ i, c₀ ≤ Real.sqrt (⨅ x, π i x))
(ε : ℝ) (hε : 0 < ε) (hε1 : ε < 1) :
contMixingTime (productChain P) (fun x => ∏ i, π i (x i)) ε ≤
(2 * γ)⁻¹ * n * Real.log n + γ⁻¹ * n * Real.log (1 / (c₀ * ε)) ∧
((∀ i, spectralGap (P i) = γ) →
(n : ℝ) / (2 * γ) *
(Real.log n - Real.log (8 * Real.log (1 / (1 - ε)))) ≤
contMixingTime (productChain P) (fun x => ∏ i, π i (x i)) ε) := by
sorry
end MarkovMixingRead-back
What the Lean code literally says, in plain math · claude-opus-5
Read-back of MarkovMixing.product_chain_mixing
The objects the statement quantifies over
The statement is universally quantified over the following data, all of which must be supplied before any conclusion is asserted.
A natural number (an implicit argument) together with a proof that . A family of types indexed by (implicit; the types may live in any universe), each of which is assumed to be finite, to have decidable equality, and to be nonempty. For each index a square real matrix whose rows and columns are indexed by , i.e. a function . For each index a real-valued function . Three further real numbers , , .
Throughout, write
for the product state space (a finite, nonempty type with decidable equality, since each factor is).
The hypotheses, with every custom notion expanded
-
. In particular , so is nonempty and every "for all " hypothesis below has at least two instances; none of them is vacuous.
-
Each is stochastic (
IsStochastic): for all , , and for every , . -
Each is irreducible (
Irreducible, the definition local to this development, not the ring-theoreticIrreducibleof Mathlib): for all there exists a natural number with . Note that is permitted and is the identity matrix, so every instance with is satisfied automatically by ; the content of the hypothesis is the case . -
Each state space has at least two points: for every .
-
Each is stationary for (
IsStationary), which unfolds to two things: (a) is a probability distribution (IsDist), i.e. for all and ; and (b) is a left fixed vector, for every . -
Each pair satisfies detailed balance (
DetailedBalance): for all ,
Given hypotheses 2 and 5(a), this hypothesis already implies part (b) of hypothesis 5 (sum hypothesis 6 over and use that the rows of sum to ), so the left-fixed-vector half of the stationarity assumption is redundant here; the distribution half is not.
-
.
-
Uniform spectral gap: for every , , where the gap is defined as
and " is a real eigenvalue of " means: there exists a function which is not identically zero with for all (a right eigenvector). Only real eigenvalues are considered; complex eigenvalues of play no role in this definition. The exclusion is of the value , not of one copy of the eigenvalue : if were an eigenvalue of multiplicity greater than one, it would still be excluded entirely.
-
.
-
Uniform lower bound on the stationary masses: for every ,
Since $W_i$ is finite and nonempty, the infimum is an actual minimum over $W_i$.
11. and (strict on both sides).
The two conclusions
Let denote the product chain built from the family (productChain): the matrix on given by
(That is: pick a coordinate uniformly at random and move that coordinate according to , leaving the others fixed. Note that when every index satisfies the side condition, so .)
Let denote the product function on . Nothing in the statement asserts that is stationary for ; it is simply the reference function fed to the mixing-time definition.
The quantity being bounded is the continuous-time mixing time , a real number defined as
where
the inner supremum ranging over all finite subsets of (all subsets, since is finite; is included, so the inner quantity is ), and where is the heat kernel
an infinite series (a tsum) in the real numbers. The outer maximum is over the nonempty finite type .
The theorem asserts the conjunction of the following two claims.
(A) An upper bound, asserted unconditionally under the hypotheses above:
where is the natural logarithm and is coerced from a natural number to a real. (Grouping is as written: and .)
(B) A conditional lower bound: if additionally for every (exact equality, for all coordinates), then
The antecedent of (B) is strictly stronger than hypothesis 8, which it subsumes; under that antecedent hypothesis 8 carries no extra information. If the antecedent fails for the given family, conjunct (B) holds trivially and only (A) has content. Conversely, the antecedent is satisfiable (e.g. take all equal), so (B) is not vacuous as a general claim.
Junk-value and degenerate-branch conventions
The following total-function conventions are in force; for each, I state whether the stated hypotheses make the degenerate branch reachable.
-
Infimum of an empty or unbounded set of reals (
sInf). The mixing time is an infimum over . This set is bounded below by by construction, so the "unbounded below" junk branch is unreachable. However, if is empty — i.e. if no nonnegative time brings down to — the convention gives . No hypothesis in the statement asserts that is nonempty, so as written the branch is not syntactically excluded; whether it is actually reachable depends on the mathematical consequences of hypotheses 2–11. In that branch, claim (A) reduces to " the right-hand side" and claim (B) to "the left-hand side ". -
Supremum of an empty or unbounded set of reals (
sSup), inside . If a matrix had no real eigenvalue other than (or an unbounded such set), would be by convention and would be . Nothing in the statement rules this branch out by fiat; it is excluded only through the mathematical content of hypotheses 2, 3, 6 and 10 (a stochastic matrix that is irreducible in the above sense and reversible with respect to a strictly positive has a full real spectrum in with simple, so the set is nonempty and bounded). The reader should note that if this branch were reached, would take the value rather than being undefined, and hypothesis 8 would then merely say . -
Infimum over an empty index type, in . Unreachable: each carries a
Nonemptyinstance (and ), so the infimum is a genuine minimum over a nonempty finite set. -
Square root of a negative number.
Real.sqrtreturns on nonpositive inputs. Combined with , hypothesis 10 therefore forces ; more precisely it forces
So hypothesis 10 is a genuine strict-positivity assumption on every stationary weight, and the "" branch is unreachable given . It also forces , since sums to over a set of at least points, so .
-
Logarithm of a nonpositive number.
Real.logreturns on nonpositive inputs. Each occurrence has a strictly positive argument under the hypotheses, so this branch is unreachable: has ; has ; has because ; and has a positive argument because gives and hence . Note that the values may still be negative: always here (since ), while is negative for small (precisely when ), which makes the left-hand side of (B) larger. -
Division by zero / inverse of zero.
Realdivision and inversion return at . All divisors here are nonzero: in the definition of has ; , and have ; has ; has ; the in the heat kernel is never a division by zero. So no junk-division branch is reachable. -
Sum of a non-summable family (
tsum). The heat-kernel entries are defined by an infinite series which, if not summable, would be assigned the value . For each fixed real and each finite matrix the series converges absolutely, so this branch is unreachable. At the convention makes the identity matrix. -
Natural-number subtraction, floors, ceilings. None occur. is a real number, not a natural number; no rounding is applied to either bound.
-
Suprema over and over subsets. Both the outer maximum over starting states and the inner supremum over subsets range over nonempty finite index sets ( is nonempty since every is, and the empty subset always exists), so no empty-supremum convention is invoked.
Satisfiability
The hypothesis package is satisfiable, so the theorem is not vacuous: take , a two-element type, , uniform, , , ; all of hypotheses 1–11 hold (and the antecedent of (B) holds as well).
Confirmed by the mission captain (proposal self-audit).