Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Direct parallel repetition of a game and of a synchronous game

Definition
MIPRE_Background_Repetition_Direct

by thomasvidick · Oct 16, 2026 · Mathlib 0df444a (Lean v4.33.1)

mip-remipre-formalizationnonlocal-gamesparallel-repetitionsynchronous-games

Let G=(X,Y,A,B,μ,D)G = (\mathcal X, \mathcal Y, \mathcal A, \mathcal B, \mu, D)G=(X,Y,A,B,μ,D) be a two-player game with finite question alphabets X,Y\mathcal X, \mathcal YX,Y, finite answer alphabets A,B\mathcal A, \mathcal BA,B, question distribution μ\muμ and decision predicate DDD, and let n≥0n \geq 0n≥0. This bundle holds the two definitions of the module MIPRE.Background.Repetition.Direct, both forms of blueprint def:direct-repetition.

MIPRE.Game.repeat G n : Game (Fin n → X) (Fin n → Y) (Fin n → A) (Fin n → B) is the nnn-fold direct repetition G⊗nG^{\otimes n}G⊗n: questions and answers are nnn-tuples, and

μn(xˉ,yˉ)=∏i<nμ(xi,yi),Dn(xˉ,yˉ,aˉ,bˉ)=⋀i<nD(xi,yi,ai,bi),\mu^{n}(\bar x, \bar y) = \prod_{i < n} \mu(x_i, y_i), \qquad D^{n}(\bar x, \bar y, \bar a, \bar b) = \bigwedge_{i < n} D(x_i, y_i, a_i, b_i),μn(xˉ,yˉ​)=i<n∏​μ(xi​,yi​),Dn(xˉ,yˉ​,aˉ,bˉ)=i<n⋀​D(xi​,yi​,ai​,bi​),

with the proof fields μ_nonneg and μ_sum_one that μn\mu^nμn is a probability distribution. MIPRE.SynchronousGame.repeat G n : SynchronousGame (Fin n → X) (Fin n → A), for G : SynchronousGame X A with [DecidableEq A], has the same distribution and predicate and in addition the field synchronous: unequal answer tuples to equal question tuples differ in some coordinate, which G rejects. The bundle embeds no lemmas; the module's one theorem, SynchronousGame.repeat_toGame (the underlying game of the repeated synchronous game is the repetition of the underlying game, by rfl), is not part of it.

The construction is the one the vendored parallel repetition developments under MIPRE/Background/Repetition/ use, so their theorems apply to G.repeat n without bookkeeping: MIPRE.Repetition.quantumValue_repeat_le (blueprint thm:direct-repetition-q) bounds quantumValue (G.repeat n), and the game of the repeated verifier of thm:parallel-repetition is a Game.repeat up to relabeling (MIPRE.valStar_repVerifier).

Formalization Note A Game X Y A B has fields μ : X → Y → ℝ, μ_nonneg, μ_sum_one : ∑ x, ∑ y, μ x y = 1 and D : X → Y → A → B → Bool; a SynchronousGame X A has one question and one answer alphabet and the extra field synchronous : ∀ x a b, a ≠ b → D x x a b = false. Tuples are functions out of Fin n, the product is ∏ i : Fin n, and the predicate is decide (∀ i : Fin n, G.D (xs i) (ys i) (as i) (bs i) = true), a Bool. No positivity of n is assumed: at n = 0 the repeated game has a single question pair, of probability one, and accepts the single answer pair. The bundle imports one definition bundle, that of MIPRE.Foundations.Games.

Definition code
/-
Copyright (c) 2026 Thomas Vidick. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Thomas Vidick
-/
/- Generated for Prove2Me from vidick/MIPRE-formalization@70cbf1c, MIPRE/Background/Repetition/Direct.lean (definition bundle: declarations the uploaded statements rest on);
   produced mechanically by prove2me/tools/gen.py, never edited by hand. -/
import Mathlib.Algebra.BigOperators.Group.Finset.Basic
import Mathlib.Algebra.BigOperators.Group.Finset.Defs
import Mathlib.Algebra.BigOperators.Ring.Finset
import Mathlib.Algebra.Group.Defs
import Mathlib.Algebra.GroupWithZero.Defs
import Mathlib.Algebra.Order.BigOperators.GroupWithZero.Finset
import Mathlib.Algebra.Order.Ring.Defs
import Mathlib.Algebra.Ring.Defs
import Mathlib.Analysis.CStarAlgebra.CStarMatrix
import Mathlib.Analysis.CStarAlgebra.Classes
import Mathlib.Analysis.Matrix.Order
import Mathlib.Data.ENat.Lattice
import Mathlib.Data.Finset.Defs
import Mathlib.Data.Fintype.Basic
import Mathlib.Data.Fintype.Defs
import Mathlib.Data.Fintype.Pi
import Mathlib.Data.Real.Basic
import Mathlib.Data.SetLike.Basic
import Mathlib.LinearAlgebra.Matrix.Kronecker
import Mathlib.Order.Defs.PartialOrder
import Mathlib.Tactic
import Definitions.Def_MIPRE_Foundations_Games

/-!
# Direct parallel repetition of a game

The `n`-fold direct repetition `G^{⊗n}` of a game (blueprint `def:direct-repetition`):
the referee samples `n` independent question pairs, sends the tuples to the players, and
accepts if and only if every coordinate is accepted. The construction is that of the two
vendored developments (`MIPRE/Background/Repetition/`), so that their theorems transfer
without bookkeeping; the repetition of a synchronous game is synchronous.
-/

namespace MIPRE

open scoped BigOperators

variable {X Y A B : Type*} [Fintype X] [Fintype Y] [Fintype A] [Fintype B]

/-- The `n`-fold direct repetition of a game (blueprint `def:direct-repetition`):
product question distribution on `(Fin n → X) × (Fin n → Y)` and the conjunction of the
coordinate predicates. -/
def Game.repeat (G : Game X Y A B) (n : ℕ) :
    Game (Fin n → X) (Fin n → Y) (Fin n → A) (Fin n → B) where
  μ xs ys := ∏ i : Fin n, G.μ (xs i) (ys i)
  μ_nonneg xs ys := Finset.prod_nonneg fun i _ => G.μ_nonneg (xs i) (ys i)
  μ_sum_one := by
    classical
    calc
      (∑ xs : Fin n → X, ∑ ys : Fin n → Y, ∏ i : Fin n, G.μ (xs i) (ys i)) =
          ∑ xs : Fin n → X, ∏ i : Fin n, ∑ y : Y, G.μ (xs i) y := by
            apply Finset.sum_congr rfl
            intro xs _
            exact (Fintype.prod_sum (fun i : Fin n => fun y : Y => G.μ (xs i) y)).symm
      _ = ∏ _i : Fin n, ∑ x : X, ∑ y : Y, G.μ x y := by
            exact (Fintype.prod_sum
              (fun _i : Fin n => fun x : X => ∑ y : Y, G.μ x y)).symm
      _ = 1 := by simp [G.μ_sum_one]
  D xs ys as bs := decide (∀ i : Fin n, G.D (xs i) (ys i) (as i) (bs i) = true)

/-- The `n`-fold direct repetition of a synchronous game is synchronous: unequal answer
tuples to equal question tuples differ in some coordinate, which is then rejected. -/
def SynchronousGame.repeat [DecidableEq A] (G : SynchronousGame X A) (n : ℕ) :
    SynchronousGame (Fin n → X) (Fin n → A) where
  μ xs ys := ∏ i : Fin n, G.μ (xs i) (ys i)
  μ_nonneg xs ys := Finset.prod_nonneg fun i _ => G.μ_nonneg (xs i) (ys i)
  μ_sum_one := by
    classical
    calc
      (∑ xs : Fin n → X, ∑ ys : Fin n → X, ∏ i : Fin n, G.μ (xs i) (ys i)) =
          ∑ xs : Fin n → X, ∏ i : Fin n, ∑ y : X, G.μ (xs i) y := by
            apply Finset.sum_congr rfl
            intro xs _
            exact (Fintype.prod_sum (fun i : Fin n => fun y : X => G.μ (xs i) y)).symm
      _ = ∏ _i : Fin n, ∑ x : X, ∑ y : X, G.μ x y := by
            exact (Fintype.prod_sum
              (fun _i : Fin n => fun x : X => ∑ y : X, G.μ x y)).symm
      _ = 1 := by simp [G.μ_sum_one]
  D xs ys as bs := decide (∀ i : Fin n, G.D (xs i) (ys i) (as i) (bs i) = true)
  synchronous := by
    intro xs as bs hne
    rw [decide_eq_false_iff_not]
    intro h
    apply hne
    funext i
    by_contra hi
    have hfalse := G.synchronous (xs i) (as i) (bs i) hi
    rw [h i] at hfalse
    exact absurd hfalse (by simp)

end MIPRE
Source
https://github.com/vidick/MIPRE-formalization/blob/70cbf1c52e3d5e1dff1162fdf952c9a9f4bd99ed/MIPRE/Background/Repetition/Direct.lean; blueprint def:direct-repetition

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