Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

The one-step stay probability Pr⁡[X′∈T]\Pr[X'\in\mathcal T]Pr[X′∈T] of the coordinate-replacement walk

Definition
TwoFoldOPI_Supplement_stayProb

by iris · Nov 16, 2026 · Mathlib 0df444a (Lean v4.33.1)

coding-theoryoptimal-polynomial-intersectionp2o-gran-per-chapterp2o-plan-paperp2o-v1quantum-algorithmsregev-reductionschur-product-codes

Let T⊆[n]m\mathcal T\subseteq[n]^mT⊆[n]m be nonempty, let XXX be uniform on T\mathcal TT, and obtain X′X'X′ by replacing a uniformly chosen coordinate of XXX by an independent uniform symbol of [n][n][n]. Then

Pr⁡[X′∈T]=1∣T∣∑x∈T1m∑i=1m1n∑a∈[n]1[x(i→a)∈T],\Pr[X'\in\mathcal T]=\frac{1}{|\mathcal T|}\sum_{x\in\mathcal T}\frac1m\sum_{i=1}^m\frac1n\sum_{a\in[n]}\mathbf 1[x^{(i\to a)}\in\mathcal T],Pr[X′∈T]=∣T∣1​x∈T∑​m1​i=1∑m​n1​a∈[n]∑​1[x(i→a)∈T],

where x(i→a)x^{(i\to a)}x(i→a) is xxx with coordinate iii set to aaa.

This is the quantity estimated in Theorem 10.11.

Formalization Note Meaningful for T≠∅\mathcal T\ne\emptysetT=∅, m,n≥1m,n\ge1m,n≥1, which hold in every use (large nnn).

Definition code
import Mathlib

namespace TwoFoldOPI

namespace Supplement

open Classical in
/-- **The one-step stay probability of the coordinate-replacement walk on a set `T ⊆ [n]^m`.**
Ragavan, Shutty, *Quantum Algorithms for OPI Variants Beyond Locality and Classical
Decodability*, arXiv:2610.00502 (version held, sha256 ef050ec0…62605), §10.2, Theorem 10.11, p.56: "Let X be uniform on T, and obtain X′ by replacing a uniformly
chosen coordinate of X by an independent uniform symbol in [n]. … Then Pr[X′ ∈ T] = …".

`stayProb T = (1/|T|) Σ_{x ∈ T} (1/m) Σ_{i} (1/n) Σ_{a ∈ [n]} 1[x with coordinate i set to a ∈ T]`
`= Pr[X′ ∈ T]`.

**Formalization Note.** Meaningful for `T ≠ ∅`, `m ≥ 1`, `n ≥ 1`; statements using it are for
large `n`, where these hold. -/
noncomputable def stayProb {m n : ℕ} (T : Finset (Fin m → Fin n)) : ℝ :=
  (T.card : ℝ)⁻¹ * ∑ x ∈ T, ((m : ℝ)⁻¹ * ∑ i : Fin m, ((n : ℝ)⁻¹ * ∑ a : Fin n,
    if Function.update x i a ∈ T then (1 : ℝ) else 0))

end Supplement

end TwoFoldOPI
Source
Ragavan, Shutty, Quantum Algorithms for OPI Variants Beyond Locality and Classical Decodability, arXiv:2610.00502 (version held, sha256 ef050ec0…62605), §10.2, Theorem 10.11, p. 56

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 paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me