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 |
|---|---|---|---|---|---|---|
determinant_multilinearn (A B C : 'M[R]_n) i0 b c :
row i0 A = b *: row i0 B + c *: row i0 C ->
row' i0 B = row' i0 A ->
row' i0 C = row' i0 A ->
\det A = b * \det B + c * \det C.
Proof.
rewrite -[_ + _](row_id 0); move/row_eq=> ABC.
move/row'_eq=> BA; move/row'_eq=> CA.
rewrite !big_distrr -big_split; apply: eq_bigr => s _ /=.
rewrite -!(mulrCA (_ ^+s)) -mulrDr; congr (_ * _).
rewrite !(bigD1 i0 (_ : predT i0)) //= {}ABC !mxE mulrDl !mulrA.
by congr (_ * _ + _ * _); apply: eq_bigr => i i0i; rewrite ?BA ?CA.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
determinant_multilinear
| |
determinant_alternaten (A : 'M[R]_n) i1 i2 :
i1 != i2 -> A i1 =1 A i2 -> \det A = 0.
Proof.
move=> neq_i12 eqA12; pose t := tperm i1 i2.
have oddMt s: (t * s)%g = ~~ s :> bool by rewrite odd_permM odd_tperm neq_i12.
rewrite [\det A](bigID (@odd_perm _)) /=.
apply: canLR (subrK _) _; rewrite add0r -sumrN.
rewrite (reindex_inj (mulgI t)); apply: eq_big => //= s.
rewrite oddMt => /negPf->; rewrite mulN1r mul1r; congr (- _).
rewrite (reindex_perm t); apply: eq_bigr => /= i _.
by rewrite permM tpermK /t; case: tpermP => // ->; rewrite eqA12.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
determinant_alternate
| |
det_trn (A : 'M[R]_n) : \det A^T = \det A.
Proof.
rewrite [\det A^T](reindex_inj invg_inj) /=.
apply: eq_bigr => s _ /=; rewrite !odd_permV (reindex_perm s) /=.
by congr (_ * _); apply: eq_bigr => i _; rewrite mxE permK.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
det_tr
| |
det_permn (s : 'S_n) : \det (perm_mx s) = (-1) ^+ s :> R.
Proof.
rewrite [\det _](bigD1 s) //= big1 => [|i _]; last by rewrite /= !mxE eqxx.
rewrite mulr1 big1 ?addr0 => //= t Dst.
case: (pickP (fun i => s i != t i)) => [i ist | Est].
by rewrite (bigD1 i) // mulrCA /= !mxE (negPf ist) mul0r.
by case/eqP: Dst; apply/permP => i; move/eqP: (Est i).
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
det_perm
| |
det1n : \det (1%:M : 'M[R]_n) = 1.
Proof. by rewrite -perm_mx1 det_perm odd_perm1. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
det1
| |
det_mx00(A : 'M[R]_0) : \det A = 1.
Proof. by rewrite flatmx0 -(flatmx0 1%:M) det1. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
det_mx00
| |
detZn a (A : 'M[R]_n) : \det (a *: A) = a ^+ n * \det A.
Proof.
rewrite big_distrr /=; apply: eq_bigr => s _; rewrite mulrCA; congr (_ * _).
rewrite -[n in a ^+ n]card_ord -prodr_const -big_split /=.
by apply: eq_bigr=> i _; rewrite mxE.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
detZ
| |
det0n' : \det (0 : 'M[R]_n'.+1) = 0.
Proof. by rewrite -(scale0r 0) detZ exprS !mul0r. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
det0
| |
det_scalarn a : \det (a%:M : 'M[R]_n) = a ^+ n.
Proof. by rewrite -{1}(mulr1 a) -scale_scalar_mx detZ det1 mulr1. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
det_scalar
| |
det_scalar1a : \det (a%:M : 'M[R]_1) = a.
Proof. exact: det_scalar. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
det_scalar1
| |
det_mx11(M : 'M[R]_1) : \det M = M 0 0.
Proof. by rewrite {1}[M]mx11_scalar det_scalar. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
det_mx11
| |
det_mulmxn (A B : 'M[R]_n) : \det (A *m B) = \det A * \det B.
Proof.
rewrite big_distrl /=.
pose F := ('I_n ^ n)%type; pose AB s i j := A i j * B j (s i).
transitivity (\sum_(f : F) \sum_(s : 'S_n) (-1) ^+ s * \prod_i AB s i (f i)).
rewrite exchange_big; apply: eq_bigr => /= s _; rewrite -big_distrr /=.
congr (_ * _); rewrite -(bigA_distr_bigA (AB s)) /=.
by apply: eq_bigr => x _; rewrite mxE.
rewrite (bigID (fun f : F => injectiveb f)) /= addrC big1 ?add0r => [|f Uf].
rewrite (reindex (@pval _)) /=; last first.
pose in_Sn := insubd (1%g : 'S_n).
by exists in_Sn => /= f Uf; first apply: val_inj; apply: insubdK.
apply: eq_big => /= [s | s _]; rewrite ?(valP s) // big_distrr /=.
rewrite (reindex_inj (mulgI s)); apply: eq_bigr => t _ /=.
rewrite big_split /= [in LHS]mulrA mulrCA mulrA mulrCA mulrA.
rewrite -signr_addb odd_permM !pvalE; congr (_ * _); symmetry.
by rewrite (reindex_perm s); apply: eq_bigr => i; rewrite permM.
transitivity (\det (\matrix_(i, j) B (f i) j) * \prod_i A i (f i)).
rewrite mulrC big_distrr /=; apply: eq_bigr => s _.
rewrite mulrCA big_split //=; congr (_ * (_ * _)).
by apply: eq_bigr => x _; rewrite mxE.
case/injectivePn: Uf => i1 [i2 Di12 Ef12].
by rewrite (determinant_alternate Di12) ?simp //= => j; rewrite !mxE Ef12.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
det_mulmx
| |
detMn' (A B : 'M[R]_n'.+1) : \det (A * B) = \det A * \det B.
Proof. exact: det_mulmx. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
detM
| |
expand_cofactorn (A : 'M[R]_n) i j :
cofactor A i j =
\sum_(s : 'S_n | s i == j) (-1) ^+ s * \prod_(k | i != k) A k (s k).
Proof.
case: n A i j => [|n] A i0 j0; first by case: i0.
rewrite (reindex (lift_perm i0 j0)); last first.
pose ulsf i (s : 'S_n.+1) k := odflt k (unlift (s i) (s (lift i k))).
have ulsfK i (s : 'S_n.+1) k: lift (s i) (ulsf i s k) = s (lift i k).
rewrite /ulsf; have:= neq_lift i k.
by rewrite -(can_eq (permK s)) => /unlift_some[] ? ? ->.
have inj_ulsf: injective (ulsf i0 _).
move=> s; apply: can_inj (ulsf (s i0) s^-1%g) _ => k'.
by rewrite {1}/ulsf ulsfK !permK liftK.
exists (fun s => perm (inj_ulsf s)) => [s _ | s].
by apply/permP=> k'; rewrite permE /ulsf lift_perm_lift lift_perm_id liftK.
move/(s _ =P _) => si0; apply/permP=> k.
case: (unliftP i0 k) => [k'|] ->; rewrite ?lift_perm_id //.
by rewrite lift_perm_lift -si0 permE ulsfK.
rewrite /cofactor big_distrr /=.
apply: eq_big => [s | s _]; first by rewrite lift_perm_id eqxx.
rewrite -signr_odd mulrA -signr_addb oddD -odd_lift_perm; congr (_ * _).
case: (pickP 'I_n) => [k0 _ | n0]; last first.
by rewrite !big1 // => [j /unlift_some[i] | i _]; have:= n0 i.
rewrite (reindex (lift i0)).
by apply: eq_big => [k | k _] /=; rewrite ?neq_lift // !mxE lift_perm_lift.
exists (fun k => odflt k0 (unlift i0 k)) => k; first by rewrite liftK.
by case/unlift_some=> k' -> ->.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
expand_cofactor
| |
expand_det_rown (A : 'M[R]_n) i0 :
\det A = \sum_j A i0 j * cofactor A i0 j.
Proof.
rewrite /(\det A) (partition_big (fun s : 'S_n => s i0) predT) //=.
apply: eq_bigr => j0 _; rewrite expand_cofactor big_distrr /=.
apply: eq_bigr => s /eqP Dsi0.
rewrite mulrCA (bigID (pred1 i0)) /= big_pred1_eq Dsi0; congr (_ * (_ * _)).
by apply: eq_bigl => i; rewrite eq_sym.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
expand_det_row
| |
cofactor_trn (A : 'M[R]_n) i j : cofactor A^T i j = cofactor A j i.
Proof.
rewrite /cofactor addnC; congr (_ * _).
rewrite -tr_row' -tr_col' det_tr; congr (\det _).
by apply/matrixP=> ? ?; rewrite !mxE.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
cofactor_tr
| |
cofactorZn a (A : 'M[R]_n) i j :
cofactor (a *: A) i j = a ^+ n.-1 * cofactor A i j.
Proof. by rewrite {1}/cofactor !linearZ detZ mulrCA mulrA. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
cofactorZ
| |
expand_det_coln (A : 'M[R]_n) j0 :
\det A = \sum_i (A i j0 * cofactor A i j0).
Proof.
rewrite -det_tr (expand_det_row _ j0).
by under eq_bigr do rewrite cofactor_tr mxE.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
expand_det_col
| |
trmx_adjn (A : 'M[R]_n) : (\adj A)^T = \adj A^T.
Proof. by apply/matrixP=> i j; rewrite !mxE cofactor_tr. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
trmx_adj
| |
adjZn a (A : 'M[R]_n) : \adj (a *: A) = a^+n.-1 *: \adj A.
Proof. by apply/matrixP=> i j; rewrite !mxE cofactorZ. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
adjZ
| |
mul_mx_adjn (A : 'M[R]_n) : A *m \adj A = (\det A)%:M.
Proof.
apply/matrixP=> i1 i2 /[!mxE]; have [->|Di] := eqVneq.
rewrite (expand_det_row _ i2) //=.
by apply: eq_bigr => j _; congr (_ * _); rewrite mxE.
pose B := \matrix_(i, j) (if i == i2 then A i1 j else A i j).
have EBi12: B i1 =1 B i2 by move=> j; rewrite /= !mxE eqxx (negPf Di).
rewrite -[_ *+ _](determinant_alternate Di EBi12) (expand_det_row _ i2).
apply: eq_bigr => j _; rewrite !mxE eqxx; congr (_ * (_ * _)).
apply: eq_bigr => s _; congr (_ * _); apply: eq_bigr => i _.
by rewrite !mxE eq_sym -if_neg neq_lift.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
mul_mx_adj
| |
mul_adj_mxn (A : 'M[R]_n) : \adj A *m A = (\det A)%:M.
Proof.
by apply: trmx_inj; rewrite trmx_mul trmx_adj mul_mx_adj det_tr tr_scalar_mx.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
mul_adj_mx
| |
adj1n : \adj (1%:M) = 1%:M :> 'M[R]_n.
Proof. by rewrite -{2}(det1 n) -mul_adj_mx mulmx1. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
adj1
| |
mulmx1Cn (A B : 'M[R]_n) : A *m B = 1%:M -> B *m A = 1%:M.
Proof.
move=> AB1; pose A' := \det B *: \adj A.
suffices kA: A' *m A = 1%:M by rewrite -[B]mul1mx -kA -(mulmxA A') AB1 mulmx1.
by rewrite -scalemxAl mul_adj_mx scale_scalar_mx mulrC -det_mulmx AB1 det1.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
mulmx1C
| |
det_ublockn1 n2 Aul (Aur : 'M[R]_(n1, n2)) Adr :
\det (block_mx Aul Aur 0 Adr) = \det Aul * \det Adr.
Proof.
elim: n1 => [|n1 IHn1] in Aul Aur *.
have ->: Aul = 1%:M by apply/matrixP=> i [].
rewrite det1 mul1r; congr (\det _); apply/matrixP=> i j.
by do 2![rewrite !mxE; case: splitP => [[]|k] //=; move/val_inj=> <- {k}].
rewrite (expand_det_col _ (lshift n2 0)) big_split_ord /=.
rewrite addrC big1 1?simp => [|i _]; last by rewrite block_mxEdl mxE simp.
rewrite (expand_det_col _ 0) big_distrl /=; apply: eq_bigr=> i _.
rewrite block_mxEul -!mulrA; do 2!congr (_ * _).
by rewrite col'_col_mx !col'Kl raddf0 row'Ku row'_row_mx IHn1.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
det_ublock
| |
det_lblockn1 n2 Aul (Adl : 'M[R]_(n2, n1)) Adr :
\det (block_mx Aul 0 Adl Adr) = \det Aul * \det Adr.
Proof. by rewrite -det_tr tr_block_mx trmx0 det_ublock !det_tr. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
det_lblock
| |
det_trign (A : 'M[R]_n) : is_trig_mx A -> \det A = \prod_(i < n) A i i.
Proof.
elim/trigsqmx_ind => [|k x c B Bt IHB]; first by rewrite ?big_ord0 ?det_mx00.
rewrite det_lblock big_ord_recl det_mx11 IHB//; congr (_ * _).
by rewrite -[ord0](lshift0 _ 0) block_mxEul.
by apply: eq_bigr => i; rewrite -!rshift1 block_mxEdr.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
det_trig
| |
det_diagn (d : 'rV[R]_n) : \det (diag_mx d) = \prod_i d 0 i.
Proof. by rewrite det_trig//; apply: eq_bigr => i; rewrite !mxE eqxx. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
det_diag
| |
Definition_ (R : comNzSemiRingType) n :=
GRing.LSemiAlgebra_isSemiAlgebra.Build R 'M[R]_n.+1 (fun k => scalemxAr k).
HB.instance Definition _ (R : comNzRingType) (n' : nat) :=
GRing.LSemiAlgebra.on 'M[R]_n'.+1.
HB.instance Definition _ (R : finComNzRingType) (n' : nat) :=
[Finite of 'M[R]_n'.+1 by <:].
|
HB.instance
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
Definition
| |
mulmx1_min(R : comNzRingType) m n (A : 'M[R]_(m, n)) B :
A *m B = 1%:M -> m <= n.
Proof.
move=> AB1; rewrite leqNgt; apply/negP=> /subnKC; rewrite addSnnS.
move: (_ - _)%N => m' def_m; move: AB1; rewrite -{m}def_m in A B *.
rewrite -(vsubmxK A) -(hsubmxK B) mul_col_row scalar_mx_block.
case/eq_block_mx=> /mulmx1C BlAu1 AuBr0 _ => /eqP/idPn[].
by rewrite -[_ B]mul1mx -BlAu1 -mulmxA AuBr0 !mulmx0 eq_sym oner_neq0.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
mulmx1_min
| |
unitmx: pred 'M[R]_n := fun A => \det A \is a GRing.unit.
|
Definition
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
unitmx
| |
invmxA := if A \in unitmx then (\det A)^-1 *: \adj A else A.
|
Definition
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
invmx
| |
unitmxEA : (A \in unitmx) = (\det A \is a GRing.unit).
Proof. by []. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
unitmxE
| |
unitmx1: 1%:M \in unitmx. Proof. by rewrite unitmxE det1 unitr1. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
unitmx1
| |
unitmx_perms : perm_mx s \in unitmx.
Proof. by rewrite unitmxE det_perm unitrX ?unitrN ?unitr1. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
unitmx_perm
| |
unitmx_trA : (A^T \in unitmx) = (A \in unitmx).
Proof. by rewrite unitmxE det_tr. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
unitmx_tr
| |
unitmxZa A : a \is a GRing.unit -> (a *: A \in unitmx) = (A \in unitmx).
Proof. by move=> Ua; rewrite !unitmxE detZ unitrM unitrX. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
unitmxZ
| |
invmx1: invmx 1%:M = 1%:M.
Proof. by rewrite /invmx det1 invr1 scale1r adj1 if_same. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
invmx1
| |
invmxZa A : a *: A \in unitmx -> invmx (a *: A) = a^-1 *: invmx A.
Proof.
rewrite /invmx !unitmxE detZ unitrM => /andP[Ua U_A].
rewrite Ua U_A adjZ !scalerA invrM {U_A}//=.
case: (posnP n) A => [-> | n_gt0] A; first by rewrite flatmx0 [_ *: _]flatmx0.
rewrite unitrX_pos // in Ua; rewrite -[_ * _](mulrK Ua) mulrC -!mulrA.
by rewrite -exprSr prednK // !mulrA divrK ?unitrX.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
invmxZ
| |
invmx_scalara : invmx a%:M = a^-1%:M.
Proof.
case Ua: (a%:M \in unitmx).
by rewrite -scalemx1 in Ua *; rewrite invmxZ // invmx1 scalemx1.
rewrite /invmx Ua; have [->|n_gt0] := posnP n; first by rewrite ![_%:M]flatmx0.
by rewrite unitmxE det_scalar unitrX_pos // in Ua; rewrite invr_out ?Ua.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
invmx_scalar
| |
mulVmx: {in unitmx, left_inverse 1%:M invmx mulmx}.
Proof.
by move=> A nsA; rewrite /invmx nsA -scalemxAl mul_adj_mx scale_scalar_mx mulVr.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
mulVmx
| |
mulmxV: {in unitmx, right_inverse 1%:M invmx mulmx}.
Proof.
by move=> A nsA; rewrite /invmx nsA -scalemxAr mul_mx_adj scale_scalar_mx mulVr.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
mulmxV
| |
mulKmxm : {in unitmx, @left_loop _ 'M_(n, m) invmx mulmx}.
Proof. by move=> A uA /= B; rewrite mulmxA mulVmx ?mul1mx. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
mulKmx
| |
mulKVmxm : {in unitmx, @rev_left_loop _ 'M_(n, m) invmx mulmx}.
Proof. by move=> A uA /= B; rewrite mulmxA mulmxV ?mul1mx. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
mulKVmx
| |
mulmxKm : {in unitmx, @right_loop 'M_(m, n) _ invmx mulmx}.
Proof. by move=> A uA /= B; rewrite -mulmxA mulmxV ?mulmx1. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
mulmxK
| |
mulmxKVm : {in unitmx, @rev_right_loop 'M_(m, n) _ invmx mulmx}.
Proof. by move=> A uA /= B; rewrite -mulmxA mulVmx ?mulmx1. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
mulmxKV
| |
det_invA : \det (invmx A) = (\det A)^-1.
Proof.
case uA: (A \in unitmx); last by rewrite /invmx uA invr_out ?negbT.
by apply: (mulrI uA); rewrite -det_mulmx mulmxV ?divrr ?det1.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
det_inv
| |
unitmx_invA : (invmx A \in unitmx) = (A \in unitmx).
Proof. by rewrite !unitmxE det_inv unitrV. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
unitmx_inv
| |
unitmx_mulA B : (A *m B \in unitmx) = (A \in unitmx) && (B \in unitmx).
Proof. by rewrite -unitrM -det_mulmx. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
unitmx_mul
| |
trmx_inv(A : 'M_n) : (invmx A)^T = invmx (A^T).
Proof. by rewrite (fun_if trmx) linearZ /= trmx_adj -unitmx_tr -det_tr. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
trmx_inv
| |
invmxK: involutive invmx.
Proof.
move=> A; case uA : (A \in unitmx); last by rewrite /invmx !uA.
by apply: (can_inj (mulKVmx uA)); rewrite mulVmx // mulmxV ?unitmx_inv.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
invmxK
| |
mulmx1_unitA B : A *m B = 1%:M -> A \in unitmx /\ B \in unitmx.
Proof. by move=> AB1; apply/andP; rewrite -unitmx_mul AB1 unitmx1. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
mulmx1_unit
| |
intro_unitmxA B : B *m A = 1%:M /\ A *m B = 1%:M -> unitmx A.
Proof. by case=> _ /mulmx1_unit[]. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
intro_unitmx
| |
invmx_out: {in [predC unitmx], invmx =1 id}.
Proof. by move=> A; rewrite inE /= /invmx -if_neg => ->. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
invmx_out
| |
Definition_ := GRing.NzRing_hasMulInverse.Build 'M[R]_n
(@mulVmx n) (@mulmxV n) (@intro_unitmx n) (@invmx_out n).
|
HB.instance
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
Definition
| |
detV(A : 'M_n) : \det A^-1 = (\det A)^-1.
Proof. exact: det_inv. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
detV
| |
unitr_trmx(A : 'M_n) : (A^T \is a GRing.unit) = (A \is a GRing.unit).
Proof. exact: unitmx_tr. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
unitr_trmx
| |
trmxV(A : 'M_n) : A^-1^T = (A^T)^-1.
Proof. exact: trmx_inv. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
trmxV
| |
perm_mxV(s : 'S_n) : perm_mx s^-1 = (perm_mx s)^-1.
Proof.
rewrite -[_^-1]mul1r; apply: (canRL (mulmxK (unitmx_perm s))).
by rewrite -perm_mxM mulVg perm_mx1.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
perm_mxV
| |
is_perm_mxV(A : 'M_n) : is_perm_mx A^-1 = is_perm_mx A.
Proof.
apply/is_perm_mxP/is_perm_mxP=> [] [s defA]; exists s^-1%g.
by rewrite -(invrK A) defA perm_mxV.
by rewrite defA perm_mxV.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
is_perm_mxV
| |
block_diag_mx_unit(R : comUnitRingType) n1 n2
(Aul : 'M[R]_n1) (Adr : 'M[R]_n2) :
(block_mx Aul 0 0 Adr \in unitmx) = (Aul \in unitmx) && (Adr \in unitmx).
Proof. by rewrite !unitmxE det_ublock unitrM. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
block_diag_mx_unit
| |
invmx_block_diag(R : comUnitRingType) n1 n2
(Aul : 'M[R]_n1) (Adr : 'M[R]_n2) :
block_mx Aul 0 0 Adr \in unitmx ->
invmx (block_mx Aul 0 0 Adr) = block_mx (invmx Aul) 0 0 (invmx Adr).
Proof.
move=> /[dup] Aunit; rewrite block_diag_mx_unit => /andP[Aul_unit Adr_unit].
rewrite -[LHS]mul1mx; apply: (canLR (mulmxK _)) => //.
rewrite [RHS](mulmx_block (invmx Aul)) !(mulmx0, mul0mx, add0r, addr0).
by rewrite !mulVmx// -?scalar_mx_block.
Qed.
HB.instance Definition _ (R : countComUnitRingType) (n' : nat) :=
[Countable of 'M[R]_n'.+1 by <:].
HB.instance Definition _ (n : nat) (R : finComUnitRingType) :=
[Finite of 'M[R]_n.+1 by <:].
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
invmx_block_diag
| |
GLtype(R : finComUnitRingType) := {unit 'M[R]_n.-1.+1}.
|
Definition
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
GLtype
| |
GLvalR (u : GLtype R) : 'M[R]_n.-1.+1 :=
let: FinRing.Unit A _ := u in A.
|
Coercion
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
GLval
| |
Definition_ (n : nat) (R : finComUnitRingType) :=
[isSub of {'GL_n[R]} for GLval].
|
HB.instance
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
Definition
| |
Definition_ := [Finite of {'GL_n[R]} by <:].
HB.instance Definition _ := FinGroup.on {'GL_n[R]}.
|
HB.instance
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
Definition
| |
GLgroup:= [set: {'GL_n[R]}].
|
Definition
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
GLgroup
| |
GLgroup_group:= Eval hnf in [group of GLgroup].
Implicit Types u v : {'GL_n[R]}.
|
Canonical
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
GLgroup_group
| |
GL_1E: GLval 1 = 1. Proof. by []. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
GL_1E
| |
GL_VEu : GLval u^-1 = (GLval u)^-1. Proof. by []. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
GL_VE
| |
GL_VxEu : GLval u^-1 = invmx u. Proof. by []. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
GL_VxE
| |
GL_MEu v : GLval (u * v) = GLval u * GLval v. Proof. by []. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
GL_ME
| |
GL_MxEu v : GLval (u * v) = u *m v. Proof. by []. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
GL_MxE
| |
GL_unitu : GLval u \is a GRing.unit. Proof. exact: valP. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
GL_unit
| |
GL_unitmxu : val u \in unitmx. Proof. exact: GL_unit. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
GL_unitmx
| |
GL_detu : \det u != 0.
Proof.
by apply: contraL (GL_unitmx u); rewrite unitmxE => /eqP->; rewrite unitr0.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
GL_det
| |
scalemx_eq0m n a (A : 'M[R]_(m, n)) :
(a *: A == 0) = (a == 0) || (A == 0).
Proof.
case nz_a: (a == 0) / eqP => [-> | _]; first by rewrite scale0r eqxx.
apply/eqP/eqP=> [aA0 | ->]; last exact: scaler0.
apply/matrixP=> i j; apply/eqP; move/matrixP/(_ i j)/eqP: aA0.
by rewrite !mxE mulf_eq0 nz_a.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
scalemx_eq0
| |
scalemx_injm n a :
a != 0 -> injective ( *:%R a : 'M[R]_(m, n) -> 'M[R]_(m, n)).
Proof.
move=> nz_a A B eq_aAB; apply: contraNeq nz_a.
rewrite -[A == B]subr_eq0 -[a == 0]orbF => /negPf<-.
by rewrite -scalemx_eq0 linearB subr_eq0 /= eq_aAB.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
scalemx_inj
| |
det0Pn (A : 'M[R]_n) :
reflect (exists2 v : 'rV[R]_n, v != 0 & v *m A = 0) (\det A == 0).
Proof.
apply: (iffP eqP) => [detA0 | [v n0v vA0]]; last first.
apply: contraNeq n0v => nz_detA; rewrite -(inj_eq (scalemx_inj nz_detA)).
by rewrite scaler0 -mul_mx_scalar -mul_mx_adj mulmxA vA0 mul0mx.
elim: n => [|n IHn] in A detA0 *.
by case/idP: (oner_eq0 R); rewrite -detA0 [A]thinmx0 -(thinmx0 1%:M) det1.
have [{detA0}A'0 | nzA'] := eqVneq (row 0 (\adj A)) 0; last first.
exists (row 0 (\adj A)) => //; rewrite rowE -mulmxA mul_adj_mx detA0.
by rewrite mul_mx_scalar scale0r.
pose A' := col' 0 A; pose vA := col 0 A.
have defA: A = row_mx vA A'.
apply/matrixP=> i j /[!mxE].
by case: split_ordP => j' -> /[!(mxE, ord1)]; congr (A i _); apply: val_inj.
have{IHn} w_ j : exists w : 'rV_n.+1, [/\ w != 0, w 0 j = 0 & w *m A' = 0].
have [|wj nzwj wjA'0] := IHn (row' j A').
by apply/eqP; move/rowP/(_ j)/eqP: A'0; rewrite !mxE mulf_eq0 signr_eq0.
exists (\row_k oapp (wj 0) 0 (unlift j k)).
rewrite !mxE unlift_none -wjA'0; split=> //.
apply: contraNneq nzwj => w0; apply/eqP/rowP=> k'.
by move/rowP/(_ (lift j k')): w0; rewrite !mxE liftK.
apply/rowP=> k; rewrite !mxE (bigD1_ord j) //= mxE unlift_none mul0r add0r.
by apply: eq_big => //= k'; rewrite !mxE/= liftK.
have [w0 [/rV0Pn[j nz_w0j] w00_0 w0A']] := w_ 0; pose a0 := (w0 *m vA) 0 0.
have{w_} [wj [nz_wj wj0_0 wjA']] := w_ j; pose aj := (wj *m vA) 0 0.
have [aj0 | nz_aj] := eqVneq aj 0.
exists wj => //; rewrite d
...
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
det0P
| |
map_mx_inj{m n} : injective (map_mx f : 'M_(m, n) -> 'M_(m, n)).
Proof.
move=> A B eq_AB; apply/matrixP=> i j.
by move/matrixP/(_ i j): eq_AB => /[!mxE]; apply: fmorph_inj.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
map_mx_inj
| |
map_mx_is_scalarn (A : 'M_n) : is_scalar_mx A^f = is_scalar_mx A.
Proof.
rewrite /is_scalar_mx; case: (insub _) => // i.
by rewrite mxE -map_scalar_mx inj_eq //; apply: map_mx_inj.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
map_mx_is_scalar
| |
map_unitmxn (A : 'M_n) : (A^f \in unitmx) = (A \in unitmx).
Proof. by rewrite unitmxE det_map_mx // fmorph_unit // -unitfE. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
map_unitmx
| |
map_mx_unitn' (A : 'M_n'.+1) :
(A^f \is a GRing.unit) = (A \is a GRing.unit).
Proof. exact: map_unitmx. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
map_mx_unit
| |
map_invmxn (A : 'M_n) : (invmx A)^f = invmx A^f.
Proof.
rewrite /invmx map_unitmx (fun_if (map_mx f)).
by rewrite map_mxZ map_mx_adj det_map_mx fmorphV.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
map_invmx
| |
map_mx_invn' (A : 'M_n'.+1) : A^-1^f = A^f^-1.
Proof. exact: map_invmx. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
map_mx_inv
| |
map_mx_eq0m n (A : 'M_(m, n)) : (A^f == 0) = (A == 0).
Proof. by rewrite -(inj_eq map_mx_inj) raddf0. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
map_mx_eq0
| |
cormen_lup{n} :=
match n return let M := 'M[F]_n.+1 in M -> M * M * M with
| 0 => fun A => (1, 1, A)
| _.+1 => fun A =>
let k := odflt 0 [pick k | A k 0 != 0] in
let A1 : 'M_(1 + _) := xrow 0 k A in
let P1 : 'M_(1 + _) := tperm_mx 0 k in
let Schur := ((A k 0)^-1 *: dlsubmx A1) *m ursubmx A1 in
let: (P2, L2, U2) := cormen_lup (drsubmx A1 - Schur) in
let P := block_mx 1 0 0 P2 *m P1 in
let L := block_mx 1 0 ((A k 0)^-1 *: (P2 *m dlsubmx A1)) L2 in
let U := block_mx (ulsubmx A1) (ursubmx A1) 0 U2 in
(P, L, U)
end.
|
Fixpoint
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
cormen_lup
| |
cormen_lup_permn (A : 'M_n.+1) : is_perm_mx (cormen_lup A).1.1.
Proof.
elim: n => [|n IHn] /= in A *; first exact: is_perm_mx1.
set A' := _ - _; move/(_ A'): IHn; case: cormen_lup => [[P L U]] {A'}/=.
rewrite (is_perm_mxMr _ (perm_mx_is_perm _ _)).
by case/is_perm_mxP => s ->; apply: lift0_mx_is_perm.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
cormen_lup_perm
| |
cormen_lup_correctn (A : 'M_n.+1) :
let: (P, L, U) := cormen_lup A in P * A = L * U.
Proof.
elim: n => [|n IHn] /= in A *; first by rewrite !mul1r.
set k := odflt _ _; set A1 : 'M_(1 + _) := xrow _ _ _.
set A' := _ - _; move/(_ A'): IHn; case: cormen_lup => [[P' L' U']] /= IHn.
rewrite -mulrA -!mulmxE -xrowE -/A1 /= -[n.+2]/(1 + n.+1)%N -{1}(submxK A1).
rewrite !mulmx_block !mul0mx !mulmx0 !add0r !addr0 !mul1mx -{L' U'}[L' *m _]IHn.
rewrite -scalemxAl !scalemxAr -!mulmxA addrC -mulrDr {A'}subrK.
congr (block_mx _ _ (_ *m _) _).
rewrite [_ *: _]mx11_scalar !mxE lshift0 tpermL {}/A1 {}/k.
case: pickP => /= [k nzAk0 | no_k]; first by rewrite mulVf ?mulmx1.
rewrite (_ : dlsubmx _ = 0) ?mul0mx //; apply/colP=> i.
by rewrite !mxE lshift0 (elimNf eqP (no_k _)).
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
cormen_lup_correct
| |
cormen_lup_detLn (A : 'M_n.+1) : \det (cormen_lup A).1.2 = 1.
Proof.
elim: n => [|n IHn] /= in A *; first by rewrite det1.
set A' := _ - _; move/(_ A'): IHn; case: cormen_lup => [[P L U]] {A'}/= detL.
by rewrite (@det_lblock _ 1) det1 mul1r.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
cormen_lup_detL
| |
cormen_lup_lowern A (i j : 'I_n.+1) :
i <= j -> (cormen_lup A).1.2 i j = (i == j)%:R.
Proof.
elim: n => [|n IHn] /= in A i j *; first by rewrite [i]ord1 [j]ord1 mxE.
set A' := _ - _; move/(_ A'): IHn; case: cormen_lup => [[P L U]] {A'}/= Ll.
rewrite !mxE split1; case: unliftP => [i'|] -> /=; rewrite !mxE split1.
by case: unliftP => [j'|] -> //; apply: Ll.
by case: unliftP => [j'|] ->; rewrite /= mxE.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
cormen_lup_lower
| |
cormen_lup_uppern A (i j : 'I_n.+1) :
j < i -> (cormen_lup A).2 i j = 0 :> F.
Proof.
elim: n => [|n IHn] /= in A i j *; first by rewrite [i]ord1.
set A' := _ - _; move/(_ A'): IHn; case: cormen_lup => [[P L U]] {A'}/= Uu.
rewrite !mxE split1; case: unliftP => [i'|] -> //=; rewrite !mxE split1.
by case: unliftP => [j'|] ->; [apply: Uu | rewrite /= mxE].
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
cormen_lup_upper
| |
mxOver_pred(S : {pred T}) :=
fun M : 'M[T]_(m, n) => [forall i, [forall j, M i j \in S]].
Arguments mxOver_pred _ _ /.
|
Definition
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
mxOver_pred
| |
mxOver(S : {pred T}) := [qualify a M | mxOver_pred S M].
|
Definition
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
mxOver
| |
mxOverP{S : {pred T}} {M : 'M[T]__} :
reflect (forall i j, M i j \in S) (M \is a mxOver S).
Proof. exact/'forall_forallP. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
mxOverP
| |
mxOverS(S1 S2 : {pred T}) :
{subset S1 <= S2} -> {subset mxOver S1 <= mxOver S2}.
Proof. by move=> sS12 M /mxOverP S1M; apply/mxOverP=> i j; apply/sS12/S1M. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
mxOverS
| |
mxOver_constc S : c \in S -> const_mx c \is a mxOver S.
Proof. by move=> cS; apply/mxOverP => i j; rewrite !mxE. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
mxOver_const
| |
mxOver_constEc S : (m > 0)%N -> (n > 0)%N ->
(const_mx c \is a mxOver S) = (c \in S).
Proof.
move=> m_gt0 n_gt0; apply/idP/idP; last exact: mxOver_const.
by move=> /mxOverP /(_ (Ordinal m_gt0) (Ordinal n_gt0)); rewrite mxE.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
mxOver_constE
| |
thinmxOver{n : nat} {T : Type} (M : 'M[T]_(n, 0)) S : M \is a mxOver S.
Proof. by apply/mxOverP => ? []. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
thinmxOver
| |
flatmxOver{n : nat} {T : Type} (M : 'M[T]_(0, n)) S : M \is a mxOver S.
Proof. by apply/mxOverP => - []. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice",
"From mathcomp Require Import fintype finfun finset fingroup perm order div",
"From mathcomp Require Import prime binomial ssralg countalg finalg zmodp bigop"
] |
algebra/matrix.v
|
flatmxOver
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.