Sublinear Algorithms Lecture 26 Sofya Raskhodnikova Penn State - - PowerPoint PPT Presentation

β–Ά
sublinear algorithms
SMART_READER_LITE
LIVE PREVIEW

Sublinear Algorithms Lecture 26 Sofya Raskhodnikova Penn State - - PowerPoint PPT Presentation

Sublinear Algorithms Lecture 26 Sofya Raskhodnikova Penn State University Thanks to Madhav Jha (Penn State) for help with creating these slides. 1 Testing Linearity Linear Functions Over Finite Field 2 A Boolean function : 0,1


slide-1
SLIDE 1

1

Sublinear Algorithms

Lecture 26

Sofya Raskhodnikova

Penn State University

Thanks to Madhav Jha (Penn State) for help with creating these slides.

slide-2
SLIDE 2

Testing Linearity

slide-3
SLIDE 3

Linear Functions Over Finite Field 𝔾2

3

A Boolean function 𝑔: 0,1 π‘œ β†’ {0,1} is linear if 𝑔 𝑦1, … , π‘¦π‘œ = 𝑏1𝑦1 + β‹― + π‘π‘œπ‘¦π‘œ for some 𝑏1, … , π‘π‘œ ∈ {0,1}

  • Work in finite field 𝔾2

– Other accepted notation for 𝔾2: 𝐻𝐺

2 and β„€2

– Addition and multiplication is mod 2 – π’š= 𝑦1, … , π‘¦π‘œ , 𝒛= 𝑧1, … , π‘§π‘œ , that is, π’š, 𝒛 ∈ 0,1 π‘œ π’š + 𝒛= 𝑦1 + 𝑧1, … , π‘¦π‘œ + π‘§π‘œ no free term

Based on Ryan O’Donell’s lecture notes: http://www.cs.cmu.edu/~odonnell/boolean-analysis/

001001 011001 010000

+ example

slide-4
SLIDE 4

Testing if a Boolean function is Linear

4

Input: Boolean function 𝑔: 0,1 π‘œ β†’ {0,1} Question: Is the function linear or 𝜁-far from linear (β‰₯ 𝜁2π‘œ values need to be changed to make it linear)? Today: can answer in 𝑃

1 𝜁 time

slide-5
SLIDE 5

Motivation

  • Linearity test is one of the most celebrated testing algorithms

– A special case of many important property tests – Computations over finite fields are used in

  • Cryptography
  • Coding Theory

– Originally designed for program checkers and self-correctors – Low-degree testing is needed in constructions of Probabilistically Checkable Proofs (PCPs)

  • Used for proving inapproximability
  • Main tool in the correctness proof: Fourier analysis of Boolean

functions

– Powerful and widely used technique in understanding the structure of Boolean functions

5

slide-6
SLIDE 6

Equivalent Definitions of Linear Functions

6

  • Definition. 𝑔 is linear if 𝑔 𝑦1, … , π‘¦π‘œ = 𝑏1𝑦1 + β‹― + π‘π‘œπ‘¦π‘œ for some 𝑏1, … , π‘π‘œ ∈ 𝔾2

⇕ 𝑔 𝑦1, … , π‘¦π‘œ = 𝑦𝑗

π‘—βˆˆS

for some 𝑇 βŠ† π‘œ . Definitionβ€². 𝑔 is linear if 𝑔 π’š + 𝒛 = 𝑔 π’š + 𝑔(𝒛) for all π’š, 𝒛 ∈ 0,1 π‘œ.

  • Definition β‡’ Definitionβ€²

𝑔 π’š + 𝒛 = π’š + 𝒛 𝑗 = 𝑦𝑗 +

π‘—βˆˆπ‘‡

𝑧𝑗 = 𝑔 π’š + 𝑔 𝒛 .

π‘—βˆˆπ‘‡ π‘—βˆˆπ‘‡

  • Definitionβ€² β‡’ Definition

Let 𝛽𝑗 = 𝑔((0, … , 0,1,0, … , 0

𝑓𝑗

)) Repeatedly apply Definitionβ€²: 𝑔 𝑦1, … , π‘¦π‘œ = 𝑔 𝑦𝑗𝑓𝑗 = 𝑦𝑗𝑔 𝑓𝑗 = 𝛽𝑗𝑦𝑗.

Based on Ryan O’Donell’s lecture notes: http://www.cs.cmu.edu/~odonnell/boolean-analysis/

[π‘œ] is a shorthand for {1, … π‘œ}

slide-7
SLIDE 7

Linearity Test [Blum Luby Rubinfeld 90]

7

1. Pick π’š and 𝒛 independently and uniformly at random from 0,1 π‘œ. 2. Set π’œ = π’š + 𝒛 and query 𝑔on π’š, 𝒛, and π’œ. Accept iff 𝑔 π’œ = 𝑔 π’š + 𝑔 𝒛 . Analysis If 𝑔is linear, BLR always accepts. If 𝑔 is 𝜁-far from linear then > 𝜁 fraction of pairs π’š and 𝒛 fail BLR test.

  • Then, by Witness Lemma (Lecture 1), 2/𝜁 iterations suffice.

BLR Test (f, Ξ΅)

Correctness Theorem [Bellare Coppersmith Hastad Kiwi Sudan 95]

slide-8
SLIDE 8

Analysis Technique: Fourier Expansion

slide-9
SLIDE 9

Representing Functions as Vectors

Stack the 2π‘œ values of 𝑔(π’š) and treat it as a vector in {0,1}2π‘œ.

𝑔 = 1 1 1 β‹… β‹… β‹… 1

𝑔(0000) 𝑔(0001) 𝑔(0010) 𝑔(0011) 𝑔(0100) β‹… β‹… β‹… 𝑔(1101) 𝑔(1110) 𝑔(1111)

9

slide-10
SLIDE 10

Linear functions

There are 2π‘œ linear functions: one for each subset 𝑇 βŠ† [π‘œ]. πœ“βˆ… = β‹… β‹… β‹… , πœ“ 1 = 1 1 β‹… β‹… β‹… 1 1 , β‹― β‹―, πœ“ π‘œ = 1 1 1 β‹… β‹… β‹… 1

10

Parity on the positions indexed by set 𝑇 is πœ“π‘‡ 𝑦1, … , π‘¦π‘œ = 𝑦𝑗

π‘—βˆˆS

slide-11
SLIDE 11

Great Notational Switch

Idea: Change notation, so that we work over reals instead of a finite field.

  • Vectors in 0,1 2π‘œ ⟢ Vectors in ℝ2π‘œ.
  • 0/False ⟢ 1

1/True ⟢ -1.

  • Addition (mod 2) ⟢ Multiplication in ℝ.
  • Boolean function: 𝑔 ∢ βˆ’1, 1 π‘œ β†’ {βˆ’1,1}.
  • Linear function πœ“π‘‡βˆΆ βˆ’1, 1 π‘œ β†’ {βˆ’1,1} is given by πœ“π‘‡ π’š =

𝑦𝑗

π‘—βˆˆπ‘‡

.

11

slide-12
SLIDE 12

Benefit 1 of New Notation

  • The dot product of 𝑔 and 𝑕 as vectors in βˆ’1,1 2π‘œ:

(# π’šβ€™s such that 𝑔 π’š = 𝑕(π’š)) βˆ’ (# π’šβ€™s such that 𝑔 π’š β‰  𝑕(π’š)) = 2π‘œ βˆ’ 2 β‹… (# π’šβ€™s such that 𝑔 π’š β‰  𝑕(π’š)) 𝑔, 𝑕 = 1 2π‘œ dot product of 𝑔 and 𝑕 as vectors = avg

π’šβˆˆ βˆ’1,1 π‘œ 𝑔 π’š 𝑕 π’š

= E

π’šβˆˆ βˆ’1,1 π‘œ[ 𝑔 π’š 𝑕 π’š ].

𝑔, 𝑕 = 1 βˆ’ 2 β‹… (fraction of disagreements between 𝑔 and 𝑕)

12

Inner product of functions 𝑔, 𝑕 ∢ βˆ’1, 1 β†’ {βˆ’1, 1}

disagreements between 𝑔 and 𝑕

slide-13
SLIDE 13

Benefit 2 of New Notation

  • If 𝑇 β‰  π‘ˆ then πœ“π‘‡ and πœ“π‘ˆ are orthogonal: πœ“π‘‡, πœ“π‘ˆ = 0.

– Let 𝑗 be an element on which 𝑇 and π‘ˆ differ (w.l.o.g. 𝑗 ∈ 𝑇 βˆ– π‘ˆ) – Pair up all π‘œ-bit strings: (π’š, π’š 𝑗 ) where π’š 𝑗 is π’š with the 𝑗th bit flipped. – Each such pair contributes 𝑏𝑐 βˆ’ 𝑏𝑐 = 0 to πœ“π‘‡, πœ“π‘ˆ . – Since all π’šβ€™s are paired up, πœ“π‘‡, πœ“π‘ˆ = 0.

  • Recall that there are 2π‘œ linear functions πœ“π‘‡ .
  • πœ“π‘‡, πœ“π‘‡ = 1

– In fact, 𝑔, 𝑔 = 1 for all 𝑔 ∢ βˆ’1, 1 π‘œ β†’ βˆ’1, 1 . – (The norm of 𝑔, denoted 𝑔 , is 𝑔, 𝑔 )

13

π’š π’š 𝑗

πœ“π‘‡ πœ“π‘ˆ

+1 βˆ’1 +1 +𝑏 +1 β‹… β‹… β‹… βˆ’π‘ +1 βˆ’1 βˆ’1 βˆ’1 +1 +1 𝑐 +1 β‹… β‹… β‹… 𝑐 βˆ’1 +1 +1 The functions πœ“π‘‡ π‘‡βŠ† π‘œ form an orthonormal basis for ℝ2π‘œ. Claim.

slide-14
SLIDE 14

Idea: Work in the basis πœ“π‘‡ π‘‡βŠ† π‘œ , so it is easy to see how close a specific function 𝑔 is to each of the linear functions.

Every function 𝑔 ∢ βˆ’1, 1 π‘œ β†’ ℝ is uniquely expressible as a linear combination (over ℝ) of the 2π‘œ linear functions: where 𝑔 𝑇 = 𝑔, πœ“π‘‡ is the Fourier Coefficient of 𝑔 on set 𝑇. Proof: 𝑔 can be written uniquely as a linear combination of basis vectors: 𝑔 = 𝑑𝑇 β‹… πœ“π‘‡

π‘‡βŠ† π‘œ

It remains to prove that 𝑑𝑇=𝑔 𝑇 for all 𝑇. 𝑔 𝑇 = 𝑔, πœ“π‘‡ = π‘‘π‘ˆ β‹… πœ“π‘ˆ

π‘ˆβŠ†[π‘œ]

, πœ“π‘‡ = π‘‘π‘ˆ β‹… πœ“π‘ˆ, πœ“π‘‡

π‘ˆβŠ†[π‘œ]

= 𝑑𝑇

Fourier Expansion Theorem

14

Fourier Expansion Theorem

𝑔 = 𝑔 𝑇 πœ“π‘‡,

π‘‡βŠ† π‘œ

Linearity of β‹…,β‹…

πœ“π‘ˆ, πœ“π‘‡ =

1 if π‘ˆ = 𝑇 0 otherwise Definition of Fourier coefficients

slide-15
SLIDE 15

Examples: Fourier Expansion

π’ˆ Fourier transform 𝑔 π’š = 1 1 𝑔 π’š = 𝑦𝑗 𝑦𝑗 AND(𝑦1, 𝑦2) 1 2 + 1 2 𝑦1 + 1 2 𝑦2 βˆ’ 1 2 𝑦1𝑦2 MAJORITY(𝑦1, 𝑦2, 𝑦3) 1 2 𝑦1 + 1 2 𝑦2 + 1 2 𝑦3 βˆ’ 1 2 𝑦1𝑦2𝑦3

15

slide-16
SLIDE 16

Parseval Equality

Proof: 𝑔, 𝑔 = 𝑔 𝑇 πœ“π‘‡

π‘‡βŠ† π‘œ

, 𝑔 π‘ˆ πœ“π‘ˆ

π‘ˆβŠ† π‘œ

= 𝑔 𝑇

π‘ˆ 𝑇

𝑔 π‘ˆ πœ“π‘‡, πœ“π‘ˆ = 𝑔 𝑇 2

𝑇

16

By linearity of inner product By orthonormality of πœ“π‘‡β€™s

Parseval Equality

Let 𝑔: βˆ’1, 1 π‘œ β†’ ℝ. Then 𝑔, 𝑔 = 𝑔 𝑇 2

π‘‡βŠ† π‘œ

By Fourier Expansion Theorem

slide-17
SLIDE 17

Parseval Equality

Proof: 𝑔, 𝑔 = E

π’šβˆˆ βˆ’1,1 π‘œ[𝑔 π’š 2]

= 1

17

Parseval Equality for Boolean Functions

Let 𝑔: βˆ’1, 1 π‘œ β†’ βˆ’1, 1 . Then 𝑔, 𝑔 = 𝑔 𝑇 2

π‘‡βŠ† π‘œ

= 1

By definition of inner product Since 𝑔 is Boolean

slide-18
SLIDE 18

Vector product notation: π’š ∘ 𝒛 = (𝑦1𝑧1, 𝑦2𝑧2, … , π‘¦π‘œπ‘§π‘œ) Proof: Indicator variable πŸšπΆπ‘€π‘† = 1 if BLR accepts 0 otherwise β‡’ πŸšπΆπ‘€π‘† =

1 2 + 1 2 𝑔 π’š 𝑔 𝒛 𝑔 π’œ .

Pr

π’š,π’›βˆˆ βˆ’1,1 π‘œ BLR 𝑔 accepts =

E

𝐲,𝐳∈ βˆ’1,1 π‘œ πŸšπΆπ‘€π‘† = 1

2 + 1 2 E

𝐲,𝐳∈ βˆ’1,1 π‘œ 𝑔 π’š 𝑔 𝒛 𝑔 π’œ

BLR Test in {-1,1} notation

18

BLR Test (f, Ξ΅)

1.

Pick π’š and 𝒛 independently and uniformly at random from βˆ’1,1 π‘œ. 2. Set π’œ = π’š ∘ 𝒛 and query 𝑔 on π’š, 𝒛, and π’œ. Accept iff 𝑔 π’š 𝑔 𝒛 𝑔 π’œ = 1. Pr

𝐲,𝐳∈ βˆ’1,1 π‘œ BLR 𝑔 accepts = 1

2 + 1 2 𝑔 𝑇 3

π‘‡βŠ†[π‘œ]

Sum-Of-Cubes Lemma.

By linearity of expectation

slide-19
SLIDE 19

So far: Pr

𝐲,𝐳∈ βˆ’1,1 π‘œ BLR 𝑔 accepts = 1 2 + 1 2

E

𝐲,𝐳∈ βˆ’1,1 π‘œ 𝑔 π’š 𝑔 𝒛 𝑔 π’œ

Next:

Proof of Sum-Of-Cubes Lemma

19

= 𝑔 𝑇 𝑔 π‘ˆ 𝑔 𝑉 E

𝐲,𝐳∈ βˆ’1,1 π‘œ[πœ“π‘‡(π’š)πœ“π‘ˆ(𝒛)πœ“π‘‰(π’œ) 𝑇,π‘ˆ,π‘‰βŠ†[π‘œ]

] = E

𝐲,𝐳∈ βˆ’1,1 π‘œ

𝑔 𝑇 𝑔 π‘ˆ 𝑔 𝑉 πœ“π‘‡(π’š)πœ“π‘ˆ(𝒛)πœ“π‘‰(π’œ)

𝑇,π‘ˆ,π‘‰βŠ†[π‘œ]

E

𝐲,𝐳∈ βˆ’1,1 π‘œ 𝑔 π’š 𝑔 𝒛 𝑔 π’œ

= E

𝐲,𝐳∈ βˆ’1,1 π‘œ

𝑔 𝑇 πœ“π‘‡(π’š)

π‘‡βŠ†[π‘œ]

𝑔 π‘ˆ πœ“π‘ˆ(𝒛)

π‘ˆβŠ†[π‘œ]

𝑔 𝑉 πœ“π‘‰(π’œ)

π‘‰βŠ†[π‘œ]

By Fourier Expansion Theorem Distributing out the product of sums By linearity of expectation

slide-20
SLIDE 20

Pr

𝐲,𝐳∈ βˆ’1,1 π‘œ BLR 𝑔 accepts

  • Let π‘‡Ξ”π‘ˆdenote symmetric difference of sets 𝑇 and π‘ˆ

Proof of Sum-Of-Cubes Lemma (Continued)

20

a= E

𝐲,𝐳∈ βˆ’1,1 π‘œ

𝑦𝑗

π‘—βˆˆπ‘‡

𝑧𝑗 𝑦𝑗𝑧𝑗

π‘—βˆˆπ‘‰ π‘—βˆˆπ‘ˆ

a= E

𝐲,𝐳∈ βˆ’1,1 π‘œ

𝑦𝑗

π‘—βˆˆπ‘‡Ξ”π‘‰

𝑧𝑗

π‘—βˆˆπ‘ˆΞ”π‘‰

a= E

𝐲∈ βˆ’1,1 π‘œ

𝑦𝑗

π‘—βˆˆπ‘‡Ξ”π‘‰

β‹… E

𝐳∈ βˆ’1,1 π‘œ

𝑧𝑗

π‘—βˆˆπ‘‡Ξ”π‘‰

a= E

𝐲∈ βˆ’1,1 π‘œ[𝑦𝑗] π‘—βˆˆπ‘‡Ξ”π‘‰

β‹… E

𝐳∈ βˆ’1,1 π‘œ[𝑧𝑗] π‘—βˆˆπ‘ˆΞ”π‘‰

a E

𝐲,𝐳∈ βˆ’1,1 π‘œ[πœ“π‘‡(π’š)πœ“π‘ˆ(𝒛)πœ“π‘‰(π’œ)]

= 1 when 𝑇Δ𝑉 = βˆ… and π‘ˆΞ”π‘‰ = βˆ… ⇔ 𝑇 = π‘ˆ = 𝑉 0 otherwise a= E

𝐲,𝐳∈ βˆ’1,1 π‘œ

𝑦𝑗

π‘—βˆˆπ‘‡

𝑧𝑗 𝑨𝑗

π‘—βˆˆπ‘‰ π‘—βˆˆπ‘ˆ

= 1 2 + 1 2

𝑔 𝑇 𝑔 π‘ˆ 𝑔 𝑉 E

𝐲,𝐳∈ βˆ’1,1 π‘œ[πœ“π‘‡(π’š)πœ“π‘ˆ(𝒛)πœ“π‘‰(π’œ) 𝑇,π‘ˆ,π‘‰βŠ†[π‘œ]

]

Since 𝑦𝑗

2 = 𝑧𝑗 2 = 1

Since 𝐲 and 𝐳 are independent Since 𝐴 = 𝐲 ∘ 𝐳 Since 𝐲 and 𝐳′s coordinates are independent

a= E

π‘¦π‘—βˆˆ{βˆ’1,1}[𝑦𝑗] π‘—βˆˆπ‘‡Ξ”π‘‰

β‹… E

π‘§π‘—βˆˆ{βˆ’1,1}[𝑧𝑗] π‘—βˆˆπ‘ˆΞ”π‘‰

E

𝐲,𝐳∈ βˆ’1,1 π‘œ[πœ“π‘‡(π’š)πœ“π‘ˆ(𝒛)πœ“π‘‰(π’œ)] is 1 if 𝑇 = π‘ˆ = 𝑉 and 0 otherwise.

Claim.

slide-21
SLIDE 21

Proof of Sum-Of-Cubes Lemma (Done)

21

= 1 2 + 1 2 𝑔 𝑇 3

π‘‡βŠ†[π‘œ]

Pr

𝐲,𝐳∈ βˆ’1,1 π‘œ BLR 𝑔 accepts = 1

2 + 1 2 𝑔 𝑇 3

π‘‡βŠ†[π‘œ]

Sum-Of-Cubes Lemma.

Pr

𝐲,𝐳∈ βˆ’1,1 π‘œ BLR 𝑔 accepts

= 1 2 + 1 2

𝑔 𝑇 𝑔 π‘ˆ 𝑔 𝑉 E

𝐲,𝐳∈ βˆ’1,1 π‘œ[πœ“π‘‡(π’š)πœ“π‘ˆ(𝒛)πœ“π‘‰(π’œ) 𝑇,π‘ˆ,π‘‰βŠ†[π‘œ]

]

slide-22
SLIDE 22

Proof of Correctness Theorem

Proof: Suppose to the contrary that

  • Then max

π‘‡βŠ† π‘œ 𝑔

𝑇 > 1 βˆ’ 2𝜁. That is, 𝑔 π‘ˆ > 1 βˆ’ 2𝜁 for some π‘ˆ βŠ† π‘œ .

  • But 𝑔

π‘ˆ = 𝑔, πœ“π‘ˆ = 1 βˆ’ 2 β‹… (fraction of disagreements between 𝑔 and πœ“π‘ˆ)

  • 𝑔 disagrees with a linear function πœ“π‘ˆ on < 𝜁 fraction of values.

22

By Sum-Of-Cubes Lemma Since 𝑔 𝑇 2 β‰₯ 0 Parseval Equality

Correctness Theorem (restated)

If 𝑔 is Ξ΅-far from linear then Pr BLR 𝑔 accepts ≀ 1 βˆ’ 𝜁. = 1 2 + 1 2 𝑔 𝑇 3

π‘‡βŠ†[π‘œ]

≀ 1 2 + 1 2 β‹… max

π‘‡βŠ† π‘œ 𝑔

𝑇 β‹… 𝑔 𝑇 2

π‘‡βŠ† π‘œ

= 1 2 + 1 2 β‹… max

π‘‡βŠ† π‘œ 𝑔

𝑇 1 βˆ’ 𝜁 < Pr

𝐲,𝐳∈ βˆ’1,1 π‘œ BLR 𝑔 accepts

⨳

slide-23
SLIDE 23

Summary

BLR tests whether a function 𝑔: 0,1 π‘œ β†’ {0,1} is linear or 𝜁-far from linear (β‰₯ 𝜁2π‘œ values need to be changed to make it linear) in 𝑃

1 𝜁 time.

23