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
intq_eq0 n : (n%:~R == 0 :> rat) = (n == 0)%N.
Proof. by rewrite -ratzE /ratz rat_eqE/= /numq /denq/= eqxx andbT. Qed.
Fact
intq_eq0
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "denq", "eqxx", "numq", "rat", "rat_eqE", "ratz", "ratzE" ]
Will be subsumed by pnatr_eq0
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
fracqE x : fracq x = x.1%:Q / x.2%:Q.
Proof. move: x => [m n] /=; apply/val_inj; rewrite val_fracq/=. case: eqVneq => //= [->|n_neq0]; first by rewrite rat0 invr0 mulr0. rewrite -[m%:Q]valqK -[n%:Q]valqK. rewrite [_^-1]invq_frac ?denq_neq0 ?numq_eq0 ?intq_eq0//=. rewrite [X in valq X]mulq_frac val_fracq /invq_subdef !mulq_subdefE/=. by rewrite -!/(numq _) ...
Lemma
fracqE
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "apply", "denq", "denq_int", "denq_neq0", "eqVneq", "fracq", "intq_eq0", "invq_frac", "invq_subdef", "invr0", "mul1r", "mulq_frac", "mulq_subdefE", "mulr0", "mulr1", "numq", "numq_eq0", "numq_int", "rat0", "val_fracq", "val_inj", "valqK" ]
fracq should never appear, its canonical form is _%:Q / _%:Q
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divq_num_den x : (numq x)%:Q / (denq x)%:Q = x.
Proof. by rewrite -{3}[x]valqK [valq _]surjective_pairing /= fracqE. Qed.
Lemma
divq_num_den
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "denq", "fracqE", "numq", "valqK" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divq_spec (n d : int) : int -> int -> rat -> Type
:= | DivqSpecN of d = 0 : divq_spec n d n 0 0 | DivqSpecP k x of k != 0 : divq_spec n d (k * numq x) (k * denq x) x.
Variant
divq_spec
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "denq", "int", "numq", "rat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
divqP n d : divq_spec n d n d (n%:Q / d%:Q).
Proof. set x := (n, d); rewrite -[n]/x.1 -[d]/x.2 -fracqE. by case: fracqP => [_|k fx k_neq0] /=; constructor. Qed.
Lemma
divqP
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "divq_spec", "fracqE", "fracqP" ]
replaces fracqP
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
rat_spec (* (x : rat) *) : rat -> int -> int -> Type
:= Rat_spec (n : int) (d : nat) & coprime `|n| d.+1 : rat_spec (* x *) (n%:Q / d.+1%:Q) n d.+1.
Variant
rat_spec
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "coprime", "int", "nat", "rat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ratP x : rat_spec x (numq x) (denq x).
Proof. rewrite -{1}[x](divq_num_den); case hd: denq => [p|n]. have: 0 < p%:Z by rewrite -hd denq_gt0. case: p hd=> //= n hd; constructor; rewrite -?hd ?divq_num_den //. by rewrite -[n.+1]/`|n.+1|%N -hd coprime_num_den. by move: (denq_gt0 x); rewrite hd. Qed.
Lemma
ratP
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "coprime_num_den", "denq", "denq_gt0", "divq_num_den", "numq", "rat_spec" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
coprimeq_num n d : coprime `|n| `|d| -> numq (n%:~R / d%:~R) = sgr d * n.
Proof. move=> cnd /=; have <- := fracqE (n, d). rewrite num_fracq/= (eqP (cnd : _ == 1)) divn1. have [|d_gt0|d_lt0] := sgrP d; by rewrite (mul0r, mul1r, mulN1r) //= ?[_ ^ _]signrN ?mulNr mulz_sign_abs. Qed.
Lemma
coprimeq_num
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "coprime", "d_gt0", "divn1", "fracqE", "mul0r", "mul1r", "mulN1r", "mulNr", "mulz_sign_abs", "num_fracq", "numq", "sgr", "sgrP", "signrN" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
coprimeq_den n d : coprime `|n| `|d| -> denq (n%:~R / d%:~R) = (if d == 0 then 1 else `|d|).
Proof. move=> cnd; have <- := fracqE (n, d). by rewrite den_fracq/= (eqP (cnd : _ == 1)) divn1; case: d {cnd}; case. Qed.
Lemma
coprimeq_den
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "coprime", "den_fracq", "denq", "divn1", "fracqE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
denqVz (i : int) : i != 0 -> denq (i%:~R^-1) = `|i|.
Proof. move=> h; rewrite -div1r -[1]/(1%:~R). by rewrite coprimeq_den /= ?coprime1n // (negPf h). Qed.
Lemma
denqVz
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "coprime1n", "coprimeq_den", "denq", "div1r", "int" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
numqE x : (numq x)%:~R = x * (denq x)%:~R.
Proof. by rewrite -{2}[x]divq_num_den divfK // intq_eq0 denq_eq0. Qed.
Lemma
numqE
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "denq", "denq_eq0", "divfK", "divq_num_den", "intq_eq0", "numq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
denqP x : {d | denq x = d.+1}.
Proof. by rewrite /denq; case: x => [[_ [[|d]|]] //= _]; exists d. Qed.
Lemma
denqP
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "denq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
normq '(Rat x _) : rat
:= `|x.1|%:~R / (x.2)%:~R.
Definition
normq
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "rat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
le_rat '(Rat x _) '(Rat y _)
:= x.1 * y.2 <= y.1 * x.2.
Definition
le_rat
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
lt_rat '(Rat x _) '(Rat y _)
:= x.1 * y.2 < y.1 * x.2.
Definition
lt_rat
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
normqE x : normq x = `|numq x|%:~R / (denq x)%:~R.
Proof. by case: x. Qed.
Lemma
normqE
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "denq", "normq", "numq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
le_ratE x y : le_rat x y = (numq x * denq y <= numq y * denq x).
Proof. by case: x; case: y. Qed.
Lemma
le_ratE
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "denq", "le_rat", "numq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
lt_ratE x y : lt_rat x y = (numq x * denq y < numq y * denq x).
Proof. by case: x; case: y. Qed.
Lemma
lt_ratE
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "denq", "lt_rat", "numq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
gt_rat0 x : lt_rat 0 x = (0 < numq x).
Proof. by rewrite lt_ratE mul0r mulr1. Qed.
Lemma
gt_rat0
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "lt_rat", "lt_ratE", "mul0r", "mulr1", "numq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
lt_rat0 x : lt_rat x 0 = (numq x < 0).
Proof. by rewrite lt_ratE mul0r mulr1. Qed.
Lemma
lt_rat0
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "lt_rat", "lt_ratE", "mul0r", "mulr1", "numq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ge_rat0 x : le_rat 0 x = (0 <= numq x).
Proof. by rewrite le_ratE mul0r mulr1. Qed.
Lemma
ge_rat0
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "le_rat", "le_ratE", "mul0r", "mulr1", "numq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
le_rat0 x : le_rat x 0 = (numq x <= 0).
Proof. by rewrite le_ratE mul0r mulr1. Qed.
Lemma
le_rat0
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "le_rat", "le_ratE", "mul0r", "mulr1", "numq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
le_rat0D x y : le_rat 0 x -> le_rat 0 y -> le_rat 0 (x + y).
Proof. rewrite !ge_rat0 => hnx hny. have hxy: (0 <= numq x * denq y + numq y * denq x). by rewrite addr_ge0 ?mulr_ge0. rewrite [_ + _]addq_def /numq /= -!/(denq _) ?mulf_eq0 ?denq_eq0. rewrite val_fracq/=; case: ifP => //=. by rewrite ?addq_subdefE !mulr_ge0// !le_gtF ?mulr_ge0 ?denq_ge0//=. Qed.
Fact
le_rat0D
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "addq_def", "addq_subdefE", "addr_ge0", "denq", "denq_eq0", "denq_ge0", "ge_rat0", "le_gtF", "le_rat", "mulf_eq0", "mulr_ge0", "numq", "val_fracq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
le_rat0M x y : le_rat 0 x -> le_rat 0 y -> le_rat 0 (x * y).
Proof. rewrite !ge_rat0 => hnx hny. have hxy: (0 <= numq x * denq y + numq y * denq x). by rewrite addr_ge0 ?mulr_ge0. rewrite [_ * _]mulq_def /numq /= -!/(denq _) ?mulf_eq0 ?denq_eq0. rewrite val_fracq/=; case: ifP => //=. by rewrite ?mulq_subdefE !mulr_ge0// !le_gtF ?mulr_ge0 ?denq_ge0//=. Qed.
Fact
le_rat0M
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "addr_ge0", "denq", "denq_eq0", "denq_ge0", "ge_rat0", "le_gtF", "le_rat", "mulf_eq0", "mulq_def", "mulq_subdefE", "mulr_ge0", "numq", "val_fracq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
le_rat0_anti x : le_rat 0 x -> le_rat x 0 -> x = 0.
Proof. by move=> hx hy; apply/eqP; rewrite -numq_eq0 eq_le -ge_rat0 -le_rat0 hx hy. Qed.
Fact
le_rat0_anti
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "apply", "eq_le", "ge_rat0", "le_rat", "le_rat0", "numq_eq0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
sgr_numq_div (n d : int) : sgr (numq (n%:Q / d%:Q)) = sgr n * sgr d.
Proof. set x := (n, d); rewrite -[n]/x.1 -[d]/x.2 -fracqE. case: fracqP => [|k fx k_neq0] /=; first by rewrite mulr0. by rewrite !sgrM mulrACA -expr2 sqr_sg k_neq0 sgr_denq mulr1 mul1r. Qed.
Lemma
sgr_numq_div
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "expr2", "fracqE", "fracqP", "int", "mul1r", "mulr0", "mulr1", "mulrACA", "numq", "sgr", "sgrM", "sgr_denq", "sqr_sg" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
subq_ge0 x y : le_rat 0 (y - x) = le_rat x y.
Proof. symmetry; rewrite ge_rat0 !le_ratE -subr_ge0. case: ratP => nx dx cndx; case: ratP => ny dy cndy. rewrite -!mulNr addf_div ?intq_eq0 // !mulNr -!rmorphM -rmorphB /=. symmetry; rewrite !leNgt -sgr_cp0 sgr_numq_div mulrC gtr0_sg //. by rewrite mul1r sgr_cp0. Qed.
Fact
subq_ge0
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "addf_div", "ge_rat0", "gtr0_sg", "intq_eq0", "leNgt", "le_rat", "le_ratE", "mul1r", "mulNr", "mulrC", "ratP", "rmorphB", "rmorphM", "sgr_cp0", "sgr_numq_div", "subr_ge0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
le_rat_total : total le_rat.
Proof. by move=> x y; rewrite !le_ratE; apply: le_total. Qed.
Fact
le_rat_total
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "apply", "le_rat", "le_ratE", "le_total", "total" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
numq_sign_mul (b : bool) x : numq ((-1) ^+ b * x) = (-1) ^+ b * numq x.
Proof. by case: b; rewrite ?(mul1r, mulN1r) // numqN. Qed.
Fact
numq_sign_mul
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "mul1r", "mulN1r", "numq", "numqN" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
numq_div_lt0 n d : n != 0 -> d != 0 -> (numq (n%:~R / d%:~R) < 0)%R = (n < 0)%R (+) (d < 0)%R.
Proof. move=> n0 d0; rewrite -sgr_cp0 sgr_numq_div !sgr_def n0 d0. by rewrite !mulr1n -signr_addb; case: (_ (+) _). Qed.
Fact
numq_div_lt0
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "mulr1n", "numq", "sgr_cp0", "sgr_def", "sgr_numq_div", "signr_addb" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
normr_num_div n d : `|numq (n%:~R / d%:~R)| = numq (`|n|%:~R / `|d|%:~R).
Proof. rewrite (normrEsg n) (normrEsg d) !rmorphM /= invfM mulrACA !sgr_def. have [->|n_neq0] := eqVneq; first by rewrite mul0r mulr0. have [->|d_neq0] := eqVneq; first by rewrite invr0 !mulr0. rewrite !intr_sign invr_sign -signr_addb numq_sign_mul -numq_div_lt0 //. by apply: (canRL (signrMK _)); rewrite mulz_sign_abs....
Lemma
normr_num_div
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "apply", "eqVneq", "intr_sign", "invfM", "invr0", "invr_sign", "mul0r", "mulr0", "mulrACA", "mulz_sign_abs", "normrEsg", "numq", "numq_div_lt0", "numq_sign_mul", "rmorphM", "sgr_def", "signrMK", "signr_addb" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
norm_ratN x : normq (- x) = normq x.
Proof. by rewrite !normqE numqN denqN normrN. Qed.
Fact
norm_ratN
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "denqN", "normq", "normqE", "normrN", "numqN" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ge_rat0_norm x : le_rat 0 x -> normq x = x.
Proof. rewrite ge_rat0; case: ratP=> [] // n d cnd n_ge0. by rewrite normqE /= normr_num_div ?ger0_norm // divq_num_den. Qed.
Fact
ge_rat0_norm
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "divq_num_den", "ge_rat0", "ger0_norm", "le_rat", "normq", "normqE", "normr_num_div", "ratP" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
lt_rat_def x y : (lt_rat x y) = (y != x) && (le_rat x y).
Proof. by rewrite lt_ratE le_ratE lt_def rat_eq. Qed.
Fact
lt_rat_def
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "le_rat", "le_ratE", "lt_def", "lt_rat", "lt_ratE", "rat_eq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
numq_ge0 x : (0 <= numq x) = (0 <= x).
Proof. by case: ratP => n d cnd; rewrite ?pmulr_lge0 ?invr_gt0 (ler0z, ltr0z). Qed.
Lemma
numq_ge0
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "invr_gt0", "ler0z", "ltr0z", "numq", "pmulr_lge0", "ratP" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
numq_le0 x : (numq x <= 0) = (x <= 0).
Proof. by rewrite -oppr_ge0 -numqN numq_ge0 oppr_ge0. Qed.
Lemma
numq_le0
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "numq", "numqN", "numq_ge0", "oppr_ge0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
numq_gt0 x : (0 < numq x) = (0 < x).
Proof. by rewrite !ltNge numq_le0. Qed.
Lemma
numq_gt0
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "ltNge", "numq", "numq_le0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
numq_lt0 x : (numq x < 0) = (x < 0).
Proof. by rewrite !ltNge numq_ge0. Qed.
Lemma
numq_lt0
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "ltNge", "numq", "numq_ge0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
sgr_numq x : sgz (numq x) = sgz x.
Proof. apply/eqP; case: (sgzP x); rewrite sgz_cp0 ?(numq_gt0, numq_lt0) //. by move->. Qed.
Lemma
sgr_numq
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "apply", "numq", "numq_gt0", "numq_lt0", "sgz", "sgzP", "sgz_cp0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
denq_mulr_sign (b : bool) x : denq ((-1) ^+ b * x) = denq x.
Proof. by case: b; rewrite ?(mul1r, mulN1r) // denqN. Qed.
Lemma
denq_mulr_sign
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "denq", "denqN", "mul1r", "mulN1r" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
denq_norm x : denq `|x| = denq x.
Proof. by rewrite normrEsign denq_mulr_sign. Qed.
Lemma
denq_norm
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "denq", "denq_mulr_sign", "normrEsign" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
floor x : int
:= (numq x %/ denq x)%Z.
Definition
floor
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "denq", "int", "numq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ceil x : int
:= - (- numq x %/ denq x)%Z.
Definition
ceil
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "denq", "int", "numq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
truncn x : nat
:= if 0 <= x then (`|numq x| %/ `|denq x|)%N else 0%N.
Definition
truncn
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "denq", "nat", "numq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
is_int x
:= denq x == 1.
Let
is_int
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "denq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
is_nat x
:= (0 <= x) && (denq x == 1).
Let
is_nat
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "denq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
floorP x : if x \is Num.real then (floor x)%:~R <= x < (floor x + 1)%:~R else floor x == 0.
Proof. rewrite num_real /floor; case: (ratP x) => n d _ {x}; rewrite ler_pdivlMr//. by rewrite ltr_pdivrMr// -!intrM ler_int ltr_int lez_floor ?ltz_ceil. Qed.
Fact
floorP
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "floor", "intrM", "ler_int", "ler_pdivlMr", "lez_floor", "ltr_int", "ltr_pdivrMr", "ltz_ceil", "num_real", "ratP", "real" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ceilP x : ceil x = - floor (- x).
Proof. by rewrite /ceil /floor numqN denqN. Qed.
Fact
ceilP
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "ceil", "denqN", "floor", "numqN" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
truncnP x : truncn x = if floor x is Posz n then n else 0.
Proof. rewrite /truncn /floor; case: (ratP x) => n d _ {x} /=. by rewrite !ler_pdivlMr// mul0r; case: n => n; rewrite ler0z//= mul1n. Qed.
Fact
truncnP
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "Posz", "floor", "ler0z", "ler_pdivlMr", "mul0r", "mul1n", "ratP", "truncn" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
intrP x : reflect (exists n, x = n%:~R) (is_int x).
Proof. apply: (iffP idP) => [/eqP d1 | [i ->]]; [|by rewrite /is_int denq_int]. by exists (numq x); case: (ratP x) d1 => n d _ ->; rewrite divr1. Qed.
Fact
intrP
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "apply", "denq_int", "divr1", "is_int", "numq", "ratP" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
natrP x : reflect (exists n, x = n%:R) (is_nat x).
Proof. apply: (iffP idP) => [/andP[]/[swap]/intrP[i ->]|[n ->]]. by rewrite ler0z; case: i => [n _|//]; exists n. by rewrite /is_nat pmulrn ler0z denq_int. Qed.
Fact
natrP
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "apply", "denq_int", "intrP", "is_nat", "ler0z", "pmulrn" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
floorErat (x : rat) : Num.floor x = (numq x %/ denq x)%Z.
Proof. by []. Qed.
Lemma
floorErat
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "denq", "floor", "numq", "rat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ceilErat (x : rat) : Num.ceil x = - (- numq x %/ denq x)%Z.
Proof. by []. Qed.
Lemma
ceilErat
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "ceil", "denq", "numq", "rat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Qint_def (x : rat) : (x \is a Num.int) = (denq x == 1).
Proof. by []. Qed.
Lemma
Qint_def
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "denq", "int", "rat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
numqK : {in Num.int, cancel (fun x => numq x) intr}.
Proof. by move=> _ /intrP [x ->]; rewrite numq_int. Qed.
Lemma
numqK
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "int", "intr", "intrP", "numq", "numq_int" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
natq_div m n : (n %| m)%N -> (m %/ n)%:R = m%:R / n%:R :> rat.
Proof. exact/pchar0_natf_div/pchar_num. Qed.
Lemma
natq_div
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "pchar0_natf_div", "pchar_num", "rat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ratr x : R
:= (numq x)%:~R / (denq x)%:~R.
Definition
ratr
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "denq", "numq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ratr_int z : ratr z%:~R = z%:~R.
Proof. by rewrite /ratr numq_int denq_int divr1. Qed.
Lemma
ratr_int
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "denq_int", "divr1", "numq_int", "ratr" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ratr_nat n : ratr n%:R = n%:R.
Proof. exact: ratr_int n. Qed.
Lemma
ratr_nat
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "ratr", "ratr_int" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
rpred_rat (S : divringClosed R) a : ratr a \in S.
Proof. by rewrite rpred_div ?rpred_int. Qed.
Lemma
rpred_rat
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "ratr", "rpred_div", "rpred_int" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
fmorph_rat (aR : fieldType) rR (f : {rmorphism aR -> rR}) a : f (ratr _ a) = ratr _ a.
Proof. by rewrite fmorph_div !rmorph_int. Qed.
Lemma
fmorph_rat
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "fmorph_div", "ratr", "rmorph_int" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
fmorph_eq_rat rR (f : {rmorphism rat -> rR}) : f =1 ratr _.
Proof. by move=> a; rewrite -{1}[a]divq_num_den fmorph_div !rmorph_int. Qed.
Lemma
fmorph_eq_rat
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "divq_num_den", "fmorph_div", "rat", "ratr", "rmorph_int" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
rat_linear U V (f : U -> V) : zmod_morphism f -> scalable f.
Proof. move=> fB a u. pose aM := GRing.isZmodMorphism.Build U V f fB. pose phi : {additive U -> V} := HB.pack f aM. rewrite -[f]/(phi : _ -> _) -{2}[a]divq_num_den mulrC -scalerA. apply: canRL (scalerK _) _; first by rewrite intr_eq0 denq_neq0. rewrite 2!scaler_int -3!raddfMz /=. by rewrite -scalerMzr scalerMzl -mulrzr...
Lemma
rat_linear
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "Build", "additive", "apply", "denq_neq0", "divq_num_den", "intr_eq0", "mulrC", "mulrzr", "numqE", "raddfMz", "scalable", "scalerA", "scalerK", "scalerMzl", "scalerMzr", "scaler_int", "zmod_morphism" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ratr_is_zmod_morphism : zmod_morphism (@ratr F).
Proof. have injZtoQ: @injective rat int intr by apply: intr_inj. have nz_den x: (denq x)%:~R != 0 :> F by rewrite intr_eq0 denq_eq0. move=> x y. apply: (canLR (mulfK (nz_den _))); apply: (mulIf (nz_den x)). rewrite mulrAC mulrBl divfK ?nz_den // mulrAC -!rmorphM. apply: (mulIf (nz_den y)); rewrite mulrAC mulrBl divfK ?...
Fact
ratr_is_zmod_morphism
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "apply", "denq", "denq_eq0", "divfK", "int", "intr", "intr_eq0", "intr_inj", "mulIf", "mulfK", "mulrA", "mulrAC", "mulrBl", "numqE", "rat", "ratr", "rmorphB", "rmorphM", "zmod_morphism" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ratr_is_additive
:= ratr_is_zmod_morphism.
Definition
ratr_is_additive
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "ratr_is_zmod_morphism" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ratr_is_monoid_morphism : monoid_morphism (@ratr F).
Proof. have injZtoQ: @injective rat int intr by apply: intr_inj. have nz_den x: (denq x)%:~R != 0 :> F by rewrite intr_eq0 denq_eq0. split=> [|x y]; first by rewrite /ratr divr1. rewrite /ratr mulrC mulrAC; apply: canLR (mulKf (nz_den _)) _; rewrite !mulrA. do 2!apply: canRL (mulfK (nz_den _)) _; rewrite -!rmorphM; con...
Fact
ratr_is_monoid_morphism
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "apply", "denq", "denq_eq0", "divr1", "int", "intr", "intr_eq0", "intr_inj", "monoid_morphism", "mulKf", "mulfK", "mulrA", "mulrAC", "mulrC", "mulrCA", "numqE", "rat", "ratr", "rmorphM", "split" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ratr_is_multiplicative
:= (fun g => (g.2,g.1)) ratr_is_monoid_morphism.
Definition
ratr_is_multiplicative
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "ratr_is_monoid_morphism" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ler_rat : {mono (@ratr F) : x y / x <= y}.
Proof. move=> x y /=; case: (ratP x) => nx dx cndx; case: (ratP y) => ny dy cndy. rewrite !fmorph_div /= !ratr_int !ler_pdivlMr ?ltr0z //. by rewrite ![_ / _ * _]mulrAC !ler_pdivrMr ?ltr0z // -!rmorphM /= !ler_int. Qed.
Lemma
ler_rat
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "fmorph_div", "ler_int", "ler_pdivlMr", "ler_pdivrMr", "ltr0z", "mulrAC", "ratP", "ratr", "ratr_int", "rmorphM" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ltr_rat : {mono (@ratr F) : x y / x < y}.
Proof. exact: leW_mono ler_rat. Qed.
Lemma
ltr_rat
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "leW_mono", "ler_rat", "ratr" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ler0q x : (0 <= ratr F x) = (0 <= x).
Proof. by rewrite (_ : 0 = ratr F 0) ?ler_rat ?rmorph0. Qed.
Lemma
ler0q
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "ler_rat", "ratr", "rmorph0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
lerq0 x : (ratr F x <= 0) = (x <= 0).
Proof. by rewrite (_ : 0 = ratr F 0) ?ler_rat ?rmorph0. Qed.
Lemma
lerq0
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "ler_rat", "ratr", "rmorph0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ltr0q x : (0 < ratr F x) = (0 < x).
Proof. by rewrite (_ : 0 = ratr F 0) ?ltr_rat ?rmorph0. Qed.
Lemma
ltr0q
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "ltr_rat", "ratr", "rmorph0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ltrq0 x : (ratr F x < 0) = (x < 0).
Proof. by rewrite (_ : 0 = ratr F 0) ?ltr_rat ?rmorph0. Qed.
Lemma
ltrq0
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "ltr_rat", "ratr", "rmorph0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ratr_sg x : ratr F (sgr x) = sgr (ratr F x).
Proof. by rewrite !sgr_def fmorph_eq0 ltrq0 rmorphMn /= rmorph_sign. Qed.
Lemma
ratr_sg
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "fmorph_eq0", "ltrq0", "ratr", "rmorphMn", "rmorph_sign", "sgr", "sgr_def" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ratr_norm x : ratr F `|x| = `|ratr F x|.
Proof. by rewrite {2}[x]numEsign rmorphMsign normrMsign [`|ratr F _|]ger0_norm ?ler0q. Qed.
Lemma
ratr_norm
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "ger0_norm", "ler0q", "normrMsign", "numEsign", "ratr", "rmorphMsign" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
minr_rat : {morph ratr F : x y / Num.min x y}.
Proof. by move=> x y; rewrite !minEle ler_rat; case: leP. Qed.
Lemma
minr_rat
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "leP", "ler_rat", "min", "minEle", "ratr" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
maxr_rat : {morph ratr F : x y / Num.max x y}.
Proof. by move=> x y; rewrite !maxEle ler_rat; case: leP. Qed.
Lemma
maxr_rat
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "leP", "ler_rat", "max", "maxEle", "ratr" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
floor_rat : {mono (@ratr F) : x / Num.floor x}.
Proof. move=> x; apply: floor_def; apply/andP; split. - by rewrite -ratr_int ler_rat floor_le. - by rewrite -ratr_int ltr_rat floorD1_gt. Qed.
Lemma
floor_rat
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "apply", "floor", "floorD1_gt", "floor_def", "floor_le", "ler_rat", "ltr_rat", "ratr", "ratr_int", "split" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ceil_rat : {mono (@ratr F) : x / Num.ceil x}.
Proof. by move=> x; rewrite !ceilNfloor -rmorphN floor_rat. Qed.
Lemma
ceil_rat
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "ceil", "ceilNfloor", "floor_rat", "ratr", "rmorphN" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Qint_dvdz (m d : int) : (d %| m)%Z -> (m%:~R / d%:~R : rat) \is a Num.int.
Proof. case/dvdzP=> z ->; rewrite rmorphM /=; have [->|dn0] := eqVneq d 0. by rewrite mulr0 mul0r. by rewrite mulfK ?intr_eq0. Qed.
Lemma
Qint_dvdz
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "dvdzP", "eqVneq", "int", "intr_eq0", "mul0r", "mulfK", "mulr0", "rat", "rmorphM" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
Qnat_dvd (m d : nat) : (d %| m)%N -> (m%:R / d%:R : rat) \is a Num.nat.
Proof. by move=> h; rewrite natrEint divr_ge0 ?ler0n // !pmulrn Qint_dvdz. Qed.
Lemma
Qnat_dvd
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "Qint_dvdz", "divr_ge0", "ler0n", "nat", "natrEint", "pmulrn", "rat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pZtoQ
:= (map_poly (intr : int -> rat)).
Notation
pZtoQ
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "int", "intr", "map_poly", "rat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
size_rat_int_poly p : size (pZtoQ p) = size p.
Proof. by apply: size_map_inj_poly; first apply: intr_inj. Qed.
Lemma
size_rat_int_poly
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "apply", "intr_inj", "pZtoQ", "size", "size_map_inj_poly" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
rat_poly_scale (p : {poly rat}) : {q : {poly int} & {a | a != 0 & p = a%:~R^-1 *: pZtoQ q}}.
Proof. pose a := \prod_(i < size p) denq p`_i. have nz_a: a != 0 by apply/prodf_neq0=> i _; apply: denq_neq0. exists (map_poly numq (a%:~R *: p)), a => //. apply: canRL (scalerK _) _; rewrite ?intr_eq0 //. apply/polyP=> i; rewrite !(coefZ, coef_map_id0) // numqK // Qint_def mulrC. have [ltip | /(nth_default 0)->] := lt...
Lemma
rat_poly_scale
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "Qint_def", "apply", "bigD1", "coefZ", "coef_map_id0", "denq", "denq_int", "denq_neq0", "int", "intr_eq0", "last", "ltnP", "map_poly", "mul0r", "mulrA", "mulrC", "nth_default", "numq", "numqE", "numqK", "pZtoQ", "poly", "polyP", "prodf_neq0", "rat", "rmorphM", "sc...
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
dvdp_rat_int p q : (pZtoQ p %| pZtoQ q) = (p %| q).
Proof. apply/dvdpP/Pdiv.Idomain.dvdpP=> [[/= r1 Dq] | [[/= a r] nz_a Dq]]; last first. exists (a%:~R^-1 *: pZtoQ r). by rewrite -scalerAl -rmorphM -Dq /= linearZ/= scalerK ?intr_eq0. have [r [a nz_a Dr1]] := rat_poly_scale r1; exists (a, r) => //=. apply: (map_inj_poly _ _ : injective pZtoQ) => //; first exact: int...
Lemma
dvdp_rat_int
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "apply", "dvdpP", "intr_eq0", "intr_inj", "last", "linearZ", "map_inj_poly", "pZtoQ", "r1", "rat_poly_scale", "rmorphM", "scalerAl", "scalerK", "scalerKV" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
dvdpP_rat_int p q : p %| pZtoQ q -> {p1 : {poly int} & {a | a != 0 & p = a *: pZtoQ p1} & {r | q = p1 * r}}.
Proof. have{p} [p [a nz_a ->]] := rat_poly_scale p. rewrite dvdpZl ?invr_eq0 ?intr_eq0 // dvdp_rat_int => dv_p_q. exists (zprimitive p); last exact: dvdpP_int. have [-> | nz_p] := eqVneq p 0. by exists 1; rewrite ?oner_eq0 // zprimitive0 map_poly0 !scaler0. exists ((zcontents p)%:~R / a%:~R). by rewrite mulf_neq0 ?...
Lemma
dvdpP_rat_int
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "dvdpP_int", "dvdpZl", "dvdp_rat_int", "eqVneq", "int", "intr_eq0", "invr_eq0", "last", "map_poly0", "map_polyZ", "mulf_neq0", "mulrC", "nz_p", "oner_eq0", "pZtoQ", "poly", "rat_poly_scale", "scaler0", "scalerA", "zcontents", "zcontents_eq0", "zpolyEprim", "zprimitive", ...
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
irreducible_rat_int p : irreducible_poly (pZtoQ p) <-> irreducible_poly p.
Proof. rewrite /irreducible_poly size_rat_int_poly; split=> -[] p1 p_irr; split=> //. move=> q q1; rewrite /eqp -!dvdp_rat_int => rq. by apply/p_irr => //; rewrite size_rat_int_poly. move=> q + /dvdpP_rat_int [] r [] c c0 qE [] s sE. rewrite qE size_scale// size_rat_int_poly => r1. apply/(eqp_trans (eqp_scale _ c0)...
Lemma
irreducible_rat_int
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "apply", "c0", "dvdpP_rat_int", "dvdp_mulIl", "dvdp_rat_int", "eqp", "eqp_scale", "eqp_trans", "irreducible_poly", "pZtoQ", "r1", "size_rat_int_poly", "size_scale", "split" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
inIntSpan (V : zmodType) m (s : m.-tuple V) v
:= exists a : int ^ m, v = \sum_(i < m) s`_i *~ a i.
Definition
inIntSpan
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "int", "tuple" ]
Integral spans.
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
solve_Qint_span (vT : vectType rat) m (s : m.-tuple vT) v : {b : int ^ m & {p : seq (int ^ m) & forall a : int ^ m, v = \sum_(i < m) s`_i *~ a i <-> exists c : seq int, a = b + \sum_(i < size p) p`_i *~ c`_i}} + (~ inIntSpan s v).
Proof. have s_s (i : 'I_m): s`_i \in <<s>>%VS by rewrite memv_span ?memt_nth. have s_Zs a: \sum_(i < m) s`_i *~ a i \in <<s>>%VS. by apply/rpred_sum => i _; apply/rpredMz. case s_v: (v \in <<s>>%VS); last by right=> [[a Dv]]; rewrite Dv s_Zs in s_v. move SE : (\matrix_(i < m, j < _) coord (vbasis <<s>>) j s`_i) => S....
Lemma
solve_Qint_span
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "add0r", "addKr", "addNKr", "addr0", "addrI", "apply", "basis_free", "big1", "bigD1", "big_split", "block_mxKul", "card_ord", "castmx", "const_mx", "coord", "coord_free", "coord_span", "coord_vbasis", "denq", "denq_int", "denq_neq0", "dsubmx", "eq_bigr", "eq_row_base", ...
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
dec_Qint_span (vT : vectType rat) m (s : m.-tuple vT) v : decidable (inIntSpan s v).
Proof. have [[b [p aP]]|] := solve_Qint_span s v; last by right. left; exists b; apply/(aP b); exists [::]; rewrite big1 ?addr0 // => i _. by rewrite nth_nil mulr0z. Qed.
Lemma
dec_Qint_span
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "aP", "addr0", "apply", "big1", "decidable", "inIntSpan", "last", "mulr0z", "nth_nil", "rat", "solve_Qint_span", "tuple", "vT" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
eisenstein_crit (p : nat) (q : {poly int}) : prime p -> (size q != 1)%N -> ~~ (p %| lead_coef q)%Z -> ~~ (p ^+ 2 %| q`_0)%Z -> (forall i, (i < (size q).-1)%N -> p %| q`_i)%Z -> irreducible_poly q.
Proof. move=> p_prime qN1 Ndvd_pql Ndvd_pq0 dvd_pq. apply/irreducible_rat_int. have qN0 : q != 0 by rewrite -lead_coef_eq0; apply: contraNneq Ndvd_pql => ->. split. rewrite size_map_poly_id0 ?intr_eq0 ?lead_coef_eq0//. by rewrite ltn_neqAle eq_sym qN1 size_poly_gt0. move=> f' +/dvdpP_rat_int[f [d dN0 feq]]; rewrite...
Lemma
eisenstein_crit
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "apply", "big_ord1", "coefM", "coefXn", "coefZ", "coef_map", "coef_poly", "contraNneq", "contra_neq", "dvdpP_rat_int", "dvdp_exp_XsubCP", "dvdp_mull", "dvdp_mulr", "dvdz_mul", "dvdz_pcharf", "eqVneq", "eq_from_nth", "eq_sym", "eqpP", "eqp_dvdr", "eqp_scale", "eqp_sym", "e...
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
rat_to_ring
:= rewrite -?[0%Q]/(0 : rat)%R -?[1%Q]/(1 : rat)%R -?[(_ - _)%Q]/(_ - _ : rat)%R -?[(_ / _)%Q]/(_ / _ : rat)%R -?[(_ + _)%Q]/(_ + _ : rat)%R -?[(_ * _)%Q]/(_ * _ : rat)%R -?[(- _)%Q]/(- _ : rat)%R -?[(_ ^-1)%Q]/(_ ^-1 : rat)%R /=.
Ltac
rat_to_ring
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "rat" ]
Connecting rationals to the ring and field tactics
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ring_to_rat
:= rewrite -?[0%R]/0%Q -?[1%R]/1%Q -?[(_ - _)%R]/(_ - _)%Q -?[(_ / _)%R]/(_ / _)%Q -?[(_ + _)%R]/(_ + _)%Q -?[(_ * _)%R]/(_ * _)%Q -?[(- _)%R]/(- _)%Q -?[(_ ^-1)%R]/(_ ^-1)%Q /=.
Ltac
ring_to_rat
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"[ 'rat' x // y ]"
:= (@Rat (x, y) _) (only printing) : ring_scope.
Notation
[ 'rat' x // y ]
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[]
Pretty printing or normal element of rat.
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"[ 'rat' x // y ]"
:= (@Rat (x : int, y : int) (fracq_subproof (x : int, y : int))) : ring_scope.
Notation
[ 'rat' x // y ]
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "fracq_subproof", "int" ]
For debugging purposes we provide the parsable version
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
rat_vm_compute n (x : rat) : vm_compute_eq n%:Q x -> n%:Q = x.
Proof. exact. Qed.
Lemma
rat_vm_compute
algebra
algebra/rat.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "div", "choice", "fintype", "tuple", "finfun", "bigop", "prime", "nmodule", "order", "rings_modules_and_algebras", "divalg", "countalg", "poly", "polydiv", "zmodp", "matrix", ...
[ "rat" ]
A specialization of vm_compute rewrite rule for pattern _%:Q
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pi_zero_quot_morph zqT
:= PiMorph (@pi_zeror _ _ _ _ _ zqT).
Canonical
pi_zero_quot_morph
algebra
algebra/ring_quotient.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "choice", "ssrnat", "seq", "generic_quotient", "nmodule", "rings_modules_and_algebras", "divalg", "GRing.Theory", "Quotient.Exports" ]
[ "PiMorph" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pi_opp_quot_morph zqT
:= PiMorph1 (@pi_oppr _ _ _ _ _ zqT).
Canonical
pi_opp_quot_morph
algebra
algebra/ring_quotient.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "choice", "ssrnat", "seq", "generic_quotient", "nmodule", "rings_modules_and_algebras", "divalg", "GRing.Theory", "Quotient.Exports" ]
[ "PiMorph1" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pi_add_quot_morph zqT
:= PiMorph2 (@pi_addr _ _ _ _ _ zqT).
Canonical
pi_add_quot_morph
algebra
algebra/ring_quotient.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "choice", "ssrnat", "seq", "generic_quotient", "nmodule", "rings_modules_and_algebras", "divalg", "GRing.Theory", "Quotient.Exports" ]
[ "PiMorph2" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pi_is_zmod_morphism : zmod_morphism \pi_Q.
Proof. by move=> x y /=; rewrite !piE. Qed.
Lemma
pi_is_zmod_morphism
algebra
algebra/ring_quotient.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "choice", "ssrnat", "seq", "generic_quotient", "nmodule", "rings_modules_and_algebras", "divalg", "GRing.Theory", "Quotient.Exports" ]
[ "piE", "zmod_morphism" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d