math / data /lean /OAI /Computability /UniqueGames /Decoding /ActualSpectralLemmas.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
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