AFTD Auto-Formalizing Theoretical Domains

bitword_rotate

def

Cyclic rotation of an n-bit word x (a number below 2^n) by one position: the word is shifted up and its top bit moves to the bottom.

Statement

def bitword_rotate (n x : ℕ) : ℕ
Defined in
arXiv:2610.24758 (Optimal single-track Gray codes from Gray-ordered necklaces), Conjecture 1 (prime case of a conjecture from 2007), Sec. 1; cyclic shift of words
Verified
20 Oct 2026
Axioms
none listed
Used by 29

Lean source view module on GitHub

/-- Cyclic rotation of an n-bit word x (a number below 2^n) by one position: the word is shifted up and its top bit moves to the bottom. -/
def bitword_rotate (n x : ℕ) : ℕ := (2 * x) % 2 ^ n + x / 2 ^ (n - 1)
See it in the graphDiscuss this resultChallenge it