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 |
|---|---|---|---|---|---|---|---|---|---|---|
trunc_log1 p : trunc_log p 1 = 0. | Proof. by case: p => [|[]]. Qed. | Lemma | trunc_log1 | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"trunc_log"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
trunc_log_bounds p n :
1 < p -> 0 < n -> let k := trunc_log p n in p ^ k <= n < p ^ k.+1. | Proof.
rewrite {+}/trunc_log => p_gt1; have p_gt0 := ltnW p_gt1.
rewrite [p <= 1]leqNgt p_gt1 /=.
set loop := (loop in loop n n); set m := n; rewrite [in n in loop m n]/m.
have: m <= n by []; elim: n m => [|n IHn] [|m] //= /ltnSE-le_m_n _.
have [le_p_n | // ] := leqP p _; rewrite 2!expnSr -leq_divRL -?ltn_divLR //.
by ... | Lemma | trunc_log_bounds | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"divn_gt0",
"expnSr",
"leqNgt",
"leqP",
"leq_divRL",
"leq_trans",
"ltnS",
"ltnSE",
"ltnW",
"ltn_Pdiv",
"ltn_divLR",
"p_gt0",
"p_gt1",
"trunc_log"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
trunc_logP p n : 1 < p -> 0 < n -> p ^ trunc_log p n <= n. | Proof. by move=> p_gt1 /(trunc_log_bounds p_gt1)/andP[]. Qed. | Lemma | trunc_logP | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"p_gt1",
"trunc_log",
"trunc_log_bounds"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
trunc_log_ltn p n : 1 < p -> n < p ^ (trunc_log p n).+1. | Proof.
have [-> | n_gt0] := posnP n; first by rewrite trunc_log0 => /ltnW.
by case/trunc_log_bounds/(_ n_gt0)/andP.
Qed. | Lemma | trunc_log_ltn | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"ltnW",
"n_gt0",
"posnP",
"trunc_log",
"trunc_log0",
"trunc_log_bounds"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
trunc_log_max p k j : 1 < p -> p ^ j <= k -> j <= trunc_log p k. | Proof.
move=> p_gt1 le_pj_k; rewrite -ltnS -(@ltn_exp2l p) //.
exact: leq_ltn_trans (trunc_log_ltn _ _).
Qed. | Lemma | trunc_log_max | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"leq_ltn_trans",
"ltnS",
"ltn_exp2l",
"p_gt1",
"trunc_log",
"trunc_log_ltn"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
trunc_log_eq0 p n : (trunc_log p n == 0) = (p <= 1) || (n <= p.-1). | Proof.
case: p => [|[|p]]; case: n => // n; rewrite /= ltnS.
have /= /andP[] := trunc_log_bounds (isT : 1 < p.+2) (isT : 0 < n.+1).
case: trunc_log => [//|k] b1 b2.
apply/idP/idP => [/eqP sk0 | nlep]; first by move: b2; rewrite sk0.
symmetry; rewrite -[_ == _]/false /is_true -b1; apply/negbTE; rewrite -ltnNge.
move: nl... | Lemma | trunc_log_eq0 | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"expn1",
"leqLHS",
"leq_ltn_trans",
"leq_pexp2l",
"ltnNge",
"ltnS",
"trunc_log",
"trunc_log_bounds"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
trunc_log_gt0 p n : (0 < trunc_log p n) = (1 < p) && (p.-1 < n). | Proof. by rewrite ltnNge leqn0 trunc_log_eq0 negb_or -!ltnNge. Qed. | Lemma | trunc_log_gt0 | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"leqn0",
"ltnNge",
"trunc_log",
"trunc_log_eq0"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
trunc_log0n n : trunc_log 0 n = 0. | Proof. by []. Qed. | Lemma | trunc_log0n | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"trunc_log"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
trunc_log1n n : trunc_log 1 n = 0. | Proof. by []. Qed. | Lemma | trunc_log1n | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"trunc_log"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
leq_trunc_log p m n : m <= n -> trunc_log p m <= trunc_log p n. | Proof.
move=> mlen; case: p => [|[|p]]; rewrite ?trunc_log0n ?trunc_log1n //.
case: m mlen => [|m] mlen; first by rewrite trunc_log0.
apply/trunc_log_max => //; apply: leq_trans mlen; exact: trunc_logP.
Qed. | Lemma | leq_trunc_log | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"leq_trans",
"trunc_log",
"trunc_log0",
"trunc_log0n",
"trunc_log1n",
"trunc_logP",
"trunc_log_max"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
trunc_log_eq p n k : 1 < p -> p ^ n <= k < p ^ n.+1 -> trunc_log p k = n. | Proof.
move=> p_gt1 /andP[npLk kLpn]; apply/anti_leq.
rewrite trunc_log_max// andbT -ltnS -(ltn_exp2l _ _ p_gt1).
apply: leq_ltn_trans kLpn; apply: trunc_logP => //.
by apply: leq_trans npLk; rewrite expn_gt0 ltnW.
Qed. | Lemma | trunc_log_eq | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"anti_leq",
"apply",
"expn_gt0",
"leq_ltn_trans",
"leq_trans",
"ltnS",
"ltnW",
"ltn_exp2l",
"p_gt1",
"trunc_log",
"trunc_logP",
"trunc_log_max"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
trunc_lognn p : 1 < p -> trunc_log p p = 1. | Proof. by case: p => [|[|p]] // _; rewrite /trunc_log ltnSn divnn. Qed. | Lemma | trunc_lognn | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"divnn",
"ltnSn",
"trunc_log"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
trunc_expnK p n : 1 < p -> trunc_log p (p ^ n) = n. | Proof. by move=> ?; apply: trunc_log_eq; rewrite // leqnn ltn_exp2l /=. Qed. | Lemma | trunc_expnK | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"leqnn",
"ltn_exp2l",
"trunc_log",
"trunc_log_eq"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
trunc_logMp p n : 1 < p -> 0 < n ->
trunc_log p (p * n) = (trunc_log p n).+1. | Proof.
case: p => [//|p] => p_gt0 n_gt0; apply: trunc_log_eq => //.
rewrite expnS leq_pmul2l// trunc_logP//=.
by rewrite expnS ltn_pmul2l// trunc_log_ltn.
Qed. | Lemma | trunc_logMp | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"expnS",
"leq_pmul2l",
"ltn_pmul2l",
"n_gt0",
"p_gt0",
"trunc_log",
"trunc_logP",
"trunc_log_eq",
"trunc_log_ltn"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
trunc_log2_double n : 0 < n -> trunc_log 2 n.*2 = (trunc_log 2 n).+1. | Proof. by move=> n_gt0; rewrite -mul2n trunc_logMp. Qed. | Lemma | trunc_log2_double | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"mul2n",
"n_gt0",
"trunc_log",
"trunc_logMp"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
trunc_log2S n : 1 < n -> trunc_log 2 n = (trunc_log 2 n./2).+1. | Proof.
move=> n_gt1.
rewrite -trunc_log2_double ?half_gt0//.
rewrite -[n in LHS]odd_double_half.
case: odd => //; rewrite add1n.
apply: trunc_log_eq => //.
rewrite leqW ?trunc_logP //= ?double_gt0 ?half_gt0//.
rewrite trunc_log2_double ?half_gt0// expnS.
by rewrite -doubleS mul2n leq_double trunc_log_ltn.
Qed. | Lemma | trunc_log2S | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"add1n",
"apply",
"doubleS",
"double_gt0",
"expnS",
"half_gt0",
"leqW",
"leq_double",
"mul2n",
"odd",
"odd_double_half",
"trunc_log",
"trunc_log2_double",
"trunc_logP",
"trunc_log_eq",
"trunc_log_ltn"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
up_log p n | :=
if (p <= 1) then 0 else
let v := trunc_log p n in if n <= p ^ v then v else v.+1. | Definition | up_log | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"trunc_log"
] | Truncated up real logarithm | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d |
up_log0 p : up_log p 0 = 0. | Proof. by case: p => // [] []. Qed. | Lemma | up_log0 | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"up_log"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
up_log1 p : up_log p 1 = 0. | Proof. by case: p => // [] []. Qed. | Lemma | up_log1 | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"up_log"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
up_log_eq0 p n : (up_log p n == 0) = (p <= 1) || (n <= 1). | Proof.
case: p => // [] [] // p.
case: n => [|[|n]]; rewrite /up_log //=.
have /= := trunc_log_bounds (isT : 1 < p.+2) (isT : 0 < n.+2).
by case: (leqP _ n.+1); case: trunc_log.
Qed. | Lemma | up_log_eq0 | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"leqP",
"trunc_log",
"trunc_log_bounds",
"up_log"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
up_log_gt0 p n : (0 < up_log p n) = (1 < p) && (1 < n). | Proof. by rewrite ltnNge leqn0 up_log_eq0 negb_or -!ltnNge. Qed. | Lemma | up_log_gt0 | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"leqn0",
"ltnNge",
"up_log",
"up_log_eq0"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
up_log_bounds p n :
1 < p -> 1 < n -> let k := up_log p n in p ^ k.-1 < n <= p ^ k. | Proof.
move=> p_gt1 n_gt1.
have n_gt0 : 0 < n by apply: leq_trans n_gt1.
rewrite /up_log (leqNgt p 1) p_gt1 /=.
have /= /andP[tpLn nLtpS] := trunc_log_bounds p_gt1 n_gt0.
have [nLnp|npLn] := leqP n (p ^ trunc_log p n); last by rewrite npLn ltnW.
rewrite nLnp (leq_trans _ tpLn) // ltn_exp2l // prednK ?leqnn //.
by case:... | Lemma | up_log_bounds | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"last",
"leqNgt",
"leqP",
"leq_trans",
"leqnn",
"ltnW",
"ltn_exp2l",
"n_gt0",
"p_gt1",
"prednK",
"trunc_log",
"trunc_log_bounds",
"up_log"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
up_logP p n : 1 < p -> n <= p ^ up_log p n. | Proof.
case: n => [|[|n]] // p_gt1; first by rewrite up_log1.
by have /andP[] := up_log_bounds p_gt1 (isT: 1 < n.+2).
Qed. | Lemma | up_logP | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"p_gt1",
"up_log",
"up_log1",
"up_log_bounds"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
up_log_gtn p n : 1 < p -> 1 < n -> p ^ (up_log p n).-1 < n. | Proof.
by case: n => [|[|n]] p_gt1 n_gt1 //; have /andP[] := up_log_bounds p_gt1 n_gt1.
Qed. | Lemma | up_log_gtn | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"p_gt1",
"up_log",
"up_log_bounds"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
up_log_min p k j : 1 < p -> k <= p ^ j -> up_log p k <= j. | Proof.
case: k => [|[|k]] // p_gt1 kLj; rewrite ?(up_log0, up_log1) //.
rewrite -[up_log _ _]prednK ?up_log_gt0 ?p_gt1 // -(@ltn_exp2l p) //.
by apply: leq_trans (up_log_gtn p_gt1 (isT : 1 < k.+2)) _.
Qed. | Lemma | up_log_min | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"leq_trans",
"ltn_exp2l",
"p_gt1",
"prednK",
"up_log",
"up_log0",
"up_log1",
"up_log_gt0",
"up_log_gtn"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
leq_up_log p m n : m <= n -> up_log p m <= up_log p n. | Proof.
move=> mLn; case: p => [|[|p]] //.
by apply/up_log_min => //; apply: leq_trans mLn (up_logP _ _).
Qed. | Lemma | leq_up_log | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"leq_trans",
"up_log",
"up_logP",
"up_log_min"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
up_log_eq p n k : 1 < p -> p ^ n < k <= p ^ n.+1 -> up_log p k = n.+1. | Proof.
move=> p_gt1 /andP[npLk kLpn]; apply/eqP; rewrite eqn_leq.
apply/andP; split; first by apply: up_log_min.
rewrite -(ltn_exp2l _ _ p_gt1) //.
by apply: leq_trans npLk (up_logP _ _).
Qed. | Lemma | up_log_eq | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"eqn_leq",
"leq_trans",
"ltn_exp2l",
"p_gt1",
"split",
"up_log",
"up_logP",
"up_log_min"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
up_lognn p : 1 < p -> up_log p p = 1. | Proof. by move=> p_gt1; apply: up_log_eq; rewrite p_gt1 /=. Qed. | Lemma | up_lognn | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"p_gt1",
"up_log",
"up_log_eq"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
up_expnK p n : 1 < p -> up_log p (p ^ n) = n. | Proof.
case: n => [|n] p_gt1 /=; first by rewrite up_log1.
by apply: up_log_eq; rewrite // leqnn andbT ltn_exp2l.
Qed. | Lemma | up_expnK | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"leqnn",
"ltn_exp2l",
"p_gt1",
"up_log",
"up_log1",
"up_log_eq"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
up_logMp p n : 1 < p -> 0 < n -> up_log p (p * n) = (up_log p n).+1. | Proof.
case: p => [//|p] p_gt0.
case: n => [//|[|n]] _; first by rewrite muln1 up_lognn// up_log1.
apply: up_log_eq => //.
rewrite expnS leq_pmul2l// up_logP// andbT.
rewrite -[up_log _ _]prednK ?up_log_gt0 ?p_gt0 //.
by rewrite expnS ltn_pmul2l// up_log_gtn.
Qed. | Lemma | up_logMp | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"expnS",
"leq_pmul2l",
"ltn_pmul2l",
"muln1",
"p_gt0",
"prednK",
"up_log",
"up_log1",
"up_logP",
"up_log_eq",
"up_log_gt0",
"up_log_gtn",
"up_lognn"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
up_log2_double n : 0 < n -> up_log 2 n.*2 = (up_log 2 n).+1. | Proof. by move=> n_gt0; rewrite -mul2n up_logMp. Qed. | Lemma | up_log2_double | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"mul2n",
"n_gt0",
"up_log",
"up_logMp"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
up_log2S n : 0 < n -> up_log 2 n.+1 = (up_log 2 (n./2.+1)).+1. | Proof.
case: n=> // [] [|n] // _.
apply: up_log_eq => //; apply/andP; split.
apply: leq_trans (_ : n./2.+1.*2 < n.+3); last first.
by rewrite doubleS !ltnS -[leqRHS]odd_double_half leq_addl.
have /= /andP[H1n _] := up_log_bounds (isT : 1 < 2) (isT : 1 < n./2.+2).
by rewrite ltnS -leq_double -mul2n -expnS pred... | Lemma | up_log2S | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"add1n",
"apply",
"doubleS",
"expnS",
"last",
"leqLHS",
"leqRHS",
"leq_add2r",
"leq_addl",
"leq_double",
"leq_trans",
"ltnS",
"mul2n",
"odd",
"odd_double_half",
"prednK",
"split",
"up_log",
"up_log_bounds",
"up_log_eq",
"up_log_gt0"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
up_log_trunc_log p n :
1 < p -> 1 < n -> up_log p n = (trunc_log p n.-1).+1. | Proof.
move=> p_gt1 n_gt1; apply: up_log_eq => //.
rewrite -[n]prednK ?ltnS -?pred_Sn ?[0 < n]ltnW//.
by rewrite trunc_logP ?ltn_predRL// trunc_log_ltn.
Qed. | Lemma | up_log_trunc_log | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"ltnS",
"ltnW",
"ltn_predRL",
"p_gt1",
"prednK",
"trunc_log",
"trunc_logP",
"trunc_log_ltn",
"up_log",
"up_log_eq"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
trunc_log_up_log p n :
1 < p -> 0 < n -> trunc_log p n = (up_log p n.+1).-1. | Proof. by move=> ? ?; rewrite up_log_trunc_log.
Qed. | Lemma | trunc_log_up_log | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"trunc_log",
"up_log",
"up_log_trunc_log"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
nat_pred_pred | := Eval hnf in [predType of nat_pred]. | Canonical | nat_pred_pred | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"nat_pred"
] | Testing for membership in set of prime factors. | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d |
nat_pred_of_nat (p : nat) : nat_pred | := pred1 p. | Coercion | nat_pred_of_nat | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"nat",
"nat_pred",
"pred1"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
negn : nat_pred | := [predC pi]. | Definition | negn | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"nat_pred",
"pi"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
pnat : pred nat | := fun m => (m > 0) && all [in pi] (primes m). | Definition | pnat | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"all",
"nat",
"pi",
"primes"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
partn | := \prod_(0 <= p < n.+1 | p \in pi) p ^ logn p n. | Definition | partn | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"logn",
"pi"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
"pi ^'" | := (negn pi) : nat_scope. | Notation | pi ^' | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"negn",
"pi"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
"pi .-nat" | := (pnat pi) : nat_scope. | Notation | pi .-nat | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"pi",
"pnat"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
"n `_ pi" | := (partn n pi) : nat_scope. | Notation | n `_ pi | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"partn",
"pi"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
negnK pi : pi^'^' =i pi. | Proof. by move=> p; apply: negbK. Qed. | Lemma | negnK | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"pi"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
eq_negn pi1 pi2 : pi1 =i pi2 -> pi1^' =i pi2^'. | Proof. by move=> eq_pi n; rewrite inE eq_pi. Qed. | Lemma | eq_negn | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"inE"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
eq_piP m n : \pi(m) =i \pi(n) <-> \pi(m) = \pi(n). | Proof.
rewrite /pi_of; have eqs := irr_sorted_eq ltn_trans ltnn.
by split=> [|-> //] /(eqs _ _ (sorted_primes m) (sorted_primes n)) ->.
Qed. | Lemma | eq_piP | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"irr_sorted_eq",
"ltn_trans",
"ltnn",
"pi",
"pi_of",
"sorted_primes",
"split"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
part_gt0 pi n : 0 < n`_pi. | Proof. exact: prodn_gt0. Qed. | Lemma | part_gt0 | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"pi",
"prodn_gt0"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
sub_in_partn pi1 pi2 n :
{in \pi(n), {subset pi1 <= pi2}} -> n`_pi1 %| n`_pi2. | Proof.
move=> pi12; rewrite ![n`__]big_mkcond /=.
apply (big_ind2 (fun m1 m2 => m1 %| m2)) => // [*|p _]; first exact: dvdn_mul.
rewrite lognE -mem_primes; case: ifP => pi1p; last exact: dvd1n.
by case: ifP => pr_p; [rewrite pi12 | rewrite if_same].
Qed. | Lemma | sub_in_partn | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"big_ind2",
"big_mkcond",
"dvd1n",
"dvdn_mul",
"last",
"lognE",
"mem_primes",
"pi",
"pr_p"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
eq_in_partn pi1 pi2 n : {in \pi(n), pi1 =i pi2} -> n`_pi1 = n`_pi2. | Proof.
by move=> pi12; apply/eqP; rewrite eqn_dvd ?sub_in_partn // => p /pi12->.
Qed. | Lemma | eq_in_partn | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"eqn_dvd",
"pi",
"sub_in_partn"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
eq_partn pi1 pi2 n : pi1 =i pi2 -> n`_pi1 = n`_pi2. | Proof. by move=> pi12; apply: eq_in_partn => p _. Qed. | Lemma | eq_partn | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"eq_in_partn"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
partnNK pi n : n`_pi^'^' = n`_pi. | Proof. by apply: eq_partn; apply: negnK. Qed. | Lemma | partnNK | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"eq_partn",
"negnK",
"pi"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
widen_partn m pi n :
n <= m -> n`_pi = \prod_(0 <= p < m.+1 | p \in pi) p ^ logn p n. | Proof.
move=> le_n_m; rewrite big_mkcond /=.
rewrite [n`_pi](big_nat_widen _ _ m.+1) // big_mkcond /=.
apply: eq_bigr => p _; rewrite ltnS lognE.
by case: and3P => [[_ n_gt0 p_dv_n]|]; rewrite ?if_same // andbC dvdn_leq.
Qed. | Lemma | widen_partn | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"big_mkcond",
"big_nat_widen",
"dvdn_leq",
"eq_bigr",
"logn",
"lognE",
"ltnS",
"n_gt0",
"pi"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
eq_partn_from_log m n (pi : nat_pred) : 0 < m -> 0 < n ->
{in pi, logn^~ m =1 logn^~ n} -> m`_pi = n`_pi. | Proof.
move=> m0 n0 eq_log; rewrite !(@widen_partn (maxn m n)) ?leq_maxl ?leq_maxr//.
by apply: eq_bigr => p /eq_log ->.
Qed. | Lemma | eq_partn_from_log | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"eq_bigr",
"leq_maxl",
"leq_maxr",
"logn",
"maxn",
"nat_pred",
"pi",
"widen_partn"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
partn0 pi : 0`_pi = 1. | Proof. by apply: big1_seq => [] [|n]; rewrite andbC. Qed. | Lemma | partn0 | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"big1_seq",
"pi"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
partn1 pi : 1`_pi = 1. | Proof. by apply: big1_seq => [] [|[|n]]; rewrite andbC. Qed. | Lemma | partn1 | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"big1_seq",
"pi"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
partnM pi m n : m > 0 -> n > 0 -> (m * n)`_pi = m`_pi * n`_pi. | Proof.
have le_pmul m' n': m' > 0 -> n' <= m' * n' by move/prednK <-; apply: leq_addr.
move=> mpos npos; rewrite !(@widen_partn (n * m)) 3?(le_pmul, mulnC) //.
rewrite !big_mkord -big_split; apply: eq_bigr => p _ /=.
by rewrite lognM // expnD.
Qed. | Lemma | partnM | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"big_mkord",
"big_split",
"eq_bigr",
"expnD",
"leq_addr",
"lognM",
"mulnC",
"n'",
"npos",
"pi",
"prednK",
"widen_partn"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
partnX pi m n : (m ^ n)`_pi = m`_pi ^ n. | Proof.
elim: n => [|n IHn]; first exact: partn1.
rewrite expnS; have [->|m_gt0] := posnP m; first by rewrite partn0 exp1n.
by rewrite expnS partnM ?IHn // expn_gt0 m_gt0.
Qed. | Lemma | partnX | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"exp1n",
"expnS",
"expn_gt0",
"partn0",
"partn1",
"partnM",
"pi",
"posnP"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
partn_dvd pi m n : n > 0 -> m %| n -> m`_pi %| n`_pi. | Proof.
move=> n_gt0 dvmn; case/dvdnP: dvmn n_gt0 => q ->{n}.
by rewrite muln_gt0 => /andP[q_gt0 m_gt0]; rewrite partnM ?dvdn_mull.
Qed. | Lemma | partn_dvd | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"dvdnP",
"dvdn_mull",
"muln_gt0",
"n_gt0",
"partnM",
"pi",
"q_gt0"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
p_part p n : n`_p = p ^ logn p n. | Proof.
case (posnP (logn p n)) => [log0 |].
by rewrite log0 [n`_p]big1_seq // => q /andP [/eqP ->]; rewrite log0.
rewrite logn_gt0 mem_primes; case/and3P=> _ n_gt0 dv_p_n.
have le_p_n: p < n.+1 by rewrite ltnS dvdn_leq.
by rewrite [n`_p]big_mkord (big_pred1 (Ordinal le_p_n)).
Qed. | Lemma | p_part | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"big1_seq",
"big_mkord",
"big_pred1",
"dvdn_leq",
"logn",
"logn_gt0",
"ltnS",
"mem_primes",
"n_gt0",
"posnP"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
p_part_eq1 p n : (n`_p == 1) = (p \notin \pi(n)). | Proof.
rewrite mem_primes p_part lognE; case: and3P => // [[p_pr _ _]].
by rewrite -dvdn1 pfactor_dvdn // logn1.
Qed. | Lemma | p_part_eq1 | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"dvdn1",
"logn1",
"lognE",
"mem_primes",
"p_part",
"p_pr",
"pfactor_dvdn",
"pi"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
p_part_gt1 p n : (n`_p > 1) = (p \in \pi(n)). | Proof. by rewrite ltn_neqAle part_gt0 andbT eq_sym p_part_eq1 negbK. Qed. | Lemma | p_part_gt1 | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"eq_sym",
"ltn_neqAle",
"p_part_eq1",
"part_gt0",
"pi"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
primes_part pi n : primes n`_pi = filter [in pi] (primes n). | Proof.
have ltnT := ltn_trans; have [->|n_gt0] := posnP n; first by rewrite partn0.
apply: (irr_sorted_eq ltnT ltnn); rewrite ?(sorted_primes, sorted_filter) //.
move=> p; rewrite mem_filter /= !mem_primes n_gt0 part_gt0 /=.
apply/andP/and3P=> [[p_pr] | [pi_p p_pr dv_p_n]].
rewrite /partn; apply big_ind => [|n1 n2 IH... | Lemma | primes_part | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"Euclid_dvdM",
"apply",
"bigD1",
"big_ind",
"big_mkord",
"dvdn1",
"dvdn_leq",
"dvdn_mulr",
"expn1",
"expnS",
"filter",
"irr_sorted_eq",
"lognE",
"lognX",
"logn_gt0",
"logn_prime",
"ltnS",
"ltn_trans",
"ltnn",
"mem_filter",
"mem_primes",
"muln_gt0",
"n_gt0",
"p_pr",
"p... | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
filter_pi_of n m : n < m -> filter \pi(n) (index_iota 0 m) = primes n. | Proof.
move=> lt_n_m; have ltnT := ltn_trans; apply: (irr_sorted_eq ltnT ltnn).
- by rewrite sorted_filter // iota_ltn_sorted.
- exact: sorted_primes.
move=> p; rewrite mem_filter mem_index_iota /= mem_primes; case: and3P => //.
by case=> _ n_gt0 dv_p_n; apply: leq_ltn_trans lt_n_m; apply: dvdn_leq.
Qed. | Lemma | filter_pi_of | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"dvdn_leq",
"filter",
"index_iota",
"iota_ltn_sorted",
"irr_sorted_eq",
"leq_ltn_trans",
"ltn_trans",
"ltnn",
"mem_filter",
"mem_index_iota",
"mem_primes",
"n_gt0",
"pi",
"primes",
"sorted_filter",
"sorted_primes"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
partn_pi n : n > 0 -> n`_\pi(n) = n. | Proof.
move=> n_gt0; rewrite [RHS]prod_prime_decomp // prime_decompE big_map.
by rewrite -[n`__]big_filter filter_pi_of.
Qed. | Lemma | partn_pi | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"big_filter",
"big_map",
"filter_pi_of",
"n_gt0",
"pi",
"prime_decompE",
"prod_prime_decomp"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
partnT n : n > 0 -> n`_predT = n. | Proof.
move=> n_gt0; rewrite -[RHS]partn_pi // [RHS]/partn big_mkcond /=.
by apply: eq_bigr => p _; rewrite -logn_gt0; case: (logn p _).
Qed. | Lemma | partnT | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"big_mkcond",
"eq_bigr",
"logn",
"logn_gt0",
"n_gt0",
"partn",
"partn_pi"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
eqn_from_log m n : 0 < m -> 0 < n -> logn^~ m =1 logn^~ n -> m = n. | Proof.
by move=> ? ? /(@in1W _ predT)/eq_partn_from_log; rewrite !partnT// => ->.
Qed. | Lemma | eqn_from_log | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"eq_partn_from_log",
"logn",
"partnT"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
partnC pi n : n > 0 -> n`_pi * n`_pi^' = n. | Proof.
move=> n_gt0; rewrite -[RHS]partnT /partn //.
do 2!rewrite mulnC big_mkcond /=; rewrite -big_split; apply: eq_bigr => p _ /=.
by rewrite mulnC inE /=; case: (p \in pi); rewrite /= (muln1, mul1n).
Qed. | Lemma | partnC | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"big_mkcond",
"big_split",
"eq_bigr",
"inE",
"mul1n",
"muln1",
"mulnC",
"n_gt0",
"partn",
"partnT",
"pi"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
dvdn_part pi n : n`_pi %| n. | Proof. by case: n => // n; rewrite -{2}[n.+1](@partnC pi) // dvdn_mulr. Qed. | Lemma | dvdn_part | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"dvdn_mulr",
"partnC",
"pi"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
logn_part p m : logn p m`_p = logn p m. | Proof.
case p_pr: (prime p); first by rewrite p_part pfactorK.
by rewrite lognE (lognE p m) p_pr.
Qed. | Lemma | logn_part | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"logn",
"lognE",
"p_part",
"p_pr",
"pfactorK",
"prime"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
partn_lcm pi m n : m > 0 -> n > 0 -> (lcmn m n)`_pi = lcmn m`_pi n`_pi. | Proof.
move=> m_gt0 n_gt0; have p_gt0: lcmn m n > 0 by rewrite lcmn_gt0 m_gt0.
apply/eqP; rewrite eqn_dvd dvdn_lcm !partn_dvd ?dvdn_lcml ?dvdn_lcmr //.
rewrite -(dvdn_pmul2r (part_gt0 pi^' (lcmn m n))) partnC // dvdn_lcm !andbT.
rewrite -[m in m %| _](partnC pi m_gt0) andbC -[n in n %| _](partnC pi n_gt0).
by rewrite !... | Lemma | partn_lcm | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"dvdn_lcm",
"dvdn_lcml",
"dvdn_lcmr",
"dvdn_mul",
"dvdn_pmul2r",
"eqn_dvd",
"lcmn",
"lcmn_gt0",
"n_gt0",
"p_gt0",
"part_gt0",
"partnC",
"partn_dvd",
"pi"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
partn_gcd pi m n : m > 0 -> n > 0 -> (gcdn m n)`_pi = gcdn m`_pi n`_pi. | Proof.
move=> m_gt0 n_gt0; have p_gt0: gcdn m n > 0 by rewrite gcdn_gt0 m_gt0.
apply/eqP; rewrite eqn_dvd dvdn_gcd !partn_dvd ?dvdn_gcdl ?dvdn_gcdr //=.
rewrite -(dvdn_pmul2r (part_gt0 pi^' (gcdn m n))) partnC // dvdn_gcd.
rewrite -[m in _ %| m](partnC pi m_gt0) andbC -[n in _%| n](partnC pi n_gt0).
by rewrite !dvdn_mu... | Lemma | partn_gcd | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"dvdn_gcd",
"dvdn_gcdl",
"dvdn_gcdr",
"dvdn_mul",
"dvdn_pmul2r",
"eqn_dvd",
"gcdn",
"gcdn_gt0",
"n_gt0",
"p_gt0",
"part_gt0",
"partnC",
"partn_dvd",
"pi"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
partn_biglcm (I : finType) (P : pred I) F pi :
(forall i, P i -> F i > 0) ->
(\big[lcmn/1%N]_(i | P i) F i)`_pi = \big[lcmn/1%N]_(i | P i) (F i)`_pi. | Proof.
move=> F_gt0; set m := \big[lcmn/1%N]_(i | P i) F i.
have m_gt0: 0 < m by elim/big_ind: m => // p q p_gt0; rewrite lcmn_gt0 p_gt0.
apply/eqP; rewrite eqn_dvd andbC; apply/andP; split.
by apply/dvdn_biglcmP=> i Pi; rewrite partn_dvd // (@biglcmn_sup _ i).
rewrite -(dvdn_pmul2r (part_gt0 pi^' m)) partnC //.
appl... | Lemma | partn_biglcm | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"big_ind",
"biglcmn_sup",
"dvdn_biglcmP",
"dvdn_mul",
"dvdn_pmul2r",
"eqn_dvd",
"lcmn",
"lcmn_gt0",
"p_gt0",
"part_gt0",
"partnC",
"partn_dvd",
"pi",
"split"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
partn_biggcd (I : finType) (P : pred I) F pi :
#|SimplPred P| > 0 -> (forall i, P i -> F i > 0) ->
(\big[gcdn/0]_(i | P i) F i)`_pi = \big[gcdn/0]_(i | P i) (F i)`_pi. | Proof.
move=> ntP F_gt0; set d := \big[gcdn/0]_(i | P i) F i.
have d_gt0: 0 < d.
case/card_gt0P: ntP => i /= Pi; have:= F_gt0 i Pi.
rewrite !lt0n -!dvd0n; apply: contra => dv0d.
by rewrite (dvdn_trans dv0d) // (@biggcdn_inf _ i).
apply/eqP; rewrite eqn_dvd; apply/andP; split.
by apply/dvdn_biggcdP=> i Pi; rewri... | Lemma | partn_biggcd | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"biggcdn_inf",
"card_gt0P",
"d_gt0",
"dvd0n",
"dvdn_biggcdP",
"dvdn_mul",
"dvdn_pmul2r",
"dvdn_trans",
"eqn_dvd",
"gcdn",
"lt0n",
"part_gt0",
"partnC",
"partn_dvd",
"pi",
"split"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
logn_gcd p m n : 0 < m -> 0 < n ->
logn p (gcdn m n) = minn (logn p m) (logn p n). | Proof.
move=> m_gt0 n_gt0; case p_pr: (prime p); last by rewrite /logn p_pr.
by apply: (@expnI p); rewrite ?prime_gt1// expn_min -!p_part partn_gcd.
Qed. | Lemma | logn_gcd | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"expnI",
"expn_min",
"gcdn",
"last",
"logn",
"minn",
"n_gt0",
"p_part",
"p_pr",
"partn_gcd",
"prime",
"prime_gt1"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
logn_lcm p m n : 0 < m -> 0 < n ->
logn p (lcmn m n) = maxn (logn p m) (logn p n). | Proof.
move=> m_gt0 n_gt0; rewrite /lcmn logn_div ?dvdn_mull ?dvdn_gcdr//.
by rewrite lognM// logn_gcd// -addn_min_max addnC addnK.
Qed. | Lemma | logn_lcm | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"addnC",
"addnK",
"addn_min_max",
"dvdn_gcdr",
"dvdn_mull",
"lcmn",
"logn",
"lognM",
"logn_div",
"logn_gcd",
"maxn",
"n_gt0"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
sub_in_pnat pi rho n :
{in \pi(n), {subset pi <= rho}} -> pi.-nat n -> rho.-nat n. | Proof.
rewrite /pnat => subpi /andP[-> pi_n].
by apply/allP=> p pr_p; apply: subpi => //; apply: (allP pi_n).
Qed. | Lemma | sub_in_pnat | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"allP",
"apply",
"nat",
"pi",
"pnat",
"pr_p"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
eq_in_pnat pi rho n : {in \pi(n), pi =i rho} -> pi.-nat n = rho.-nat n. | Proof. by move=> eqpi; apply/idP/idP; apply: sub_in_pnat => p /eqpi->. Qed. | Lemma | eq_in_pnat | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"nat",
"pi",
"sub_in_pnat"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
eq_pnat pi rho n : pi =i rho -> pi.-nat n = rho.-nat n. | Proof. by move=> eqpi; apply: eq_in_pnat => p _. Qed. | Lemma | eq_pnat | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"eq_in_pnat",
"nat",
"pi"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
pnatNK pi n : pi^'^'.-nat n = pi.-nat n. | Proof. exact: eq_pnat (negnK pi). Qed. | Lemma | pnatNK | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"eq_pnat",
"nat",
"negnK",
"pi"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
pnatI pi rho n : [predI pi & rho].-nat n = pi.-nat n && rho.-nat n. | Proof. by rewrite /pnat andbCA all_predI !andbA andbb. Qed. | Lemma | pnatI | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"all_predI",
"nat",
"pi",
"pnat"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
pnatM pi m n : pi.-nat (m * n) = pi.-nat m && pi.-nat n. | Proof.
rewrite /pnat muln_gt0 andbCA -andbA andbCA.
case: posnP => // n_gt0; case: posnP => //= m_gt0.
apply/allP/andP=> [pi_mn | [pi_m pi_n] p].
by split; apply/allP=> p m_p; apply: pi_mn; rewrite primesM // m_p ?orbT.
by rewrite primesM // => /orP[]; [apply: (allP pi_m) | apply: (allP pi_n)].
Qed. | Lemma | pnatM | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"allP",
"apply",
"muln_gt0",
"n_gt0",
"nat",
"pi",
"pnat",
"posnP",
"primesM",
"split"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
pnatX pi m n : pi.-nat (m ^ n) = pi.-nat m || (n == 0). | Proof. by case: n => [|n]; rewrite orbC // /pnat expn_gt0 orbC primesX. Qed. | Lemma | pnatX | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"expn_gt0",
"nat",
"pi",
"pnat",
"primesX"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
part_pnat pi n : pi.-nat n`_pi. | Proof.
rewrite /pnat primes_part part_gt0.
by apply/allP=> p; rewrite mem_filter => /andP[].
Qed. | Lemma | part_pnat | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"allP",
"apply",
"mem_filter",
"nat",
"part_gt0",
"pi",
"pnat",
"primes_part"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
pnatE pi p : prime p -> pi.-nat p = (p \in pi). | Proof. by move=> pr_p; rewrite /pnat prime_gt0 ?primes_prime //= andbT. Qed. | Lemma | pnatE | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"nat",
"pi",
"pnat",
"pr_p",
"prime",
"prime_gt0",
"primes_prime"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
pnat_id p : prime p -> p.-nat p. | Proof. by move=> pr_p; rewrite pnatE ?inE /=. Qed. | Lemma | pnat_id | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"inE",
"nat",
"pnatE",
"pr_p",
"prime"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
coprime_pi' m n : m > 0 -> n > 0 -> coprime m n = \pi(m)^'.-nat n. | Proof.
by move=> m_gt0 n_gt0; rewrite /pnat n_gt0 all_predC coprime_has_primes.
Qed. | Lemma | coprime_pi' | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"all_predC",
"coprime",
"coprime_has_primes",
"n_gt0",
"nat",
"pi",
"pnat"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
pnat_pi n : n > 0 -> \pi(n).-nat n. | Proof. by rewrite /pnat => ->; apply/allP. Qed. | Lemma | pnat_pi | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"allP",
"apply",
"nat",
"pi",
"pnat"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
pi_of_dvd m n : m %| n -> n > 0 -> {subset \pi(m) <= \pi(n)}. | Proof.
move=> m_dv_n n_gt0 p; rewrite !mem_primes n_gt0 => /and3P[-> _ p_dv_m].
exact: dvdn_trans p_dv_m m_dv_n.
Qed. | Lemma | pi_of_dvd | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"dvdn_trans",
"mem_primes",
"n_gt0",
"pi"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
pi_ofM m n : m > 0 -> n > 0 -> \pi(m * n) =i [predU \pi(m) & \pi(n)]. | Proof. by move=> m_gt0 n_gt0 p; apply: primesM. Qed. | Lemma | pi_ofM | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"n_gt0",
"pi",
"primesM"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
pi_of_part pi n : n > 0 -> \pi(n`_pi) =i [predI \pi(n) & pi]. | Proof. by move=> n_gt0 p; rewrite /pi_of primes_part mem_filter andbC. Qed. | Lemma | pi_of_part | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"mem_filter",
"n_gt0",
"pi",
"pi_of",
"primes_part"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
pi_of_exp p n : n > 0 -> \pi(p ^ n) = \pi(p). | Proof. by move=> n_gt0; rewrite /pi_of primesX. Qed. | Lemma | pi_of_exp | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"n_gt0",
"pi",
"pi_of",
"primesX"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
pi_of_prime p : prime p -> \pi(p) =i (p : nat_pred). | Proof. by move=> pr_p q; rewrite /pi_of primes_prime // mem_seq1. Qed. | Lemma | pi_of_prime | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"mem_seq1",
"nat_pred",
"pi",
"pi_of",
"pr_p",
"prime",
"primes_prime"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
p'natEpi p n : n > 0 -> p^'.-nat n = (p \notin \pi(n)). | Proof. by case: n => // n _; rewrite /pnat all_predC has_pred1. Qed. | Lemma | p'natEpi | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"all_predC",
"has_pred1",
"nat",
"pi",
"pnat"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
p'natE p n : prime p -> p^'.-nat n = ~~ (p %| n). | Proof.
case: n => [|n] p_pr; first by case: p p_pr.
by rewrite p'natEpi // mem_primes p_pr.
Qed. | Lemma | p'natE | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"mem_primes",
"nat",
"p'natEpi",
"p_pr",
"prime"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
pnatPpi pi n p : pi.-nat n -> p \in \pi(n) -> p \in pi. | Proof. by case/andP=> _ /allP; apply. Qed. | Lemma | pnatPpi | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"allP",
"apply",
"nat",
"pi"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
pnat_dvd m n pi : m %| n -> pi.-nat n -> pi.-nat m. | Proof. by case/dvdnP=> q ->; rewrite pnatM; case/andP. Qed. | Lemma | pnat_dvd | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"dvdnP",
"nat",
"pi",
"pnatM"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
pnat_div m n pi : m %| n -> pi.-nat n -> pi.-nat (n %/ m). | Proof.
case/dvdnP=> q ->; rewrite pnatM andbC => /andP[].
by case: m => // m _; rewrite mulnK.
Qed. | Lemma | pnat_div | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"dvdnP",
"mulnK",
"nat",
"pi",
"pnatM"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
pnat_coprime pi m n : pi.-nat m -> pi^'.-nat n -> coprime m n. | Proof.
case/andP=> m_gt0 pi_m /andP[n_gt0 pi'_n]; rewrite coprime_has_primes //.
by apply/hasPn=> p /(allP pi'_n); apply/contra/allP.
Qed. | Lemma | pnat_coprime | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"allP",
"apply",
"coprime",
"coprime_has_primes",
"hasPn",
"n_gt0",
"nat",
"pi"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
p'nat_coprime pi m n : pi^'.-nat m -> pi.-nat n -> coprime m n. | Proof. by move=> pi'm pi_n; rewrite (pnat_coprime pi'm) ?pnatNK. Qed. | Lemma | p'nat_coprime | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"coprime",
"nat",
"pi",
"pnatNK",
"pnat_coprime"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
sub_pnat_coprime pi rho m n :
{subset rho <= pi^'} -> pi.-nat m -> rho.-nat n -> coprime m n. | Proof.
by move=> pi'rho pi_m /(sub_in_pnat (in1W pi'rho)); apply: pnat_coprime.
Qed. | Lemma | sub_pnat_coprime | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"coprime",
"nat",
"pi",
"pnat_coprime",
"sub_in_pnat"
] | https://github.com/math-comp/math-comp | 91d97df9cf3204b4dab84f4e24bc633e84b6473d | |
coprime_partC pi m n : coprime m`_pi n`_pi^'. | Proof. by apply: (@pnat_coprime pi); apply: part_pnat. Qed. | Lemma | coprime_partC | boot | boot/prime.v | [
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"eqtype",
"ssrnat",
"seq",
"path",
"choice",
"fintype",
"div",
"bigop",
"NatTrec"
] | [
"apply",
"coprime",
"part_pnat",
"pi",
"pnat_coprime"
] | 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.