fact: Definition majority_vote r (s : seq 'F_2) : option 'rV['F_2]_r := let cnt := N(1 | s) in if r./2 < cnt then Some (const_mx 1) else if (r./2 == cnt) && ~~ odd r then None else Some 0.
imports: mathcomp(all_ssreflect ssralg fingroup finalg perm zmodp) mathcomp(matrix mxalgebra vector) hamming num_occ ssralg_ext f2 linearcode decoding channel_code