AFTD Auto-Formalizing Theoretical Domains

magic_square_even_sign_strings_card

theoremverified

Sanity check of the encoding of Alice's legal answers: exactly 4 of the 8 sign strings of length 3 have an even number of -1 signs (product +1).

Statement

theorem magic_square_even_sign_strings_card :
    (Finset.univ.filter (fun s : Fin 3 → Bool => xor (xor (s 0) (s 1)) (s 2) = false)).card = 4
Source
Sanity lemma for magic_square_strategy_valid (arXiv:2610.12001 (Exact value and rigidity of the 2x3 magic rectangle), Eq. (3): four even strings).
Verified
02 Nov 2026
Axioms
Classical.choiceQuot.soundpropext

The proof, explained

The theorem asserts that exactly 4 out of the 8 length-3 boolean sequences have an even parity (their XOR sum is false). Since the search space is finite and small, the proof proceeds by exhaustive computation via Lean's `decide` tactic.

  1. The number of boolean vectors $s \in \mathrm{Fin}\ 3 \to \mathrm{Bool}$ with $s(0) \oplus s(1) \oplus s(2) = \mathrm{false}$ is exactly $4$. automation

    The domain $\mathrm{Fin}\ 3 \to \mathrm{Bool}$ is finite, consisting of $2^3 = 8$ elements, and the parity condition is decidable. The `decide` tactic evaluates the condition on each of the 8 candidates by computation and counts that exactly 4 satisfy it.

    line 3

      decide

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

theorem magic_square_even_sign_strings_card :    (Finset.univ.filter (fun s : Fin 3 → Bool => xor (xor (s 0) (s 1)) (s 2) = false)).card = 4 := by  decide
See it in the graphDiscuss this resultChallenge it