Section RotrLemmas.
Variables (n0 : nat) (T : Type) (T' : eqType).
Implicit Types (x : T) (s : seq T).
Definition rot_add s n m (k := size s) (p := minn m k + minn n k) :=
locked (if p <= k then p else p - k).

Lemma mask_rot m s : size m = size s ->
mask (rot n0 m) (rot n0 s) = rot (count id (take n0 m)) (mask m s).