AFTD Auto-Formalizing Theoretical Domains

grid_five_seven_fifty_two_row_pair_capacity_feasible

theoremverified

There is a fifty-two-layer binary five-by-seven coloring in which each layer has exactly eight monochromatic rectangles, and, for each row pair and color, the total number of such rectangles counted with multiplicity is at most twenty-one. This does not assert that the coloring is box-free.

Statement

theorem grid_five_seven_fifty_two_row_pair_capacity_feasible :
  ∃ f : Fin 5 → Fin 7 → Fin 52 → Bool,
    (∀ z, (layer_mono f z).card = 8) ∧
    ∀ x₁ x₂ : Fin 5, x₁ < x₂ → ∀ c : Bool,
      (∑ z : Fin 52, ((Finset.univ : Finset (Fin 7 × Fin 7)).filter (fun p =>
        p.1 < p.2 ∧ f x₁ p.1 z = c ∧ f x₁ p.2 z = c ∧
        f x₂ p.1 z = c ∧ f x₂ p.2 z = c)).card) ≤ 21
Source
OP-1867: row-pair/color projection counterexample, experiment 43995, related to arXiv:2611.19635 section 6.
Verified
28 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 5
  • grid_five_seven_projected_witnessThe explicit fifty-two-layer binary coloring defined by the displayed repeated seven-column bit vectors; it is not claimed box-free.
  • 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…
  • 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…
  • bitThe real embedding of a Boolean value, sending false to 0 and true to 1.
  • 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…

The proof, explained

The theorem is established by exhibiting an explicit witness: a fifty-two-layer binary coloring of the 5×7 grid compactly encoded as a single 1820-bit natural number. Each layer's grid values are extracted by testing individual bits of this integer. The two required conditions—that every layer contains exactly eight monochromatic rectangles, and that each row pair and color combination has a total rectangle count of at most twenty-one across all layers—are verified through exhaustive finite computation via the `decide` tactic. The existential statement is then completed by packaging the witness coloring together with these two computational certificates.

  1. The 1820-bit integer defines a 52-layer binary 5×7 coloring in which each layer contains exactly eight monochromatic rectangles. automation

    A witness coloring f : Fin 5 → Fin 7 → Fin 52 → Bool is defined by unpacking the bits of a large integer constant, `grid_five_seven_fifty_two_row_pair_capacity_feasible_packed`, mapping grid position (x, y) in layer z to bit 5(7z + y) + x. The lemma `grid_five_seven_fifty_two_row_pair_capacity_feasible_card` asserts that for every layer z, the set of monochromatic rectangles in layer z has cardinality exactly 8. Since this is a finite proposition over 52 layers of a 5×7 grid, Lean's `decide` tactic proves it by exhaustive evaluation.

    lines 1–19

    set_option maxHeartbeats 3000000
    
    /-- Packed 1820-bit encoding of the fifty-two-by-seven table of column bit-vectors. -/
    def grid_five_seven_fifty_two_row_pair_capacity_feasible_packed : Nat :=
      57848113784968052606067852212059347867792786711539426730437992185998066129675879659638901426404714793624798202233979055396292924203781453662656723334155014606675405898451116220536061801795641177224803180852190770746339451718061692364081719833172285752129786230422020661639582426192726823878412538726706973655435888169128518265610169615086500608255244968707053259887471055746374550808288652715899299628560305022449010945574942084429424315072206198367025542673515008265962867221857125143412410419965911698755356793727397144577297422886307886122252451
    
    /-- The fifty-two-layer binary five-by-seven witness colouring, decoded from the packed Nat. -/
    def grid_five_seven_fifty_two_row_pair_capacity_feasible_witness :
        Fin 5 → Fin 7 → Fin 52 → Bool :=
      fun x y z =>
        grid_five_seven_fifty_two_row_pair_capacity_feasible_packed.testBit
          (5 * (z.val * 7 + y.val) + x.val)
    
    /-- Each layer of the witness has exactly eight monochromatic rectangles. -/
    theorem grid_five_seven_fifty_two_row_pair_capacity_feasible_card :
        ∀ z : Fin 52,
          (layer_mono grid_five_seven_fifty_two_row_pair_capacity_feasible_witness z).card = 8 := by
      decide
    
  2. For each pair of rows and each color, the total number of monochromatic rectangles across all 52 layers is at most 21. automation

    For any two distinct rows x₁ < x₂ and each color c, `grid_five_seven_fifty_two_row_pair_capacity_feasible_cap` bounds the sum over all 52 layers of the number of column pairs y₁ < y₂ forming a monochromatic rectangle of color c on rows x₁ and x₂. The `decide` tactic checks this inequality by direct computational evaluation across all 10 row pairs and 2 colors, verifying that each of the 20 resulting sums is at most 21.

    lines 20–30

    /-- For each row pair and colour, the total number of monochromatic rectangles is at most 21. -/
    theorem grid_five_seven_fifty_two_row_pair_capacity_feasible_cap :
        ∀ x₁ x₂ : Fin 5, x₁ < x₂ → ∀ c : Bool,
          (∑ z : Fin 52, ((Finset.univ : Finset (Fin 7 × Fin 7)).filter (fun p =>
            p.1 < p.2 ∧
            grid_five_seven_fifty_two_row_pair_capacity_feasible_witness x₁ p.1 z = c ∧
            grid_five_seven_fifty_two_row_pair_capacity_feasible_witness x₁ p.2 z = c ∧
            grid_five_seven_fifty_two_row_pair_capacity_feasible_witness x₂ p.1 z = c ∧
            grid_five_seven_fifty_two_row_pair_capacity_feasible_witness x₂ p.2 z = c)).card) ≤ 21 := by
      decide
    
  3. There exists a 52-layer binary 5×7 coloring satisfying both the layer rectangle count and row-pair capacity bounds.

    The existential statement is proved by directly supplying the witness coloring `grid_five_seven_fifty_two_row_pair_capacity_feasible_witness` along with the proofs of the two required properties: `grid_five_seven_fifty_two_row_pair_capacity_feasible_card` for the per-layer rectangle count of 8, and `grid_five_seven_fifty_two_row_pair_capacity_feasible_cap` for the row-pair capacity bound of 21.

    lines 31–39

    uses grid_five_seven_fifty_two_row_pair_capacity_feasible_card, grid_five_seven_fifty_two_row_pair_capacity_feasible_cap

    theorem grid_five_seven_fifty_two_row_pair_capacity_feasible :
      ∃ f : Fin 5 → Fin 7 → Fin 52 → Bool,
        (∀ z, (layer_mono f z).card = 8) ∧
        ∀ x₁ x₂ : Fin 5, x₁ < x₂ → ∀ c : Bool,
          (∑ z : Fin 52, ((Finset.univ : Finset (Fin 7 × Fin 7)).filter (fun p =>
            p.1 < p.2 ∧ f x₁ p.1 z = c ∧ f x₁ p.2 z = c ∧
            f x₂ p.1 z = c ∧ f x₂ p.2 z = c)).card) ≤ 21 := ⟨grid_five_seven_fifty_two_row_pair_capacity_feasible_witness,
       grid_five_seven_fifty_two_row_pair_capacity_feasible_card,
       grid_five_seven_fifty_two_row_pair_capacity_feasible_cap⟩
grid_five_seven_fifty_two_row_pair_capacity_feasible_card
For every layer index z ∈ {0, ..., 51}, the number of monochromatic rectangles in layer z under the witness coloring is exactly 8.
grid_five_seven_fifty_two_row_pair_capacity_feasible_cap
For every pair of rows x₁ < x₂ and each color c, the sum over all 52 layers of the number of column pairs forming a monochromatic rectangle of color c on rows x₁, x₂ is at most 21.

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 maxHeartbeats 3000000/-- Packed 1820-bit encoding of the fifty-two-by-seven table of column bit-vectors. -/def grid_five_seven_fifty_two_row_pair_capacity_feasible_packed : Nat :=  57848113784968052606067852212059347867792786711539426730437992185998066129675879659638901426404714793624798202233979055396292924203781453662656723334155014606675405898451116220536061801795641177224803180852190770746339451718061692364081719833172285752129786230422020661639582426192726823878412538726706973655435888169128518265610169615086500608255244968707053259887471055746374550808288652715899299628560305022449010945574942084429424315072206198367025542673515008265962867221857125143412410419965911698755356793727397144577297422886307886122252451/-- The fifty-two-layer binary five-by-seven witness colouring, decoded from the packed Nat. -/def grid_five_seven_fifty_two_row_pair_capacity_feasible_witness :    Fin 5 → Fin 7 → Fin 52 → Bool :=  fun x y z =>    grid_five_seven_fifty_two_row_pair_capacity_feasible_packed.testBit      (5 * (z.val * 7 + y.val) + x.val)/-- Each layer of the witness has exactly eight monochromatic rectangles. -/theorem grid_five_seven_fifty_two_row_pair_capacity_feasible_card :    ∀ z : Fin 52,      (layer_mono grid_five_seven_fifty_two_row_pair_capacity_feasible_witness z).card = 8 := by  decide/-- For each row pair and colour, the total number of monochromatic rectangles is at most 21. -/theorem grid_five_seven_fifty_two_row_pair_capacity_feasible_cap :    ∀ x₁ x₂ : Fin 5, x₁ < x₂ → ∀ c : Bool,      (∑ z : Fin 52, ((Finset.univ : Finset (Fin 7 × Fin 7)).filter (fun p =>        p.1 < p.2 ∧        grid_five_seven_fifty_two_row_pair_capacity_feasible_witness x₁ p.1 z = c ∧        grid_five_seven_fifty_two_row_pair_capacity_feasible_witness x₁ p.2 z = c ∧        grid_five_seven_fifty_two_row_pair_capacity_feasible_witness x₂ p.1 z = c ∧        grid_five_seven_fifty_two_row_pair_capacity_feasible_witness x₂ p.2 z = c)).card) ≤ 21 := by  decidetheorem grid_five_seven_fifty_two_row_pair_capacity_feasible :  ∃ f : Fin 5 → Fin 7 → Fin 52 → Bool,    (∀ z, (layer_mono f z).card = 8) ∧    ∀ x₁ x₂ : Fin 5, x₁ < x₂ → ∀ c : Bool,      (∑ z : Fin 52, ((Finset.univ : Finset (Fin 7 × Fin 7)).filter (fun p =>        p.1 < p.2 ∧ f x₁ p.1 z = c ∧ f x₁ p.2 z = c ∧        f x₂ p.1 z = c ∧ f x₂ p.2 z = c)).card) ≤ 21 := ⟨grid_five_seven_fifty_two_row_pair_capacity_feasible_witness,   grid_five_seven_fifty_two_row_pair_capacity_feasible_card,   grid_five_seven_fifty_two_row_pair_capacity_feasible_cap⟩
See it in the graphDiscuss this resultChallenge it