Unate grid functions cut corners of few border squares #
A function g : ℕ → ℕ → Bool cuts a corner of the unit square with lower-left corner (i, j)
if its mixed difference there is nonzero (CutsCorner):
g i j + g (i + 1) (j + 1) ≠ g (i + 1) j + g i (j + 1), as 0/1 values. A function of two bits
has zero mixed difference exactly when it is the sum of a function of the first bit and a
function of the second. A threshold function of two bits cuts the corner exactly when it is not
constant and not a literal.
Ring lemma (card_filter_cutsCorner_gridBorder_le): if g is monotone or antitone in each
coordinate, uniformly in the other one, then it cuts a corner of at most 4 of the 4 (m - 1)
squares on the border of the grid {0, …, m} ^ 2 (gridBorder, le_card_gridBorder).
After reflecting coordinates, g is monotone in both. Then a cut square (i, j) has
g i j = false, g (i + 1) (j + 1) = true and g (i + 1) j = g i (j + 1); it is an outer or
an inner corner of the boundary of the up-set {g = true} according to this common value. Two
distinct cut squares of the same kind are incomparable in the product order
(eq_of_cutsCorner_of_le), so a chain contains at most two cut squares
(card_filter_cutsCorner_le_two). The border is the union of the two chains
{i = 0} ∪ {j = m - 1} and {j = 0} ∪ {i = m - 1}.
This is the combinatorial step of the lower bound for Andreev's function with two address blocks in cslib-frontier#4640, there phrased as "the boundary of a monotone region in the grid cuts corners of at most four border squares".
Main definitions #
Cslib.Combinatorics.CutsCorner: nonzero mixed difference on a unit square.Cslib.Combinatorics.gridBorder: the border squares of them × mgrid of unit squares.
Main results #
Cslib.Combinatorics.card_filter_cutsCorner_le_two: a monotone grid function cuts a corner of at most two squares of a chain.Cslib.Combinatorics.card_filter_cutsCorner_gridBorder_le: the ring lemma.Cslib.Combinatorics.le_card_gridBorder: the border has at least4 (m - 1)squares.
The border of the m × m grid of unit squares has at least 4 (m - 1) squares (exactly
4 (m - 1) for m ≥ 2).
On a grid function monotone in both coordinates, a cut square (i, j) has g i j = false,
g (i + 1) (j + 1) = true and g (i + 1) j = g i (j + 1).
Cut squares of the same kind are incomparable: for a grid function monotone in both
coordinates, two cut squares p ≤ q with the same value g (· + 1) · at their lower-right corners
are equal.
Chains: a grid function monotone in both coordinates cuts a corner of at most two squares of any chain of the product order.
Ring lemma: if g is monotone or antitone in each coordinate, uniformly in the other
coordinate, then g cuts a corner of at most 4 border squares of the m × m grid.