Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

Degrees and the sharp count bound for legal words

Abstract

Legal binary words have one neighbour per occupied position or flippable zero. The flippable-zero count plus twice the occupation count is at most n+1, with equality exactly for odd alternating words beginning and ending in one.

A legal word is a Boolean function on Fin n satisfying Adm: adjacent positions cannot both be true. Positions are indexed from zero. The graph is the induced subgraph of the Boolean hypercube, so its edges have actual Hamming distance one. The occupation count is the existing sum of the Boolean values converted to naturals.

Definition 1.1 (The induced legal-word graph).

Formalization. D5/S3/Combinatorics/Graph/LegalWordDegree.legalWordGraph (✓ std3).

Source. Repository-derived.

Commentary.

Vertices are the literal subtype of admissible Boolean words. Adjacency is inherited from the hypercube.

Definition 1.2 (A flippable zero position).

Formalization. D5/S3/Combinatorics/Graph/LegalWordDegree.FlippableZero (✓ std3).

Source. Repository-derived.

Commentary.

The position itself is false, and every existing immediate neighbour is false. A missing left or right neighbour is taken to be zero. Thus the two endpoint conditions are exactly the same as padding the word with a zero on each side.

Definition 1.3 (Counting flippable zeros).

Formalization. D5/S3/Combinatorics/Graph/LegalWordDegree.flippableZeroCount (✓ std3).

Source. Repository-derived.

Commentary.

The count sums one for each flippable zero and zero for every other position.

Theorem 1.4 (Degree equals additions plus removals).

Proof. Machine-checked in Lean as D5/S3/Combinatorics/Graph/LegalWordDegree.degree_eq_flippable_add_occupation (✓ std3). ∎

Source. Repository-derived.

Commentary.

Removing a one always preserves legality. Adding a one preserves legality exactly at a flippable zero. These legal flips give a bijection from the eligible positions to the actual neighbour set. A neighbour differs at exactly one position, so this accounts for every edge without duplication.

Theorem 1.5 (The sharp bound and its complete equality condition).

Proof. Machine-checked in Lean as D5/S3/Combinatorics/Graph/LegalWordDegree.flippable_bound_and_equality (✓ std3). ∎

Source. Repository-derived.

Commentary.

For every length and every legal word, u+2k is at most n+1. Equality holds exactly when n is odd and position i is true exactly when i is even. The proof separates a leading zero from a leading one followed by zero. Removing a leading zero preserves the tail’s flippable positions and removes at most one extra flippable zero; equality is impossible in this branch. Removing a leading 10 preserves u and decreases k by one, reducing both the bound and the equality condition to the shorter word. The length-one word 1 attains equality. The empty word satisfies the strict inequality, and all-zero words, even lengths, and zero endpoints are included.

References