math / data /lean /OAI /Computability /UniqueGames /Games /CompletedSamplingLemmas.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
36.2 kB
import OAI.Computability.UniqueGames.Games.FactorizationLemmas
import OAI.Computability.UniqueGames.Games.FinishBoundsLemmas
import OAI.Computability.UniqueGames.Games.PartialRevealLemmas
import OAI.Computability.UniqueGames.Games.SelectedCommonMarginalLemmas
import OAI.Computability.UniqueGames.Games.SelectionSequence
namespace OAI
section
/-!
# Finite local completion after correlated sampling
One independent seed contains the original shared seed and two full response
tables. Its local reads give exactly the mixture of the requested completion
kernels. Applying those kernels contracts total variation. On a diagonal
target the same construction uses one common selected label.
-/
namespace UniqueGamesTheorem.Foundations.Repetition.CompletedSampling
open scoped BigOperators
open Games
noncomputable section
section DistributionIdentities
variable {A B C D : Type*} [Fintype A] [Fintype B] [Fintype C] [Fintype D]
theorem mixture_pushforward_base (ΞΌ : FiniteDistribution A) (f : A β†’ B)
(K : B β†’ FiniteDistribution C) :
(ΞΌ.pushforward f).mixture K = ΞΌ.mixture (fun a => K (f a)) := by
apply FiniteDistribution.eq_of_weight_eq
intro c
exact FiniteDistribution.expectation_pushforward ΞΌ f (fun b => (K b).weight c)
theorem product_pushforward_eq_mixture_right (ΞΌ : FiniteDistribution A)
(Ξ½ : FiniteDistribution B) (f : A Γ— B β†’ C) :
(ΞΌ.product Ξ½).pushforward f =
Ξ½.mixture (fun b => ΞΌ.pushforward (fun a => f (a, b))) := by
classical
apply FiniteDistribution.eq_of_weight_eq
intro c
simp only [FiniteDistribution.pushforward, FiniteDistribution.product,
FiniteDistribution.mixture, Fintype.sum_prod_type]
rw [Finset.sum_comm]
apply Finset.sum_congr rfl
intro b _
rw [Finset.mul_sum]
apply Finset.sum_congr rfl
intro a _
by_cases h : f (a, b) = c <;> simp [h, mul_comm]
theorem product_product_pushforward_eq_mixture (ΞΌ : FiniteDistribution A)
(Ξ½ : FiniteDistribution B) (ΞΊ : FiniteDistribution C) (f : A β†’ B β†’ C β†’ D) :
(ΞΌ.product (Ξ½.product ΞΊ)).pushforward (fun z => f z.1 z.2.1 z.2.2) =
(ΞΌ.product Ξ½).mixture
(fun z => ΞΊ.pushforward (fun c => f z.1 z.2 c)) := by
classical
apply FiniteDistribution.eq_of_weight_eq
intro d
simp only [FiniteDistribution.pushforward, FiniteDistribution.product,
FiniteDistribution.mixture, Fintype.sum_prod_type]
simp only [Finset.mul_sum, mul_ite, mul_zero, mul_assoc]
theorem mixture_totalVariation_le (ΞΌ Ξ½ : FiniteDistribution A)
(K : A β†’ FiniteDistribution B) :
(ΞΌ.mixture K).totalVariation (Ξ½.mixture K) ≀ ΞΌ.totalVariation Ξ½ := by
simpa only [FiniteDistribution.totalVariation, FiniteDistribution.mixture,
Information.totalVariation, kernelPushforward] using
totalVariation_kernelPushforward_le ΞΌ.weight Ξ½.weight
(fun a => (K a).weight) (fun a => Information.gameLaw_isProbability (K a))
end DistributionIdentities
section Diagonal
variable {Z S : Type*} [Fintype Z] [Fintype S]
def diagonalLaw (Οƒ : FiniteDistribution (Z Γ— S)) : FiniteDistribution (Z Γ— S Γ— S) :=
Information.toGameLaw (diagonalWeights Οƒ.weight)
(diagonalWeights_isProbability _ (Information.gameLaw_isProbability Οƒ))
theorem diagonalLaw_eq_pushforward (Οƒ : FiniteDistribution (Z Γ— S)) :
diagonalLaw Οƒ = Οƒ.pushforward (fun z => (z.1, z.2, z.2)) := by
classical
apply FiniteDistribution.eq_of_weight_eq
rintro ⟨z, a, b⟩
change diagonalWeights Οƒ.weight (z, a, b) =
(Οƒ.pushforward (fun t => (t.1, t.2, t.2))).weight (z, a, b)
simp only [diagonalWeights, FiniteDistribution.pushforward,
Fintype.sum_prod_type, Prod.mk.injEq]
by_cases hab : a = b
Β· subst b
simp [ite_and]
Β· simp [hab, ite_and]
theorem diagonalLaw_mixture {T : Type*} [Fintype T]
(Οƒ : FiniteDistribution (Z Γ— S)) (K : Z Γ— S Γ— S β†’ FiniteDistribution T) :
(diagonalLaw Οƒ).mixture K = Οƒ.mixture (fun z => K (z.1, z.2, z.2)) := by
rw [diagonalLaw_eq_pushforward, mixture_pushforward_base]
end Diagonal
section Completion
variable {X Y S Ξ“ U V : Type*}
[Fintype X] [Fintype Y] [Fintype S] [Fintype Ξ“] [Fintype U] [Fintype V]
[DecidableEq X] [DecidableEq Y] [DecidableEq S]
/-- The independent original seed and two full local completion tables. -/
abbrev Seed (Ξ“ X Y S U V : Type*) :=
Ξ“ Γ— KernelSampling.Seed (X Γ— S) (Y Γ— S) U V
def seedLaw (Ξ³ : FiniteDistribution Ξ“)
(L : X Γ— S β†’ FiniteDistribution U) (R : Y Γ— S β†’ FiniteDistribution V) :
FiniteDistribution (Seed Ξ“ X Y S U V) :=
Ξ³.product (KernelSampling.seedLaw L R)
def left (sL : Ξ“ β†’ X β†’ S) (seed : Seed Ξ“ X Y S U V) (x : X) : U :=
KernelSampling.readLeft seed.2 (x, sL seed.1 x)
def right (sR : Ξ“ β†’ Y β†’ S) (seed : Seed Ξ“ X Y S U V) (y : Y) : V :=
KernelSampling.readRight seed.2 (y, sR seed.1 y)
def completionKernel (L : X Γ— S β†’ FiniteDistribution U)
(R : Y Γ— S β†’ FiniteDistribution V) (z : (X Γ— Y) Γ— S Γ— S) :
FiniteDistribution (U Γ— V) :=
(L (z.1.1, z.2.1)).product (R (z.1.2, z.2.2))
/-- This is the shared-seed mixture used by `Game.localEmbeddingLaw`. -/
def outputLaw (ΞΌ : FiniteDistribution (X Γ— Y)) (Ξ³ : FiniteDistribution Ξ“)
(sL : Ξ“ β†’ X β†’ S) (sR : Ξ“ β†’ Y β†’ S)
(L : X Γ— S β†’ FiniteDistribution U) (R : Y Γ— S β†’ FiniteDistribution V) :
FiniteDistribution (U Γ— V) :=
(seedLaw Ξ³ L R).mixture (fun seed =>
ΞΌ.pushforward (fun q => (left sL seed q.1, right sR seed q.2)))
theorem outputLaw_eq_product_pushforward
(ΞΌ : FiniteDistribution (X Γ— Y)) (Ξ³ : FiniteDistribution Ξ“)
(sL : Ξ“ β†’ X β†’ S) (sR : Ξ“ β†’ Y β†’ S)
(L : X Γ— S β†’ FiniteDistribution U) (R : Y Γ— S β†’ FiniteDistribution V) :
outputLaw ΞΌ Ξ³ sL sR L R =
(ΞΌ.product (seedLaw Ξ³ L R)).pushforward
(fun z => (left sL z.2 z.1.1, right sR z.2 z.1.2)) := by
exact (product_pushforward_eq_mixture_right ΞΌ (seedLaw Ξ³ L R)
(fun z : (X Γ— Y) Γ— Seed Ξ“ X Y S U V =>
(left sL z.2 z.1.1, right sR z.2 z.1.2))).symm
/-- The completion mixture is derived from actual local table reads. -/
theorem outputLaw_eq_mixture
(ΞΌ : FiniteDistribution (X Γ— Y)) (Ξ³ : FiniteDistribution Ξ“)
(sL : Ξ“ β†’ X β†’ S) (sR : Ξ“ β†’ Y β†’ S)
(L : X Γ— S β†’ FiniteDistribution U) (R : Y Γ— S β†’ FiniteDistribution V) :
outputLaw ΞΌ Ξ³ sL sR L R =
(sharedOutputLaw ΞΌ Ξ³ sL sR).mixture (completionKernel L R) := by
calc
outputLaw ΞΌ Ξ³ sL sR L R =
(ΞΌ.product Ξ³).mixture (fun z =>
(KernelSampling.seedLaw L R).pushforward (fun table =>
(KernelSampling.readLeft table (z.1.1, sL z.2 z.1.1),
KernelSampling.readRight table (z.1.2, sR z.2 z.1.2)))) := by
rw [outputLaw_eq_product_pushforward]
exact product_product_pushforward_eq_mixture ΞΌ Ξ³ (KernelSampling.seedLaw L R)
(fun q seed table =>
(KernelSampling.readLeft table (q.1, sL seed q.1),
KernelSampling.readRight table (q.2, sR seed q.2)))
_ = (ΞΌ.product Ξ³).mixture (fun z =>
completionKernel L R (z.1, sL z.2 z.1.1, sR z.2 z.1.2)) := by
apply congrArg ((ΞΌ.product Ξ³).mixture)
funext z
exact KernelSampling.read_joint_pushforward L R
(z.1.1, sL z.2 z.1.1) (z.1.2, sR z.2 z.1.2)
_ = (sharedOutputLaw ΞΌ Ξ³ sL sR).mixture (completionKernel L R) := by
exact (mixture_pushforward_base (ΞΌ.product Ξ³)
(fun z => (z.1, sL z.2 z.1.1, sR z.2 z.1.2)) (completionKernel L R)).symm
omit [DecidableEq X] [DecidableEq Y] [DecidableEq S] in
/-- The diagonal target uses the same selected label for both completion rows. -/
theorem diagonalLaw_completion_mixture
(Οƒ : FiniteDistribution ((X Γ— Y) Γ— S))
(L : X Γ— S β†’ FiniteDistribution U) (R : Y Γ— S β†’ FiniteDistribution V) :
(diagonalLaw Οƒ).mixture (completionKernel L R) =
Οƒ.mixture (fun z => (L (z.1.1, z.2)).product (R (z.1.2, z.2))) := by
exact diagonalLaw_mixture Οƒ (completionKernel L R)
/-- Completing local outputs incurs no additional total-variation loss. -/
theorem outputLaw_totalVariation_le
(ΞΌ : FiniteDistribution (X Γ— Y)) (Ξ³ : FiniteDistribution Ξ“)
(sL : Ξ“ β†’ X β†’ S) (sR : Ξ“ β†’ Y β†’ S)
(L : X Γ— S β†’ FiniteDistribution U) (R : Y Γ— S β†’ FiniteDistribution V)
(Οƒ : FiniteDistribution ((X Γ— Y) Γ— S)) :
(outputLaw ΞΌ Ξ³ sL sR L R).totalVariation
(Οƒ.mixture (fun z => (L (z.1.1, z.2)).product (R (z.1.2, z.2)))) ≀
(sharedOutputLaw ΞΌ Ξ³ sL sR).totalVariation (diagonalLaw Οƒ) := by
rw [outputLaw_eq_mixture, ← diagonalLaw_completion_mixture Οƒ L R]
exact mixture_totalVariation_le _ _ (completionKernel L R)
end Completion
section CoordinateCompletion
variable {I X Y S Ξ“ : Type*}
[Fintype I] [Fintype X] [Fintype Y] [Fintype S] [Fintype Ξ“]
[DecidableEq I] [DecidableEq X] [DecidableEq Y] [DecidableEq S]
/-- Restore the left input coordinate even on completion tables of weight zero. -/
def coordinateLeft (j : I) (sL : Ξ“ β†’ X β†’ S)
(seed : Seed Ξ“ X Y S (I β†’ X) (I β†’ Y)) (x : X) : I β†’ X :=
KernelSampling.completedLeft j seed.2 (x, sL seed.1 x)
/-- Restore the right input coordinate even on completion tables of weight zero. -/
def coordinateRight (j : I) (sR : Ξ“ β†’ Y β†’ S)
(seed : Seed Ξ“ X Y S (I β†’ X) (I β†’ Y)) (y : Y) : I β†’ Y :=
KernelSampling.completedRight j seed.2 (y, sR seed.1 y)
omit [Fintype I] [Fintype X] [Fintype Y] [Fintype S] [Fintype Ξ“]
[DecidableEq X] [DecidableEq Y] [DecidableEq S] in
@[simp] theorem coordinateLeft_preserves (j : I) (sL : Ξ“ β†’ X β†’ S)
(seed : Seed Ξ“ X Y S (I β†’ X) (I β†’ Y)) (x : X) :
coordinateLeft j sL seed x j = x := by
simp [coordinateLeft]
omit [Fintype I] [Fintype X] [Fintype Y] [Fintype S] [Fintype Ξ“]
[DecidableEq X] [DecidableEq Y] [DecidableEq S] in
@[simp] theorem coordinateRight_preserves (j : I) (sR : Ξ“ β†’ Y β†’ S)
(seed : Seed Ξ“ X Y S (I β†’ X) (I β†’ Y)) (y : Y) :
coordinateRight j sR seed y j = y := by
simp [coordinateRight]
def coordinateOutputLaw (ΞΌ : FiniteDistribution (X Γ— Y)) (Ξ³ : FiniteDistribution Ξ“)
(j : I) (sL : Ξ“ β†’ X β†’ S) (sR : Ξ“ β†’ Y β†’ S)
(L : X Γ— S β†’ FiniteDistribution (I β†’ X))
(R : Y Γ— S β†’ FiniteDistribution (I β†’ Y)) :
FiniteDistribution ((I β†’ X) Γ— (I β†’ Y)) :=
(seedLaw Ξ³ L R).mixture (fun seed => ΞΌ.pushforward
(fun q => (coordinateLeft j sL seed q.1, coordinateRight j sR seed q.2)))
/-- Supported coordinate repair preserves the exact completion mixture. -/
theorem coordinateOutputLaw_eq_mixture
(ΞΌ : FiniteDistribution (X Γ— Y)) (Ξ³ : FiniteDistribution Ξ“)
(j : I) (sL : Ξ“ β†’ X β†’ S) (sR : Ξ“ β†’ Y β†’ S)
(L : X Γ— S β†’ FiniteDistribution (I β†’ X))
(R : Y Γ— S β†’ FiniteDistribution (I β†’ Y))
(hL : βˆ€ q xs, (L q).weight xs β‰  0 β†’ xs j = q.1)
(hR : βˆ€ q ys, (R q).weight ys β‰  0 β†’ ys j = q.1) :
coordinateOutputLaw ΞΌ Ξ³ j sL sR L R =
(sharedOutputLaw ΞΌ Ξ³ sL sR).mixture (completionKernel L R) := by
calc
coordinateOutputLaw ΞΌ Ξ³ j sL sR L R =
(ΞΌ.product (seedLaw Ξ³ L R)).pushforward
(fun z => (coordinateLeft j sL z.2 z.1.1,
coordinateRight j sR z.2 z.1.2)) := by
exact (product_pushforward_eq_mixture_right ΞΌ (seedLaw Ξ³ L R)
(fun z : (X Γ— Y) Γ— Seed Ξ“ X Y S (I β†’ X) (I β†’ Y) =>
(coordinateLeft j sL z.2 z.1.1, coordinateRight j sR z.2 z.1.2))).symm
_ = (ΞΌ.product Ξ³).mixture (fun z =>
(KernelSampling.seedLaw L R).pushforward (fun table =>
(KernelSampling.completedLeft j table (z.1.1, sL z.2 z.1.1),
KernelSampling.completedRight j table (z.1.2, sR z.2 z.1.2)))) := by
exact product_product_pushforward_eq_mixture ΞΌ Ξ³ (KernelSampling.seedLaw L R)
(fun q seed table =>
(KernelSampling.completedLeft j table (q.1, sL seed q.1),
KernelSampling.completedRight j table (q.2, sR seed q.2)))
_ = (ΞΌ.product Ξ³).mixture (fun z =>
completionKernel L R (z.1, sL z.2 z.1.1, sR z.2 z.1.2)) := by
apply congrArg ((ΞΌ.product Ξ³).mixture)
funext z
exact KernelSampling.completed_joint_pushforward L R j hL hR
(z.1.1, sL z.2 z.1.1) (z.1.2, sR z.2 z.1.2)
_ = (sharedOutputLaw ΞΌ Ξ³ sL sR).mixture (completionKernel L R) := by
exact (mixture_pushforward_base (ΞΌ.product Ξ³)
(fun z => (z.1, sL z.2 z.1.1, sR z.2 z.1.2)) (completionKernel L R)).symm
theorem coordinateOutputLaw_eq_outputLaw
(ΞΌ : FiniteDistribution (X Γ— Y)) (Ξ³ : FiniteDistribution Ξ“)
(j : I) (sL : Ξ“ β†’ X β†’ S) (sR : Ξ“ β†’ Y β†’ S)
(L : X Γ— S β†’ FiniteDistribution (I β†’ X))
(R : Y Γ— S β†’ FiniteDistribution (I β†’ Y))
(hL : βˆ€ q xs, (L q).weight xs β‰  0 β†’ xs j = q.1)
(hR : βˆ€ q ys, (R q).weight ys β‰  0 β†’ ys j = q.1) :
coordinateOutputLaw ΞΌ Ξ³ j sL sR L R = outputLaw ΞΌ Ξ³ sL sR L R := by
rw [coordinateOutputLaw_eq_mixture ΞΌ Ξ³ j sL sR L R hL hR, outputLaw_eq_mixture]
theorem coordinateOutputLaw_totalVariation_le
(ΞΌ : FiniteDistribution (X Γ— Y)) (Ξ³ : FiniteDistribution Ξ“)
(j : I) (sL : Ξ“ β†’ X β†’ S) (sR : Ξ“ β†’ Y β†’ S)
(L : X Γ— S β†’ FiniteDistribution (I β†’ X))
(R : Y Γ— S β†’ FiniteDistribution (I β†’ Y))
(hL : βˆ€ q xs, (L q).weight xs β‰  0 β†’ xs j = q.1)
(hR : βˆ€ q ys, (R q).weight ys β‰  0 β†’ ys j = q.1)
(Οƒ : FiniteDistribution ((X Γ— Y) Γ— S)) :
(coordinateOutputLaw ΞΌ Ξ³ j sL sR L R).totalVariation
(Οƒ.mixture (fun z => (L (z.1.1, z.2)).product (R (z.1.2, z.2)))) ≀
(sharedOutputLaw ΞΌ Ξ³ sL sR).totalVariation (diagonalLaw Οƒ) := by
rw [coordinateOutputLaw_eq_outputLaw ΞΌ Ξ³ j sL sR L R hL hR]
exact outputLaw_totalVariation_le ΞΌ Ξ³ sL sR L R Οƒ
end CoordinateCompletion
end
end UniqueGamesTheorem.Foundations.Repetition.CompletedSampling
end
section
/-! An explicit finite shared sampler followed by supported local completion
gives the coordinate success bound. No embedding-existence premise remains. -/
namespace UniqueGamesTheorem.Foundations.Repetition
open scoped BigOperators
open Games CorrelatedSampling
noncomputable section
variable {Q₁ Qβ‚‚ A₁ Aβ‚‚ S : Type*}
[Fintype Q₁] [Fintype Qβ‚‚] [Fintype A₁] [Fintype Aβ‚‚] [Fintype S]
[Nonempty A₁] [Nonempty Aβ‚‚] [Nonempty S]
[DecidableEq Q₁] [DecidableEq Qβ‚‚] [DecidableEq S] {n : Nat}
theorem coordinate_probability_le_value_of_local_completion
(G : Game Q₁ Qβ‚‚ A₁ Aβ‚‚) (j : Fin n)
(strategy : Strategy (Fin n β†’ Q₁) (Fin n β†’ Qβ‚‚) (Fin n β†’ A₁) (Fin n β†’ Aβ‚‚))
(Οƒ : FiniteDistribution ((Q₁ Γ— Qβ‚‚) Γ— S))
(profileL : Q₁ β†’ FiniteDistribution S) (profileR : Qβ‚‚ β†’ FiniteDistribution S)
(completionL : Q₁ Γ— S β†’ FiniteDistribution (Fin n β†’ Q₁))
(completionR : Qβ‚‚ Γ— S β†’ FiniteDistribution (Fin n β†’ Qβ‚‚))
(supportL : βˆ€ q xs, (completionL q).weight xs β‰  0 β†’ xs j = q.1)
(supportR : βˆ€ q ys, (completionR q).weight ys β‰  0 β†’ ys j = q.1)
(fallback : S) :
(Οƒ.mixture (fun z => (completionL (z.1.1,z.2)).product
(completionR (z.1.2,z.2)))).probability (G.coordinateWin strategy j) ≀
G.value +
(2 * Information.totalVariation Οƒ.weight
(fun z => G.questions.weight z.1 * (profileL z.1.1).weight z.2) +
2 * Information.totalVariation Οƒ.weight
(fun z => G.questions.weight z.1 * (profileR z.1.2).weight z.2)) := by
let targetLaw := Οƒ.mixture (fun z => (completionL (z.1.1,z.2)).product (completionR (z.1.2,z.2)))
let Ξ΄ := 2 * Information.totalVariation Οƒ.weight
(fun z => G.questions.weight z.1 * (profileL z.1.1).weight z.2) +
2 * Information.totalVariation Οƒ.weight
(fun z => G.questions.weight z.1 * (profileR z.1.2).weight z.2)
change targetLaw.probability (G.coordinateWin strategy j) ≀ G.value + Ξ΄
by_contra h
have gap : 0 < targetLaw.probability (G.coordinateWin strategy j) - (G.value + Ξ΄) :=
sub_pos.mpr (lt_of_not_ge h)
let Ξ· := (targetLaw.probability (G.coordinateWin strategy j) - (G.value + Ξ΄)) / 2
have hΞ· : 0 < Ξ· := by dsimp [Ξ·]; linarith
obtain ⟨N,hN⟩ := samplerOutputLaw_arbitrarily_close Οƒ G.questions profileL profileR fallback Ξ· hΞ·
let thresholds := sharedProfileThresholds profileL profileR
let Ξ³ := traceSeedLaw (rectangleDistribution (Ξ± := S) thresholds) N
let sL := samplerLocal thresholds profileL fallback N
let sR := samplerLocal thresholds profileR fallback N
have hvariation := CompletedSampling.coordinateOutputLaw_totalVariation_le
G.questions Ξ³ j sL sR completionL completionR supportL supportR Οƒ
have hclose : (CompletedSampling.coordinateOutputLaw G.questions Ξ³ j sL sR completionL completionR).totalVariation targetLaw ≀ Ξ΄ + Ξ· :=
hvariation.trans hN
have hsuccess := G.coordinate_probability_le_value_add_embedding_distance j targetLaw
(CompletedSampling.seedLaw Ξ³ completionL completionR)
(CompletedSampling.coordinateLeft j sL) (CompletedSampling.coordinateRight j sR)
(CompletedSampling.coordinateLeft_preserves j sL)
(CompletedSampling.coordinateRight_preserves j sR) strategy
have hsym : targetLaw.totalVariation
(G.localEmbeddingLaw (CompletedSampling.seedLaw Ξ³ completionL completionR)
(CompletedSampling.coordinateLeft j sL) (CompletedSampling.coordinateRight j sR)) =
(CompletedSampling.coordinateOutputLaw G.questions Ξ³ j sL sR completionL completionR).totalVariation targetLaw := by
unfold FiniteDistribution.totalVariation
congr 1
apply Finset.sum_congr rfl
intro q _
exact abs_sub_comm _ _
rw [hsym] at hsuccess
dsimp [Ξ·] at hclose
linarith
end
end UniqueGamesTheorem.Foundations.Repetition
end
section
/-! The two actual conditional common-data profiles used by the shared
sampler, with explicit normalized default laws on all null inputs. -/
namespace UniqueGamesTheorem.Foundations.Repetition
open scoped BigOperators
open Games Information
noncomputable section
theorem finiteDistribution_nonempty {A : Type*} [Fintype A] (ΞΌ : FiniteDistribution A) :
Nonempty A := by
have hsum : (βˆ‘ a, ΞΌ.weight a) β‰  0 := by rw [ΞΌ.normalized]; norm_num
obtain ⟨a, _, _⟩ := Finset.exists_ne_zero_of_sum_ne_zero hsum
exact ⟨a⟩
variable {Q₁ Qβ‚‚ A₁ Aβ‚‚ : Type*}
[Fintype Q₁] [Fintype Qβ‚‚] [Fintype A₁] [Fintype Aβ‚‚]
[DecidableEq Q₁] [DecidableEq Qβ‚‚] {n : Nat}
def selectedProfileFallback (G : Game Q₁ Qβ‚‚ A₁ Aβ‚‚)
(strategy : Strategy (Fin n β†’ Q₁) (Fin n β†’ Qβ‚‚) (Fin n β†’ A₁) (Fin n β†’ Aβ‚‚))
(selected : Finset (Fin n)) (positive : 0 < G.selectedSuccess strategy selected)
(j : {i : Fin n // i βˆ‰ selected}) :
FiniteDistribution (SelectedCommonData (Q₁ := Q₁) (Qβ‚‚ := Qβ‚‚)
(A₁ := A₁) (Aβ‚‚ := Aβ‚‚) selected j) :=
(selectedCommonLaw G strategy selected positive j).pushforward Prod.fst
def selectedLeftProfile (G : Game Q₁ Qβ‚‚ A₁ Aβ‚‚)
(strategy : Strategy (Fin n β†’ Q₁) (Fin n β†’ Qβ‚‚) (Fin n β†’ A₁) (Fin n β†’ Aβ‚‚))
(selected : Finset (Fin n)) (positive : 0 < G.selectedSuccess strategy selected)
(j : {i : Fin n // i βˆ‰ selected}) (x : Q₁) :
FiniteDistribution (SelectedCommonData (Q₁ := Q₁) (Qβ‚‚ := Qβ‚‚)
(A₁ := A₁) (Aβ‚‚ := Aβ‚‚) selected j) :=
toGameLaw
(leftCommonProfile (selectedCommonLaw G strategy selected positive j).weight
(selectedProfileFallback G strategy selected positive j).weight x)
(leftCommonProfile_isProbability _ _
(gameLaw_isProbability (selectedCommonLaw G strategy selected positive j))
(gameLaw_isProbability (selectedProfileFallback G strategy selected positive j)) x)
def selectedRightProfile (G : Game Q₁ Qβ‚‚ A₁ Aβ‚‚)
(strategy : Strategy (Fin n β†’ Q₁) (Fin n β†’ Qβ‚‚) (Fin n β†’ A₁) (Fin n β†’ Aβ‚‚))
(selected : Finset (Fin n)) (positive : 0 < G.selectedSuccess strategy selected)
(j : {i : Fin n // i βˆ‰ selected}) (y : Qβ‚‚) :
FiniteDistribution (SelectedCommonData (Q₁ := Q₁) (Qβ‚‚ := Qβ‚‚)
(A₁ := A₁) (Aβ‚‚ := Aβ‚‚) selected j) :=
toGameLaw
(rightCommonProfile (selectedCommonLaw G strategy selected positive j).weight
(selectedProfileFallback G strategy selected positive j).weight y)
(rightCommonProfile_isProbability _ _
(gameLaw_isProbability (selectedCommonLaw G strategy selected positive j))
(gameLaw_isProbability (selectedProfileFallback G strategy selected positive j)) y)
def selectedLeftProfileError (G : Game Q₁ Qβ‚‚ A₁ Aβ‚‚)
(strategy : Strategy (Fin n β†’ Q₁) (Fin n β†’ Qβ‚‚) (Fin n β†’ A₁) (Fin n β†’ Aβ‚‚))
(selected : Finset (Fin n)) (positive : 0 < G.selectedSuccess strategy selected)
(j : {i : Fin n // i βˆ‰ selected}) : ℝ :=
totalVariation (selectedCommonLaw G strategy selected positive j).weight
(fun z => G.questions.weight z.2 * (selectedLeftProfile G strategy selected positive j z.2.1).weight z.1)
def selectedRightProfileError (G : Game Q₁ Qβ‚‚ A₁ Aβ‚‚)
(strategy : Strategy (Fin n β†’ Q₁) (Fin n β†’ Qβ‚‚) (Fin n β†’ A₁) (Fin n β†’ Aβ‚‚))
(selected : Finset (Fin n)) (positive : 0 < G.selectedSuccess strategy selected)
(j : {i : Fin n // i βˆ‰ selected}) : ℝ :=
totalVariation (selectedCommonLaw G strategy selected positive j).weight
(fun z => G.questions.weight z.2 * (selectedRightProfile G strategy selected positive j z.2.2).weight z.1)
theorem selectedLeftProfileError_le (G : Game Q₁ Qβ‚‚ A₁ Aβ‚‚)
(strategy : Strategy (Fin n β†’ Q₁) (Fin n β†’ Qβ‚‚) (Fin n β†’ A₁) (Fin n β†’ Aβ‚‚))
(selected : Finset (Fin n)) (positive : 0 < G.selectedSuccess strategy selected)
(j : {i : Fin n // i βˆ‰ selected}) :
selectedLeftProfileError G strategy selected positive j ≀
totalVariation (partialRevealMarginal G.questions j (selectedOutsideLikelihood G strategy selected))
(leftRevealModel G.questions
(partialRevealMarginal G.questions j (selectedOutsideLikelihood G strategy selected))) +
totalVariation (secondMarginal (selectedCommonLaw G strategy selected positive j).weight)
G.questions.weight :=
leftCommonProfile_error _ G.questions _
(gameLaw_isProbability (selectedCommonLaw G strategy selected positive j))
(gameLaw_isProbability (selectedProfileFallback G strategy selected positive j))
theorem selectedRightProfileError_le (G : Game Q₁ Qβ‚‚ A₁ Aβ‚‚)
(strategy : Strategy (Fin n β†’ Q₁) (Fin n β†’ Qβ‚‚) (Fin n β†’ A₁) (Fin n β†’ Aβ‚‚))
(selected : Finset (Fin n)) (positive : 0 < G.selectedSuccess strategy selected)
(j : {i : Fin n // i βˆ‰ selected}) :
selectedRightProfileError G strategy selected positive j ≀
totalVariation (partialRevealMarginal G.questions j (selectedOutsideLikelihood G strategy selected))
(rightRevealModel G.questions
(partialRevealMarginal G.questions j (selectedOutsideLikelihood G strategy selected))) +
totalVariation (secondMarginal (selectedCommonLaw G strategy selected positive j).weight)
G.questions.weight :=
rightCommonProfile_error _ G.questions _
(gameLaw_isProbability (selectedCommonLaw G strategy selected positive j))
(gameLaw_isProbability (selectedProfileFallback G strategy selected positive j))
def selectedSamplingTarget (G : Game Q₁ Qβ‚‚ A₁ Aβ‚‚)
(strategy : Strategy (Fin n β†’ Q₁) (Fin n β†’ Qβ‚‚) (Fin n β†’ A₁) (Fin n β†’ Aβ‚‚))
(selected : Finset (Fin n)) (positive : 0 < G.selectedSuccess strategy selected)
(j : {i : Fin n // i βˆ‰ selected}) :
FiniteDistribution ((Q₁ Γ— Qβ‚‚) Γ— SelectedCommonData (Q₁ := Q₁) (Qβ‚‚ := Qβ‚‚)
(A₁ := A₁) (Aβ‚‚ := Aβ‚‚) selected j) :=
(selectedCommonLaw G strategy selected positive j).transport (Equiv.prodComm _ _)
theorem selectedSamplingTarget_left_error (G : Game Q₁ Qβ‚‚ A₁ Aβ‚‚)
(strategy : Strategy (Fin n β†’ Q₁) (Fin n β†’ Qβ‚‚) (Fin n β†’ A₁) (Fin n β†’ Aβ‚‚))
(selected : Finset (Fin n)) (positive : 0 < G.selectedSuccess strategy selected)
(j : {i : Fin n // i βˆ‰ selected}) :
totalVariation (selectedSamplingTarget G strategy selected positive j).weight
(fun z => G.questions.weight z.1 * (selectedLeftProfile G strategy selected positive j z.1.1).weight z.2) =
selectedLeftProfileError G strategy selected positive j := by
exact totalVariation_comp_equiv
(Equiv.prodComm (Q₁ Γ— Qβ‚‚) (SelectedCommonData (Q₁ := Q₁) (Qβ‚‚ := Qβ‚‚)
(A₁ := A₁) (Aβ‚‚ := Aβ‚‚) selected j))
(selectedCommonLaw G strategy selected positive j).weight
(fun z => G.questions.weight z.2 * (selectedLeftProfile G strategy selected positive j z.2.1).weight z.1)
theorem selectedSamplingTarget_right_error (G : Game Q₁ Qβ‚‚ A₁ Aβ‚‚)
(strategy : Strategy (Fin n β†’ Q₁) (Fin n β†’ Qβ‚‚) (Fin n β†’ A₁) (Fin n β†’ Aβ‚‚))
(selected : Finset (Fin n)) (positive : 0 < G.selectedSuccess strategy selected)
(j : {i : Fin n // i βˆ‰ selected}) :
totalVariation (selectedSamplingTarget G strategy selected positive j).weight
(fun z => G.questions.weight z.1 * (selectedRightProfile G strategy selected positive j z.1.2).weight z.2) =
selectedRightProfileError G strategy selected positive j := by
exact totalVariation_comp_equiv
(Equiv.prodComm (Q₁ Γ— Qβ‚‚) (SelectedCommonData (Q₁ := Q₁) (Qβ‚‚ := Qβ‚‚)
(A₁ := A₁) (Aβ‚‚ := Aβ‚‚) selected j))
(selectedCommonLaw G strategy selected positive j).weight
(fun z => G.questions.weight z.2 * (selectedRightProfile G strategy selected positive j z.2.2).weight z.1)
end
end UniqueGamesTheorem.Foundations.Repetition
end
section
namespace UniqueGamesTheorem.Foundations.Repetition
open scoped BigOperators
open Games Information
noncomputable section
variable {Q₁ Qβ‚‚ A₁ Aβ‚‚ : Type*}
[Fintype Q₁] [Fintype Qβ‚‚] [Fintype A₁] [Fintype Aβ‚‚]
[DecidableEq Q₁] [DecidableEq Qβ‚‚] {n : Nat}
omit [DecidableEq Q₁] [DecidableEq Qβ‚‚] in
theorem selectedQuestionRadius_le_informationRadius [Nonempty A₁] [Nonempty Aβ‚‚]
(G : Game Q₁ Qβ‚‚ A₁ Aβ‚‚)
(strategy : Strategy (Fin n β†’ Q₁) (Fin n β†’ Qβ‚‚) (Fin n β†’ A₁) (Fin n β†’ Aβ‚‚))
(selected : Finset (Fin n)) :
Real.sqrt ((Fintype.card {i : Fin n // i βˆ‰ selected} : ℝ) *
Real.log (1 / G.selectedSuccess strategy selected)) ≀
selectedInformationRadius G strategy selected := by
have hcard : (1 : ℝ) ≀ Fintype.card (SelectedLabels (A₁ := A₁) (Aβ‚‚ := Aβ‚‚) selected) := by
exact_mod_cast (Nat.succ_le_of_lt
(Fintype.card_pos : 0 < Fintype.card (SelectedLabels (A₁ := A₁) (Aβ‚‚ := Aβ‚‚) selected)))
have hlog := Real.log_nonneg hcard
have hnonneg : 0 ≀ (Fintype.card {i : Fin n // i βˆ‰ selected} : ℝ) := Nat.cast_nonneg _
unfold selectedInformationRadius
apply Real.sqrt_le_sqrt
nlinarith
theorem selectedQuestionMarginal_error_sum [Nonempty A₁] [Nonempty Aβ‚‚]
(G : Game Q₁ Qβ‚‚ A₁ Aβ‚‚)
(strategy : Strategy (Fin n β†’ Q₁) (Fin n β†’ Qβ‚‚) (Fin n β†’ A₁) (Fin n β†’ Aβ‚‚))
(selected : Finset (Fin n)) (positive : 0 < G.selectedSuccess strategy selected) :
(βˆ‘ j : {i : Fin n // i βˆ‰ selected},
(selectedQuestionMarginal G strategy selected positive j.1).totalVariation G.questions) ≀
selectedInformationRadius G strategy selected :=
(unselectedQuestionMarginal_totalVariation_sum_le_sqrt G strategy selected positive).trans
(selectedQuestionRadius_le_informationRadius G strategy selected)
def selectedEmbeddingError (G : Game Q₁ Qβ‚‚ A₁ Aβ‚‚)
(strategy : Strategy (Fin n β†’ Q₁) (Fin n β†’ Qβ‚‚) (Fin n β†’ A₁) (Fin n β†’ Aβ‚‚))
(selected : Finset (Fin n)) (positive : 0 < G.selectedSuccess strategy selected)
(j : {i : Fin n // i βˆ‰ selected}) : ℝ :=
2 * selectedLeftProfileError G strategy selected positive j +
2 * selectedRightProfileError G strategy selected positive j
theorem selectedEmbeddingError_nonnegative (G : Game Q₁ Qβ‚‚ A₁ Aβ‚‚)
(strategy : Strategy (Fin n β†’ Q₁) (Fin n β†’ Qβ‚‚) (Fin n β†’ A₁) (Fin n β†’ Aβ‚‚))
(selected : Finset (Fin n)) (positive : 0 < G.selectedSuccess strategy selected)
(j : {i : Fin n // i βˆ‰ selected}) :
0 ≀ selectedEmbeddingError G strategy selected positive j := by
exact add_nonneg
(mul_nonneg (by norm_num) (Information.totalVariation_nonneg _ _))
(mul_nonneg (by norm_num) (Information.totalVariation_nonneg _ _))
theorem selectedLeftProfileError_sum [Nonempty A₁] [Nonempty Aβ‚‚]
(G : Game Q₁ Qβ‚‚ A₁ Aβ‚‚)
(strategy : Strategy (Fin n β†’ Q₁) (Fin n β†’ Qβ‚‚) (Fin n β†’ A₁) (Fin n β†’ Aβ‚‚))
(selected : Finset (Fin n)) (positive : 0 < G.selectedSuccess strategy selected) :
(βˆ‘ j : {i : Fin n // i βˆ‰ selected}, selectedLeftProfileError G strategy selected positive j) ≀
3 * selectedInformationRadius G strategy selected := by
have hsum := Finset.sum_le_sum
(fun j (_ : j ∈ (Finset.univ : Finset {i : Fin n // i βˆ‰ selected})) =>
selectedLeftProfileError_le G strategy selected positive j)
simp_rw [selectedCommonLaw_secondMarginal] at hsum
rw [Finset.sum_add_distrib] at hsum
have hleft := selected_leftReveal_error_sum G strategy selected positive
have hquestion := selectedQuestionMarginal_error_sum G strategy selected positive
change (βˆ‘ j : {i : Fin n // i βˆ‰ selected},
Information.totalVariation (selectedQuestionMarginal G strategy selected positive j.1).weight
G.questions.weight) ≀ _ at hquestion
linarith
theorem selectedRightProfileError_sum [Nonempty A₁] [Nonempty Aβ‚‚]
(G : Game Q₁ Qβ‚‚ A₁ Aβ‚‚)
(strategy : Strategy (Fin n β†’ Q₁) (Fin n β†’ Qβ‚‚) (Fin n β†’ A₁) (Fin n β†’ Aβ‚‚))
(selected : Finset (Fin n)) (positive : 0 < G.selectedSuccess strategy selected) :
(βˆ‘ j : {i : Fin n // i βˆ‰ selected}, selectedRightProfileError G strategy selected positive j) ≀
3 * selectedInformationRadius G strategy selected := by
have hsum := Finset.sum_le_sum
(fun j (_ : j ∈ (Finset.univ : Finset {i : Fin n // i βˆ‰ selected})) =>
selectedRightProfileError_le G strategy selected positive j)
simp_rw [selectedCommonLaw_secondMarginal] at hsum
rw [Finset.sum_add_distrib] at hsum
have hright := selected_rightReveal_error_sum G strategy selected positive
have hquestion := selectedQuestionMarginal_error_sum G strategy selected positive
change (βˆ‘ j : {i : Fin n // i βˆ‰ selected},
Information.totalVariation (selectedQuestionMarginal G strategy selected positive j.1).weight
G.questions.weight) ≀ _ at hquestion
linarith
theorem selectedEmbeddingError_sum_le_fifteen [Nonempty A₁] [Nonempty Aβ‚‚]
(G : Game Q₁ Qβ‚‚ A₁ Aβ‚‚)
(strategy : Strategy (Fin n β†’ Q₁) (Fin n β†’ Qβ‚‚) (Fin n β†’ A₁) (Fin n β†’ Aβ‚‚))
(selected : Finset (Fin n)) (positive : 0 < G.selectedSuccess strategy selected) :
(βˆ‘ j : {i : Fin n // i βˆ‰ selected}, selectedEmbeddingError G strategy selected positive j) ≀
15 * selectedInformationRadius G strategy selected := by
have hl := selectedLeftProfileError_sum G strategy selected positive
have hr := selectedRightProfileError_sum G strategy selected positive
have hn : 0 ≀ selectedInformationRadius G strategy selected := Real.sqrt_nonneg _
simp only [selectedEmbeddingError, Finset.sum_add_distrib, ← Finset.mul_sum]
linarith
end
end UniqueGamesTheorem.Foundations.Repetition
end
section
/-! Quantitative parallel repetition for actual finite two-player games.
The coordinate bound is derived from the explicitly conditioned question law,
finite reveal variables, information estimates, shared rejection sampler,
and normalized local completions. The scalar recurrence is then applied to
the actual repeated strategy's success probability. -/
namespace UniqueGamesTheorem.Foundations.Repetition
open scoped BigOperators
open Games
noncomputable section
variable {Q₁ Qβ‚‚ A₁ Aβ‚‚ : Type*}
[Fintype Q₁] [Fintype Qβ‚‚] [Fintype A₁] [Fintype Aβ‚‚]
[Nonempty A₁] [Nonempty Aβ‚‚]
[DecidableEq Q₁] [DecidableEq Qβ‚‚] {n : Nat}
theorem selected_coordinate_probability_le_value_add_error
(G : Game Q₁ Qβ‚‚ A₁ Aβ‚‚)
(strategy : Strategy (Fin n β†’ Q₁) (Fin n β†’ Qβ‚‚) (Fin n β†’ A₁) (Fin n β†’ Aβ‚‚))
(selected : Finset (Fin n)) (positive : 0 < G.selectedSuccess strategy selected)
(j : {i : Fin n // i βˆ‰ selected}) :
((G.repetition n).questions.condition (G.selectedWins strategy selected) positive).probability
(G.coordinateWin strategy j.1) ≀
G.value + selectedEmbeddingError G strategy selected positive j := by
classical
let : Nonempty (SelectedCommonData (Q₁ := Q₁) (Qβ‚‚ := Qβ‚‚)
(A₁ := A₁) (Aβ‚‚ := Aβ‚‚) selected j) :=
finiteDistribution_nonempty (selectedProfileFallback G strategy selected positive j)
have h := coordinate_probability_le_value_of_local_completion G j.1 strategy
(selectedSamplingTarget G strategy selected positive j)
(selectedLeftProfile G strategy selected positive j)
(selectedRightProfile G strategy selected positive j)
(selectedFullLeftCompletion G strategy selected j)
(selectedFullRightCompletion G strategy selected j)
(selectedFullLeftCompletion_support G strategy selected j)
(selectedFullRightCompletion_support G strategy selected j)
(Classical.choice inferInstance)
have htarget : (selectedSamplingTarget G strategy selected positive j).mixture
(fun z => (selectedFullLeftCompletion G strategy selected j (z.1.1,z.2)).product
(selectedFullRightCompletion G strategy selected j (z.1.2,z.2))) =
(G.repetition n).questions.condition (G.selectedWins strategy selected) positive :=
selectedFullCompletionMixture_eq_conditionedQuestions G strategy selected positive j
rw [htarget, selectedSamplingTarget_left_error, selectedSamplingTarget_right_error] at h
exact h
theorem holenstein_conditionalCoordinateBound
(G : Game Q₁ Qβ‚‚ A₁ Aβ‚‚) (n : Nat)
(strategy : Strategy (Fin n β†’ Q₁) (Fin n β†’ Qβ‚‚) (Fin n β†’ A₁) (Fin n β†’ Aβ‚‚))
(ell : ℝ)
(halphabet : logTwo ((Fintype.card A₁ : ℝ) * (Fintype.card Aβ‚‚ : ℝ)) ≀ ell) :
SelectionSequence.ConditionalCoordinateBound G n strategy ell := by
intro selected hcard positive
obtain ⟨j,hj⟩ := exists_coordinate_le_information_budget G strategy selected positive ell
halphabet hcard (selectedEmbeddingError G strategy selected positive)
(selectedEmbeddingError_sum_le_fifteen G strategy selected positive)
exact ⟨j.1,j.property,
(selected_coordinate_probability_le_value_add_error G strategy selected positive j).trans
(add_le_add le_rfl hj)⟩
/-- Holenstein's explicit constant-6000 repetition estimate, for the actual
success probability of every finite deterministic repeated strategy. -/
theorem holenstein_repetition_success
(G : Game Q₁ Qβ‚‚ A₁ Aβ‚‚) (n : Nat)
(strategy : Strategy (Fin n β†’ Q₁) (Fin n β†’ Qβ‚‚) (Fin n β†’ A₁) (Fin n β†’ Aβ‚‚))
{v ell : ℝ} (hvalue : G.value ≀ v) (hv : v < 1) (hell : 1 ≀ ell)
(halphabet : logTwo ((Fintype.card A₁ : ℝ) * (Fintype.card Aβ‚‚ : ℝ)) ≀ ell) :
(G.repetition n).success strategy ≀
(1 - (1 - v)^3 / 6000)^((n : ℝ) / ell) :=
SelectionSequence.repetition_success_le_of_conditionalCoordinateBound G n strategy
hvalue hv hell (holenstein_conditionalCoordinateBound G n strategy ell halphabet)
/-- Quantitative parallel repetition of the actual maximum game value.
There is no repetition, embedding, information-budget, or independence premise. -/
theorem holenstein_repetition_value
(G : Game Q₁ Qβ‚‚ A₁ Aβ‚‚) (n : Nat)
{v ell : ℝ} (hvalue : G.value ≀ v) (hv : v < 1) (hell : 1 ≀ ell)
(halphabet : logTwo ((Fintype.card A₁ : ℝ) * (Fintype.card Aβ‚‚ : ℝ)) ≀ ell) :
(G.repetition n).value ≀
(1 - (1 - v)^3 / 6000)^((n : ℝ) / ell) := by
apply ((G.repetition n).value_le_iff _).2
intro strategy
exact holenstein_repetition_success G n strategy hvalue hv hell halphabet
end
end UniqueGamesTheorem.Foundations.Repetition
end
end OAI