File size: 8,055 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | import OAI.Computability.PerfectCompleteness.Algebra.AffineLinearHeavyWitness
import OAI.Computability.PerfectCompleteness.Algebra.BilinearGramCompressionLemmas
import OAI.Computability.PerfectCompleteness.Algebra.TensorBucketEvaluationLemmas
import OAI.Computability.PerfectCompleteness.Algebra.TensorSliceDimension
import OAI.Computability.PerfectCompleteness.Foundations.OutputAnnihilator
import OAI.Computability.PerfectCompleteness.Sampling.OwnLawHeavyList
namespace OAI
section
namespace PerfectCompleteness.TensorAffineHeavyWitness
open scoped TensorProduct Classical
open QuarterBalance (F2)
open UniqueGamesTheorem.Foundations.Games
noncomputable section
variable {β : Nat} {H : Type*} [AddCommGroup H] [Module F2 H]
[Finite H] [FiniteDimensional F2 H]
local instance dualFintype {V : Type*} [AddCommGroup V] [Module F2 V] [Fintype V] :
Fintype (Module.Dual F2 V) :=
Fintype.ofInjective (fun f : Module.Dual F2 V => (f : V β F2)) DFunLike.coe_injective
def heavyList (W : Submodule F2 (Fin β β F2))
(ΞΌ : FiniteDistribution (W β[F2] H)) (G : (W β[F2] H) β (Fin β β F2))
(Ο : β) (Ο : Module.Dual F2 (Fin β β F2)) :
Finset (Module.Dual F2 (W β[F2] H)) :=
OwnLawHeavyList.heavyList ΞΌ (fun X => QuarterBalance.sign (Ο (G X))) Ο
omit [FiniteDimensional F2 H] in
theorem heavyList_card_le (W : Submodule F2 (Fin β β F2))
(ΞΌ : FiniteDistribution (W β[F2] H)) (G : (W β[F2] H) β (Fin β β F2))
(Ο biasBound : β) (hΟ : 0 < Ο) (hbiasBound : 0 β€ biasBound) (hsmall : biasBound β€ Ο ^ 2 / 2)
(hbias : β Ξ¦ : Module.Dual F2 (W β[F2] H), Ξ¦ β 0 β
|ΞΌ.expectation (fun X => QuarterBalance.sign (Ξ¦ X))| β€ biasBound)
(Ο : Module.Dual F2 (Fin β β F2)) :
((heavyList W ΞΌ G Ο Ο).card : β) β€ 2 / Ο ^ 2 := by
apply OwnLawHeavyList.heavyList_card_le ΞΌ _ Ο biasBound hΟ hbiasBound hsmall
Β· intro X
exact (OwnLawHeavyList.character_sq Ο (G X)).le
Β· exact hbias
def conditionalMatch (W : Submodule F2 (Fin β β F2))
(ΞΌ : FiniteDistribution (W β[F2] H)) (G : (W β[F2] H) β (Fin β β F2))
(Q : Submodule F2 (Module.Dual F2 H)) (target : Q ββ[F2] W)
(z : Module.Dual F2 H) (offset : Fin β β F2) : β :=
AffineLinearHeavyWitness.conditionalMatch ΞΌ (TensorRestriction.restrictionMap Q)
target G (TensorBucketEvaluation.tensorOutputLinear W z) offset
theorem exists_heavy_candidate (W : Submodule F2 (Fin β β F2))
(ΞΌ : FiniteDistribution (W β[F2] H)) (G : (W β[F2] H) β (Fin β β F2))
(Ο hβ biasBound : β) (hΟ : 0 < Ο) (hhβ : 0 < hβ) (hbiasBound : 0 β€ biasBound)
(hsmall : biasBound β€ hβ / 2)
(hbias : β Ξ¦ : Module.Dual F2 (W β[F2] H), Ξ¦ β 0 β
|ΞΌ.expectation (fun X => QuarterBalance.sign (Ξ¦ X))| β€ biasBound)
(hexcluded : 1 / (2 : β) ^ Module.finrank F2 W < Ο / 8)
(Q : Submodule F2 (Module.Dual F2 H))
(hsize : hβ β€ 1 / (2 : β) ^ Module.finrank F2 (Q ββ[F2] W))
(target : Q ββ[F2] W) (z : Module.Dual F2 H) (offset : Fin β β F2)
(hmatch : Ο β€ conditionalMatch W ΞΌ G Q target z offset) :
β Ο : Module.Dual F2 (Fin β β F2), Ο.comp W.subtype β 0 β§
β Ξ¦ β heavyList W ΞΌ G (Ο * hβ / 4) Ο,
β w : W, Ο w = 1 β TensorCosetEvaluation.scalarRestriction Ξ¦ w - z β Q := by
let : Module.Free F2 (Q ββ[F2] W) := Module.Free.of_divisionRing F2 (Q ββ[F2] W)
let : Fintype (Module.Dual F2 (W β[F2] H)) :=
Fintype.ofInjective (fun functional : Module.Dual F2 (W β[F2] H) =>
(functional : (W β[F2] H) β F2)) DFunLike.coe_injective
let b := Module.finBasis F2 (Q ββ[F2] W)
let c := Module.finBasis F2 (Fin β β F2)
have hsize' : hβ β€ 1 / (Fintype.card
(Fin (Module.finrank F2 (Q ββ[F2] W)) β Bool) : β) := by
simpa only [Fintype.card_fun, Fintype.card_bool, Fintype.card_fin,
Nat.cast_pow, Nat.cast_ofNat] using hsize
have hbad : ((OutputAnnihilator.bad W).card : β) /
Fintype.card (Module.Dual F2 (Fin β β F2)) < Ο / 8 := by
rw [OutputAnnihilator.bad_fraction]
exact hexcluded
unfold conditionalMatch at hmatch
have candidateBasis :=
AffineLinearHeavyWitness.exists_heavy_in_dual_coset
(U := W β[F2] H) (V := Q ββ[F2] W) (K := Fin β β F2) ΞΌ b c
have candidateRestriction := candidateBasis
(TensorRestriction.restrictionMap Q)
(TensorRestriction.restrictionMap_surjective (W := W) Q)
have candidateData := candidateRestriction
target G (TensorBucketEvaluation.tensorOutputLinear W z) offset
(OutputAnnihilator.bad W) Ο hβ biasBound
have candidateBounds := candidateData hΟ hhβ hsize' hbiasBound hsmall hbias hbad
have candidateWitness := candidateBounds hmatch
obtain β¨Ο, hΟ, Ο, hΟ, hheavyβ© := candidateWitness
refine β¨Ο, (OutputAnnihilator.not_mem_bad_iff W Ο).mp hΟ,
Ο.comp (TensorBucketEvaluation.tensorOutputLinear W z) + Ο, ?_, ?_β©
Β· simp only [heavyList, OwnLawHeavyList.heavyList, SmallBias.heavySet,
Finset.mem_filter, Finset.mem_univ, true_and] at hheavy β’
simpa only [OwnLawHeavyList.character, BinaryDualCoordinates.character] using hheavy
Β· intro w hw
have hΟ' : TensorCosetEvaluation.scalarRestriction Ο w β Q :=
TensorCosetEvaluation.scalarRestriction_mem_of_vanishes Q Ο
(TensorRestriction.dualImage_vanishes Q Ο hΟ) w
rw [TensorTargetCharacter.comp_tensorOutputLinear,
TensorCosetEvaluation.scalarRestriction_add,
TensorCosetEvaluation.scalarRestriction_pure]
have hw' : (Ο.comp W.subtype) w = 1 := hw
rw [hw', one_smul, add_sub_cancel_left]
exact hΟ'
theorem lemma53 (W : Submodule F2 (Fin β β F2))
(ΞΌ : FiniteDistribution (W β[F2] H)) (G : (W β[F2] H) β (Fin β β F2))
(r : Nat) (hcodim : Module.finrank F2 ((Fin β β F2) β§Έ W) β€ r)
(Ο biasBound : β) (hΟ : 0 < Ο) (hbiasBound : 0 β€ biasBound)
(hgap : 1 / (2 : β) ^ (β - r) < Ο / 8)
(hsmall : biasBound β€ min ((1 / (2 : β) ^ (r * β)) / 2)
((Ο * (1 / (2 : β) ^ (r * β)) / 4) ^ 2 / 2))
(hbias : β Ξ¦ : Module.Dual F2 (W β[F2] H), Ξ¦ β 0 β
|ΞΌ.expectation (fun X => QuarterBalance.sign (Ξ¦ X))| β€ biasBound) :
(β Ο : Module.Dual F2 (Fin β β F2),
((heavyList W ΞΌ G (Ο * (1 / (2 : β) ^ (r * β)) / 4) Ο).card : β) β€
2 / (Ο * (1 / (2 : β) ^ (r * β)) / 4) ^ 2) β§
β (Q : Submodule F2 (Module.Dual F2 H)), Module.finrank F2 Q β€ r β
β (target : Q ββ[F2] W) (z : Module.Dual F2 H) (offset : Fin β β F2),
Ο β€ conditionalMatch W ΞΌ G Q target z offset β
β Ο : Module.Dual F2 (Fin β β F2), Ο.comp W.subtype β 0 β§
β Ξ¦ β heavyList W ΞΌ G (Ο * (1 / (2 : β) ^ (r * β)) / 4) Ο,
β w : W, Ο w = 1 β
TensorCosetEvaluation.scalarRestriction Ξ¦ w - z β Q := by
have hhβ : 0 < 1 / (2 : β) ^ (r * β) := by positivity
have hΟ : 0 < Ο * (1 / (2 : β) ^ (r * β)) / 4 := by positivity
have hsmall' := le_min_iff.mp hsmall
constructor
Β· intro Ο
exact heavyList_card_le W ΞΌ G _ biasBound hΟ hbiasBound hsmall'.2 hbias Ο
Β· intro Q hQ target z offset hmatch
have hexcluded : 1 / (2 : β) ^ Module.finrank F2 W < Ο / 8 := by
rw [β OutputAnnihilator.bad_fraction W]
apply OutputAnnihilator.bad_fraction_lt_of_codim_le W r Ο hcodim
simpa only [Module.finrank_fin_fun] using hgap
have hsize : 1 / (2 : β) ^ (r * β) β€
1 / (2 : β) ^ Module.finrank F2 (Q ββ[F2] W) := by
simpa only [TensorSliceDimension.mask_card, Nat.cast_pow, Nat.cast_ofNat] using
TensorSliceDimension.reciprocal_equation_mask_card_ge W Q hQ
exact exists_heavy_candidate W ΞΌ G Ο _ biasBound hΟ hhβ hbiasBound hsmall'.1 hbias hexcluded
Q hsize target z offset hmatch
end
end PerfectCompleteness.TensorAffineHeavyWitness
end
end OAI
|