AFTD Auto-Formalizing Theoretical Domains

hypercube_coord_reflect_involutive

theoremverified

For any coordinate subset T of Fin n and any Boolean vector x : Fin n → Bool, applying coordinate reflection with respect to T twice returns x.

Statement

theorem hypercube_coord_reflect_involutive {n : ℕ} (T : Finset (Fin n)) (x : Fin n → Bool) :
    hypercube_coord_reflect T (hypercube_coord_reflect T x) = x
Source
arXiv:2610.38287 Eq. (14)
Verified
08 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
  • hypercube_coord_reflectGiven a coordinate subset T of Fin n and a Boolean vector x : Fin n → Bool, hypercube_coord_reflect T x is the Boolean vector obtained by…
Used by 1

Read back from the Lean

For every natural number $n$, every subset $T \subseteq \text{Fin } n$ (as a Finset), and every boolean vector $x : \text{Fin } n \to \text{Bool}$, applying hypercube_coord_reflect T twice to $x$ yields $x$ itself.

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

To show that coordinate reflection with respect to a coordinate set T is an involution, we consider an arbitrary coordinate i of the hypercube. By definition, coordinate reflection negates the i-th bit if i ∈ T and leaves it fixed otherwise. Applying the reflection twice either flips the bit twice or leaves it fixed twice, which in both cases preserves the original value x(i).

  1. It suffices to show that the double reflection agrees with x at every coordinate i

    By function extensionality (the ext tactic), two Boolean vectors on Fin n are equal if and only if they agree at every coordinate i.

    line 4

      ext i
  2. At every coordinate i, reflecting twice preserves the coordinate value x(i)

    Unfolding the definition of hypercube_coord_reflect rewrites the double reflection at coordinate i into nested conditionals depending on whether i ∈ T. A case split on whether i ∈ T shows: if i ∈ T, the coordinate is negated twice (!!x(i) = x(i)); if i ∉ T, the coordinate is left unchanged both times (x(i) = x(i)). In either case, the result simplifies to x(i).

    lines 5–6

    uses hypercube_coord_reflect

      simp [hypercube_coord_reflect]
      split_ifs <;> simp
hypercube_coord_reflect
the coordinate reflection of a Boolean vector x along a subset of coordinates T, which flips x(i) if i ∈ T and leaves x(i) unchanged otherwise

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

/-- Coordinate reflection on the unit hypercube is an involution. -/theorem hypercube_coord_reflect_involutive {n : ℕ} (T : Finset (Fin n)) (x : Fin n → Bool) :    hypercube_coord_reflect T (hypercube_coord_reflect T x) = x := by  ext i  simp [hypercube_coord_reflect]  split_ifs <;> simp
See it in the graphDiscuss this resultChallenge it