Download data/lean/OAI/Computability/PerfectCompleteness/Algebra/TensorAffineHeavyWitness.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 8.06 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/PerfectCompleteness/Algebra/TensorAffineHeavyWitness.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Computability/PerfectCompleteness/Algebra/TensorAffineHeavyWitness.lean
-
curl -L -o TensorAffineHeavyWitness.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/PerfectCompleteness/Algebra/TensorAffineHeavyWitness.lean
8.06 kB
| 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 | |