fact
stringlengths
8
1.54k
type
stringclasses
19 values
library
stringclasses
8 values
imports
listlengths
1
10
filename
stringclasses
98 values
symbolic_name
stringlengths
1
42
docstring
stringclasses
1 value
hornerNp x : (- p).[x] = - p.[x]. Proof. by apply/esym/addr0_eq; rewrite -hornerD subrr horner0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
hornerN
hornerXsubCa x : ('X - a%:P).[x] = x - a. Proof. by rewrite hornerD hornerN hornerC hornerX. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
hornerXsubC
hornerE_comm:= (hornerD, hornerN, hornerX, hornerC, horner_cons, simp, hornerCM, hornerZ, (fun p x => hornerM_comm p (comm_polyX x))).
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
hornerE_comm
Definition_ (zmodS : zmodClosed R) := GRing.isOppClosed.Build {poly R} (polyOver_pred zmodS) (@polyOverNr _).
HB.instance
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
Definition
Definition_ := GRing.MulClosed.on (polyOver_pred S).
HB.instance
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
Definition
polyOverXaddCc : ('X + c%:P \in polyOver S) = (c \in S). Proof. by rewrite rpredDl ?polyOverX ?polyOverC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
polyOverXaddC
polyOverXnaddCn c : ('X^n + c%:P \is a polyOver S) = (c \in S). Proof. by rewrite rpredDl ?polyOverXn// ?polyOverC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
polyOverXnaddC
polyOverXsubCc : ('X - c%:P \in polyOver S) = (c \in S). Proof. by rewrite rpredBl ?polyOverX ?polyOverC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
polyOverXsubC
polyOverXnsubCn c : ('X^n - c%:P \is a polyOver S) = (c \in S). Proof. by rewrite rpredBl ?polyOverXn// ?polyOverC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
polyOverXnsubC
derivN: {morph deriv : p / - p}. Proof. exact: linearN. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
derivN
derivB: {morph deriv : p q / p - q}. Proof. exact: linearB. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
derivB
derivXsubC(a : R) : ('X - a%:P)^`() = 1. Proof. by rewrite derivB derivX derivC subr0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
derivXsubC
derivMNnn p : (p *- n)^`() = p^`() *- n. Proof. exact: linearMNn. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
derivMNn
derivE:= Eval lazy beta delta [morphism_2 morphism_1] in (derivZ, deriv_mulC, derivC, derivX, derivMXaddC, derivXsubC, derivM, derivB, derivD, derivN, derivXn, derivM, derivMn).
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
derivE
derivnBn : {morph derivn n : p q / p - q}. Proof. exact: linearB. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
derivnB
derivnMNnn m p : (p *- m)^`(n) = p^`(n) *- m. Proof. exact: linearMNn. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
derivnMNn
derivnNn : {morph derivn n : p / - p}. Proof. exact: linearN. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
derivnN
nderivnBn : {morph nderivn n : p q / p - q}. Proof. exact: linearB. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
nderivnB
nderivnMNnn m p : (p *- m)^`N(n) = p^`N(n) *- m. Proof. exact: linearMNn. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
nderivnMNn
nderivnNn : {morph nderivn n : p / - p}. Proof. exact: linearN. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
nderivnN
monicXsubCc : 'X - c%:P \is monic. Proof. exact/eqP/lead_coefXsubC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
monicXsubC
monic_prod_XsubCI rI (P : pred I) (F : I -> R) : \prod_(i <- rI | P i) ('X - (F i)%:P) \is monic. Proof. by apply: monic_prod => i _; apply: monicXsubC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
monic_prod_XsubC
lead_coef_prod_XsubCI rI (P : pred I) (F : I -> R) : lead_coef (\prod_(i <- rI | P i) ('X - (F i)%:P)) = 1. Proof. exact/eqP/monic_prod_XsubC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
lead_coef_prod_XsubC
size_prod_XsubCI rI (F : I -> R) : size (\prod_(i <- rI) ('X - (F i)%:P)) = (size rI).+1. Proof. elim: rI => [|i r /= <-]; rewrite ?big_nil ?size_poly1 // big_cons. rewrite size_monicM ?monicXsubC ?monic_neq0 ?monic_prod_XsubC //. by rewrite size_XsubC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
size_prod_XsubC
size_exp_XsubCn a : size (('X - a%:P) ^+ n) = n.+1. Proof. rewrite -[n]card_ord -prodr_const -big_filter size_prod_XsubC. by have [e _ _ [_ ->]] := big_enumP. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
size_exp_XsubC
monicXnsubCn c : 0 < n -> 'X^n - c%:P \is monic. Proof. by move=> n_gt0; rewrite monicE lead_coefXnsubC. Qed. #[deprecated(since="mathcomp 2.3.0'",note="Use monicXnsubC instead.")]
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
monicXnsubC
monic_Xn_sub_1n : n > 0 -> 'X^n - 1 \is @monic R. Proof. exact/monicXnsubC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
monic_Xn_sub_1
lreg_leadp : GRing.lreg (lead_coef p) -> GRing.lreg p. Proof. move/mulrI_eq0=> reg_p; apply: mulrI0_lreg => q; apply/contra_eq => nz_q. by rewrite -lead_coef_eq0 lead_coef_proper_mul reg_p lead_coef_eq0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
lreg_lead
rreg_leadp : GRing.rreg (lead_coef p) -> GRing.rreg p. Proof. move/mulIr_eq0=> reg_p; apply: mulIr0_rreg => q; apply/contra_eq => nz_q. by rewrite -lead_coef_eq0 lead_coef_proper_mul reg_p lead_coef_eq0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
rreg_lead
monic_lregp : p \is monic -> GRing.lreg p. Proof. by move=> /eqP lp1; apply/lreg_lead; rewrite lp1; apply/lreg1. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
monic_lreg
monic_rregp : p \is monic -> GRing.rreg p. Proof. by move=> /eqP lp1; apply/rreg_lead; rewrite lp1; apply/rreg1. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
monic_rreg
rootNp x : root (- p) x = root p x. Proof. by rewrite rootE hornerN oppr_eq0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
rootN
root_XsubCa x : root ('X - a%:P) x = (x == a). Proof. by rewrite rootE hornerXsubC subr_eq0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
root_XsubC
root_XaddCa x : root ('X + a%:P) x = (x == - a). Proof. by rewrite -root_XsubC rmorphN opprK. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
root_XaddC
factor_theoremp a : reflect (exists q, p = q * ('X - a%:P)) (root p a). Proof. apply: (iffP eqP) => [pa0 | [q ->]]; last first. by rewrite hornerM_comm /comm_poly hornerXsubC subrr ?simp. exists (\poly_(i < size p) horner_rec (drop i.+1 p) a). apply/polyP=> i; rewrite mulrBr coefB coefMX coefMC !coef_poly. apply: canRL (addrK _) _; rewrite addrC; have [le_p_i | lt_i_p] := leqP. rewrite nth_default // !simp drop_oversize ?if_same //. exact: leq_trans (leqSpred _). case: i => [|i] in lt_i_p *; last by rewrite ltnW // (drop_nth 0 lt_i_p). by rewrite drop1 /= -{}pa0 /horner; case: (p : seq R) lt_i_p. Qed.
Theorem
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
factor_theorem
multiplicity_XsubCp a : {m | exists2 q, (p != 0) ==> ~~ root q a & p = q * ('X - a%:P) ^+ m}. Proof. have [n le_p_n] := ubnP (size p); elim: n => // n IHn in p le_p_n *. have [-> | nz_p /=] := eqVneq p 0; first by exists 0, 0; rewrite ?mul0r. have [/sig_eqW[p1 Dp] | nz_pa] := altP (factor_theorem p a); last first. by exists 0%N, p; rewrite ?mulr1. have nz_p1: p1 != 0 by apply: contraNneq nz_p => p1_0; rewrite Dp p1_0 mul0r. have /IHn[m /sig2_eqW[q nz_qa Dp1]]: size p1 < n. by rewrite Dp size_Mmonic ?monicXsubC // size_XsubC addn2 in le_p_n. by exists m.+1, q; [rewrite nz_p1 in nz_qa | rewrite exprSr mulrA -Dp1]. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
multiplicity_XsubC
root_of_unityn : pred R := root ('X^n - 1). Local Notation "n .-unity_root" := (root_of_unity n) : ring_scope.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
root_of_unity
unity_rootEn z : n.-unity_root z = (z ^+ n == 1). Proof. by rewrite /root_of_unity rootE hornerD hornerN hornerXn hornerC subr_eq0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
unity_rootE
unity_rootPn z : reflect (z ^+ n = 1) (n.-unity_root z). Proof. by rewrite unity_rootE; apply: eqP. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
unity_rootP
primitive_root_of_unityn z := (n > 0) && [forall i : 'I_n, i.+1.-unity_root z == (i.+1 == n)]. Local Notation "n .-primitive_root" := (primitive_root_of_unity n) : ring_scope.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
primitive_root_of_unity
prim_order_existsn z : n > 0 -> z ^+ n = 1 -> {m | m.-primitive_root z & (m %| n)}. Proof. move=> n_gt0 zn1. have: exists m, (m > 0) && (z ^+ m == 1) by exists n; rewrite n_gt0 /= zn1. case/ex_minnP=> m /andP[m_gt0 /eqP zm1] m_min. exists m. apply/andP; split=> //; apply/eqfunP=> [[i]] /=. rewrite leq_eqVlt unity_rootE. case: eqP => [-> _ | _]; first by rewrite zm1 eqxx. by apply: contraTF => zi1; rewrite -leqNgt m_min. have: n %% m < m by rewrite ltn_mod. apply: contraLR; rewrite -lt0n -leqNgt => nm_gt0; apply: m_min. by rewrite nm_gt0 /= expr_mod ?zn1. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
prim_order_exists
prim_order_gt0: n > 0. Proof. by case/andP: prim_z. Qed. Let n_gt0 := prim_order_gt0.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
prim_order_gt0
prim_expr_order: z ^+ n = 1. Proof. case/andP: prim_z => _; rewrite -(prednK n_gt0) => /forallP/(_ ord_max). by rewrite unity_rootE eqxx eqb_id => /eqP. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
prim_expr_order
prim_expr_modi : z ^+ (i %% n) = z ^+ i. Proof. exact: expr_mod prim_expr_order. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
prim_expr_mod
prim_order_dvdi : (n %| i) = (z ^+ i == 1). Proof. move: n_gt0; rewrite -prim_expr_mod /dvdn -(ltn_mod i). case: {i}(i %% n)%N => [|i] lt_i; first by rewrite !eqxx. case/andP: prim_z => _ /forallP/(_ (Ordinal (ltnW lt_i)))/eqP. by rewrite unity_rootE eqn_leq andbC leqNgt lt_i. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
prim_order_dvd
eq_prim_root_expri j : (z ^+ i == z ^+ j) = (i == j %[mod n]). Proof. wlog le_ji: i j / j <= i. move=> IH; case: (leqP j i) => [|/ltnW] /IH //. by rewrite eq_sym (eq_sym (j %% n)%N). rewrite -{1}(subnKC le_ji) exprD -prim_expr_mod eqn_mod_dvd //. rewrite prim_order_dvd; apply/eqP/eqP=> [|->]; last by rewrite mulr1. move/(congr1 ( *%R (z ^+ (n - j %% n)))); rewrite mulrA -exprD. by rewrite subnK ?prim_expr_order ?mul1r // ltnW ?ltn_mod. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
eq_prim_root_expr
exp_prim_rootk : (n %/ gcdn k n).-primitive_root (z ^+ k). Proof. set d := gcdn k n; have d_gt0: (0 < d)%N by rewrite gcdn_gt0 orbC n_gt0. have [d_dv_k d_dv_n]: (d %| k /\ d %| n)%N by rewrite dvdn_gcdl dvdn_gcdr. set q := (n %/ d)%N; rewrite /q.-primitive_root ltn_divRL // n_gt0. apply/forallP=> i; rewrite unity_rootE -exprM -prim_order_dvd. rewrite -(divnK d_dv_n) -/q -(divnK d_dv_k) mulnAC dvdn_pmul2r //. apply/eqP; apply/idP/idP=> [|/eqP->]; last by rewrite dvdn_mull. rewrite Gauss_dvdr; first by rewrite eqn_leq ltn_ord; apply: dvdn_leq. by rewrite /coprime gcdnC -(eqn_pmul2r d_gt0) mul1n muln_gcdl !divnK. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
exp_prim_root
dvdn_prim_rootm : (m %| n)%N -> m.-primitive_root (z ^+ (n %/ m)). Proof. set k := (n %/ m)%N => m_dv_n; rewrite -{1}(mulKn m n_gt0) -divnA // -/k. by rewrite -{1}(@gcdn_idPl k n _) ?exp_prim_root // -(divnK m_dv_n) dvdn_mulr. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
dvdn_prim_root
prim_root_eq0: (z == 0) = (n == 0%N). Proof. rewrite gtn_eqF//; apply/eqP => z0; have /esym/eqP := prim_expr_order. by rewrite z0 expr0n gtn_eqF//= oner_eq0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
prim_root_eq0
prim_root_exp_coprimen z k : n.-primitive_root z -> n.-primitive_root (z ^+ k) = coprime k n. Proof. move=> prim_z; have n_gt0 := prim_order_gt0 prim_z. apply/idP/idP=> [prim_zk | co_k_n]. set d := gcdn k n; have dv_d_n: (d %| n)%N := dvdn_gcdr _ _. rewrite /coprime -/d -(eqn_pmul2r n_gt0) mul1n -{2}(gcdnMl n d). rewrite -{2}(divnK dv_d_n) (mulnC _ d) -muln_gcdr (gcdn_idPr _) //. rewrite (prim_order_dvd prim_zk) -exprM -(prim_order_dvd prim_z). by rewrite muln_divCA_gcd dvdn_mulr. have zkn_1: z ^+ k ^+ n = 1 by rewrite exprAC (prim_expr_order prim_z) expr1n. have{zkn_1} [m prim_zk dv_m_n]:= prim_order_exists n_gt0 zkn_1. suffices /eqP <-: m == n by []. rewrite eqn_dvd dv_m_n -(@Gauss_dvdr n k m) 1?coprime_sym //=. by rewrite (prim_order_dvd prim_z) exprM (prim_expr_order prim_zk). Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
prim_root_exp_coprime
size_opp:= size_polyN (only parsing).
Notation
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
size_opp
map_poly(p : {poly aR}) := \poly_(i < size p) f p`_i.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
map_poly
map_polyEp : map_poly p = Poly (map f p). Proof. rewrite /map_poly unlock; congr Poly. apply: (@eq_from_nth _ 0); rewrite size_mkseq ?size_map // => i lt_i_p. by rewrite [RHS](nth_map 0) ?nth_mkseq. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
map_polyE
commr_rmorphu := forall x, GRing.comm u (f x).
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
commr_rmorph
horner_morphu of commr_rmorph u := fun p => (map_poly p).[u].
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
horner_morph
map_poly0: 0^f = 0. Proof. by rewrite map_polyE polyseq0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
map_poly0
eq_map_poly(g : aR -> rR) : f =1 g -> map_poly f =1 map_poly g. Proof. by move=> eq_fg p; rewrite !map_polyE (eq_map eq_fg). Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
eq_map_poly
map_poly_idg (p : {poly iR}) : {in (p : seq iR), g =1 id} -> map_poly g p = p. Proof. by move=> g_id; rewrite map_polyE map_id_in ?polyseqK. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
map_poly_id
coef_map_id0p i : f 0 = 0 -> (p^f)`_i = f p`_i. Proof. by move=> f0; rewrite coef_poly; case: ltnP => // le_p_i; rewrite nth_default. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
coef_map_id0
map_Poly_id0s : f 0 = 0 -> (Poly s)^f = Poly (map f s). Proof. move=> f0; apply/polyP=> j; rewrite coef_map_id0 ?coef_Poly //. have [/(nth_map 0 0)->// | le_s_j] := ltnP j (size s). by rewrite !nth_default ?size_map. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
map_Poly_id0
map_poly_comp_id0(g : iR -> aR) p : f 0 = 0 -> map_poly (f \o g) p = (map_poly g p)^f. Proof. by move=> f0; rewrite map_polyE map_comp -map_Poly_id0 -?map_polyE. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
map_poly_comp_id0
size_map_poly_id0p : f (lead_coef p) != 0 -> size p^f = size p. Proof. by move=> nz_fp; apply: size_poly_eq. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
size_map_poly_id0
map_poly_eq0_id0p : f (lead_coef p) != 0 -> (p^f == 0) = (p == 0). Proof. by rewrite -!size_poly_eq0 => /size_map_poly_id0->. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
map_poly_eq0_id0
lead_coef_map_id0p : f 0 = 0 -> f (lead_coef p) != 0 -> lead_coef p^f = f (lead_coef p). Proof. by move=> f0 nz_fp; rewrite lead_coefE coef_map_id0 ?size_map_poly_id0. Qed. Hypotheses (inj_f : injective f) (f_0 : f 0 = 0).
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
lead_coef_map_id0
size_map_inj_polyp : size p^f = size p. Proof. have [-> | nz_p] := eqVneq p 0; first by rewrite map_poly0 !size_poly0. by rewrite size_map_poly_id0 // -f_0 (inj_eq inj_f) lead_coef_eq0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
size_map_inj_poly
map_inj_poly: injective (map_poly f). Proof. move=> p q /polyP eq_pq; apply/polyP=> i; apply: inj_f. by rewrite -!coef_map_id0 ?eq_pq. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
map_inj_poly
lead_coef_map_injp : lead_coef p^f = f (lead_coef p). Proof. by rewrite !lead_coefE size_map_inj_poly coef_map_id0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
lead_coef_map_inj
map_polyK(f : aR -> rR) g : cancel g f -> f 0 = 0 -> cancel (map_poly g) (map_poly f). Proof. by move=> gK f_0 p; rewrite /= -map_poly_comp_id0 ?map_poly_id // => x _ //=. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
map_polyK
eq_in_map_poly_id0(f g : aR -> rR) (S : addrClosed aR) : f 0 = 0 -> g 0 = 0 -> {in S, f =1 g} -> {in polyOver S, map_poly f =1 map_poly g}. Proof. move=> f0 g0 eq_fg p pP; apply/polyP => i. by rewrite !coef_map_id0// eq_fg// (polyOverP _). Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
eq_in_map_poly_id0
eq_in_map_poly(f g : {additive aR -> rR}) (S : addrClosed aR) : {in S, f =1 g} -> {in polyOver S, map_poly f =1 map_poly g}. Proof. by move=> /eq_in_map_poly_id0; apply; rewrite //?raddf0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
eq_in_map_poly
coef_mapp i : p^f`_i = f p`_i. Proof. exact: coef_map_id0 (raddf0 f). Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
coef_map
map_Polys : (Poly s)^f = Poly (map f s). Proof. exact: map_Poly_id0 (raddf0 f). Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
map_Poly
map_poly_comp(g : iR -> aR) p : map_poly (f \o g) p = map_poly f (map_poly g p). Proof. exact: map_poly_comp_id0 (raddf0 f). Qed. Fact map_poly_is_nmod_morphism : nmod_morphism (map_poly f). Proof. split=> [|p q]; apply/polyP => i; first by rewrite coef_map !coef0 raddf0. by rewrite !(coef_map, coefD) raddfD. Qed. HB.instance Definition _ := GRing.isNmodMorphism.Build {poly aR} {poly rR} (map_poly f) map_poly_is_nmod_morphism.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
map_poly_comp
map_polyCa : (a%:P)^f = (f a)%:P. Proof. by apply/polyP=> i; rewrite !(coef_map, coefC) -!mulrb raddfMn. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
map_polyC
lead_coef_map_eqp : f (lead_coef p) != 0 -> lead_coef p^f = f (lead_coef p). Proof. exact: lead_coef_map_id0 (raddf0 f). Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
lead_coef_map_eq
map_poly_is_multiplicative:= (fun g => (g.2, g.1)) map_poly_is_monoid_morphism. HB.instance Definition _ := GRing.isMonoidMorphism.Build {poly aR} {poly rR} (map_poly f) map_poly_is_monoid_morphism.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
map_poly_is_multiplicative
map_polyZc p : (c *: p)^f = f c *: p^f. Proof. by apply/polyP=> i; rewrite !(coef_map, coefZ) /= rmorphM. Qed. HB.instance Definition _ := GRing.isScalable.Build aR {poly aR} {poly rR} (f \; *:%R) (map_poly f) map_polyZ.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
map_polyZ
map_polyX: ('X)^f = 'X. Proof. by apply/polyP=> i; rewrite coef_map !coefX /= rmorph_nat. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
map_polyX
map_polyXnn : ('X^n)^f = 'X^n. Proof. by rewrite rmorphXn /= map_polyX. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
map_polyXn
map_polyXaddCx : ('X + x%:P)^f = 'X + (f x)%:P. Proof. by rewrite raddfD/= map_polyX map_polyC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
map_polyXaddC
monic_mapp : p \is monic -> p^f \is monic. Proof. move/monicP=> mon_p; rewrite monicE. by rewrite lead_coef_map_eq mon_p /= rmorph1 ?oner_neq0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
monic_map
horner_mapp x : p^f.[f x] = f p.[x]. Proof. elim/poly_ind: p => [|p c IHp]; first by rewrite !(rmorph0, horner0). rewrite hornerMXaddC !rmorphD !rmorphM /=. by rewrite map_polyX map_polyC hornerMXaddC IHp. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
horner_map
map_comm_polyp x : comm_poly p x -> comm_poly p^f (f x). Proof. by rewrite /comm_poly horner_map -!rmorphM // => ->. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
map_comm_poly
map_comm_coefp x : comm_coef p x -> comm_coef p^f (f x). Proof. by move=> cpx i; rewrite coef_map -!rmorphM ?cpx. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
map_comm_coef
rmorph_rootp x : root p x -> root p^f (f x). Proof. by move/eqP=> px0; rewrite rootE horner_map px0 rmorph0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
rmorph_root
horner_morphCa : horner_morph cfu a%:P = f a. Proof. by rewrite /horner_morph map_polyC hornerC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
horner_morphC
horner_morphX: horner_morph cfu 'X = u. Proof. by rewrite /horner_morph map_polyX hornerX. Qed. Fact horner_is_semilinear : semilinear_for (f \; *%R) (horner_morph cfu). Proof. split=> [c p|p q]; rewrite /horner_morph; first by rewrite linearZ hornerZ. by rewrite linearD hornerD. Qed. Fact horner_is_monoid_morphism : monoid_morphism (horner_morph cfu). Proof. split=> [|p q]; first by rewrite /horner_morph rmorph1 hornerC. rewrite /horner_morph rmorphM /= hornerM_comm //. by apply: comm_coef_poly => i; rewrite coef_map cfu. Qed. #[deprecated(since="mathcomp 2.5.0", note="use `horner_is_monoid_morphism` instead")]
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
horner_morphX
horner_is_multiplicative:= (fun g => (g.2, g.1)) horner_is_monoid_morphism. HB.instance Definition _ := GRing.isSemilinear.Build aR {poly aR} rR _ (horner_morph cfu) horner_is_semilinear. HB.instance Definition _ := GRing.isMonoidMorphism.Build {poly aR} rR (horner_morph cfu) horner_is_monoid_morphism.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
horner_is_multiplicative
deriv_mapp : p^f^`() = (p^`())^f. Proof. by apply/polyP => i; rewrite !(coef_map, coef_deriv) //= rmorphMn. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
deriv_map
derivn_mapp n : p^f^`(n) = (p^`(n))^f. Proof. by apply/polyP => i; rewrite !(coef_map, coef_derivn) //= rmorphMn. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
derivn_map
nderivn_mapp n : p^f^`N(n) = (p^`N(n))^f. Proof. by apply/polyP => i; rewrite !(coef_map, coef_nderivn) //= rmorphMn. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
nderivn_map
map_polyXsubCx : ('X - x%:P)^f = 'X - (f x)%:P. Proof. by rewrite raddfB/= map_polyX map_polyC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
map_polyXsubC
map_prod_XsubCI (rI : seq I) P F : (\prod_(i <- rI | P i) ('X - (F i)%:P))^f = \prod_(i <- rI | P i) ('X - (f (F i))%:P). Proof. by rewrite rmorph_prod//; apply/eq_bigr => x /=; rewrite map_polyXsubC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
map_prod_XsubC
prod_map_poly(ar : seq aR) P : \prod_(x <- map f ar | P x) ('X - x%:P) = (\prod_(x <- ar | P (f x)) ('X - x%:P))^f. Proof. by rewrite big_map map_prod_XsubC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
prod_map_poly
rmorph_unity_rootn z : n.-unity_root z -> n.-unity_root (f z). Proof. move/(rmorph_root f); rewrite rootE rmorphB hornerD hornerN. by rewrite /= map_polyXn rmorph1 hornerC hornerXn subr_eq0 unity_rootE. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
rmorph_unity_root
in_alg_comm: commr_rmorph (in_alg A) a. Proof. move=> r /=; by rewrite /GRing.comm comm_alg. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
in_alg_comm
horner_alg:= horner_morph in_alg_comm.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
horner_alg
horner_algCc : horner_alg c%:P = c%:A. Proof. exact: horner_morphC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
horner_algC
horner_algX: horner_alg 'X = a. Proof. exact: horner_morphX. Qed. HB.instance Definition _ := GRing.LRMorphism.on horner_alg.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
horner_algX
poly_alg_initial: pf =1 horner_alg (pf 'X). Proof. apply: poly_ind => [|p a IHp]; first by rewrite !rmorph0. rewrite !rmorphD !rmorphM /= -{}IHp horner_algC ?horner_algX. by rewrite -alg_polyC rmorph_alg. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finset tuple div ssralg", "From mathcomp Require Import countalg binomial" ]
algebra/poly.v
poly_alg_initial