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
equivf:= (@FracField.equivf _). #[global] Hint Resolve denom_ratioP : core.
Notation
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import ssrAC choice tuple bigop ssralg poly polydiv", "From mathcomp Require Import generic_quotient" ]
algebra/fraction.v
equivf
Ratio_numden(x : {ratio R}) : Ratio \n_x \d_x = x. Proof. exact: FracField.Ratio_numden. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import ssrAC choice tuple bigop ssralg poly polydiv", "From mathcomp Require Import generic_quotient" ]
algebra/fraction.v
Ratio_numden
tofrac_is_zmod_morphism: zmod_morphism tofrac. Proof. move=> p q /=; unlock tofrac. rewrite -[X in _ = _ + X]pi_opp -[RHS]pi_add. by rewrite /addf /oppf /= !numden_Ratio ?(oner_neq0, mul1r, mulr1). Qed. #[deprecated(since="mathcomp 2.5.0", note="use `tofrac_is_zmod_morphism` instead")]
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import ssrAC choice tuple bigop ssralg poly polydiv", "From mathcomp Require Import generic_quotient" ]
algebra/fraction.v
tofrac_is_zmod_morphism
tofrac_is_additive:= tofrac_is_zmod_morphism. HB.instance Definition _ := GRing.isZmodMorphism.Build R {fraction R} tofrac tofrac_is_zmod_morphism.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import ssrAC choice tuple bigop ssralg poly polydiv", "From mathcomp Require Import generic_quotient" ]
algebra/fraction.v
tofrac_is_additive
tofrac_is_monoid_morphism: monoid_morphism tofrac. Proof. split=> [//|p q]; unlock tofrac; rewrite -[RHS]pi_mul. by rewrite /mulf /= !numden_Ratio ?(oner_neq0, mul1r, mulr1). Qed. #[deprecated(since="mathcomp 2.5.0", note="use `tofrac_is_monoid_morphism` instead")]
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import ssrAC choice tuple bigop ssralg poly polydiv", "From mathcomp Require Import generic_quotient" ]
algebra/fraction.v
tofrac_is_monoid_morphism
tofrac_is_multiplicative:= tofrac_is_monoid_morphism. HB.instance Definition _ := GRing.isMonoidMorphism.Build R {fraction R} tofrac tofrac_is_monoid_morphism.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import ssrAC choice tuple bigop ssralg poly polydiv", "From mathcomp Require Import generic_quotient" ]
algebra/fraction.v
tofrac_is_multiplicative
tofrac0: 0%:F = 0. Proof. exact: rmorph0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import ssrAC choice tuple bigop ssralg poly polydiv", "From mathcomp Require Import generic_quotient" ]
algebra/fraction.v
tofrac0
tofracN: {morph tofrac: x / - x}. Proof. exact: rmorphN. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import ssrAC choice tuple bigop ssralg poly polydiv", "From mathcomp Require Import generic_quotient" ]
algebra/fraction.v
tofracN
tofracD: {morph tofrac: x y / x + y}. Proof. exact: rmorphD. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import ssrAC choice tuple bigop ssralg poly polydiv", "From mathcomp Require Import generic_quotient" ]
algebra/fraction.v
tofracD
tofracB: {morph tofrac: x y / x - y}. Proof. exact: rmorphB. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import ssrAC choice tuple bigop ssralg poly polydiv", "From mathcomp Require Import generic_quotient" ]
algebra/fraction.v
tofracB
tofracMnn : {morph tofrac: x / x *+ n}. Proof. exact: rmorphMn. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import ssrAC choice tuple bigop ssralg poly polydiv", "From mathcomp Require Import generic_quotient" ]
algebra/fraction.v
tofracMn
tofracMNnn : {morph tofrac: x / x *- n}. Proof. exact: rmorphMNn. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import ssrAC choice tuple bigop ssralg poly polydiv", "From mathcomp Require Import generic_quotient" ]
algebra/fraction.v
tofracMNn
tofrac1: 1%:F = 1. Proof. exact: rmorph1. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import ssrAC choice tuple bigop ssralg poly polydiv", "From mathcomp Require Import generic_quotient" ]
algebra/fraction.v
tofrac1
tofracM: {morph tofrac: x y / x * y}. Proof. exact: rmorphM. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import ssrAC choice tuple bigop ssralg poly polydiv", "From mathcomp Require Import generic_quotient" ]
algebra/fraction.v
tofracM
tofracXnn : {morph tofrac: x / x ^+ n}. Proof. exact: rmorphXn. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import ssrAC choice tuple bigop ssralg poly polydiv", "From mathcomp Require Import generic_quotient" ]
algebra/fraction.v
tofracXn
tofrac_eq(p q : R): (p%:F == q%:F) = (p == q). Proof. apply/eqP/eqP=> [|->//]; unlock tofrac=> /eqmodP /eqP /=. by rewrite !numden_Ratio ?(oner_eq0, mul1r, mulr1). Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import ssrAC choice tuple bigop ssralg poly polydiv", "From mathcomp Require Import generic_quotient" ]
algebra/fraction.v
tofrac_eq
tofrac_eq0(p : R): (p%:F == 0) = (p == 0). Proof. by rewrite tofrac_eq. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import ssrAC choice tuple bigop ssralg poly polydiv", "From mathcomp Require Import generic_quotient" ]
algebra/fraction.v
tofrac_eq0
divz(m d : int) : int := let: (K, n) := match m with Posz n => (Posz, n) | Negz n => (Negz, n) end in sgz d * K (n %/ `|d|)%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
divz
modz(m d : int) : int := m - divz m d * d.
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
modz
dvdzd m := (`|d| %| `|m|)%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
dvdz
gcdzm n := (gcdn `|m| `|n|)%:Z.
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
gcdz
lcmzm n := (lcmn `|m| `|n|)%:Z.
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
lcmz
egcdzm n : int * int := if m == 0 then (0, (-1) ^+ (n < 0)%R) else let: (u, v) := egcdn `|m| `|n| in (sgz m * u, - (-1) ^+ (n < 0)%R * v%:Z).
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
egcdz
coprimezm n := (gcdz m n == 1). Infix "%/" := divz : int_scope. Infix "%%" := modz : int_scope.
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
coprimez
divz_nat(n d : nat) : (n %/ d)%Z = (n %/ d)%N. Proof. by case: d => // d; rewrite /divz /= mul1r. 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
divz_nat
divzNm d : (m %/ - d)%Z = - (m %/ d)%Z. Proof. by case: m => n; rewrite /divz /= sgzN abszN mulNr. 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
divzN
divz_abs(m d : int) : (m %/ `|d|)%Z = (-1) ^+ (d < 0)%R * (m %/ d)%Z. Proof. by rewrite {3}[d]intEsign !mulr_sign; case: ifP => -> //; rewrite divzN opprK. 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
divz_abs
div0zd : (0 %/ d)%Z = 0. Proof. by rewrite -(canLR (signrMK _) (divz_abs _ _)) (divz_nat 0) div0n mulr0. 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
div0z
divNz_natm d : (d > 0)%N -> (Negz m %/ d)%Z = - (m %/ d).+1%:Z. Proof. by case: d => // d _; apply: mul1r. 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
divNz_nat
divz_eqm d : m = (m %/ d)%Z * d + (m %% d)%Z. Proof. by rewrite addrC subrK. 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
divz_eq
modzNm d : (m %% - d)%Z = (m %% d)%Z. Proof. by rewrite /modz divzN mulrNN. 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
modzN
modz_absm d : (m %% `|d|%N)%Z = (m %% d)%Z. Proof. by rewrite {2}[d]intEsign mulr_sign; case: ifP; rewrite ?modzN. 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
modz_abs
modz_nat(m d : nat) : (m %% d)%Z = (m %% d)%N. Proof. by apply: (canLR (addrK _)); rewrite addrC divz_nat {1}(divn_eq m d). 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
modz_nat
modNz_natm d : (d > 0)%N -> (Negz m %% d)%Z = d%:Z - 1 - (m %% d)%:Z. Proof. rewrite /modz => /divNz_nat->; apply: (canLR (addrK _)). rewrite -!addrA -!opprD -!PoszD -opprB mulnSr !addnA PoszD addrK. by rewrite addnAC -addnA mulnC -divn_eq. 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
modNz_nat
modz_ge0m d : d != 0 -> 0 <= (m %% d)%Z. Proof. rewrite -absz_gt0 -modz_abs => d_gt0. case: m => n; rewrite ?modNz_nat ?modz_nat // -addrA -opprD subr_ge0. by rewrite lez_nat ltn_mod. 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
modz_ge0
divz0m : (m %/ 0)%Z = 0. Proof. by case: m. 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
divz0
mod0zd : (0 %% d)%Z = 0. Proof. by rewrite /modz div0z mul0r subrr. 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
mod0z
modz0m : (m %% 0)%Z = m. Proof. by rewrite /modz mulr0 subr0. 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
modz0
divz_smallm d : 0 <= m < `|d|%:Z -> (m %/ d)%Z = 0. Proof. rewrite -(canLR (signrMK _) (divz_abs _ _)); case: m => // n /divn_small. by rewrite divz_nat => ->; rewrite mulr0. 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
divz_small
divzMDlq m d : d != 0 -> ((q * d + m) %/ d)%Z = q + (m %/ d)%Z. Proof. rewrite neq_lt -oppr_gt0 => nz_d. wlog{nz_d} d_gt0: q d / d > 0; last case: d => // d in d_gt0 *. move=> IH; case/orP: nz_d => /IH// /(_ (- q)). by rewrite mulrNN !divzN -opprD => /oppr_inj. wlog q_gt0: q m / q >= 0; last case: q q_gt0 => // q _. move=> IH; case: q => n; first exact: IH; rewrite NegzE mulNr. by apply: canRL (addKr _) _; rewrite -IH ?addNKr. case: m => n; first by rewrite !divz_nat divnMDl. have [le_qd_n | lt_qd_n] := leqP (q * d) n. rewrite divNz_nat // NegzE -(subnKC le_qd_n) divnMDl //. by rewrite -!addnS !PoszD !opprD !addNKr divNz_nat. rewrite divNz_nat // NegzE -PoszM subzn // divz_nat. apply: canRL (addrK _) _; congr _%:Z; rewrite addnC -divnMDl // mulSnr. rewrite -{3}(subnKC (ltn_pmod n d_gt0)) addnA addnS -divn_eq addnAC. by rewrite subnKC // divnMDl // divn_small ?addn0 // subnSK ?ltn_mod ?leq_subr. 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
divzMDl
mulzKm d : d != 0 -> (m * d %/ d)%Z = m. Proof. by move=> d_nz; rewrite -[m * d]addr0 divzMDl // div0z addr0. 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
mulzK
mulKzm d : d != 0 -> (d * m %/ d)%Z = m. Proof. by move=> d_nz; rewrite mulrC 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
mulKz
expzBp m n : p != 0 -> (m >= n)%N -> p ^+ (m - n) = (p ^+ m %/ p ^+ n)%Z. Proof. by move=> p_nz /subnK{2}<-; rewrite exprD mulzK // expf_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
expzB
modz1m : (m %% 1)%Z = 0. Proof. by case: m => n; rewrite (modNz_nat, modz_nat) ?modn1. 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
modz1
divz1m : (m %/ 1)%Z = m. Proof. by rewrite -{1}[m]mulr1 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
divz1
divzzd : (d %/ d)%Z = (d != 0). Proof. by have [-> // | d_nz] := eqVneq; rewrite -{1}[d]mul1r 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
divzz
ltz_pmodm d : d > 0 -> (m %% d)%Z < d. Proof. case: m d => n [] // d d_gt0; first by rewrite modz_nat ltz_nat ltn_pmod. by rewrite modNz_nat // -lezD1 addrAC subrK gerDl oppr_le0. 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
ltz_pmod
ltz_modm d : d != 0 -> (m %% d)%Z < `|d|. Proof. by rewrite -absz_gt0 -modz_abs => d_gt0; apply: ltz_pmod. 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
ltz_mod
divzMplp m d : p > 0 -> (p * m %/ (p * d) = m %/ d)%Z. Proof. case: p => // p p_gt0; wlog d_gt0: d / d > 0; last case: d => // d in d_gt0 *. by move=> IH; case/intP: d => [|d|d]; rewrite ?mulr0 ?divz0 ?mulrN ?divzN ?IH. rewrite {1}(divz_eq m d) mulrDr mulrCA divzMDl ?mulf_neq0 ?gt_eqF // addrC. rewrite divz_small ?add0r // PoszM pmulr_rge0 ?modz_ge0 ?gt_eqF //=. by rewrite ltr_pM2l ?ltz_pmod. Qed. Arguments divzMpl [p m 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
divzMpl
divzMprp m d : p > 0 -> (m * p %/ (d * p) = m %/ d)%Z. Proof. by move=> p_gt0; rewrite -!(mulrC p) divzMpl. Qed. Arguments divzMpr [p m 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
divzMpr
lez_floorm d : d != 0 -> (m %/ d)%Z * d <= m. Proof. by rewrite -subr_ge0; apply: modz_ge0. 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
lez_floor
lez_divm d : (`|(m %/ d)%Z| <= `|m|)%N. Proof. wlog d_gt0: d / d > 0; last case: d d_gt0 => // d d_gt0. by move=> IH; case/intP: d => [|n|n]; rewrite ?divz0 ?divzN ?abszN // IH. case: m => n; first by rewrite divz_nat leq_div. by rewrite divNz_nat // NegzE !abszN ltnS leq_div. 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
lez_div
ltz_ceilm d : d > 0 -> m < ((m %/ d)%Z + 1) * d. Proof. by case: d => // d d_gt0; rewrite mulrDl mul1r -ltrBlDl ltz_mod ?gt_eqF. 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
ltz_ceil
ltz_divLRm n d : d > 0 -> ((m %/ d)%Z < n) = (m < n * d). Proof. move=> d_gt0; apply/idP/idP. by rewrite -[_ < n]lezD1 -(ler_pM2r d_gt0); exact/lt_le_trans/ltz_ceil. by rewrite -(ltr_pM2r d_gt0 _ n); apply/le_lt_trans/lez_floor; rewrite gt_eqF. 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
ltz_divLR
lez_divRLm n d : d > 0 -> (m <= (n %/ d)%Z) = (m * d <= n). Proof. by move=> d_gt0; rewrite !leNgt ltz_divLR. 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
lez_divRL
lez_pdiv2rd : 0 <= d -> {homo divz^~ d : m n / m <= n}. Proof. by case: d => [[|d]|]// _ [] m [] n //; rewrite /divz !mul1r; apply: leq_div2r. 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
lez_pdiv2r
divz_ge0m d : d > 0 -> ((m %/ d)%Z >= 0) = (m >= 0). Proof. by case: d m => // d [] n d_gt0; rewrite (divz_nat, divNz_nat). 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
divz_ge0
divzMA_ge0m n p : n >= 0 -> (m %/ (n * p) = (m %/ n)%Z %/ p)%Z. Proof. case: n => // [[|n]] _; first by rewrite mul0r !divz0 div0z. wlog p_gt0: p / p > 0; last case: p => // p in p_gt0 *. by case/intP: p => [|p|p] IH; rewrite ?mulr0 ?divz0 ?mulrN ?divzN // IH. rewrite {2}(divz_eq m (n.+1%:Z * p)) mulrA mulrAC !divzMDl // ?gt_eqF //. rewrite [rhs in _ + rhs]divz_small ?addr0 // ltz_divLR // divz_ge0 //. by rewrite mulrC ltz_pmod ?modz_ge0 ?gt_eqF ?pmulr_lgt0. 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_ge0
modz_smallm d : 0 <= m < d -> (m %% d)%Z = m. Proof. by case: m d => //= m [] // d; rewrite modz_nat => /modn_small->. 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
modz_small
modz_modm d : ((m %% d)%Z = m %[mod d])%Z. Proof. rewrite -!(modz_abs _ d); case: {d}`|d|%N => [|d]; first by rewrite !modz0. by rewrite modz_small ?modz_ge0 ?ltz_mod. 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
modz_mod
modzMDlp m d : (p * d + m = m %[mod d])%Z. Proof. have [-> | d_nz] := eqVneq d 0; first by rewrite mulr0 add0r. by rewrite /modz divzMDl // mulrDl opprD addrACA subrr 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
modzMDl
mulz_modr{p m d} : 0 < p -> p * (m %% d)%Z = ((p * m) %% (p * d))%Z. Proof. case: p => // p p_gt0; rewrite mulrBr; apply: canLR (addrK _) _. by rewrite mulrCA -(divzMpl p_gt0) subrK. 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_modr
mulz_modl{p m d} : 0 < p -> (m %% d)%Z * p = ((m * p) %% (d * p))%Z. Proof. by rewrite -!(mulrC p); apply: mulz_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
mulz_modl
modzDlm d : (d + m = m %[mod d])%Z. Proof. by rewrite -{1}[d]mul1r 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
modzDl
modzDrm d : (m + d = m %[mod d])%Z. Proof. by rewrite addrC modzDl. 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
modzDr
modzzd : (d %% d)%Z = 0. Proof. by rewrite -{1}[d]addr0 modzDl mod0z. 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
modzz
modzMlp d : (p * d %% d)%Z = 0. Proof. by rewrite -[p * d]addr0 modzMDl mod0z. 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
modzMl
modzMrp d : (d * p %% d)%Z = 0. Proof. by rewrite mulrC modzMl. 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
modzMr
modzDmlm n d : ((m %% d)%Z + n = m + n %[mod d])%Z. Proof. by rewrite {2}(divz_eq m d) -[_ * d + _ + n]addrA 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
modzDml
modzDmrm n d : (m + (n %% d)%Z = m + n %[mod d])%Z. Proof. by rewrite !(addrC m) modzDml. 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
modzDmr
modzDmm n d : ((m %% d)%Z + (n %% d)%Z = m + n %[mod d])%Z. Proof. by rewrite modzDml modzDmr. 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
modzDm
eqz_modDlp m n d : (p + m == p + n %[mod d])%Z = (m == n %[mod d])%Z. Proof. have [-> | d_nz] := eqVneq d 0; first by rewrite !modz0 (inj_eq (addrI p)). apply/eqP/eqP=> eq_mn; last by rewrite -modzDmr eq_mn modzDmr. by rewrite -(addKr p m) -modzDmr eq_mn modzDmr addKr. 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_modDl
eqz_modDrp m n d : (m + p == n + p %[mod d])%Z = (m == n %[mod d])%Z. Proof. by rewrite -!(addrC p) eqz_modDl. 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_modDr
modzMmlm n d : ((m %% d)%Z * n = m * n %[mod d])%Z. Proof. by rewrite {2}(divz_eq m d) [in RHS]mulrDl mulrAC 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
modzMml
modzMmrm n d : (m * (n %% d)%Z = m * n %[mod d])%Z. Proof. by rewrite !(mulrC m) modzMml. 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
modzMmr
modzMmm n d : ((m %% d)%Z * (n %% d)%Z = m * n %[mod d])%Z. Proof. by rewrite modzMml modzMmr. 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
modzMm
modzXmk m d : ((m %% d)%Z ^+ k = m ^+ k %[mod d])%Z. Proof. by elim: k => // k IHk; rewrite !exprS -modzMmr IHk modzMm. 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
modzXm
modzNmm d : (- (m %% d)%Z = - m %[mod d])%Z. Proof. by rewrite -mulN1r modzMmr mulN1r. 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
modzNm
modz_absmm d : ((-1) ^+ (m < 0)%R * (m %% d)%Z = `|m|%:Z %[mod d])%Z. Proof. by rewrite modzMmr -abszEsign. 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
modz_absm
dvdzEd m : (d %| m)%Z = (`|d| %| `|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
dvdzE
dvdz0d : (d %| 0)%Z. Proof. exact: dvdn0. 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
dvdz0
dvd0zn : (0 %| n)%Z = (n == 0). Proof. by rewrite -absz_eq0 -dvd0n. 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
dvd0z
dvdz1d : (d %| 1)%Z = (`|d|%N == 1). Proof. exact: dvdn1. 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
dvdz1
dvd1zm : (1 %| m)%Z. Proof. exact: dvd1n. 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
dvd1z
dvdzzm : (m %| m)%Z. Proof. exact: dvdnn. 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
dvdzz
dvdz_mulld m n : (d %| n)%Z -> (d %| m * n)%Z. Proof. by rewrite !dvdzE abszM; apply: dvdn_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
dvdz_mull
dvdz_mulrd m n : (d %| m)%Z -> (d %| m * n)%Z. Proof. by move=> d_m; rewrite mulrC dvdz_mull. Qed. #[global] Hint Resolve dvdz0 dvd1z dvdzz dvdz_mull dvdz_mulr : core.
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_mulr
dvdz_muld1 d2 m1 m2 : (d1 %| m1 -> d2 %| m2 -> d1 * d2 %| m1 * m2)%Z. Proof. by rewrite !dvdzE !abszM; apply: dvdn_mul. 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_mul
dvdz_transn d m : (d %| n -> n %| m -> d %| m)%Z. Proof. by rewrite !dvdzE; apply: dvdn_trans. 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_trans
dvdzPd m : reflect (exists q, m = q * d) (d %| m)%Z. Proof. apply: (iffP dvdnP) => [] [q Dm]; last by exists `|q|%N; rewrite Dm abszM. exists ((-1) ^+ (m < 0)%R * q%:Z * (-1) ^+ (d < 0)%R). by rewrite -!mulrA -abszEsign -PoszM -Dm -intEsign. Qed. Arguments dvdzP {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
dvdzP
dvdz_mod0Pd m : reflect (m %% d = 0)%Z (d %| m)%Z. Proof. apply: (iffP dvdzP) => [[q ->] | md0]; first by rewrite modzMl. by rewrite (divz_eq m d) md0 addr0; exists (m %/ d)%Z. Qed. Arguments dvdz_mod0P {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_mod0P
dvdz_eqd m : (d %| m)%Z = ((m %/ d)%Z * d == m). Proof. by rewrite (sameP dvdz_mod0P eqP) subr_eq0 eq_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
dvdz_eq
divzKd m : (d %| m)%Z -> (m %/ d)%Z * d = m. Proof. by rewrite dvdz_eq => /eqP. 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
divzK
lez_divLRd m n : 0 < d -> (d %| m)%Z -> ((m %/ d)%Z <= n) = (m <= n * d). Proof. by move=> /ler_pM2r <- /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
lez_divLR
ltz_divRLd m n : 0 < d -> (d %| m)%Z -> (n < m %/ d)%Z = (n * d < m). Proof. by move=> /ltr_pM2r/(_ n)<- /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
ltz_divRL
eqz_divd m n : d != 0 -> (d %| m)%Z -> (n == m %/ d)%Z = (n * d == m). Proof. by move=> /mulIf/inj_eq <- /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
eqz_div
eqz_muld m n : d != 0 -> (d %| m)%Z -> (m == n * d) = (m %/ d == n)%Z. Proof. by move=> d_gt0 dv_d_m; rewrite eq_sym -eqz_div // eq_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
eqz_mul
divz_mulACd m n : (d %| m)%Z -> (m %/ d)%Z * n = (m * n %/ d)%Z. Proof. have [-> | d_nz] := eqVneq d 0; first by rewrite !divz0 mul0r. by move/divzK=> {2} <-; rewrite 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
divz_mulAC
mulz_divAd m n : (d %| n)%Z -> m * (n %/ d)%Z = (m * n %/ d)%Z. Proof. by move=> dv_d_m; rewrite !(mulrC m) divz_mulAC. 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_divA
mulz_divCAd m n : (d %| m)%Z -> (d %| n)%Z -> m * (n %/ d)%Z = n * (m %/ d)%Z. Proof. by move=> dv_d_m dv_d_n; rewrite mulrC divz_mulAC ?mulz_divA. 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