Download data/lean/OAI/Computability/UniqueGames/Decoding/ActualSpectralLemmas.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 25.2 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/UniqueGames/Decoding/ActualSpectralLemmas.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Computability/UniqueGames/Decoding/ActualSpectralLemmas.lean
-
curl -L -o ActualSpectralLemmas.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/UniqueGames/Decoding/ActualSpectralLemmas.lean
25.2 kB
| import Mathlib.Algebra.BigOperators.Field | |
| import OAI.Computability.UniqueGames.Decoding.AdviceFibersLemmas | |
| import OAI.Computability.UniqueGames.Decoding.DimensionSelection | |
| import OAI.Computability.UniqueGames.Decoding.MatrixCoordinates | |
| import OAI.Computability.UniqueGames.Decoding.PrivateStrategyLemmas | |
| import OAI.Computability.UniqueGames.Decoding.SparseLawLemmas | |
| import OAI.Computability.UniqueGames.Decoding.TableKeysGame | |
| import OAI.Computability.UniqueGames.Foundations.SamplingLemmas | |
| import OAI.Computability.UniqueGames.Inverse.KMSAnalyticHybridEnergyLemmas | |
| import OAI.Computability.UniqueGames.Inverse.RowErasureMatrixLemmas | |
| import OAI.Computability.UniqueGames.Reduction.ActualSourceLemmas | |
| namespace OAI | |
| section | |
| noncomputable section | |
| open scoped BigOperators Classical | |
| open UniqueGamesTheorem.Integration.BinaryLinear | |
| open UniqueGamesTheorem.Reduction UniqueGamesTheorem.Reduction.ActualSource | |
| open UniqueGamesTheorem.Fourier.MatrixNoise | |
| namespace UniqueGamesTheorem.Decoder.ActualSpectral | |
| open TableKeysGame PositiveMultiplier NoiseSampler SurrogateFibers | |
| local instance homFintype {D F : Type*} | |
| [AddCommGroup D] [Module F2 D] [AddCommGroup F] [Module F2 F] | |
| [Fintype D] [Fintype F] : Fintype (D ββ[F2] F) := | |
| Fintype.ofInjective (fun M : D ββ[F2] F => (M : D β F)) DFunLike.coe_injective | |
| theorem expect_prod {A B : Type*} [Fintype A] [Fintype B] (f : A Γ B β β) : | |
| (πΌ p, f p) = πΌ a, πΌ b, f (a, b) := by | |
| simpa only [Finset.univ_product_univ] using | |
| (Finset.expect_product Finset.univ Finset.univ f) | |
| theorem expect_eq_uniform_sum {I : Type*} [Fintype I] (f : I β β) : | |
| (πΌ i, f i) = β i, (Fintype.card I : β)β»ΒΉ * f i := by | |
| rw [Fintype.expect_eq_sum_div_card, β Finset.mul_sum] | |
| ring | |
| /-- The finite noise law's multiplier is exactly the rational kernel event | |
| of the same gadget, cast to the real numbers. -/ | |
| theorem eigenvalue_eq_kernelProbability {s d : Nat} (g : SplitGadget s d) | |
| {P : Type} [AddCommGroup P] [Module F2 P] (S : Ambient s d ββ[F2] P) : | |
| linearNoiseEigenvalue (samplerLaw g.noise) S = | |
| (Integration.SplitGadget.kernelProbability g S : β) := by | |
| rw [β sample_kernel_eq_eigenvalue] | |
| unfold Integration.SplitGadget.kernelProbability | |
| rw [rat_expect_cast] | |
| simp only [apply_ite, Rat.cast_one, Rat.cast_zero] | |
| /-- The four independent samples of the actual single-orbit test. -/ | |
| theorem acceptance_nested (S : Source) (k : Nat) {s d : Nat} | |
| (g : SplitGadget s d) (label : Fin (vertexCount S k s d) β Fin (2 ^ s)) : | |
| (acceptanceProbability S k g label : β) = | |
| πΌ U : Question S k, πΌ X : Map k s d, πΌ i : g.NoiseIndex, πΌ l : Dual k, | |
| if unfolded S k s d label (U, X) = | |
| unfolded S k s d label (U, X + l.smulRight (g.noise i)) | |
| then (1 : β) else 0 := by | |
| rw [acceptanceProbability_eq_test, rat_expect_cast] | |
| simp only [apply_ite, Rat.cast_one, Rat.cast_zero] | |
| simp only [expect_prod, leftQuery, rightQuery, ActualGame.leftQuery, ActualGame.rightQuery] | |
| apply Finset.expect_congr rfl | |
| intro U _ | |
| apply Finset.expect_congr rfl | |
| intro X _ | |
| apply Finset.expect_congr rfl | |
| intro i _ | |
| apply Finset.expect_congr rfl | |
| intro l _ | |
| by_cases h : unfolded S k s d label (U, X) = | |
| unfolded S k s d label (U, X + l.smulRight (g.noise i)) <;> simp [h] | |
| /-- No auxiliary side labeling is introduced: the same restored table occurs | |
| on both sides of the actual equality test. -/ | |
| theorem acceptance_eq_equality_mean (S : Source) (k : Nat) {s d : Nat} | |
| (g : SplitGadget s d) (label : Fin (vertexCount S k s d) β Fin (2 ^ s)) : | |
| (acceptanceProbability S k g label : β) = | |
| πΌ U : Question S k, | |
| equalityAcceptance (samplerLaw g.noise) (fun X : Map k s d => | |
| unfolded S k s d label (U, X)) := by | |
| rw [acceptance_nested] | |
| apply Finset.expect_congr rfl | |
| intro U _ | |
| unfold equalityAcceptance | |
| apply Finset.expect_congr rfl | |
| intro X _ | |
| rw [β sample_expect_eq] | |
| apply Finset.expect_congr rfl | |
| intro i _ | |
| apply Finset.expect_congr rfl | |
| intro l _ | |
| split_ifs <;> rfl | |
| def fiberAcceptance (S : Source) (k s d : Nat) | |
| (label : Fin (vertexCount S k s d) β Fin (2 ^ s)) | |
| (U : Question S k) (T : ActualHomogeneous.E k ββ[F2] Vector d) : β := | |
| shortcodeAcceptance (fun M : ActualHomogeneous.E k ββ[F2] Alphabet s => | |
| unfolded S k s d label (U, M.prod T)) | |
| theorem fiberAcceptance_le_one (S : Source) (k s d : Nat) | |
| (label : Fin (vertexCount S k s d) β Fin (2 ^ s)) | |
| (U : Question S k) (T : ActualHomogeneous.E k ββ[F2] Vector d) : | |
| fiberAcceptance S k s d label U T β€ 1 := by | |
| unfold fiberAcceptance shortcodeAcceptance | |
| apply Finset.expect_le Finset.univ_nonempty | |
| intro M _ | |
| apply Finset.expect_le Finset.univ_nonempty | |
| intro a _ | |
| apply Finset.expect_le Finset.univ_nonempty | |
| intro l _ | |
| split_ifs <;> norm_num | |
| theorem weighted_fiber_mean_lower (S : Source) (k : Nat) {s d : Nat} | |
| (g : SplitGadget s d) (label : Fin (vertexCount S k s d) β Fin (2 ^ s)) | |
| (ΞΌ : Question S k β β) (r : Nat) | |
| (hΞΌ : β U, 0 β€ ΞΌ U) (hΞΌsum : β U, ΞΌ U = 1) | |
| (hkernel : β L : Ambient s d ββ[F2] ActualHomogeneous.E k, | |
| r β€ Module.finrank F2 (L.comp (alphabetEmbedding s d)).range β | |
| Integration.SplitGadget.kernelProbability g L β€ 7 / 8) | |
| (haccept : (99 : β) / 100 β€ β U, ΞΌ U * | |
| equalityAcceptance (samplerLaw g.noise) | |
| (fun X : Map k s d => unfolded S k s d label (U, X))) : | |
| (9 : β) / 10 * ((2 : β) ^ r)β»ΒΉ β€ | |
| β U, ΞΌ U * (πΌ T, fiberAcceptance S k s d label U T) := by | |
| have h := matrix_spectral_comparison ΞΌ (samplerLaw g.noise) (alphabetEmbedding s d) | |
| (fun U (X : Map k s d) => unfolded S k s d label (U, X)) r | |
| hΞΌ hΞΌsum (samplerLaw_nonneg g.noise) (samplerLaw_normalized g.noise) | |
| (fun L hL => by | |
| rw [eigenvalue_eq_kernelProbability] | |
| have hc := (Rat.cast_le (K := β)).mpr (hkernel L hL) | |
| simpa only [Rat.cast_div, Rat.cast_ofNat] using hc) haccept | |
| simpa only [alphabetEmbedding, surrogate_acceptance_eq_fiber_average, | |
| fiberAcceptance] using h | |
| theorem actual_fiber_mean_lower (S : Source) (k : Nat) {s d : Nat} | |
| (g : SplitGadget s d) (label : Fin (vertexCount S k s d) β Fin (2 ^ s)) (r : Nat) | |
| (hkernel : β L : Ambient s d ββ[F2] ActualHomogeneous.E k, | |
| r β€ Module.finrank F2 (L.comp (alphabetEmbedding s d)).range β | |
| Integration.SplitGadget.kernelProbability g L β€ 7 / 8) | |
| (haccept : (99 : β) / 100 β€ acceptanceProbability S k g label) : | |
| (9 : β) / 10 * ((2 : β) ^ r)β»ΒΉ β€ | |
| πΌ U : Question S k, πΌ T, fiberAcceptance S k s d label U T := by | |
| rw [expect_eq_uniform_sum] | |
| apply weighted_fiber_mean_lower S k g label | |
| (fun _ => (Fintype.card (Question S k) : β)β»ΒΉ) r | |
| Β· intro U | |
| positivity | |
| Β· rw [Finset.sum_const, Finset.card_univ, nsmul_eq_mul] | |
| apply mul_inv_cancelβ | |
| exact_mod_cast Fintype.card_ne_zero (Ξ± := Question S k) | |
| Β· exact hkernel | |
| Β· have hc := (Rat.cast_le (K := β)).mpr haccept | |
| rw [acceptance_eq_equality_mean, expect_eq_uniform_sum] at hc | |
| simpa only [Rat.cast_div, Rat.cast_ofNat] using hc | |
| def eta (r : Nat) : β := ((2 : β) ^ r)β»ΒΉ / 16 | |
| theorem eta_pos (r : Nat) : 0 < eta r := by unfold eta; positivity | |
| /-- At least `10 Ξ·` of the actual `(U,T)` pairs have shortcode acceptance | |
| at least `4 Ξ·`, exactly the input needed by row erasure. -/ | |
| theorem actual_good_fiber_mass (S : Source) (k : Nat) {s d : Nat} | |
| (g : SplitGadget s d) (label : Fin (vertexCount S k s d) β Fin (2 ^ s)) (r : Nat) | |
| (hkernel : β L : Ambient s d ββ[F2] ActualHomogeneous.E k, | |
| r β€ Module.finrank F2 (L.comp (alphabetEmbedding s d)).range β | |
| Integration.SplitGadget.kernelProbability g L β€ 7 / 8) | |
| (haccept : (99 : β) / 100 β€ acceptanceProbability S k g label) : | |
| 10 * eta r β€ πΌ U : Question S k, | |
| πΌ T : ActualHomogeneous.E k ββ[F2] Vector d, | |
| if 4 * eta r β€ fiberAcceptance S k s d label U T then (1 : β) else 0 := by | |
| let I := Question S k Γ (ActualHomogeneous.E k ββ[F2] Vector d) | |
| let ΞΌ : I β β := fun _ => (Fintype.card I : β)β»ΒΉ | |
| let p : I β β := fun a => fiberAcceptance S k s d label a.1 a.2 | |
| have hmean := actual_fiber_mean_lower S k g label r hkernel haccept | |
| have hmean' : (72 : β) / 5 * eta r β€ β a, ΞΌ a * p a := by | |
| rw [β expect_eq_uniform_sum, expect_prod] | |
| unfold eta | |
| nlinarith | |
| have h := good_fiber_mass ΞΌ p (eta r) (fun _ => by positivity) | |
| (by simp [ΞΌ, Fintype.card_ne_zero]) (eta_pos r).le | |
| (fun a => fiberAcceptance_le_one S k s d label a.1 a.2) hmean' | |
| change 10 * eta r β€ | |
| β a : Question S k Γ (ActualHomogeneous.E k ββ[F2] Vector d), | |
| (Fintype.card (Question S k Γ (ActualHomogeneous.E k ββ[F2] Vector d)) : β)β»ΒΉ * | |
| (if 4 * eta r β€ fiberAcceptance S k s d label a.1 a.2 then 1 else 0) at h | |
| rw [β expect_eq_uniform_sum, expect_prod] at h | |
| exact h | |
| end UniqueGamesTheorem.Decoder.ActualSpectral | |
| end | |
| end | |
| section | |
| namespace UniqueGamesTheorem.Decoder.ActualGoodRows | |
| open Integration.BinaryLinear Reduction ActualSource | |
| open Inverse Inverse.RowErasure | |
| open Inverse.Shortcode (Mat HasAffineSlice) | |
| open scoped BigOperators Classical | |
| noncomputable section | |
| local instance homFintype {D F : Type*} | |
| [AddCommGroup D] [Module F2 D] [AddCommGroup F] [Module F2 F] | |
| [Fintype D] [Fintype F] : Fintype (D ββ[F2] F) := | |
| Fintype.ofInjective (fun M : D ββ[F2] F => (M : D β F)) DFunLike.coe_injective | |
| def table (S : Source) (k s d : β) | |
| (labeling : Fin (TableKeysGame.vertexCount S k s d) β Fin (2 ^ s)) | |
| (U : ActualGame.Question S k) (T : ActualHomogeneous.E k ββ[F2] Vector d) | |
| (M : Mat s (1 + 2 * k)) : Vector s := | |
| TableKeysGame.unfolded S k s d labeling | |
| (U, ((MatrixCoordinates.mapEquiv k s).symm M).prod T) | |
| theorem table_acceptance (S : Source) (k s d : β) | |
| (labeling : Fin (TableKeysGame.vertexCount S k s d) β Fin (2 ^ s)) | |
| (U : ActualGame.Question S k) (T : ActualHomogeneous.E k ββ[F2] Vector d) : | |
| Shortcode.equalityAcceptance (table S k s d labeling U T) = | |
| ActualSpectral.fiberAcceptance S k s d labeling U T := by | |
| unfold table | |
| rw [β MatrixCoordinates.shortcodeAcceptance_eq k s | |
| (fun M : ActualHomogeneous.E k ββ[F2] Vector s => | |
| TableKeysGame.unfolded S k s d labeling (U, M.prod T))] | |
| unfold ActualSpectral.fiberAcceptance SurrogateFibers.shortcodeAcceptance | |
| apply Finset.expect_congr (by ext M; simp only [Finset.mem_univ]) | |
| intro M _ | |
| apply Finset.expect_congr (by ext a; simp only [Finset.mem_univ]) | |
| intro a _ | |
| apply Finset.expect_congr (by ext l; simp only [Finset.mem_univ]) | |
| intro l _ | |
| rfl | |
| /-- The row-advice probability in actual matrix coordinates. In particular, | |
| dependent rows of `A` are sampled with their full multiplicity. -/ | |
| def adviceMass (S : Source) (k s d r : β) | |
| (labeling : Fin (TableKeysGame.vertexCount S k s d) β Fin (2 ^ s)) (Ξ± : β) : β := | |
| πΌ U : ActualGame.Question S k, | |
| πΌ T : ActualHomogeneous.E k ββ[F2] Vector d, | |
| RowErasure.adviceMass | |
| ((RowErasureMatrix.family s (1 + 2 * k) r).goodAt (table S k s d labeling U T) Ξ±) | |
| def goodRowMass (rstar s r : β) : β := | |
| 10 * ActualSpectral.eta rstar ^ 2 / (2 : β) ^ (s * r) | |
| theorem goodRowMass_pos (rstar s r : β) : 0 < goodRowMass rstar s r := by | |
| unfold goodRowMass | |
| have h := ActualSpectral.eta_pos rstar | |
| positivity | |
| theorem exists_actual_advice_threshold (rstar : β) (Ξ± : β) | |
| (hΞ± : 0 < Ξ±) (hΞ±one : Ξ± β€ 1) (s r : β) | |
| (hr : r < s) (halphabet : 1 / (2 : β) ^ s β€ Ξ± / 8) : | |
| β kβ : β, β k : β, kβ β€ k β | |
| (β f : Mat s (1 + 2 * k) β Vector s, | |
| ActualSpectral.eta rstar β€ Shortcode.equalityAcceptance f β HasAffineSlice f Ξ± r) β | |
| β (S : Source) (d : β) (g : SplitGadget s d) | |
| (labeling : Fin (TableKeysGame.vertexCount S k s d) β Fin (2 ^ s)), | |
| (β L : Ambient s d ββ[F2] ActualHomogeneous.E k, | |
| rstar β€ Module.finrank F2 (L.comp (alphabetEmbedding s d)).range β | |
| Integration.SplitGadget.kernelProbability g L β€ 7 / 8) β | |
| (99 : β) / 100 β€ TableKeysGame.acceptanceProbability S k g labeling β | |
| goodRowMass rstar s r β€ adviceMass S k s d r labeling Ξ± := by | |
| obtain β¨mβ, hmββ© := RowErasureMatrix.exists_contextual_advice_threshold | |
| (ActualSpectral.eta rstar) Ξ± (ActualSpectral.eta_pos rstar) hΞ± hΞ±one | |
| s r hr halphabet | |
| refine β¨mβ, ?_β© | |
| intro k hk hinverse S d g labeling hkernel haccept | |
| let Q := ActualGame.Question S k Γ (ActualHomogeneous.E k ββ[F2] Vector d) | |
| let f : Q β Mat s (1 + 2 * k) β Vector s := | |
| fun q => table S k s d labeling q.1 q.2 | |
| have hcontext : 10 * ActualSpectral.eta rstar β€ | |
| uniformMass (fun q : Q => 4 * ActualSpectral.eta rstar β€ | |
| Shortcode.equalityAcceptance (f q)) := by | |
| have h := ActualSpectral.actual_good_fiber_mass S k g labeling rstar hkernel haccept | |
| dsimp only [Q, f] | |
| unfold uniformMass | |
| rw [ActualSpectral.expect_prod] | |
| simpa only [indicator, table_acceptance] using h | |
| have h := hmβ (1 + 2 * k) (by omega) hinverse Q f hcontext | |
| dsimp only [Q, f] at h | |
| rw [ActualSpectral.expect_prod] at h | |
| simpa only [goodRowMass, adviceMass] using h | |
| end | |
| end UniqueGamesTheorem.Decoder.ActualGoodRows | |
| end | |
| section | |
| /-! The two full-table events used in the projected-witness transfer. Their | |
| sample space contains actual occurrence tuples and complete affine tables, | |
| but no projection choice. The selected witness depends on row advice only. | |
| -/ | |
| namespace UniqueGamesTheorem.Decoder.ActualEvents | |
| open Integration.BinaryLinear Reduction ActualSource Foundations.Games | |
| open Inverse Inverse.RowErasure | |
| open Inverse.Shortcode (Mat) | |
| open scoped BigOperators Classical | |
| noncomputable section | |
| local instance homFintype {D F : Type*} | |
| [AddCommGroup D] [Module F2 D] [AddCommGroup F] [Module F2 F] | |
| [Fintype D] [Fintype F] : Fintype (D ββ[F2] F) := | |
| Fintype.ofInjective (fun M : D ββ[F2] F => (M : D β F)) DFunLike.coe_injective | |
| abbrev Context (S : Source) (k d : β) := | |
| ActualGame.Question S k Γ (ActualHomogeneous.E k ββ[F2] Vector d) | |
| abbrev Sample (S : Source) (k s d r : β) := | |
| Context S k d Γ (RowErasureDescriptions.RowMap s r Γ Mat s (1 + 2 * k)) | |
| abbrev FullTableSample (S : Source) (k s d r : β) := | |
| (ActualGame.Question S k Γ (Alphabet s ββ[F2] Vector r)) Γ ActualGame.Map k s d | |
| /-- A bijection merely rearranges the full sampled table and changes its | |
| matrix coordinates. It never appends the hidden projection to this law. -/ | |
| def fullTableEquiv (S : Source) (k s d r : β) : | |
| FullTableSample S k s d r β Sample S k s d r where | |
| toFun p := ((p.1.1, (LinearMap.snd F2 (Alphabet s) (Vector d)).comp p.2), | |
| (LinearMap.toMatrix' p.1.2, | |
| MatrixCoordinates.mapEquiv k s ((LinearMap.fst F2 (Alphabet s) (Vector d)).comp p.2))) | |
| invFun q := ((q.1.1, Matrix.toLin' q.2.1), | |
| ((MatrixCoordinates.mapEquiv k s).symm q.2.2).prod q.1.2) | |
| left_inv p := by | |
| rcases p with β¨β¨U, Aβ©, Pβ© | |
| apply Prod.ext | |
| Β· simp | |
| Β· apply LinearMap.ext | |
| intro x | |
| simp only [LinearEquiv.symm_apply_apply, LinearMap.prod_apply] | |
| rfl | |
| right_inv q := by | |
| rcases q with β¨β¨U, Tβ©, A, Mβ© | |
| apply Prod.ext | |
| Β· apply Prod.ext rfl | |
| apply LinearMap.ext | |
| intro x | |
| rfl | |
| Β· apply Prod.ext | |
| Β· exact LinearMap.toMatrix'_toLin' A | |
| Β· change MatrixCoordinates.mapEquiv k s | |
| ((LinearMap.fst F2 (Alphabet s) (Vector d)).comp | |
| (((MatrixCoordinates.mapEquiv k s).symm M).prod T)) = M | |
| have hf : (LinearMap.fst F2 (Alphabet s) (Vector d)).comp | |
| (((MatrixCoordinates.mapEquiv k s).symm M).prod T) = | |
| (MatrixCoordinates.mapEquiv k s).symm M := by | |
| apply LinearMap.ext | |
| intro x | |
| rfl | |
| rw [hf, LinearEquiv.apply_symm_apply] | |
| def unrestricted (S : Source) (k s d r : β) : FiniteDistribution (Sample S k s d r) := | |
| FiniteDistribution.uniform _ | |
| def sliceEvent (S : Source) (k s d r : β) | |
| (labeling : Fin (TableKeysGame.vertexCount S k s d) β Fin (2 ^ s)) | |
| (Ξ± : β) (p : Sample S k s d r) : Bool := | |
| decide ((RowErasureMatrix.family s (1 + 2 * k) r).selectedEvent | |
| (ActualGoodRows.table S k s d labeling p.1.1 p.1.2) Ξ± p.2.1 p.2.2) | |
| def targetHit (S : Source) (k s d r : β) | |
| (labeling : Fin (TableKeysGame.vertexCount S k s d) β Fin (2 ^ s)) | |
| (Ξ± : β) (p : Sample S k s d r) : Bool := | |
| decide ((RowErasureMatrix.family s (1 + 2 * k) r).selectedMatch | |
| (ActualGoodRows.table S k s d labeling p.1.1 p.1.2) Ξ± p.2.1 p.2.2) | |
| theorem targetHit_implies_slice (S : Source) (k s d r : β) | |
| (labeling : Fin (TableKeysGame.vertexCount S k s d) β Fin (2 ^ s)) | |
| (Ξ± : β) (p : Sample S k s d r) | |
| (h : targetHit S k s d r labeling Ξ± p = true) : | |
| sliceEvent S k s d r labeling Ξ± p = true := by | |
| exact of_decide_eq_true h |> fun hm => decide_eq_true | |
| ((RowErasureMatrix.family s (1 + 2 * k) r).selectedMatch_event _ Ξ± _ _ hm) | |
| theorem uniform_probability_expect {Ξ© : Type*} [Fintype Ξ©] [Nonempty Ξ©] | |
| (p : Ξ© β Bool) : | |
| (FiniteDistribution.uniform Ξ©).probability p = | |
| πΌ x : Ξ©, if p x then (1 : β) else 0 := by | |
| simp only [FiniteDistribution.probability, FiniteDistribution.uniform, | |
| Fintype.expect_eq_sum_div_card, Finset.sum_div, ite_div, one_div, zero_div] | |
| theorem unrestricted_slice_mass (S : Source) (k s d r : β) | |
| (labeling : Fin (TableKeysGame.vertexCount S k s d) β Fin (2 ^ s)) (Ξ± : β) : | |
| (unrestricted S k s d r).probability (sliceEvent S k s d r labeling Ξ±) = | |
| πΌ q : Context S k d, | |
| RowErasureMatrix.selectedEventMass r | |
| (ActualGoodRows.table S k s d labeling q.1 q.2) Ξ± := by | |
| unfold unrestricted | |
| rw [uniform_probability_expect, ActualSpectral.expect_prod] | |
| apply Finset.expect_congr rfl | |
| intro q _ | |
| rw [ActualSpectral.expect_prod] | |
| simp only [sliceEvent, RowErasureMatrix.selectedEventMass, uniformMass, indicator, | |
| decide_eq_true_eq] | |
| theorem unrestricted_match_mass (S : Source) (k s d r : β) | |
| (labeling : Fin (TableKeysGame.vertexCount S k s d) β Fin (2 ^ s)) (Ξ± : β) : | |
| (unrestricted S k s d r).probability | |
| (fun p => sliceEvent S k s d r labeling Ξ± p && targetHit S k s d r labeling Ξ± p) = | |
| πΌ q : Context S k d, | |
| RowErasureMatrix.selectedMatchMass r | |
| (ActualGoodRows.table S k s d labeling q.1 q.2) Ξ± := by | |
| have he : (fun p => sliceEvent S k s d r labeling Ξ± p && targetHit S k s d r labeling Ξ± p) = | |
| targetHit S k s d r labeling Ξ± := by | |
| funext p | |
| by_cases h : targetHit S k s d r labeling Ξ± p = true | |
| Β· simp [h, targetHit_implies_slice S k s d r labeling Ξ± p h] | |
| Β· simp [Bool.eq_false_iff.mpr h] | |
| rw [he] | |
| unfold unrestricted | |
| rw [uniform_probability_expect, ActualSpectral.expect_prod] | |
| apply Finset.expect_congr rfl | |
| intro q _ | |
| rw [ActualSpectral.expect_prod] | |
| simp only [targetHit, RowErasureMatrix.selectedMatchMass, uniformMass, indicator, | |
| decide_eq_true_eq] | |
| /-- The full-table slice event pays exactly one bounded column-fiber factor. -/ | |
| theorem slice_probability_lower (S : Source) (k s d r : β) | |
| (labeling : Fin (TableKeysGame.vertexCount S k s d) β Fin (2 ^ s)) (Ξ± gβ : β) | |
| (hgood : gβ β€ ActualGoodRows.adviceMass S k s d r labeling Ξ±) : | |
| gβ * (1 / (2 : β) ^ (s * r)) β€ | |
| (unrestricted S k s d r).probability (sliceEvent S k s d r labeling Ξ±) := by | |
| rw [unrestricted_slice_mass] | |
| have h := RowErasureMatrix.selectedEventMass_contextual_ge (r := r) | |
| (fun q : Context S k d => ActualGoodRows.table S k s d labeling q.1 q.2) Ξ± gβ | |
| (by simpa only [ActualGoodRows.adviceMass, ActualSpectral.expect_prod] using hgood) | |
| simpa only [mul_comm] using h | |
| theorem target_probability_lower (S : Source) (k s d r : β) | |
| (labeling : Fin (TableKeysGame.vertexCount S k s d) β Fin (2 ^ s)) (Ξ± : β) : | |
| (Ξ± / 2) * (unrestricted S k s d r).probability (sliceEvent S k s d r labeling Ξ±) β€ | |
| (unrestricted S k s d r).probability | |
| (fun p => sliceEvent S k s d r labeling Ξ± p && targetHit S k s d r labeling Ξ± p) := by | |
| rw [unrestricted_slice_mass, unrestricted_match_mass] | |
| exact RowErasureMatrix.selectedMatchMass_contextual_ge (r := r) | |
| (fun q : Context S k d => ActualGoodRows.table S k s d labeling q.1 q.2) Ξ± | |
| end | |
| end UniqueGamesTheorem.Decoder.ActualEvents | |
| end | |
| section | |
| namespace UniqueGamesTheorem.Decoder.MatrixGapChoice | |
| open Integration.BinaryLinear Reduction ActualSource | |
| open Inverse.Shortcode (Mat HasAffineSlice InversePrinciple equalityAcceptance) | |
| noncomputable section | |
| /-- Fixed dimensions, density and sparse mask for one logical alphabet. | |
| The remaining gadget codimension may be arbitrary when choosing the cube. -/ | |
| structure InverseParameters (rstar : β) where | |
| Ξ± : β | |
| positive : 0 < Ξ± | |
| bounded : Ξ± β€ 1 | |
| r : β | |
| s : β | |
| s_large : rstar β€ s | |
| r_small : r < s | |
| trivial_small : 1 / (2 : β) ^ (s - r) < Ξ± / 8 | |
| tupleThreshold : β | |
| inverse : β k : β, tupleThreshold β€ k β | |
| β f : Mat s (1 + 2 * k) β Vector s, | |
| ActualSpectral.eta rstar β€ equalityAcceptance f β HasAffineSlice f Ξ± r | |
| advice : β k : β, tupleThreshold β€ k β | |
| β (S : Source) (d : β) (g : SplitGadget s d) | |
| (labeling : Fin (TableKeysGame.vertexCount S k s d) β Fin (2 ^ s)), | |
| (β L : Ambient s d ββ[F2] ActualHomogeneous.E k, | |
| rstar β€ Module.finrank F2 (L.comp (alphabetEmbedding s d)).range β | |
| Integration.SplitGadget.kernelProbability g L β€ 7 / 8) β | |
| (99 : β) / 100 β€ TableKeysGame.acceptanceProbability S k g labeling β | |
| ActualGoodRows.goodRowMass rstar s r β€ ActualGoodRows.adviceMass S k s d r labeling Ξ± | |
| theorem eta_lt_one (rstar : β) : ActualSpectral.eta rstar < 1 := by | |
| have hp : (1 : β) β€ 2 ^ rstar := one_le_powβ (by norm_num) | |
| have hi : 1 / (2 : β) ^ rstar β€ 1 := by | |
| exact (div_le_one (by positivity)).mpr hp | |
| unfold ActualSpectral.eta | |
| rw [β one_div] | |
| linarith | |
| theorem exists_inverse_parameters (hinverse : InversePrinciple) (rstar : β) : | |
| Nonempty (InverseParameters rstar) := by | |
| obtain β¨Ξ±, hΞ±, hΞ±one, r, _hr, sβ, hinvβ© := | |
| hinverse (ActualSpectral.eta rstar) (ActualSpectral.eta_pos rstar) (eta_lt_one rstar) | |
| obtain β¨s, hs, hrs, hsmall, _htinyβ© := DimensionSelection.exists_logical_dimension | |
| hΞ± (ActualSpectral.eta_pos rstar) r (max rstar sβ) | |
| have hsstar : rstar β€ s := (le_max_left _ _).trans hs | |
| have hsβ : sβ β€ s := (le_max_right _ _).trans hs | |
| obtain β¨mβ, hmββ© := hinv s hsβ | |
| have halphabet : 1 / (2 : β) ^ s β€ Ξ± / 8 := by | |
| have hp : (2 : β) ^ (s - r) β€ 2 ^ s := | |
| pow_le_pow_rightβ (by norm_num) (Nat.sub_le s r) | |
| exact (one_div_le_one_div_of_le (by positivity) hp).trans hsmall.le | |
| obtain β¨kβ, hkββ© := ActualGoodRows.exists_actual_advice_threshold | |
| rstar Ξ± hΞ± hΞ±one s r hrs halphabet | |
| let threshold := max mβ kβ | |
| have hi (k : β) (hk : threshold β€ k) : | |
| β f : Mat s (1 + 2 * k) β Vector s, | |
| ActualSpectral.eta rstar β€ equalityAcceptance f β HasAffineSlice f Ξ± r := by | |
| apply hmβ (1 + 2 * k) | |
| have hm : mβ β€ k := (le_max_left _ _).trans hk | |
| omega | |
| refine β¨{ | |
| Ξ± := Ξ± | |
| positive := hΞ± | |
| bounded := hΞ±one | |
| r := r | |
| s := s | |
| s_large := hsstar | |
| r_small := hrs | |
| trivial_small := hsmall | |
| tupleThreshold := threshold | |
| inverse := hi | |
| advice := ?_ }β© | |
| intro k hk S d g labeling hkernel haccept | |
| exact hkβ k ((le_max_right _ _).trans hk) (hi k hk) S d g labeling hkernel haccept | |
| /-- After all fixed dimensions are known, the cube simultaneously exceeds the | |
| inverse threshold, reduces full-table variation, and beats the decoder mass. -/ | |
| theorem exists_cube {rstar : β} (P : InverseParameters rstar) (d : β) : | |
| β m : β, 0 < m β§ P.tupleThreshold β€ m ^ 3 β§ | |
| 0 β€ 1 / (m : β) ^ 2 β§ 1 / (m : β) ^ 2 β€ 1 β§ | |
| Foundations.Information.totalVariation | |
| (SparseLaw.independentWeights | |
| (SparseLaw.mixture (1 / (m : β) ^ 2) | |
| (SparseLaw.singletonPairWeights (Ambient P.s d))) (m ^ 3)) | |
| (SparseLaw.uniformWeights (Fin (m ^ 3) β Ambient P.s d Γ Ambient P.s d)) β€ | |
| ConstantSelection.variationBudget P.Ξ± (ActualGoodRows.goodRowMass rstar P.s P.r) P.s P.r β§ | |
| (1 - ((1 / (m : β) ^ 2) / (2 : β) ^ (d + P.r)) / 3600) ^ (m ^ 3) < | |
| ConstantSelection.decodingMass P.Ξ± (ActualGoodRows.goodRowMass rstar P.s P.r) P.s P.r := by | |
| obtain β¨m, hlarge, hm, htv, hrateβ© := ConstantSelection.exists_matrix_cube (Ambient P.s d) | |
| P.positive (ActualGoodRows.goodRowMass_pos rstar P.s P.r) P.s P.r d P.tupleThreshold | |
| have hmreal : (1 : β) β€ m := by exact_mod_cast (Nat.succ_le_iff.mpr hm) | |
| have hmsq : (1 : β) β€ (m : β) ^ 2 := one_le_powβ hmreal | |
| refine β¨m, hm, hlarge.trans (Nat.le_self_pow (by decide : (3 : β) β 0) m), | |
| by positivity, ?_, htv, hrateβ© | |
| exact (div_le_one (by positivity)).mpr hmsq | |
| end | |
| end UniqueGamesTheorem.Decoder.MatrixGapChoice | |
| end | |
| end OAI | |