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
prodf_seq_eq0I r (P : pred I) (F : I -> R) : (\prod_(i <- r | P i) F i == 0) = has (fun i => P i && (F i == 0)) r. Proof. by rewrite (big_morph _ mulf_eq0 (oner_eq0 _)) big_has_cond. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
prodf_seq_eq0
mulf_neq0x y : x != 0 -> y != 0 -> x * y != 0. Proof. by move=> x0 y0; rewrite mulf_eq0; apply/norP. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
mulf_neq0
prodf_neq0(I : finType) (P : pred I) (F : I -> R) : reflect (forall i, P i -> (F i != 0)) (\prod_(i | P i) F i != 0). Proof. by rewrite (sameP (prodf_eq0 _ _) exists_inP); apply: exists_inPn. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
prodf_neq0
prodf_seq_neq0I r (P : pred I) (F : I -> R) : (\prod_(i <- r | P i) F i != 0) = all (fun i => P i ==> (F i != 0)) r. Proof. rewrite prodf_seq_eq0 -all_predC; apply: eq_all => i /=. by rewrite implybE negb_and. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
prodf_seq_neq0
expf_eq0x n : (x ^+ n == 0) = (n > 0) && (x == 0). Proof. elim: n => [|n IHn]; first by rewrite oner_eq0. by rewrite exprS mulf_eq0 IHn andKb. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
expf_eq0
sqrf_eq0x : (x ^+ 2 == 0) = (x == 0). Proof. exact: expf_eq0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
sqrf_eq0
expf_neq0x m : x != 0 -> x ^+ m != 0. Proof. by move=> x_nz; rewrite expf_eq0; apply/nandP; right. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
expf_neq0
natf_neq0_pcharn : (n%:R != 0 :> R) = (pchar R)^'.-nat n. Proof. have [-> | /prod_prime_decomp->] := posnP n; first by rewrite eqxx. rewrite !big_seq; elim/big_rec: _ => [|[p e] s /=]; first by rewrite oner_eq0. case/mem_prime_decomp=> p_pr _ _; rewrite pnatM pnatX eqn0Ngt orbC => <-. by rewrite natrM natrX mulf_eq0 expf_eq0 negb_or negb_and pnatE ?inE p_pr. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
natf_neq0_pchar
natf0_pcharn : n > 0 -> n%:R == 0 :> R -> exists p, p \in pchar R. Proof. move=> n_gt0 nR_0; exists (pdiv n`_(pchar R)). apply: pnatP (pdiv_dvd _); rewrite ?part_pnat // ?pdiv_prime //. by rewrite ltn_neqAle eq_sym partn_eq1 // -natf_neq0_pchar nR_0 /=. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
natf0_pchar
pcharf'_natn : (pchar R)^'.-nat n = (n%:R != 0 :> R). Proof. have [-> | n_gt0] := posnP n; first by rewrite eqxx. apply/idP/idP => [|nz_n]; last first. by apply/pnatP=> // p p_pr p_dvd_n; apply: contra nz_n => /dvdn_pcharf <-. apply: contraL => n0; have [// | p pcharRp] := natf0_pchar _ n0. have [p_pr _] := andP pcharRp; rewrite (eq_pnat _ (eq_negn (pcharf_eq pcharRp))). by rewrite p'natE // (dvdn_pcharf pcharRp) n0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
pcharf'_nat
pcharf0P: pchar R =i pred0 <-> (forall n, (n%:R == 0 :> R) = (n == 0)%N). Proof. split=> pcharF0 n; last by rewrite !inE pcharF0 andbC; case: eqP => // ->. have [-> | n_gt0] := posnP; first exact: eqxx. by apply/negP; case/natf0_pchar=> // p; rewrite pcharF0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
pcharf0P
eqf_sqrx y : (x ^+ 2 == y ^+ 2) = (x == y) || (x == - y). Proof. by rewrite -subr_eq0 subr_sqr mulf_eq0 subr_eq0 addr_eq0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
eqf_sqr
mulfIx : x != 0 -> injective ( *%R x). Proof. move=> nz_x y z; apply: contra_eq => neq_yz. by rewrite -subr_eq0 -mulrBr mulf_neq0 ?subr_eq0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
mulfI
mulIfx : x != 0 -> injective ( *%R^~ x). Proof. by move=> nz_x y z; rewrite -!(mulrC x); apply: mulfI. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
mulIf
divfIx : x != 0 -> injective (fun y => x / y). Proof. by move/mulfI/inj_comp; apply; apply: invr_inj. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
divfI
divIfy : y != 0 -> injective (fun x => x / y). Proof. by rewrite -invr_eq0; apply: mulIf. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
divIf
sqrf_eq1x : (x ^+ 2 == 1) = (x == 1) || (x == -1). Proof. by rewrite -subr_eq0 subr_sqr_1 mulf_eq0 subr_eq0 addr_eq0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
sqrf_eq1
expfS_eq1x n : (x ^+ n.+1 == 1) = (x == 1) || (\sum_(i < n.+1) x ^+ i == 0). Proof. by rewrite -![_ == 1]subr_eq0 subrX1 mulf_eq0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
expfS_eq1
lregPx : reflect (lreg x) (x != 0). Proof. by apply: (iffP idP) => [/mulfI | /lreg_neq0]. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
lregP
rregPx : reflect (rreg x) (x != 0). Proof. by apply: (iffP idP) => [/mulIf | /rreg_neq0]. Qed. #[export] HB.instance Definition _ := IntegralDomain.on R^o.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
rregP
natf_neq0:= natf_neq0_pchar (only parsing). #[deprecated(since="mathcomp 2.4.0", note="Use natf0_pchar instead.")]
Notation
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
natf_neq0
natf0_char:= natf0_pchar (only parsing). #[deprecated(since="mathcomp 2.4.0", note="Use pcharf'_nat instead.")]
Notation
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
natf0_char
charf'_nat:= pcharf'_nat (only parsing). #[deprecated(since="mathcomp 2.4.0", note="Use pcharf0P instead.")]
Notation
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
charf'_nat
charf0P:= pcharf0P (only parsing). Arguments lregP {R x}. Arguments rregP {R x}.
Notation
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
charf0P
field_axiom(R : unitRingType) := forall x : R, x != 0 -> x \in unit. HB.mixin Record UnitRing_isField R of UnitRing R := { fieldP : field_axiom R; }. #[mathcomp(axiom="field_axiom"), short(type="fieldType")] HB.structure Definition Field := { R of IntegralDomain R & UnitRing_isField R }.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
field_axiom
IdomainMixin(R : unitRingType): Field.axiom R -> IntegralDomain.axiom R. Proof. move=> m x y xy0; apply/norP=> [[]] /m Ux /m. by rewrite -(unitrMr _ Ux) xy0 unitr0. Qed. HB.factory Record ComUnitRing_isField R of ComUnitRing R := { fieldP : field_axiom R; }. HB.builders Context R of ComUnitRing_isField R. HB.instance Definition _ := ComUnitRing_isIntegral.Build R (IdomainMixin fieldP). HB.instance Definition _ := UnitRing_isField.Build R fieldP. HB.end. HB.factory Record ComNzRing_isField R of ComNzRing R := { inv : R -> R; mulVf : forall x, x != 0 -> inv x * x = 1; invr0 : inv 0 = 0; }.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
IdomainMixin
BuildR := (ComNzRing_isField.Build R) (only parsing).
Notation
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
Build
ComRing_isFieldR := (ComNzRing_isField R) (only parsing). HB.builders Context R of ComNzRing_isField R. Fact intro_unit (x y : R) : y * x = 1 -> x != 0. Proof. move=> yx1; apply: contraNneq (@oner_neq0 R) => x0. by rewrite -yx1 x0 mulr0. Qed. Fact inv_out : {in predC (predC1 0), inv =1 id}. Proof. by move=> x /negbNE/eqP->; exact: invr0. Qed. HB.instance Definition _ : ComNzRing_hasMulInverse R := ComNzRing_hasMulInverse.Build R mulVf intro_unit inv_out. HB.instance Definition _ : ComUnitRing_isField R := ComUnitRing_isField.Build R (fun x x_neq_0 => x_neq_0). HB.end.
Notation
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
ComRing_isField
unitfEx : (x \in unit) = (x != 0). Proof. by apply/idP/idP=> [/(memPn _)-> | /fieldP]; rewrite ?unitr0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
unitfE
mulVfx : x != 0 -> x^-1 * x = 1. Proof. by rewrite -unitfE; apply: mulVr. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
mulVf
divffx : x != 0 -> x / x = 1. Proof. by rewrite -unitfE; apply: divrr. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
divff
mulfV:= divff.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
mulfV
mulKfx : x != 0 -> cancel ( *%R x) ( *%R x^-1). Proof. by rewrite -unitfE; apply: mulKr. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
mulKf
mulVKfx : x != 0 -> cancel ( *%R x^-1) ( *%R x). Proof. by rewrite -unitfE; apply: mulVKr. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
mulVKf
mulfKx : x != 0 -> cancel ( *%R^~ x) ( *%R^~ x^-1). Proof. by rewrite -unitfE; apply: mulrK. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
mulfK
mulfVKx : x != 0 -> cancel ( *%R^~ x^-1) ( *%R^~ x). Proof. by rewrite -unitfE; apply: divrK. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
mulfVK
divfK:= mulfVK.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
divfK
invfM: {morph @inv F : x y / x * y}. Proof. move=> x y; have [->|nzx] := eqVneq x 0; first by rewrite !(mul0r, invr0). have [->|nzy] := eqVneq y 0; first by rewrite !(mulr0, invr0). by rewrite mulrC invrM ?unitfE. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
invfM
invf_divx y : (x / y)^-1 = y / x. Proof. by rewrite invfM invrK mulrC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
invf_div
divKfx : x != 0 -> involutive (fun y => x / y). Proof. by move=> nz_x y; rewrite invf_div mulrC divfK. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
divKf
expfB_condm n x : (x == 0) + n <= m -> x ^+ (m - n) = x ^+ m / x ^+ n. Proof. move/subnK=> <-; rewrite addnA addnK !exprD. have [-> | nz_x] := eqVneq; first by rewrite !mulr0 !mul0r. by rewrite mulfK ?expf_neq0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
expfB_cond
expfBm n x : n < m -> x ^+ (m - n) = x ^+ m / x ^+ n. Proof. by move=> lt_n_m; apply: expfB_cond; case: eqP => // _; apply: ltnW. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
expfB
prodfVI r (P : pred I) (E : I -> F) : \prod_(i <- r | P i) (E i)^-1 = (\prod_(i <- r | P i) E i)^-1. Proof. by rewrite (big_morph _ invfM (invr1 F)). Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
prodfV
prodf_divI r (P : pred I) (E D : I -> F) : \prod_(i <- r | P i) (E i / D i) = \prod_(i <- r | P i) E i / \prod_(i <- r | P i) D i. Proof. by rewrite big_split prodfV. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
prodf_div
telescope_prodfn m (f : nat -> F) : (forall k, n < k < m -> f k != 0) -> n < m -> \prod_(n <= k < m) (f k.+1 / f k) = f m / f n. Proof. move=> nz_f ltnm; apply: invr_inj; rewrite prodf_div !invf_div -prodf_div. by apply: telescope_prodr => // k /nz_f; rewrite unitfE. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
telescope_prodf
telescope_prodf_eqn m (f u : nat -> F) : (forall k, n < k < m -> f k != 0) -> n < m -> (forall k, n <= k < m -> u k = f k.+1 / f k) -> \prod_(n <= k < m) u k = f m / f n. Proof. by move=> ? ? uE; under eq_big_nat do rewrite uE //=; exact: telescope_prodf. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
telescope_prodf_eq
addf_divx1 y1 x2 y2 : y1 != 0 -> y2 != 0 -> x1 / y1 + x2 / y2 = (x1 * y2 + x2 * y1) / (y1 * y2). Proof. by move=> nzy1 nzy2; rewrite invfM mulrDl !mulrA mulrAC !mulfK. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
addf_div
mulf_divx1 y1 x2 y2 : (x1 / y1) * (x2 / y2) = (x1 * x2) / (y1 * y2). Proof. by rewrite mulrACA -invfM. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
mulf_div
eqr_divx y z t : y != 0 -> t != 0 -> (x / y == z / t) = (x * t == z * y). Proof. move=> yD0 tD0; rewrite -[x in RHS](divfK yD0) -[z in RHS](divfK tD0) mulrAC. by apply/eqP/eqP => [->|/(mulIf yD0)/(mulIf tD0)]. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
eqr_div
eqr_sum_divI r P (f : I -> F) c a : c != 0 -> \big[+%R/0]_(x <- r | P x) (f x / c) == a = (\big[+%R/0]_(x <- r | P x) f x == a * c). Proof. by move=> ?; rewrite -mulr_suml -(divr1 a) eqr_div ?oner_eq0// mulr1 divr1. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
eqr_sum_div
pchar0_natf_div: pchar F =i pred0 -> forall m d, d %| m -> (m %/ d)%:R = m%:R / d%:R :> F. Proof. move/pcharf0P=> pchar0F m [|d] d_dv_m; first by rewrite divn0 invr0 mulr0. by rewrite natr_div // unitfE pchar0F. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
pchar0_natf_div
fmorph_eq0x : (f x == 0) = (x == 0). Proof. have [-> | nz_x] := eqVneq x; first by rewrite rmorph0 eqxx. apply/eqP; move/(congr1 ( *%R (f x^-1)))/eqP. by rewrite -rmorphM mulVf // mulr0 rmorph1 ?oner_eq0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
fmorph_eq0
fmorph_inj: injective f. Proof. by apply/raddf_inj => x /eqP; rewrite fmorph_eq0 => /eqP. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
fmorph_inj
fmorph_eq: {mono f : x y / x == y}. Proof. exact: inj_eq fmorph_inj. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
fmorph_eq
fmorph_eq1x : (f x == 1) = (x == 1). Proof. by rewrite -(inj_eq fmorph_inj) rmorph1. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
fmorph_eq1
fmorph_pchar: pchar R =i pchar F. Proof. by move=> p; rewrite !inE -fmorph_eq0 rmorph_nat. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
fmorph_pchar
fmorph_unitx : (f x \in unit) = (x != 0). Proof. have [-> |] := eqVneq x; first by rewrite rmorph0 unitr0. by rewrite -unitfE; apply: rmorph_unit. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
fmorph_unit
fmorphV: {morph f: x / x^-1}. Proof. move=> x; have [-> | nz_x] := eqVneq x 0; first by rewrite !(invr0, rmorph0). by rewrite rmorphV ?unitfE. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
fmorphV
fmorph_div: {morph f : x y / x / y}. Proof. by move=> x y; rewrite rmorphM /= fmorphV. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
fmorph_div
scalerKa : a != 0 -> cancel ( *:%R a : V -> V) ( *:%R a^-1). Proof. by move=> nz_a v; rewrite scalerA mulVf // scale1r. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
scalerK
scalerKVa : a != 0 -> cancel ( *:%R a^-1 : V -> V) ( *:%R a). Proof. by rewrite -invr_eq0 -{3}[a]invrK; apply: scalerK. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
scalerKV
scalerIa : a != 0 -> injective ( *:%R a : V -> V). Proof. by move=> nz_a; apply: can_inj (scalerK nz_a). Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
scalerI
scaler_eq0a v : (a *: v == 0) = (a == 0) || (v == 0). Proof. have [-> | nz_a] := eqVneq a; first by rewrite scale0r eqxx. by rewrite (can2_eq (scalerK nz_a) (scalerKV nz_a)) scaler0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
scaler_eq0
pchar_lalg(A : lalgType F) : pchar A =i pchar F. Proof. by move=> p; rewrite inE -scaler_nat scaler_eq0 oner_eq0 orbF. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
pchar_lalg
char0_natf_div:= pchar0_natf_div (only parsing). #[deprecated(since="mathcomp 2.4.0", note="Use fmorph_pchar instead.")]
Notation
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
char0_natf_div
fmorph_char:= fmorph_pchar (only parsing). #[deprecated(since="mathcomp 2.4.0", note="Use pchar_lalg instead.")]
Notation
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
fmorph_char
char_lalg:= pchar_lalg (only parsing). Arguments fmorph_inj {F R} f [x1 x2]. Arguments telescope_prodf_eq {F n m} f u.
Notation
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
char_lalg
decidable_field_axiom(R : unitRingType) (s : seq R -> pred (formula R)) := forall e f, reflect (holds e f) (s e f). HB.mixin Record Field_isDecField R of UnitRing R := { sat : seq R -> pred (formula R); satP : decidable_field_axiom sat; }. #[mathcomp(axiom="decidable_field_axiom"), short(type="decFieldType")] HB.structure Definition DecidableField := { F of Field F & Field_isDecField F }.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
decidable_field_axiom
soln f := if sol_subproof n f is ReflectT sP then xchoose sP else nseq n 0.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
sol
size_soln f : size (sol n f) = n. Proof. rewrite /sol; case: sol_subproof => [sP | _]; last exact: size_nseq. by case/andP: (xchooseP sP) => /eqP. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
size_sol
solPn f : reflect (exists2 s, size s = n & holds s f) (sat (sol n f) f). Proof. rewrite /sol; case: sol_subproof => [sP | sPn]. case/andP: (xchooseP sP) => _ ->; left. by case: sP => s; case/andP; move/eqP=> <-; move/satP; exists s. apply: (iffP (satP _ _)); first by exists (nseq n 0); rewrite ?size_nseq. by case=> s sz_s; move/satP=> f_s; case: sPn; exists s; rewrite sz_s eqxx. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
solP
eq_satf1 f2 : (forall e, holds e f1 <-> holds e f2) -> sat^~ f1 =1 sat^~ f2. Proof. by move=> eqf12 e; apply/satP/satP; case: (eqf12 e). Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
eq_sat
eq_solf1 f2 : (forall e, holds e f1 <-> holds e f2) -> sol^~ f1 =1 sol^~ f2. Proof. rewrite /sol => /eq_sat eqf12 n. do 2![case: sol_subproof] => //= [f1s f2s | ns1 [s f2s] | [s f1s] []]. - by apply: eq_xchoose => s; rewrite eqf12. - by case: ns1; exists s; rewrite -eqf12. by exists s; rewrite eqf12. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
eq_sol
wf_QE_proj:= forall i bc (bc_i := proj i bc), dnf_rterm bc -> qf_form bc_i && rformula bc_i.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
wf_QE_proj
valid_QE_proj:= forall i bc (ex_i_bc := ('exists 'X_i, dnf_to_form [:: bc])%T) e, dnf_rterm bc -> reflect (holds e ex_i_bc) (qf_eval e (proj i bc)). Hypotheses (wf_proj : wf_QE_proj) (ok_proj : valid_QE_proj). Let elim_aux f n := foldr Or False (map (proj n) (qf_to_dnf f false)).
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
valid_QE_proj
quantifier_elimf := match f with | f1 /\ f2 => (quantifier_elim f1) /\ (quantifier_elim f2) | f1 \/ f2 => (quantifier_elim f1) \/ (quantifier_elim f2) | f1 ==> f2 => (~ quantifier_elim f1) \/ (quantifier_elim f2) | ~ f => ~ quantifier_elim f | ('exists 'X_n, f) => elim_aux (quantifier_elim f) n | ('forall 'X_n, f) => ~ elim_aux (~ quantifier_elim f) n | _ => f end%T.
Fixpoint
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
quantifier_elim
quantifier_elim_wff : let qf := quantifier_elim f in rformula f -> qf_form qf && rformula qf. Proof. suffices aux_wf f0 n : let qf := elim_aux f0 n in rformula f0 -> qf_form qf && rformula qf. - by elim: f => //=; do ?[ move=> f1 IH1 f2 IH2; case/andP=> rf1 rf2; case/andP:(IH1 rf1)=> -> ->; case/andP:(IH2 rf2)=> -> -> // | move=> n f1 IH rf1; case/andP: (IH rf1)=> qff rf; rewrite aux_wf ]. rewrite /elim_aux => rf. suffices or_wf fs : let ofs := foldr Or False fs in all (@qf_form F) fs && all (@rformula F) fs -> qf_form ofs && rformula ofs. - apply: or_wf. suffices map_proj_wf bcs: let mbcs := map (proj n) bcs in all dnf_rterm bcs -> all (@qf_form _) mbcs && all (@rformula _) mbcs. by apply/map_proj_wf/qf_to_dnf_rterm. elim: bcs => [|bc bcs ihb] bcsr //= /andP[rbc rbcs]. by rewrite andbAC andbA wf_proj //= andbC ihb. elim: fs => //= g gs ihg; rewrite -andbA => /and4P[-> qgs -> rgs] /=. by apply: ihg; rewrite qgs rgs. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
quantifier_elim_wf
quantifier_elim_rformPe f : rformula f -> reflect (holds e f) (qf_eval e (quantifier_elim f)). Proof. pose rc e n f := exists x, qf_eval (set_nth 0 e n x) f. have auxP f0 e0 n0: qf_form f0 && rformula f0 -> reflect (rc e0 n0 f0) (qf_eval e0 (elim_aux f0 n0)). + rewrite /elim_aux => cf; set bcs := qf_to_dnf f0 false. apply: (@iffP (rc e0 n0 (dnf_to_form bcs))); last first. - by case=> x; rewrite -qf_to_dnfP //; exists x. - by case=> x; rewrite qf_to_dnfP //; exists x. have: all dnf_rterm bcs by case/andP: cf => _; apply: qf_to_dnf_rterm. elim: {f0 cf}bcs => [|bc bcs IHbcs] /=; first by right; case. case/andP=> r_bc /IHbcs {IHbcs}bcsP. have f_qf := dnf_to_form_qf [:: bc]. case: ok_proj => //= [ex_x|no_x]. left; case: ex_x => x /(qf_evalP _ f_qf); rewrite /= orbF => bc_x. by exists x; rewrite /= bc_x. apply: (iffP bcsP) => [[x bcs_x] | [x]] /=. by exists x; rewrite /= bcs_x orbT. case/orP => [bc_x|]; last by exists x. by case: no_x; exists x; apply/(qf_evalP _ f_qf); rewrite /= bc_x. elim: f e => //. - by move=> b e _; apply: idP. - by move=> t1 t2 e _; apply: eqP. - move=> f1 IH1 f2 IH2 e /= /andP[/IH1[] f1e]; last by right; case. by case/IH2; [left | right; case]. - move=> f1 IH1 f2 IH2 e /= /andP[/IH1[] f1e]; first by do 2!left. by case/IH2; [left; right | right; case]. - move=> f1 IH1 f2 IH2 e /= /andP[/IH1[] f1e]; last by left. by case/IH2; [left | right; move/(_ f1e)]. - by move=> f IHf e /= /IHf[]; [right | left]. - move=> n f IHf e /= rf; have rqf : ...
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
quantifier_elim_rformP
proj_sate f := qf_eval e (quantifier_elim (to_rform f)).
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
proj_sat
proj_satP: DecidableField.axiom proj_sat. Proof. move=> e f; have fP := quantifier_elim_rformP e (to_rform_rformula f). by apply: (iffP fP); move/to_rformP. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
proj_satP
RecordField_QE_isDecField F of Field F := { proj : nat -> seq (term F) * seq (term F) -> formula F; wf_proj : wf_QE_proj proj; ok_proj : valid_QE_proj proj; }. HB.builders Context F of Field_QE_isDecField F. HB.instance Definition qe_is_def_field : Field_isDecField F := Field_isDecField.Build F (proj_satP wf_proj ok_proj). HB.end.
HB.factory
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
Record
closed_field_axiom(R : pzRingType) := forall n (P : nat -> R), n > 0 -> exists x : R, x ^+ n = \sum_(i < n) P i * (x ^+ i). HB.mixin Record DecField_isAlgClosed F of DecidableField F := { solve_monicpoly : closed_field_axiom F; }. #[mathcomp(axiom="closed_field_axiom"), short(type="closedFieldType")] HB.structure Definition ClosedField := { F of DecidableField F & DecField_isAlgClosed F }.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
closed_field_axiom
imaginary_exists: {i : F | i ^+ 2 = -1}. Proof. have /sig_eqW[i Di2] := @solve_monicpoly F 2 (nth 0 [:: -1]) isT. by exists i; rewrite Di2 !big_ord_recl big_ord0 mul0r mulr1 !addr0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
imaginary_exists
lalgMixin(R : pzRingType) (A : lalgType R) (B : lmodType R) (f : B -> A) : phant B -> injective f -> scalable f -> forall mulB, {morph f : x y / mulB x y >-> x * y} -> forall a u v, a *: (mulB u v) = mulB (a *: u) v. Proof. by move=> _ injf fZ mulB fM a x y; apply: injf; rewrite !(fZ, fM) scalerAl. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
lalgMixin
comRingMixin(R : comPzRingType) (T : pzRingType) (f : T -> R) : phant T -> injective f -> {morph f : x y / x * y} -> commutative (@mul T). Proof. by move=> _ inj_f fM x y; apply: inj_f; rewrite !fM mulrC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
comRingMixin
algMixin(R : pzRingType) (A : algType R) (B : lalgType R) (f : B -> A) : phant B -> injective f -> {morph f : x y / x * y} -> scalable f -> forall k (x y : B), k *: (x * y) = x * (k *: y). Proof. by move=> _ inj_f fM fZ a x y; apply: inj_f; rewrite !(fM, fZ) scalerAr. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
algMixin
RecordisMul2Closed (R : pzSemiRingType) (S : {pred R}) := { rpredM : mulr_2closed S }. HB.mixin Record isMul1Closed (R : pzSemiRingType) (S : {pred R}) := { rpred1 : 1 \in S }. HB.mixin Record isInvClosed (R : unitRingType) (S : {pred R}) := { rpredVr : invr_closed S }. HB.mixin Record isScaleClosed (R : pzSemiRingType) (V : lSemiModType R) (S : {pred V}) := { rpredZ : scaler_closed S }.
HB.mixin
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
Record
DefinitionMul2Closed (R : pzSemiRingType) := {S of isMul2Closed R S}. #[short(type="mulrClosed")] HB.structure Definition MulClosed (R : pzSemiRingType) := {S of Mul2Closed R S & isMul1Closed R S}. #[short(type="semiring2Closed")] HB.structure Definition Semiring2Closed (R : pzSemiRingType) := {S of AddClosed R S & Mul2Closed R S}. #[short(type="semiringClosed")] HB.structure Definition SemiringClosed (R : pzSemiRingType) := {S of AddClosed R S & MulClosed R S}. #[short(type="smulClosed")] HB.structure Definition SmulClosed (R : pzRingType) := {S of OppClosed R S & MulClosed R S}. #[short(type="subringClosed")] HB.structure Definition SubringClosed (R : pzRingType) := {S of ZmodClosed R S & MulClosed R S}. #[short(type="divClosed")] HB.structure Definition DivClosed (R : unitRingType) := {S of MulClosed R S & isInvClosed R S}. #[short(type="sdivClosed")] HB.structure Definition SdivClosed (R : unitRingType) := {S of SmulClosed R S & isInvClosed R S}. #[short(type="submodClosed")] HB.structure Definition SubmodClosed (R : pzSemiRingType) (V : lSemiModType R) := {S of AddClosed V S & isScaleClosed R V S}. #[short(type="subalgClosed")] HB.structure Definition SubalgClosed (R : pzSemiRingType) (A : lSemiAlgType R) := {S of SemiringClosed A S & isScaleClosed R A S}. #[short(type="divringClosed")]
HB.structure
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
Definition
RecordisMulClosed (R : pzSemiRingType) (S : {pred R}) := { rpred1M : mulr_closed S }. HB.builders Context R S of isMulClosed R S. HB.instance Definition _ := isMul2Closed.Build R S (proj2 rpred1M). HB.instance Definition _ := isMul1Closed.Build R S (proj1 rpred1M). HB.end. HB.factory Record isSmulClosed (R : pzRingType) (S : R -> bool) := { smulr_closed_subproof : smulr_closed S }. HB.builders Context R S of isSmulClosed R S. HB.instance Definition _ := isMulClosed.Build R S (smulr_closedM smulr_closed_subproof). HB.instance Definition _ := isOppClosed.Build R S (smulr_closedN smulr_closed_subproof). HB.end. HB.factory Record isSemiringClosed (R : pzSemiRingType) (S : R -> bool) := { semiring_closed_subproof : semiring_closed S }. HB.builders Context R S of isSemiringClosed R S. HB.instance Definition _ := isAddClosed.Build R S (semiring_closedD semiring_closed_subproof). HB.instance Definition _ := isMulClosed.Build R S (semiring_closedM semiring_closed_subproof). HB.end. HB.factory Record isSubringClosed (R : pzRingType) (S : R -> bool) := { subring_closed_subproof : subring_closed S }. HB.builders Context R S of isSubringClosed R S. HB.instance Definition _ := isZmodClosed.Build R S (subring_closedB subring_closed_subproof). HB.instance Definition _ := isSmulClosed.Build R S (subring_closedM subring_closed_subproof).
HB.factory
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
Record
rpred0D: nmod_closed S. Proof. exact: nmod_closed_subproof. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
rpred0D
zmodClosedP: zmod_closed S. Proof. split; [ exact: (@rpred0D V S).1 | exact: rpredB ]. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
zmodClosedP
rpred1M: mulr_closed S. Proof. exact: (conj rpred1 rpredM). Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
rpred1M
rpred_prodI r (P : pred I) F : (forall i, P i -> F i \in S) -> \prod_(i <- r | P i) F i \in S. Proof. by move=> IH; elim/big_ind: _; [apply: rpred1 | apply: rpredM |]. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
rpred_prod
rpredXn : {in S, forall u, u ^+ n \in S}. Proof. by move=> u Su; rewrite -(card_ord n) -prodr_const rpred_prod. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
rpredX
rpred_nat(S : semiringClosed R) n : n%:R \in S. Proof. by rewrite rpredMn ?rpred1. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
rpred_nat
semiringClosedP(rngS : semiringClosed R) : semiring_closed rngS. Proof. split; [ exact: rpred0D | exact: rpred1M ]. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
semiringClosedP
rpredMsign(S : opprClosed R) n x : ((-1) ^+ n * x \in S) = (x \in S). Proof. by rewrite -signr_odd mulr_sign; case: ifP => // _; rewrite rpredN. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
rpredMsign
rpredN1(S : smulClosed R) : -1 \in S. Proof. by rewrite rpredN rpred1. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
rpredN1
rpred_sign(S : smulClosed R) n : (-1) ^+ n \in S. Proof. by rewrite rpredX ?rpredN1. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
rpred_sign
subringClosedP(rngS : subringClosed R) : subring_closed rngS. Proof. split; [ exact: rpred1 | exact: rpredB | exact: rpredM ]. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop prime binomial", "From mathcomp Require Export nmodule" ]
algebra/ssralg.v
subringClosedP