grid_five_seven_nine_rectangles_balanced_columns
In every binary five-by-seven layer with at most nine monochromatic rectangles, each column contains exactly two or three true entries.
Statement
theorem grid_five_seven_nine_rectangles_balanced_columns (f : Fin 5 → Fin 7 → Bool) (h : (layer_mono (fun x y (_ : Fin 1) => f x y) 0).card ≤ 9) : ∀ y : Fin 7, let ones := ((Finset.univ : Finset (Fin 5)).filter (fun x => f x y = true)).card; ones = 2 ∨ ones = 3
- Source
- OP-1867: low-rectangle column structure computed in experiment 43999, related to arXiv:2611.19635 section 6.
- Verified
- 28 Nov 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 5
- layer_monoFor a $2$-colouring $f$ of $[a]\times[b]\times[c]$ and a layer index $z$, $\mathrm{layer\_mono}(f,z)$ is the finite set of coloured…
- grid57_unbalanced_column_thirty_agreementsA five-by-seven binary layer with an unbalanced column has at least thirty row-pair agreements across all columns.
- grid57_agreements_le_rectangles_add_twentyThe total column agreements are at most the number of monochromatic rectangles plus twenty.
- grid57_column_agreementsThe number of agreeing unordered row pairs in a column of a binary five-by-seven layer.
- BoxPatternA coloured rectangle pattern in an $a\times b$ grid: a pair of rows $x_1<x_2$, a pair of columns $y_1<y_2$, and a colour, encoded as the…
- Used by 1
- grid_five_seven_fifty_one_at_most_six_unbalanced_layersA box-free five-by-seven-by-fifty-one binary coloring has at most six layers containing an unbalanced column.
The proof, explained
The theorem is proved by contradiction. If any column of the 5×7 grid were unbalanced—having neither two nor three true entries—the total number of column agreements would have to be at least 30. However, the total number of column agreements cannot exceed the number of monochromatic rectangles plus 20, which is at most 9 + 20 = 29, producing an immediate contradiction.
Fix a column y and suppose, for contradiction, that it does not contain exactly two or three true entries.
We introduce an arbitrary column index y and assume the negation of the conclusion (that the count of true entries in column y is 2 or 3) for contradiction.
intro y by_contra hbad
The total number of column agreements across all seven columns is at least 30.
Using not_or to rewrite the contradiction hypothesis into the fact that the number of true entries in column y is neither 2 nor 3, lemma grid57_unbalanced_column_thirty_agreements establishes that having such an unbalanced column forces the sum of column agreements across all seven columns to be at least 30.
uses
grid57_unbalanced_column_thirty_agreements,not_orhave h30 := grid57_unbalanced_column_thirty_agreements f y (by simpa [not_or] using hbad)
The total number of column agreements is at most the number of monochromatic rectangles plus 20.
Lemma grid57_agreements_le_rectangles_add_twenty gives a general upper bound on the total column agreements in terms of the number of monochromatic rectangles plus 20.
uses
grid57_agreements_le_rectangles_add_twentyhave hcap := grid57_agreements_le_rectangles_add_twenty fContradiction.
The hypothesis guarantees that the number of monochromatic rectangles is at most 9, so the upper bound on agreements is at most 9 + 20 = 29. Together with the lower bound of 30, this gives 30 ≤ 29, which linear integer arithmetic (omega) recognizes as false.
omega
grid57_agreements_le_rectangles_add_twenty- In a 5×7 boolean grid, the total number of column agreements is at most the number of monochromatic rectangles plus 20.
grid57_unbalanced_column_thirty_agreements- In a 5×7 boolean grid, if some column has neither 2 nor 3 true entries, then the total number of column agreements across all columns is at least 30.
not_or- The negation of a disjunction is equivalent to the conjunction of the negations: ¬(p ∨ q) ↔ ¬p ∧ ¬q.
Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.
Lean source view module on GitHub
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
theorem grid_five_seven_nine_rectangles_balanced_columns (f : Fin 5 → Fin 7 → Bool) (h : (layer_mono (fun x y (_ : Fin 1) => f x y) 0).card ≤ 9) : ∀ y : Fin 7, let ones := ((Finset.univ : Finset (Fin 5)).filter (fun x => f x y = true)).card; ones = 2 ∨ ones = 3 := by intro y by_contra hbad have h30 := grid57_unbalanced_column_thirty_agreements f y (by simpa [not_or] using hbad) have hcap := grid57_agreements_le_rectangles_add_twenty f omega