Documentation

Mathlib.Logic.Equiv.Fin.Rotate

Cyclic permutations on Fin n #

This file defines

def finRotate (n : ) :

Rotate Fin n one step to the right.

Equations
Instances For
    theorem finRotate_of_lt {n k : } (h : k < n) :
    (finRotate (n + 1)) k, = k + 1,
    theorem finRotate_last' {n : } :
    (finRotate (n + 1)) n, = 0,
    theorem finRotate_last {n : } :
    (finRotate (n + 1)) (Fin.last n) = 0
    theorem Fin.snoc_eq_cons_rotate {n : } {α : Type u_1} (v : Fin nα) (a : α) :
    snoc v a = fun (i : Fin (n + 1)) => cons a v ((finRotate (n + 1)) i)
    @[simp]
    theorem finRotate_succ_apply {n : } (i : Fin (n + 1)) :
    (finRotate (n + 1)) i = i + 1
    theorem coe_finRotate_of_ne_last {n : } {i : Fin n.succ} (h : i Fin.last n) :
    ((finRotate (n + 1)) i) = i + 1
    theorem coe_finRotate {n : } (i : Fin n.succ) :
    ((finRotate n.succ) i) = if i = Fin.last n then 0 else i + 1
    theorem lt_finRotate_iff_ne_last {n : } (i : Fin (n + 1)) :
    i < (finRotate (n + 1)) i i Fin.last n
    theorem lt_finRotate_iff_ne_neg_one {n : } [NeZero n] (i : Fin n) :
    i < (finRotate n) i i -1
    @[simp]
    theorem finRotate_succ_symm_apply {n : } [NeZero n] (i : Fin n) :
    (Equiv.symm (finRotate n)) i = i - 1
    theorem coe_finRotate_symm_of_ne_zero {n : } [NeZero n] {i : Fin n} (hi : i 0) :
    ((Equiv.symm (finRotate n)) i) = i - 1
    theorem finRotate_symm_lt_iff_ne_zero {n : } [NeZero n] (i : Fin n) :
    (Equiv.symm (finRotate n)) i < i i 0
    def finCycle {n : } (k : Fin n) :

    The permutation on Fin n that adds k to each number.

    Equations
    • finCycle k = { toFun := fun (i : Fin n) => i + k, invFun := fun (i : Fin n) => i - k, left_inv := , right_inv := }
    Instances For
      @[simp]
      theorem finCycle_symm_apply {n : } (k i : Fin n) :
      (Equiv.symm (finCycle k)) i = i - k
      @[simp]
      theorem finCycle_apply {n : } (k i : Fin n) :
      (finCycle k) i = i + k
      theorem finCycle_eq_finRotate_iterate {n : } {k : Fin n} :
      (finCycle k) = (⇑(finRotate n))^[k]