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
mulr_absz(x : R) i : x *+ `|i| = x *~ `|i|. Proof. by rewrite -abszE. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
mulr_absz
natr_abszi : `|i|%:R = `|i|%:~R :> R. Proof. by rewrite -abszE. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
natr_absz
Posz: nat >-> int.
Coercion
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
Posz
distnCm1 m2 : `|m1 - m2| = `|m2 - m1|. Proof. by rewrite -opprB abszN. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
distnC
distnDld n1 n2 : `|d + n1 - (d + n2)| = `|n1 - n2|. Proof. by rewrite !PoszD opprD addrCA -addrA addKr. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
distnDl
distnDrd n1 n2 : `|n1 + d - (n2 + d)| = `|n1 - n2|. Proof. by rewrite -!(addnC d) distnDl. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
distnDr
distnErn1 n2 : n1 <= n2 -> `|n1 - n2| = n2 - n1. Proof. by move/subnK=> {1}<-; rewrite distnC PoszD addrK absz_nat. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
distnEr
distnEln1 n2 : n2 <= n1 -> `|n1 - n2| = n1 - n2. Proof. by move/distnEr <-; rewrite distnC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
distnEl
distn0n : `|n - 0| = n. Proof. by rewrite subr0 absz_nat. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
distn0
dist0nn : `|0 - n| = n. Proof. by rewrite distnC distn0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
dist0n
distnnm : `|m - m| = 0. Proof. by rewrite subrr. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
distnn
distn_eq0n1 n2 : (`|n1 - n2| == 0) = (n1 == n2). Proof. by rewrite absz_eq0 subr_eq0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
distn_eq0
distnSn : `|n - n.+1| = 1. Proof. exact: distnDr n 0 1. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
distnS
distSnn : `|n.+1 - n| = 1. Proof. exact: distnDr n 1 0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
distSn
distn_eq1n1 n2 : (`|n1 - n2| == 1) = (if n1 < n2 then n1.+1 == n2 else n1 == n2.+1). Proof. case: ltnP => [lt_n12 | le_n21]. by rewrite eq_sym -(eqn_add2r n1) distnEr ?subnK // ltnW. by rewrite -(eqn_add2r n2) distnEl ?subnK. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
distn_eq1
leqD_distm1 m2 m3 : `|m1 - m3| <= `|m1 - m2| + `|m2 - m3|. Proof. by rewrite -lez_nat PoszD !abszE ler_distD. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
leqD_dist
leqifD_distzm1 m2 m3 : `|m1 - m3| <= `|m1 - m2| + `|m2 - m3| ?= iff (m1 <= m2 <= m3)%R || (m3 <= m2 <= m1)%R. Proof. apply/leqifP; rewrite -ltz_nat -eqz_nat PoszD !abszE; apply/leifP. wlog le_m31 : m1 m3 / (m3 <= m1)%R. move=> IH; case/orP: (le_total m1 m3) => /IH //. by rewrite (addrC `|_|)%R orbC !(distrC m1) !(distrC m3). rewrite ger0_norm ?subr_ge0 // orb_idl => [|/andP[le_m12 le_m23]]; last first. by have /eqP->: m2 == m3; rewrite ?lexx // eq_le le_m23 (le_trans le_m31). rewrite -{1}(subrK m2 m1) -(addrA _ m2) -subr_ge0 andbC -[X in X && _]subr_ge0. by apply: leifD; apply/real_leif_norm/num_real. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
leqifD_distz
leqifD_distn1 n2 n3 : `|n1 - n3| <= `|n1 - n2| + `|n2 - n3| ?= iff (n1 <= n2 <= n3) || (n3 <= n2 <= n1). Proof. exact: leqifD_distz. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
leqifD_dist
sqrn_distn1 n2 : `|n1 - n2| ^ 2 + 2 * (n1 * n2) = n1 ^ 2 + n2 ^ 2. Proof. wlog le_n21: n1 n2 / n2 <= n1. move=> IH; case/orP: (leq_total n2 n1) => /IH //. by rewrite (addnC (n2 ^ 2)) (mulnC n2) distnC. by rewrite distnEl ?sqrnB ?subnK ?nat_Cauchy. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
sqrn_dist
intr_normm : `|m|%:~R = `|m%:~R : R|. Proof. by rewrite {2}[m]intEsign rmorphMsign normrMsign abszE normr_nat. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
intr_norm
normrMzm (x : R) : `|x *~ m| = `|x| *~ `|m|. Proof. by rewrite -mulrzl normrM -intr_norm mulrzl. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
normrMz
expN1r(i : int) : (-1 : R) ^ i = (-1) ^+ `|i|. Proof. case: i => n; first by rewrite exprnP absz_nat. by rewrite NegzE abszN absz_nat -invr_expz expfV invrN1. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
expN1r
coefMrzp n i : (p *~ n)`_i = (p`_i *~ n). Proof. by case: n => n; rewrite ?NegzE (coefMNn, coefMn). Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
coefMrz
polyCMzn : {morph (@polyC R) : c / c *~ n}. Proof. by case: (intP n) => // n' c; rewrite ?mulrNz ?polyCN polyCMn. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
polyCMz
hornerMzn p x : (p *~ n).[x] = p.[x] *~ n. Proof. by case: n => n; rewrite ?NegzE ?mulNzr ?(hornerN, hornerMn). Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
hornerMz
horner_intn x : (n%:~R : {poly R}).[x] = n%:~R. Proof. by rewrite hornerMz hornerC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
horner_int
derivMzn p : (p *~ n)^`() = p^`() *~ n. Proof. by case: n => n; rewrite ?NegzE -?pmulrn (derivMn, derivMNn). Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
derivMz
mulpzp n : p *~ n = n%:~R *: p. Proof. by rewrite -mul_polyC polyCMz polyC1 mulrzl. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
mulpz
rpredMz(M : zmodType) (S : zmodClosed M) m : {in S, forall u, u *~ m \in S}. Proof. by case: m => n u Su; rewrite ?rpredN ?rpredMn. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
rpredMz
rpred_int(R : pzRingType) (S : subringClosed R) m : m%:~R \in S. Proof. by rewrite rpredMz ?rpred1. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
rpred_int
rpredZint(R : pzRingType) (M : lmodType R) (S : zmodClosed M) m : {in S, forall u, m%:~R *: u \in S}. Proof. by move=> u Su; rewrite /= scaler_int rpredMz. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
rpredZint
rpredXz(R : unitRingType) (S : divClosed R) m : {in S, forall x, x ^ m \in S}. Proof. by case: m => n x Sx; rewrite ?rpredV rpredX. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
rpredXz
rpredXsign(R : unitRingType) (S : divClosed R) n x : (x ^ ((-1) ^+ n) \in S) = (x \in S). Proof. by rewrite -signr_odd; case: (odd n); rewrite ?rpredV. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice seq", "From mathcomp Require Import fintype finfun bigop order ssralg countalg ssrnum", "From mathcomp Require Import poly" ]
algebra/ssrint.v
rpredXsign
semivector_axiom_def(R : nzSemiRingType) n (V : lSemiModType R) := { v2r : V -> 'rV[R]_n; v2r_semilinear : semilinear v2r; v2r_bijective : bijective v2r }. Arguments semivector_axiom_def [R] n%_N V%_type.
Record
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
semivector_axiom_def
vector_axiom_def(R : nzRingType) n (V : lmodType R) := {v2r : V -> 'rV[R]_n | linear v2r & bijective v2r}. Arguments vector_axiom_def [R] n%_N V%_type. HB.mixin Record LSemiModule_hasFinDim (R : nzSemiRingType) (V : Type) of GRing.LSemiModule R V := { dim : nat; vector_subdef : semivector_axiom_def dim V }. #[mathcomp(axiom="semivector_axiom_def"), short(type="semiVectType")] HB.structure Definition SemiVector (R : nzSemiRingType) := { V of LSemiModule_hasFinDim R V & GRing.LSemiModule R V }. #[mathcomp(axiom="vector_axiom_def"), short(type="vectType")] HB.structure Definition Vector (R : nzRingType) := { V of LSemiModule_hasFinDim R V & GRing.Lmodule R V }. #[deprecated(since="mathcomp 2.2.0", note="Use Vector.axiom instead.")]
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
vector_axiom_def
vector_axiom:= Vector.axiom. Arguments dim {R} s. HB.factory Record Lmodule_hasFinDim (R : nzRingType) (V : Type) of GRing.Lmodule R V := { dim : nat; vector_subdef : vector_axiom_def dim V }. HB.builders Context R V of Lmodule_hasFinDim R V.
Notation
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
vector_axiom
v2r:= sval vector_subdef. HB.instance Definition _ := GRing.isLinear.Build R V 'rV_dim _ v2r (proj1 (proj2_sig vector_subdef)). HB.instance Definition _ := LSemiModule_hasFinDim.Build R V (Build_semivector_axiom_def (semilinearP v2r) (proj2 (proj2_sig vector_subdef))). HB.end.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
v2r
space(K : fieldType) (vT : vectType K) := Space (mx : 'M[K]_vT) & <<mx>>%MS == mx.
Inductive
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
space
hom(R : nzSemiRingType) (vT wT : semiVectType R) := Hom of 'M[R]_(vT, wT).
Inductive
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
hom
v2r:= v2r v2r_subproof. Let v2r_bij : bijective v2r := v2r_bijective v2r_subproof. Fact r2v_subproof : {r2v | cancel r2v v2r}. Proof. have r2vP r: {v | v2r v = r}. by apply: sig_eqW; have [v _ vK] := v2r_bij; exists (v r). by exists (fun r => sval (r2vP r)) => r; case: (r2vP r). Qed.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
v2r
r2v:= sval r2v_subproof.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
r2v
r2vK: cancel r2v v2r. Proof. exact: svalP r2v_subproof. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
r2vK
r2v_inj: injective r2v. Proof. exact: can_inj r2vK. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
r2v_inj
v2rK: cancel v2r r2v. Proof. by have/bij_can_sym:= r2vK; apply. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
v2rK
v2r_inj: injective v2r. Proof. exact: can_inj v2rK. Qed. HB.instance Definition _ := GRing.isSemilinear.Build R vT 'rV_vT _ v2r (v2r_semilinear v2r_subproof). HB.instance Definition _ := GRing.isSemilinear.Build R 'rV_vT vT _ r2v (can2_semilinear v2rK r2vK).
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
v2r_inj
b2mxn (X : n.-tuple vT) := \matrix_i v2r (tnth X i).
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
b2mx
b2mxKn (X : n.-tuple vT) i : r2v (row i (b2mx X)) = X`_i. Proof. by rewrite rowK v2rK -tnth_nth. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
b2mxK
vs2mx(U : @space K vT) := let: Space mx _ := U in mx.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
vs2mx
gen_vs2mx(U : {vspace vT}) : <<vs2mx U>>%MS = vs2mx U. Proof. by apply/eqP; rewrite /vs2mx; case: U. Qed. Fact mx2vs_subproof m (A : 'M[K]_(m, vT)) : <<(<<A>>)>>%MS == <<A>>%MS. Proof. by rewrite genmx_id. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
gen_vs2mx
mx2vs{m} A : {vspace vT} := Space (@mx2vs_subproof m A). HB.instance Definition _ := [isSub of {vspace vT} for vs2mx].
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
mx2vs
vs2mxK: cancel vs2mx mx2vs. Proof. by move=> v; apply: val_inj; rewrite /= gen_vs2mx. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
vs2mxK
mx2vsKm (M : 'M_(m, vT)) : (vs2mx (mx2vs M) :=: M)%MS. Proof. exact: genmxE. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
mx2vsK
f2mx(f : 'Hom(aT, rT)) := let: Hom A := f in A. HB.instance Definition _ : isSub _ _ 'Hom(aT, rT) := [isNew for f2mx].
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
f2mx
Definition_ := [Choice of {vspace vT} by <:].
HB.instance
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
Definition
dimvU := \rank (vs2mx U).
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
dimv
subsetvU V := (vs2mx U <= vs2mx V)%MS.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
subsetv
vlineu := mx2vs (v2r u).
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
vline
pred_of_vspace(U : space vT) : {pred vT} := fun v => (vs2mx (vline v) <= vs2mx U)%MS.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
pred_of_vspace
vspace_predType:= @PredType _ (unkeyed {vspace vT}) pred_of_vspace.
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
vspace_predType
fullv: {vspace vT} := mx2vs 1%:M.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
fullv
addvU V := mx2vs (vs2mx U + vs2mx V).
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
addv
capvU V := mx2vs (vs2mx U :&: vs2mx V).
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
capv
complvU := mx2vs (vs2mx U)^C.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
complv
diffvU V := mx2vs (vs2mx U :\: vs2mx V).
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
diffv
vpickU := r2v (nz_row (vs2mx U)). Fact span_key : unit. Proof. by []. Qed.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
vpick
span_expanded_defX := mx2vs (b2mx (in_tuple X)).
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
span_expanded_def
span:= locked_with span_key span_expanded_def.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
span
span_unlockable:= [unlockable fun span].
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
span_unlockable
vbasis_defU := [tuple r2v (row i (row_base (vs2mx U))) | i < dimv U].
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
vbasis_def
vbasis:= locked_with span_key vbasis_def.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
vbasis
vbasis_unlockable:= [unlockable fun vbasis].
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
vbasis_unlockable
freeX := dimv (span X) == size X.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
free
basis_ofU X := (span X == U) && free X.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
basis_of
pred_of_vspace: space >-> pred_sort.
Coercion
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
pred_of_vspace
memvEv U : (v \in U) = (<[v]> <= U)%VS. 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 fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
memvE
vlinePv1 v2 : reflect (exists k, v1 = k *: v2) (v1 \in <[v2]>)%VS. Proof. apply: (iffP idP) => [|[k ->]]; rewrite memvK genmxE ?linearZ ?scalemx_sub //. by case/sub_rVP=> k; rewrite -linearZ => /v2r_inj->; exists k. Qed. Fact memv_submod_closed U : submod_closed U. Proof. split=> [|a u v]; rewrite !memvK 1?linear0 1?sub0mx // => Uu Uv. by rewrite linearP addmx_sub ?scalemx_sub. Qed. HB.instance Definition _ (U : {vspace vT}) := GRing.isSubmodClosed.Build K vT (pred_of_vspace U) (memv_submod_closed U).
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
vlineP
mem0vU : 0 \in U. Proof. exact: rpred0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
mem0v
memvNU v : (- v \in U) = (v \in U). Proof. exact: rpredN. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
memvN
memvDU : {in U &, forall u v, u + v \in U}. Proof. exact: rpredD. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
memvD
memvBU : {in U &, forall u v, u - v \in U}. Proof. exact: rpredB. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
memvB
memvZU k : {in U, forall v, k *: v \in U}. Proof. exact: rpredZ. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
memvZ
memv_sumlI r (P : pred I) vs U : (forall i, P i -> vs i \in U) -> \sum_(i <- r | P i) vs i \in U. Proof. exact: rpred_sum. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
memv_suml
memv_lineu : u \in <[u]>%VS. Proof. by apply/vlineP; exists 1; rewrite scale1r. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
memv_line
subvPU V : reflect {subset U <= V} (U <= V)%VS. Proof. apply: (iffP rV_subP) => sU12 u. by rewrite !memvE /subsetv !genmxE => /sU12. by have:= sU12 (r2v u); rewrite !memvE /subsetv !genmxE r2vK. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
subvP
subvvU : (U <= U)%VS. Proof. exact/subvP. Qed. Hint Resolve subvv : core.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
subvv
subv_trans: transitive subV. Proof. by move=> U V W /subvP sUV /subvP sVW; apply/subvP=> u /sUV/sVW. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
subv_trans
subv_anti: antisymmetric subV. Proof. by move=> U V; apply/vs2mxP. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
subv_anti
eqEsubvU V : (U == V) = (U <= V <= U)%VS. Proof. by apply/eqP/idP=> [-> | /subv_anti//]; rewrite subvv. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
eqEsubv
vspacePU V : U =i V <-> U = V. Proof. split=> [eqUV | -> //]; apply/subv_anti/andP. by split; apply/subvP=> v; rewrite eqUV. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
vspaceP
subvPn{U V} : reflect (exists2 u, u \in U & u \notin V) (~~ (U <= V)%VS). Proof. apply: (iffP idP) => [|[u Uu]]; last by apply: contra => /subvP->. case/row_subPn=> i; set vi := row i _ => V'vi. by exists (r2v vi); rewrite memvK r2vK ?row_sub. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
subvPn
sub0vU : (0 <= U)%VS. Proof. exact: mem0v. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
sub0v
subv0U : (U <= 0)%VS = (U == 0%VS). Proof. by rewrite eqEsubv sub0v andbT. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
subv0
memv0v : v \in 0%VS = (v == 0). Proof. by apply/idP/eqP=> [/vlineP[k ->] | ->]; rewrite (scaler0, mem0v). Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
memv0
subvfU : (U <= fullv)%VS. Proof. by rewrite /subsetv vs2mxF submx1. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
subvf
memvfv : v \in fullv. Proof. exact: subvf. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
memvf
memv_pickU : vpick U \in U. Proof. by rewrite mem_r2v nz_row_sub. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
memv_pick
vpick0U : (vpick U == 0) = (U == 0%VS). Proof. by rewrite -memv0 mem_r2v -subv0 /subV vs2mx0 !submx0 nz_row_eq0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
vpick0
subv_addU V W : (U + V <= W)%VS = (U <= W)%VS && (V <= W)%VS. Proof. by rewrite /subV vs2mxD addsmx_sub. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
subv_add
addvSU1 U2 V1 V2 : (U1 <= U2 -> V1 <= V2 -> U1 + V1 <= U2 + V2)%VS. Proof. by rewrite /subV !vs2mxD; apply: addsmxS. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
addvS
addvSlU V : (U <= U + V)%VS. Proof. by rewrite /subV vs2mxD addsmxSl. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import fintype bigop finfun tuple", "From mathcomp Require Import ssralg matrix mxalgebra zmodp" ]
algebra/vector.v
addvSl