AFTD Auto-Formalizing Theoretical Domains

brgc_word_two

theoremverified

Sanity check: the BRGC word of rank 2 is 011.

Statement

theorem brgc_word_two : brgc_word 2 = 3
Source
sanity check for brgc_word (OP-392)
Verified
20 Oct 2026
Axioms
propext
Built on 1
  • brgc_wordThe binary reflected Gray code word of rank t, read as a binary number: g(t) = t xor floor(t/2).

The proof, explained

The claim states that the binary reflected Gray code (BRGC) word at index 2 equals 3. By definition, this word is computed as $2 \oplus \lfloor 2 / 2 \rfloor = 2 \oplus 1 = 3$, which Lean verifies by direct computation.

  1. brgc_word 2 = 3 automation

    By definition, $\operatorname{brgc\_word}(2) = 2 \oplus (2 / 2) = 2 \oplus 1$, where $\oplus$ denotes bitwise XOR. Since $2 \oplus 1 = 3$, the identity holds by direct finite computation.

    line 1

    theorem brgc_word_two : brgc_word 2 = 3 := by 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 brgc_word_two : brgc_word 2 = 3 := by decide
See it in the graphDiscuss this resultChallenge it