Download data/lean/OAI/Computability/UniqueGames/Repetition/TensorAlgebraLemmas.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 27.5 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/UniqueGames/Repetition/TensorAlgebraLemmas.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Computability/UniqueGames/Repetition/TensorAlgebraLemmas.lean
-
curl -L -o TensorAlgebraLemmas.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/UniqueGames/Repetition/TensorAlgebraLemmas.lean
27.5 kB
| import Mathlib.Algebra.BigOperators.Fin | |
| import Mathlib.Algebra.BigOperators.Ring.Finset | |
| import Mathlib.Algebra.Order.BigOperators.Group.Finset | |
| import Mathlib.Algebra.Order.BigOperators.GroupWithZero.Finset | |
| import Mathlib.Analysis.Real.Sqrt | |
| import Mathlib.Data.Fin.Tuple.Basic | |
| import Mathlib.Data.Fintype.BigOperators | |
| import Mathlib.Basic.Real.Basic | |
| import Mathlib.Tactic.Linarith | |
| import Mathlib.Tactic.Ring | |
| import OAI.Computability.UniqueGames.Repetition.AnalyticRateLemmas | |
| import OAI.Computability.UniqueGames.Repetition.CollisionLemmas | |
| import OAI.Computability.UniqueGames.Repetition.RoundingKernel | |
| namespace OAI | |
| section | |
| /-! | |
| Finite-sum tensor factorization used by projection-game collision operators. | |
| No restriction to coordinatewise strategies occurs: `f` below is an arbitrary | |
| function of both input questions and both input answers. | |
| -/ | |
| namespace UniqueGamesTheorem.Repetition | |
| open scoped BigOperators | |
| noncomputable section | |
| variable {X A Y B U D Z C I : Type*} | |
| [Fintype X] [Fintype A] [Fintype U] [Fintype D] [Fintype I] | |
| /-- Apply a finite real kernel. Output indices need no finiteness assumption. -/ | |
| def kernelApply (K : Y β B β X β A β β) (f : X β A β β) (y : Y) (b : B) : β := | |
| β x, β a, K y b x a * f x a | |
| /-- Independent tensor of two kernels. -/ | |
| def tensorKernel (K : Y β B β X β A β β) (L : Z β C β U β D β β) | |
| (yz : Y Γ Z) (bc : B Γ C) (xu : X Γ U) (ad : A Γ D) : β := | |
| K yz.1 bc.1 xu.1 ad.1 * L yz.2 bc.2 xu.2 ad.2 | |
| /-- Applying the tensor first applies `L` separately for every fixed input of | |
| `K`, and then applies `K`. This is valid for arbitrary coupled inputs. -/ | |
| theorem kernelApply_tensor | |
| (K : Y β B β X β A β β) (L : Z β C β U β D β β) | |
| (f : (X Γ U) β (A Γ D) β β) (y : Y) (z : Z) (b : B) (c : C) : | |
| kernelApply (tensorKernel K L) f (y,z) (b,c) = | |
| kernelApply K (fun x a => kernelApply L (fun u d => f (x,u) (a,d)) z c) y b := by | |
| classical | |
| simp only [kernelApply, tensorKernel, Fintype.sum_prod_type] | |
| apply Finset.sum_congr rfl | |
| intro x _ | |
| rw [Finset.sum_comm] | |
| apply Finset.sum_congr rfl | |
| intro a _ | |
| simp only [Finset.mul_sum, mul_assoc] | |
| theorem kernelApply_nonnegative | |
| (K : Y β B β X β A β β) (f : X β A β β) | |
| (hK : β y b x a, 0 β€ K y b x a) (hf : β x a, 0 β€ f x a) | |
| (y : Y) (b : B) : 0 β€ kernelApply K f y b := by | |
| apply Finset.sum_nonneg | |
| intro x _ | |
| apply Finset.sum_nonneg | |
| intro a _ | |
| exact mul_nonneg (hK y b x a) (hf x a) | |
| /-- Summing a family of input functions commutes with the finite operator. -/ | |
| theorem kernelApply_sum | |
| (K : Y β B β X β A β β) (f : I β X β A β β) (y : Y) (b : B) : | |
| kernelApply K (fun x a => β i, f i x a) y b = | |
| β i, kernelApply K (f i) y b := by | |
| classical | |
| simp only [kernelApply, Finset.mul_sum] | |
| calc | |
| (β x, β a, β i, K y b x a * f i x a) = | |
| β x, β i, β a, K y b x a * f i x a := by | |
| apply Finset.sum_congr rfl | |
| intro x _ | |
| rw [Finset.sum_comm] | |
| _ = _ := by rw [Finset.sum_comm] | |
| theorem kernelApply_smul | |
| (K : Y β B β X β A β β) (f : X β A β β) (r : β) (y : Y) (b : B) : | |
| kernelApply K (fun x a => r * f x a) y b = r * kernelApply K f y b := by | |
| simp only [kernelApply, Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro x _ | |
| apply Finset.sum_congr rfl | |
| intro a _ | |
| exact mul_left_comm _ _ _ | |
| omit [Fintype X] in | |
| /-- Marginalizing the first answer of a joint input strategy after applying | |
| the second kernel is the same as applying the kernel to the answer marginal. -/ | |
| theorem kernelApply_slice_mass | |
| (L : Z β C β U β D β β) (f : (X Γ U) β (A Γ D) β β) | |
| (x : X) (z : Z) (c : C) : | |
| (β a, kernelApply L (fun u d => f (x,u) (a,d)) z c) = | |
| kernelApply L (fun u d => β a, f (x,u) (a,d)) z c := by | |
| symm | |
| exact kernelApply_sum L (fun a u d => f (x,u) (a,d)) z c | |
| end | |
| end UniqueGamesTheorem.Repetition | |
| end | |
| section | |
| /-! Exact tensor identities for normalized finite projection kernels. -/ | |
| namespace UniqueGamesTheorem.Repetition | |
| open UniqueGamesTheorem.Foundations.Games | |
| open scoped BigOperators | |
| noncomputable section | |
| namespace ProjectionKernel | |
| variable {Qβ Qβ Aβ Aβ Rβ Rβ Bβ Bβ I : Type*} | |
| [Fintype Qβ] [Fintype Qβ] [Fintype Aβ] [Fintype Aβ] | |
| [Fintype Rβ] [Fintype Rβ] [Fintype Bβ] [Fintype Bβ] [Fintype I] | |
| /-- The coefficient form of the conditional projection operator. -/ | |
| def coefficients (K : ProjectionKernel Qβ Qβ Aβ Aβ) | |
| (y : Qβ) (b : Aβ) (x : Qβ) (a : Aβ) : β := | |
| (K.inner y).weight x * if K.accepts x y a b then 1 else 0 | |
| theorem apply_eq_kernelApply (K : ProjectionKernel Qβ Qβ Aβ Aβ) | |
| (f : Qβ β Aβ β β) (y : Qβ) (b : Aβ) : | |
| K.apply f y b = kernelApply K.coefficients f y b := by | |
| classical | |
| unfold apply kernelApply coefficients | |
| apply Finset.sum_congr rfl | |
| intro x _ | |
| rw [Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro a _ | |
| by_cases h : K.accepts x y a b = true <;> simp [h] | |
| theorem apply_nonnegative (K : ProjectionKernel Qβ Qβ Aβ Aβ) | |
| (f : Qβ β Aβ β β) (hf : β x a, 0 β€ f x a) (y : Qβ) (b : Aβ) : | |
| 0 β€ K.apply f y b := by | |
| apply Finset.sum_nonneg | |
| intro x _ | |
| apply mul_nonneg ((K.inner y).nonnegative x) | |
| apply Finset.sum_nonneg | |
| intro a _ | |
| split | |
| Β· exact hf x a | |
| Β· exact le_rfl | |
| theorem apply_sum (K : ProjectionKernel Qβ Qβ Aβ Aβ) | |
| (f : I β Qβ β Aβ β β) (y : Qβ) (b : Aβ) : | |
| K.apply (fun x a => β i, f i x a) y b = β i, K.apply (f i) y b := by | |
| simp_rw [apply_eq_kernelApply] | |
| exact kernelApply_sum _ _ _ _ | |
| theorem apply_smul (K : ProjectionKernel Qβ Qβ Aβ Aβ) | |
| (f : Qβ β Aβ β β) (r : β) (y : Qβ) (b : Aβ) : | |
| K.apply (fun x a => r * f x a) y b = r * K.apply f y b := by | |
| simp_rw [apply_eq_kernelApply] | |
| exact kernelApply_smul _ _ _ _ _ | |
| /-- Independent product of the outer and conditional laws. -/ | |
| def product (K : ProjectionKernel Qβ Qβ Aβ Aβ) | |
| (H : ProjectionKernel Rβ Rβ Bβ Bβ) : | |
| ProjectionKernel (Qβ Γ Rβ) (Qβ Γ Rβ) (Aβ Γ Bβ) (Aβ Γ Bβ) where | |
| outer := K.outer.product H.outer | |
| inner q := (K.inner q.1).product (H.inner q.2) | |
| accepts x y a b := K.accepts x.1 y.1 a.1 b.1 && H.accepts x.2 y.2 a.2 b.2 | |
| projection x y a b b' hb hb' := by | |
| have hβ := Bool.and_eq_true_iff.mp hb | |
| have hβ := Bool.and_eq_true_iff.mp hb' | |
| exact Prod.ext (K.projection _ _ _ _ _ hβ.1 hβ.1) | |
| (H.projection _ _ _ _ _ hβ.2 hβ.2) | |
| theorem coefficients_product (K : ProjectionKernel Qβ Qβ Aβ Aβ) | |
| (H : ProjectionKernel Rβ Rβ Bβ Bβ) : | |
| (K.product H).coefficients = tensorKernel K.coefficients H.coefficients := by | |
| funext yz bc xu ad | |
| unfold coefficients product tensorKernel FiniteDistribution.product | |
| by_cases hk : K.accepts xu.1 yz.1 ad.1 bc.1 = true <;> | |
| by_cases hh : H.accepts xu.2 yz.2 ad.2 bc.2 = true <;> simp [hk, hh] | |
| /-- Arbitrary product inputs factor through the second game operator. -/ | |
| theorem apply_product (K : ProjectionKernel Qβ Qβ Aβ Aβ) | |
| (H : ProjectionKernel Rβ Rβ Bβ Bβ) | |
| (f : (Qβ Γ Rβ) β (Aβ Γ Bβ) β β) | |
| (y : Qβ) (z : Rβ) (b : Aβ) (c : Bβ) : | |
| (K.product H).apply f (y,z) (b,c) = | |
| K.apply (fun x a => H.apply (fun u d => f (x,u) (a,d)) z c) y b := by | |
| simp_rw [apply_eq_kernelApply] | |
| rw [coefficients_product] | |
| exact kernelApply_tensor _ _ _ _ _ _ _ | |
| /-- The kernel tensor realizes the ordinary independent conjunction game. -/ | |
| theorem toGame_product (K : ProjectionKernel Qβ Qβ Aβ Aβ) | |
| (H : ProjectionKernel Rβ Rβ Bβ Bβ) : | |
| (K.product H).toGame = UniqueGamesTheorem.Repetition.product K.toGame H.toGame := by | |
| have hquestions : (K.product H).toGame.questions = | |
| (UniqueGamesTheorem.Repetition.product K.toGame H.toGame).questions := by | |
| apply FiniteDistribution.eq_of_weight_eq | |
| intro q | |
| change (K.outer.weight q.2.1 * H.outer.weight q.2.2) * | |
| ((K.inner q.2.1).weight q.1.1 * (H.inner q.2.2).weight q.1.2) = | |
| (K.outer.weight q.2.1 * (K.inner q.2.1).weight q.1.1) * | |
| (H.outer.weight q.2.2 * (H.inner q.2.2).weight q.1.2) | |
| ring | |
| exact congrArg | |
| (fun questions : FiniteDistribution ((Qβ Γ Rβ) Γ (Qβ Γ Rβ)) => | |
| ({ questions := questions | |
| accepts := fun x y a b => | |
| K.accepts x.1 y.1 a.1 b.1 && H.accepts x.2 y.2 a.2 b.2 } : | |
| Game (Qβ Γ Rβ) (Qβ Γ Rβ) (Aβ Γ Bβ) (Aβ Γ Bβ))) hquestions | |
| end ProjectionKernel | |
| end | |
| end UniqueGamesTheorem.Repetition | |
| end | |
| section | |
| /-! | |
| Independent repetitions of the actual conditional projection kernel. The | |
| resulting game has precisely the original game's product question law. A | |
| successor tuple is a reindexed independent product, so collision bounds on the | |
| product apply to unrestricted strategies on whole tuples. | |
| -/ | |
| namespace UniqueGamesTheorem.Repetition.ProjectionKernel | |
| open UniqueGamesTheorem.Foundations.Games | |
| open scoped BigOperators | |
| noncomputable section | |
| variable {Qβ Qβ Aβ Aβ : Type*} | |
| [Fintype Qβ] [Fintype Qβ] [Fintype Aβ] [Fintype Aβ] | |
| def repetition (K : ProjectionKernel Qβ Qβ Aβ Aβ) (n : Nat) : | |
| ProjectionKernel (Fin n β Qβ) (Fin n β Qβ) (Fin n β Aβ) (Fin n β Aβ) := by | |
| classical | |
| exact | |
| { outer := K.outer.iid n | |
| inner := fun y => FiniteDistribution.table (fun i : Fin n => K.inner (y i)) | |
| accepts := fun x y a b => decide (β i, K.accepts (x i) (y i) (a i) (b i) = true) | |
| projection := by | |
| intro x y a b b' hb hb' | |
| simp only [decide_eq_true_eq] at hb hb' | |
| funext i | |
| exact K.projection _ _ _ _ _ (hb i) (hb' i) } | |
| @[simp] theorem repetition_accepts_iff (K : ProjectionKernel Qβ Qβ Aβ Aβ) (n : Nat) | |
| (x : Fin n β Qβ) (y : Fin n β Qβ) (a : Fin n β Aβ) (b : Fin n β Aβ) : | |
| (K.repetition n).accepts x y a b = true β | |
| β i, K.accepts (x i) (y i) (a i) (b i) = true := by | |
| classical | |
| simp [repetition] | |
| @[simp] theorem toGame_repetition (K : ProjectionKernel Qβ Qβ Aβ Aβ) (n : Nat) : | |
| (K.repetition n).toGame = K.toGame.repetition n := by | |
| classical | |
| have hq : (K.repetition n).toGame.questions = (K.toGame.repetition n).questions := by | |
| apply FiniteDistribution.eq_of_weight_eq | |
| intro q | |
| change ((β i, K.outer.weight (q.2 i)) * | |
| (β i, (K.inner (q.2 i)).weight (q.1 i))) = | |
| β i, K.outer.weight (q.2 i) * (K.inner (q.2 i)).weight (q.1 i) | |
| exact Finset.prod_mul_distrib.symm | |
| change Game.mk (K.repetition n).toGame.questions | |
| (fun (x : Fin n β Qβ) (y : Fin n β Qβ) (a : Fin n β Aβ) (b : Fin n β Aβ) => | |
| decide (β i, K.accepts (x i) (y i) (a i) (b i) = true)) = | |
| Game.mk (K.toGame.repetition n).questions | |
| (fun (x : Fin n β Qβ) (y : Fin n β Qβ) (a : Fin n β Aβ) (b : Fin n β Aβ) => | |
| decide (β i, K.accepts (x i) (y i) (a i) (b i) = true)) | |
| rw [hq] | |
| theorem eq_of_data_eq {K H : ProjectionKernel Qβ Qβ Aβ Aβ} | |
| (houter : K.outer = H.outer) (hinner : K.inner = H.inner) | |
| (haccepts : K.accepts = H.accepts) : K = H := by | |
| cases K | |
| cases H | |
| cases houter | |
| cases hinner | |
| cases haccepts | |
| rfl | |
| /-- Separate the first coordinate without restricting answer dependence on | |
| any coordinate of the complete local question tuple. -/ | |
| theorem repetition_succ (K : ProjectionKernel Qβ Qβ Aβ Aβ) (n : Nat) : | |
| K.repetition (n + 1) = | |
| (K.product (K.repetition n)).reindex | |
| (Fin.consEquiv (fun _ : Fin (n + 1) => Qβ)) | |
| (Fin.consEquiv (fun _ : Fin (n + 1) => Qβ)) | |
| (Fin.consEquiv (fun _ : Fin (n + 1) => Aβ)) | |
| (Fin.consEquiv (fun _ : Fin (n + 1) => Aβ)) := by | |
| classical | |
| apply eq_of_data_eq | |
| Β· apply FiniteDistribution.eq_of_weight_eq | |
| intro y | |
| change (β i : Fin (n + 1), K.outer.weight (y i)) = | |
| K.outer.weight (y 0) * β i : Fin n, K.outer.weight (y i.succ) | |
| exact Fin.prod_univ_succ _ | |
| Β· funext y | |
| apply FiniteDistribution.eq_of_weight_eq | |
| intro x | |
| change (β i : Fin (n + 1), (K.inner (y i)).weight (x i)) = | |
| (K.inner (y 0)).weight (x 0) * | |
| β i : Fin n, (K.inner (y i.succ)).weight (x i.succ) | |
| exact Fin.prod_univ_succ _ | |
| Β· funext x y a b | |
| apply Bool.eq_iff_iff.mpr | |
| change (decide (β i : Fin (n + 1), K.accepts (x i) (y i) (a i) (b i) = true) = true) β | |
| (K.accepts (x 0) (y 0) (a 0) (b 0) && | |
| decide (β i : Fin n, K.accepts (x i.succ) (y i.succ) (a i.succ) (b i.succ) = true)) = true | |
| simp only [decide_eq_true_eq, Bool.and_eq_true] | |
| constructor | |
| Β· intro h | |
| exact β¨h 0, fun i => h i.succβ© | |
| Β· rintro β¨hzero, hsuccβ© i | |
| exact Fin.cases hzero hsucc i | |
| theorem collisionValue_repetition_succ [Nonempty Aβ] | |
| (K : ProjectionKernel Qβ Qβ Aβ Aβ) (n : Nat) : | |
| (K.repetition (n + 1)).collisionValue = | |
| (K.product (K.repetition n)).collisionValue := by | |
| rw [repetition_succ, collisionValue_reindex] | |
| theorem collisionValue_repetition_zero_le_one [Nonempty Aβ] [Nonempty Aβ] | |
| (K : ProjectionKernel Qβ Qβ Aβ Aβ) : | |
| (K.repetition 0).collisionValue β€ 1 := | |
| (K.repetition 0).collisionValue_le_one | |
| end | |
| end UniqueGamesTheorem.Repetition.ProjectionKernel | |
| end | |
| section | |
| /-! | |
| The tensor-domination reduction before the Dinur--Steurer rounding theorem. | |
| Every deterministic strategy for the product gives a nonnegative vector table | |
| for the first kernel. Its energy is exactly the product collision energy, and | |
| each input-question mass is bounded by the second kernel's collision value. | |
| -/ | |
| namespace UniqueGamesTheorem.Repetition | |
| open UniqueGamesTheorem.Foundations.Games | |
| open scoped BigOperators | |
| noncomputable section | |
| namespace ProjectionKernel | |
| variable {Qβ Qβ Aβ Aβ Rβ Rβ Bβ Bβ : Type*} | |
| [Fintype Qβ] [Fintype Qβ] [Fintype Aβ] [Fintype Aβ] | |
| [Fintype Rβ] [Fintype Rβ] [Fintype Bβ] [Fintype Bβ] | |
| /-- Apply the second game to a fixed first question and first answer. The | |
| square-root factor changes its weighted output space into counting measure. -/ | |
| def tensorSlice (H : ProjectionKernel Rβ Rβ Bβ Bβ) | |
| (labels : (Qβ Γ Rβ) β (Aβ Γ Bβ)) | |
| (Ο : Rβ Γ Bβ) (x : Qβ) (a : Aβ) : β := | |
| Real.sqrt (H.outer.weight Ο.1) * | |
| H.apply (fun u d => assignment labels (x,u) (a,d)) Ο.1 Ο.2 | |
| omit [Fintype Qβ] [Fintype Aβ] in | |
| theorem tensorSlice_nonnegative (H : ProjectionKernel Rβ Rβ Bβ Bβ) | |
| (labels : (Qβ Γ Rβ) β (Aβ Γ Bβ)) (Ο : Rβ Γ Bβ) (x : Qβ) (a : Aβ) : | |
| 0 β€ H.tensorSlice labels Ο x a := by | |
| apply mul_nonneg (Real.sqrt_nonneg _) | |
| apply H.apply_nonnegative | |
| intro u d | |
| unfold assignment | |
| split | |
| Β· exact zero_le_one | |
| Β· exact le_rfl | |
| omit [Fintype Qβ] [Fintype Rβ] [Fintype Bβ] in | |
| /-- Marginalizing the first label of a deterministic product strategy leaves | |
| the deterministic second-label strategy. -/ | |
| theorem sum_assignment_product (labels : (Qβ Γ Rβ) β (Aβ Γ Bβ)) | |
| (x : Qβ) (u : Rβ) (d : Bβ) : | |
| (β a, assignment labels (x,u) (a,d)) = | |
| assignment (fun r => (labels (x,r)).2) u d := by | |
| classical | |
| by_cases h : (labels (x,u)).2 = d <;> simp [assignment, Prod.ext_iff, h] | |
| omit [Fintype Qβ] in | |
| theorem tensorSlice_label_mass (H : ProjectionKernel Rβ Rβ Bβ Bβ) | |
| (labels : (Qβ Γ Rβ) β (Aβ Γ Bβ)) (Ο : Rβ Γ Bβ) (x : Qβ) : | |
| (β a, H.tensorSlice labels Ο x a) = | |
| Real.sqrt (H.outer.weight Ο.1) * | |
| H.apply (assignment (fun r => (labels (x,r)).2)) Ο.1 Ο.2 := by | |
| unfold tensorSlice | |
| rw [β Finset.mul_sum, β apply_sum] | |
| simp_rw [sum_assignment_product] | |
| omit [Fintype Qβ] in | |
| /-- The fiber mass is an actual collision energy of the second game, not a | |
| free normalization assumption. -/ | |
| theorem vectorMass_tensorSlice (H : ProjectionKernel Rβ Rβ Bβ Bβ) | |
| (labels : (Qβ Γ Rβ) β (Aβ Γ Bβ)) (x : Qβ) : | |
| vectorMass (H.tensorSlice labels) x = | |
| H.assignmentEnergy (fun r => (labels (x,r)).2) := by | |
| classical | |
| unfold vectorMass assignmentEnergy energy | |
| simp_rw [tensorSlice_label_mass, mul_pow] | |
| simp only [Fintype.sum_prod_type] | |
| apply Finset.sum_congr rfl | |
| intro y _ | |
| rw [Real.sq_sqrt (H.outer.nonnegative y), Finset.mul_sum] | |
| omit [Fintype Qβ] in | |
| theorem vectorMass_tensorSlice_le [Nonempty Bβ] | |
| (H : ProjectionKernel Rβ Rβ Bβ Bβ) | |
| (labels : (Qβ Γ Rβ) β (Aβ Γ Bβ)) (x : Qβ) : | |
| vectorMass (H.tensorSlice labels) x β€ H.collisionValue := by | |
| rw [vectorMass_tensorSlice] | |
| exact H.assignmentEnergy_le_collisionValue _ | |
| /-- Exact Hilbert-norm factorization, with every marginal weight retained. -/ | |
| theorem vectorEnergy_tensorSlice (K : ProjectionKernel Qβ Qβ Aβ Aβ) | |
| (H : ProjectionKernel Rβ Rβ Bβ Bβ) | |
| (labels : (Qβ Γ Rβ) β (Aβ Γ Bβ)) : | |
| K.vectorEnergy (H.tensorSlice labels) = (K.product H).assignmentEnergy labels := by | |
| classical | |
| let p := fun y z b c => | |
| K.apply (fun x a => H.apply (fun u d => assignment labels (x,u) (a,d)) z c) y b ^ 2 | |
| have hlhs : K.vectorEnergy (H.tensorSlice labels) = | |
| β z, β c, β y, β b, K.outer.weight y * H.outer.weight z * p y z b c := by | |
| simp only [vectorEnergy, energy, Fintype.sum_prod_type] | |
| apply Finset.sum_congr rfl | |
| intro z _ | |
| apply Finset.sum_congr rfl | |
| intro c _ | |
| apply Finset.sum_congr rfl | |
| intro y _ | |
| rw [Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro b _ | |
| change K.outer.weight y * | |
| (K.apply (fun x a => Real.sqrt (H.outer.weight z) * | |
| H.apply (fun u d => assignment labels (x,u) (a,d)) z c) y b) ^ 2 = _ | |
| rw [apply_smul, mul_pow, Real.sq_sqrt (H.outer.nonnegative z)] | |
| exact (mul_assoc _ _ _).symm | |
| have hrhs : (K.product H).assignmentEnergy labels = | |
| β y, β z, β b, β c, K.outer.weight y * H.outer.weight z * p y z b c := by | |
| simp only [assignmentEnergy, energy, product, FiniteDistribution.product, | |
| Fintype.sum_prod_type] | |
| apply Finset.sum_congr rfl | |
| intro y _ | |
| apply Finset.sum_congr rfl | |
| intro z _ | |
| simp only [Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro b _ | |
| apply Finset.sum_congr rfl | |
| intro c _ | |
| congr 1 | |
| exact congrArg (fun r : β => r ^ 2) | |
| (apply_product K H (assignment labels) y z b c) | |
| rw [hlhs, hrhs] | |
| calc | |
| (β z, β c, β y, β b, K.outer.weight y * H.outer.weight z * p y z b c) = | |
| β z, β y, β b, β c, K.outer.weight y * H.outer.weight z * p y z b c := by | |
| apply Finset.sum_congr rfl | |
| intro z _ | |
| rw [Finset.sum_comm] | |
| apply Finset.sum_congr rfl | |
| intro y _ | |
| rw [Finset.sum_comm] | |
| _ = _ := by rw [Finset.sum_comm] | |
| end ProjectionKernel | |
| end | |
| end UniqueGamesTheorem.Repetition | |
| end | |
| section | |
| /-! Homogeneous normalization for finite nonnegative vector assignments. -/ | |
| namespace UniqueGamesTheorem.Repetition.ProjectionKernel | |
| open scoped BigOperators | |
| noncomputable section | |
| variable {Qβ Qβ Aβ Aβ Ξ© : Type*} | |
| [Fintype Qβ] [Fintype Qβ] [Fintype Aβ] [Fintype Aβ] [Fintype Ξ©] | |
| omit [Fintype Qβ] in | |
| theorem vectorMass_smul (f : Ξ© β Qβ β Aβ β β) (r : β) (x : Qβ) : | |
| vectorMass (fun Ο x a => r * f Ο x a) x = r ^ 2 * vectorMass f x := by | |
| unfold vectorMass | |
| simp_rw [β Finset.mul_sum, mul_pow] | |
| exact (Finset.mul_sum _ _ _).symm | |
| theorem energy_smul (K : ProjectionKernel Qβ Qβ Aβ Aβ) | |
| (f : Qβ β Aβ β β) (r : β) : | |
| K.energy (fun x a => r * f x a) = r ^ 2 * K.energy f := by | |
| unfold energy | |
| simp_rw [apply_smul, mul_pow, Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro y _ | |
| apply Finset.sum_congr rfl | |
| intro b _ | |
| exact mul_left_comm _ _ _ | |
| theorem vectorEnergy_smul (K : ProjectionKernel Qβ Qβ Aβ Aβ) | |
| (f : Ξ© β Qβ β Aβ β β) (r : β) : | |
| K.vectorEnergy (fun Ο x a => r * f Ο x a) = r ^ 2 * K.vectorEnergy f := by | |
| unfold vectorEnergy | |
| simp_rw [energy_smul] | |
| exact (Finset.mul_sum _ _ _).symm | |
| omit [Fintype Qβ] in | |
| theorem entry_eq_zero_of_vectorMass_nonpositive | |
| (f : Ξ© β Qβ β Aβ β β) (hf : β Ο x a, 0 β€ f Ο x a) | |
| (hmass : β x, vectorMass f x β€ 0) (Ο : Ξ©) (x : Qβ) (a : Aβ) : | |
| f Ο x a = 0 := by | |
| classical | |
| have hsquare : (β b, f Ο x b) ^ 2 β€ vectorMass f x := | |
| Finset.single_le_sum (fun Ο _ => sq_nonneg (β b, f Ο x b)) (Finset.mem_univ Ο) | |
| have hsum : β b, f Ο x b = 0 := by | |
| nlinarith [hmass x, sq_nonneg (β b, f Ο x b)] | |
| have hentry : f Ο x a β€ β b, f Ο x b := | |
| Finset.single_le_sum (fun b _ => hf Ο x b) (Finset.mem_univ a) | |
| rw [hsum] at hentry | |
| exact le_antisymm hentry (hf Ο x a) | |
| theorem vectorEnergy_eq_zero_of_mass_nonpositive | |
| (K : ProjectionKernel Qβ Qβ Aβ Aβ) | |
| (f : Ξ© β Qβ β Aβ β β) (hf : β Ο x a, 0 β€ f Ο x a) | |
| (hmass : β x, vectorMass f x β€ 0) : K.vectorEnergy f = 0 := by | |
| have hfzero : f = fun _ _ _ => 0 := by | |
| funext Ο x a | |
| exact entry_eq_zero_of_vectorMass_nonpositive f hf hmass Ο x a | |
| rw [hfzero] | |
| simp [vectorEnergy, energy, apply] | |
| /-- A unit-mass estimate extends to any nonnegative mass bound, including | |
| zero. The hypothesis is precisely the unit-mass analytic estimate being | |
| normalized; the normalization itself assumes no repetition bound. -/ | |
| theorem vectorEnergy_le_of_unit_bound | |
| (K : ProjectionKernel Qβ Qβ Aβ Aβ) (Ο C : β) | |
| (unit_bound : β f : Ξ© β Qβ β Aβ β β, | |
| (β Ο x a, 0 β€ f Ο x a) β (β x, vectorMass f x β€ 1) β K.vectorEnergy f β€ Ο) | |
| (hC : 0 β€ C) (f : Ξ© β Qβ β Aβ β β) | |
| (hf : β Ο x a, 0 β€ f Ο x a) (hmass : β x, vectorMass f x β€ C) : | |
| K.vectorEnergy f β€ Ο * C := by | |
| rcases eq_or_lt_of_le hC with hzero | hpositive | |
| Β· have hCzero : C = 0 := hzero.symm | |
| subst C | |
| rw [K.vectorEnergy_eq_zero_of_mass_nonpositive f hf hmass, mul_zero] | |
| Β· have hsqrt : 0 β€ (Real.sqrt C)β»ΒΉ := inv_nonneg.mpr (Real.sqrt_nonneg C) | |
| have hscale : ((Real.sqrt C)β»ΒΉ) ^ 2 = Cβ»ΒΉ := by | |
| rw [inv_pow, Real.sq_sqrt hC] | |
| have hnorm : β x, vectorMass (fun Ο x a => (Real.sqrt C)β»ΒΉ * f Ο x a) x β€ 1 := by | |
| intro x | |
| rw [vectorMass_smul, hscale] | |
| have h := mul_le_mul_of_nonneg_left (hmass x) (inv_nonneg.mpr hC) | |
| simpa [ne_of_gt hpositive] using h | |
| have hbound := unit_bound (fun Ο x a => (Real.sqrt C)β»ΒΉ * f Ο x a) | |
| (fun Ο x a => mul_nonneg hsqrt (hf Ο x a)) hnorm | |
| rw [vectorEnergy_smul, hscale] at hbound | |
| have h := mul_le_mul_of_nonneg_left hbound hC | |
| simpa [β mul_assoc, ne_of_gt hpositive, mul_comm C Ο] using h | |
| end | |
| end UniqueGamesTheorem.Repetition.ProjectionKernel | |
| end | |
| section | |
| /-! | |
| Alphabet-independent repetition of ordinary finite projection games. | |
| The game is the actual finite question distribution and its local acceptance | |
| predicate. The proof bounds nonnegative vector assignments by finite | |
| thresholding and correlated sampling, factors each unrestricted product | |
| strategy through that bound, and iterates the resulting collision contraction. | |
| No repetition bound, decoder certificate, or alphabet-size budget is a premise. | |
| The deterministic-predicate game interface permits arbitrary real question | |
| weights. Distinct hidden constraints on the same question pair are not encoded | |
| by this interface. Both v2 uses have a unique predicate for each question pair: | |
| the distinct-position equation--variable game and the final simple graph. | |
| -/ | |
| namespace UniqueGamesTheorem.Repetition | |
| open UniqueGamesTheorem.Foundations.Games | |
| noncomputable section | |
| namespace ProjectionKernel | |
| variable {Qβ Qβ Aβ Aβ Rβ Rβ Bβ Bβ : Type*} | |
| [Fintype Qβ] [Fintype Qβ] [Fintype Aβ] [Fintype Aβ] | |
| [Fintype Rβ] [Fintype Rβ] [Fintype Bβ] [Fintype Bβ] | |
| [Nonempty Aβ] [Nonempty Aβ] [Nonempty Bβ] [Nonempty Bβ] | |
| omit [Nonempty Bβ] in | |
| theorem collisionValue_product_le_gap_rate | |
| (K : ProjectionKernel Qβ Qβ Aβ Aβ) | |
| (H : ProjectionKernel Rβ Rβ Bβ Bβ) {gap : β} | |
| (hgapβ : 0 β€ gap) (hgapβ : gap β€ 1) | |
| (hvalue : K.toGame.value β€ 1 - gap) : | |
| (K.product H).collisionValue β€ (1 - gap ^ 2 / 8) * H.collisionValue := by | |
| apply ((K.product H).collisionValue_le_iff _).2 | |
| intro labels | |
| rw [β vectorEnergy_tensorSlice] | |
| apply K.vectorEnergy_le_of_unit_bound (1 - gap ^ 2 / 8) H.collisionValue | |
| (fun f hf hmass => K.vectorEnergy_le_gap_rate f hf hmass hgapβ hgapβ hvalue) | |
| H.collisionValue_nonneg (H.tensorSlice labels) | |
| (H.tensorSlice_nonnegative labels) (H.vectorMass_tensorSlice_le labels) | |
| theorem repetition_value_le_dsRate | |
| (K : ProjectionKernel Qβ Qβ Aβ Aβ) {gap : β} | |
| (hgapβ : 0 β€ gap) (hgapβ : gap β€ 1) | |
| (hvalue : K.toGame.value β€ 1 - gap) (n : β) : | |
| (K.toGame.repetition n).value β€ dsRate gap ^ n := by | |
| have hstep : β m, (K.repetition (m + 1)).collisionValue β€ | |
| (1 - gap ^ 2 / 8) * (K.repetition m).collisionValue := by | |
| intro m | |
| rw [K.collisionValue_repetition_succ] | |
| exact K.collisionValue_product_le_gap_rate (K.repetition m) hgapβ hgapβ hvalue | |
| have h := rate_of_squared_collision_recurrence hgapβ hgapβ | |
| (fun m => (K.repetition m).collisionValue) | |
| (fun m => (K.repetition m).toGame.value) | |
| K.collisionValue_repetition_zero_le_one hstep | |
| (fun m => (K.repetition m).value_sq_le_collisionValue) n | |
| simpa only [toGame_repetition] using h | |
| end ProjectionKernel | |
| variable {Qβ Qβ Aβ Aβ : Type*} | |
| [Fintype Qβ] [Fintype Qβ] [Fintype Aβ] [Fintype Aβ] | |
| [Nonempty Aβ] [Nonempty Aβ] | |
| /-- The v2 projection-repetition estimate, including the empty product. | |
| The repetition exponent is independent of all question and answer cardinalities. -/ | |
| theorem projection_repetition_value | |
| (G : Game Qβ Qβ Aβ Aβ) (hG : IsProjection G) (n : β) | |
| {gap : β} (hgapβ : 0 < gap) (hgapβ : gap < 1) | |
| (hvalue : G.value β€ 1 - gap) : | |
| (G.repetition n).value β€ (1 - gap ^ 2 / 16) ^ n := by | |
| have h := (kernelOfGame G hG).repetition_value_le_dsRate hgapβ.le hgapβ.le | |
| (by simpa only [kernelOfGame_value] using hvalue) n | |
| simpa only [toGame_kernelOfGame, dsRate] using h | |
| theorem projection_repetition_success | |
| (G : Game Qβ Qβ Aβ Aβ) (hG : IsProjection G) (n : β) | |
| {gap : β} (hgapβ : 0 < gap) (hgapβ : gap < 1) | |
| (hvalue : G.value β€ 1 - gap) | |
| (strategy : Strategy (Fin n β Qβ) (Fin n β Qβ) (Fin n β Aβ) (Fin n β Aβ)) : | |
| (G.repetition n).success strategy β€ (1 - gap ^ 2 / 16) ^ n := | |
| ((G.repetition n).success_le_value strategy).trans | |
| (projection_repetition_value G hG n hgapβ hgapβ hvalue) | |
| theorem clean_repetition_value | |
| (G : Game Qβ Qβ Aβ Aβ) (hG : IsProjection G) (n : β) | |
| (hvalue : G.value β€ (14 : β) / 15) : | |
| (G.repetition n).value β€ (1 - (1 : β) / 3600) ^ n := by | |
| have hv : G.value β€ 1 - (1 : β) / 15 := by | |
| convert hvalue using 1 | |
| norm_num | |
| have h := projection_repetition_value G hG n | |
| (gap := (1 : β) / 15) (by norm_num) (by norm_num) hv | |
| norm_num at h β’ | |
| exact h | |
| theorem final_repetition_value | |
| (G : Game Qβ Qβ Aβ Aβ) (hG : IsProjection G) (n : β) | |
| (hvalue : G.value β€ 1 - (1 : β) / 800) : | |
| (G.repetition n).value β€ (1 - (1 : β) / 10240000) ^ n := by | |
| have h := projection_repetition_value G hG n | |
| (gap := (1 : β) / 800) (by norm_num) (by norm_num) hvalue | |
| norm_num at h β’ | |
| exact h | |
| end | |
| end UniqueGamesTheorem.Repetition | |
| end | |
| end OAI | |