cyclic_rotate_left
def
Given a type α, a natural number k, and a word w : Fin k → α, cyclic_rotate_left k w is the function Fin k → α mapping each index j : Fin k to w evaluated at the index (j.val + 1) % k.
Statement
def cyclic_rotate_left {α : Type*} (k : ℕ) (w : Fin k → α) : Fin k → α
- Defined in
- folklore
- Verified
- 01 Nov 2026
- Axioms
- none listed
- Used by 7
- dual_melas_joint_pattern_probFor a field F finite-dimensional over ZMod 2, natural number k, elements α, c : F, and natural numbers a, b : ℕ,…
- cyclic_rotate_left_bijectiveFor any positive natural number k and any type α, cyclic_rotate_left k is a bijection on Fin k → α.
- dual_melas_pattern_count_cyclic_rotate_left_sumFor any field F finite-dimensional over ZMod 2, positive natural number k, and elements α, c ∈ F, the sum over all words w : Fin k → ZMod…
- dual_melas_joint_pattern_prob_sumFor any field F finite-dimensional over ZMod 2, natural number k, and elements α, c ∈ F, the sum of dual_melas_joint_pattern_prob k α c a…
- dual_melas_joint_pattern_prob_eq_zero_of_geFor any field F finite-dimensional over ZMod 2, natural number k, elements α, c ∈ F, and natural numbers a, b such that 2^k ≤ a or 2^k ≤…
- dual_melas_joint_pattern_prob_le_oneFor any field F finite-dimensional over ZMod 2, natural number k, elements α, c ∈ F, and natural numbers a, b,…
- dual_melas_joint_pattern_prob_nonnegFor any field F finite-dimensional over ZMod 2, natural number k, elements α, c ∈ F, and natural numbers a, b,…
Read back from the Lean
Given a type α, a natural number k, and a function w : Fin k → α, cyclic_rotate_left k w is the function Fin k → α sending each index j : Fin k to w evaluated at (j.val + 1) % k (as an element of Fin k).
Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.
Lean source view module on GitHub
/-- The 1-step cyclic left-shift of a length-k word w. -/ def cyclic_rotate_left {α : Type*} (k : ℕ) (w : Fin k → α) : Fin k → α := fun j => w ⟨(j.val + 1) % k, Nat.mod_lt _ (pos_of_gt j.isLt)⟩