statement
stringlengths
1
4.33k
proof
stringlengths
0
37.9k
type
stringclasses
25 values
symbolic_name
stringlengths
1
67
library
stringclasses
10 values
filename
stringclasses
112 values
imports
listlengths
2
138
deps
listlengths
0
64
docstring
stringclasses
798 values
source_url
stringclasses
1 value
commit
stringclasses
1 value
modpN p : (- p) %% d = - (p %% d).
Proof. by rewrite -mulN1r -[RHS]mulN1r -polyCN !mul_polyC modpZl. Qed.
Lemma
modpN
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "modpZl", "mulN1r", "mul_polyC", "polyCN" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divpN p : (- p) %/ d = - (p %/ d).
Proof. by rewrite -mulN1r -[RHS]mulN1r -polyCN !mul_polyC divpZl. Qed.
Lemma
divpN
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "divpZl", "mulN1r", "mul_polyC", "polyCN" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
modpD p q : (p + q) %% d = p %% d + q %% d.
Proof. have/edivpP [] // : (p + q) = (p %/ d + q %/ d) * d + (p %% d + q %% d). by rewrite mulrDl addrACA -!divp_eq. apply: leq_ltn_trans (size_polyD _ _) _. rewrite gtn_max !ltn_modp andbb -lead_coef_eq0. by apply: contraTneq ulcd => ->; rewrite unitr0. Qed.
Lemma
modpD
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "addrACA", "apply", "contraTneq", "divp_eq", "edivpP", "gtn_max", "lead_coef_eq0", "leq_ltn_trans", "ltn_modp", "mulrDl", "size_polyD", "ulcd", "unitr0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divpD p q : (p + q) %/ d = p %/ d + q %/ d.
Proof. have/edivpP [] // : (p + q) = (p %/ d + q %/ d) * d + (p %% d + q %% d). by rewrite mulrDl addrACA -!divp_eq. apply: leq_ltn_trans (size_polyD _ _) _. rewrite gtn_max !ltn_modp andbb -lead_coef_eq0. by apply: contraTneq ulcd => ->; rewrite unitr0. Qed.
Lemma
divpD
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "addrACA", "apply", "contraTneq", "divp_eq", "edivpP", "gtn_max", "lead_coef_eq0", "leq_ltn_trans", "ltn_modp", "mulrDl", "size_polyD", "ulcd", "unitr0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mulpK q : (q * d) %/ d = q.
Proof. case/esym/edivpP: (addr0 (q * d)); rewrite // size_poly0 size_poly_gt0. by rewrite -lead_coef_eq0; apply: contraTneq ulcd => ->; rewrite unitr0. Qed.
Lemma
mulpK
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "addr0", "apply", "contraTneq", "edivpP", "lead_coef_eq0", "size_poly0", "size_poly_gt0", "ulcd", "unitr0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mulKp q : (d * q) %/ d = q.
Proof. by rewrite mulrC; apply: mulpK. Qed.
Lemma
mulKp
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "mulpK", "mulrC" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divp_addl_mul_small q r : size r < size d -> (q * d + r) %/ d = q.
Proof. by move=> srd; rewrite divpD (divp_small srd) addr0 mulpK. Qed.
Lemma
divp_addl_mul_small
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "addr0", "divpD", "divp_small", "mulpK", "size" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
modp_addl_mul_small q r : size r < size d -> (q * d + r) %% d = r.
Proof. by move=> srd; rewrite modpD modp_mull add0r modp_small. Qed.
Lemma
modp_addl_mul_small
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "add0r", "modpD", "modp_mull", "modp_small", "size" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divp_addl_mul q r : (q * d + r) %/ d = q + r %/ d.
Proof. by rewrite divpD mulpK. Qed.
Lemma
divp_addl_mul
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "divpD", "mulpK" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divpp : d %/ d = 1.
Proof. by rewrite -[d in d %/ _]mul1r mulpK. Qed.
Lemma
divpp
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "mul1r", "mulpK" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
leq_divMp m : size (m %/ d * d) <= size m.
Proof. case: (eqVneq d 0) ulcd => [->|dn0 _]; first by rewrite lead_coef0 unitr0. have [->|q0] := eqVneq (m %/ d) 0; first by rewrite mul0r size_poly0 leq0n. rewrite {2}(divp_eq m) size_polyDl // size_mul // (polySpred q0) addSn /=. by rewrite ltn_addl // ltn_modp. Qed.
Lemma
leq_divMp
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "addSn", "divp_eq", "eqVneq", "lead_coef0", "leq0n", "ltn_addl", "ltn_modp", "mul0r", "polySpred", "size", "size_mul", "size_poly0", "size_polyDl", "ulcd", "unitr0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
dvdpP p : reflect (exists q, p = q * d) (d %| p).
Proof. apply: (iffP idP) => [| [k ->]]; last by apply/eqP; rewrite modp_mull. by rewrite dvdp_eq; move/eqP->; exists (p %/ d). Qed.
Lemma
dvdpP
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "dvdp_eq", "last", "modp_mull" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divpK p : d %| p -> p %/ d * d = p.
Proof. by rewrite dvdp_eq; move/eqP. Qed.
Lemma
divpK
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "dvdp_eq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divpKC p : d %| p -> d * (p %/ d) = p.
Proof. by move=> ?; rewrite mulrC divpK. Qed.
Lemma
divpKC
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "divpK", "mulrC" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
dvdp_eq_div p q : d %| p -> (q == p %/ d) = (q * d == p).
Proof. move/divpK=> {2}<-; apply/eqP/eqP; first by move->. apply/mulIf; rewrite -lead_coef_eq0; apply: contraTneq ulcd => ->. by rewrite unitr0. Qed.
Lemma
dvdp_eq_div
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "contraTneq", "divpK", "lead_coef_eq0", "mulIf", "ulcd", "unitr0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
dvdp_eq_mul p q : d %| p -> (p == q * d) = (p %/ d == q).
Proof. by move=> dv_d_p; rewrite eq_sym -dvdp_eq_div // eq_sym. Qed.
Lemma
dvdp_eq_mul
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "dvdp_eq_div", "eq_sym" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divp_mulA p q : d %| q -> p * (q %/ d) = p * q %/ d.
Proof. move=> hdm; apply/eqP; rewrite eq_sym -dvdp_eq_mul; last first. by rewrite -mulrA divpK. by move/divpK: hdm<-; rewrite mulrA dvdp_mull // dvdpp. Qed.
Lemma
divp_mulA
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "divpK", "dvdp_eq_mul", "dvdp_mull", "dvdpp", "eq_sym", "last", "mulrA" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divp_mulAC m n : d %| m -> m %/ d * n = m * n %/ d.
Proof. by move=> hdm; rewrite mulrC (mulrC m); apply: divp_mulA. Qed.
Lemma
divp_mulAC
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "divp_mulA", "mulrC" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divp_mulCA p q : d %| p -> d %| q -> p * (q %/ d) = q * (p %/ d).
Proof. by move=> hdp hdq; rewrite mulrC divp_mulAC // divp_mulA. Qed.
Lemma
divp_mulCA
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "divp_mulA", "divp_mulAC", "mulrC" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
modp_mul p q : (p * (q %% d)) %% d = (p * q) %% d.
Proof. by rewrite [q in RHS]divp_eq mulrDr modpD mulrA modp_mull add0r. Qed.
Lemma
modp_mul
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "add0r", "divp_eq", "modpD", "modp_mull", "mulrA", "mulrDr" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
leq_trunc_divp
:= leq_divMp (only parsing).
Notation
leq_trunc_divp
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "leq_divMp" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
expp_sub m n : n <= m -> (d ^+ (m - n))%N = d ^+ m %/ d ^+ n.
Proof. by move/subnK=> {2}<-; rewrite exprD mulpK // lead_coef_exp unitrX. Qed.
Lemma
expp_sub
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "exprD", "lead_coef_exp", "mulpK", "subnK", "unitrX" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divp_pmul2l p q : lead_coef q \in GRing.unit -> d * p %/ (d * q) = p %/ q.
Proof. move=> uq; rewrite {1}(divp_eq uq p) mulrDr mulrCA divp_addl_mul //. by rewrite lead_coefM unitrM_comm ?ulcd //; red; rewrite mulrC. have dn0 : d != 0. by rewrite -lead_coef_eq0; apply: contraTneq ulcd => ->; rewrite unitr0. have qn0 : q != 0. by rewrite -lead_coef_eq0; apply: contraTneq uq => ->; rewrite ...
Lemma
divp_pmul2l
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "addSn", "addr0", "apply", "contraTneq", "divpN0", "divp_addl_mul", "divp_eq", "eqVneq", "lead_coef", "lead_coefM", "lead_coef_eq0", "ltnNge", "ltn_add2l", "ltn_modp", "mulf_eq0", "mulr0", "mulrC", "mulrCA", "mulrDr", "polySpred", "size", "size_mul", "size_poly0", "size...
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divp_pmul2r p q : lead_coef p \in GRing.unit -> q * d %/ (p * d) = q %/ p.
Proof. by move=> uq; rewrite -!(mulrC d) divp_pmul2l. Qed.
Lemma
divp_pmul2r
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "divp_pmul2l", "lead_coef", "mulrC", "unit" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divp_divl r p q : lead_coef r \in GRing.unit -> lead_coef p \in GRing.unit -> q %/ p %/ r = q %/ (p * r).
Proof. move=> ulcr ulcp. have e : q = (q %/ p %/ r) * (p * r) + ((q %/ p) %% r * p + q %% p). by rewrite addrA (mulrC p) mulrA -mulrDl; rewrite -divp_eq //; apply: divp_eq. have pn0 : p != 0. by rewrite -lead_coef_eq0; apply: contraTneq ulcp => ->; rewrite unitr0. have rn0 : r != 0. by rewrite -lead_coef_eq0; app...
Lemma
divp_divl
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "add0r", "addSn", "addnS", "addrA", "apply", "contraTneq", "divp_eq", "edivpP", "eqVneq", "last", "lead_coef", "lead_coefM", "lead_coef_eq0", "leq_addr", "leq_trans", "ltn_add2l", "ltn_modp", "mul0r", "mulrA", "mulrC", "mulrDl", "polySpred", "size", "size_mul", "size_...
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divpAC p q : lead_coef p \in GRing.unit -> q %/ d %/ p = q %/ p %/ d.
Proof. by move=> ulcp; rewrite !divp_divl // mulrC. Qed.
Lemma
divpAC
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "divp_divl", "lead_coef", "mulrC", "unit" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
modpZr c p : c \in GRing.unit -> p %% (c *: d) = (p %% d).
Proof. case: (eqVneq d 0) => [-> | dn0 cn0]; first by rewrite scaler0 !modp0. have e : p = (c^-1 *: (p %/ d)) * (c *: d) + (p %% d). by rewrite scalerCA scalerA mulVr // scale1r -(divp_eq ulcd). suff s : size (p %% d) < size (c *: d). by rewrite (modpP _ e s) // -mul_polyC lead_coefM lead_coefC unitrM cn0. by rewri...
Lemma
modpZr
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "contraTneq", "divp_eq", "eqVneq", "lead_coefC", "lead_coefM", "ltn_modp", "modp0", "modpP", "mulVr", "mul_polyC", "scale1r", "scaler0", "scalerA", "scalerCA", "size", "size_scale", "ulcd", "unit", "unitr0", "unitrM" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divpZr c p : c \in GRing.unit -> p %/ (c *: d) = c^-1 *: (p %/ d).
Proof. case: (eqVneq d 0) => [-> | dn0 cn0]; first by rewrite scaler0 !divp0 scaler0. have e : p = (c^-1 *: (p %/ d)) * (c *: d) + (p %% d). by rewrite scalerCA scalerA mulVr // scale1r -(divp_eq ulcd). suff s : size (p %% d) < size (c *: d). by rewrite (divpP _ e s) // -mul_polyC lead_coefM lead_coefC unitrM cn0. ...
Lemma
divpZr
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "contraTneq", "divp0", "divpP", "divp_eq", "eqVneq", "lead_coefC", "lead_coefM", "ltn_modp", "mulVr", "mul_polyC", "scale1r", "scaler0", "scalerA", "scalerCA", "size", "size_scale", "ulcd", "unit", "unitr0", "unitrM" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divp_eq p q : p = (p %/ q) * q + (p %% q).
Proof. have [-> | qn0] := eqVneq q 0; first by rewrite modp0 mulr0 add0r. by apply: IdomainUnit.divp_eq; rewrite unitfE lead_coef_eq0. Qed.
Lemma
divp_eq
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "add0r", "apply", "eqVneq", "lead_coef_eq0", "modp0", "mulr0", "unitfE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divp_modpP p q d r : p = q * d + r -> size r < size d -> q = (p %/ d) /\ r = p %% d.
Proof. move=> he hs; apply: IdomainUnit.edivpP => //; rewrite unitfE lead_coef_eq0. by rewrite -size_poly_gt0; apply: leq_trans hs. Qed.
Lemma
divp_modpP
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "edivpP", "lead_coef_eq0", "leq_trans", "size", "size_poly_gt0", "unitfE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divpP p q d r : p = q * d + r -> size r < size d -> q = (p %/ d).
Proof. by move/divp_modpP=> h; case/h. Qed.
Lemma
divpP
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "divp_modpP", "size" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
modpP p q d r : p = q * d + r -> size r < size d -> r = (p %% d).
Proof. by move/divp_modpP=> h; case/h. Qed.
Lemma
modpP
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "divp_modpP", "size" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
eqpfP p q : p %= q -> p = (lead_coef p / lead_coef q) *: q.
Proof. have [->|nz_q] := eqVneq q 0; first by rewrite eqp0 scaler0 => /eqP ->. by apply/IdomainUnit.ucl_eqp_eq; rewrite unitfE lead_coef_eq0. Qed.
Lemma
eqpfP
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "eqVneq", "eqp0", "lead_coef", "lead_coef_eq0", "scaler0", "ucl_eqp_eq", "unitfE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
dvdp_eq q p : (q %| p) = (p == p %/ q * q).
Proof. have [-> | qn0] := eqVneq q 0; first by rewrite dvd0p mulr0 eq_sym. by apply: IdomainUnit.dvdp_eq; rewrite unitfE lead_coef_eq0. Qed.
Lemma
dvdp_eq
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "dvd0p", "eqVneq", "eq_sym", "lead_coef_eq0", "mulr0", "unitfE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
eqpf_eq p q : reflect (exists2 c, c != 0 & p = c *: q) (p %= q).
Proof. apply: (iffP idP); last first. case=> c nz_c ->; apply/eqpP. by exists (1, c); rewrite ?scale1r ?oner_eq0. have [->|nz_q] := eqVneq q 0. by rewrite eqp0=> /eqP ->; exists 1; rewrite ?scale1r ?oner_eq0. case/IdomainUnit.ulc_eqpP; first by rewrite unitfE lead_coef_eq0. by move=> c nz_c ->; exists c. Qed.
Lemma
eqpf_eq
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "eqVneq", "eqp0", "eqpP", "last", "lead_coef_eq0", "oner_eq0", "scale1r", "ulc_eqpP", "unitfE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
modpZl c p q : (c *: p) %% q = c *: (p %% q).
Proof. have [-> | qn0] := eqVneq q 0; first by rewrite !modp0. by apply: IdomainUnit.modpZl; rewrite unitfE lead_coef_eq0. Qed.
Lemma
modpZl
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "eqVneq", "lead_coef_eq0", "modp0", "unitfE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mulpK p q : q != 0 -> p * q %/ q = p.
Proof. by move=> qn0; rewrite IdomainUnit.mulpK // unitfE lead_coef_eq0. Qed.
Lemma
mulpK
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "lead_coef_eq0", "unitfE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mulKp p q : q != 0 -> q * p %/ q = p.
Proof. by rewrite mulrC; apply: mulpK. Qed.
Lemma
mulKp
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "mulpK", "mulrC" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divpZl c p q : (c *: p) %/ q = c *: (p %/ q).
Proof. have [-> | qn0] := eqVneq q 0; first by rewrite !divp0 scaler0. by apply: IdomainUnit.divpZl; rewrite unitfE lead_coef_eq0. Qed.
Lemma
divpZl
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "divp0", "eqVneq", "lead_coef_eq0", "scaler0", "unitfE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
modpZr c p d : c != 0 -> p %% (c *: d) = (p %% d).
Proof. case: (eqVneq d 0) => [-> | dn0 cn0]; first by rewrite scaler0 !modp0. have e : p = (c^-1 *: (p %/ d)) * (c *: d) + (p %% d). by rewrite scalerCA scalerA mulVf // scale1r -divp_eq. suff s : size (p %% d) < size (c *: d) by rewrite (modpP e s). by rewrite size_scale ?ltn_modp. Qed.
Lemma
modpZr
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "divp_eq", "eqVneq", "ltn_modp", "modp0", "modpP", "mulVf", "scale1r", "scaler0", "scalerA", "scalerCA", "size", "size_scale" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divpZr c p d : c != 0 -> p %/ (c *: d) = c^-1 *: (p %/ d).
Proof. case: (eqVneq d 0) => [-> | dn0 cn0]; first by rewrite scaler0 !divp0 scaler0. have e : p = (c^-1 *: (p %/ d)) * (c *: d) + (p %% d). by rewrite scalerCA scalerA mulVf // scale1r -divp_eq. suff s : size (p %% d) < size (c *: d) by rewrite (divpP e s). by rewrite size_scale ?ltn_modp. Qed.
Lemma
divpZr
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "divp0", "divpP", "divp_eq", "eqVneq", "ltn_modp", "mulVf", "scale1r", "scaler0", "scalerA", "scalerCA", "size", "size_scale" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
eqp_modpl d p q : p %= q -> (p %% d) %= (q %% d).
Proof. case/eqpP=> [[c1 c2]] /andP /= [c1n0 c2n0 e]. by apply/eqpP; exists (c1, c2); rewrite ?c1n0 // -!modpZl e. Qed.
Lemma
eqp_modpl
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "c1", "c2", "eqpP", "modpZl" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
eqp_divl d p q : p %= q -> (p %/ d) %= (q %/ d).
Proof. case/eqpP=> [[c1 c2]] /andP /= [c1n0 c2n0 e]. by apply/eqpP; exists (c1, c2); rewrite ?c1n0 // -!divpZl e. Qed.
Lemma
eqp_divl
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "c1", "c2", "divpZl", "eqpP" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
eqp_modpr d p q : p %= q -> (d %% p) %= (d %% q).
Proof. case/eqpP=> [[c1 c2]] /andP [c1n0 c2n0 e]. have -> : p = (c1^-1 * c2) *: q by rewrite -scalerA -e scalerA mulVf // scale1r. by rewrite modpZr ?eqpxx // mulf_eq0 negb_or invr_eq0 c1n0. Qed.
Lemma
eqp_modpr
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "c1", "c2", "eqpP", "eqpxx", "invr_eq0", "modpZr", "mulVf", "mulf_eq0", "scale1r", "scalerA" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
eqp_mod p1 p2 q1 q2 : p1 %= p2 -> q1 %= q2 -> p1 %% q1 %= p2 %% q2.
Proof. move=> e1 e2; exact: eqp_trans (eqp_modpl _ e1) (eqp_modpr _ e2). Qed.
Lemma
eqp_mod
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "eqp_modpl", "eqp_modpr", "eqp_trans" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
eqp_divr (d m n : {poly F}) : m %= n -> (d %/ m) %= (d %/ n).
Proof. case/eqpP=> [[c1 c2]] /andP [c1n0 c2n0 e]. have -> : m = (c1^-1 * c2) *: n by rewrite -scalerA -e scalerA mulVf // scale1r. by rewrite divpZr ?eqp_scale // ?invr_eq0 mulf_eq0 negb_or invr_eq0 c1n0. Qed.
Lemma
eqp_divr
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "c1", "c2", "divpZr", "eqpP", "eqp_scale", "invr_eq0", "mulVf", "mulf_eq0", "poly", "scale1r", "scalerA" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
eqp_div p1 p2 q1 q2 : p1 %= p2 -> q1 %= q2 -> p1 %/ q1 %= p2 %/ q2.
Proof. move=> e1 e2; exact: eqp_trans (eqp_divl _ e1) (eqp_divr _ e2). Qed.
Lemma
eqp_div
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "eqp_divl", "eqp_divr", "eqp_trans" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
eqp_gdcor p q r : q %= r -> gdcop p q %= gdcop p r.
Proof. move=> eqr; rewrite /gdcop (eqp_size eqr). move: (size r)=> n; elim: n p q r eqr => [|n ihn] p q r; first by rewrite eqpxx. move=> eqr /=; rewrite (eqp_coprimepl p eqr); case: ifP => _ //. exact/ihn/eqp_div/eqp_gcdl. Qed.
Lemma
eqp_gdcor
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "eqp_coprimepl", "eqp_div", "eqp_gcdl", "eqp_size", "eqpxx", "gdcop", "size" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
eqp_gdcol p q r : q %= r -> gdcop q p %= gdcop r p.
Proof. move=> eqr; rewrite /gdcop; move: (size p)=> n. elim: n p q r eqr {1 3}p (eqpxx p) => [|n ihn] p q r eqr s esp /=. case: (eqVneq q 0) eqr => [-> | nq0 eqr] /=. by rewrite eqp_sym eqp0 => ->; rewrite eqpxx. by case: (eqVneq r 0) eqr nq0 => [->|]; rewrite ?eqpxx // eqp0 => ->. rewrite (eqp_coprimepr _ eqr)...
Lemma
eqp_gdcol
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "eqVneq", "eqp0", "eqp_coprimepl", "eqp_coprimepr", "eqp_div", "eqp_gcd", "eqp_sym", "eqpxx", "gdcop", "size" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
eqp_rgdco_gdco q p : rgdcop q p %= gdcop q p.
Proof. rewrite /rgdcop /gdcop; move: (size p)=> n. elim: n p q {1 3}p {1 3}q (eqpxx p) (eqpxx q) => [|n ihn] p q s t /= sp tq. case: (eqVneq t 0) tq => [-> | nt0 etq]. by rewrite eqp_sym eqp0 => ->; rewrite eqpxx. by case: (eqVneq q 0) etq nt0 => [->|]; rewrite ?eqpxx // eqp0 => ->. rewrite rcoprimep_coprimep (...
Lemma
eqp_rgdco_gdco
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "eqVneq", "eqp0", "eqp_coprimepl", "eqp_coprimepr", "eqp_div", "eqp_gcd", "eqp_rdiv_div", "eqp_rgcd_gcd", "eqp_sym", "eqp_trans", "eqpxx", "gdcop", "rcoprimep_coprimep", "rgdcop", "size", "sp" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
modpD d p q : (p + q) %% d = p %% d + q %% d.
Proof. have [-> | dn0] := eqVneq d 0; first by rewrite !modp0. by apply: IdomainUnit.modpD; rewrite unitfE lead_coef_eq0. Qed.
Lemma
modpD
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "eqVneq", "lead_coef_eq0", "modp0", "unitfE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
modpN p q : (- p) %% q = - (p %% q).
Proof. by apply/eqP; rewrite -addr_eq0 -modpD addNr mod0p. Qed.
Lemma
modpN
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "addNr", "addr_eq0", "apply", "mod0p", "modpD" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
modNp p q : (- p) %% q = - (p %% q).
Proof. exact: modpN. Qed.
Lemma
modNp
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "modpN" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divpD d p q : (p + q) %/ d = p %/ d + q %/ d.
Proof. have [-> | dn0] := eqVneq d 0; first by rewrite !divp0 addr0. by apply: IdomainUnit.divpD; rewrite unitfE lead_coef_eq0. Qed.
Lemma
divpD
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "addr0", "apply", "divp0", "eqVneq", "lead_coef_eq0", "unitfE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divpN p q : (- p) %/ q = - (p %/ q).
Proof. by apply/eqP; rewrite -addr_eq0 -divpD addNr div0p. Qed.
Lemma
divpN
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "addNr", "addr_eq0", "apply", "div0p", "divpD" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divp_addl_mul_small d q r : size r < size d -> (q * d + r) %/ d = q.
Proof. move=> srd; rewrite divpD (divp_small srd) addr0 mulpK // -size_poly_gt0. exact: leq_trans srd. Qed.
Lemma
divp_addl_mul_small
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "addr0", "divpD", "divp_small", "leq_trans", "mulpK", "size", "size_poly_gt0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
modp_addl_mul_small d q r : size r < size d -> (q * d + r) %% d = r.
Proof. by move=> srd; rewrite modpD modp_mull add0r modp_small. Qed.
Lemma
modp_addl_mul_small
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "add0r", "modpD", "modp_mull", "modp_small", "size" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divp_addl_mul d q r : d != 0 -> (q * d + r) %/ d = q + r %/ d.
Proof. by move=> dn0; rewrite divpD mulpK. Qed.
Lemma
divp_addl_mul
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "divpD", "mulpK" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divpp d : d != 0 -> d %/ d = 1.
Proof. by move=> dn0; apply: IdomainUnit.divpp; rewrite unitfE lead_coef_eq0. Qed.
Lemma
divpp
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "lead_coef_eq0", "unitfE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
leq_divMp d m : size (m %/ d * d) <= size m.
Proof. have [-> | dn0] := eqVneq d 0; first by rewrite mulr0 size_poly0. by apply: IdomainUnit.leq_divMp; rewrite unitfE lead_coef_eq0. Qed.
Lemma
leq_divMp
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "eqVneq", "lead_coef_eq0", "mulr0", "size", "size_poly0", "unitfE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divpK d p : d %| p -> p %/ d * d = p.
Proof. case: (eqVneq d 0) => [-> /dvd0pP -> | dn0]; first by rewrite mulr0. by apply: IdomainUnit.divpK; rewrite unitfE lead_coef_eq0. Qed.
Lemma
divpK
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "dvd0pP", "eqVneq", "lead_coef_eq0", "mulr0", "unitfE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divpKC d p : d %| p -> d * (p %/ d) = p.
Proof. by move=> ?; rewrite mulrC divpK. Qed.
Lemma
divpKC
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "divpK", "mulrC" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
dvdp_eq_div d p q : d != 0 -> d %| p -> (q == p %/ d) = (q * d == p).
Proof. by move=> dn0; apply: IdomainUnit.dvdp_eq_div; rewrite unitfE lead_coef_eq0. Qed.
Lemma
dvdp_eq_div
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "lead_coef_eq0", "unitfE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
dvdp_eq_mul d p q : d != 0 -> d %| p -> (p == q * d) = (p %/ d == q).
Proof. by move=> dn0 dv_d_p; rewrite eq_sym -dvdp_eq_div // eq_sym. Qed.
Lemma
dvdp_eq_mul
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "dvdp_eq_div", "eq_sym" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divp_mulA d p q : d %| q -> p * (q %/ d) = p * q %/ d.
Proof. case: (eqVneq d 0) => [-> /dvd0pP -> | dn0]; first by rewrite !divp0 mulr0. by apply: IdomainUnit.divp_mulA; rewrite unitfE lead_coef_eq0. Qed.
Lemma
divp_mulA
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "divp0", "dvd0pP", "eqVneq", "lead_coef_eq0", "mulr0", "unitfE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divp_mulAC d m n : d %| m -> m %/ d * n = m * n %/ d.
Proof. by move=> hdm; rewrite mulrC (mulrC m); apply: divp_mulA. Qed.
Lemma
divp_mulAC
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "divp_mulA", "mulrC" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divp_mulCA d p q : d %| p -> d %| q -> p * (q %/ d) = q * (p %/ d).
Proof. by move=> hdp hdq; rewrite mulrC divp_mulAC // divp_mulA. Qed.
Lemma
divp_mulCA
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "divp_mulA", "divp_mulAC", "mulrC" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
expp_sub d m n : d != 0 -> m >= n -> (d ^+ (m - n))%N = d ^+ m %/ d ^+ n.
Proof. by move=> dn0 /subnK=> {2}<-; rewrite exprD mulpK // expf_neq0. Qed.
Lemma
expp_sub
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "expf_neq0", "exprD", "mulpK", "subnK" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divp_pmul2l d q p : d != 0 -> q != 0 -> d * p %/ (d * q) = p %/ q.
Proof. by move=> dn0 qn0; apply: IdomainUnit.divp_pmul2l; rewrite unitfE lead_coef_eq0. Qed.
Lemma
divp_pmul2l
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "lead_coef_eq0", "unitfE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divp_pmul2r d p q : d != 0 -> p != 0 -> q * d %/ (p * d) = q %/ p.
Proof. by move=> dn0 qn0; rewrite -!(mulrC d) divp_pmul2l. Qed.
Lemma
divp_pmul2r
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "divp_pmul2l", "mulrC" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divp_divl r p q : q %/ p %/ r = q %/ (p * r).
Proof. have [-> | rn0] := eqVneq r 0; first by rewrite mulr0 !divp0. have [-> | pn0] := eqVneq p 0; first by rewrite mul0r !divp0 div0p. by apply: IdomainUnit.divp_divl; rewrite unitfE lead_coef_eq0. Qed.
Lemma
divp_divl
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "div0p", "divp0", "eqVneq", "lead_coef_eq0", "mul0r", "mulr0", "unitfE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divpAC d p q : q %/ d %/ p = q %/ p %/ d.
Proof. by rewrite !divp_divl // mulrC. Qed.
Lemma
divpAC
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "divp_divl", "mulrC" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
edivp_def p q : edivp p q = (0, p %/ q, p %% q).
Proof. rewrite Idomain.edivp_def; congr (_, _, _); rewrite /scalp 2!unlock /=. have [-> | qn0] := eqVneq; first by rewrite lead_coef0 unitr0. by rewrite unitfE lead_coef_eq0 qn0 /=; case: (redivp_rec _ _ _ _) => [[]]. Qed.
Lemma
edivp_def
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "edivp", "eqVneq", "lead_coef0", "lead_coef_eq0", "redivp_rec", "scalp", "unitfE", "unitr0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divpE p q : p %/ q = (lead_coef q)^-(rscalp p q) *: (rdivp p q).
Proof. have [-> | qn0] := eqVneq q 0; first by rewrite rdivp0 divp0 scaler0. by rewrite Idomain.divpE unitfE lead_coef_eq0 qn0. Qed.
Lemma
divpE
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "divp0", "eqVneq", "lead_coef", "lead_coef_eq0", "rdivp", "rdivp0", "rscalp", "scaler0", "unitfE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
modpE p q : p %% q = (lead_coef q)^-(rscalp p q) *: (rmodp p q).
Proof. have [-> | qn0] := eqVneq q 0. by rewrite rmodp0 modp0 /rscalp unlock eqxx lead_coef0 expr0 invr1 scale1r. by rewrite Idomain.modpE unitfE lead_coef_eq0 qn0. Qed.
Lemma
modpE
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "eqVneq", "eqxx", "expr0", "invr1", "lead_coef", "lead_coef0", "lead_coef_eq0", "modp0", "rmodp", "rmodp0", "rscalp", "scale1r", "unitfE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
scalpE p q : scalp p q = 0.
Proof. have [-> | qn0] := eqVneq q 0; first by rewrite scalp0. by rewrite Idomain.scalpE unitfE lead_coef_eq0 qn0. Qed.
Lemma
scalpE
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "eqVneq", "lead_coef_eq0", "scalp", "scalp0", "unitfE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
dvdpE p q : (p %| q) = rdvdp p q.
Proof. exact: Idomain.dvdpE. Qed.
Lemma
dvdpE
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "rdvdp" ]
Just to have it without importing the weak theory
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
edivp_spec m d : nat * {poly F} * {poly F} -> Type
:= EdivpSpec n q r of m = q * d + r & (d != 0) ==> (size r < size d) : edivp_spec m d (n, q, r).
Variant
edivp_spec
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "nat", "poly", "size" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
edivpP m d : edivp_spec m d (edivp m d).
Proof. rewrite edivp_def; constructor; first exact: divp_eq. by apply/implyP=> dn0; rewrite ltn_modp. Qed.
Lemma
edivpP
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "divp_eq", "edivp", "edivp_def", "edivp_spec", "ltn_modp" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
edivp_eq d q r : size r < size d -> edivp (q * d + r) d = (0, q, r).
Proof. move=> srd; apply: Idomain.edivp_eq; rewrite // unitfE lead_coef_eq0. by rewrite -size_poly_gt0; apply: leq_trans srd. Qed.
Lemma
edivp_eq
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "edivp", "lead_coef_eq0", "leq_trans", "size", "size_poly_gt0", "unitfE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
modp_mul p q m : (p * (q %% m)) %% m = (p * q) %% m.
Proof. by rewrite [in RHS](divp_eq q m) mulrDr modpD mulrA modp_mull add0r. Qed.
Lemma
modp_mul
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "add0r", "divp_eq", "modpD", "modp_mull", "mulrA", "mulrDr" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
horner_mod p q x : root q x -> (p %% q).[x] = p.[x].
Proof. by rewrite [in RHS](divp_eq p q) !hornerE => /eqP->; rewrite mulr0 add0r. Qed.
Lemma
horner_mod
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "add0r", "divp_eq", "hornerE", "mulr0", "root" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
dvdpP p q : reflect (exists qq, p = qq * q) (q %| p).
Proof. have [-> | qn0] := eqVneq q 0; last first. by apply: IdomainUnit.dvdpP; rewrite unitfE lead_coef_eq0. by rewrite dvd0p; apply: (iffP eqP) => [->| [? ->]]; [exists 1|]; rewrite mulr0. Qed.
Lemma
dvdpP
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "dvd0p", "eqVneq", "last", "lead_coef_eq0", "mulr0", "unitfE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Bezout_eq1_coprimepP p q : reflect (exists u, u.1 * p + u.2 * q = 1) (coprimep p q).
Proof. apply: (iffP idP)=> [hpq|]; last first. by case=> -[u v] /= e; apply/Bezout_coprimepP; exists (u, v); rewrite e eqpxx. case/Bezout_coprimepP: hpq => [[u v]] /=. case/eqpP=> [[c1 c2]] /andP /= [c1n0 c2n0] e. exists (c2^-1 *: (c1 *: u), c2^-1 *: (c1 *: v)); rewrite /= -!scalerAl. by rewrite -!scalerDr e scalerA ...
Lemma
Bezout_eq1_coprimepP
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "Bezout_coprimepP", "apply", "c1", "c2", "coprimep", "eqpP", "eqpxx", "last", "mulVf", "scale1r", "scalerA", "scalerAl", "scalerDr" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
dvdp_gdcor p q : q != 0 -> p %| (gdcop q p) * (q ^+ size p).
Proof. rewrite /gdcop => nz_q; have [n hsp] := ubnPleq (size p). elim: n => [|n IHn] /= in p hsp *; first by rewrite (negPf nz_q) mul0r dvdp0. have [_ | ncop_pq] := ifPn; first by rewrite dvdp_mulr. have g_gt1: 1 < size (gcdp p q). rewrite ltn_neqAle eq_sym ncop_pq size_poly_gt0 gcdp_eq0. by rewrite negb_and nz_q o...
Lemma
dvdp_gdcor
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "add2n", "div0p", "divpK", "dvdp0", "dvdp_gcdl", "dvdp_gcdr", "dvdp_mul", "dvdp_mulr", "eqVneq", "eq_sym", "exprSr", "gcdp", "gcdp_eq0", "gdcop", "leq_subr", "leq_trans", "ltnS", "ltn_neqAle", "mul0r", "mulrA", "nz_p", "polySpred", "size", "size_divp", "size_poly0", ...
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
reducible_cubic_root p q : size p <= 4 -> 1 < size q < size p -> q %| p -> {r | root p r}.
Proof. move=> p_le4 /andP[]; rewrite leq_eqVlt eq_sym. have [/poly2_root[x qx0] _ _ | _ /= q_gt2 p_gt_q] := size q =P 2. by exists x; rewrite -!dvdp_XsubCl in qx0 *; apply: (dvdp_trans qx0). case/dvdpP/sig_eqW=> r def_p; rewrite def_p. suffices /poly2_root[x rx0]: size r = 2 by exists x; rewrite rootM rx0. have /norP...
Lemma
reducible_cubic_root
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "def_p", "dvdpP", "dvdp_XsubCl", "dvdp_trans", "eq_sym", "eqn_add2r", "eqn_leq", "leq_eqVlt", "leq_ltn_trans", "leq_subLR", "leq_trans", "ltn_subRL", "mulf_eq0", "poly2_root", "root", "rootM", "sig_eqW", "size", "size_mul", "size_poly_gt0", "subn1" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
cubic_irreducible p : 1 < size p <= 4 -> (forall x, ~~ root p x) -> irreducible_poly p.
Proof. move=> /andP[p_gt1 p_le4] root'p; split=> // q sz_q_neq1 q_dv_p. have nz_p: p != 0 by rewrite -size_poly_gt0 ltnW. have nz_q: q != 0 by apply: contraTneq q_dv_p => ->; rewrite dvd0p. have q_gt1: size q > 1 by rewrite ltn_neqAle eq_sym sz_q_neq1 size_poly_gt0. rewrite -dvdp_size_eqp // eqn_leq dvdp_leq //= leqNgt...
Lemma
cubic_irreducible
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "contraTneq", "dvd0p", "dvdp_leq", "dvdp_size_eqp", "eq_sym", "eqn_leq", "irreducible_poly", "leqNgt", "ltnW", "ltn_neqAle", "nz_p", "p_gt1", "q_gt1", "reducible_cubic_root", "root", "size", "size_poly_gt0", "split" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mup x q
:= [arg max_(n > (ord0 : 'I_(size q).+1) | ('X - x%:P) ^+ n %| q) n] : nat.
Definition
mup
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "nat", "ord0", "size" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mup_geq x q n : q != 0 -> (n <= mup x q)%N = (('X - x%:P) ^+ n %| q).
Proof. move=> q_neq0; rewrite /mup; symmetry. case: arg_maxnP; rewrite ?expr0 ?dvd1p//= => i i_dvd gti. case: ltnP => [|/dvdp_exp2l/dvdp_trans]; last exact. apply: contraTF => dvdq; rewrite -leqNgt. suff n_small : (n < (size q).+1)%N by exact: (gti (Ordinal n_small)). by rewrite ltnS ltnW// -(size_exp_XsubC _ x) dvdp_l...
Lemma
mup_geq
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "arg_maxnP", "dvd1p", "dvdp_exp2l", "dvdp_leq", "dvdp_trans", "expr0", "last", "leqNgt", "ltnP", "ltnS", "ltnW", "mup", "size", "size_exp_XsubC" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mup_leq x q n : q != 0 -> (mup x q <= n)%N = ~~ (('X - x%:P) ^+ n.+1 %| q).
Proof. by move=> qN0; rewrite leqNgt mup_geq. Qed.
Lemma
mup_leq
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "leqNgt", "mup", "mup_geq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mup_ltn x q n : q != 0 -> (mup x q < n)%N = ~~ (('X - x%:P) ^+ n %| q).
Proof. by move=> qN0; rewrite ltnNge mup_geq. Qed.
Lemma
mup_ltn
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "ltnNge", "mup", "mup_geq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
XsubC_dvd x q : q != 0 -> ('X - x%:P %| q) = (0 < mup x q)%N.
Proof. by move=> /mup_geq-/(_ _ 1%N)/esym; apply. Qed.
Lemma
XsubC_dvd
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "mup", "mup_geq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mup_XsubCX n x y : mup x (('X - y%:P) ^+ n) = (if (y == x) then n else 0)%N.
Proof. have Xxn0 : ('X - y%:P) ^+ n != 0 by rewrite ?expf_neq0 ?polyXsubC_eq0. apply/eqP; rewrite eqn_leq mup_leq ?mup_geq//. have [->|Nxy] := eqVneq x y. by rewrite /= dvdpp ?dvdp_Pexp2l ?size_XsubC ?ltnn. by rewrite dvd1p dvdp_XsubCl /root horner_exp !hornerE expf_neq0// subr_eq0. Qed.
Lemma
mup_XsubCX
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "dvd1p", "dvdp_Pexp2l", "dvdp_XsubCl", "dvdpp", "eqVneq", "eqn_leq", "expf_neq0", "hornerE", "horner_exp", "ltnn", "mup", "mup_geq", "mup_leq", "polyXsubC_eq0", "root", "size_XsubC", "subr_eq0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mupNroot x q : ~~ root q x -> mup x q = 0%N.
Proof. move=> qNx; have qN0 : q != 0 by apply: contraNneq qNx => ->; rewrite root0. by move: qNx; rewrite -dvdp_XsubCl XsubC_dvd// lt0n negbK => /eqP. Qed.
Lemma
mupNroot
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "XsubC_dvd", "apply", "contraNneq", "dvdp_XsubCl", "lt0n", "mup", "root", "root0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mupMr x q1 q2 : ~~ root q1 x -> mup x (q1 * q2) = mup x q2.
Proof. move=> q1Nx; have q1N0 : q1 != 0 by apply: contraNneq q1Nx => ->; rewrite root0. have [->|q2N0] := eqVneq q2 0; first by rewrite mulr0. apply/esym/eqP; rewrite eqn_leq mup_geq ?mulf_neq0// dvdp_mull -?mup_geq//=. rewrite mup_leq ?mulf_neq0// Gauss_dvdpr -?mup_ltn//. by rewrite coprimep_expl// coprimep_sym coprim...
Lemma
mupMr
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "Gauss_dvdpr", "apply", "contraNneq", "coprimep_XsubC", "coprimep_expl", "coprimep_sym", "dvdp_mull", "eqVneq", "eqn_leq", "mulf_neq0", "mulr0", "mup", "mup_geq", "mup_leq", "mup_ltn", "root", "root0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mupMl x q1 q2 : ~~ root q2 x -> mup x (q1 * q2) = mup x q1.
Proof. by rewrite mulrC; apply/mupMr. Qed.
Lemma
mupMl
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "mulrC", "mup", "mupMr", "root" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mupM x q1 q2 : q1 != 0 -> q2 != 0 -> mup x (q1 * q2) = (mup x q1 + mup x q2)%N.
Proof. move=> q1N0 q2N0; apply/eqP; rewrite eqn_leq mup_leq ?mulf_neq0//. rewrite mup_geq ?mulf_neq0// exprD ?dvdp_mul; do ?by rewrite -mup_geq. have [m1 [r1]] := multiplicity_XsubC q1 x; rewrite q1N0 /= => r1Nx ->. have [m2 [r2]] := multiplicity_XsubC q2 x; rewrite q2N0 /= => r2Nx ->. rewrite !mupMr// ?mup_XsubCX eqxx...
Lemma
mupM
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "apply", "dvdp_XsubCl", "dvdp_mul", "dvdp_mul2r", "eqn_leq", "eqxx", "expf_neq0", "exprD", "exprS", "mulf_neq0", "mulrACA", "multiplicity_XsubC", "mup", "mupMr", "mup_XsubCX", "mup_geq", "mup_leq", "polyXsubC_eq0", "r1", "r2", "rootM" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mu_prod_XsubC x (s : seq F) : mup x (\prod_(y <- s) ('X - y%:P)) = count_mem x s.
Proof. elim: s => [|y s IHs]; rewrite (big_cons, big_nil)/=. by rewrite mupNroot// root1. rewrite mupM ?polyXsubC_eq0// ?monic_neq0 ?monic_prod_XsubC//. by rewrite IHs (@mup_XsubCX 1). Qed.
Lemma
mu_prod_XsubC
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "big_cons", "big_nil", "count_mem", "monic_neq0", "monic_prod_XsubC", "mup", "mupM", "mupNroot", "mup_XsubCX", "polyXsubC_eq0", "root1", "seq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
prod_XsubC_eq (s t : seq F) : \prod_(x <- s) ('X - x%:P) = \prod_(x <- t) ('X - x%:P) -> perm_eq s t.
Proof. move=> eq_prod; apply/allP => x _ /=; apply/eqP. by have /(congr1 (mup x)) := eq_prod; rewrite !mu_prod_XsubC. Qed.
Lemma
prod_XsubC_eq
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "allP", "apply", "mu_prod_XsubC", "mup", "perm_eq", "seq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
redivp_map a b : redivp a^f b^f = (rscalp a b, (rdivp a b)^f, (rmodp a b)^f).
Proof. rewrite /rdivp /rscalp /rmodp !unlock map_poly_eq0 size_map_poly. have [// | q_nz] := ifPn; rewrite -(rmorph0 (map_poly f)) //. have [m _] := ubnPeq (size a); elim: m 0%N 0 a => [|m IHm] qq r a /=. rewrite -!mul_polyC !size_map_poly !lead_coef_map // -(map_polyXn f). by rewrite -!(map_polyC f) -!rmorphM -rmo...
Lemma
redivp_map
algebra
algebra/polydiv.v
[ "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "bigop", "nmodule", "rings_modules_and_algebras", "divalg", "decfield", "poly", "GRing.Theory", "CommonRing", "RingComRreg", "RingMonic", "Ring", "ComRing", "UnitRing", "IdomainD...
[ "lead_coef_map", "map_poly", "map_polyC", "map_polyXn", "map_poly_eq0", "mul_polyC", "rdivp", "redivp", "rmodp", "rmorph0", "rmorphB", "rmorphD", "rmorphM", "rscalp", "size", "size_map_poly", "ubnPeq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d