Off-diagonal Gram entries #
Sections 11.2 and 11.3 of bs_lambda.txt.
Let F : CertFamily V ι and let x ≠ y be two positive inputs of F.ind, with owners
i = owner x and j = owner y. Write G = gram F.ind, so that G x y counts the
common negative Hamming neighbours of x and y.
Two pure cube-geometry lemmas come first: a common neighbour of x ≠ y forces
y = x^{p,q} for two distinct coordinates p ≠ q, and then the only possible common
neighbours are the two midpoints x^p and x^q.
The classification itself is exists_flip_pair_of_gram_ne_zero: for a nonzero off-diagonal
entry the owners differ, one of the two flipped coordinates is the (unique) conflict
coordinate q of C_i and C_j, and the other one, p, is fixed by exactly one of the
two certificates. Everything else in the file is a consequence:
gram_eq_zero_of_owner_eq— ifi = jthenG x y = 0;gram_le_one— forx ≠ yalwaysG x y ≤ 1;dist_eq_one_or_dist_eq_one— ifG x y ≠ 0thendist(x, C_j) = 1ordist(y, C_i) = 1;exists_flip_pair_of_dist_eq_one— in the first case the ambiguity inpis resolved:C_ifixespandC_jdoes not;dist_eq_two_of_dist_eq_one— in the first casedist(y, C_i) = 2(so in particular the two alternatives above are exclusive) andx = π_{C_i}(y), the column bound of Section 11.3;exists_flip_proj— in the first casey = (π_{C_j} x)^pwithpfixed byC_i(the row bound of Section 11.3);exists_flip_proj_self— andx = (π_{C_j} x)^qis another such flip, which is what produces thec - 1rather thancin the row bound.
Adapted for Lean Pool from Timeroot/BS_Lam at commit
7bd39a8d41ee7910d3296d0477ad18f8fff9d870; ported to Lean Pool with proof and dependency cleanup.
Cube geometry #
The two facts about the Boolean cube that drive the whole classification: a pair of points with a common neighbour is a two-coordinate flip, and such a pair has only the two obvious common neighbours.
Two distinct inputs with a common Hamming neighbour differ in exactly two coordinates (Section 11.2).
The only common Hamming neighbours of x and its two-coordinate flip x^{p,q} are the
two midpoints x^p and x^q: a third one would sit at distance three from x^{p,q}
(Section 11.2).
Two distinct positive inputs with the same owner have no common negative neighbour:
both flipped coordinates are free for the common owner, so both midpoints stay inside
its certificate and are therefore positive (Section 11.2, case i = j).
A nonzero off-diagonal Gram entry forces distinct owners (Section 11.2).
A point at distance one from another point's certificate is not that point, since every
point satisfies its own certificate. This is why the oriented lemmas below take no
separate x ≠ y hypothesis (Section 11.2).
Classification of a nonzero off-diagonal Gram entry (Section 11.2). The two
inputs differ in exactly two coordinates p ≠ q; the coordinate q is the unique
conflict of the two owners' certificates, and the other coordinate p is fixed by
exactly one of them.
Of the two midpoints between x and y = x^{p,q}, at least one is positive: some
certificate containing x or y leaves p or q free, because otherwise p and q
would both be conflict coordinates of the two owners (Section 11.2).
Distinct positive inputs have at most one common negative neighbour: the two candidates
are the midpoints x^p and x^q, and by ind_flipSet_singleton_eq_true_or at most one of
them is negative (Section 11.2).
Orientation of a nonzero off-diagonal entry: one of the two inputs lies at distance
exactly one from the other's certificate (Section 11.2). In either case the conflict
coordinate is the only violated literal, by
PartialAssign.violSet_eq_singleton_of_conflict.
Oriented form of exists_flip_pair_of_gram_ne_zero: once it is known which of the two
inputs is the near one, the alternative on p is resolved — C_i fixes p and C_j leaves
it free, since otherwise x would violate both p and q of C_j (Section 11.3).
The two alternatives of dist_eq_one_or_dist_eq_one are exclusive, and in the oriented
case the reverse distance is exactly two and is realised by the nearest-point projection: y
violates both p and q for C_i, and resetting them returns x (Section 11.3,
column bound).
In the oriented case the projection of x onto C_j is x^q, and y is obtained
from it by flipping the single coordinate p, which is fixed by C_i
(Section 11.3, row bound).
The point x itself is a single flip of its own projection onto C_j, namely at the
conflict coordinate, which is fixed by C_i. This removes one option from the row bound
of Section 11.3.