fact
stringlengths
8
1.54k
type
stringclasses
19 values
library
stringclasses
8 values
imports
listlengths
1
10
filename
stringclasses
98 values
symbolic_name
stringlengths
1
42
docstring
stringclasses
1 value
sgr_numqx : sgz (numq x) = sgz x. Proof. apply/eqP; case: (sgzP x); rewrite sgz_cp0 ?(numq_gt0, numq_lt0) //. by move->. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
sgr_numq
denq_mulr_sign(b : bool) x : denq ((-1) ^+ b * x) = denq x. Proof. by case: b; rewrite ?(mul1r, mulN1r) // denqN. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
denq_mulr_sign
denq_normx : denq `|x| = denq x. Proof. by rewrite normrEsign denq_mulr_sign. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
denq_norm
floorx : int := (numq x %/ denq x)%Z.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
floor
ceilx : int := - (- numq x %/ denq x)%Z.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
ceil
truncnx : nat := if 0 <= x then (`|numq x| %/ `|denq x|)%N else 0%N. Let is_int x := denq x == 1. Let is_nat x := (0 <= x) && (denq x == 1). Fact 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 ceilP x : ceil x = - floor (- x). Proof. by rewrite /ceil /floor numqN denqN. Qed. Fact 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 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 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.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
truncn
Definition_ := Num.NumDomain_hasFloorCeilTruncn.Build rat ratArchimedean.floorP ratArchimedean.ceilP ratArchimedean.truncnP ratArchimedean.intrP ratArchimedean.natrP.
HB.instance
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
Definition
floorErat(x : rat) : Num.floor x = (numq x %/ denq x)%Z. Proof. by []. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
floorErat
ceilErat(x : rat) : Num.ceil x = - (- numq x %/ denq x)%Z. Proof. by []. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
ceilErat
Qint_def(x : rat) : (x \is a Num.int) = (denq x == 1). Proof. by []. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
Qint_def
numqK: {in Num.int, cancel (fun x => numq x) intr}. Proof. by move=> _ /intrP [x ->]; rewrite numq_int. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
numqK
natq_divm n : (n %| m)%N -> (m %/ n)%:R = m%:R / n%:R :> rat. Proof. exact/pchar0_natf_div/pchar_num. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
natq_div
ratrx : R := (numq x)%:~R / (denq x)%:~R.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
ratr
ratr_intz : ratr z%:~R = z%:~R. Proof. by rewrite /ratr numq_int denq_int divr1. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
ratr_int
ratr_natn : ratr n%:R = n%:R. Proof. exact: ratr_int n. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
ratr_nat
rpred_rat(S : divringClosed R) a : ratr a \in S. Proof. by rewrite rpred_div ?rpred_int. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
rpred_rat
fmorph_rat(aR : fieldType) rR (f : {rmorphism aR -> rR}) a : f (ratr _ a) = ratr _ a. Proof. by rewrite fmorph_div !rmorph_int. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
fmorph_rat
fmorph_eq_ratrR (f : {rmorphism rat -> rR}) : f =1 ratr _. Proof. by move=> a; rewrite -{1}[a]divq_num_den fmorph_div !rmorph_int. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
fmorph_eq_rat
rat_linearU 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 -numqE scaler_int. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
rat_linear
ratr_is_additive:= ratr_is_zmod_morphism. Fact 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; congr _%:~R. apply: injZtoQ; rewrite !rmorphM [x * y]lock /= !numqE -lock. by rewrite -!mulrA mulrA mulrCA -!mulrA (mulrCA y). Qed. #[warning="-deprecated-since-mathcomp-2.5.0", deprecated(since="mathcomp 2.5.0", note="use `ratr_is_monoid_morphism` instead")]
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
ratr_is_additive
ratr_is_multiplicative:= (fun g => (g.2,g.1)) ratr_is_monoid_morphism. HB.instance Definition _ := GRing.isZmodMorphism.Build rat F (@ratr F) ratr_is_zmod_morphism. HB.instance Definition _ := GRing.isMonoidMorphism.Build rat F (@ratr F) ratr_is_monoid_morphism.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
ratr_is_multiplicative
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
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
ler_rat
ltr_rat: {mono (@ratr F) : x y / x < y}. Proof. exact: leW_mono ler_rat. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
ltr_rat
ler0qx : (0 <= ratr F x) = (0 <= x). Proof. by rewrite (_ : 0 = ratr F 0) ?ler_rat ?rmorph0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
ler0q
lerq0x : (ratr F x <= 0) = (x <= 0). Proof. by rewrite (_ : 0 = ratr F 0) ?ler_rat ?rmorph0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
lerq0
ltr0qx : (0 < ratr F x) = (0 < x). Proof. by rewrite (_ : 0 = ratr F 0) ?ltr_rat ?rmorph0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
ltr0q
ltrq0x : (ratr F x < 0) = (x < 0). Proof. by rewrite (_ : 0 = ratr F 0) ?ltr_rat ?rmorph0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
ltrq0
ratr_sgx : ratr F (sgr x) = sgr (ratr F x). Proof. by rewrite !sgr_def fmorph_eq0 ltrq0 rmorphMn /= rmorph_sign. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
ratr_sg
ratr_normx : ratr F `|x| = `|ratr F x|. Proof. by rewrite {2}[x]numEsign rmorphMsign normrMsign [`|ratr F _|]ger0_norm ?ler0q. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
ratr_norm
minr_rat: {morph ratr F : x y / Num.min x y}. Proof. by move=> x y; rewrite !minEle ler_rat; case: leP. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
minr_rat
maxr_rat: {morph ratr F : x y / Num.max x y}. Proof. by move=> x y; rewrite !maxEle ler_rat; case: leP. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
maxr_rat
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
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
floor_rat
ceil_rat: {mono (@ratr F) : x / Num.ceil x}. Proof. by move=> x; rewrite !ceilNfloor -rmorphN floor_rat. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
ceil_rat
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
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
Qint_dvdz
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
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
Qnat_dvd
size_rat_int_polyp : size (pZtoQ p) = size p. Proof. by apply: size_map_inj_poly; first apply: intr_inj. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
size_rat_int_poly
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)->] := ltnP i (size p); last by rewrite mul0r. by rewrite [a](bigD1 (Ordinal ltip)) // rmorphM mulrA -numqE -rmorphM denq_int. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
rat_poly_scale
dvdp_rat_intp 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: intr_inj. by rewrite linearZ /= Dq Dr1 -scalerAl -rmorphM scalerKV ?intr_eq0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
dvdp_rat_int
dvdpP_rat_intp 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 ?invr_eq0 ?intr_eq0 ?zcontents_eq0. by rewrite mulrC -scalerA -map_polyZ -zpolyEprim. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
dvdpP_rat_int
irreducible_rat_intp : 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)). rewrite /eqp !dvdp_rat_int; apply/p_irr => //. by rewrite sE dvdp_mulIl. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
irreducible_rat_int
inIntSpan(V : zmodType) m (s : m.-tuple V) v := exists a : int ^ m, v = \sum_(i < m) s`_i *~ a i.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
inIntSpan
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. move rE : (\rank S) => r; move kE : (m - r)%N => k. have Dm: (m = k + r)%N by rewrite -kE -rE subnK ?rank_leq_row. rewrite Dm in s s_s s_Zs s_v S SE rE kE *. move=> {Dm m}; pose m := (k + r)%N. have [K kerK]: {K : 'M_(k, m) | map_mx intr K == kermx S}%MS. move: (mxrank_ker S); rewrite rE kE => krk. pose B := row_base (kermx S); pose d := \prod_ij denq (B ij.1 ij.2). exists (castmx (krk, erefl m) (map_mx numq (intr d *: B))). rewrite map_castmx !eqmx_cast -map_mx_comp map_mx_id_in => [|i j]; last first. rewrite mxE mulrC [d](bigD1 (i, j)) //= rmorphM mulrA. by rewrite -numqE -rmorphM numq_int. suff nz_d: d%:Q != 0 by rewrite !eqmx_scale // !eq_row_base andbb. by rewrite intr_eq0; apply/prodf_neq0 => i _; apply: denq_neq0. have [L _ [G uG [D _ defK]]] := int_Smith_normal_form K. have {K L D defK kerK} [kerGu kerS_sub_Gu]: map_mx intr (usubmx G) *m S = 0 /\ (kermx S <= map_mx intr (usubmx G))%MS. pose Kl : 'M[rat]_k ...
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
solve_Qint_span
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
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
dec_Qint_span
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 {f'}feq size_scale// => fN1. move=> /= [g q_eq]; rewrite q_eq (eqp_trans (eqp_scale _ _))//. have fN0 : f != 0 by apply: contra_neq qN0; rewrite q_eq => ->; rewrite mul0r. have gN0 : g != 0 by apply: contra_neq qN0; rewrite q_eq => ->; rewrite mulr0. rewrite size_map_poly_id0 ?intr_eq0 ?lead_coef_eq0// in fN1. have [/eqP/size_poly1P[c cN0 ->]|gN1] := eqVneq (size g) 1%N. by rewrite mulrC mul_polyC map_polyZ/= eqp_sym eqp_scale// intr_eq0. have c_neq0 : (lead_coef q)%:~R != 0 :> 'F_p by rewrite -(dvdz_pcharf (pchar_Fp _)). have : map_poly (intr : int -> 'F_p) q = (lead_coef q)%:~R *: 'X^((size q).-1). apply/val_inj/(@eq_from_nth _ 0) => [|i]; rewrite size_map_poly_id0//. by rewrite size_scale// size_polyXn -polySpred. move=> i_small; rewrite coef_poly i_small coefZ coefXn lead_coefE. move: i_small; rewrite polySpred// ltnS/=. case: ltngtP => // [i_lt|->]; rewrite (mulr1, mulr0)//= => _. by apply/eqP; rewrite -(dvdz_pcharf (pchar_Fp _))// dvd_pq. rewrite [in LH ...
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
eisenstein_crit
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
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
rat_to_ring
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
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
ring_to_rat
rat_vm_computen (x : rat) : vm_compute_eq n%:Q x -> n%:Q = x. Proof. exact. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import prime fintype finfun bigop order tuple ssralg", "From mathcomp Require Import countalg div ssrnum ssrint archimedean poly zmodp", "From mathcomp Require Import polydiv intdiv matrix mxalgebra vector" ]
algebra/rat.v
rat_vm_compute
RecordisZmodQuotient T eqT (zeroT : T) (oppT : T -> T) (addT : T -> T -> T) (Q : Type) of GRing.Zmodule Q & EqQuotient T eqT Q := { pi_zeror : \pi_Q zeroT = 0; pi_oppr : {morph \pi_Q : x / oppT x >-> - x}; pi_addr : {morph \pi_Q : x y / addT x y >-> x + y} }. #[short(type="zmodQuotType")] HB.structure Definition ZmodQuotient T eqT zeroT oppT addT := {Q of isZmodQuotient T eqT zeroT oppT addT Q & GRing.Zmodule Q & EqQuotient T eqT Q}.
HB.mixin
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
Record
pi_zero_quot_morphzqT := PiMorph (@pi_zeror _ _ _ _ _ zqT).
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
pi_zero_quot_morph
pi_opp_quot_morphzqT := PiMorph1 (@pi_oppr _ _ _ _ _ zqT).
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
pi_opp_quot_morph
pi_add_quot_morphzqT := PiMorph2 (@pi_addr _ _ _ _ _ zqT).
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
pi_add_quot_morph
pi_is_zmod_morphism: zmod_morphism \pi_Q. Proof. by move=> x y /=; rewrite !piE. Qed. #[warning="-deprecated-since-mathcomp-2.5.0", deprecated(since="mathcomp 2.5.0", note="use `pi_is_monoid_morphism` instead")]
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
pi_is_zmod_morphism
pi_is_additive:= pi_is_zmod_morphism. HB.instance Definition _ := GRing.isZmodMorphism.Build V Q \pi_Q pi_is_zmod_morphism.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
pi_is_additive
RecordisNzRingQuotient T eqT zeroT oppT addT (oneT : T) (mulT : T -> T -> T) (Q : Type) of ZmodQuotient T eqT zeroT oppT addT Q & GRing.NzRing Q:= { pi_oner : \pi_Q oneT = 1; pi_mulr : {morph \pi_Q : x y / mulT x y >-> x * y} }.
HB.mixin
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
Record
BuildT eqT zeroT oppT addT oneT mulT Q := (isNzRingQuotient.Build T eqT zeroT oppT addT oneT mulT Q) (only parsing).
Notation
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
Build
isRingQuotientT eqT zeroT oppT addT oneT mulT Q := (isNzRingQuotient T eqT zeroT oppT addT oneT mulT Q) (only parsing). #[short(type="nzRingQuotType")] HB.structure Definition NzRingQuotient T eqT zeroT oppT addT oneT mulT := {Q of isNzRingQuotient T eqT zeroT oppT addT oneT mulT Q & ZmodQuotient T eqT zeroT oppT addT Q & GRing.NzRing Q }. #[deprecated(since="mathcomp 2.4.0", note="Use nzRingQuotType instead.")]
Notation
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
isRingQuotient
ringQuotType:= (nzRingQuotType) (only parsing).
Notation
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
ringQuotType
pi_one_quot_morphrqT := PiMorph (@pi_oner _ _ _ _ _ _ _ rqT).
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
pi_one_quot_morph
pi_mul_quot_morphrqT := PiMorph2 (@pi_mulr _ _ _ _ _ _ _ rqT).
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
pi_mul_quot_morph
pi_is_monoid_morphism: monoid_morphism \pi_Q. Proof. by split; do ?move=> x y /=; rewrite !piE. Qed. #[warning="-deprecated-since-mathcomp-2.5.0", deprecated(since="mathcomp 2.5.0", note="use `pi_is_monoid_morphism` instead")]
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
pi_is_monoid_morphism
pi_is_multiplicative:= (fun g => (g.2,g.1)) pi_is_monoid_morphism. HB.instance Definition _ := GRing.isMonoidMorphism.Build R Q \pi_Q pi_is_monoid_morphism.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
pi_is_multiplicative
RecordisUnitRingQuotient T eqT zeroT oppT addT oneT mulT (unitT : pred T) (invT : T -> T) (Q : Type) of NzRingQuotient T eqT zeroT oppT addT oneT mulT Q & GRing.UnitRing Q := { pi_unitr : {mono \pi_Q : x / unitT x >-> x \in GRing.unit}; pi_invr : {morph \pi_Q : x / invT x >-> x^-1} }. #[short(type="unitRingQuotType")] HB.structure Definition UnitRingQuotient T eqT zeroT oppT addT oneT mulT unitT invT := {Q of isUnitRingQuotient T eqT zeroT oppT addT oneT mulT unitT invT Q & GRing.UnitRing Q & isQuotient T Q & isEqQuotient T eqT Q & isZmodQuotient T eqT zeroT oppT addT Q & isNzRingQuotient T eqT zeroT oppT addT oneT mulT Q}.
HB.mixin
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
Record
pi_unit_quot_morphurqT := PiMono1 (@pi_unitr _ _ _ _ _ _ _ _ _ urqT).
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
pi_unit_quot_morph
pi_inv_quot_morphurqT := PiMorph1 (@pi_invr _ _ _ _ _ _ _ _ _ urqT).
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
pi_inv_quot_morph
proper_ideal(R : nzRingType) (S : {pred R}) : Prop := 1 \notin S /\ forall a, {in S, forall u, a * u \in S}.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
proper_ideal
prime_idealr_closed(R : nzRingType) (S : {pred R}) : Prop := forall u v, u * v \in S -> (u \in S) || (v \in S).
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
prime_idealr_closed
idealr_closed(R : nzRingType) (S : {pred R}) := [/\ 0 \in S, 1 \notin S & forall a, {in S &, forall u v, a * u + v \in S}].
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
idealr_closed
idealr_closed_nontrivialR S : @idealr_closed R S -> proper_ideal S. Proof. by case=> S0 S1 hS; split => // a x xS; rewrite -[_ * _]addr0 hS. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
idealr_closed_nontrivial
idealr_closedBR S : @idealr_closed R S -> zmod_closed S. Proof. by case=> S0 _ hS; split=> // x y xS yS; rewrite -mulN1r addrC hS. Qed. HB.mixin Record isProperIdeal (R : nzRingType) (S : R -> bool) := { proper_ideal_subproof : proper_ideal S }. #[short(type="proper_ideal")] HB.structure Definition ProperIdeal R := {S of isProperIdeal R S}. #[short(type="idealr")] HB.structure Definition Idealr (R : nzRingType) := {S of GRing.ZmodClosed R S & ProperIdeal R S}. HB.mixin Record isPrimeIdealrClosed (R : nzRingType) (S : R -> bool) := { prime_idealr_closed_subproof : prime_idealr_closed S }. #[short(type="prime_idealr")] HB.structure Definition PrimeIdealr (R : nzRingType) := {S of Idealr R S & isPrimeIdealrClosed R S}. HB.factory Record isIdealr (R : nzRingType) (S : R -> bool) := { idealr_closed_subproof : idealr_closed S }. HB.builders Context R S of isIdealr R S. HB.instance Definition _ := GRing.isZmodClosed.Build R S (idealr_closedB idealr_closed_subproof). HB.instance Definition _ := isProperIdeal.Build R S (idealr_closed_nontrivial idealr_closed_subproof). HB.end.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
idealr_closedB
idealr1: 1 \in I = false. Proof. apply: negPf; exact: proper_ideal_subproof.1. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
idealr1
idealMra u : u \in I -> a * u \in I. Proof. exact: proper_ideal_subproof.2. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
idealMr
idealr0: 0 \in I. Proof. exact: rpred0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
idealr0
prime_idealrMu v : (u * v \in I) = (u \in I) || (v \in I). Proof. apply/idP/idP; last by case/orP => /idealMr hI; rewrite // mulrC. exact: prime_idealr_closed_subproof. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
prime_idealrM
equiv(x y : R) := (x - y) \in I.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
equiv
equivEx y : (equiv x y) = (x - y \in I). Proof. by []. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
equivE
equiv_is_equiv: equiv_class_of equiv. Proof. split=> [x|x y|y x z]; rewrite !equivE ?subrr ?rpred0 //. by rewrite -opprB rpredN. by move=> *; rewrite -[x](addrNK y) -addrA rpredD. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
equiv_is_equiv
equiv_equiv:= EquivRelPack equiv_is_equiv.
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
equiv_equiv
equiv_encModRel:= defaultEncModRel equiv.
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
equiv_encModRel
quot:= {eq_quot equiv}. #[export] HB.instance Definition _ : EqQuotient R equiv quot := EqQuotient.on quot. #[export] HB.instance Definition _ := Choice.on quot.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
quot
idealrBEx y : (x - y) \in I = (x == y %[mod quot]). Proof. by rewrite piE equivE. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
idealrBE
idealrDEx y : (x + y) \in I = (x == - y %[mod quot]). Proof. by rewrite -idealrBE opprK. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
idealrDE
zero: quot := lift_cst quot 0.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
zero
add:= lift_op2 quot +%R.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
add
opp:= lift_op1 quot -%R.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
opp
pi_zero_morph:= PiConst zero.
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
pi_zero_morph
pi_opp: {morph \pi : x / - x >-> opp x}. Proof. move=> x; unlock opp; apply/eqP; rewrite piE equivE. by rewrite -opprD rpredN idealrDE opprK reprK. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
pi_opp
pi_opp_morph:= PiMorph1 pi_opp.
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
pi_opp_morph
pi_add: {morph \pi : x y / x + y >-> add x y}. Proof. move=> x y /=; unlock add; apply/eqP; rewrite piE equivE. rewrite opprD addrAC addrA -addrA. by rewrite rpredD // (idealrBE, idealrDE) ?pi_opp ?reprK. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
pi_add
pi_add_morph:= PiMorph2 pi_add.
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
pi_add_morph
addqA: associative add. Proof. by move=> x y z; rewrite -[x]reprK -[y]reprK -[z]reprK !piE addrA. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
addqA
addqC: commutative add. Proof. by move=> x y; rewrite -[x]reprK -[y]reprK !piE addrC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
addqC
add0q: left_id zero add. Proof. by move=> x; rewrite -[x]reprK !piE add0r. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
add0q
addNq: left_inverse zero opp add. Proof. by move=> x; rewrite -[x]reprK !piE addNr. Qed. #[export] HB.instance Definition _ := GRing.isZmodule.Build quot addqA addqC add0q addNq. #[export] HB.instance Definition _ := @isZmodQuotient.Build R equiv 0 -%R +%R quot (lock _) pi_opp pi_add.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
addNq
one: {quot idealI} := lift_cst {quot idealI} 1.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
one
mul:= lift_op2 {quot idealI} *%R.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
mul
pi_one_morph:= PiConst one.
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
pi_one_morph
pi_mul: {morph \pi : x y / x * y >-> mul x y}. Proof. move=> x y; unlock mul; apply/eqP; rewrite piE equivE. rewrite -[_ * _](addrNK (x * repr (\pi_{quot idealI} y))) -mulrBr. rewrite -addrA -mulrBl rpredD //. by rewrite idealMr // idealrDE opprK reprK. by rewrite mulrC idealMr // idealrDE opprK reprK. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
pi_mul
pi_mul_morph:= PiMorph2 pi_mul.
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
pi_mul_morph
mulqA: associative mul. Proof. by move=> x y z; rewrite -[x]reprK -[y]reprK -[z]reprK !piE mulrA. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
mulqA
mulqC: commutative mul. Proof. by move=> x y; rewrite -[x]reprK -[y]reprK !piE mulrC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype choice ssrnat", "From mathcomp Require Import seq ssralg generic_quotient" ]
algebra/ring_quotient.v
mulqC