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
divzAm n p : (p %| n -> n %| m * p -> m %/ (n %/ p)%Z = m * p %/ n)%Z. Proof. move/divzK=> p_dv_n; have [->|] := eqVneq n 0; first by rewrite div0z !divz0. rewrite -{1 2}p_dv_n mulf_eq0 => /norP[pn_nz p_nz] /divzK; rewrite mulrA p_dv_n. by move/mulIf=> {1} <- //; rewrite mulzK. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
divzA
divzMAm n p : (n * p %| m -> m %/ (n * p) = (m %/ n)%Z %/ p)%Z. Proof. have [-> | nz_p] := eqVneq p 0; first by rewrite mulr0 !divz0. have [-> | nz_n] := eqVneq n 0; first by rewrite mul0r !divz0 div0z. by move/divzK=> {2} <-; rewrite mulrA mulrAC !mulzK. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
divzMA
divzACm n p : (n * p %| m -> (m %/ n)%Z %/ p = (m %/ p)%Z %/ n)%Z. Proof. by move=> np_dv_mn; rewrite -!divzMA // mulrC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
divzAC
divzMlp m d : p != 0 -> (d %| m -> p * m %/ (p * d) = m %/ d)%Z. Proof. have [-> | nz_d nz_p] := eqVneq d 0; first by rewrite mulr0 !divz0. by move/divzK=> {1}<-; rewrite mulrCA mulzK ?mulf_neq0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
divzMl
divzMrp m d : p != 0 -> (d %| m -> m * p %/ (d * p) = m %/ d)%Z. Proof. by rewrite -!(mulrC p); apply: divzMl. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
divzMr
dvdz_mul2lp d m : p != 0 -> (p * d %| p * m)%Z = (d %| m)%Z. Proof. by rewrite !dvdzE -absz_gt0 !abszM; apply: dvdn_pmul2l. Qed. Arguments dvdz_mul2l [p d m].
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
dvdz_mul2l
dvdz_mul2rp d m : p != 0 -> (d * p %| m * p)%Z = (d %| m)%Z. Proof. by rewrite !dvdzE -absz_gt0 !abszM; apply: dvdn_pmul2r. Qed. Arguments dvdz_mul2r [p d m].
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
dvdz_mul2r
dvdz_exp2lp m n : (m <= n)%N -> (p ^+ m %| p ^+ n)%Z. Proof. by rewrite dvdzE !abszX; apply: dvdn_exp2l. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
dvdz_exp2l
dvdz_Pexp2lp m n : `|p| > 1 -> (p ^+ m %| p ^+ n)%Z = (m <= n)%N. Proof. by rewrite dvdzE !abszX ltz_nat; apply: dvdn_Pexp2l. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
dvdz_Pexp2l
dvdz_exp2rm n k : (m %| n -> m ^+ k %| n ^+ k)%Z. Proof. by rewrite !dvdzE !abszX; apply: dvdn_exp2r. Qed. Fact dvdz_zmod_closed d : zmod_closed (dvdz d). Proof. split=> [|_ _ /dvdzP[p ->] /dvdzP[q ->]]; first exact: dvdz0. by rewrite -mulrBl dvdz_mull. Qed. HB.instance Definition _ d := GRing.isZmodClosed.Build int (dvdz d) (dvdz_zmod_closed d).
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
dvdz_exp2r
dvdz_expk d m : (0 < k)%N -> (d %| m -> d %| m ^+ k)%Z. Proof. by case: k => // k _ d_dv_m; rewrite exprS dvdz_mulr. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
dvdz_exp
eqz_mod_dvdd m n : (m == n %[mod d])%Z = (d %| m - n)%Z. Proof. apply/eqP/dvdz_mod0P=> eq_mn. by rewrite -modzDml eq_mn modzDml subrr mod0z. by rewrite -(subrK n m) -modzDml eq_mn add0r. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
eqz_mod_dvd
divzDlm n d : (d %| m)%Z -> ((m + n) %/ d)%Z = (m %/ d)%Z + (n %/ d)%Z. Proof. have [-> | d_nz] := eqVneq d 0; first by rewrite !divz0. by move/divzK=> {1}<-; rewrite divzMDl. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
divzDl
divzDrm n d : (d %| n)%Z -> ((m + n) %/ d)%Z = (m %/ d)%Z + (n %/ d)%Z. Proof. by move=> dv_n; rewrite addrC divzDl // addrC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
divzDr
dvdz_pcharf(R : nzRingType) p : p \in [pchar R] -> forall n : int, (p %| n)%Z = (n%:~R == 0 :> R). Proof. move=> pcharRp [] n; rewrite [LHS](dvdn_pcharf pcharRp)//. by rewrite NegzE abszN rmorphN// oppr_eq0. Qed. #[deprecated(since="mathcomp 2.4.0", note="Use dvdz_pcharf instead.")]
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
dvdz_pcharf
dvdz_charfchRp := (dvdz_pcharf chRp).
Notation
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
dvdz_charf
gcdzzm : gcdz m m = `|m|%:Z. Proof. by rewrite /gcdz gcdnn. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
gcdzz
gcdzC: commutative gcdz. Proof. by move=> m n; rewrite /gcdz gcdnC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
gcdzC
gcd0zm : gcdz 0 m = `|m|%:Z. Proof. by rewrite /gcdz gcd0n. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
gcd0z
gcdz0m : gcdz m 0 = `|m|%:Z. Proof. by rewrite /gcdz gcdn0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
gcdz0
gcd1z: left_zero 1 gcdz. Proof. by move=> m; rewrite /gcdz gcd1n. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
gcd1z
gcdz1: right_zero 1 gcdz. Proof. by move=> m; rewrite /gcdz gcdn1. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
gcdz1
dvdz_gcdrm n : (gcdz m n %| n)%Z. Proof. exact: dvdn_gcdr. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
dvdz_gcdr
dvdz_gcdlm n : (gcdz m n %| m)%Z. Proof. exact: dvdn_gcdl. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
dvdz_gcdl
gcdz_eq0m n : (gcdz m n == 0) = (m == 0) && (n == 0). Proof. by rewrite -absz_eq0 eqn0Ngt gcdn_gt0 !negb_or -!eqn0Ngt !absz_eq0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
gcdz_eq0
gcdNzm n : gcdz (- m) n = gcdz m n. Proof. by rewrite /gcdz abszN. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
gcdNz
gcdzNm n : gcdz m (- n) = gcdz m n. Proof. by rewrite /gcdz abszN. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
gcdzN
gcdz_modrm n : gcdz m (n %% m)%Z = gcdz m n. Proof. rewrite -modz_abs /gcdz; move/absz: m => m. have [-> | m_gt0] := posnP m; first by rewrite modz0. case: n => n; first by rewrite modz_nat gcdn_modr. rewrite modNz_nat // NegzE abszN {2}(divn_eq n m) -addnS gcdnMDl. rewrite -addrA -opprD -intS /=; set m1 := _.+1. have le_m1m: (m1 <= m)%N by apply: ltn_pmod. by rewrite subzn // !(gcdnC m) -{2 3}(subnK le_m1m) gcdnDl gcdnDr gcdnC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
gcdz_modr
gcdz_modlm n : gcdz (m %% n)%Z n = gcdz m n. Proof. by rewrite -!(gcdzC n) gcdz_modr. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
gcdz_modl
gcdzMDlq m n : gcdz m (q * m + n) = gcdz m n. Proof. by rewrite -gcdz_modr modzMDl gcdz_modr. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
gcdzMDl
gcdzDlm n : gcdz m (m + n) = gcdz m n. Proof. by rewrite -{2}(mul1r m) gcdzMDl. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
gcdzDl
gcdzDrm n : gcdz m (n + m) = gcdz m n. Proof. by rewrite addrC gcdzDl. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
gcdzDr
gcdzMln m : gcdz n (m * n) = `|n|%:Z. Proof. by rewrite -[m * n]addr0 gcdzMDl gcdz0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
gcdzMl
gcdzMrn m : gcdz n (n * m) = `|n|%:Z. Proof. by rewrite mulrC gcdzMl. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
gcdzMr
gcdz_idPl{m n} : reflect (gcdz m n = `|m|%:Z) (m %| n)%Z. Proof. by apply: (iffP gcdn_idPl) => [<- | []]. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
gcdz_idPl
gcdz_idPr{m n} : reflect (gcdz m n = `|n|%:Z) (n %| m)%Z. Proof. by rewrite gcdzC; apply: gcdz_idPl. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
gcdz_idPr
expz_mine m n : e >= 0 -> e ^+ minn m n = gcdz (e ^+ m) (e ^+ n). Proof. by case: e => // e _; rewrite /gcdz !abszX -expn_min -natz -natrX !natz. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
expz_min
dvdz_gcdp m n : (p %| gcdz m n)%Z = (p %| m)%Z && (p %| n)%Z. Proof. exact: dvdn_gcd. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
dvdz_gcd
gcdzAC: right_commutative gcdz. Proof. by move=> m n p; rewrite /gcdz gcdnAC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
gcdzAC
gcdzA: associative gcdz. Proof. by move=> m n p; rewrite /gcdz gcdnA. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
gcdzA
gcdzCA: left_commutative gcdz. Proof. by move=> m n p; rewrite /gcdz gcdnCA. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
gcdzCA
gcdzACA: interchange gcdz gcdz. Proof. by move=> m n p q; rewrite /gcdz gcdnACA. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
gcdzACA
mulz_gcdrm n p : `|m|%:Z * gcdz n p = gcdz (m * n) (m * p). Proof. by rewrite -PoszM muln_gcdr -!abszM. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
mulz_gcdr
mulz_gcdlm n p : gcdz m n * `|p|%:Z = gcdz (m * p) (n * p). Proof. by rewrite -PoszM muln_gcdl -!abszM. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
mulz_gcdl
mulz_divCA_gcdn m : n * (m %/ gcdz n m)%Z = m * (n %/ gcdz n m)%Z. Proof. by rewrite mulz_divCA ?dvdz_gcdl ?dvdz_gcdr. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
mulz_divCA_gcd
dvdz_lcmrm n : (n %| lcmz m n)%Z. Proof. exact: dvdn_lcmr. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
dvdz_lcmr
dvdz_lcmlm n : (m %| lcmz m n)%Z. Proof. exact: dvdn_lcml. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
dvdz_lcml
dvdz_lcmd1 d2 m : ((lcmn d1 d2 %| m) = (d1 %| m) && (d2 %| m))%Z. Proof. exact: dvdn_lcm. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
dvdz_lcm
lcmzC: commutative lcmz. Proof. by move=> m n; rewrite /lcmz lcmnC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
lcmzC
lcm0z: left_zero 0 lcmz. Proof. by move=> x; rewrite /lcmz absz0 lcm0n. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
lcm0z
lcmz0: right_zero 0 lcmz. Proof. by move=> x; rewrite /lcmz absz0 lcmn0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
lcmz0
lcmz_ge0m n : 0 <= lcmz m n. Proof. by []. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
lcmz_ge0
lcmz_neq0m n : (lcmz m n != 0) = (m != 0) && (n != 0). Proof. have [->|m_neq0] := eqVneq m 0; first by rewrite lcm0z. have [->|n_neq0] := eqVneq n 0; first by rewrite lcmz0. by rewrite gt_eqF// [0 < _]lcmn_gt0 !absz_gt0 m_neq0 n_neq0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
lcmz_neq0
coprimezEm n : coprimez m n = coprime `|m| `|n|. Proof. by []. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
coprimezE
coprimez_sym: symmetric coprimez. Proof. by move=> m n; apply: coprime_sym. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
coprimez_sym
coprimeNzm n : coprimez (- m) n = coprimez m n. Proof. by rewrite coprimezE abszN. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
coprimeNz
coprimezNm n : coprimez m (- n) = coprimez m n. Proof. by rewrite coprimezE abszN. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
coprimezN
egcdz_specm n : int * int -> Type := EgcdzSpec u v of u * m + v * n = gcdz m n & coprimez u v : egcdz_spec m n (u, v).
Variant
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
egcdz_spec
egcdzPm n : egcdz_spec m n (egcdz m n). Proof. rewrite /egcdz; have [-> | m_nz] := eqVneq. by split; [rewrite -abszEsign gcd0z | rewrite coprimezE absz_sign]. have m_gt0 : (`|m| > 0)%N by rewrite absz_gt0. case: egcdnP (coprime_egcdn `|n| m_gt0) => //= u v Duv _ co_uv; split. rewrite !mulNr -!mulrA mulrCA -abszEsg mulrCA -abszEsign. by rewrite -!PoszM Duv addnC PoszD addrK. by rewrite coprimezE abszM absz_sg m_nz mul1n mulNr abszN abszMsign. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
egcdzP
Bezoutzm n : {u : int & {v : int | u * m + v * n = gcdz m n}}. Proof. by exists (egcdz m n).1, (egcdz m n).2; case: egcdzP. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
Bezoutz
coprimezPm n : reflect (exists uv, uv.1 * m + uv.2 * n = 1) (coprimez m n). Proof. apply: (iffP eqP) => [<-| [[u v] /= Duv]]. by exists (egcdz m n); case: egcdzP. congr _%:Z; apply: gcdn_def; rewrite ?dvd1n // => d dv_d_n dv_d_m. by rewrite -(dvdzE d 1) -Duv [m]intEsg [n]intEsg rpredD ?dvdz_mull. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
coprimezP
Gauss_dvdzm n p : coprimez m n -> (m * n %| p)%Z = (m %| p)%Z && (n %| p)%Z. Proof. by move/Gauss_dvd <-; rewrite -abszM. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
Gauss_dvdz
Gauss_dvdzrm n p : coprimez m n -> (m %| n * p)%Z = (m %| p)%Z. Proof. by rewrite dvdzE abszM => /Gauss_dvdr->. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
Gauss_dvdzr
Gauss_dvdzlm n p : coprimez m p -> (m %| n * p)%Z = (m %| n)%Z. Proof. by rewrite mulrC; apply: Gauss_dvdzr. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
Gauss_dvdzl
Gauss_gcdzrp m n : coprimez p m -> gcdz p (m * n) = gcdz p n. Proof. by rewrite /gcdz abszM => /Gauss_gcdr->. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
Gauss_gcdzr
Gauss_gcdzlp m n : coprimez p n -> gcdz p (m * n) = gcdz p m. Proof. by move=> co_pn; rewrite mulrC Gauss_gcdzr. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
Gauss_gcdzl
coprimezMrp m n : coprimez p (m * n) = coprimez p m && coprimez p n. Proof. by rewrite -coprimeMr -abszM. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
coprimezMr
coprimezMlp m n : coprimez (m * n) p = coprimez m p && coprimez n p. Proof. by rewrite -coprimeMl -abszM. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
coprimezMl
coprimez_pexplk m n : (0 < k)%N -> coprimez (m ^+ k) n = coprimez m n. Proof. by rewrite /coprimez /gcdz abszX; apply: coprime_pexpl. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
coprimez_pexpl
coprimez_pexprk m n : (0 < k)%N -> coprimez m (n ^+ k) = coprimez m n. Proof. by move=> k_gt0; rewrite !(coprimez_sym m) coprimez_pexpl. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
coprimez_pexpr
coprimezXlk m n : coprimez m n -> coprimez (m ^+ k) n. Proof. by rewrite /coprimez /gcdz abszX; apply: coprimeXl. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
coprimezXl
coprimezXrk m n : coprimez m n -> coprimez m (n ^+ k). Proof. by rewrite !(coprimez_sym m); apply: coprimezXl. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
coprimezXr
coprimez_dvdlm n p : (m %| n)%N -> coprimez n p -> coprimez m p. Proof. exact: coprime_dvdl. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
coprimez_dvdl
coprimez_dvdrm n p : (m %| n)%N -> coprimez p n -> coprimez p m. Proof. exact: coprime_dvdr. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
coprimez_dvdr
dvdz_pexp2rm n k : (k > 0)%N -> (m ^+ k %| n ^+ k)%Z = (m %| n)%Z. Proof. by rewrite dvdzE !abszX; apply: dvdn_pexp2r. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
dvdz_pexp2r
zchinese_remainderx y : (x == y %[mod m1 * m2])%Z = (x == y %[mod m1])%Z && (x == y %[mod m2])%Z. Proof. by rewrite !eqz_mod_dvd Gauss_dvdz. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
zchinese_remainder
zchineser1 r2 := r1 * m2 * (egcdz m1 m2).2 + r2 * m1 * (egcdz m1 m2).1.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
zchinese
zchinese_modlr1 r2 : (zchinese r1 r2 = r1 %[mod m1])%Z. Proof. rewrite /zchinese; have [u v /= Duv _] := egcdzP m1 m2. rewrite -{2}[r1]mulr1 -((gcdz _ _ =P 1) co_m12) -Duv. by rewrite mulrDr mulrAC addrC (mulrAC r2) !mulrA !modzMDl. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
zchinese_modl
zchinese_modrr1 r2 : (zchinese r1 r2 = r2 %[mod m2])%Z. Proof. rewrite /zchinese; have [u v /= Duv _] := egcdzP m1 m2. rewrite -{2}[r2]mulr1 -((gcdz _ _ =P 1) co_m12) -Duv. by rewrite mulrAC modzMDl mulrAC addrC mulrDr !mulrA modzMDl. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
zchinese_modr
zchinese_modx : (x = zchinese (x %% m1)%Z (x %% m2)%Z %[mod m1 * m2])%Z. Proof. apply/eqP; rewrite zchinese_remainder //. by rewrite zchinese_modl zchinese_modr !modz_mod !eqxx. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
zchinese_mod
zcontents(p : {poly int}) : int := sgz (lead_coef p) * \big[gcdn/0]_(i < size p) `|(p`_i)%R|%N.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
zcontents
sgz_contentsp : sgz (zcontents p) = sgz (lead_coef p). Proof. rewrite /zcontents mulrC sgzM sgz_id; set d := _%:Z. have [-> | nz_p] := eqVneq p 0; first by rewrite lead_coef0 mulr0. rewrite gtr0_sgz ?mul1r // ltz_nat polySpred ?big_ord_recr //= -lead_coefE. by rewrite gcdn_gt0 orbC absz_gt0 lead_coef_eq0 nz_p. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
sgz_contents
zcontents_eq0p : (zcontents p == 0) = (p == 0). Proof. by rewrite -sgz_eq0 sgz_contents sgz_eq0 lead_coef_eq0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
zcontents_eq0
zcontents0: zcontents 0 = 0. Proof. by apply/eqP; rewrite zcontents_eq0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
zcontents0
zcontentsZa p : zcontents (a *: p) = a * zcontents p. Proof. have [-> | nz_a] := eqVneq a 0; first by rewrite scale0r mul0r zcontents0. rewrite {2}[a]intEsg mulrCA -mulrA -PoszM big_distrr /= mulrCA mulrA -sgzM. rewrite -lead_coefZ; congr (_ * _%:Z); rewrite size_scale //. by apply: eq_bigr => i _; rewrite coefZ abszM. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
zcontentsZ
zcontents_monicp : p \is monic -> zcontents p = 1. Proof. move=> mon_p; rewrite /zcontents polySpred ?monic_neq0 //. by rewrite big_ord_recr /= -lead_coefE (monicP mon_p) gcdn1. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
zcontents_monic
dvdz_contentsa p : (a %| zcontents p)%Z = (p \is a polyOver (dvdz a)). Proof. rewrite dvdzE abszM absz_sg lead_coef_eq0. have [-> | nz_p] := eqVneq; first by rewrite mul0n dvdn0 rpred0. rewrite mul1n; apply/dvdn_biggcdP/(all_nthP 0)=> a_dv_p i ltip /=. exact: (a_dv_p (Ordinal ltip)). exact: a_dv_p. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
dvdz_contents
map_poly_divzK{a} p : p \is a polyOver (dvdz a) -> a *: map_poly (divz^~ a) p = p. Proof. move/polyOverP=> a_dv_p; apply/polyP=> i. by rewrite coefZ coef_map_id0 ?div0z // mulrC divzK. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
map_poly_divzK
polyOver_dvdzPa p : reflect (exists q, p = a *: q) (p \is a polyOver (dvdz a)). Proof. apply: (iffP idP) => [/map_poly_divzK | [q ->]]. by exists (map_poly (divz^~ a) p). by apply/polyOverP=> i; rewrite coefZ dvdz_mulr. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
polyOver_dvdzP
zprimitivep := map_poly (divz^~ (zcontents p)) p.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
zprimitive
zpolyEprimp : p = zcontents p *: zprimitive p. Proof. by rewrite map_poly_divzK // -dvdz_contents. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
zpolyEprim
zprimitive0: zprimitive 0 = 0. Proof. by apply/polyP=> i; rewrite coef0 coef_map_id0 ?div0z // zcontents0 divz0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
zprimitive0
zprimitive_eq0p : (zprimitive p == 0) = (p == 0). Proof. apply/idP/idP=> /eqP p0; first by rewrite [p]zpolyEprim p0 scaler0. by rewrite p0 zprimitive0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
zprimitive_eq0
size_zprimitivep : size (zprimitive p) = size p. Proof. have [-> | ] := eqVneq p 0; first by rewrite zprimitive0. by rewrite {1 3}[p]zpolyEprim scale_poly_eq0 => /norP[/size_scale-> _]. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
size_zprimitive
sgz_lead_primitivep : sgz (lead_coef (zprimitive p)) = (p != 0). Proof. have [-> | nz_p] := eqVneq; first by rewrite zprimitive0 lead_coef0. apply: (@mulfI _ (sgz (zcontents p))); first by rewrite sgz_eq0 zcontents_eq0. by rewrite -sgzM mulr1 -lead_coefZ -zpolyEprim sgz_contents. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
sgz_lead_primitive
zcontents_primitivep : zcontents (zprimitive p) = (p != 0). Proof. have [-> | nz_p] := eqVneq; first by rewrite zprimitive0 zcontents0. apply: (@mulfI _ (zcontents p)); first by rewrite zcontents_eq0. by rewrite mulr1 -zcontentsZ -zpolyEprim. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
zcontents_primitive
zprimitive_idp : zprimitive (zprimitive p) = zprimitive p. Proof. have [-> | nz_p] := eqVneq p 0; first by rewrite !zprimitive0. by rewrite {2}[zprimitive p]zpolyEprim zcontents_primitive nz_p scale1r. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
zprimitive_id
zprimitive_monicp : p \in monic -> zprimitive p = p. Proof. by move=> mon_p; rewrite {2}[p]zpolyEprim zcontents_monic ?scale1r. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
zprimitive_monic
zprimitiveZa p : a != 0 -> zprimitive (a *: p) = zprimitive p. Proof. have [-> | nz_p nz_a] := eqVneq p 0; first by rewrite scaler0. apply: (@mulfI _ (a * zcontents p)%:P). by rewrite polyC_eq0 mulf_neq0 ?zcontents_eq0. by rewrite -{1}zcontentsZ !mul_polyC -zpolyEprim -scalerA -zpolyEprim. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
zprimitiveZ
zprimitive_minp a q : p != 0 -> p = a *: q -> {b | sgz b = sgz (lead_coef q) & q = b *: zprimitive p}. Proof. move=> nz_p Dp; have /dvdzP/sig_eqW[b Db]: (a %| zcontents p)%Z. by rewrite dvdz_contents; apply/polyOver_dvdzP; exists q. suffices ->: q = b *: zprimitive p. by rewrite lead_coefZ sgzM sgz_lead_primitive nz_p mulr1; exists b. apply: (@mulfI _ a%:P). by apply: contraNneq nz_p; rewrite Dp -mul_polyC => ->; rewrite mul0r. by rewrite !mul_polyC -Dp scalerA mulrC -Db -zpolyEprim. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq path", "From mathcomp Require Import div choice fintype tuple prime order", "From mathcomp Require Import ssralg poly ssrnum ssrint matrix", "From mathcomp Require Import polydiv perm zmodp bigop" ]
algebra/intdiv.v
zprimitive_min