Violated edges and the distance to monotone Boolean functions #
A Boolean function f : (ι → Bool) → Bool on the cube is monotone (Mathlib's Monotone, for the
coordinatewise order with false < true) exactly when it does not decrease along any edge of the
cube, the edge in direction i joining update x i false to update x i true
(BitString.monotone_iff_forall_update_le). The violated edges of f in direction i
(BitString.violatedEdges f i) are those along which f decreases, listed by their lower
endpoints; f is monotone exactly when it has none (monotone_iff_forall_violatedEdges_eq_empty).
BitString.distMonotone f is the least Hamming distance from f to a monotone function, and
BitString.relDistMonotone f that distance divided by the 2 ^ n points of the cube, n being
the number of coordinates; f is ε-far from monotone in the sense of Goldreich, Goldwasser,
Lehman, Ron and Samorodnitsky when
ε ≤ relDistMonotone f (BitString.le_relDistMonotone_iff).
BitString.sortAlong i f sorts the values of f along every edge in direction i: the lower
endpoint gets the smaller value and the upper endpoint the larger. This is the operator that swaps
the values at the endpoints of every violated edge of the i-th slice
Roughgarden, §8.3.1. It changes f at exactly the 2 |A_i| endpoints of
the violated edges in direction i (BitString.hammingDist_sortAlong), it leaves none in that
direction (BitString.violatedEdges_sortAlong_self), and, the Key Claim of the source's proof,
it does not increase the number of violated edges in any direction
(BitString.card_violatedEdges_sortAlong_le). Its proof compares, on every square spanned by the
directions i and j, the violations of the two j-edges before and after sorting along i; this
is a check of the 16 labellings of the square. Sorting along every direction in turn therefore
gives a monotone function within Hamming distance 2 Σ_i |A_i| of f
(BitString.exists_monotone_hammingDist_le, BitString.distMonotone_le_two_mul_sum). Conversely
every violated edge has an endpoint on which f differs from a nearest monotone function, and the
violated edges in one direction are disjoint, so |A_i| ≤ distMonotone f
(BitString.card_violatedEdges_le_distMonotone).
Normalized by the n 2 ^ (n - 1) edges of the cube (BitString.violatedEdgeFraction), this is the
combinatorial core of the edge tester's analysis Roughgarden, Theorem 8.2:
the relative distance to monotone is at most n times the fraction of violated edges
(BitString.relDistMonotone_le_card_mul_violatedEdgeFraction), so a function ε-far from monotone
has at least an ε / n fraction of violated edges
(BitString.div_card_le_violatedEdgeFraction). The tester itself is in
CslibFrontier.Computability.PropertyTesting.Monotonicity.EdgeTester.
The results are stated for any finite index type ι, in particular for Fin n.
Main definitions #
Cslib.BitString.violatedEdges: the violated edges in a direction, by their lower endpoints.Cslib.BitString.violatedEdgeFraction: the fraction of the edges of the cube that are violated.Cslib.BitString.distMonotone,Cslib.BitString.relDistMonotone: the absolute and relative Hamming distance to the monotone functions.Cslib.BitString.sortAlong: sorting the values along the edges in one direction.
Main results #
Cslib.BitString.monotone_iff_forall_update_le,Cslib.BitString.monotone_iff_forall_violatedEdges_eq_empty: monotonicity along edges.Cslib.BitString.card_endpoints_violatedEdges: the violated edges in directionihave2 |A_i|endpoints.Cslib.BitString.hammingDist_sortAlong,Cslib.BitString.violatedEdges_sortAlong_self,Cslib.BitString.card_violatedEdges_sortAlong_le,Cslib.BitString.violatedEdges_sortAlong_eq_empty: sorting along a direction, with the Key Claim.Cslib.BitString.exists_monotone_hammingDist_le,Cslib.BitString.distMonotone_le_two_mul_sum: every function is within2 Σ_i |A_i|of a monotone function.Cslib.BitString.card_violatedEdges_le_distMonotone:|A_i| ≤ distMonotone f.Cslib.BitString.distMonotone_eq_zero_iff,Cslib.BitString.relDistMonotone_of_monotone,Cslib.BitString.le_relDistMonotone_iff: the distance to monotone.Cslib.BitString.relDistMonotone_le_card_mul_violatedEdgeFraction,Cslib.BitString.div_card_le_violatedEdgeFraction: anε-far function has at least anε / nfraction of violated edges.
References #
Monotonicity along edges #
A function on a finite cube is monotone exactly when it does not decrease along any edge: for
every point x and direction i, its value at update x i false is at most its value at
update x i true.
Violated edges #
The violated edges of f in direction i, listed by their lower endpoints: the points x
with x i = false such that f x = true and f (update x i true) = false. The edges in
direction i are the 2 ^ (n - 1) pairs (x, update x i true) with x i = false.
A Boolean function is monotone exactly when it has no violated edge in any direction.
Sorting along a direction #
Sorting along direction i: on every edge in direction i, the lower endpoint gets the
smaller and the upper endpoint the larger of the two values of f. On a violated edge this swaps
the two values, and elsewhere it changes nothing Roughgarden, §8.3.1.
At the lower endpoint of an edge, sorting takes the smaller value.
At the upper endpoint of an edge, sorting takes the larger value.
The endpoints of the violated edges in direction i, the points x such that f decreases
along the edge in direction i through x, number 2 |A_i|.
Sorting along i changes f at exactly the 2 |A_i| endpoints of its violated edges in
direction i.
After sorting along i, no edge in direction i is violated.
The Key Claim Roughgarden, §8.3.1: sorting along any direction i
does not increase the number of violated edges in any direction j.
Sorting along one direction keeps every direction without violated edges free of them; in particular it keeps a monotone function monotone.
Every Boolean function is within 2 Σ_i |A_i| of a monotone function, where A_i are its
violated edges in direction i Roughgarden, proof of Theorem 8.2: sort along
every direction in turn.
Distance to monotone #
The distance to monotone of f: the least Hamming distance from f to a monotone Boolean
function, that is, the least number of points at which f must be changed to make it monotone.
The distance to monotone is at most the distance to any monotone function.
The distance to monotone is attained by a monotone function.
The distance to monotone vanishes exactly on monotone functions.
The distance to monotone is at most twice the number of violated edges.
Every violated i-edge of f contributes a distinct disagreement with any function g
that is nondecreasing along direction i.
Every violated edge has an endpoint on which f differs from a nearest monotone function, and
the violated edges in one direction are disjoint, so |A_i| ≤ distMonotone f.
The relative distance to monotone of f: the distance to monotone divided by the
2 ^ n points of the cube. A function is ε-far from monotone when ε ≤ relDistMonotone f.
ε ≤ relDistMonotone f says that f is ε-far from monotone: every monotone function
differs from f on at least an ε fraction of the cube.
Monotone functions are at relative distance 0 from monotone.
The fraction of violated edges #
The fraction of violated edges of f: the number of violated edges divided by the
n 2 ^ (n - 1) edges of the cube, written 2 Σ_i |A_i| / (n 2 ^ n). It is 0 for n = 0.
The relative distance to monotone is at most n times the fraction of violated edges
Roughgarden, proof of Theorem 8.2.
An ε-far function has at least an ε / n fraction of violated edges
Roughgarden, proof of Theorem 8.2. For n = 0 both sides are 0.