Download data/lean/OAI/Computability/UniqueGames/Repetition/RoundingPaddingLemmas.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 20 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/UniqueGames/Repetition/RoundingPaddingLemmas.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Computability/UniqueGames/Repetition/RoundingPaddingLemmas.lean
-
curl -L -o RoundingPaddingLemmas.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/UniqueGames/Repetition/RoundingPaddingLemmas.lean
20 kB
| import Mathlib.Analysis.Real.Sqrt | |
| import Mathlib.Data.Fintype.Sum | |
| import OAI.Computability.UniqueGames.Foundations.FiniteTrialsLemmas | |
| import OAI.Computability.UniqueGames.Repetition.AnalyticCheegerLemmas | |
| import OAI.Computability.UniqueGames.Repetition.CollisionLemmas | |
| namespace OAI | |
| section | |
| /-! Finite vertex-specific padding of nonnegative vectors to unit squared row | |
| mass. The new coordinates can only increase any nonnegative relation energy. -/ | |
| namespace UniqueGamesTheorem.Repetition | |
| open scoped BigOperators | |
| open Foundations.Games | |
| noncomputable section | |
| variable {V A Ξ© E : Type*} [Fintype V] [Fintype Ξ©] [Fintype E] | |
| def rowSquareMass (f : V β Ξ© β β) (v : V) : β := β Ο, (f v Ο) ^ 2 | |
| def paddedAmplitude [DecidableEq V] (f : V β Ξ© β β) (v : V) : Ξ© β V β β | |
| | Sum.inl Ο => f v Ο | |
| | Sum.inr w => if v = w then Real.sqrt (1 - rowSquareMass f v) else 0 | |
| def paddedLabel (a : V β Ξ© β A) (fallback : A) (v : V) : Ξ© β V β A | |
| | Sum.inl Ο => a v Ο | |
| | Sum.inr _ => fallback | |
| omit [Fintype V] in | |
| theorem paddedAmplitude_nonnegative [DecidableEq V] (f : V β Ξ© β β) | |
| (hf : β v Ο, 0 β€ f v Ο) (v : V) (Ο : Ξ© β V) : | |
| 0 β€ paddedAmplitude f v Ο := by | |
| cases Ο with | |
| | inl Ο => exact hf v Ο | |
| | inr w => | |
| simp only [paddedAmplitude] | |
| split | |
| Β· exact Real.sqrt_nonneg _ | |
| Β· exact le_rfl | |
| theorem paddedAmplitude_row [DecidableEq V] (f : V β Ξ© β β) | |
| (hrow : β v, rowSquareMass f v β€ 1) (v : V) : | |
| rowSquareMass (paddedAmplitude f) v = 1 := by | |
| have hs : Real.sqrt (1 - rowSquareMass f v) ^ 2 = 1 - rowSquareMass f v := | |
| Real.sq_sqrt (sub_nonneg.mpr (hrow v)) | |
| simp only [rowSquareMass] at hs | |
| simp only [rowSquareMass, Fintype.sum_sum_type, paddedAmplitude] | |
| simp only [ite_pow, zero_pow (by decide : 2 β 0)] | |
| rw [Finset.sum_ite_eq, ite_eq_left (Finset.mem_univ v), hs] | |
| ring | |
| def pairEnergy (Ξ½ : FiniteDistribution E) (left right : E β V) | |
| (R : E β A β A β Bool) (a : V β Ξ© β A) (f : V β Ξ© β β) : β := | |
| Ξ½.expectation fun e => β Ο, | |
| if R e (a (left e) Ο) (a (right e) Ο) | |
| then f (left e) Ο * f (right e) Ο else 0 | |
| def pairOverlap (Ξ½ : FiniteDistribution E) (left right : E β V) | |
| (R : E β A β A β Bool) (a : V β Ξ© β A) (f : V β Ξ© β β) : β := | |
| Ξ½.expectation fun e => β Ο, | |
| if R e (a (left e) Ο) (a (right e) Ο) | |
| then min ((f (left e) Ο) ^ 2) ((f (right e) Ο) ^ 2) else 0 | |
| omit [Fintype V] in | |
| theorem pairEnergy_nonnegative (Ξ½ : FiniteDistribution E) (left right : E β V) | |
| (R : E β A β A β Bool) (a : V β Ξ© β A) (f : V β Ξ© β β) | |
| (hf : β v Ο, 0 β€ f v Ο) : 0 β€ pairEnergy Ξ½ left right R a f := by | |
| apply Finset.sum_nonneg | |
| intro e _ | |
| apply mul_nonneg (Ξ½.nonnegative e) | |
| apply Finset.sum_nonneg | |
| intro Ο _ | |
| split | |
| Β· exact mul_nonneg (hf (left e) Ο) (hf (right e) Ο) | |
| Β· exact le_rfl | |
| theorem pairEnergy_le_padded [DecidableEq V] (Ξ½ : FiniteDistribution E) | |
| (left right : E β V) (R : E β A β A β Bool) | |
| (a : V β Ξ© β A) (f : V β Ξ© β β) | |
| (hf : β v Ο, 0 β€ f v Ο) (fallback : A) : | |
| pairEnergy Ξ½ left right R a f β€ | |
| pairEnergy Ξ½ left right R (paddedLabel a fallback) (paddedAmplitude f) := by | |
| unfold pairEnergy FiniteDistribution.expectation | |
| apply Finset.sum_le_sum | |
| intro e _ | |
| apply mul_le_mul_of_nonneg_left _ (Ξ½.nonnegative e) | |
| dsimp only | |
| rw [Fintype.sum_sum_type] | |
| simp only [paddedLabel, paddedAmplitude] | |
| have hnonneg : 0 β€ β w : V, | |
| if R e fallback fallback then | |
| (if left e = w then Real.sqrt (1 - rowSquareMass f (left e)) else 0) * | |
| (if right e = w then Real.sqrt (1 - rowSquareMass f (right e)) else 0) | |
| else 0 := by | |
| apply Finset.sum_nonneg | |
| intro w _ | |
| split | |
| Β· exact mul_nonneg (paddedAmplitude_nonnegative f hf (left e) (Sum.inr w)) | |
| (paddedAmplitude_nonnegative f hf (right e) (Sum.inr w)) | |
| Β· exact le_rfl | |
| exact le_add_of_nonneg_right hnonneg | |
| end | |
| end UniqueGamesTheorem.Repetition | |
| end | |
| section | |
| /-! Flatten the genuine finite occurrence law together with the auxiliary | |
| coordinate into the Cheeger inequality. The occurrence may retain hidden | |
| information; both endpoint label tables still depend only on their vertex. -/ | |
| namespace UniqueGamesTheorem.Repetition | |
| open scoped BigOperators | |
| open Foundations.Games | |
| noncomputable section | |
| variable {V A Ξ© E : Type*} [Fintype V] [Fintype Ξ©] [Fintype E] | |
| omit [Fintype V] in | |
| theorem pairQuadraticMass_eq_one (Ξ½ : FiniteDistribution E) (left right : E β V) | |
| (f : V β Ξ© β β) (hrow : β v, rowSquareMass f v = 1) : | |
| Analytic.quadraticMass (fun p : E Γ Ξ© => Ξ½.weight p.1) | |
| (fun p => f (left p.1) p.2) (fun p => f (right p.1) p.2) = 1 := by | |
| unfold Analytic.quadraticMass | |
| rw [Fintype.sum_prod_type] | |
| have he (e : E) : | |
| (β Ο, Ξ½.weight e * ((f (left e) Ο) ^ 2 + (f (right e) Ο) ^ 2) / 2) = | |
| Ξ½.weight e := by | |
| calc | |
| _ = Ξ½.weight e * | |
| ((β Ο, (f (left e) Ο) ^ 2) + (β Ο, (f (right e) Ο) ^ 2)) / 2 := by | |
| simp only [div_eq_mul_inv, mul_add, add_mul, Finset.sum_add_distrib, | |
| Finset.mul_sum, Finset.sum_mul] | |
| _ = Ξ½.weight e := by | |
| change Ξ½.weight e * (rowSquareMass f (left e) + rowSquareMass f (right e)) / 2 = _ | |
| rw [hrow, hrow] | |
| ring | |
| simp_rw [he] | |
| exact Ξ½.normalized | |
| omit [Fintype V] in | |
| theorem pairGatedCorrelation_eq_energy (Ξ½ : FiniteDistribution E) (left right : E β V) | |
| (R : E β A β A β Bool) (a : V β Ξ© β A) (f : V β Ξ© β β) : | |
| Analytic.gatedCorrelation (fun p : E Γ Ξ© => Ξ½.weight p.1) | |
| (fun p => f (left p.1) p.2) (fun p => f (right p.1) p.2) | |
| (fun p => R p.1 (a (left p.1) p.2) (a (right p.1) p.2)) = | |
| pairEnergy Ξ½ left right R a f := by | |
| simp only [Analytic.gatedCorrelation, pairEnergy, FiniteDistribution.expectation, | |
| Fintype.sum_prod_type, Finset.mul_sum, mul_ite, mul_zero, mul_assoc] | |
| omit [Fintype V] in | |
| theorem pairGatedMinimum_eq_overlap (Ξ½ : FiniteDistribution E) (left right : E β V) | |
| (R : E β A β A β Bool) (a : V β Ξ© β A) (f : V β Ξ© β β) : | |
| Analytic.gatedMinimum (fun p : E Γ Ξ© => Ξ½.weight p.1) | |
| (fun p => f (left p.1) p.2) (fun p => f (right p.1) p.2) | |
| (fun p => R p.1 (a (left p.1) p.2) (a (right p.1) p.2)) = | |
| pairOverlap Ξ½ left right R a f := by | |
| simp only [Analytic.gatedMinimum, pairOverlap, FiniteDistribution.expectation, | |
| Fintype.sum_prod_type, Finset.mul_sum, mul_ite, mul_zero] | |
| omit [Fintype V] in | |
| theorem pairEnergy_le_one_of_unit_rows (Ξ½ : FiniteDistribution E) (left right : E β V) | |
| (R : E β A β A β Bool) (a : V β Ξ© β A) (f : V β Ξ© β β) | |
| (hrow : β v, rowSquareMass f v = 1) : pairEnergy Ξ½ left right R a f β€ 1 := by | |
| have h := Analytic.gatedCorrelation_le_mass (fun p : E Γ Ξ© => Ξ½.weight p.1) | |
| (fun p => f (left p.1) p.2) (fun p => f (right p.1) p.2) | |
| (fun p => R p.1 (a (left p.1) p.2) (a (right p.1) p.2)) | |
| (fun p => Ξ½.nonnegative p.1) | |
| rw [pairGatedCorrelation_eq_energy, pairQuadraticMass_eq_one Ξ½ left right f hrow] at h | |
| exact h | |
| omit [Fintype V] in | |
| /-- The overlap used by finite threshold sampling is large whenever the | |
| actual weighted occurrence energy is large. -/ | |
| theorem pairOverlap_ge_energy (Ξ½ : FiniteDistribution E) (left right : E β V) | |
| (R : E β A β A β Bool) (a : V β Ξ© β A) (f : V β Ξ© β β) | |
| (hf : β v Ο, 0 β€ f v Ο) (hrow : β v, rowSquareMass f v = 1) : | |
| 1 - Real.sqrt (2 * (1 - pairEnergy Ξ½ left right R a f)) β€ | |
| pairOverlap Ξ½ left right R a f := by | |
| have h := Analytic.gatedMinimum_unit_mass (fun p : E Γ Ξ© => Ξ½.weight p.1) | |
| (fun p => f (left p.1) p.2) (fun p => f (right p.1) p.2) | |
| (fun p => R p.1 (a (left p.1) p.2) (a (right p.1) p.2)) | |
| (fun p => Ξ½.nonnegative p.1) (fun p => hf (left p.1) p.2) | |
| (fun p => hf (right p.1) p.2) (pairQuadraticMass_eq_one Ξ½ left right f hrow) | |
| rw [pairGatedCorrelation_eq_energy, pairGatedMinimum_eq_overlap] at h | |
| exact h | |
| end | |
| end UniqueGamesTheorem.Repetition | |
| end | |
| section | |
| /-! | |
| The collision norm as an actual finite distribution on symmetrized edges. | |
| An edge retains the hidden common right question, while each label remains a | |
| function of its own left question. Projection uniqueness turns the sum over | |
| common right answers into a Boolean compatibility predicate exactly. | |
| -/ | |
| namespace UniqueGamesTheorem.Repetition.ProjectionKernel | |
| open Foundations.Games | |
| open scoped BigOperators | |
| noncomputable section | |
| attribute [local instance] Classical.propDecidable | |
| variable {Qβ Qβ Aβ Aβ Ξ© : Type*} | |
| [Fintype Qβ] [Fintype Qβ] [Fintype Aβ] [Fintype Aβ] [Fintype Ξ©] | |
| abbrev SymmetricEdge (Qβ Qβ : Type*) := Qβ Γ Qβ Γ Qβ | |
| def symmetricLeft (e : SymmetricEdge Qβ Qβ) : Qβ := e.2.1 | |
| def symmetricRight (e : SymmetricEdge Qβ Qβ) : Qβ := e.2.2 | |
| def symmetricDistribution (K : ProjectionKernel Qβ Qβ Aβ Aβ) : | |
| FiniteDistribution (SymmetricEdge Qβ Qβ) where | |
| weight e := K.outer.weight e.1 * (K.inner e.1).weight e.2.1 * | |
| (K.inner e.1).weight e.2.2 | |
| nonnegative e := mul_nonneg | |
| (mul_nonneg (K.outer.nonnegative _) ((K.inner _).nonnegative _)) | |
| ((K.inner _).nonnegative _) | |
| normalized := by | |
| rw [Fintype.sum_prod_type] | |
| calc | |
| _ = β y, K.outer.weight y := by | |
| apply Finset.sum_congr rfl | |
| intro y _ | |
| rw [Fintype.sum_prod_type] | |
| calc | |
| _ = β x, K.outer.weight y * (K.inner y).weight x := by | |
| apply Finset.sum_congr rfl | |
| intro x _ | |
| dsimp only | |
| rw [β Finset.mul_sum, (K.inner y).normalized, mul_one] | |
| _ = K.outer.weight y := by | |
| rw [β Finset.mul_sum, (K.inner y).normalized, mul_one] | |
| _ = 1 := K.outer.normalized | |
| def symmetricAccept (K : ProjectionKernel Qβ Qβ Aβ Aβ) | |
| (e : SymmetricEdge Qβ Qβ) (a a' : Aβ) : Bool := by | |
| classical | |
| exact decide (β b, K.accepts e.2.1 e.1 a b = true β§ | |
| K.accepts e.2.2 e.1 a' b = true) | |
| /-- A coordinate has one possible nonzero label at each question. -/ | |
| def singleLabelVector (a : Qβ β Ξ© β Aβ) (f : Qβ β Ξ© β β) | |
| (Ο : Ξ©) (x : Qβ) (b : Aβ) : β := by | |
| classical | |
| exact if a x Ο = b then f x Ο else 0 | |
| theorem sum_projection_gates (K : ProjectionKernel Qβ Qβ Aβ Aβ) | |
| (y : Qβ) (x x' : Qβ) (a a' : Aβ) (r s : β) : | |
| (β b, (if K.accepts x y a b then r else 0) * | |
| (if K.accepts x' y a' b then s else 0)) = | |
| if K.symmetricAccept (y, x, x') a a' then r * s else 0 := by | |
| classical | |
| by_cases hex : β b, K.accepts x y a b = true β§ K.accepts x' y a' b = true | |
| Β· obtain β¨bβ, hbβ, hbβ'β© := hex | |
| have hex' : β b, K.accepts x y a b = true β§ K.accepts x' y a' b = true := | |
| β¨bβ, hbβ, hbβ'β© | |
| simp only [symmetricAccept, hex', decide_true, ite_true] | |
| calc | |
| _ = (if K.accepts x y a bβ then r else 0) * | |
| (if K.accepts x' y a' bβ then s else 0) := by | |
| apply Finset.sum_eq_single bβ | |
| Β· intro b _ hne | |
| have hb : K.accepts x y a b β true := by | |
| intro hb | |
| exact hne (K.projection x y a b bβ hb hbβ) | |
| simp [hb] | |
| Β· simp | |
| _ = r * s := by simp [hbβ, hbβ'] | |
| Β· simp only [symmetricAccept, hex, decide_false, Bool.false_eq_true, ite_false] | |
| apply Finset.sum_eq_zero | |
| intro b _ | |
| by_cases hb : K.accepts x y a b = true | |
| Β· have hb' : K.accepts x' y a' b β true := fun hb' => hex β¨b, hb, hb'β© | |
| simp [hb'] | |
| Β· simp [hb] | |
| theorem apply_single_label (K : ProjectionKernel Qβ Qβ Aβ Aβ) | |
| (labels : Qβ β Aβ) (f : Qβ β β) (y : Qβ) (b : Aβ) : | |
| K.apply (fun x a => if labels x = a then f x else 0) y b = | |
| β x, (K.inner y).weight x * (if K.accepts x y (labels x) b then f x else 0) := by | |
| classical | |
| unfold apply | |
| apply Finset.sum_congr rfl | |
| intro x _ | |
| congr 1 | |
| calc | |
| _ = β a, if labels x = a then | |
| (if K.accepts x y (labels x) b then f x else 0) else 0 := by | |
| apply Finset.sum_congr rfl | |
| intro a _ | |
| by_cases ha : labels x = a | |
| Β· subst a | |
| simp | |
| Β· simp [ha] | |
| _ = _ := by simp | |
| theorem energy_single_label (K : ProjectionKernel Qβ Qβ Aβ Aβ) | |
| (labels : Qβ β Aβ) (f : Qβ β β) : | |
| K.energy (fun x a => if labels x = a then f x else 0) = | |
| K.symmetricDistribution.expectation (fun e => | |
| if K.symmetricAccept e (labels (symmetricLeft e)) (labels (symmetricRight e)) | |
| then f (symmetricLeft e) * f (symmetricRight e) else 0) := by | |
| classical | |
| have hexpand (y : Qβ) : | |
| (β b, (β x, (K.inner y).weight x * | |
| (if K.accepts x y (labels x) b then f x else 0)) ^ 2) = | |
| β x, β x', (K.inner y).weight x * (K.inner y).weight x' * | |
| (if K.symmetricAccept (y, x, x') (labels x) (labels x') | |
| then f x * f x' else 0) := by | |
| simp only [pow_two, Finset.sum_mul, Finset.mul_sum] | |
| rw [Finset.sum_comm] | |
| apply Finset.sum_congr rfl | |
| intro x _ | |
| rw [Finset.sum_comm] | |
| apply Finset.sum_congr rfl | |
| intro x' _ | |
| calc | |
| _ = (K.inner y).weight x * (K.inner y).weight x' * | |
| β b, (if K.accepts x y (labels x) b then f x else 0) * | |
| (if K.accepts x' y (labels x') b then f x' else 0) := by | |
| rw [Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro b _ | |
| ring | |
| _ = _ := by rw [K.sum_projection_gates] | |
| unfold energy | |
| simp_rw [K.apply_single_label, hexpand] | |
| simp only [FiniteDistribution.expectation, symmetricDistribution, | |
| Fintype.sum_prod_type, symmetricLeft, symmetricRight, Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro y _ | |
| apply Finset.sum_congr rfl | |
| intro x _ | |
| apply Finset.sum_congr rfl | |
| intro x' _ | |
| simp only [mul_assoc] | |
| rfl | |
| /-- Coordinate expansion and the symmetrized edge law agree exactly. -/ | |
| theorem vectorEnergy_singleLabelVector (K : ProjectionKernel Qβ Qβ Aβ Aβ) | |
| (a : Qβ β Ξ© β Aβ) (f : Qβ β Ξ© β β) : | |
| K.vectorEnergy (singleLabelVector a f) = | |
| pairEnergy K.symmetricDistribution symmetricLeft symmetricRight K.symmetricAccept a f := by | |
| classical | |
| unfold vectorEnergy singleLabelVector | |
| simp_rw [K.energy_single_label] | |
| unfold pairEnergy FiniteDistribution.expectation | |
| rw [Finset.sum_comm] | |
| apply Finset.sum_congr rfl | |
| intro e _ | |
| rw [Finset.mul_sum] | |
| /-- Ordinary deterministic labelings give the collision assignment energy. -/ | |
| theorem symmetric_probability_eq_assignmentEnergy (K : ProjectionKernel Qβ Qβ Aβ Aβ) | |
| (labels : Qβ β Aβ) : | |
| K.symmetricDistribution.probability (fun e => | |
| K.symmetricAccept e (labels (symmetricLeft e)) (labels (symmetricRight e))) = | |
| K.assignmentEnergy labels := by | |
| classical | |
| change _ = K.energy (fun x a => if labels x = a then (1 : β) else 0) | |
| rw [K.energy_single_label] | |
| simp only [FiniteDistribution.probability, FiniteDistribution.expectation, | |
| mul_ite, mul_one, mul_zero] | |
| end | |
| end UniqueGamesTheorem.Repetition.ProjectionKernel | |
| end | |
| section | |
| /-! | |
| Apply finite positive-vector determinization to the actual projection kernel. | |
| The target coordinates retain both the right question and the right answer. | |
| The selected label may depend on the auxiliary coordinate, but only on its own | |
| left question. Every question's squared vector mass is preserved exactly. | |
| -/ | |
| namespace UniqueGamesTheorem.Repetition.ProjectionKernel | |
| open scoped BigOperators | |
| noncomputable section | |
| attribute [local instance] Classical.propDecidable | |
| variable {Qβ Qβ Aβ Aβ Ξ© : Type*} | |
| [Fintype Qβ] [Fintype Qβ] [Fintype Aβ] [Fintype Aβ] [Fintype Ξ©] | |
| /-- Explicit matrix coefficients of the projection operator. -/ | |
| def linearCoefficient (K : ProjectionKernel Qβ Qβ Aβ Aβ) | |
| (t : Qβ Γ Aβ) (x : Qβ) (a : Aβ) : β := | |
| (K.inner t.1).weight x * (if K.accepts x t.1 a t.2 then 1 else 0) | |
| theorem apply_eq_linearCoefficient_sum (K : ProjectionKernel Qβ Qβ Aβ Aβ) | |
| (h : Qβ β Aβ β β) (y : Qβ) (b : Aβ) : | |
| K.apply h y b = β x, β a, K.linearCoefficient (y, b) x a * h x a := by | |
| unfold apply | |
| simp_rw [Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro x _ | |
| apply Finset.sum_congr rfl | |
| intro a _ | |
| by_cases ha : K.accepts x y a b = true <;> simp [linearCoefficient, ha] | |
| theorem energy_eq_linearCoefficient_sum (K : ProjectionKernel Qβ Qβ Aβ Aβ) | |
| (h : Qβ β Aβ β β) : | |
| K.energy h = β t : Qβ Γ Aβ, K.outer.weight t.1 * | |
| (β x, β a, K.linearCoefficient t x a * h x a) ^ 2 := by | |
| rw [Fintype.sum_prod_type] | |
| simp_rw [β K.apply_eq_linearCoefficient_sum, β Finset.mul_sum] | |
| rfl | |
| /-- Scalar kernel determinization preserves the whole mass at every question. -/ | |
| theorem exists_energy_le_deterministicVector [Nonempty Aβ] | |
| (K : ProjectionKernel Qβ Qβ Aβ Aβ) | |
| (h : Qβ β Aβ β β) (hh : β x a, 0 β€ h x a) : | |
| β labels : Qβ β Aβ, | |
| K.energy h β€ K.energy (deterministicVector h labels) := by | |
| classical | |
| obtain β¨labels, _, _, hlabelsβ© := exists_deterministic_vector h hh | |
| (fun t : Qβ Γ Aβ => K.outer.weight t.1) | |
| (fun t => K.outer.nonnegative t.1) K.linearCoefficient | |
| refine β¨labels, ?_β© | |
| rw [K.energy_eq_linearCoefficient_sum, K.energy_eq_linearCoefficient_sum] | |
| exact hlabels | |
| /-- The amplitude at a question is the sum of its original label entries. -/ | |
| def vectorAmplitude (h : Ξ© β Qβ β Aβ β β) (x : Qβ) (Ο : Ξ©) : β := | |
| rowMass (h Ο) x | |
| omit [Fintype Qβ] [Fintype Ξ©] in | |
| theorem vectorAmplitude_nonnegative (h : Ξ© β Qβ β Aβ β β) | |
| (hh : β Ο x a, 0 β€ h Ο x a) (x : Qβ) (Ο : Ξ©) : | |
| 0 β€ vectorAmplitude h x Ο := | |
| rowMass_nonnegative (h Ο) (hh Ο) x | |
| omit [Fintype Qβ] in | |
| @[simp] theorem rowSquareMass_vectorAmplitude (h : Ξ© β Qβ β Aβ β β) (x : Qβ) : | |
| rowSquareMass (vectorAmplitude h) x = vectorMass h x := rfl | |
| /-- Auxiliary coordinates are determinized separately; they need not be | |
| independent, normalized, or nonempty. -/ | |
| theorem exists_vectorEnergy_le_singleLabelVector [Nonempty Aβ] | |
| (K : ProjectionKernel Qβ Qβ Aβ Aβ) | |
| (h : Ξ© β Qβ β Aβ β β) (hh : β Ο x a, 0 β€ h Ο x a) : | |
| β labels : Qβ β Ξ© β Aβ, | |
| K.vectorEnergy h β€ K.vectorEnergy (singleLabelVector labels (vectorAmplitude h)) := by | |
| classical | |
| have hex (Ο : Ξ©) := K.exists_energy_le_deterministicVector (h Ο) (hh Ο) | |
| let labels (Ο : Ξ©) : Qβ β Aβ := Classical.choose (hex Ο) | |
| have hlabels (Ο : Ξ©) : K.energy (h Ο) β€ | |
| K.energy (deterministicVector (h Ο) (labels Ο)) := Classical.choose_spec (hex Ο) | |
| refine β¨fun x Ο => labels Ο x, ?_β© | |
| apply Finset.sum_le_sum | |
| intro Ο _ | |
| have heq : deterministicVector (h Ο) (labels Ο) = | |
| singleLabelVector (fun x Ο => labels Ο x) (vectorAmplitude h) Ο := by | |
| funext x a | |
| by_cases ha : a = labels Ο x | |
| Β· simp [deterministicVector, singleLabelVector, vectorAmplitude, ha] | |
| Β· simp [deterministicVector, singleLabelVector, ha, Ne.symm ha] | |
| exact heq βΈ hlabels Ο | |
| /-- Package the deterministic labels, amplitudes, exact mass preservation, and | |
| energy inequality for use by the finite threshold-rounding construction. -/ | |
| theorem exists_mass_preserving_singleLabelVector [Nonempty Aβ] | |
| (K : ProjectionKernel Qβ Qβ Aβ Aβ) | |
| (h : Ξ© β Qβ β Aβ β β) (hh : β Ο x a, 0 β€ h Ο x a) : | |
| β (labels : Qβ β Ξ© β Aβ) (f : Qβ β Ξ© β β), | |
| (β x Ο, 0 β€ f x Ο) β§ | |
| (β x, rowSquareMass f x = vectorMass h x) β§ | |
| K.vectorEnergy h β€ K.vectorEnergy (singleLabelVector labels f) := by | |
| obtain β¨labels, hlabelsβ© := K.exists_vectorEnergy_le_singleLabelVector h hh | |
| exact β¨labels, vectorAmplitude h, vectorAmplitude_nonnegative h hh, | |
| rowSquareMass_vectorAmplitude h, hlabelsβ© | |
| end | |
| end UniqueGamesTheorem.Repetition.ProjectionKernel | |
| end | |
| end OAI | |