statement stringlengths 1 4.33k | proof stringlengths 0 37.9k | type stringclasses 25
values | symbolic_name stringlengths 1 67 | library stringclasses 10
values | filename stringclasses 112
values | imports listlengths 2 138 | deps listlengths 0 64 | docstring stringclasses 798
values | source_url stringclasses 1
value | commit stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|
pickle_seq s | := CodeSeq.code (map (@pickle T) s). | Definition | pickle_seq | boot | boot/choice.v | [
"HB",
"structures",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"Choice.InternalTheory",
"CodeSeq"
] | [
"code",
"map"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
unpickle_seq n | := Some (pmap (@unpickle T) (CodeSeq.decode n)). | Definition | unpickle_seq | boot | boot/choice.v | [
"HB",
"structures",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"Choice.InternalTheory",
"CodeSeq"
] | [
"decode",
"pmap"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
pickle_seqK : pcancel pickle_seq unpickle_seq. | Proof. by move=> s; rewrite /unpickle_seq CodeSeq.codeK (map_pK pickleK). Qed. | Lemma | pickle_seqK | boot | boot/choice.v | [
"HB",
"structures",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"Choice.InternalTheory",
"CodeSeq"
] | [
"codeK",
"map_pK",
"pickle_seq",
"unpickle_seq"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
"[ 'Countable' 'of' T 'by' <: ]" | :=
(Countable.copy T%type (sub_type T%type))
(format "[ 'Countable' 'of' T 'by' <: ]") : form_scope. | Notation | [ 'Countable' 'of' T 'by' <: ] | boot | boot/choice.v | [
"HB",
"structures",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"Choice.InternalTheory",
"CodeSeq"
] | [
"copy",
"sub_type",
"type"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
pickle_tagged (u : {i : I & T_ i}) | :=
CodeSeq.code [:: pickle (tag u); pickle (tagged u)]. | Definition | pickle_tagged | boot | boot/choice.v | [
"HB",
"structures",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"Choice.InternalTheory",
"CodeSeq"
] | [
"code"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
unpickle_tagged s | :=
if CodeSeq.decode s is [:: ni; nx] then
obind (fun i => omap (@Tagged I i T_) (unpickle nx)) (unpickle ni)
else None. | Definition | unpickle_tagged | boot | boot/choice.v | [
"HB",
"structures",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"Choice.InternalTheory",
"CodeSeq"
] | [
"decode"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
pickle_taggedK : pcancel pickle_tagged unpickle_tagged. | Proof.
by case=> i x; rewrite /unpickle_tagged CodeSeq.codeK /= pickleK /= pickleK.
Qed. | Lemma | pickle_taggedK | boot | boot/choice.v | [
"HB",
"structures",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"Choice.InternalTheory",
"CodeSeq"
] | [
"codeK",
"pickle_tagged",
"unpickle_tagged"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
nat_pickleK : pcancel id (@Some nat). | Proof. by []. Qed. | Lemma | nat_pickleK | boot | boot/choice.v | [
"HB",
"structures",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"Choice.InternalTheory",
"CodeSeq"
] | [
"id",
"nat"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
edivn_rec d | :=
fix loop m q := if m - d is m'.+1 then loop m' q.+1 else (q, m). | Definition | edivn_rec | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [] | Euclidean division | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d |
edivn m d | := if d > 0 then edivn_rec d.-1 m 0 else (0, m). | Definition | edivn | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"edivn_rec"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
edivn_spec m d : nat * nat -> Type | :=
EdivnSpec q r of m = q * d + r & (d > 0) ==> (r < d) : edivn_spec m d (q, r). | Variant | edivn_spec | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"nat"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
edivnP m d : edivn_spec m d (edivn m d). | Proof.
rewrite -[m in edivn_spec m]/(0 * d + m) /edivn; case: d => //= d.
elim/ltn_ind: m 0 => -[|m] IHm q //=; rewrite subn_if_gt.
case: ltnP => // le_dm; rewrite -[in m.+1](subnKC le_dm) -addSn.
by rewrite addnA -mulSnr; apply/IHm/leq_subr.
Qed. | Lemma | edivnP | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"addSn",
"addnA",
"apply",
"edivn",
"edivn_spec",
"leq_subr",
"ltnP",
"ltn_ind",
"mulSnr",
"subnKC",
"subn_if_gt"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
edivn_eq d q r : r < d -> edivn (q * d + r) d = (q, r). | Proof.
move=> lt_rd; have d_gt0: 0 < d by apply: leq_trans lt_rd.
case: edivnP lt_rd => q' r'; rewrite d_gt0 /=.
wlog: q q' r r' / q <= q' by case/orP: (leq_total q q'); last symmetry; eauto.
have [||-> _ /addnI ->] //= := ltngtP q q'.
rewrite -(leq_pmul2r d_gt0) => /leq_add lt_qr _ eq_qr _ /lt_qr {lt_qr}.
by rewrite a... | Lemma | edivn_eq | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"addnA",
"addnCA",
"addnI",
"addnS",
"apply",
"d_gt0",
"edivn",
"edivnP",
"last",
"leq_add",
"leq_addr",
"leq_pmul2r",
"leq_total",
"leq_trans",
"ltnNge",
"ltngtP",
"mulSn"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
divn m d | := (edivn m d).1. | Definition | divn | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"edivn"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
"m %/ d" | := (divn m d) : nat_scope. | Notation | m %/ d | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"divn"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modn_rec d | := fix loop m := if m - d is m'.+1 then loop m' else m. | Definition | modn_rec | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [] | We redefine modn so that it is structurally decreasing. | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d |
modn m d | := if d > 0 then modn_rec d.-1 m else m. | Definition | modn | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"modn_rec"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
"m %% d" | := (modn m d) : nat_scope. | Notation | m %% d | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"modn"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
"m = n %[mod d ]" | := (m %% d = n %% d) : nat_scope. | Notation | m = n %[mod d ] | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
"m == n %[mod d ]" | := (m %% d == n %% d) : nat_scope. | Notation | m == n %[mod d ] | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
"m <> n %[mod d ]" | := (m %% d <> n %% d) : nat_scope. | Notation | m <> n %[mod d ] | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
"m != n %[mod d ]" | := (m %% d != n %% d) : nat_scope. | Notation | m != n %[mod d ] | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modn_def m d : m %% d = (edivn m d).2. | Proof.
case: d => //= d; rewrite /modn /edivn /=; elim/ltn_ind: m 0 => -[|m] IHm q //=.
by rewrite !subn_if_gt; case: (d <= m) => //; apply/IHm/leq_subr.
Qed. | Lemma | modn_def | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"apply",
"edivn",
"leq_subr",
"ltn_ind",
"modn",
"subn_if_gt"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
edivn_def m d : edivn m d = (m %/ d, m %% d). | Proof. by rewrite /divn modn_def; case: (edivn m d). Qed. | Lemma | edivn_def | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"divn",
"edivn",
"modn_def"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
divn_eq m d : m = m %/ d * d + m %% d. | Proof. by rewrite /divn modn_def; case: edivnP. Qed. | Lemma | divn_eq | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"divn",
"edivnP",
"modn_def"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
div0n d : 0 %/ d = 0. | Proof. by case: d. Qed. | Lemma | div0n | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
divn0 m : m %/ 0 = 0. | Proof. by []. Qed. | Lemma | divn0 | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
mod0n d : 0 %% d = 0. | Proof. by case: d. Qed. | Lemma | mod0n | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modn0 m : m %% 0 = m. | Proof. by []. Qed. | Lemma | modn0 | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
divn_small m d : m < d -> m %/ d = 0. | Proof. by move=> lt_md; rewrite /divn (edivn_eq 0). Qed. | Lemma | divn_small | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"divn",
"edivn_eq"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
divnMDl q m d : 0 < d -> (q * d + m) %/ d = q + m %/ d. | Proof.
move=> d_gt0; rewrite [in LHS](divn_eq m d) addnA -mulnDl.
by rewrite /divn edivn_eq // modn_def; case: edivnP; rewrite d_gt0.
Qed. | Lemma | divnMDl | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"addnA",
"d_gt0",
"divn",
"divn_eq",
"edivnP",
"edivn_eq",
"modn_def",
"mulnDl"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
mulnK m d : 0 < d -> m * d %/ d = m. | Proof. by move=> d_gt0; rewrite -[m * d]addn0 divnMDl // div0n addn0. Qed. | Lemma | mulnK | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"addn0",
"d_gt0",
"div0n",
"divnMDl"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
mulKn m d : 0 < d -> d * m %/ d = m. | Proof. by move=> d_gt0; rewrite mulnC mulnK. Qed. | Lemma | mulKn | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"d_gt0",
"mulnC",
"mulnK"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
expnB p m n : p > 0 -> m >= n -> p ^ (m - n) = p ^ m %/ p ^ n. | Proof.
by move=> p_gt0 /subnK-Dm; rewrite -[in RHS]Dm expnD mulnK // expn_gt0 p_gt0.
Qed. | Lemma | expnB | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"expnD",
"expn_gt0",
"mulnK",
"p_gt0",
"subnK"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modn1 m : m %% 1 = 0. | Proof. by rewrite modn_def; case: edivnP => ? []. Qed. | Lemma | modn1 | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"edivnP",
"modn_def"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
divn1 m : m %/ 1 = m. | Proof. by rewrite [RHS](@divn_eq m 1) // modn1 addn0 muln1. Qed. | Lemma | divn1 | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"addn0",
"divn_eq",
"modn1",
"muln1"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
divnn d : d %/ d = (0 < d). | Proof. by case: d => // d; rewrite -[n in n %/ _]muln1 mulKn. Qed. | Lemma | divnn | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"mulKn",
"muln1"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
divnMl p m d : p > 0 -> p * m %/ (p * d) = m %/ d. | Proof.
move=> p_gt0; have [->|d_gt0] := posnP d; first by rewrite muln0.
rewrite [RHS]/divn; case: edivnP; rewrite d_gt0 /= => q r ->{m} lt_rd.
rewrite mulnDr mulnCA divnMDl; first by rewrite muln_gt0 p_gt0.
by rewrite addnC divn_small // ltn_pmul2l.
Qed. | Lemma | divnMl | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"addnC",
"d_gt0",
"divn",
"divnMDl",
"divn_small",
"edivnP",
"ltn_pmul2l",
"muln0",
"mulnCA",
"mulnDr",
"muln_gt0",
"p_gt0",
"posnP"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
divnMr p m d : p > 0 -> m * p %/ (d * p) = m %/ d. | Proof. by move=> p_gt0; rewrite -!(mulnC p) divnMl. Qed. | Lemma | divnMr | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"divnMl",
"mulnC",
"p_gt0"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
ltn_mod m d : (m %% d < d) = (0 < d). | Proof. by case: d => // d; rewrite modn_def; case: edivnP. Qed. | Lemma | ltn_mod | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"edivnP",
"modn_def"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
ltn_pmod m d : 0 < d -> m %% d < d. | Proof. by rewrite ltn_mod. Qed. | Lemma | ltn_pmod | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"ltn_mod"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
leq_divM m d : m %/ d * d <= m. | Proof. by rewrite [leqRHS](divn_eq m d) leq_addr. Qed. | Lemma | leq_divM | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"divn_eq",
"leqRHS",
"leq_addr"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
leq_trunc_div | := leq_divM (only parsing). | Notation | leq_trunc_div | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"leq_divM"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
leq_mod m d : m %% d <= m. | Proof. by rewrite [leqRHS](divn_eq m d) leq_addl. Qed. | Lemma | leq_mod | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"divn_eq",
"leqRHS",
"leq_addl"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
leq_div m d : m %/ d <= m. | Proof.
by case: d => // d; apply: leq_trans (leq_pmulr _ _) (leq_divM _ _).
Qed. | Lemma | leq_div | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"apply",
"leq_divM",
"leq_pmulr",
"leq_trans"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
ltn_ceil m d : 0 < d -> m < (m %/ d).+1 * d. | Proof.
by move=> d_gt0; rewrite [in m.+1](divn_eq m d) -addnS mulSnr leq_add2l ltn_mod.
Qed. | Lemma | ltn_ceil | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"addnS",
"d_gt0",
"divn_eq",
"leq_add2l",
"ltn_mod",
"mulSnr"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
ltn_divLR m n d : d > 0 -> (m %/ d < n) = (m < n * d). | Proof.
move=> d_gt0; apply/idP/idP.
by rewrite -(leq_pmul2r d_gt0); apply: leq_trans (ltn_ceil _ _).
rewrite !ltnNge -(@leq_pmul2r d n) //; apply: contra => le_nd_floor.
exact: leq_trans le_nd_floor (leq_divM _ _).
Qed. | Lemma | ltn_divLR | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"apply",
"d_gt0",
"leq_divM",
"leq_pmul2r",
"leq_trans",
"ltnNge",
"ltn_ceil"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
leq_divRL m n d : d > 0 -> (m <= n %/ d) = (m * d <= n). | Proof. by move=> d_gt0; rewrite leqNgt ltn_divLR // -leqNgt. Qed. | Lemma | leq_divRL | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"d_gt0",
"leqNgt",
"ltn_divLR"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
ltn_Pdiv m d : 1 < d -> 0 < m -> m %/ d < m. | Proof. by move=> d_gt1 m_gt0; rewrite ltn_divLR ?ltn_Pmulr // ltnW. Qed. | Lemma | ltn_Pdiv | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"ltnW",
"ltn_Pmulr",
"ltn_divLR"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
divn_gt0 d m : 0 < d -> (0 < m %/ d) = (d <= m). | Proof. by move=> d_gt0; rewrite leq_divRL ?mul1n. Qed. | Lemma | divn_gt0 | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"d_gt0",
"leq_divRL",
"mul1n"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
leq_div2r d m n : m <= n -> m %/ d <= n %/ d. | Proof.
have [-> //| d_gt0 le_mn] := posnP d.
by rewrite leq_divRL // (leq_trans _ le_mn) -?leq_divRL.
Qed. | Lemma | leq_div2r | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"d_gt0",
"leq_divRL",
"leq_trans",
"posnP"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
leq_div2l m d e : 0 < d -> d <= e -> m %/ e <= m %/ d. | Proof.
move/leq_divRL=> -> le_de.
by apply: leq_trans (leq_divM m e); apply: leq_mul.
Qed. | Lemma | leq_div2l | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"apply",
"leq_divM",
"leq_divRL",
"leq_mul",
"leq_trans"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
edivnD m n d (offset := m %% d + n %% d >= d) : 0 < d ->
edivn (m + n) d = (m %/ d + n %/ d + offset, m %% d + n %% d - offset * d). | Proof.
rewrite {}/offset; case: d => // d _; rewrite /divn !modn_def.
case: (edivnP m d.+1) (edivnP n d.+1) => [/= q r -> r_lt] [/= p s -> s_lt].
rewrite addnACA -mulnDl; have [r_le s_le] := (ltnW r_lt, ltnW s_lt).
have [d_ge|d_lt] := leqP; first by rewrite addn0 mul0n subn0 edivn_eq.
rewrite addn1 mul1n -[in LHS](subn... | Lemma | edivnD | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"addn0",
"addn1",
"addnA",
"addnACA",
"addnS",
"divn",
"edivn",
"edivnP",
"edivn_eq",
"leqP",
"leq_add",
"ltnW",
"ltn_subLR",
"modn_def",
"mul0n",
"mul1n",
"mulSnr",
"mulnDl",
"offset",
"subn0",
"subnKC"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
divnD m n d : 0 < d ->
(m + n) %/ d = (m %/ d) + (n %/ d) + (m %% d + n %% d >= d). | Proof. by move=> /(@edivnD m n); rewrite edivn_def => -[]. Qed. | Lemma | divnD | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"edivnD",
"edivn_def"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modnD m n d : 0 < d ->
(m + n) %% d = m %% d + n %% d - (m %% d + n %% d >= d) * d. | Proof. by move=> /(@edivnD m n); rewrite edivn_def => -[]. Qed. | Lemma | modnD | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"edivnD",
"edivn_def"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
leqDmod m n d : 0 < d ->
(d <= m %% d + n %% d) = ((m + n) %% d < n %% d). | Proof.
move=> d_gt0; rewrite modnD//.
have [d_le|_] := leqP d; last by rewrite subn0 ltnNge leq_addl.
by rewrite -(ltn_add2r d) mul1n (subnK d_le) addnC ltn_add2l ltn_pmod.
Qed. | Lemma | leqDmod | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"addnC",
"d_gt0",
"last",
"leqP",
"leq_addl",
"ltnNge",
"ltn_add2l",
"ltn_add2r",
"ltn_pmod",
"modnD",
"mul1n",
"subn0",
"subnK"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
divnB n m d : 0 < d ->
(m - n) %/ d = (m %/ d) - (n %/ d) - (m %% d < n %% d). | Proof.
move=> d_gt0; have [mn|/ltnW nm] := leqP m n.
by rewrite (eqP mn) (eqP (leq_div2r _ _)) ?div0n.
by rewrite -[in m %/ d](subnK nm) divnD// addnAC addnK leqDmod ?subnK ?addnK.
Qed. | Lemma | divnB | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"addnAC",
"addnK",
"d_gt0",
"div0n",
"divnD",
"leqDmod",
"leqP",
"leq_div2r",
"ltnW",
"subnK"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modnB m n d : 0 < d -> n <= m ->
(m - n) %% d = (m %% d < n %% d) * d + m %% d - n %% d. | Proof.
move=> d_gt0 nm; rewrite -[in m %% _](subnK nm) -leqDmod// modnD//.
have [d_le|_] := leqP d; last by rewrite mul0n add0n subn0 addnK.
by rewrite mul1n addnBA// addnC !addnK.
Qed. | Lemma | modnB | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"add0n",
"addnBA",
"addnC",
"addnK",
"d_gt0",
"last",
"leqDmod",
"leqP",
"modnD",
"mul0n",
"mul1n",
"subn0",
"subnK"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
edivnB m n d (offset := m %% d < n %% d) : 0 < d -> n <= m ->
edivn (m - n) d = (m %/ d - n %/ d - offset, offset * d + m %% d - n %% d). | Proof. by move=> d_gt0 le_nm; rewrite edivn_def divnB// modnB. Qed. | Lemma | edivnB | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"d_gt0",
"divnB",
"edivn",
"edivn_def",
"modnB",
"offset"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
leq_divDl p m n : (m + n) %/ p <= m %/ p + n %/ p + 1. | Proof. by have [->//|p_gt0] := posnP p; rewrite divnD// !leq_add// leq_b1. Qed. | Lemma | leq_divDl | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"divnD",
"leq_add",
"leq_b1",
"p_gt0",
"posnP"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
geq_divBl k m p : k %/ p - m %/ p <= (k - m) %/ p + 1. | Proof.
rewrite leq_subLR addnA; apply: leq_trans (leq_divDl _ _ _).
by rewrite -maxnE leq_div2r ?leq_maxr.
Qed. | Lemma | geq_divBl | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"addnA",
"apply",
"leq_div2r",
"leq_divDl",
"leq_maxr",
"leq_subLR",
"leq_trans",
"maxnE"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
divnMA m n p : m %/ (n * p) = m %/ n %/ p. | Proof.
case: n p => [|n] [|p]; rewrite ?muln0 ?div0n //.
rewrite [in RHS](divn_eq m (n.+1 * p.+1)) mulnA mulnAC !divnMDl //.
by rewrite [_ %/ p.+1]divn_small ?addn0 // ltn_divLR // mulnC ltn_mod.
Qed. | Lemma | divnMA | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"addn0",
"div0n",
"divnMDl",
"divn_eq",
"divn_small",
"ltn_divLR",
"ltn_mod",
"muln0",
"mulnA",
"mulnAC",
"mulnC"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
divnAC m n p : m %/ n %/ p = m %/ p %/ n. | Proof. by rewrite -!divnMA mulnC. Qed. | Lemma | divnAC | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"divnMA",
"mulnC"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modn_small m d : m < d -> m %% d = m. | Proof. by move=> lt_md; rewrite [RHS](divn_eq m d) divn_small. Qed. | Lemma | modn_small | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"divn_eq",
"divn_small"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modn_mod m d : m %% d = m %[mod d]. | Proof. by case: d => // d; apply: modn_small; rewrite ltn_mod. Qed. | Lemma | modn_mod | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"apply",
"ltn_mod",
"modn_small"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modnMDl p m d : p * d + m = m %[mod d]. | Proof.
have [->|d_gt0] := posnP d; first by rewrite muln0.
by rewrite [in LHS](divn_eq m d) addnA -mulnDl modn_def edivn_eq // ltn_mod.
Qed. | Lemma | modnMDl | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"addnA",
"d_gt0",
"divn_eq",
"edivn_eq",
"ltn_mod",
"modn_def",
"muln0",
"mulnDl",
"posnP"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
muln_modr p m d : p * (m %% d) = (p * m) %% (p * d). | Proof.
have [->//|p_gt0] := posnP p; apply: (@addnI (p * (m %/ d * d))).
by rewrite -mulnDr -divn_eq mulnCA -(divnMl p_gt0) -divn_eq.
Qed. | Lemma | muln_modr | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"addnI",
"apply",
"divnMl",
"divn_eq",
"mulnCA",
"mulnDr",
"p_gt0",
"posnP"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
muln_modl p m d : (m %% d) * p = (m * p) %% (d * p). | Proof. by rewrite -!(mulnC p); apply: muln_modr. Qed. | Lemma | muln_modl | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"apply",
"mulnC",
"muln_modr"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modn_divl m n d : (m %/ d) %% n = m %% (n * d) %/ d. | Proof.
case: d n => [|d] [|n] //; rewrite [in LHS]/divn [in LHS]modn_def.
case: (edivnP m d.+1) edivnP => [/= _ r -> le_rd] [/= q s -> le_sn].
rewrite mulnDl -mulnA -addnA modnMDl modn_small ?divnMDl ?divn_small ?addn0//.
by rewrite mulSnr -addnS leq_add ?leq_mul2r.
Qed. | Lemma | modn_divl | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"addn0",
"addnA",
"addnS",
"divn",
"divnMDl",
"divn_small",
"edivnP",
"leq_add",
"leq_mul2r",
"modnMDl",
"modn_def",
"modn_small",
"mulSnr",
"mulnA",
"mulnDl"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modnDl m d : d + m = m %[mod d]. | Proof. by rewrite -[m %% _](modnMDl 1) mul1n. Qed. | Lemma | modnDl | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"modnMDl",
"mul1n"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modnDr m d : m + d = m %[mod d]. | Proof. by rewrite addnC modnDl. Qed. | Lemma | modnDr | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"addnC",
"modnDl"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modnn d : d %% d = 0. | Proof. by rewrite [d %% d](modnDr 0) mod0n. Qed. | Lemma | modnn | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"mod0n",
"modnDr"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modnMl p d : p * d %% d = 0. | Proof. by rewrite -[p * d]addn0 modnMDl mod0n. Qed. | Lemma | modnMl | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"addn0",
"mod0n",
"modnMDl"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modnMr p d : d * p %% d = 0. | Proof. by rewrite mulnC modnMl. Qed. | Lemma | modnMr | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"modnMl",
"mulnC"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modnDml m n d : m %% d + n = m + n %[mod d]. | Proof. by rewrite [in RHS](divn_eq m d) -addnA modnMDl. Qed. | Lemma | modnDml | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"addnA",
"divn_eq",
"modnMDl"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modnDmr m n d : m + n %% d = m + n %[mod d]. | Proof. by rewrite !(addnC m) modnDml. Qed. | Lemma | modnDmr | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"addnC",
"modnDml"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modnDm m n d : m %% d + n %% d = m + n %[mod d]. | Proof. by rewrite modnDml modnDmr. Qed. | Lemma | modnDm | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"modnDml",
"modnDmr"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
eqn_modDl p m n d : (p + m == p + n %[mod d]) = (m == n %[mod d]). | Proof.
case: d => [|d]; first by rewrite !modn0 eqn_add2l.
apply/eqP/eqP=> eq_mn; last by rewrite -modnDmr eq_mn modnDmr.
rewrite -(modnMDl p m) -(modnMDl p n) !mulnSr -!addnA.
by rewrite -modnDmr eq_mn modnDmr.
Qed. | Lemma | eqn_modDl | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"addnA",
"apply",
"eqn_add2l",
"last",
"modn0",
"modnDmr",
"modnMDl",
"mulnSr"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
eqn_modDr p m n d : (m + p == n + p %[mod d]) = (m == n %[mod d]). | Proof. by rewrite -!(addnC p) eqn_modDl. Qed. | Lemma | eqn_modDr | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"addnC",
"eqn_modDl"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modnMml m n d : m %% d * n = m * n %[mod d]. | Proof. by rewrite [in RHS](divn_eq m d) mulnDl mulnAC modnMDl. Qed. | Lemma | modnMml | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"divn_eq",
"modnMDl",
"mulnAC",
"mulnDl"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modnMmr m n d : m * (n %% d) = m * n %[mod d]. | Proof. by rewrite !(mulnC m) modnMml. Qed. | Lemma | modnMmr | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"modnMml",
"mulnC"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modnMm m n d : m %% d * (n %% d) = m * n %[mod d]. | Proof. by rewrite modnMml modnMmr. Qed. | Lemma | modnMm | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"modnMml",
"modnMmr"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modn2 m : m %% 2 = odd m. | Proof. by elim: m => //= m IHm; rewrite -addn1 -modnDml IHm; case odd. Qed. | Lemma | modn2 | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"addn1",
"modnDml",
"odd"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
divn2 m : m %/ 2 = m./2. | Proof. by rewrite [in RHS](divn_eq m 2) modn2 muln2 addnC half_bit_double. Qed. | Lemma | divn2 | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"addnC",
"divn_eq",
"half_bit_double",
"modn2",
"muln2"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
odd_mod m d : odd d = false -> odd (m %% d) = odd m. | Proof.
by move=> d_even; rewrite [in RHS](divn_eq m d) oddD oddM d_even andbF.
Qed. | Lemma | odd_mod | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"divn_eq",
"odd",
"oddD",
"oddM"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modnXm m n a : (a %% n) ^ m = a ^ m %[mod n]. | Proof. by elim: m => // m IHm; rewrite !expnS -modnMmr IHm modnMml modnMmr. Qed. | Lemma | modnXm | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"expnS",
"modnMml",
"modnMmr"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modnMDXl p m n d : (p * d + m) ^ n = m ^ n %[mod d]. | Proof. by elim: n => // n IH; rewrite !expnS -modnMm IH modnMDl modnMm. Qed. | Lemma | modnMDXl | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"expnS",
"modnMDl",
"modnMm"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modnMBXl p m n d :
m <= p * d -> (p * d - m) ^ n = (p * d - m) ^ odd n * m ^ n./2.*2 %[mod d]. | Proof.
move=> mpd; have [k]:= ubnP n; elim: k n => //= k IH; case => [|[|n nk]] //.
by rewrite muln1.
rewrite /= negbK doubleS -addn2 expnD -modnMmr.
suff -> : (p * d - m) ^ 2 = m ^ 2 %[mod d].
by rewrite modnMmr -modnMml IH 1? ltnW // modnMml -mulnA -expnD addn2.
rewrite -sqrnD_sub // -(modnMDXl p _ _ d).
suff pd... | Lemma | modnMBXl | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"addn0",
"addn2",
"addnn",
"apply",
"doubleS",
"expnD",
"expnMn",
"expn_gt0",
"last",
"ltnW",
"ltngtP",
"mod0n",
"modnDmr",
"modnMDXl",
"modnMl",
"modnMml",
"modnMmr",
"mul2n",
"muln0",
"muln1",
"mulnA",
"mulnAC",
"odd",
"sqrnD_sub",
"subnK",
"subn_gt0",
"ubnP"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
modn_sqrB m n : n <= m -> (m - n) ^ 2 = n ^ 2 %[mod m]. | Proof. by move=> nLn; have := @modnMBXl 1 n 2 m; rewrite !mul1n => ->. Qed. | Lemma | modn_sqrB | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"modnMBXl",
"mul1n"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
dvdn d m | := m %% d == 0. | Definition | dvdn | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [] | Divisibility * | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d |
"m %| d" | := (dvdn m d) : nat_scope. | Notation | m %| d | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"dvdn"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
dvdnP d m : reflect (exists k, m = k * d) (d %| m). | Proof.
apply: (iffP eqP) => [md0 | [k ->]]; last by rewrite modnMl.
by exists (m %/ d); rewrite [LHS](divn_eq m d) md0 addn0.
Qed. | Lemma | dvdnP | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"addn0",
"apply",
"divn_eq",
"last",
"modnMl"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
dvdn0 d : d %| 0. | Proof. by case: d. Qed. | Lemma | dvdn0 | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
dvd0n n : (0 %| n) = (n == 0). | Proof. by case: n. Qed. | Lemma | dvd0n | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
dvdn1 d : (d %| 1) = (d == 1). | Proof. by case: d => [|[|d]] //; rewrite /dvdn modn_small. Qed. | Lemma | dvdn1 | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"dvdn",
"modn_small"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
dvd1n m : 1 %| m. | Proof. by rewrite /dvdn modn1. Qed. | Lemma | dvd1n | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"dvdn",
"modn1"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
dvdn_gt0 d m : m > 0 -> d %| m -> d > 0. | Proof. by case: d => // /prednK <-. Qed. | Lemma | dvdn_gt0 | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"prednK"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
dvdnn m : m %| m. | Proof. by rewrite /dvdn modnn. Qed. | Lemma | dvdnn | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"dvdn",
"modnn"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
dvdn_mull d m n : d %| n -> d %| m * n. | Proof. by case/dvdnP=> n' ->; rewrite /dvdn mulnA modnMl. Qed. | Lemma | dvdn_mull | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"dvdn",
"dvdnP",
"modnMl",
"mulnA",
"n'"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
dvdn_mulr d m n : d %| m -> d %| m * n. | Proof. by move=> d_m; rewrite mulnC dvdn_mull. Qed. | Lemma | dvdn_mulr | boot | boot/div.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq"
] | [
"dvdn_mull",
"mulnC"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.