Download data/lean/OAI/Computability/UniqueGames/Decoding/PrivateStrategyLemmas.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 22.6 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/UniqueGames/Decoding/PrivateStrategyLemmas.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Computability/UniqueGames/Decoding/PrivateStrategyLemmas.lean
-
curl -L -o PrivateStrategyLemmas.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/UniqueGames/Decoding/PrivateStrategyLemmas.lean
22.6 kB
| import OAI.Computability.UniqueGames.Analysis.ParityLemmas | |
| import OAI.Computability.UniqueGames.Decoding.AdviceFibersLemmas | |
| import OAI.Computability.UniqueGames.Foundations.SamplingLemmas | |
| import OAI.Computability.UniqueGames.Games.FinishBoundsLemmas | |
| namespace OAI | |
| section | |
| /-! | |
| # Actual private response laws for Fourier decoding | |
| The right response law has only its row-fiber table, the inclusion of its hidden | |
| kernel, a first-bit map, and an actual fallback answer as arguments. In | |
| particular it has no column slice or witness. Zero-mass invalid frequencies | |
| are repaired to the fallback so that the response type always consists of | |
| actual answers. Witness data occur only in the success analysis. | |
| -/ | |
| noncomputable section | |
| namespace UniqueGamesTheorem.Decoder.PrivateStrategy | |
| attribute [local instance] Classical.propDecidable | |
| open PrivateFourier | |
| open UniqueGamesTheorem.Fourier.MatrixCharacters | |
| open UniqueGamesTheorem.Foundations.Games | |
| open scoped BigOperators Classical | |
| section Candidates | |
| variable {E E' : Type*} [AddCommGroup E] [Module F2 E] | |
| [AddCommGroup E'] [Module F2 E'] [Fintype E] | |
| def candidates (Z : Submodule F2 E) (z : E) (Ο : E ββ[F2] F2) : Finset E := | |
| Finset.univ.filter fun v => v - z β Z β§ Ο v = 1 | |
| theorem mem_candidates (Z : Submodule F2 E) (z v : E) (Ο : E ββ[F2] F2) : | |
| v β candidates Z z Ο β v - z β Z β§ Ο v = 1 := by simp [candidates] | |
| theorem candidates_nonempty (Z : Submodule F2 E) (z : E) | |
| (Ο : E ββ[F2] F2) (hz : Ο z = 1) : (candidates Z z Ο).Nonempty := by | |
| exact β¨z, (mem_candidates Z z z Ο).2 β¨by simp, hzβ©β© | |
| theorem candidates_card_le (Z : Submodule F2 E) [Fintype Z] (z : E) | |
| (Ο : E ββ[F2] F2) : (candidates Z z Ο).card β€ Fintype.card Z := by | |
| let f : {v // v β candidates Z z Ο} β Z := fun v => | |
| β¨v.1 - z, ((mem_candidates Z z v.1 Ο).1 v.2).1β© | |
| have hf : Function.Injective f := by | |
| intro x y h | |
| apply Subtype.ext | |
| have he := congrArg Subtype.val h | |
| change x.val - z = y.val - z at he | |
| exact sub_left_injective he | |
| simpa using Fintype.card_le_of_injective f hf | |
| theorem candidates_card_le_pow (Z : Submodule F2 E) [Fintype Z] | |
| [FiniteDimensional F2 Z] (z : E) (Ο : E ββ[F2] F2) | |
| (r : β) (hr : Module.finrank F2 Z β€ r) : | |
| (candidates Z z Ο).card β€ 2 ^ r := by | |
| have hc : Fintype.card Z = 2 ^ Module.finrank F2 Z := by | |
| simpa [F2, UniqueGamesTheorem.Integration.BinaryLinear.F2, ZMod.card] using | |
| Module.card_fintype (Module.finBasis F2 Z) | |
| calc | |
| _ β€ Fintype.card Z := candidates_card_le Z z Ο | |
| _ = 2 ^ Module.finrank F2 Z := hc | |
| _ β€ 2 ^ r := Nat.pow_le_pow_right (by decide : 0 < 2) hr | |
| /-- First-bit preservation converts a projected coset member into an actual | |
| answer in the left candidate set. -/ | |
| theorem candidate_preimage (Z : Submodule F2 E) (z : E) | |
| (Ο : E ββ[F2] E') (Ο : E ββ[F2] F2) (Ο' : E' ββ[F2] F2) | |
| (hΟ : Ο'.comp Ο = Ο) (y : E') (hy : y - Ο z β Z.map Ο) | |
| (hybit : Ο' y = 1) : β v β candidates Z z Ο, Ο v = y := by | |
| obtain β¨w, hw, hwΟβ© := Submodule.mem_map.mp hy | |
| have heq : Ο (z + w) = y := by | |
| rw [map_add, hwΟ] | |
| rw [add_comm, sub_add_cancel] | |
| refine β¨z + w, (mem_candidates Z z (z + w) Ο).2 β¨?_, ?_β©, heqβ© | |
| Β· simpa only [add_sub_cancel_left] using hw | |
| Β· rw [β hΟ, LinearMap.comp_apply, heq, hybit] | |
| end Candidates | |
| section RightRule | |
| variable {E H K : Type*} | |
| variable [AddCommGroup E] [Module F2 E] [AddCommGroup H] [Module F2 H] | |
| variable [AddCommGroup K] [Module F2 K] | |
| variable [FiniteDimensional F2 E] [FiniteDimensional F2 H] | |
| variable [Fintype (E ββ[F2] H)] [Fintype (H ββ[F2] E)] | |
| variable [Fintype (K ββ[F2] F2)] | |
| omit [FiniteDimensional F2 H] in | |
| theorem exists_unit (Ο : H ββ[F2] F2) (hne : Ο β 0) : β h, Ο h = 1 := by | |
| have hn : β h, Ο h β 0 := by | |
| by_contra hh | |
| apply hne | |
| ext h | |
| by_contra hh' | |
| exact hh β¨h, hh'β© | |
| obtain β¨h, hhβ© := hn | |
| exact β¨h, (UniqueGamesTheorem.Integration.BinaryLinear.scalar_cases _).resolve_left hhβ© | |
| def chooseUnit (Ο : H ββ[F2] F2) (hne : Ο β 0) : H := | |
| Classical.choose (exists_unit Ο hne) | |
| omit [FiniteDimensional F2 H] in | |
| theorem chooseUnit_spec (Ο : H ββ[F2] F2) (hne : Ο β 0) : | |
| Ο (chooseUnit Ο hne) = 1 := Classical.choose_spec (exists_unit Ο hne) | |
| abbrev ActualAnswer (Ο : E ββ[F2] F2) := {v : E // Ο v = 1} | |
| /-- The uniform output character followed by its actual Fourier frequency. -/ | |
| def privateSeedLaw (F : (E ββ[F2] H) β K) : | |
| FiniteDistribution ((K ββ[F2] F2) Γ (H ββ[F2] E)) where | |
| weight p := frequencyWeight (tableSign F p.1) p.2 / | |
| (Fintype.card (K ββ[F2] F2) : β) | |
| nonnegative p := div_nonneg (frequencyWeight_nonneg _ _) (Nat.cast_nonneg _) | |
| normalized := by | |
| rw [Fintype.sum_prod_type] | |
| simp_rw [β Finset.sum_div, tableSign_frequencyWeight_sum] | |
| simp [Fintype.card_ne_zero] | |
| theorem privateSeedLaw_expectation (F : (E ββ[F2] H) β K) | |
| (g : ((K ββ[F2] F2) Γ (H ββ[F2] E)) β β) : | |
| (privateSeedLaw F).expectation g = | |
| πΌ Ο : K ββ[F2] F2, β Ξ¦ : H ββ[F2] E, | |
| frequencyWeight (tableSign F Ο) Ξ¦ * g (Ο, Ξ¦) := by | |
| simp only [FiniteDistribution.expectation, privateSeedLaw, Fintype.sum_prod_type, | |
| Fintype.expect_eq_sum_div_card] | |
| simp_rw [div_mul_eq_mul_div, β Finset.sum_div] | |
| /-- The decoder receives no left witness. The first-bit repair affects only | |
| zero-mass frequencies when the table is folded. -/ | |
| def privateOutput (ΞΉ : H ββ[F2] K) (Ο : E ββ[F2] F2) | |
| (fallback : ActualAnswer Ο) (p : (K ββ[F2] F2) Γ (H ββ[F2] E)) : | |
| ActualAnswer Ο := | |
| if hn : p.1.comp ΞΉ = 0 then fallback else | |
| let v := p.2 (chooseUnit (p.1.comp ΞΉ) hn) | |
| if hv : Ο v = 1 then β¨v, hvβ© else fallback | |
| omit [FiniteDimensional F2 E] [Fintype (H ββ[F2] E)] [Fintype (K ββ[F2] F2)] in | |
| theorem privateOutput_eq_contraction (F : (E ββ[F2] H) β K) | |
| (ΞΉ : H ββ[F2] K) (Ο : E ββ[F2] F2) (fallback : ActualAnswer Ο) | |
| (folded : β N h, F (N + Ο.smulRight h) = F N + ΞΉ h) | |
| (Ο : K ββ[F2] F2) (Ξ¦ : H ββ[F2] E) | |
| (hn : Ο.comp ΞΉ β 0) (hp : 0 < frequencyWeight (tableSign F Ο) Ξ¦) : | |
| (privateOutput ΞΉ Ο fallback (Ο, Ξ¦)).1 = Ξ¦ (chooseUnit (Ο.comp ΞΉ) hn) := by | |
| have hunit : Ο (ΞΉ (chooseUnit (Ο.comp ΞΉ) hn)) = 1 := chooseUnit_spec (Ο.comp ΞΉ) hn | |
| have hfold := tableSign_antifold F ΞΉ Ο Ο (chooseUnit (Ο.comp ΞΉ) hn) | |
| (fun N => folded N _) hunit | |
| have hbit := positive_frequency_first_bit (tableSign F Ο) Ο | |
| (chooseUnit (Ο.comp ΞΉ) hn) Ξ¦ hfold hp | |
| simp [privateOutput, hn, hbit] | |
| /-- This is an actual finite distribution on actual answers, for every visible | |
| row table. The sampler's normalization is Parseval, not a hypothesis. -/ | |
| def privateLaw [Fintype E] (F : (E ββ[F2] H) β K) | |
| (ΞΉ : H ββ[F2] K) (Ο : E ββ[F2] F2) (fallback : ActualAnswer Ο) : | |
| FiniteDistribution (ActualAnswer Ο) := | |
| (privateSeedLaw F).pushforward (privateOutput ΞΉ Ο fallback) | |
| theorem privateLaw_expectation [Fintype E] (F : (E ββ[F2] H) β K) | |
| (ΞΉ : H ββ[F2] K) (Ο : E ββ[F2] F2) (fallback : ActualAnswer Ο) | |
| (g : ActualAnswer Ο β β) : | |
| (privateLaw F ΞΉ Ο fallback).expectation g = | |
| πΌ Ο : K ββ[F2] F2, β Ξ¦ : H ββ[F2] E, | |
| frequencyWeight (tableSign F Ο) Ξ¦ * g (privateOutput ΞΉ Ο fallback (Ο, Ξ¦)) := by | |
| rw [privateLaw, FiniteDistribution.expectation_pushforward, privateSeedLaw_expectation] | |
| end RightRule | |
| section LeftRule | |
| variable {E : Type*} [AddCommGroup E] [Module F2 E] [Fintype E] | |
| /-- The left rule is uniform on its own chosen affine-answer candidates. -/ | |
| def candidateLaw (Z : Submodule F2 E) (z : E) (Ο : E ββ[F2] F2) | |
| (hz : Ο z = 1) : FiniteDistribution (ActualAnswer Ο) := by | |
| letI : Nonempty {v // v β candidates Z z Ο} := | |
| β¨β¨z, (mem_candidates Z z z Ο).2 β¨by simp, hzβ©β©β© | |
| exact (FiniteDistribution.uniform {v // v β candidates Z z Ο}).pushforward | |
| (fun v => β¨v.1, ((mem_candidates Z z v.1 Ο).1 v.2).2β©) | |
| theorem candidateLaw_expectation (Z : Submodule F2 E) (z : E) | |
| (Ο : E ββ[F2] F2) (hz : Ο z = 1) (g : E β β) : | |
| (candidateLaw Z z Ο hz).expectation (fun v => g v.1) = | |
| πΌ v β candidates Z z Ο, g v := by | |
| let : Nonempty {v // v β candidates Z z Ο} := | |
| β¨β¨z, (mem_candidates Z z z Ο).2 β¨by simp, hzβ©β©β© | |
| unfold candidateLaw | |
| rw [FiniteDistribution.expectation_pushforward, FiniteDistribution.expectation_uniform, | |
| Finset.expect_eq_sum_div_card] | |
| simp only [Fintype.card_coe, Finset.sum_coe_sort] | |
| end LeftRule | |
| section ConditionalAgreement | |
| variable {U E H K : Type*} | |
| variable [AddCommGroup U] [Module F2 U] [Fintype U] | |
| variable [AddCommGroup E] [Module F2 E] [Fintype E] | |
| variable [AddCommGroup H] [Module F2 H] | |
| variable [AddCommGroup K] [Module F2 K] | |
| variable [FiniteDimensional F2 E] [FiniteDimensional F2 H] | |
| variable [Fintype (E ββ[F2] H)] [Fintype (H ββ[F2] E)] | |
| variable [Fintype (K ββ[F2] F2)] | |
| /-- Actual independent response-law success, with the literal projection test. -/ | |
| def conditionalAgreement (Z : Submodule F2 U) (z : U) | |
| (ΟU : U ββ[F2] F2) (hz : ΟU z = 1) (Ο : U ββ[F2] E) | |
| (F : (E ββ[F2] H) β K) (ΞΉ : H ββ[F2] K) | |
| (Ο : E ββ[F2] F2) (fallback : ActualAnswer Ο) : β := | |
| ((candidateLaw Z z ΟU hz).product (privateLaw F ΞΉ Ο fallback)).probability | |
| (fun a => decide (Ο a.1.1 = a.2.1)) | |
| theorem conditionalAgreement_eq_sum (Z : Submodule F2 U) (z : U) | |
| (ΟU : U ββ[F2] F2) (hz : ΟU z = 1) (Ο : U ββ[F2] E) | |
| (F : (E ββ[F2] H) β K) (ΞΉ : H ββ[F2] K) | |
| (Ο : E ββ[F2] F2) (fallback : ActualAnswer Ο) : | |
| conditionalAgreement Z z ΟU hz Ο F ΞΉ Ο fallback = | |
| πΌ Ο : K ββ[F2] F2, β Ξ¦ : H ββ[F2] E, | |
| frequencyWeight (tableSign F Ο) Ξ¦ * | |
| (πΌ v β candidates Z z ΟU, | |
| if Ο v = (privateOutput ΞΉ Ο fallback (Ο, Ξ¦)).1 then (1 : β) else 0) := by | |
| unfold conditionalAgreement | |
| have hp (ΞΌ : FiniteDistribution (ActualAnswer ΟU Γ ActualAnswer Ο)) : | |
| ΞΌ.probability (fun a => decide (Ο a.1.1 = a.2.1)) = | |
| ΞΌ.expectation (fun a => if Ο a.1.1 = a.2.1 then (1 : β) else 0) := by | |
| simp [FiniteDistribution.probability, FiniteDistribution.expectation, mul_ite] | |
| rw [hp, FiniteDistribution.expectation_product] | |
| simp_rw [privateLaw_expectation] | |
| rw [candidateLaw_expectation Z z ΟU hz (fun v => | |
| πΌ Ο : K ββ[F2] F2, β Ξ¦ : H ββ[F2] E, | |
| frequencyWeight (tableSign F Ο) Ξ¦ * | |
| (if Ο v = (privateOutput ΞΉ Ο fallback (Ο, Ξ¦)).1 then (1 : β) else 0)), | |
| Finset.expect_comm] | |
| apply Finset.expect_congr rfl | |
| intro Ο _ | |
| rw [Finset.expect_sum_comm] | |
| apply Finset.sum_congr rfl | |
| intro Ξ¦ _ | |
| exact (Finset.mul_expect _ _ _).symm | |
| /-- The exact good Fourier mass in a witness coset; unlike the response law, | |
| this analysis-only quantity is allowed to mention the witness. -/ | |
| def goodCosetMass (Q : Submodule F2 E) (z' : E) | |
| (F : (E ββ[F2] H) β K) (ΞΉ : H ββ[F2] K) : β := | |
| πΌ Ο : K ββ[F2] F2, if Ο.comp ΞΉ β 0 then | |
| β Ξ¦ β frequencyCoset Q.mkQ ((Ο.comp ΞΉ).smulRight z'), | |
| frequencyWeight (tableSign F Ο) Ξ¦ else 0 | |
| omit [Fintype E] [FiniteDimensional F2 E] [FiniteDimensional F2 H] in | |
| theorem goodCosetMass_nonneg (Q : Submodule F2 E) (z' : E) | |
| (F : (E ββ[F2] H) β K) (ΞΉ : H ββ[F2] K) : | |
| 0 β€ goodCosetMass Q z' F ΞΉ := by | |
| apply Finset.expect_nonneg | |
| intro Ο _ | |
| split | |
| Β· exact Finset.sum_nonneg fun _ _ => frequencyWeight_nonneg _ _ | |
| Β· exact le_rfl | |
| omit [Fintype E] [FiniteDimensional F2 E] [Fintype (K ββ[F2] F2)] in | |
| /-- A good sampled frequency has a valid left preimage. Neither decoder is | |
| given the proof or the witness used here. -/ | |
| theorem good_frequency_preimage (Z : Submodule F2 U) (z : U) | |
| (ΟU : U ββ[F2] F2) (Ο : U ββ[F2] E) | |
| (F : (E ββ[F2] H) β K) (ΞΉ : H ββ[F2] K) | |
| (Ο : E ββ[F2] F2) (fallback : ActualAnswer Ο) | |
| (hΟ : Ο.comp Ο = ΟU) | |
| (folded : β N h, F (N + Ο.smulRight h) = F N + ΞΉ h) | |
| (Ο : K ββ[F2] F2) (Ξ¦ : H ββ[F2] E) | |
| (hn : Ο.comp ΞΉ β 0) | |
| (hc : Ξ¦ β frequencyCoset (Z.map Ο).mkQ ((Ο.comp ΞΉ).smulRight (Ο z))) | |
| (hp : 0 < frequencyWeight (tableSign F Ο) Ξ¦) : | |
| β v β candidates Z z ΟU, Ο v = (privateOutput ΞΉ Ο fallback (Ο, Ξ¦)).1 := by | |
| have hout := privateOutput_eq_contraction F ΞΉ Ο fallback folded Ο Ξ¦ hn hp | |
| apply candidate_preimage Z z Ο ΟU Ο hΟ | |
| Β· rw [hout] | |
| apply contraction_mem_target_coset (Z.map Ο) (Ο.comp ΞΉ) (Ο z) Ξ¦ | |
| (chooseUnit (Ο.comp ΞΉ) hn) (chooseUnit_spec _ _) | |
| simpa [frequencyCoset] using hc | |
| Β· exact (privateOutput ΞΉ Ο fallback (Ο, Ξ¦)).2 | |
| /-- The actual independent policies agree with at least the good Fourier mass | |
| divided by the number of left candidates. -/ | |
| theorem conditionalAgreement_ge_mass_div_card (Z : Submodule F2 U) (z : U) | |
| (ΟU : U ββ[F2] F2) (hz : ΟU z = 1) (Ο : U ββ[F2] E) | |
| (F : (E ββ[F2] H) β K) (ΞΉ : H ββ[F2] K) | |
| (Ο : E ββ[F2] F2) (fallback : ActualAnswer Ο) | |
| (hΟ : Ο.comp Ο = ΟU) | |
| (folded : β N h, F (N + Ο.smulRight h) = F N + ΞΉ h) : | |
| goodCosetMass (Z.map Ο) (Ο z) F ΞΉ / (candidates Z z ΟU).card β€ | |
| conditionalAgreement Z z ΟU hz Ο F ΞΉ Ο fallback := by | |
| rw [goodCosetMass, Finset.expect_div, conditionalAgreement_eq_sum] | |
| apply Finset.expect_le_expect | |
| intro Ο _ | |
| have hi := independent_agreement_lower (candidates Z z ΟU) Ο | |
| (fun Ξ¦ => (privateOutput ΞΉ Ο fallback (Ο, Ξ¦)).1) | |
| (frequencyWeight (tableSign F Ο)) | |
| (fun Ξ¦ => Ο.comp ΞΉ β 0 β§ | |
| Ξ¦ β frequencyCoset (Z.map Ο).mkQ ((Ο.comp ΞΉ).smulRight (Ο z))) | |
| (frequencyWeight_nonneg _) | |
| (fun Ξ¦ hΞ¦ hp => good_frequency_preimage Z z ΟU Ο F ΞΉ Ο fallback | |
| hΟ folded Ο Ξ¦ hΞ¦.1 hΞ¦.2 hp) | |
| by_cases hn : Ο.comp ΞΉ β 0 | |
| Β· simpa [hn, Finset.sum_filter] using hi | |
| Β· simpa [hn] using hi | |
| end ConditionalAgreement | |
| section SliceBound | |
| variable {E H K : Type*} | |
| variable [AddCommGroup E] [Module F2 E] [Fintype E] | |
| variable [AddCommGroup H] [Module F2 H] [Fintype H] | |
| variable [AddCommGroup K] [Module F2 K] | |
| variable [FiniteDimensional F2 E] [FiniteDimensional F2 H] | |
| variable [Fintype (E ββ[F2] H)] [Fintype (H ββ[F2] E)] | |
| variable [Fintype (K ββ[F2] F2)] | |
| omit [Fintype E] in | |
| /-- The actual transferred affine-slice agreement supplies the sampled good | |
| Fourier mass, including removal of characters trivial on the hidden kernel. -/ | |
| theorem goodCosetMass_lower_from_slice (Q : Submodule F2 E) | |
| [Fintype (H ββ[F2] Q)] [Fintype ((E β§Έ Q) ββ[F2] H)] | |
| (Nβ : E ββ[F2] H) (F : (E ββ[F2] H) β K) | |
| (ΞΉ : H ββ[F2] K) (hΞΉ : Function.Injective ΞΉ) (z' : E) (b : K) | |
| (Ξ± : β) (hΞ± : 0 β€ Ξ±) (β r : β) | |
| (hH : Module.finrank F2 H β€ β) (hQ : Module.finrank F2 Q β€ r) | |
| (hsmall : 1 / (Fintype.card H : β) β€ Ξ± / 8) | |
| (hagreement : Ξ± / 4 β€ πΌ A : (E β§Έ Q) ββ[F2] H, | |
| if F (Nβ + A.comp Q.mkQ) = b + ΞΉ ((Nβ + A.comp Q.mkQ) z') | |
| then (1 : β) else 0) : | |
| (Ξ± / 8) ^ 2 / (2 : β) ^ (β * r) β€ goodCosetMass Q z' F ΞΉ := by | |
| let good : (K ββ[F2] F2) β Prop := fun Ο => Ο.comp ΞΉ β 0 | |
| let : DecidablePred good := fun _ => Classical.propDecidable _ | |
| let C : (K ββ[F2] F2) β β := fun Ο => | |
| sliceCorrelation Q.mkQ Nβ (tableSign F Ο) ((Ο.comp ΞΉ).smulRight z') | |
| let mass : (K ββ[F2] F2) β β := fun Ο => | |
| β Ξ¦ β frequencyCoset Q.mkQ ((Ο.comp ΞΉ).smulRight z'), | |
| frequencyWeight (tableSign F Ο) Ξ¦ | |
| have habs : Ξ± / 4 β€ πΌ Ο : K ββ[F2] F2, |C Ο| := | |
| hagreement.trans (agreement_le_average_abs_correlation Q.mkQ Nβ F ΞΉ z' b) | |
| have hbad : (πΌ Ο : K ββ[F2] F2, | |
| if good Ο then (0 : β) else 1) β€ Ξ± / 8 := by | |
| have ht := trivial_restriction_probability ΞΉ hΞΉ | |
| have heq : (πΌ Ο : K ββ[F2] F2, | |
| if good Ο then (0 : β) else 1) = 1 / (Fintype.card H : β) := by | |
| calc | |
| _ = πΌ Ο : K ββ[F2] F2, if Ο.comp ΞΉ = 0 then (1 : β) else 0 := by | |
| apply Finset.expect_congr rfl | |
| intro Ο _ | |
| by_cases hn : Ο.comp ΞΉ = 0 <;> simp [good, hn] | |
| _ = _ := ht | |
| exact heq.le.trans hsmall | |
| have hselected : Ξ± / 8 β€ πΌ Ο : K ββ[F2] F2, | |
| if good Ο then |C Ο| else 0 := by | |
| have hh := remove_bad_characters C good (Ξ± / 4) (Ξ± / 8) | |
| (fun Ο => sliceCorrelation_tableSign_abs_le_one Q.mkQ Nβ F Ο | |
| ((Ο.comp ΞΉ).smulRight z')) habs hbad | |
| linarith | |
| have hbound := average_coset_mass_lower C mass good | |
| ((2 : β) ^ (β * r)) (Ξ± / 8) (by positivity) (by positivity) hselected | |
| (by | |
| intro Ο _ | |
| have hcs := sliceCorrelation_sq_le_coset_mass Q.mkQ Nβ (tableSign F Ο) | |
| ((Ο.comp ΞΉ).smulRight z') | |
| have hc : ((frequencyCoset Q.mkQ ((Ο.comp ΞΉ).smulRight z')).card : β) β€ | |
| (2 : β) ^ (β * r) := by | |
| exact_mod_cast frequencyCoset_card_le Q ((Ο.comp ΞΉ).smulRight z') β r hH hQ | |
| exact hcs.trans (mul_le_mul_of_nonneg_right hc | |
| (Finset.sum_nonneg fun _ _ => frequencyWeight_nonneg _ _))) | |
| calc | |
| _ β€ πΌ Ο : K ββ[F2] F2, if good Ο then mass Ο else 0 := hbound | |
| _ = goodCosetMass Q z' F ΞΉ := by | |
| unfold goodCosetMass | |
| apply Finset.expect_congr rfl | |
| intro Ο _ | |
| by_cases hn : Ο.comp ΞΉ = 0 <;> simp [good, mass, hn] | |
| end SliceBound | |
| section FinalConditionalBound | |
| variable {U E H K : Type*} | |
| variable [AddCommGroup U] [Module F2 U] [Fintype U] | |
| variable [AddCommGroup E] [Module F2 E] [Fintype E] | |
| variable [AddCommGroup H] [Module F2 H] [Fintype H] | |
| variable [AddCommGroup K] [Module F2 K] | |
| variable [FiniteDimensional F2 U] [FiniteDimensional F2 E] [FiniteDimensional F2 H] | |
| variable [Fintype (E ββ[F2] H)] [Fintype (H ββ[F2] E)] | |
| variable [Fintype (K ββ[F2] F2)] | |
| theorem conditionalAgreement_from_slice (Z : Submodule F2 U) [Fintype Z] | |
| (z : U) (ΟU : U ββ[F2] F2) (hz : ΟU z = 1) (Ο : U ββ[F2] E) | |
| [Fintype (H ββ[F2] Z.map Ο)] [Fintype ((E β§Έ Z.map Ο) ββ[F2] H)] | |
| (Nβ : E ββ[F2] H) (F : (E ββ[F2] H) β K) | |
| (ΞΉ : H ββ[F2] K) (hΞΉ : Function.Injective ΞΉ) | |
| (Ο : E ββ[F2] F2) (fallback : ActualAnswer Ο) (hΟ : Ο.comp Ο = ΟU) | |
| (folded : β N h, F (N + Ο.smulRight h) = F N + ΞΉ h) | |
| (b : K) (Ξ± : β) (hΞ± : 0 β€ Ξ±) (β r : β) | |
| (hH : Module.finrank F2 H β€ β) (hZ : Module.finrank F2 Z β€ r) | |
| (hsmall : 1 / (Fintype.card H : β) β€ Ξ± / 8) | |
| (hagreement : Ξ± / 4 β€ πΌ A : (E β§Έ Z.map Ο) ββ[F2] H, | |
| if F (Nβ + A.comp (Z.map Ο).mkQ) = | |
| b + ΞΉ ((Nβ + A.comp (Z.map Ο).mkQ) (Ο z)) then (1 : β) else 0) : | |
| (Ξ± / 8) ^ 2 / (2 : β) ^ (β * r) / (2 : β) ^ r β€ | |
| conditionalAgreement Z z ΟU hz Ο F ΞΉ Ο fallback := by | |
| have hQ : Module.finrank F2 (Z.map Ο) β€ r := | |
| (Submodule.finrank_map_le Ο Z).trans hZ | |
| have hmass := goodCosetMass_lower_from_slice (Z.map Ο) Nβ F ΞΉ hΞΉ (Ο z) b | |
| Ξ± hΞ± β r hH hQ hsmall hagreement | |
| have hcard : ((candidates Z z ΟU).card : β) β€ (2 : β) ^ r := by | |
| exact_mod_cast candidates_card_le_pow Z z ΟU r hZ | |
| have hcardpos : (0 : β) < (candidates Z z ΟU).card := | |
| Nat.cast_pos.mpr (Finset.card_pos.mpr (candidates_nonempty Z z ΟU hz)) | |
| calc | |
| _ β€ goodCosetMass (Z.map Ο) (Ο z) F ΞΉ / (2 : β) ^ r := | |
| div_le_div_of_nonneg_right hmass (by positivity) | |
| _ β€ goodCosetMass (Z.map Ο) (Ο z) F ΞΉ / (candidates Z z ΟU).card := | |
| div_le_div_of_nonneg_left (goodCosetMass_nonneg _ _ _ _) hcardpos hcard | |
| _ β€ _ := conditionalAgreement_ge_mass_div_card Z z ΟU hz Ο F ΞΉ Ο fallback hΟ folded | |
| end FinalConditionalBound | |
| end UniqueGamesTheorem.Decoder.PrivateStrategy | |
| end | |
| end | |
| section | |
| /-! | |
| The surrogate perturbation fixes the complementary table exactly. Splitting | |
| the actual uniform matrix law therefore expresses surrogate acceptance as the | |
| mean of the uniform shortcode tests on the `(U,T)` fibers, including zero | |
| perturbation factors. This supplies the sampling identification needed before | |
| applying the inverse theorem to the many useful fibers. | |
| -/ | |
| namespace UniqueGamesTheorem.Decoder.SurrogateFibers | |
| open UniqueGamesTheorem.Integration.BinaryLinear | |
| open UniqueGamesTheorem.Fourier | |
| open PositiveMultiplier | |
| open scoped BigOperators | |
| noncomputable section | |
| variable {E K W C : Type*} | |
| variable [AddCommGroup E] [Module F2 E] | |
| variable [AddCommGroup K] [Module F2 K] [Fintype K] | |
| variable [AddCommGroup W] [Module F2 W] [Fintype W] | |
| variable [Fintype (E ββ[F2] F2)] | |
| variable [Fintype (E ββ[F2] K)] [Fintype (E ββ[F2] W)] | |
| variable [Fintype (E ββ[F2] K Γ W)] | |
| /-- Uniform shortcode sampling; neither nonzero-factor conditioning nor | |
| rank-one-matrix-uniform sampling is substituted for its two independent factors. -/ | |
| def shortcodeAcceptance (f : (E ββ[F2] K) β C) : β := by | |
| classical | |
| exact πΌ M, πΌ a : K, πΌ l : E ββ[F2] F2, | |
| if f M = f (M + l.smulRight a) then (1 : β) else 0 | |
| omit [Fintype K] [Fintype W] [Fintype (E ββ[F2] F2)] | |
| [Fintype (E ββ[F2] K)] [Fintype (E ββ[F2] W)] [Fintype (E ββ[F2] K Γ W)] in | |
| theorem product_perturbation (M : E ββ[F2] K) (T : E ββ[F2] W) | |
| (l : E ββ[F2] F2) (a : K) : | |
| M.prod T + l.smulRight ((LinearMap.inl F2 K W) a) = | |
| (M + l.smulRight a).prod T := by | |
| ext x <;> simp | |
| theorem surrogate_acceptance_eq_fiber_average | |
| (label : (E ββ[F2] K Γ W) β C) : | |
| equalityAcceptance (subspaceLaw (LinearMap.inl F2 K W)) label = | |
| πΌ T : E ββ[F2] W, | |
| shortcodeAcceptance (fun M : E ββ[F2] K => label (M.prod T)) := by | |
| classical | |
| have hsampling : equalityAcceptance (subspaceLaw (LinearMap.inl F2 K W)) label = | |
| πΌ X : E ββ[F2] K Γ W, πΌ a : K, πΌ l : E ββ[F2] F2, | |
| if label X = label (X + l.smulRight ((LinearMap.inl F2 K W) a)) then | |
| (1 : β) else 0 := by | |
| unfold equalityAcceptance | |
| apply Finset.expect_congr rfl | |
| intro X _ | |
| rw [subspaceLaw_sum, Fintype.expect_eq_sum_div_card] | |
| ring | |
| rw [hsampling, SplitMaps.expect_codomain_product, Finset.expect_comm] | |
| apply Finset.expect_congr rfl | |
| intro T _ | |
| unfold shortcodeAcceptance | |
| apply Finset.expect_congr rfl | |
| intro M _ | |
| apply Finset.expect_congr rfl | |
| intro a _ | |
| apply Finset.expect_congr rfl | |
| intro l _ | |
| rw [product_perturbation] | |
| end | |
| end UniqueGamesTheorem.Decoder.SurrogateFibers | |
| end | |
| end OAI | |