brgc_word_two
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.
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.
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
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
theorem brgc_word_two : brgc_word 2 = 3 := by decide