Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Weighted changes in the contracted reciprocal-test walk

Definition
CountingLLL_ContractedCost

by wcysai · Nov 13, 2026 · Mathlib 0df444a (Lean v4.33.1)

algorithmsprobability

For the abstract absorbed walk of the paper, count the upward changes before each time and let the current counter be the initial value jjj plus that count. An active contracted change has weight equal to the reciprocal of the current counter. The module defines the total weighted changes, the total restricted to upward changes, and their expectations. The source quantity MMM is the expected total weighted changes starting from level three and counter two. All quantities refer to the suppressed-return walk; no coupling with the operational machine is asserted.

Definition code
import Definitions.Def_CountingLLL_ContractedWalk
set_option autoImplicit false

/-! Weighted changes in the suppressed-return contracted walk of #442,
Lemma 6.5. The source's quantity M is `expectedWeightedChanges θ 3 2`.
These are properties of the abstract walk; connecting it to the small-step
ReciprocalTest remains separate. -/
namespace CountingLLL.ContractedWalk
open MeasureTheory
open scoped ENNReal BigOperators

/-- Number of upward changes before time t. -/
def upwardBefore (ω : Tape) (start t : ℕ) : ℕ :=
  ∑ k ∈ Finset.range t, if level ω start k ≠ 0 ∧ ω k = true then 1 else 0

/-- Reciprocal counter just before an active change, and zero after absorption. -/
noncomputable def changeWeight (ω : Tape) (start j t : ℕ) : ℝ≥0∞ :=
  if level ω start t = 0 then 0 else ((j + upwardBefore ω start t : ℕ) : ℝ≥0∞)⁻¹

/-- Sum of the reciprocal counter before every contracted change. -/
noncomputable def weightedChanges (ω : Tape) (start j : ℕ) : ℝ≥0∞ :=
  ∑' t, changeWeight ω start j t

/-- Sum of the same weights over upward changes only. -/
noncomputable def weightedIncreases (ω : Tape) (start j : ℕ) : ℝ≥0∞ :=
  ∑' t, changeWeight ω start j t * (if ω t then 1 else 0)

noncomputable def expectedWeightedChanges (θ : ℝ≥0∞) (start j : ℕ) : ℝ≥0∞ :=
  ∫⁻ ω, weightedChanges ω start j ∂tapeLaw θ

noncomputable def expectedWeightedIncreases (θ : ℝ≥0∞) (start j : ℕ) : ℝ≥0∞ :=
  ∫⁻ ω, weightedIncreases ω start j ∂tapeLaw θ
end CountingLLL.ContractedWalk
Source
Liu, Wang, Yin, Zhang and Zhou, A Counting and Sampling Lovász Local Lemma, STOC #442, proof of Lemma 6.5, calls to O, p. 28, https://github.com/sigact-stoc/stoc2027/releases/download/papers-1/442.pdf

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