fact
stringlengths
9
8.91k
type
stringclasses
20 values
library
stringclasses
7 values
imports
listlengths
1
12
filename
stringclasses
87 values
symbolic_name
stringlengths
1
38
docstring
stringclasses
1 value
location_polynomial_points := \row_i \prod_(j < n | j != i) (a ``_ i - a ``_ j).
Definition
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg finalg poly polydiv.", "From mathcomp Require Import cyclic perm matrix mxpoly vector mxalgebra zmodp.", "From mathcomp Require Import finfield falgebra fieldext.", "Require Import ssr_ext ssralg_ext linearcode.", "Require Import dft poly_decoding grs bch."...
ecc_classic/alternant.v
location_polynomial_points
b := \row_(i < n) (((location_polynomial_points a) ``_ i)^-1 * g.[a ``_ i]). Variable (r : nat).
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg finalg poly polydiv.", "From mathcomp Require Import cyclic perm matrix mxpoly vector mxalgebra zmodp.", "From mathcomp Require Import finfield falgebra fieldext.", "Require Import ssr_ext ssralg_ext linearcode.", "Require Import dft poly_decoding grs bch."...
ecc_classic/alternant.v
b
GRS_PCM_polynomial := @GRS.PCM _ F a b r.
Definition
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg finalg poly polydiv.", "From mathcomp Require Import cyclic perm matrix mxpoly vector mxalgebra zmodp.", "From mathcomp Require Import finfield falgebra fieldext.", "Require Import ssr_ext ssralg_ext linearcode.", "Require Import dft poly_decoding grs bch."...
ecc_classic/alternant.v
GRS_PCM_polynomial
ext_inj : {rmorphism F0 -> F1} := [the {rmorphism F0 -> F1} of @GRing.in_alg _ _].
Definition
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg finalg poly polydiv.", "From mathcomp Require Import cyclic perm matrix mxpoly vector mxalgebra zmodp.", "From mathcomp Require Import finfield falgebra fieldext.", "Require Import ssr_ext ssralg_ext linearcode.", "Require Import dft poly_decoding grs bch."...
ecc_classic/alternant.v
ext_inj
ext_inj_tmp : {rmorphism F0 -> (FinFieldExtType F1)} := ext_inj. Variable n : nat.
Definition
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg finalg poly polydiv.", "From mathcomp Require Import cyclic perm matrix mxpoly vector mxalgebra zmodp.", "From mathcomp Require Import finfield falgebra fieldext.", "Require Import ssr_ext ssralg_ext linearcode.", "Require Import dft poly_decoding grs bch."...
ecc_classic/alternant.v
ext_inj_tmp
ext_inj_rV : 'rV[F0]_n -> 'rV[F1]_n := @map_mx _ _ ext_inj 1 n.
Definition
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg finalg poly polydiv.", "From mathcomp Require Import cyclic perm matrix mxpoly vector mxalgebra zmodp.", "From mathcomp Require Import finfield falgebra fieldext.", "Require Import ssr_ext ssralg_ext linearcode.", "Require Import dft poly_decoding grs bch."...
ecc_classic/alternant.v
ext_inj_rV
u := u'.+1. Hypothesis primep : prime p.
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg finalg poly polydiv.", "From mathcomp Require Import cyclic perm matrix mxpoly vector mxalgebra zmodp.", "From mathcomp Require Import finfield falgebra fieldext.", "Require Import ssr_ext ssralg_ext linearcode.", "Require Import dft poly_decoding grs bch."...
ecc_classic/alternant.v
u
Fq : finFieldType := GF u primep.
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg finalg poly polydiv.", "From mathcomp Require Import cyclic perm matrix mxpoly vector mxalgebra zmodp.", "From mathcomp Require Import finfield falgebra fieldext.", "Require Import ssr_ext ssralg_ext linearcode.", "Require Import dft poly_decoding grs bch."...
ecc_classic/alternant.v
Fq
q := p ^ u.
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg finalg poly polydiv.", "From mathcomp Require Import cyclic perm matrix mxpoly vector mxalgebra zmodp.", "From mathcomp Require Import finfield falgebra fieldext.", "Require Import ssr_ext ssralg_ext linearcode.", "Require Import dft poly_decoding grs bch."...
ecc_classic/alternant.v
q
p_char : p \in [pchar Fq]. Proof. apply: char_GFqm. Qed. (** declare F_{q^m} *) Variable m' : nat.
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg finalg poly polydiv.", "From mathcomp Require Import cyclic perm matrix mxpoly vector mxalgebra zmodp.", "From mathcomp Require Import finfield falgebra fieldext.", "Require Import ssr_ext ssralg_ext linearcode.", "Require Import dft poly_decoding grs bch."...
ecc_classic/alternant.v
p_char
m := m'.+1. Variable Fqm : fieldExtType Fq. Hypothesis card_Fqm : #| FinFieldExtType Fqm | = q ^ m. (** build GRS_k(kappa, g) *) Variable n : nat. Variable a : 'rV[Fqm]_n. Variable g : {poly Fqm}. Variable k : nat.
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg finalg poly polydiv.", "From mathcomp Require Import cyclic perm matrix mxpoly vector mxalgebra zmodp.", "From mathcomp Require Import finfield falgebra fieldext.", "Require Import ssr_ext ssralg_ext linearcode.", "Require Import dft poly_decoding grs bch."...
ecc_classic/alternant.v
m
alternant_PCM : 'M_(k, n) := @GRS_PCM_polynomial n (FinFieldExtType Fqm) a g k.
Definition
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg finalg poly polydiv.", "From mathcomp Require Import cyclic perm matrix mxpoly vector mxalgebra zmodp.", "From mathcomp Require Import finfield falgebra fieldext.", "Require Import ssr_ext ssralg_ext linearcode.", "Require Import dft poly_decoding grs bch."...
ecc_classic/alternant.v
alternant_PCM
alternant_code := Rcode.t (@ext_inj_tmp Fq Fqm) (kernel alternant_PCM). (** Goppa codes are a special case of alternant codes *)
Definition
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg finalg poly polydiv.", "From mathcomp Require Import cyclic perm matrix mxpoly vector mxalgebra zmodp.", "From mathcomp Require Import finfield falgebra fieldext.", "Require Import ssr_ext ssralg_ext linearcode.", "Require Import dft poly_decoding grs bch."...
ecc_classic/alternant.v
alternant_code
goppa_code_condition := size g = (n - k).+1.
Definition
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg finalg poly polydiv.", "From mathcomp Require Import cyclic perm matrix mxpoly vector mxalgebra zmodp.", "From mathcomp Require Import finfield falgebra fieldext.", "Require Import ssr_ext ssralg_ext linearcode.", "Require Import dft poly_decoding grs bch."...
ecc_classic/alternant.v
goppa_code_condition
u := u'.+1. Hypothesis primep : prime p.
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg finalg poly polydiv.", "From mathcomp Require Import cyclic perm matrix mxpoly vector mxalgebra zmodp.", "From mathcomp Require Import finfield falgebra fieldext.", "Require Import ssr_ext ssralg_ext linearcode.", "Require Import dft poly_decoding grs bch."...
ecc_classic/alternant.v
u
Fq : finFieldType := GF u primep.
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg finalg poly polydiv.", "From mathcomp Require Import cyclic perm matrix mxpoly vector mxalgebra zmodp.", "From mathcomp Require Import finfield falgebra fieldext.", "Require Import ssr_ext ssralg_ext linearcode.", "Require Import dft poly_decoding grs bch."...
ecc_classic/alternant.v
Fq
q := p ^ u.
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg finalg poly polydiv.", "From mathcomp Require Import cyclic perm matrix mxpoly vector mxalgebra zmodp.", "From mathcomp Require Import finfield falgebra fieldext.", "Require Import ssr_ext ssralg_ext linearcode.", "Require Import dft poly_decoding grs bch."...
ecc_classic/alternant.v
q
p_char : p \in [pchar Fq]. Proof. apply: char_GFqm. Qed. (** declare F_{q^m} *) Variable m' : nat.
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg finalg poly polydiv.", "From mathcomp Require Import cyclic perm matrix mxpoly vector mxalgebra zmodp.", "From mathcomp Require Import finfield falgebra fieldext.", "Require Import ssr_ext ssralg_ext linearcode.", "Require Import dft poly_decoding grs bch."...
ecc_classic/alternant.v
p_char
m := m'.+1. Variable Fqm : fieldExtType Fq. Hypothesis card_Fqm : #| FinFieldExtType Fqm | = q ^ m. (** we are talking about narrow-sense Goppa codes *)
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg finalg poly polydiv.", "From mathcomp Require Import cyclic perm matrix mxpoly vector mxalgebra zmodp.", "From mathcomp Require Import finfield falgebra fieldext.", "Require Import ssr_ext ssralg_ext linearcode.", "Require Import dft poly_decoding grs bch."...
ecc_classic/alternant.v
m
n : nat := (q^m).-1. Variable e : Fqm. Hypothesis e_prim : n.-primitive_root e.
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg finalg poly polydiv.", "From mathcomp Require Import cyclic perm matrix mxpoly vector mxalgebra zmodp.", "From mathcomp Require Import finfield falgebra fieldext.", "Require Import ssr_ext ssralg_ext linearcode.", "Require Import dft poly_decoding grs bch."...
ecc_classic/alternant.v
n
a : 'rV[Fqm]_n := rVexp e n. Variable t : nat. (** we have to instantiate Goppa codes with a monomial to recover BCH codes *)
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg finalg poly polydiv.", "From mathcomp Require Import cyclic perm matrix mxpoly vector mxalgebra zmodp.", "From mathcomp Require Import finfield falgebra fieldext.", "Require Import ssr_ext ssralg_ext linearcode.", "Require Import dft poly_decoding grs bch."...
ecc_classic/alternant.v
a
g : {poly (FinFieldExtType Fqm)} := 'X^(n - t). (** from the Goppa code condition, we have only one choice for its degree *)
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg finalg poly polydiv.", "From mathcomp Require Import cyclic perm matrix mxpoly vector mxalgebra zmodp.", "From mathcomp Require Import finfield falgebra fieldext.", "Require Import ssr_ext ssralg_ext linearcode.", "Require Import dft poly_decoding grs bch."...
ecc_classic/alternant.v
g
goppa_code_condition_check : goppa_code_condition n g t. Proof. by rewrite /goppa_code_condition size_polyXn. Qed. (* NB: we only have binary BCH codes, so we should maybe restrict q at this point *) (** wip *)
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg finalg poly polydiv.", "From mathcomp Require Import cyclic perm matrix mxpoly vector mxalgebra zmodp.", "From mathcomp Require Import finfield falgebra fieldext.", "Require Import ssr_ext ssralg_ext linearcode.", "Require Import dft poly_decoding grs bch."...
ecc_classic/alternant.v
goppa_code_condition_check
narrow_sense_BCH_are_Goppa : @BCH.PCM (FinFieldExtType _) _ a t = @alternant_PCM _ u' primep Fqm _ a g t(*?*). Proof. rewrite /BCH.code /alternant_code. Abort.
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg finalg poly polydiv.", "From mathcomp Require Import cyclic perm matrix mxpoly vector mxalgebra zmodp.", "From mathcomp Require Import finfield falgebra fieldext.", "Require Import ssr_ext ssralg_ext linearcode.", "Require Import dft poly_decoding grs bch."...
ecc_classic/alternant.v
narrow_sense_BCH_are_Goppa
PCM : 'M_(t, n) := \matrix_(i < t, j < n) (a ``_ j) ^+ i.*2.+1.
Definition
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
PCM
PCM_alt : 'M[F]_(t.*2, n) := \matrix_(i < t.*2, j < n) (a ``_ j) ^+ i.+1.
Definition
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
PCM_alt
PCM_alt_GRS : PCM_alt = GRS.PCM a a t.*2. Proof. apply/matrixP => i j. rewrite !mxE (bigD1 j) //= !mxE eqxx mulr1n exprS mulrC. rewrite (eq_bigr (fun=> 0)) ?big_const ?iter_addr0 ?addr0 // => k kj. by rewrite !mxE (negbTE kj) mulr0n mulr0. Qed.
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
PCM_alt_GRS
m := m'.+1.
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
m
F := GF2 m. Variable a : 'rV[F]_n. Variable t : nat.
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
F
BCH_PCM_altP2 (x : 'rV[F]_n) : (forall i : 'I_t.*2, \sum_j x ``_ j * a ``_ j ^+ i.+1 = 0) -> (forall i : 'I_t,\sum_j x ``_ j * a ``_ j ^+ i.*2.+1 = 0). Proof. move=> H i. have @j : 'I_t.*2 by refine (@Ordinal _ i.*2 _); rewrite -!muln2 ltn_pmul2r. rewrite -[RHS](H j); by apply: eq_bigr => /= k _. Qed.
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
BCH_PCM_altP2
BCH_PCM_altP1 (x : 'rV['F_2]_n) : (forall i : 'I_t, \sum_j GF2_of_F2 x ``_ j * a ``_ j ^+ i.*2.+1 = 0) -> (forall i : 'I_t.*2, \sum_j GF2_of_F2 x ``_ j * a ``_ j ^+ i.+1 = 0). Proof. move=> H [i]. elim: i {-2}i (leqnn i) => [|i IH j ji i1]. move=> i; rewrite leqn0 => /eqP -> i0. destruct t. exfalso; by rewrite -muln2 m...
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
BCH_PCM_altP1
PCM_altP (x : 'rV_n) : (syndrome (BCH.PCM a t) (F2_to_GF2 m x) == 0) = (syndrome (BCH.PCM_alt a t) (F2_to_GF2 m x) == 0). Proof. apply/idP/idP. - rewrite /BCH.PCM /BCH.PCM_alt /syndrome => H. suff H' : forall j : 'I_t.*2, \sum_j0 (GF2_of_F2 (x ``_ j0) * (a ``_ j0) ^+ j.+1) = 0. apply/eqP/rowP => j; rewrite !mxE. rewrit...
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
PCM_altP
code (a : 'rV_n) t := Rcode.t (@GF2_of_F2 m) (kernel (PCM a t)).
Definition
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
code
n := n'.+1. Variable (m : nat).
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
n
F : fieldType := GF2 m. Implicit Types a : 'rV[F]_n.
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
F
syndromep a y t := syndromep a (F2_to_GF2 m y) t.*2.
Definition
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
syndromep
F := GF2 m. Variable (n' : nat).
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
F
n := n'.+1. Variable a : F. Variable (t : nat). Hypothesis tn : t.*2 < n.
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
n
fdcoor_syndrome_coord (y : 'rV['F_2]_n) i (it : i < t.*2) : fdcoor (rVexp a n) (F2_to_GF2 m y) (inord i.+1) = GRS.syndrome_coord (rVexp a n) (rVexp a n) i (F2_to_GF2 m y). Proof. rewrite /fdcoor /GRS.syndrome_coord horner_poly; apply: eq_bigr => j _. rewrite insubT // => jn. rewrite !mxE -mulrA; congr (GF2_of_F2 (y _ _...
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
fdcoor_syndrome_coord
BCH_syndromep_is_GRS_syndromep y : \BCHsynp_(rVexp a n, y, t) = GRS.syndromep (rVexp a n) (rVexp a n) t.*2 (F2_to_GF2 m y). Proof. apply/polyP => i. by rewrite !coef_poly; case: ifPn => // it; rewrite fdcoor_syndrome_coord. Qed.
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
BCH_syndromep_is_GRS_syndromep
n := n'.+1.
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
n
F := GF2 m. Variable a : F. Variable t : nat. Variable BCHcode : BCH.code (rVexp a n) t. Hypothesis tn : t <= n.-1./2.
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
F
BCH_codebook (c : 'rV['F_2]_n) : (c \in BCHcode) = [forall j : 'I_t, (map_mx (@GF2_of_F2 m) c) ^`_(rVexp a n, inord j.*2.+1) == 0]. Proof. apply/idP/idP. - case: BCHcode => code condition /= /condition. rewrite mem_kernel_syndrome0 -trmx0 => /eqP/trmx_inj/matrixP Hc. apply/forallP => /= i; apply/eqP; rewrite /fdcoor ho...
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
BCH_codebook
n := n'.+1.
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
n
F := GF2 m. Variable a : F. Variable t' : nat.
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
F
t := t'.+1.
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
t
BCH_syndrome_synp y : t.*2 < n -> (syndrome (BCH.PCM (rVexp a n) t) (F2_to_GF2 m y) == 0) = (\BCHsynp_(rVexp a n, y, t) == 0). Proof. move=> tn. apply/idP/idP. - move/eqP/eqP. rewrite BCH.PCM_altP // /BCH.PCM_alt. move/eqP => K. rewrite /BCH.syndromep /syndromep. rewrite poly_def (eq_bigr (fun=> 0)) ?big_const ?iter_ad...
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
BCH_syndrome_synp
F := GF2 m. Variable a : 'rV[F]_n.
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
F
BCH_det_mlinear t r' (f : 'I_r'.+1 -> 'I_n) (rt : r' < t.*2) : let B := \matrix_(i, j) BCH.PCM_alt a t (widen_ord rt i) (f j) in let V := Vandermonde r'.+1 (row 0 B) in \det B = \prod_(i < r'.+1) BCH.PCM_alt a t (widen_ord rt 0) (f i) * \det V. Proof. move=> B V. set h := Vandermonde r'.+1 (row 0 B). set g := fun i => ...
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
BCH_det_mlinear
det_B_neq0 t r f (Hr' : r.+1 < t.*2) (Hinj : injective f) : let B := \matrix_(i < r.+1, j < r.+1) BCH.PCM_alt a t (widen_ord (ltnW Hr') i) (f j) in \det B != 0. Proof. rewrite /=; set B := \matrix_(_, _) _. rewrite BCH_det_mlinear det_Vandermonde mulf_neq0 //. - rewrite prodf_seq_neq0 /=; apply/allP => /= j _. by rewri...
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
det_B_neq0
BCH_min_dist1 t x (x0 : x != 0) (t0 : 0 < t) (C : BCH.code a t) : x \in C -> t < wH x. Proof. move/(proj1 (Rcode.P C _)). rewrite mem_kernel_syndrome0 BCH.PCM_altP // => /eqP H. (* there are r <= t columns in the PCM s.t. their linear comb. w.r.t. is 0 *) rewrite leqNgt; apply/negP => abs. have /eqP : #| wH_supp x | = ...
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
BCH_min_dist1
BCH_erreval := erreval (const_mx 1) a.
Definition
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
BCH_erreval
n := n'.+1. Variable a : F. (** see [McEliece 2002], thm 9.4 *)
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
n
BCH_key_equation_old (y : 'rV[F]_n) : a ^+ n = 1 -> \sigma_(rVexp a n, y) * rVpoly (dft (rVexp a n) n y) = \BCHomega_(rVexp a n, y) * (1 - 'X^n). Proof. move=> an1. rewrite dftE big_distrr /=. under eq_bigr. move=> i ie. rewrite -scalerAr. rewrite (_ : \sigma_(rVexp a n, y) = \sigma_(rVexp a n, y, i) * (1 - ((rVexp a n...
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
BCH_key_equation_old
n := n'.+1.
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
n
F := GF2 m. Variable a : F. Variable t' : nat.
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
F
t := t'.+1.
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
t
H := BCH.PCM (rVexp a n) t. Hypothesis a_neq0 : a != 0.
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
H
BCH_mod (y : 'rV[F]_n) : {poly F} := \sum_(i in supp y) y ``_ i *: (\prod_(j in supp y :\ i) (1 - a ^+ j *: 'X) * - (a ^+ (t.*2.+1 * i))%:P).
Definition
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
BCH_mod
BCH_mod_is_GRS_mod y : BCH_mod y = GRS_mod y (rVexp a n) (rVexp a n) t.*2. Proof. rewrite /BCH_mod /GRS_mod; apply/eq_bigr => i iy. rewrite !mulrN scalerN; congr (- _). rewrite -!scalerAl; congr (_ *: _). rewrite mxE -mulrA; congr (_ * _). apply/eq_big. by move=> j; rewrite in_setD1 andbC. move=> j _; by rewrite mxE. b...
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
BCH_mod_is_GRS_mod
BCH_key_equation y : \sigma_(rVexp a n, F2_to_GF2 m y) * \BCHsynp_(rVexp a n, y, t) = \BCHomega_(rVexp a n, twisted a (F2_to_GF2 m y)) + BCH_mod (F2_to_GF2 m y) * 'X^(t.*2). Proof. move: (@GRS_key_equation F n (F2_to_GF2 m y) (rVexp a n) (rVexp a n) t.*2) => H0. rewrite BCH_syndromep_is_GRS_syndromep // H0; congr (_ + ...
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
BCH_key_equation
errloc_twisted (y : 'rV[F]_n) : errloc (rVexp a n) (supp y) = errloc (rVexp a n) (supp (twisted a y)). Proof. by rewrite /errloc supp_twisted. Qed.
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
errloc_twisted
size_erreval_twisted (e : 'rV_n) : #|supp (F2_to_GF2 m e)| <= t -> size (\omega_(const_mx 1, rVexp a n, twisted a (F2_to_GF2 m e))) <= t. Proof. move=> et. have et' : #|supp (twisted a (F2_to_GF2 m e))| <= t by rewrite supp_twisted. by apply: (size_erreval (rVexp a n) (Errvec et') (const_mx 1)). Qed. Local Notation "'v...
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
size_erreval_twisted
BCH_err y : {poly 'F_2} := let r0 : {poly F} := 'X^(t.*2) in let r1 := \BCHsynp_(rVexp a n, y, t) in let vstop := v r0 r1 (stop t r0 r1) in let s := vstop.[0]^-1 *: vstop in \poly_(i < n) (if s.[a^- i] == 0 then 1 else 0).
Definition
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
BCH_err
BCH_repair : repairT 'F_2 'F_2 n := [ffun y => if \BCHsynp_(rVexp a n, y, t) == 0 then Some y else let ret := y + poly_rV (BCH_err y) in if \BCHsynp_(rVexp a n, ret, t) == 0 then Some ret else None].
Definition
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
BCH_repair
BCH_err_is_correct (a_not_uroot : not_uroot_on a n) l (e y : 'rV_n) : let r0 := 'X^(t.*2) : {poly F} in let r1 := \BCHsynp_(rVexp a n, y, t) in let vj := Euclid.v r0 r1 (stop t r0 r1) in l <> 0 -> vj = l *: \sigma_(rVexp a n, F2_to_GF2 m e) -> e = poly_rV (BCH_err y). Proof. have H1 := distinct_non_zero_rVexp a_neq0 a_...
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
BCH_err_is_correct
BCH_repair_is_correct (C : BCH.code (rVexp a n) t) : not_uroot_on a n -> t.-BDD (C, BCH_repair). Proof. move=> a_not_uroot c e. set y := c + e. set r0 : {poly F} := 'X^(t.*2). set r1 := \BCHsynp_(rVexp a n, y, t). set vj := Euclid.v r0 r1 (stop t r0 r1). move=> Hc et. set r : {poly F} := \BCHomega_(rVexp a n, twisted a...
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
BCH_repair_is_correct
n := n'.+1.
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
n
F := GF2 m. Variable a : F. Variable t : nat. Hypothesis tn : t <= n.-1./2. Local Open Scope cyclic_code_scope.
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
F
rcsP_BCH_cyclic (C : BCH.code (rVexp a n) t) : a ^+ n = 1 -> rcsP [set cw in C]. Proof. move=> a1 x. rewrite inE (BCH_codebook C tn) => /forallP /= Hx. rewrite inE (BCH_codebook C tn); apply/forallP => /= i. rewrite map_mx_rcs rcs_rcs_poly /rcs_poly. set x' := map_mx _ _. have [M HM] : exists M, `[ 'X * rVpoly x' ]_ n ...
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv finalg zmodp.", "From mathcomp Require Import matrix mxalgebra mxpoly vector fieldext finfield.", "Require Import ssralg_ext hamming linearcode decoding cyclic_code poly_decoding.", "Require Import dft euclid grs f2." ]
ecc_classic/bch.v
rcsP_BCH_cyclic
rcs_perm_ffun n : {ffun 'I_n.+1 -> 'I_n.+1} := [ffun x : 'I_n.+1 => if x == ord0 then ord_max else inord x.-1].
Definition
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
rcs_perm_ffun
rcs_perm_ffun_injectiveb n : injectiveb (@rcs_perm_ffun n). Proof. apply/injectiveP => x y. rewrite /rcs_perm_ffun 2!ffunE. case: ifPn => [/eqP ->|x0]. case: ifPn => [/eqP -> //|y0]. move/eqP; rewrite -val_eqE /= => /eqP n0y. exfalso; move: (ltn_ord y). rewrite ltnNge => /negP; apply. rewrite [in X in X < _]n0y /= inor...
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
rcs_perm_ffun_injectiveb
rcs_perm n : {perm 'I_n} := if n is n.+1 then Perm (rcs_perm_ffun_injectiveb n) else 1.
Definition
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
rcs_perm
rcs (R : idomainType) n (x : 'rV[R]_n) := col_perm (rcs_perm n) x.
Definition
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
rcs
size_rcs (R : idomainType) n (x : 'rV[R]_n.+1) : size (rVpoly (rcs x)) < size ('X^(n.+1) - 1%:P : {poly R}). Proof. by rewrite size_XnsubC // ltnS /rVpoly size_poly. Qed.
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
size_rcs
map_mx_rcs (R0 R1 : idomainType) n (x : 'rV[R0]_n.+1) (f : R0 -> R1) : map_mx f (rcs x) = rcs (map_mx f x). Proof. by rewrite /rcs map_col_perm. Qed.
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
map_mx_rcs
rcs' (R : idomainType) n (x : 'rV[R]_n.+1) := \row_(i < n.+1) (if i == ord0 then x ord0 (inord n) else x ord0 (inord i.-1)).
Definition
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
rcs'
rcs'0 (R : idomainType) n (x : 'rV[R]_n.+1) : (rcs' x == 0) = (x == 0). Proof. apply/idP/idP => [|/eqP ->]. move/eqP/rowP => H; apply/eqP/rowP => i; rewrite !mxE. have ni : i.+1 %% n.+1 < n.+1 by apply: ltn_pmod. move: (H (Ordinal ni)); rewrite !mxE -val_eqE /=. case: ifPn => [in' Hx|in' Hx]. have ? : n = i. case/dvdnP...
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
rcs'0
rcs'_rcs (R : idomainType) n (x : 'rV[R]_n.+1) : rcs' x = rcs x. Proof. rewrite /rcs' /rcs; apply/rowP => i; rewrite !mxE. case: ifPn => [/eqP -> |i0]. congr (x _ _). rewrite /rcs_perm/= unlock/= ffunE eqxx. apply/val_inj => /=. by rewrite inordK. congr (x _ _); apply: val_inj => /=. rewrite unlock ffunE /= inordK. by ...
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
rcs'_rcs
sub_XrVpoly_rcs (R : idomainType) n (x : 'rV[R]_n.+1) : 'X * rVpoly x - rVpoly (rcs x) = (x 0 (inord n))%:P * ('X^(n.+1) - 1). Proof. apply/polyP => i. rewrite coef_add_poly coefXM coefCM coef_add_poly coefXn 2!coef_opp_poly coefC. case: ifPn => [/eqP ->|i0]; last rewrite subr0. rewrite 2!add0r mulrN1 coef_rVpoly /=. c...
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
sub_XrVpoly_rcs
rcs_poly (R : idomainType) (p : {poly R}) n := ('X * p) %% ('X^n - 1).
Definition
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
rcs_poly
size_rcs_poly (R : idomainType) n (x : {poly R}) (xn : size x <= n) : 0 < n -> size (rcs_poly x n) <= n. Proof. move=> n0. rewrite /rcs_poly. set xn1 := _ - _. apply: (@leq_trans (size xn1).-1); last by rewrite /xn1 size_XnsubC. rewrite -ltnS prednK; last by rewrite size_XnsubC. have : xn1 != 0 by apply/monic_neq0/moni...
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
size_rcs_poly
size_rcs_poly_old (R : idomainType) n (x : 'rV[R]_n) : size (rcs_poly (rVpoly x) n) <= n. Proof. destruct n as [|n']. rewrite /rcs_poly subrr modp0. have -> : x = 0 by apply/matrixP => i []. by rewrite linear0 mulr0 size_poly0. by rewrite size_rcs_poly // size_poly. Qed.
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
size_rcs_poly_old
rcs_rcs_poly (F : fieldType) n0 (x : 'rV[F]_n0) : rcs x = poly_rV (rcs_poly (rVpoly x) n0). Proof. destruct n0 as [|n0]. rewrite /rcs_poly (_ : 'X^0 = 1); last first. by apply/polyP => i; rewrite coefXn. rewrite subrr modp0 (_ : rVpoly x = 0); last first. apply/polyP => i. rewrite coef_rVpoly. by case: insubP => //; re...
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
rcs_rcs_poly
rcs_poly_rcs (F : fieldType) n0 (x : {poly F}) (xn0 : size x <= n0.+1) : rcs_poly x n0.+1 = rVpoly (@rcs _ n0.+1 (poly_rV x)). Proof. by rewrite rcs_rcs_poly poly_rV_K // poly_rV_K // size_rcs_poly. Qed.
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
rcs_poly_rcs
rcsP (F: finFieldType) n (C : {set 'rV[F]_n}) := forall x, x \in C -> rcs x \in C.
Definition
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
rcsP
n := n'.+1. Variable (a : F). Local Notation "v ^`_ i" := (fdcoor (rVexp a n) v i) (at level 9).
Let
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
n
fdcoor_rcs' (i : 'I_n) x : a ^+ n = 1 -> a ^+ i * x ^`_ i = 0 -> (rcs x) ^`_ i = 0. Proof. move=> an1. rewrite /fdcoor (@horner_coef_wide _ n); last by rewrite /rVpoly size_poly. rewrite big_distrr /=. rewrite (eq_bigr (fun i1 : 'I_ _ => (rVpoly x)`_i1 * a ^+ i ^+ i1.+1)); last first. move=> i1 _; rewrite mulrC -mulrA;...
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
fdcoor_rcs'
fdcoor_rcs (i : 'I_n) x : a ^+ n = 1 -> x ^`_ i = 0 -> (rcs x) ^`_ i = 0. Proof. move=> H1 H2; by rewrite (fdcoor_rcs' H1) // H2 mulr0. Qed.
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
fdcoor_rcs
loop (T : Type) (f : T -> T) (n : nat) (x : T) := if n is m.+1 then loop f m (f x) else x.
Fixpoint
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
loop
fdcoor_loop_rcs k (i : 'I_n) (x : 'rV_n) : a ^+ n = 1 -> x ^`_ i = 0 -> (loop (@rcs F n) k x) ^`_ i = 0. Proof. move: i x. elim: k => // k IH i x an1 H /=. by rewrite IH // fdcoor_rcs. Qed.
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
fdcoor_loop_rcs
is_pgen := [pred g | [forall x, (x \in C) == (g %| rVpoly x)]].
Definition
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
is_pgen
t := mk { lcode0 :> Lcode0.t F n ; gen : {poly F} ; size_gen : size gen < n ; P : gen \in 'pgen[[set cw in lcode0]] }.
Record
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
t
pcode_coercion (F : finFieldType) (n : nat) (c : Pcode.t F n) : {vspace 'rV[F]_n} := let: Pcode.mk v _ _ _ := c in v.
Coercion
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
pcode_coercion
t := mk { lcode0 :> Lcode0.t F n ; P : rcsP [set cw in lcode0] }.
Record
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
t
ccode_coercion (F : finFieldType) (n : nat) (c : Ccode.t F n) : {vspace 'rV[F]_n} := let: Ccode.mk v _ := c in v.
Coercion
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
ccode_coercion
is_cgen := [pred x | non0_codeword_lowest_deg C x]. Local Notation "''cgen'" := (is_cgen).
Definition
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
is_cgen
is_cgenE g : g \in 'cgen = non0_codeword_lowest_deg C g. Proof. by []. Qed.
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
is_cgenE
size_is_cgen g : g \in 'cgen -> size (rVpoly g) <= n. Proof. by rewrite size_poly. Qed.
Lemma
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
size_is_cgen
canonical_cgen : 'rV[F]_n := val (exists_non0_codeword_lowest_deg C_not_trivial).
Definition
ecc_classic
[ "From mathcomp Require Import all_ssreflect ssralg poly polydiv fingroup perm.", "From mathcomp Require Import finalg zmodp matrix mxalgebra mxpoly polydiv.", "From mathcomp Require Import vector.", "Require Import ssralg_ext poly_ext f2 hamming linearcode dft." ]
ecc_classic/cyclic_code.v
canonical_cgen