File size: 2,953 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 | import Mathlib.Algebra.MvPolynomial.Degrees
import Mathlib.Algebra.BigOperators.Field
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Analysis.Real.Sqrt
import Mathlib.Tactic.NormNum
namespace OAI
/-!
# Polynomial thresholds and average sensitivity
The Boolean cube encodes the sign cube `{β1,1}^n`:
`false` represents `β1` and `true` represents `1`. The public statement
quantifies directly over real multilinear polynomials and uses uniform counting
probability, the convention `sign(0) = 1`, and the exact constant `8`.
`GotsmanLinialStatement` is a proposition definition, not a proof of the bound.
-/
open scoped BigOperators
namespace LeanBlast.GotsmanLinial
/-- The sign cube `{β1,1}^n`, with Boolean coordinates encoding the signs. -/
abbrev Cube (n : β) := Fin n β Bool
/-- Interpret a Boolean cube coordinate as the corresponding real sign. -/
def cubeCoord {n : β} (x : Cube n) (i : Fin n) : β :=
if x i then 1 else -1
/-- Reverse one coordinate of a cube vertex. -/
def flip {n : β} (i : Fin n) (x : Cube n) : Cube n :=
Function.update x i (!(x i))
/-- The threshold convention assigns `1` at zero. -/
noncomputable def thresholdSign (t : β) : β :=
if 0 β€ t then 1 else -1
/-- Vertices at which reversing coordinate `i` changes the function. -/
noncomputable def sensitiveVertices {n : β} (f : Cube n β β) (i : Fin n) :
Finset (Cube n) := by
classical
exact Finset.univ.filter fun x => f x β f (flip i x)
/-- Number of ordered sensitive edges, indexed by their initial vertex and direction. -/
noncomputable def sensitiveEdgeCount {n : β} (f : Cube n β β) : β :=
β i : Fin n, (sensitiveVertices f i).card
/-- Sum of the uniform probabilities that a coordinate flip changes `f`. -/
noncomputable def averageSensitivity {n : β} (f : Cube n β β) : β :=
β i : Fin n, ((sensitiveVertices f i).card : β) / (2 : β) ^ n
/-- Every exponent in every supported monomial is at most one. -/
def IsMultilinear {n : β} (p : MvPolynomial (Fin n) β) : Prop :=
β m β p.support, β i : Fin n, m i β€ 1
/-- Evaluate a real polynomial at the signs represented by a cube vertex. -/
noncomputable def polynomialValue {n : β} (p : MvPolynomial (Fin n) β)
(x : Cube n) : β :=
MvPolynomial.eval (cubeCoord x) p
/-- The polynomial threshold function with the nonnegative-at-zero convention. -/
noncomputable def polynomialThreshold {n : β} (p : MvPolynomial (Fin n) β) :
Cube n β β :=
fun x => thresholdSign (polynomialValue p x)
/-- The average-sensitivity bound for positive dimension and degree at most the dimension. -/
def GotsmanLinialStatement : Prop :=
β (n d : β), 1 β€ n β 1 β€ d β d β€ n β
β p : MvPolynomial (Fin n) β,
IsMultilinear p β p.totalDegree β€ d β
averageSensitivity (polynomialThreshold p) β€ 8 * (d : β) * Real.sqrt (n : β)
end LeanBlast.GotsmanLinial
end OAI
|