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 |
|---|---|---|---|---|---|---|---|---|---|---|
rdivp_mull p : rdivp (p * d) d = p. | Proof. by rewrite -[p * d]addr0 rdivp_addl_mul rdiv0p addr0. Qed. | Lemma | rdivp_mull | 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",
"rdiv0p",
"rdivp",
"rdivp_addl_mul"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
rmodp_mull p : rmodp (p * d) d = 0. | Proof.
by apply: rmodp_mull; rewrite (eqP mond); [apply: commr1 | apply: rreg1].
Qed. | Lemma | rmodp_mull | 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",
"commr1",
"mond",
"rmodp",
"rreg1"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
rmodpp : rmodp d d = 0. | Proof.
by apply: rmodpp; rewrite (eqP mond); [apply: commr1 | apply: rreg1].
Qed. | Lemma | rmodpp | 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",
"commr1",
"mond",
"rmodp",
"rreg1"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
rmodp_addl_mul_small q r : size r < size d -> rmodp (q * d + r) d = r. | Proof.
by move=> Hd; case: (monic_comreg mond)=> Hc Hr; rewrite /rmodp redivp_eq.
Qed. | Lemma | rmodp_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... | [
"mond",
"monic_comreg",
"redivp_eq",
"rmodp",
"size"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
rmodp_id (p : {poly R}) : rmodp (rmodp p d) d = rmodp p d. | Proof.
by rewrite rmodp_small // ltn_rmodpN0 // monic_neq0.
Qed. | Lemma | rmodp_id | 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... | [
"ltn_rmodpN0",
"monic_neq0",
"poly",
"rmodp",
"rmodp_small"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
rmodpD p q : rmodp (p + q) d = rmodp p d + rmodp q d. | Proof.
rewrite [p in LHS]rdivp_eq [q in LHS]rdivp_eq addrACA -mulrDl.
rewrite rmodp_addl_mul_small //; apply: (leq_ltn_trans (size_polyD _ _)).
by rewrite gtn_max !ltn_rmodp // monic_neq0.
Qed. | Lemma | rmodpD | 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",
"gtn_max",
"leq_ltn_trans",
"ltn_rmodp",
"monic_neq0",
"mulrDl",
"rdivp_eq",
"rmodp",
"rmodp_addl_mul_small",
"size_polyD"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
rmodpN p : rmodp (- p) d = - (rmodp p d). | Proof.
rewrite {1}(rdivp_eq p) opprD // -mulNr rmodp_addl_mul_small //.
by rewrite size_polyN ltn_rmodp // monic_neq0.
Qed. | Lemma | rmodpN | 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... | [
"ltn_rmodp",
"monic_neq0",
"mulNr",
"opprD",
"rdivp_eq",
"rmodp",
"rmodp_addl_mul_small",
"size_polyN"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
rmodpB p q : rmodp (p - q) d = rmodp p d - rmodp q d. | Proof. by rewrite rmodpD rmodpN. Qed. | Lemma | rmodpB | 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... | [
"rmodp",
"rmodpD",
"rmodpN"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
rmodpZ a p : rmodp (a *: p) d = a *: (rmodp p d). | Proof.
case: (altP (a =P 0%R)) => [-> | cn0]; first by rewrite !scale0r rmod0p.
have -> : ((a *: p) = (a *: (rdivp p d)) * d + a *: (rmodp p d))%R.
by rewrite -scalerAl -scalerDr -rdivp_eq.
rewrite rmodp_addl_mul_small //.
rewrite -mul_polyC; apply: leq_ltn_trans (size_polyMleq _ _) _.
rewrite size_polyC cn0 addSn... | Lemma | rmodpZ | 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... | [
"add0n",
"addSn",
"apply",
"leq_ltn_trans",
"ltn_rmodp",
"monic_neq0",
"mul_polyC",
"rdivp",
"rdivp_eq",
"rmod0p",
"rmodp",
"rmodp_addl_mul_small",
"scale0r",
"scalerAl",
"scalerDr",
"size_polyC",
"size_polyMleq"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
rmodp_sum (I : Type) (r : seq I) (P : pred I) (F : I -> {poly R}) :
rmodp (\sum_(i <- r | P i) F i) d = (\sum_(i <- r | P i) (rmodp (F i) d)). | Proof.
by elim/big_rec2: _ => [|i p q _ <-]; rewrite ?(rmod0p, rmodpD).
Qed. | Lemma | rmodp_sum | 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_rec2",
"poly",
"rmod0p",
"rmodp",
"rmodpD",
"seq"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
rmodp_mulmr p q : rmodp (p * (rmodp q d)) d = rmodp (p * q) d. | Proof.
by rewrite [q in RHS]rdivp_eq mulrDr rmodpD mulrA rmodp_mull add0r.
Qed. | Lemma | rmodp_mulmr | 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",
"mulrA",
"mulrDr",
"rdivp_eq",
"rmodp",
"rmodpD",
"rmodp_mull"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
rdvdpp : rdvdp d d. | Proof.
by apply: rdvdpp; rewrite (eqP mond); [apply: commr1 | apply: rreg1].
Qed. | Lemma | rdvdpp | 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",
"commr1",
"mond",
"rdvdp",
"rreg1"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
eq_rdvdp q1 p : p = q1 * d -> rdvdp d p. | Proof.
(* this probably means I need to specify impl args for comm_rref_rdvdp *)
move=> h; apply: (@eq_rdvdp _ _ _ _ 1 q1); rewrite (eqP mond).
- exact: commr1.
- exact: rreg1.
by rewrite expr1n mulr1.
Qed. | Lemma | eq_rdvdp | 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",
"commr1",
"expr1n",
"mond",
"mulr1",
"rdvdp",
"rreg1"
] | section variables impose an inconvenient order on parameters | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d |
rdvdp_mull p : rdvdp d (p * d). | Proof.
by apply: rdvdp_mull; rewrite (eqP mond) //; [apply: commr1 | apply: rreg1].
Qed. | Lemma | rdvdp_mull | 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",
"commr1",
"mond",
"rdvdp",
"rreg1"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
rdvdpP p : reflect (exists qq, p = qq * d) (rdvdp d p). | Proof.
case: (monic_comreg mond)=> Hc Hr; apply: (iffP idP) => [|[qq] /eq_rdvdp //].
by case: rdvdp_eqP=> // k qq; rewrite (eqP mond) expr1n mulr1 => ->; exists qq.
Qed. | Lemma | rdvdpP | 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",
"eq_rdvdp",
"expr1n",
"mond",
"monic_comreg",
"mulr1",
"rdvdp",
"rdvdp_eqP"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
rdivpK p : rdvdp d p -> (rdivp p d) * d = p. | Proof. by move=> dvddp; rewrite [RHS]rdivp_eq rmodp_eq0 ?addr0. Qed. | Lemma | rdivpK | 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",
"rdivp",
"rdivp_eq",
"rdvdp",
"rmodp_eq0"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
drop_poly_rdivp n p : drop_poly n p = rdivp p 'X^n. | Proof.
rewrite -[p in RHS](poly_take_drop n) addrC rdivp_addl_mul ?monicXn//.
by rewrite rdivp_small ?addr0// size_polyXn ltnS size_take_poly.
Qed. | Lemma | drop_poly_rdivp | 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",
"addrC",
"drop_poly",
"ltnS",
"monicXn",
"poly_take_drop",
"rdivp",
"rdivp_addl_mul",
"rdivp_small",
"size_polyXn",
"size_take_poly"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
take_poly_rmodp n p : take_poly n p = rmodp p 'X^n. | Proof.
have mX := monicXn R n; rewrite -[p in RHS](poly_take_drop n) rmodpD//.
by rewrite rmodp_small ?rmodp_mull ?addr0// size_polyXn ltnS size_take_poly.
Qed. | Lemma | take_poly_rmodp | 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",
"ltnS",
"monicXn",
"poly_take_drop",
"rmodp",
"rmodpD",
"rmodp_mull",
"rmodp_small",
"size_polyXn",
"size_take_poly",
"take_poly"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
rmodp_mulml p q : rmodp (rmodp p d * q) d = rmodp (p * q) d. | Proof. by rewrite [in LHS]mulrC [in RHS]mulrC rmodp_mulmr. Qed. | Lemma | rmodp_mulml | 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... | [
"mulrC",
"rmodp",
"rmodp_mulmr"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
rmodpX p n : rmodp ((rmodp p d) ^+ n) d = rmodp (p ^+ n) d. | Proof.
elim: n => [|n IH]; first by rewrite !expr0.
rewrite !exprS -rmodp_mulmr // IH rmodp_mulmr //.
by rewrite mulrC rmodp_mulmr // mulrC.
Qed. | Lemma | rmodpX | 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... | [
"expr0",
"exprS",
"mulrC",
"rmodp",
"rmodp_mulmr"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
rmodp_compr p q : rmodp (p \Po (rmodp q d)) d = (rmodp (p \Po q) d). | Proof.
elim/poly_ind: p => [|p c IH]; first by rewrite !comp_polyC !rmod0p.
rewrite !comp_polyD !comp_polyM addrC rmodpD //.
rewrite mulrC -rmodp_mulmr // IH rmodp_mulmr //.
rewrite !comp_polyX !comp_polyC.
by rewrite mulrC rmodp_mulmr // -rmodpD // addrC.
Qed. | Lemma | rmodp_compr | 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... | [
"addrC",
"comp_polyC",
"comp_polyD",
"comp_polyM",
"comp_polyX",
"mulrC",
"poly_ind",
"rmod0p",
"rmodp",
"rmodpD",
"rmodp_mulmr"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
rdivp1 p : rdivp p 1 = p. | Proof. by rewrite -[p in LHS]mulr1 rdivp_mull // monic1. Qed. | Lemma | rdivp1 | 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... | [
"monic1",
"mulr1",
"rdivp",
"rdivp_mull"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
rdvdp_XsubCl p x : rdvdp ('X - x%:P) p = root p x. | Proof.
have [HcX Hr] := monic_comreg (monicXsubC x).
apply/rmodp_eq0P/factor_theorem => [|[p1 ->]]; last exact/rmodp_mull/monicXsubC.
move=> e0; exists (rdivp p ('X - x%:P)).
by rewrite [LHS](rdivp_eq (monicXsubC x)) e0 addr0.
Qed. | Lemma | rdvdp_XsubCl | 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",
"e0",
"factor_theorem",
"last",
"monicXsubC",
"monic_comreg",
"rdivp",
"rdivp_eq",
"rdvdp",
"rmodp_eq0P",
"rmodp_mull",
"root"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
polyXsubCP p x : reflect (p.[x] = 0) (rdvdp ('X - x%:P) p). | Proof. by apply: (iffP idP); rewrite rdvdp_XsubCl; move/rootP. Qed. | Lemma | polyXsubCP | 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",
"rdvdp",
"rdvdp_XsubCl",
"rootP"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
root_factor_theorem p x : root p x = (rdvdp ('X - x%:P) p). | Proof. by rewrite rdvdp_XsubCl. Qed. | Lemma | root_factor_theorem | 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",
"rdvdp_XsubCl",
"root"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
redivp_spec (m d : {poly R}) : nat * {poly R} * {poly R} -> Type | :=
EdivnSpec k (q r: {poly R}) of
(lead_coef d ^+ k) *: m = q * d + r &
(d != 0 -> size r < size d) : redivp_spec m d (k, q, r). | Variant | redivp_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... | [
"lead_coef",
"nat",
"poly",
"size"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
redivpP m d : redivp_spec m d (redivp m d). | Proof.
rewrite redivp_def; constructor; last by move=> dn0; rewrite ltn_rmodp.
by rewrite -mul_polyC mulrC rdivp_eq //= /GRing.comm mulrC.
Qed. | Lemma | redivpP | 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... | [
"comm",
"last",
"ltn_rmodp",
"mul_polyC",
"mulrC",
"rdivp_eq",
"redivp",
"redivp_def",
"redivp_spec"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
rdivp_eq d p :
(lead_coef d ^+ rscalp p d) *: p = rdivp p d * d + rmodp p d. | Proof.
by rewrite /rdivp /rmodp /rscalp; case: redivpP=> k q1 r1 Hc _; apply: Hc.
Qed. | Lemma | rdivp_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",
"lead_coef",
"r1",
"rdivp",
"redivpP",
"rmodp",
"rscalp"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
rdvdp_eqP d p : rdvdp_spec p d (rmodp p d) (rdvdp d p). | Proof.
case hdvd: (rdvdp d p); last by move/rmodp_eq0P/eqP/RdvdpN: hdvd.
move/rmodp_eq0P: (hdvd)->; apply: (@Rdvdp _ _ _ (rscalp p d) (rdivp p d)).
by rewrite mulrC mul_polyC rdivp_eq; move/rmodp_eq0P: (hdvd)->; rewrite addr0.
Qed. | Lemma | rdvdp_eqP | 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",
"last",
"mul_polyC",
"mulrC",
"rdivp",
"rdivp_eq",
"rdvdp",
"rdvdp_spec",
"rmodp",
"rmodp_eq0P",
"rscalp"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
rdvdp_eq q p :
rdvdp q p = (lead_coef q ^+ rscalp p q *: p == rdivp p q * q). | Proof.
rewrite rdivp_eq; apply/rmodp_eq0P/eqP => [->|/eqP]; first by rewrite addr0.
by rewrite addrC -subr_eq0 addrK => /eqP.
Qed. | Lemma | rdvdp_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... | [
"addr0",
"addrC",
"addrK",
"apply",
"lead_coef",
"rdivp",
"rdivp_eq",
"rdvdp",
"rmodp_eq0P",
"rscalp",
"subr_eq0"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
uniq_roots_rdvdp p rs :
all (root p) rs -> uniq_roots rs -> rdvdp (\prod_(z <- rs) ('X - z%:P)) p. | Proof.
move=> rrs /(uniq_roots_prod_XsubC rrs) [q ->].
exact/RingMonic.rdvdp_mull/monic_prod_XsubC.
Qed. | Lemma | uniq_roots_rdvdp | 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... | [
"all",
"monic_prod_XsubC",
"rdvdp",
"rdvdp_mull",
"root",
"uniq_roots",
"uniq_roots_prod_XsubC"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
edivp_expanded_def p q | :=
let: (k, d, r) as edvpq := redivp p q in
if lead_coef q \in GRing.unit then
(0, (lead_coef q)^-k *: d, (lead_coef q)^-k *: r)
else edvpq. | Definition | edivp_expanded_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... | [
"lead_coef",
"redivp",
"unit"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
edivp_key : unit. | Proof. by []. Qed. | Fact | edivp_key | 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... | [
"unit"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
edivp | := locked_with edivp_key edivp_expanded_def. | Definition | edivp | 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_expanded_def",
"edivp_key"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
edivp_unlockable | := [unlockable fun edivp]. | Canonical | edivp_unlockable | 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"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
divp p q | := ((edivp p q).1).2. | Definition | 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... | [
"edivp"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modp p q | := (edivp p q).2. | Definition | modp | 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"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
scalp p q | := ((edivp p q).1).1. | Definition | scalp | 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"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
dvdp p q | := modp q p == 0. | Definition | dvdp | 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... | [
"modp"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
eqp p q | := (dvdp p q) && (dvdp q p). | Definition | eqp | 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"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
"m %/ d" | := (divp m d) : ring_scope. | Notation | m %/ d | 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"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
"m %% d" | := (modp m d) : ring_scope. | Notation | m %% d | 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... | [
"modp"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
"p %| q" | := (dvdp p q) : ring_scope. | Notation | p %| q | 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"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
"p %= q" | := (eqp p q) : ring_scope. | Notation | p %= q | 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"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
edivp_def p q : edivp p q = (scalp p q, divp p q, modp p q). | Proof. by rewrite /scalp /divp /modp; case: (edivp p q) => [[]] /=. 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... | [
"divp",
"edivp",
"modp",
"scalp"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
edivp_redivp p q : (lead_coef q \in GRing.unit) = false ->
edivp p q = redivp p q. | Proof. by move=> hu; rewrite unlock hu; case: (redivp p q) => [[? ?] ?]. Qed. | Lemma | edivp_redivp | 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",
"lead_coef",
"redivp",
"unit"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
divpE p q :
p %/ q = if lead_coef q \in GRing.unit
then lead_coef q ^- rscalp p q *: rdivp p q
else rdivp p q. | Proof. by case: ifP; rewrite /divp unlock redivp_def => ->. 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... | [
"divp",
"lead_coef",
"rdivp",
"redivp_def",
"rscalp",
"unit"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modpE p q :
p %% q = if lead_coef q \in GRing.unit
then lead_coef q ^- rscalp p q *: (rmodp p q)
else rmodp p q. | Proof. by case: ifP; rewrite /modp unlock redivp_def => ->. 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... | [
"lead_coef",
"modp",
"redivp_def",
"rmodp",
"rscalp",
"unit"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
scalpE p q :
scalp p q = if lead_coef q \in GRing.unit then 0 else rscalp p q. | Proof. by case: ifP; rewrite /scalp unlock redivp_def => ->. 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... | [
"lead_coef",
"redivp_def",
"rscalp",
"scalp",
"unit"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
dvdpE p q : (p %| q) = rdvdp p q. | Proof.
rewrite /dvdp modpE /rdvdp; case ulcq: (lead_coef p \in GRing.unit)=> //.
rewrite -[in LHS]size_poly_eq0 size_scale ?size_poly_eq0 //.
by rewrite invr_eq0 expf_neq0 //; apply: contraTneq ulcq => ->; rewrite unitr0.
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... | [
"apply",
"contraTneq",
"dvdp",
"expf_neq0",
"invr_eq0",
"lead_coef",
"modpE",
"rdvdp",
"size_poly_eq0",
"size_scale",
"unit",
"unitr0"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
lc_expn_scalp_neq0 p q : lead_coef q ^+ scalp p q != 0. | Proof.
have [->|nzq] := eqVneq q 0; last by rewrite expf_neq0 ?lead_coef_eq0.
by rewrite /scalp 2!unlock /= eqxx lead_coef0 unitr0 /= oner_neq0.
Qed. | Lemma | lc_expn_scalp_neq0 | 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",
"expf_neq0",
"last",
"lead_coef",
"lead_coef0",
"lead_coef_eq0",
"oner_neq0",
"scalp",
"unitr0"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
edivp_spec (m d : {poly R}) :
nat * {poly R} * {poly R} -> bool -> Type | :=
|Redivp_spec k (q r: {poly R}) of
(lead_coef d ^+ k) *: m = q * d + r & lead_coef d \notin GRing.unit &
(d != 0 -> size r < size d) : edivp_spec m d (k, q, r) false
|Fedivp_spec (q r: {poly R}) of m = q * d + r & (lead_coef d \in GRing.unit) &
(d != 0 -> size r < size d) : edivp_spec m d (0, q, r) true. | 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... | [
"lead_coef",
"nat",
"poly",
"size",
"unit"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
edivpP m d : edivp_spec m d (edivp m d) (lead_coef d \in GRing.unit). | Proof.
have hC : GRing.comm d (lead_coef d)%:P by rewrite /GRing.comm mulrC.
case ud: (lead_coef d \in GRing.unit); last first.
rewrite edivp_redivp // redivp_def; constructor; rewrite ?ltn_rmodp // ?ud //.
by rewrite rdivp_eq.
have cdn0: lead_coef d != 0 by apply: contraTneq ud => ->; rewrite unitr0.
rewrite unloc... | 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",
"comm",
"contraTneq",
"divrr",
"edivp",
"edivp_redivp",
"edivp_spec",
"expf_eq0",
"expf_neq0",
"expr1n",
"exprMn",
"exprVn",
"invr_eq0",
"last",
"lead_coef",
"ltn_rmodp",
"mul1r",
"mul_polyC",
"mulfI",
"mulrA",
"mulrC",
"polyCM",
"polyC_eq0",
"polyC_exp",
"rd... | might be polished in light of usage. | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d |
edivp_eq d q r : size r < size d -> lead_coef d \in GRing.unit ->
edivp (q * d + r) d = (0, q, r). | Proof.
have hC : GRing.comm d (lead_coef d)%:P by apply: mulrC.
move=> hsrd hu; rewrite unlock hu; case et: (redivp _ _) => [[s qq] rr].
have cdn0 : lead_coef d != 0 by case: eqP hu => //= ->; rewrite unitr0.
move: (et); rewrite RingComRreg.redivp_eq //; first exact/rregP.
rewrite et /= mulrC (mulrC r) !mul_polyC; case... | 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",
"comm",
"edivp",
"lead_coef",
"mulVr",
"mul_polyC",
"mulrC",
"redivp",
"redivp_eq",
"rregP",
"scale1r",
"scalerA",
"size",
"unit",
"unitr0",
"unitrX"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
divp_eq p q : (lead_coef q ^+ scalp p q) *: p = (p %/ q) * q + (p %% q). | Proof.
rewrite divpE modpE scalpE.
case uq: (lead_coef q \in GRing.unit); last by rewrite rdivp_eq.
rewrite expr0 scale1r; have [->|qn0] := eqVneq q 0.
by rewrite lead_coef0 expr0n /rscalp unlock eqxx invr1 !scale1r rmodp0 !simp.
by rewrite -scalerAl -scalerDr -rdivp_eq scalerA mulVr (scale1r, unitrX).
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... | [
"divpE",
"eqVneq",
"eqxx",
"expr0",
"expr0n",
"invr1",
"last",
"lead_coef",
"lead_coef0",
"modpE",
"mulVr",
"rdivp_eq",
"rmodp0",
"rscalp",
"scale1r",
"scalerA",
"scalerAl",
"scalerDr",
"scalp",
"scalpE",
"simp",
"unit",
"unitrX"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
dvdp_eq q p : (q %| p) = (lead_coef q ^+ scalp p q *: p == (p %/ q) * q). | Proof.
rewrite dvdpE rdvdp_eq scalpE divpE; case: ifP => ulcq //.
rewrite expr0 scale1r -scalerAl; apply/eqP/eqP => [<- | {2}->].
by rewrite scalerA mulVr ?scale1r // unitrX.
by rewrite scalerA mulrV ?scale1r // unitrX.
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",
"divpE",
"dvdpE",
"expr0",
"lead_coef",
"mulVr",
"mulrV",
"rdvdp_eq",
"scale1r",
"scalerA",
"scalerAl",
"scalp",
"scalpE",
"unitrX"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
divpK d p : d %| p -> p %/ d * d = (lead_coef d ^+ scalp p 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",
"lead_coef",
"scalp"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
divpKC d p : d %| p -> d * (p %/ d) = (lead_coef d ^+ scalp 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",
"lead_coef",
"mulrC",
"scalp"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
dvdpP q p :
reflect (exists2 cqq, cqq.1 != 0 & cqq.1 *: p = cqq.2 * q) (q %| p). | Proof.
rewrite dvdp_eq; apply: (iffP eqP) => [e | [[c qq] cn0 e]].
by exists (lead_coef q ^+ scalp p q, p %/ q) => //=.
apply/eqP; rewrite -dvdp_eq dvdpE.
have Ecc: c%:P != 0 by rewrite polyC_eq0.
have [->|nz_p] := eqVneq p 0; first by rewrite rdvdp0.
pose p1 : {poly R} := lead_coef q ^+ rscalp p q *: qq - c *: (rdiv... | 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... | [
"addKr",
"addrC",
"apply",
"dvdpE",
"dvdp_eq",
"eqVneq",
"lead_coef",
"leq_addl",
"ltnNge",
"ltn_rmodp",
"mulNr",
"mul_polyC",
"mulf_eq0",
"mulrC",
"mulrDl",
"nz_p",
"poly",
"polyC_eq0",
"polySpred",
"rdivp",
"rdivp_eq",
"rdvdp0",
"rmodp",
"rscalp",
"scalerA",
"scal... | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
mulpK p q : q != 0 -> p * q %/ q = lead_coef q ^+ scalp (p * q) q *: p. | Proof.
move=> qn0; apply: (rregP qn0); rewrite -scalerAl divp_eq.
suff -> : (p * q) %% q = 0 by rewrite addr0.
rewrite modpE RingComRreg.rmodp_mull ?scaler0 ?if_same //.
by red; rewrite mulrC.
by apply/rregP; rewrite 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... | [
"addr0",
"apply",
"divp_eq",
"lead_coef",
"lead_coef_eq0",
"modpE",
"mulrC",
"rmodp_mull",
"rregP",
"scaler0",
"scalerAl",
"scalp"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
mulKp p q : q != 0 -> q * p %/ q = lead_coef q ^+ scalp (p * q) q *: p. | Proof. by move=> nzq; 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",
"lead_coef",
"mulpK",
"mulrC",
"scalp"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
divpp p : p != 0 -> p %/ p = (lead_coef p ^+ scalp p p)%:P. | Proof.
move=> np0; have := divp_eq p p.
suff -> : p %% p = 0 by rewrite addr0 -mul_polyC; move/(mulIf np0).
rewrite modpE Ring.rmodpp; first by red; rewrite mulrC.
by rewrite scaler0 if_same.
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... | [
"Ring",
"addr0",
"divp_eq",
"lead_coef",
"modpE",
"mulIf",
"mul_polyC",
"mulrC",
"rmodpp",
"scaler0",
"scalp"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
scalp0 p : scalp p 0 = 0. | Proof. by rewrite /scalp unlock lead_coef0 unitr0 unlock eqxx. Qed. | Lemma | scalp0 | 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... | [
"eqxx",
"lead_coef0",
"scalp",
"unitr0"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
divp_small p q : size p < size q -> p %/ q = 0. | Proof.
move=> spq; rewrite /divp unlock redivp_def /=.
by case: ifP; rewrite rdivp_small // scaler0.
Qed. | Lemma | divp_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... | [
"divp",
"rdivp_small",
"redivp_def",
"scaler0",
"size"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
leq_divp p q : (size (p %/ q) <= size p). | Proof.
rewrite /divp unlock redivp_def /=; case: ifP => ulcq; rewrite ?leq_rdivp //=.
rewrite size_scale ?leq_rdivp // -exprVn expf_neq0 // invr_eq0.
by case: eqP ulcq => // ->; rewrite unitr0.
Qed. | Lemma | leq_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... | [
"divp",
"expf_neq0",
"exprVn",
"invr_eq0",
"leq_rdivp",
"redivp_def",
"size",
"size_scale",
"unitr0"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
div0p p : 0 %/ p = 0. | Proof.
by rewrite /divp unlock redivp_def /=; case: ifP; rewrite rdiv0p // scaler0.
Qed. | Lemma | div0p | 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",
"rdiv0p",
"redivp_def",
"scaler0"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
divp0 p : p %/ 0 = 0. | Proof.
by rewrite /divp unlock redivp_def /=; case: ifP; rewrite rdivp0 // scaler0.
Qed. | Lemma | divp0 | 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",
"rdivp0",
"redivp_def",
"scaler0"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
divp1 m : m %/ 1 = m. | Proof.
by rewrite divpE lead_coefC unitr1 Ring.rdivp1 expr1n invr1 scale1r.
Qed. | Lemma | divp1 | 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... | [
"Ring",
"divpE",
"expr1n",
"invr1",
"lead_coefC",
"rdivp1",
"scale1r",
"unitr1"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modp0 p : p %% 0 = p. | Proof.
rewrite /modp unlock redivp_def; case: ifP; rewrite rmodp0 //= lead_coef0.
by rewrite unitr0.
Qed. | Lemma | modp0 | 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_coef0",
"modp",
"redivp_def",
"rmodp0",
"unitr0"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
mod0p p : 0 %% p = 0. | Proof.
by rewrite /modp unlock redivp_def /=; case: ifP; rewrite rmod0p // scaler0.
Qed. | Lemma | mod0p | 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... | [
"modp",
"redivp_def",
"rmod0p",
"scaler0"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modp1 p : p %% 1 = 0. | Proof.
by rewrite /modp unlock redivp_def /=; case: ifP; rewrite rmodp1 // scaler0.
Qed. | Lemma | modp1 | 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... | [
"modp",
"redivp_def",
"rmodp1",
"scaler0"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modp_small p q : size p < size q -> p %% q = p. | Proof.
move=> spq; rewrite /modp unlock redivp_def; case: ifP; rewrite rmodp_small //.
by rewrite /= rscalp_small // expr0 /= invr1 scale1r.
Qed. | Lemma | modp_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... | [
"expr0",
"invr1",
"modp",
"redivp_def",
"rmodp_small",
"rscalp_small",
"scale1r",
"size"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modpC p c : c != 0 -> p %% c%:P = 0. | Proof.
move=> cn0; rewrite /modp unlock redivp_def /=; case: ifP; rewrite ?rmodpC //.
by rewrite scaler0.
Qed. | Lemma | modpC | 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... | [
"modp",
"redivp_def",
"rmodpC",
"scaler0"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modp_mull p q : (p * q) %% q = 0. | Proof.
have [-> | nq0] := eqVneq q 0; first by rewrite modp0 mulr0.
have rlcq : GRing.rreg (lead_coef q) by apply/rregP; rewrite lead_coef_eq0.
have hC : GRing.comm q (lead_coef q)%:P by red; rewrite mulrC.
rewrite modpE; case: ifP => ulcq; rewrite RingComRreg.rmodp_mull //.
exact: scaler0.
Qed. | Lemma | modp_mull | 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",
"comm",
"eqVneq",
"lead_coef",
"lead_coef_eq0",
"modp0",
"modpE",
"mulr0",
"mulrC",
"rmodp_mull",
"rreg",
"rregP",
"scaler0"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modp_mulr d p : (d * p) %% d = 0. | Proof. by rewrite mulrC modp_mull. Qed. | Lemma | modp_mulr | 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... | [
"modp_mull",
"mulrC"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modpp d : d %% d = 0. | Proof. by rewrite -[d in d %% _]mul1r modp_mull. 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... | [
"modp_mull",
"mul1r"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
ltn_modp p q : (size (p %% q) < size q) = (q != 0). | Proof.
rewrite /modp unlock redivp_def /=; case: ifP=> ulcq; rewrite ?ltn_rmodp //=.
rewrite size_scale ?ltn_rmodp // -exprVn expf_neq0 // invr_eq0.
by case: eqP ulcq => // ->; rewrite unitr0.
Qed. | Lemma | ltn_modp | 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",
"exprVn",
"invr_eq0",
"ltn_rmodp",
"modp",
"redivp_def",
"size",
"size_scale",
"unitr0"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
ltn_divpl d q p : d != 0 ->
(size (q %/ d) < size p) = (size q < size (p * d)). | Proof.
move=> dn0.
have: (lead_coef d) ^+ (scalp q d) != 0 by apply: lc_expn_scalp_neq0.
move/(size_scale q)<-; rewrite divp_eq; have [->|quo0] := eqVneq (q %/ d) 0.
rewrite mul0r add0r size_poly0 size_poly_gt0.
have [->|pn0] := eqVneq p 0; first by rewrite mul0r size_poly0 ltn0.
by rewrite size_mul // (polySpred... | Lemma | ltn_divpl | 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",
"apply",
"divp_eq",
"eqVneq",
"lc_expn_scalp_neq0",
"lead_coef",
"ltn0",
"ltn_add2r",
"ltn_addl",
"ltn_modp",
"mul0r",
"polySpred",
"scalp",
"size",
"size_mul",
"size_poly0",
"size_polyDl",
"size_poly_gt0",
"size_scale"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
leq_divpr d p q : d != 0 ->
(size p <= size (q %/ d)) = (size (p * d) <= size q). | Proof. by move=> dn0; rewrite leqNgt ltn_divpl // -leqNgt. Qed. | Lemma | leq_divpr | 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",
"ltn_divpl",
"size"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
divpN0 d p : d != 0 -> (p %/ d != 0) = (size d <= size p). | Proof.
move=> dn0.
by rewrite -[d in RHS]mul1r -leq_divpr // size_polyC oner_eq0 size_poly_gt0.
Qed. | Lemma | divpN0 | 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_divpr",
"mul1r",
"oner_eq0",
"size",
"size_polyC",
"size_poly_gt0"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
size_divp p q : q != 0 -> size (p %/ q) = (size p - (size q).-1)%N. | Proof.
move=> nq0; case: (leqP (size q) (size p)) => sqp; last first.
move: (sqp); rewrite -{1}(ltn_predK sqp) ltnS -subn_eq0 divp_small //.
by move/eqP->; rewrite size_poly0.
have np0 : p != 0.
by rewrite -size_poly_gt0; apply: leq_trans sqp; rewrite size_poly_gt0.
have /= := congr1 (size \o @polyseq R) (divp_eq... | Lemma | size_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... | [
"add0r",
"addSn",
"addnK",
"addnS",
"apply",
"divp_eq",
"divp_small",
"eqVneq",
"expf_eq0",
"last",
"lead_coef_eq0",
"leqP",
"leq_addl",
"leq_trans",
"ltnNge",
"ltnS",
"ltn_modp",
"ltn_predK",
"mul0r",
"polySpred",
"size",
"size_mul",
"size_poly0",
"size_polyDl",
"siz... | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
ltn_modpN0 p q : q != 0 -> size (p %% q) < size q. | Proof. by rewrite ltn_modp. Qed. | Lemma | ltn_modpN0 | 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... | [
"ltn_modp",
"size"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modp_id p q : (p %% q) %% q = p %% q. | Proof.
by have [->|qn0] := eqVneq q 0; rewrite ?modp0 // modp_small ?ltn_modp.
Qed. | Lemma | modp_id | 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",
"ltn_modp",
"modp0",
"modp_small"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
leq_modp m d : size (m %% d) <= size m. | Proof.
rewrite /modp unlock redivp_def /=; case: ifP; rewrite ?leq_rmodp //.
move=> ud; rewrite size_scale ?leq_rmodp // invr_eq0 expf_neq0 //.
by apply: contraTneq ud => ->; rewrite unitr0.
Qed. | Lemma | leq_modp | 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",
"expf_neq0",
"invr_eq0",
"leq_rmodp",
"modp",
"redivp_def",
"size",
"size_scale",
"unitr0"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
dvdp0 d : d %| 0. | Proof. by rewrite /dvdp mod0p. Qed. | Lemma | dvdp0 | 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",
"mod0p"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
dvd0p p : (0 %| p) = (p == 0). | Proof. by rewrite /dvdp modp0. Qed. | Lemma | dvd0p | 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",
"modp0"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
dvd0pP p : reflect (p = 0) (0 %| p). | Proof. by apply: (iffP idP); rewrite dvd0p; move/eqP. Qed. | Lemma | dvd0pP | 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"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
dvdpN0 p q : p %| q -> q != 0 -> p != 0. | Proof. by move=> pq hq; apply: contraTneq pq => ->; rewrite dvd0p. Qed. | Lemma | dvdpN0 | 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"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
dvdp1 d : (d %| 1) = (size d == 1). | Proof.
rewrite /dvdp modpE; case ud: (lead_coef d \in GRing.unit); last exact: rdvdp1.
rewrite -size_poly_eq0 size_scale; last by rewrite size_poly_eq0 -rdvdp1.
by rewrite invr_eq0 expf_neq0 //; apply: contraTneq ud => ->; rewrite unitr0.
Qed. | Lemma | dvdp1 | 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",
"dvdp",
"expf_neq0",
"invr_eq0",
"last",
"lead_coef",
"modpE",
"rdvdp1",
"size",
"size_poly_eq0",
"size_scale",
"unit",
"unitr0"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
dvd1p m : 1 %| m. | Proof. by rewrite /dvdp modp1. Qed. | Lemma | dvd1p | 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",
"modp1"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
gtNdvdp p q : p != 0 -> size p < size q -> (q %| p) = false. | Proof.
by move=> nn0 hs; rewrite /dvdp; rewrite (modp_small hs); apply: negPf.
Qed. | Lemma | gtNdvdp | 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",
"modp_small",
"size"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modp_eq0P p q : reflect (p %% q = 0) (q %| p). | Proof. exact: (iffP eqP). Qed. | Lemma | modp_eq0P | 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... | [] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modp_eq0 p q : (q %| p) -> p %% q = 0. | Proof. exact: modp_eq0P. Qed. | Lemma | modp_eq0 | 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... | [
"modp_eq0P"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
leq_divpl d p q :
d %| p -> (size (p %/ d) <= size q) = (size p <= size (q * d)). | Proof.
case: (eqVneq d 0) => [-> /dvd0pP -> | nd0 hd].
by rewrite divp0 size_poly0 !leq0n.
rewrite leq_eqVlt ltn_divpl // (leq_eqVlt (size p)).
case lhs: (size p < size (q * d)); rewrite ?orbT ?orbF //.
have: (lead_coef d) ^+ (scalp p d) != 0 by rewrite expf_neq0 // lead_coef_eq0.
move/(size_scale p)<-; rewrite divp_... | Lemma | leq_divpl | 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... | [
"addnS",
"addr0",
"divp0",
"divp_eq",
"dvd0pP",
"eqVneq",
"eq_sym",
"eqn_add2r",
"expf_neq0",
"lead_coef",
"lead_coef_eq0",
"leq0n",
"leq_eqVlt",
"ltn_divpl",
"modp_eq0P",
"mul0r",
"mulf_eq0",
"polySpred",
"scalp",
"size",
"size_mul",
"size_poly0",
"size_poly_eq0",
"siz... | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
dvdp_leq p q : q != 0 -> p %| q -> size p <= size q. | Proof.
move=> nq0 /modp_eq0P.
by case: leqP => // /modp_small -> /eqP; rewrite (negPf nq0).
Qed. | Lemma | dvdp_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... | [
"leqP",
"modp_eq0P",
"modp_small",
"size"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
eq_dvdp c quo q p : c != 0 -> c *: p = quo * q -> q %| p. | Proof.
move=> cn0; case: (eqVneq p 0) => [->|nz_quo def_quo] //.
pose p1 : {poly R} := lead_coef q ^+ scalp p q *: quo - c *: (p %/ q).
have E1: c *: (p %% q) = p1 * q.
rewrite mulrBl -scalerAl -def_quo scalerA mulrC -scalerA -scalerAl -scalerBr.
by rewrite divp_eq [_ + _ %% _]addrC addrK.
rewrite /dvdp; apply/idPn... | Lemma | eq_dvdp | 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... | [
"addrC",
"addrK",
"apply",
"divp_eq",
"dvdp",
"eqVneq",
"lead_coef",
"leq_addl",
"ltnNge",
"ltn_modp",
"mul_polyC",
"mulf_eq0",
"mulf_neq0",
"mulrBl",
"mulrC",
"poly",
"polyC_eq0",
"polySpred",
"scalerA",
"scalerAl",
"scalerBr",
"scalp",
"size_mul",
"size_scale"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
dvdpp d : d %| d. | Proof. by rewrite /dvdp modpp. 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... | [
"dvdp",
"modpp"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
divp_dvd p q : p %| q -> (q %/ p) %| q. | Proof.
have [-> | np0] := eqVneq p 0; first by rewrite divp0.
rewrite dvdp_eq => /eqP h.
apply: (@eq_dvdp ((lead_coef p)^+ (scalp q p)) p); last by rewrite mulrC.
by rewrite expf_neq0 // lead_coef_eq0.
Qed. | Lemma | divp_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",
"divp0",
"dvdp_eq",
"eqVneq",
"eq_dvdp",
"expf_neq0",
"last",
"lead_coef",
"lead_coef_eq0",
"mulrC",
"scalp"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
dvdp_mull m d n : d %| n -> d %| m * n. | Proof.
case: (eqVneq d 0) => [-> /dvd0pP -> | dn0]; first by rewrite mulr0 dvdpp.
rewrite dvdp_eq => /eqP e.
apply: (@eq_dvdp (lead_coef d ^+ scalp n d) (m * (n %/ d))).
by rewrite expf_neq0 // lead_coef_eq0.
by rewrite scalerAr e mulrA.
Qed. | Lemma | dvdp_mull | 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",
"dvdp_eq",
"dvdpp",
"eqVneq",
"eq_dvdp",
"expf_neq0",
"lead_coef",
"lead_coef_eq0",
"mulr0",
"mulrA",
"scalerAr",
"scalp"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
dvdp_mulr n d m : d %| m -> d %| m * n. | Proof. by move=> hdm; rewrite mulrC dvdp_mull. Qed. | Lemma | dvdp_mulr | 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_mull",
"mulrC"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.