fact: Definition swap i j (s : seq A) := if s is a :: _ then let s1 := take i s in let s2 := drop i s in let s3 := behead s2 in let s4 := take (j - i).-1 s3 in let s5 := drop (j - i).-1 s3 in let v1 := head a s2 in let v2 := head a s5 in s1 ++ min v1 v2 :: s4 ++ max v1 v2 :: behead s5 else [::].
imports: mathcomp(all_ssreflect perm algebra.zmodp) mathcomp(zify) more_tuple nsort