AFTD Auto-Formalizing Theoretical Domains

grid_box_free_of_le

theoremverified

If $c' \le c$ and $f$ is a box-free $2$-coloring of $[a] \times [b] \times [c]$, then the restriction of $f$ to $[a] \times [b] \times [c']$ is also box-free.

Statement

theorem grid_box_free_of_le {a b c c' : ℕ} (hle : c' ≤ c) {f : Fin a → Fin b → Fin c → Bool} (hf : grid_box_free f) : grid_box_free (fun x y (z : Fin c') => f x y (z.castLE hle))
Source
arXiv:2611.19635 (Constructive and computational methods for extremal and near-extremal box colorings), Sec. 2
Verified
18 Nov 2026
Axioms
none — Lean reports it depends on no axioms
Built on 1
  • grid_box_freeA 2-coloring $f : [a] \times [b] \times [c] \to \{0, 1\}$ is box-free if for all $x_1 < x_2 \le a$, $y_1 < y_2 \le b$, and…
Used by 1

Read back from the Lean

For any natural numbers $a, b, c, c'$, given a proof that $c' \le c$ and a function $f : \mathrm{Fin}\ a \to \mathrm{Fin}\ b \to \mathrm{Fin}\ c \to \mathrm{Bool}$, if $f$ is grid_box_free, then the restriction of $f$ along the third coordinate to $\mathrm{Fin}\ c'$ (mapping $(x, y, z)$ to $f(x, y, z.\mathrm{castLE}\ hle)$) is also grid_box_free.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

The proof, explained

The proof unfolds the definition of box-freeness for the restricted coloring and considers an arbitrary box in [a] × [b] × [c']. Embedding the third coordinate via Fin.castLE preserves the strict inequality between coordinates, yielding a valid box in the larger grid [a] × [b] × [c]. The box-freeness of the original coloring f then guarantees that the vertices of this box cannot all share the same color.

  1. To show that the restricted coloring is box-free, it suffices to show that an arbitrary box with coordinates x₁ < x₂, y₁ < y₂, and z₁ < z₂ in [a] × [b] × [c'] is not monochromatic.

    By definition of grid_box_free, we introduce the grid coordinates x₁, x₂ : Fin a, y₁, y₂ : Fin b, and z₁, z₂ : Fin c', together with the assumptions hx : x₁ < x₂, hy : y₁ < y₂, and hz : z₁ < z₂.

    line 2

    theorem grid_box_free_of_le {a b c c' : ℕ} (hle : c' ≤ c) {f : Fin a → Fin b → Fin c → Bool} (hf : grid_box_free f) : grid_box_free (fun x y (z : Fin c') => f x y (z.castLE hle)) := fun x₁ x₂ y₁ y₂ z₁ z₂ hx hy hz =>
  2. The eight vertices of the box do not all have the same color under the restricted coloring.

    We embed z₁ and z₂ into Fin c using Fin.castLE hle. The lemma Fin.castLE_lt_castLE_iff shows that this embedding preserves strict inequality, yielding z₁.castLE hle < z₂.castLE hle from hz. Applying the box-freeness hypothesis hf to x₁, x₂, y₁, y₂, and the embedded third coordinates proves that the eight vertices cannot all share the same color.

    line 3

    uses Fin.castLE_lt_castLE_iff

      hf x₁ x₂ y₁ y₂ (z₁.castLE hle) (z₂.castLE hle) hx hy ((Fin.castLE_lt_castLE_iff hle).mpr hz)
Fin.castLE_lt_castLE_iff
For n ≤ m, the canonical embedding Fin n → Fin m strictly preserves the order of indices: castLE h i < castLE h j if and only if i < j.

Written by a model (gemini-3.8-flash) from the Lean source alone (no goal states were available). Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

/-- The restriction of a box-free coloring to fewer layers remains box-free. -/theorem grid_box_free_of_le {a b c c' : ℕ} (hle : c' ≤ c) {f : Fin a → Fin b → Fin c → Bool} (hf : grid_box_free f) : grid_box_free (fun x y (z : Fin c') => f x y (z.castLE hle)) := fun x₁ x₂ y₁ y₂ z₁ z₂ hx hy hz =>  hf x₁ x₂ y₁ y₂ (z₁.castLE hle) (z₂.castLE hle) hx hy ((Fin.castLE_lt_castLE_iff hle).mpr hz)
See it in the graphDiscuss this resultChallenge it