Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Corollary 8.10 -- random transpositions mix in (2+o(1)) nlog⁡n(2+o(1))\,n\log n(2+o(1))nlogn

Proved
MarkovMixing.random_transpositions_mixing

by Shuze Chen · Aug 21, 2026 · Mathlib 0df444a (Lean v4.33.1)

markov-chainsmixing-timesprobability

The random transpositions shuffle of a deck of nnn cards picks two cards independently and uniformly at random and swaps them (doing nothing when the same card is picked twice): the identity is applied with probability 1/n1/n1/n and each transposition with probability 2/n22/n^22/n2. Its stationary distribution is uniform over all n!n!n! orderings. The mixing time tmixt_{\mathrm{mix}}tmix​ is the first time ttt at which max⁡x∥Pt(x,⋅)−unif∥TV≤14\max_x\|P^t(x,\cdot)-\mathrm{unif}\|_{TV}\le\tfrac14maxx​∥Pt(x,⋅)−unif∥TV​≤41​, where Pt(x,⋅)P^t(x,\cdot)Pt(x,⋅) is the law of the deck after ttt shuffles from ordering xxx and ∥μ−ν∥TV=max⁡A∣μ(A)−ν(A)∣\|\mu-\nu\|_{TV}=\max_A|\mu(A)-\nu(A)|∥μ−ν∥TV​=maxA​∣μ(A)−ν(A)∣ is the total variation distance.

The theorem (Corollary 8.10 of Levin–Peres–Wilmer, the capstone of Chapter 8) asserts: for every δ>0\delta>0δ>0 there is an NNN such that for all n≥Nn\ge Nn≥N,

tmix  ≤  (2+δ) nlog⁡n.t_{\mathrm{mix}}\;\le\;(2+\delta)\,n\log n.tmix​≤(2+δ)nlogn.

Random transpositions mix in at most (2+o(1)) nlog⁡n(2+o(1))\,n\log n(2+o(1))nlogn steps. The book's proof constructs a strong stationary time by the marking scheme of Broder; the matching lower bound of order 12nlog⁡n\tfrac12 n\log n21​nlogn is the companion theorem of this mission.

Preamble
import Definitions.Def_mm_shuffle
import Mathlib.Analysis.SpecialFunctions.Log.Basic
Formal statement
namespace MarkovMixing

/-- **Corollary 8.10** (LPW), the capstone of Chapter 8: the random
transpositions shuffle on `n` cards mixes in at most `(2 + o(1)) n log n`
steps. -/
theorem random_transpositions_mixing (δ : ℝ) (hδ : 0 < δ) :
    ∃ N : ℕ, ∀ n : ℕ, N ≤ n →
      (tMix (randomTranspositions n) (uniformDist (Equiv.Perm (Fin n))) : ℝ) ≤
        (2 + δ) * n * Real.log n := by
  sorry

end MarkovMixing
Source
D. A. Levin, Y. Peres, E. L. Wilmer, Markov Chains and Mixing Times, AMS 2009, https://documents.epfl.ch/groups/i/ip/ipg/www/2013-2014/Random_Walks/markovmixing.pdf, Section 8.2.2, Corollary 8.10, p. 104

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me