Download lean/OAI/Computability/MaxCut/PCP/CompletedSampling.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
- Browser
- Download file 23.5 kB
-
https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Computability/MaxCut/PCP/CompletedSampling.lean
- Command line
-
hf download hf://datasets/roseking/openAI-math-dataset/lean/OAI/Computability/MaxCut/PCP/CompletedSampling.lean
-
curl -L -o CompletedSampling.lean https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Computability/MaxCut/PCP/CompletedSampling.lean
23.5 kB
| import Mathlib | |
| import OAI.Computability.MaxCut.PCP.Overlap | |
| import OAI.Computability.MaxCut.PCP.DistributionMaps | |
| namespace OAI | |
| /-! | |
| # 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 MaxCutGames.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 | |
| 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 | |
| end MaxCutGames.Foundations.Repetition.CompletedSampling | |
| /-! | |
| Local embedding to single-game strategy transfer for Holenstein's argument. | |
| The embedding law below is explicitly sampled from a finite shared seed and | |
| the base game's actual joint question law. Its distance from the desired | |
| conditioned law is an explicit total-variation expression. Constructing an | |
| embedding with a sufficiently small distance is a separate proof obligation. | |
| -/ | |
| namespace MaxCutGames.Foundations.Games.Game | |
| noncomputable section | |
| variable {Q₁ Q₂ A₁ A₂ R₁ R₂ B₁ B₂ Seed : Type*} | |
| [Fintype Q₁] [Fintype Q₂] [Fintype A₁] [Fintype A₂] | |
| [Fintype R₁] [Fintype R₂] [Fintype B₁] [Fintype B₂] [Fintype Seed] | |
| [Nonempty A₁] [Nonempty A₂] | |
| def localEmbeddingLaw (G : Game Q₁ Q₂ A₁ A₂) | |
| (seedLaw : FiniteDistribution Seed) | |
| (left : Seed → Q₁ → R₁) (right : Seed → Q₂ → R₂) : | |
| FiniteDistribution (R₁ × R₂) := | |
| seedLaw.mixture fun seed => | |
| G.questions.pushforward fun q => (left seed q.1, right seed q.2) | |
| /-- Any finite shared-randomness local embedding yields a valid base-game | |
| strategy after the seed is fixed. Total variation pays exactly for changing | |
| the resulting question distribution to the desired one. -/ | |
| theorem success_le_value_add_embedding_distance | |
| (G : Game Q₁ Q₂ A₁ A₂) (H : Game R₁ R₂ B₁ B₂) | |
| (seedLaw : FiniteDistribution Seed) | |
| (left : Seed → Q₁ → R₁) (right : Seed → Q₂ → R₂) | |
| (answerLeft : Seed → Q₁ → B₁ → A₁) | |
| (answerRight : Seed → Q₂ → B₂ → A₂) | |
| (acceptance : ∀ seed x y a b, | |
| H.accepts (left seed x) (right seed y) a b = true → | |
| G.accepts x y (answerLeft seed x a) (answerRight seed y b) = true) | |
| (strategy : Strategy R₁ R₂ B₁ B₂) : | |
| H.success strategy ≤ G.value + | |
| H.questions.totalVariation (G.localEmbeddingLaw seedLaw left right) := by | |
| have localBound (seed : Seed) : | |
| (G.questions.pushforward (fun q => (left seed q.1, right seed q.2))).probability | |
| (H.wins strategy) ≤ G.value := by | |
| let embedded : Game R₁ R₂ B₁ B₂ := | |
| { questions := G.questions.pushforward fun q => (left seed q.1, right seed q.2) | |
| accepts := H.accepts } | |
| change embedded.success strategy ≤ G.value | |
| exact (G.success_le_of_localSimulation embedded (left seed) (right seed) | |
| (answerLeft seed) (answerRight seed) rfl (acceptance seed) strategy).trans | |
| (G.success_le_value _) | |
| have mixtureBound : | |
| (G.localEmbeddingLaw seedLaw left right).probability (H.wins strategy) ≤ G.value := | |
| seedLaw.probability_mixture_le _ _ _ localBound | |
| exact (H.questions.probability_le_add_totalVariation | |
| (G.localEmbeddingLaw seedLaw left right) (H.wins strategy)).trans | |
| (add_le_add mixtureBound (le_refl _)) | |
| /-- A single tested coordinate under an arbitrary full-tuple question law. -/ | |
| def coordinateGame (G : Game Q₁ Q₂ A₁ A₂) {n : Nat} (coordinate : Fin n) | |
| (law : FiniteDistribution ((Fin n → Q₁) × (Fin n → Q₂))) : | |
| Game (Fin n → Q₁) (Fin n → Q₂) (Fin n → A₁) (Fin n → A₂) where | |
| questions := law | |
| accepts x y a b := G.accepts (x coordinate) (y coordinate) (a coordinate) (b coordinate) | |
| /-- The strategy-extraction step used for a surviving coordinate after | |
| conditioning on successes at other coordinates. It preserves full local | |
| question dependence and uses no independence assumption on the target law. -/ | |
| theorem coordinate_probability_le_value_add_embedding_distance | |
| (G : Game Q₁ Q₂ A₁ A₂) {n : Nat} (coordinate : Fin n) | |
| (law : FiniteDistribution ((Fin n → Q₁) × (Fin n → Q₂))) | |
| (seedLaw : FiniteDistribution Seed) | |
| (left : Seed → Q₁ → Fin n → Q₁) (right : Seed → Q₂ → Fin n → Q₂) | |
| (left_preserves : ∀ seed x, left seed x coordinate = x) | |
| (right_preserves : ∀ seed y, right seed y coordinate = y) | |
| (strategy : Strategy (Fin n → Q₁) (Fin n → Q₂) (Fin n → A₁) (Fin n → A₂)) : | |
| law.probability (G.coordinateWin strategy coordinate) ≤ G.value + | |
| law.totalVariation (G.localEmbeddingLaw seedLaw left right) := by | |
| apply G.success_le_value_add_embedding_distance (G.coordinateGame coordinate law) | |
| seedLaw left right (fun _ _ a => a coordinate) (fun _ _ b => b coordinate) | |
| intro seed x y a b h | |
| simpa only [coordinateGame, left_preserves, right_preserves] using h | |
| /-- Finite samplers may have an arbitrarily small exhaustion error. Passing | |
| to the limit in the numerical bound does not require an infinite seed or a | |
| claim that any finite sampler terminates with probability one. -/ | |
| theorem coordinate_probability_le_value_of_approximate_embeddings | |
| {SeedFamily : Nat → Type*} [∀ t, Fintype (SeedFamily t)] | |
| (G : Game Q₁ Q₂ A₁ A₂) {n : Nat} (coordinate : Fin n) | |
| (law : FiniteDistribution ((Fin n → Q₁) × (Fin n → Q₂))) | |
| (seedLaw : (t : Nat) → FiniteDistribution (SeedFamily t)) | |
| (left : (t : Nat) → SeedFamily t → Q₁ → Fin n → Q₁) | |
| (right : (t : Nat) → SeedFamily t → Q₂ → Fin n → Q₂) | |
| (left_preserves : ∀ t seed x, left t seed x coordinate = x) | |
| (right_preserves : ∀ t seed y, right t seed y coordinate = y) | |
| (strategy : Strategy (Fin n → Q₁) (Fin n → Q₂) (Fin n → A₁) (Fin n → A₂)) | |
| (distance : ℝ) | |
| (close : ∀ η : ℝ, 0 < η → ∃ t, | |
| law.totalVariation (G.localEmbeddingLaw (seedLaw t) (left t) (right t)) ≤ | |
| distance + η) : | |
| law.probability (G.coordinateWin strategy coordinate) ≤ G.value + distance := by | |
| by_contra h | |
| have gap : 0 < law.probability (G.coordinateWin strategy coordinate) - | |
| (G.value + distance) := sub_pos.mpr (lt_of_not_ge h) | |
| obtain ⟨t, ht⟩ := close | |
| ((law.probability (G.coordinateWin strategy coordinate) - (G.value + distance)) / 2) | |
| (by linarith) | |
| have bound := G.coordinate_probability_le_value_add_embedding_distance coordinate law | |
| (seedLaw t) (left t) (right t) (left_preserves t) (right_preserves t) strategy | |
| linarith | |
| end | |
| end MaxCutGames.Foundations.Games.Game | |
| /-! An explicit finite shared sampler followed by supported local completion | |
| gives the coordinate success bound. No embedding-existence premise remains. -/ | |
| namespace MaxCutGames.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 MaxCutGames.Foundations.Repetition | |
| end OAI | |