AFTD Auto-Formalizing Theoretical Domains

grid57_unbalanced_column_thirty_agreements

theoremverified

A five-by-seven binary layer with an unbalanced column has at least thirty row-pair agreements across all columns.

Statement

theorem grid57_unbalanced_column_thirty_agreements (f : Fin 5 → Fin 7 → Bool) (y : Fin 7) (h : let ones := ((Finset.univ : Finset (Fin 5)).filter (fun x => f x y = true)).card; ones ≠ 2 ∧ ones ≠ 3) : 30 ≤ ∑ j : Fin 7, grid57_column_agreements f j
Source
OP-1867: row-pair incidence count, related to arXiv:2611.19635 section 6.
Verified
28 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 2
  • grid57_column_agreementsThe number of agreeing unordered row pairs in a column of a binary five-by-seven layer.
  • cFor a group $G$ and an element $s \in G$, the local count $c_G(s)$ is the cardinality of the set of elements $g \in G$ such that…
Used by 1

The proof, explained

In any 5-element boolean column, the number of agreeing row pairs is at least 4, and is at least 6 if the column is unbalanced (having anything other than 2 or 3 true values). This column-level bound is verified for all column functions by checking all 32 boolean 5-tuples exhaustively and using function extensionality. Applying this to the 5-by-7 grid, the specified unbalanced column contributes at least 6 agreements, while each of the other 6 columns contributes at least 4 agreements. Summing these bounds gives at least 6 × 4 + 6 = 30 agreements across the entire grid.

  1. Every explicit 5-element boolean vector satisfies the column agreement bounds: at least 4 agreeing row pairs, and at least 6 if the count of true entries is neither 2 nor 3. automation

    Unfolding `oneCol` reduces the claim to checking all 2⁵ = 32 possible boolean 5-tuples. The `decide` tactic evaluates every case computationally.

    lines 10–12

      have hh : ∀ a b c d e : Bool, oneCol ![a,b,c,d,e] := by
        unfold oneCol
        decide
  2. Every column function g : Fin 5 → Bool is identical to the explicit vector ![g 0, g 1, g 2, g 3, g 4].

    By function extensionality (`funext`), two functions on Fin 5 agree if they agree at every index. Case analysis (`fin_cases`) on the five indices shows that each case holds by definition.

    lines 13–15

      have hg : g = ![g 0,g 1,g 2,g 3,g 4] := by
        funext i
        fin_cases i <;> rfl
  3. The agreement bounds property `oneCol g` holds for every column function g : Fin 5 → Bool.

    Rewriting g as an explicit 5-tuple reduces the goal to the universal property verified by exhaustive computation.

    lines 16–17

      rw [hg]
      apply hh
  4. In the grid, every column j has at least 4 row-pair agreements, and the unbalanced column y has at least 6 row-pair agreements.

    Applying `oneCol_all` to each column provides the baseline bound of 4 agreements (`ha`). For column y, the hypothesis h states that the count of true entries is neither 2 nor 3, so the second clause of `oneCol_all` gives at least 6 agreements (`hb`).

    lines 20–21

    uses oneCol_all

      have ha (j : Fin 7) : 4 ≤ grid57_column_agreements f j := (oneCol_all (fun x => f x j)).1
      have hb : 6 ≤ grid57_column_agreements f y := (oneCol_all (fun x => f x y)).2 h
  5. The total agreement count equals the sum over the other 6 columns plus the agreement count of column y.

    Rewriting with `Finset.sum_erase_add` separates column y from the sum over all 7 columns, using `Finset.mem_univ` since y belongs to the universal finset.

    line 22

    uses Finset.sum_erase_add, Finset.mem_univ

      rw [← Finset.sum_erase_add _ _ (Finset.mem_univ y)]
  6. The sum of row-pair agreements over the 6 columns other than y is at least 24.

    Applying `Finset.sum_le_sum` with the lower bound of 4 agreements on each column outside {y} bounds the sum below by ∑ 4. Simplifying the sum of the constant 4 over the 6 remaining columns evaluates to 24.

    lines 23–24

    uses Finset.sum_le_sum

      have hs := Finset.sum_le_sum (s := Finset.univ.erase y) (fun j _ => ha j)
      simp at hs
  7. The total number of row-pair agreements across all 7 columns is at least 30. automation

    The remaining 6 columns contribute at least 24 agreements and column y contributes at least 6 agreements. Linear arithmetic over ℕ (`omega`) combines these bounds to show that the total sum is at least 24 + 6 = 30.

    line 25

      omega
oneCol_all
For any boolean column of length 5, the number of agreeing row pairs is at least 4, and is at least 6 whenever the number of true entries is neither 2 nor 3.
Finset.sum_erase_add
For any finite set s, function f, and element a ∈ s, the sum of f over s equals the sum of f over s \ {a} plus f(a).
Finset.mem_univ
Every element of a finite type belongs to the universal finset of that type.
Finset.sum_le_sum
If f(i) ≤ g(i) for all i in a finite set s, then the sum of f over s is less than or equal to the sum of g over s.

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

set_option maxRecDepth 4000set_option maxHeartbeats 2000000private def oneCol (g : Fin 5 → Bool) : Prop :=  let n := (Finset.univ.filter (fun i => g i = true)).card  let a := ((Finset.univ : Finset (Fin 5 × Fin 5)).filter (fun p => p.1 < p.2 ∧ g p.1 = g p.2)).card  4 ≤ a ∧ (n ≠ 2 ∧ n ≠ 3 → 6 ≤ a)private theorem oneCol_all (g : Fin 5 → Bool) : oneCol g := by  have hh : ∀ a b c d e : Bool, oneCol ![a,b,c,d,e] := by    unfold oneCol    decide  have hg : g = ![g 0,g 1,g 2,g 3,g 4] := by    funext i    fin_cases i <;> rfl  rw [hg]  apply hhtheorem grid57_unbalanced_column_thirty_agreements (f : Fin 5 → Fin 7 → Bool) (y : Fin 7) (h : let ones := ((Finset.univ : Finset (Fin 5)).filter (fun x => f x y = true)).card; ones ≠ 2 ∧ ones ≠ 3) : 30 ≤ ∑ j : Fin 7, grid57_column_agreements f j := by  have ha (j : Fin 7) : 4 ≤ grid57_column_agreements f j := (oneCol_all (fun x => f x j)).1  have hb : 6 ≤ grid57_column_agreements f y := (oneCol_all (fun x => f x y)).2 h  rw [← Finset.sum_erase_add _ _ (Finset.mem_univ y)]  have hs := Finset.sum_le_sum (s := Finset.univ.erase y) (fun j _ => ha j)  simp at hs  omega
See it in the graphDiscuss this resultChallenge it