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
mxblockD(B_ B'_ : forall i j, 'M[V]_(p_ i, q_ j)) : \mxblock_(i, j) (B_ i j + B'_ i j) = \mxblock_(i, j) (B_ i j) + \mxblock_(i, j) (B'_ i j). Proof. by apply/matrixP=> 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
mxblockD
mxblock0: \mxblock_(i, j) (0 : 'M[V]_(p_ i, q_ j)) = 0. Proof. by apply/matrixP=> 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
mxblock0
mxblock_consta : \mxblock_(i, j) (const_mx a : 'M[V]_(p_ i, q_ j)) = const_mx a. Proof. by apply/matrixP=> 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
mxblock_const
mxblock_sum(I : finType) (B_ : forall k i j, 'M[V]_(p_ i, q_ j)) (P : {pred I}): \mxblock_(i, j) (\sum_(k | P k) B_ k i j) = \sum_(k | P k) \mxblock_(i, j) (B_ k i j). Proof. apply/matrixP => i j; rewrite !(mxE, summxE). by apply: eq_bigr => l; 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
mxblock_sum
submxblockD(B B' : 'M[V]_(sp, sq)) i j : submxblock (B + B') i j = submxblock B i j + submxblock B' i j. Proof. by apply/matrixP => k l; 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
submxblockD
submxblock0i j : submxblock (0 : 'M[V]_(sp, sq)) i j = 0. Proof. by apply/matrixP=> k l; 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
submxblock0
submxblock_sum(I : finType) (B_ : forall k, 'M[V]_(sp, sq)) (P : {pred I}) i j : submxblock (\sum_(k | P k) B_ k) i j = \sum_(k | P k) submxblock (B_ k) i j. Proof. apply/matrixP => k l; rewrite !(mxE, summxE). by apply: eq_bigr => p; 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
submxblock_sum
sp:= (\sum_i p_ i)%N.
Notation
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
sp
sq:= (\sum_i q_ i)%N.
Notation
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
sq
mxblockN(B_ : forall i j, 'M[V]_(p_ i, q_ j)) : \mxblock_(i, j) (- B_ i j) = - \mxblock_(i, j) (B_ i j). Proof. by apply/matrixP=> 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
mxblockN
mxblockB(B_ B'_ : forall i j, 'M[V]_(p_ i, q_ j)) : \mxblock_(i, j) (B_ i j - B'_ i j) = \mxblock_(i, j) (B_ i j) - \mxblock_(i, j) (B'_ i j). Proof. by apply/matrixP=> 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
mxblockB
submxblockN(B : 'M[V]_(sp, sq)) i j : submxblock (- B) i j = - submxblock B i j. Proof. by apply/matrixP => k l; 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
submxblockN
submxblockB(B B' : 'M[V]_(sp, sq)) i j : submxblock (B - B') i j = submxblock B i j - submxblock B' i j. Proof. by apply/matrixP => k l; 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
submxblockB
sp:= (\sum_i p_ i)%N.
Notation
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
sp
sq:= (\sum_i q_ i)%N.
Notation
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
sq
mul_mxrow_mxcolm n (R_ : forall j, 'M[R]_(m, p_ j)) (C_ : forall i, 'M[R]_(p_ i, n)) : \mxrow_j R_ j *m \mxcol_i C_ i = \sum_i (R_ i *m C_ i). Proof. apply/matrixP => i j; rewrite !mxE summxE; under [RHS]eq_bigr do rewrite !mxE. rewrite sig_big_dep/= (reindex _ tagnat.sig_bij_on)/=. by apply: eq_bigr=> l _; 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
mul_mxrow_mxcol
mul_mxcol_mxrowm (C_ : forall i, 'M[R]_(p_ i, m)) (R_ : forall j, 'M[R]_(m, q_ j)) : \mxcol_i C_ i*m \mxrow_j R_ j = \mxblock_(i, j) (C_ i *m R_ j). Proof. apply/mxblockP => i j; rewrite mxblockK. by rewrite submxblockEh -mul_submxrow -submxcol_mul mxcolK mxrowK. 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_mxcol_mxrow
mul_mxrow_mxblockm (R_ : forall i, 'M[R]_(m, p_ i)) (B_ : forall i j, 'M[R]_(p_ i, q_ j)) : \mxrow_i R_ i *m \mxblock_(i, j) B_ i j = \mxrow_j (\sum_i (R_ i *m B_ i j)). Proof. rewrite mxblockEv mul_mxrow_mxcol mxrow_sum. by apply: eq_bigr => i _; rewrite mul_mxrow. 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_mxrow_mxblock
mul_mxblock_mxrowm (B_ : forall i j, 'M[R]_(q_ i, p_ j)) (C_ : forall i, 'M[R]_(p_ i, m)) : \mxblock_(i, j) B_ i j *m \mxcol_j C_ j = \mxcol_i (\sum_j (B_ i j *m C_ j)). Proof. rewrite mxblockEh mul_mxrow_mxcol mxcol_sum. by apply: eq_bigr => i _; rewrite mxcol_mul. 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_mxblock_mxrow
mul_mxblock{R : pzSemiRingType} {p q r : nat} {p_ : 'I_p -> nat} {q_ : 'I_q -> nat} {r_ : 'I_r -> nat} (A_ : forall i j, 'M[R]_(p_ i, q_ j)) (B_ : forall j k, 'M_(q_ j, r_ k)) : \mxblock_(i, j) A_ i j *m \mxblock_(j, k) B_ j k = \mxblock_(i, k) \sum_j (A_ i j *m B_ j k). Proof. rewrite mxblockEh mul_mxrow_mxblock mxblockEh; apply: eq_mxrow => i. by under [LHS]eq_bigr do rewrite mxcol_mul; rewrite -mxcol_sum. 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_mxblock
sp:= (\sum_i p_ i)%N. Implicit Type (s : 'I_sp).
Notation
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
sp
is_trig_mxblockP(B_ : forall i j, 'M[V]_(p_ i, p_ j)) : reflect [/\ forall (i j : 'I_p), (i < j)%N -> B_ i j = 0 & forall i, is_trig_mx (B_ i i)] (is_trig_mx (\mxblock_(i, j) B_ i j)). Proof. apply: (iffP is_trig_mxP); last first. move=> [Blt1 /(_ _)/is_trig_mxP Blt2]/= s s'; rewrite !mxE. rewrite -[_ < _]lt_sig ltEsig/= /sig1 /sig2 leEord. case: ltngtP => //= ii'; first by rewrite (Blt1 _ _ ii') mxE. move: (sig s) (sig s') ii' => -[/= i j] [/= i' +] /val_inj ii'. by case: _ / ii' => j'; rewrite tagged_asE => /Blt2->. move=> Btrig; split=> [i i' lti|i]. apply/matrixP => j j'; have := Btrig (Rank _ j) (Rank _ j'). rewrite !mxE !Rank2K; do !case: _ / esym; rewrite !cast_ord_id. rewrite /Rank [_ <= _]lt_rank. by rewrite ltEsig/= leEord ltnW//= (ltn_geF lti)//= => /(_ isT). apply/is_trig_mxP => j j' ltj; have := Btrig (Rank _ j) (Rank _ j'). rewrite !mxE !Rank2K; do! case: _ / esym; rewrite !cast_ord_id. by rewrite [_ <= _]lt_rank ltEsig/= !leEord leqnn/= tagged_asE; apply. 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_trig_mxblockP
is_trig_mxblock(B_ : forall i j, 'M[V]_(p_ i, p_ j)) : is_trig_mx (\mxblock_(i, j) B_ i j) = ([forall i : 'I_p, forall j : 'I_p, (i < j)%N ==> (B_ i j == 0)] && [forall i, is_trig_mx (B_ i i)]). Proof. by apply/is_trig_mxblockP/andP => -[] => [/(_ _ _ _)/eqP|] => /'forall_'forall_implyP => [|/(_ _ _ _)/eqP] Blt /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
is_trig_mxblock
is_diag_mxblockP(B_ : forall i j, 'M[V]_(p_ i, p_ j)) : reflect [/\ forall (i j : 'I_p), i != j -> B_ i j = 0 & forall i, is_diag_mx (B_ i i)] (is_diag_mx (\mxblock_(i, j) B_ i j)). Proof. apply: (iffP is_diag_mxP); last first. move=> [Bneq1 /(_ _)/is_diag_mxP Bneq2]/= s s'; rewrite !mxE. rewrite val_eqE -(can_eq sigK) /sig1 /sig2. move: (sig s) (sig s') => -[/= i j] [/= i' j']. rewrite -tag_eqE/= /tag_eq/= negb_and. case: eqVneq => /= [ii'|/Bneq1->]; last by rewrite !mxE. by rewrite -ii' in j' *; rewrite tagged_asE => /Bneq2. move=> Bdiag; split=> [i i' Ni|i]. apply/matrixP => j j'; have := Bdiag (Rank _ j) (Rank _ j'). rewrite !mxE !Rank2K; do !case: _ / esym; rewrite !cast_ord_id. by rewrite eq_Rank negb_and Ni; apply. apply/is_diag_mxP => j j' Nj; have := Bdiag (Rank _ j) (Rank _ j'). rewrite !mxE !Rank2K; do! case: _ / esym; rewrite !cast_ord_id. by rewrite eq_Rank negb_and val_eqE Nj orbT; apply. 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_diag_mxblockP
is_diag_mxblock(B_ : forall i j, 'M[V]_(p_ i, p_ j)) : is_diag_mx (\mxblock_(i, j) B_ i j) = ([forall i : 'I_p, forall j : 'I_p, (i != j) ==> (B_ i j == 0)] && [forall i, is_diag_mx (B_ i i)]). Proof. by apply/is_diag_mxblockP/andP => -[] => [/(_ _ _ _)/eqP|] => /'forall_'forall_implyP => [|/(_ _ _ _)/eqP] Blt /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
is_diag_mxblock
mxdiag(B_ : forall i, 'M[V]_(p_ i)) : 'M[V]_(\sum_i p_ i) := \mxblock_(j, k) if j == k then conform_mx 0 (B_ j) else 0. Local Notation "\mxdiag_ i E" := (mxdiag (fun i => E)) : ring_scope.
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
mxdiag
submxblock_diag(B_ : forall i, 'M[V]_(p_ i)) i : submxblock (\mxdiag_i B_ i) i i = B_ i. Proof. by rewrite mxblockK conform_mx_id 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
submxblock_diag
eq_mxdiagP(B_ B'_ : forall i, 'M[V]_(p_ i)) : (forall i, B_ i = B'_ i) <-> (\mxdiag_i B_ i = \mxdiag_i B'_ i). Proof. rewrite /mxdiag; split; first by move=> e; apply/eq_mxblockP => i j; rewrite e. by move=> + i => /eq_mxblockP/(_ i i); rewrite eqxx !conform_mx_id. 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
eq_mxdiagP
eq_mxdiag(B_ B'_ : forall i, 'M[V]_(p_ i)) : (forall i, B_ i = B'_ i) -> (\mxdiag_i B_ i = \mxdiag_i B'_ i). Proof. by move=> /eq_mxdiagP. 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
eq_mxdiag
mxdiagD(B_ B'_ : forall i, 'M[V]_(p_ i)) : \mxdiag_i (B_ i + B'_ i) = \mxdiag_i (B_ i) + \mxdiag_i (B'_ i). Proof. rewrite /mxdiag -mxblockD; apply/eq_mxblock => i j. by case: eqVneq => [->|]; rewrite ?conform_mx_id ?addr0. 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
mxdiagD
mxdiag_sum(I : finType) (B_ : forall k i, 'M[V]_(p_ i)) (P : {pred I}) : \mxdiag_i (\sum_(k | P k) B_ k i) = \sum_(k | P k) \mxdiag_i (B_ k i). Proof. rewrite /mxdiag -mxblock_sum; apply/eq_mxblock => i j. case: eqVneq => [->|]; rewrite ?conform_mx_id//; last by rewrite big1. by apply: eq_bigr => k; rewrite conform_mx_id. 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
mxdiag_sum
tr_mxdiag(B_ : forall i, 'M[V]_(p_ i)) : (\mxdiag_i B_ i)^T = \mxdiag_i (B_ i)^T. Proof. rewrite tr_mxblock; apply/eq_mxblock => i j. by case: eqVneq => [->|]; rewrite ?trmx_conform ?trmx0. 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
tr_mxdiag
row_mxdiag(B_ : forall i, 'M[V]_(p_ i)) k : let B'_ i := if sig1 k == i then conform_mx 0 (B_ i) else 0 in row k (\mxdiag_ i B_ i) = row (sig2 k) (\mxrow_i B'_ i). Proof. rewrite /= row_mxblock row_mxrow; apply/eq_mxrow => i. by case: eqVneq => // e; congr row; rewrite e. 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
row_mxdiag
col_mxdiag(B_ : forall i, 'M[V]_(p_ i)) k : let B'_ i := if sig1 k == i then conform_mx 0 (B_ i) else 0 in col k (\mxdiag_ i B_ i) = col (sig2 k) (\mxcol_i B'_ i). Proof. by rewrite /= col_mxblock col_mxcol; apply/eq_mxcol => 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
col_mxdiag
sp:= (\sum_i p_ i)%N. Implicit Type (s : 'I_sp).
Notation
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
sp
mxdiagN(B_ : forall i, 'M[V]_(p_ i)) : \mxdiag_i (- B_ i) = - \mxdiag_i (B_ i). Proof. rewrite /mxdiag -mxblockN; apply/eq_mxblock => i j. by case: eqVneq => [->|]; rewrite ?conform_mx_id ?oppr0. 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
mxdiagN
mxdiagB(B_ B'_ : forall i, 'M[V]_(p_ i)) : \mxdiag_i (B_ i - B'_ i) = \mxdiag_i (B_ i) - \mxdiag_i (B'_ i). Proof. by rewrite mxdiagD mxdiagN. 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
mxdiagB
mxdiag0: \mxdiag_i (0 : 'M[V]_(p_ i)) = 0. Proof. by under [LHS]eq_mxdiag do rewrite -[0]subr0; rewrite mxdiagB subrr. 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
mxdiag0
mxdiag_recl{V : nmodType} {m : nat} {p_ : 'I_m.+1 -> nat} (B_ : forall i, 'M[V]_(p_ i)) : \mxdiag_i B_ i = castmx (mxsize_recl, mxsize_recl) (block_mx (B_ 0) 0 0 (\mxdiag_i B_ (lift ord0 i))). Proof. rewrite /mxdiag mxblock_recul/= !conform_mx_id. by congr (castmx _ (block_mx _ _ _ _)); rewrite ?mxrow0 ?mxcol0. 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
mxdiag_recl
sp:= (\sum_i p_ i)%N. Implicit Type (s : 'I_sp).
Notation
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
sp
mxtrace_mxblock(B_ : forall i j, 'M[R]_(p_ i, p_ j)) : \tr (\mxblock_(i, j) B_ i j) = \sum_i \tr (B_ i i). Proof. rewrite /mxtrace sig_big_dep (reindex _ sig_bij_on)/=. 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
mxtrace_mxblock
mxdiagZa : \mxdiag_i (a%:M : 'M[R]_(p_ i)) = a%:M. Proof. apply/matrixP => s t; rewrite !mxE -(can_eq sigK) /sig1 /sig2. case: (sig s) (sig t) => [/= i j] [/= i' j']. case: eqP => [<-|ni] in j' *; last by rewrite !mxE; case: eqVneq => // -[]. by rewrite conform_mx_id eq_Tagged/= 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
mxdiagZ
diag_mxrow(B_ : forall j, 'rV[R]_(p_ j)) : diag_mx (\mxrow_j B_ j) = \mxdiag_j (diag_mx (B_ j)). Proof. apply/matrixP => s s'; rewrite !mxE/= -(can_eq sigK) /sig1 /sig2. case: (sig s) (sig s') => [/= i j] [/= i' j']. rewrite -tag_eqE /tag_eq/=; case: (eqVneq i i') => ii'; rewrite ?mxE//=. by case: _ / ii' in j' *; rewrite tagged_asE/= conform_mx_id 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
diag_mxrow
mxtrace_mxdiag(B_ : forall i, 'M[R]_(p_ i)) : \tr (\mxdiag_i B_ i) = \sum_i \tr (B_ i). Proof. by rewrite mxtrace_mxblock; apply: eq_bigr => i _; rewrite eqxx/= conform_mx_id. 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
mxtrace_mxdiag
mul_mxdiag_mxcolm (D_ : forall i, 'M[R]_(p_ i)) (C_ : forall i, 'M[R]_(p_ i, m)): \mxdiag_i D_ i *m \mxcol_i C_ i = \mxcol_i (D_ i *m C_ i). Proof. rewrite /mxdiag mxblockEh mul_mxrow_mxcol. under [LHS]eq_bigr do rewrite mxcol_mul; rewrite -mxcol_sum. apply/eq_mxcol => i; rewrite (bigD1 i)//= eqxx conform_mx_id big1 ?addr0//. by move=> j; case: eqVneq => //=; rewrite mul0mx. 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_mxdiag_mxcol
mul_mxrow_mxdiag{R : pzSemiRingType} {p : nat} {p_ : 'I_p -> nat} m (R_ : forall i, 'M[R]_(m, p_ i)) (D_ : forall i, 'M[R]_(p_ i)) : \mxrow_i R_ i *m \mxdiag_i D_ i = \mxrow_i (R_ i *m D_ i). Proof. apply: trmx_inj; rewrite trmx_mul_rev !tr_mxrow tr_mxdiag mul_mxdiag_mxcol. by apply/ eq_mxcol => i; rewrite trmx_mul_rev. 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_mxrow_mxdiag
mul_mxblock_mxdiag{R : pzSemiRingType} {p q : nat} {p_ : 'I_p -> nat} {q_ : 'I_q -> nat} (B_ : forall i j, 'M[R]_(p_ i, q_ j)) (D_ : forall j, 'M[R]_(q_ j)) : \mxblock_(i, j) B_ i j *m \mxdiag_j D_ j = \mxblock_(i, j) (B_ i j *m D_ j). Proof. by rewrite !mxblockEh mul_mxrow_mxdiag; under eq_mxrow do rewrite mxcol_mul. 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_mxblock_mxdiag
mul_mxdiag_mxblock{R : pzSemiRingType} {p q : nat} {p_ : 'I_p -> nat} {q_ : 'I_q -> nat} (D_ : forall j, 'M[R]_(p_ j)) (B_ : forall i j, 'M[R]_(p_ i, q_ j)): \mxdiag_j D_ j *m \mxblock_(i, j) B_ i j = \mxblock_(i, j) (D_ i *m B_ i j). Proof. by rewrite !mxblockEv mul_mxdiag_mxcol; under eq_mxcol do rewrite mul_mxrow. 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_mxdiag_mxblock
Vandermonde(R : pzRingType) (m n : nat) (a : 'rV[R]_n) := \matrix_(i < m, j < n) a 0 j ^+ i.
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
Vandermonde
det_Vandermonde(R : comPzRingType) (n : nat) (a : 'rV[R]_n) : \det (Vandermonde n a) = \prod_(i < n) \prod_(j < n | i < j) (a 0 j - a 0 i). Proof. set V := @Vandermonde R. elim: n => [|n IHn] in a *; first by rewrite det_mx00 big1// => -[] []. pose b : 'rV_n := \row_i a 0 (lift 0 i). pose C : 'M_n := diag_mx (\row_(i < n) (b 0 i - a 0 0)). pose D : 'M_n.+1 := 1 - a 0 0 *: \matrix_(i, j) (i == j.+1 :> nat)%:R. have detD : \det D = 1. rewrite det_trig ?big_ord_recl ?mxE ?mulr0 ?subr0 ?eqxx. by rewrite ?big1 ?mulr1// => i; rewrite !mxE eqxx ltn_eqF// mulr0 subr0. by apply/is_trig_mxP => *; rewrite !mxE ![_ == _]ltn_eqF ?mulr0 ?subr0 ?leqW. suff: D * V _ _ a = block_mx 1 (const_mx 1) 0 (V _ _ b *m C) :> 'M_(1 + n). move=> /(congr1 determinant); rewrite detM detD mul1r => ->. rewrite det_ublock det1 mul1r det_mulmx IHn big_ord_recl mulrC; congr (_ * _). rewrite big_mkcond big_ord_recl/= mul1r det_diag. by under eq_bigr do rewrite !mxE. apply: eq_bigr => i _; under eq_bigr do rewrite !mxE. by rewrite big_mkcond [RHS]big_mkcond big_ord_recl/= mul1r. rewrite mulrBl mul1r -[_ * _]scalemxAl; apply/matrixP => i j; rewrite !mxE. under eq_bigr do rewrite !mxE; case: splitP => [{i}_ -> /[!ord1]|{}i ->]. rewrite !expr0 big1; last by move=> ?; rewrite mul0r. by rewrite ?mulr0 ?subr0 ?mxE; case: splitP => k; rewrite ?ord1 mxE//. under eq_bigr do rewrite eqSS mulr_natl mulrb eq_sym. rewrite -big_mkcond/= big_ord1_eq exprS ifT// ?leqW// -mulrBl !mxE/=. case: split_ordP => [{j}_ - ...
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_Vandermonde
Gaussian_elimination_{F : fieldType} {m n} : 'M[F]_(m, n) -> 'M_m * 'M_n * nat := match m, n with | _.+1, _.+1 => fun A : 'M_(1 + _, 1 + _) => if [pick ij | A ij.1 ij.2 != 0] is Some (i, j) then let a := A i j in let A1 := xrow i 0 (xcol j 0 A) in let u := ursubmx A1 in let v := a^-1 *: dlsubmx A1 in let: (L, U, r) := Gaussian_elimination_ (drsubmx A1 - v *m u) in (xrow i 0 (block_mx 1 0 v L), xcol j 0 (block_mx a%:M u 0 U), r.+1) else (1%:M, 1%:M, 0) | _, _ => fun _ => (1%:M, 1%:M, 0) end. HB.lock Definition Gaussian_elimination := @Gaussian_elimination_.
Fixpoint
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
Gaussian_elimination_
Gaussian_elimination_unlockable:= Unlockable Gaussian_elimination.unlock. HB.lock Definition mxrank (F : fieldType) m n (A : 'M_(m, n)) := if [|| m == 0 | n == 0]%N then 0 else (@Gaussian_elimination F m n A).2.
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
Gaussian_elimination_unlockable
mxrank_unlockable:= Unlockable mxrank.unlock.
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
mxrank_unlockable
col_ebase:= LUr.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 bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
col_ebase
row_ebase:= LUr.1.2.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
row_ebase
row_free:= mxrank == 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 bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
row_free
row_full:= mxrank == n.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
row_full
row_base: 'M_(mxrank, n) := pid_mx mxrank *m row_ebase.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
row_base
col_base: 'M_(m, mxrank) := col_ebase *m pid_mx mxrank.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
col_base
complmx: 'M_n := copid_mx mxrank *m row_ebase.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
complmx
kermx: 'M_m := copid_mx mxrank *m invmx col_ebase.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
kermx
cokermx: 'M_n := invmx row_ebase *m copid_mx mxrank.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
cokermx
pinvmx: 'M_(n, m) := invmx row_ebase *m pid_mx mxrank *m invmx col_ebase.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
pinvmx
submxF m1 m2 n (A : 'M[F]_(m1, n)) (B : 'M_(m2, n)) := A *m cokermx B == 0.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
submx
submx_unlockable:= Unlockable submx.unlock. Arguments mxrank {F} {m%_N n%_N} A%_MS. Arguments complmx {F} {m%_N n%_N} A%_MS. Arguments submx {F} {m1%_N m2%_N n%_N} A%_MS B%_MS : rename. Local Notation "\rank A" := (mxrank A) : nat_scope. Local Notation "A ^C" := (complmx A) : matrix_set_scope. Local Notation "A <= B" := (submx A B) : matrix_set_scope. Local Notation "A <= B <= C" := ((A <= B) && (B <= C))%MS : matrix_set_scope. Local Notation "A == B" := (A <= B <= A)%MS : matrix_set_scope.
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
submx_unlockable
ltmxF m1 m2 n (A : 'M[F]_(m1, n)) (B : 'M_(m2, n)) := (A <= B)%MS && ~~ (B <= A)%MS. Arguments ltmx {F} {m1%_N m2%_N n%_N} A%_MS B%_MS. Local Notation "A < B" := (ltmx A B) : matrix_set_scope.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
ltmx
eqmxF m1 m2 n (A : 'M[F]_(m1, n)) (B : 'M_(m2, n)) := prod (\rank A = \rank B) (forall m3 (C : 'M_(m3, n)), ((A <= C) = (B <= C)) * ((C <= A) = (C <= B)))%MS. Arguments eqmx {F} {m1%_N m2%_N n%_N} A%_MS B%_MS. Local Notation "A :=: B" := (eqmx A%MS B%MS) : matrix_set_scope.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
eqmx
stablemxV f := (V%MS *m f%R <= V%MS)%MS.
Notation
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
stablemx
ltmxE: (A < B)%MS = ((A <= B)%MS && ~~ (B <= A)%MS). 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 bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
ltmxE
ltmxW: (A < B)%MS -> (A <= B)%MS. Proof. by case/andP. 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 bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
ltmxW
ltmxEneq: (A < B)%MS = (A <= B)%MS && ~~ (A == B)%MS. Proof. by apply: andb_id2l => ->. 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 bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
ltmxEneq
submxElt: (A <= B)%MS = (A == B)%MS || (A < B)%MS. Proof. by rewrite -andb_orr orbN andbT. 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 bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
submxElt
genmxF m n (A : 'M[F]_(m, n)) : 'M_n := choose (equivmx A (row_full A)) (genmx_witness 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 bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
genmx
genmx_unlockable:= Unlockable genmx.unlock. Arguments genmx {F} {n m}%_N A%_MS : rename. Local Notation "<< A >>" := (genmx A%MS) : matrix_set_scope.
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
genmx_unlockable
addsmxF m1 m2 n (A : 'M[F]_(m1, n)) (B : 'M_(m2, n)) : 'M_n := if A == 0 then addsmx_nop B else if B == 0 then addsmx_nop A else <<col_mx A B>>%MS.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
addsmx
addsmx_unlockable:= Unlockable addsmx.unlock. Arguments addsmx {F} {m1%_N m2%_N n%_N} A%_MS B%_MS : rename. Local Notation "A + B" := (addsmx A B) : matrix_set_scope. Local Notation "\sum_ ( i | P ) B" := (\big[addsmx/0]_(i | P) B%MS) : matrix_set_scope. Local Notation "\sum_ ( i <- r | P ) B" := (\big[addsmx/0]_(i <- r | P) B%MS) : matrix_set_scope.
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
addsmx_unlockable
capmx_genF m1 m2 n (A : 'M[F]_(m1, n)) (B : 'M_(m2, n)) := lsubmx (kermx (col_mx A B)) *m A. HB.lock
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
capmx_gen
capmxF m1 m2 n (A : 'M[F]_(m1, n)) (B : 'M_(m2, n)) : 'M_n := if qidmx A then capmx_nop B else if qidmx B then capmx_nop A else if row_full B then capmx_norm A else capmx_norm (capmx_gen A B).
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
capmx
capmx_unlockable:= Unlockable capmx.unlock. Arguments capmx {F} {m1%_N m2%_N n%_N} A%_MS B%_MS : rename. Local Notation "A :&: B" := (capmx A B) : matrix_set_scope. Local Notation "\bigcap_ ( i | P ) B" := (\big[capmx/1%:M]_(i | P) B) : matrix_set_scope. HB.lock
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
capmx_unlockable
diffmxF m1 m2 n (A : 'M[F]_(m1, n)) (B : 'M_(m2, n)) : 'M_n := <<capmx_gen A (capmx_gen A B)^C>>%MS.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
diffmx
diffmx_unlockable:= Unlockable diffmx.unlock. Arguments diffmx {F} {m1%_N m2%_N n%_N} A%_MS B%_MS : rename. Local Notation "A :\: B" := (diffmx A B) : matrix_set_scope.
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
diffmx_unlockable
proj_mxn (U V : 'M_n) : 'M_n := pinvmx (col_mx U V) *m col_mx U 0. Local Notation GaussE := Gaussian_elimination_. Fact mxrankE m n (A : 'M_(m, n)) : \rank A = (GaussE A).2. Proof. by rewrite mxrank.unlock unlock /=; case: m n A => [|m] [|n]. Qed.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
proj_mx
rank_leq_rowm n (A : 'M_(m, n)) : \rank A <= m. Proof. rewrite mxrankE. elim: m n A => [|m IHm] [|n] //= A; case: pickP => [[i j] _|] //=. by move: (_ - _) => B; case: GaussE (IHm _ B) => [[L U] r] /=. 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 bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
rank_leq_row
row_leq_rankm n (A : 'M_(m, n)) : (m <= \rank A) = row_free A. Proof. by rewrite /row_free eqn_leq rank_leq_row. 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 bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
row_leq_rank
rank_leq_colm n (A : 'M_(m, n)) : \rank A <= n. Proof. rewrite mxrankE. elim: m n A => [|m IHm] [|n] //= A; case: pickP => [[i j] _|] //=. by move: (_ - _) => B; case: GaussE (IHm _ B) => [[L U] r] /=. 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 bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
rank_leq_col
col_leq_rankm n (A : 'M_(m, n)) : (n <= \rank A) = row_full A. Proof. by rewrite /row_full eqn_leq rank_leq_col. 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 bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
col_leq_rank
eq_row_fullm1 m2 n (A : 'M_(m1, n)) (B : 'M_(m2, n)) : (A :=: B)%MS -> row_full A = row_full B. Proof. by rewrite /row_full => ->. Qed. Let unitmx1F := @unitmx1 F.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
eq_row_full
row_ebase_unitm n (A : 'M_(m, n)) : row_ebase A \in unitmx. Proof. rewrite /row_ebase unlock; elim: m n A => [|m IHm] [|n] //= A. case: pickP => [[i j] /= nzAij | //=]; move: (_ - _) => B. case: GaussE (IHm _ B) => [[L U] r] /= uU. rewrite unitmxE xcolE det_mulmx (@det_ublock _ 1) det_scalar1 !unitrM. by rewrite unitfE nzAij -!unitmxE uU unitmx_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 bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
row_ebase_unit
col_ebase_unitm n (A : 'M_(m, n)) : col_ebase A \in unitmx. Proof. rewrite /col_ebase unlock; elim: m n A => [|m IHm] [|n] //= A. case: pickP => [[i j] _|] //=; move: (_ - _) => B. case: GaussE (IHm _ B) => [[L U] r] /= uL. rewrite unitmxE xrowE det_mulmx (@det_lblock _ 1) det1 mul1r unitrM. by rewrite -unitmxE unitmx_perm. Qed. Hint Resolve rank_leq_row rank_leq_col row_ebase_unit col_ebase_unit : core.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
col_ebase_unit
mulmx_ebasem n (A : 'M_(m, n)) : col_ebase A *m pid_mx (\rank A) *m row_ebase A = A. Proof. rewrite mxrankE /col_ebase /row_ebase unlock. elim: m n A => [n A | m IHm]; first by rewrite [A]flatmx0 [_ *m _]flatmx0. case=> [A | n]; first by rewrite [_ *m _]thinmx0 [A]thinmx0. rewrite -(add1n m) -?(add1n n) => A /=. case: pickP => [[i0 j0] | A0] /=; last first. apply/matrixP=> i j; rewrite pid_mx_0 mulmx0 mul0mx mxE. by move/eqP: (A0 (i, j)). set a := A i0 j0 => nz_a; set A1 := xrow _ _ _. set u := ursubmx _; set v := _ *: _; set B : 'M_(m, n) := _ - _. move: (rank_leq_col B) (rank_leq_row B) {IHm}(IHm n B); rewrite mxrankE. case: (GaussE B) => [[L U] r] /= r_m r_n defB. have ->: pid_mx (1 + r) = block_mx 1 0 0 (pid_mx r) :> 'M[F]_(1 + m, 1 + n). rewrite -(subnKC r_m) -(subnKC r_n) pid_mx_block -col_mx0 -row_mx0. by rewrite block_mxA castmx_id col_mx0 row_mx0 -scalar_mx_block -pid_mx_block. rewrite xcolE xrowE mulmxA -xcolE -!mulmxA. rewrite !(addr0, add0r, mulmx0, mul0mx, mulmx_block, mul1mx) mulmxA defB. rewrite addrC subrK mul_mx_scalar scalerA divff // scale1r. have ->: a%:M = ulsubmx A1 by rewrite [_ A1]mx11_scalar !mxE !lshift0 !tpermR. rewrite submxK /A1 xrowE !xcolE -!mulmxA mulmxA -!perm_mxM !tperm2 !perm_mx1. by rewrite mulmx1 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 bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
mulmx_ebase
mulmx_basem n (A : 'M_(m, n)) : col_base A *m row_base A = A. Proof. by rewrite mulmxA -[col_base A *m _]mulmxA pid_mx_id ?mulmx_ebase. 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 bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
mulmx_base
mulmx1_min_rankr m n (A : 'M_(m, n)) M N : M *m A *m N = 1%:M :> 'M_r -> r <= \rank A. Proof. by rewrite -{1}(mulmx_base A) mulmxA -mulmxA; move/mulmx1_min. Qed. Arguments mulmx1_min_rank [r m n A].
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
mulmx1_min_rank
mulmx_max_rankr m n (M : 'M_(m, r)) (N : 'M_(r, n)) : \rank (M *m N) <= r. Proof. set MN := M *m N; set rMN := \rank _. pose L : 'M_(rMN, m) := pid_mx rMN *m invmx (col_ebase MN). pose U : 'M_(n, rMN) := invmx (row_ebase MN) *m pid_mx rMN. suffices: L *m M *m (N *m U) = 1%:M by apply: mulmx1_min. rewrite mulmxA -(mulmxA L) -[M *m N]mulmx_ebase -/MN. by rewrite !mulmxA mulmxKV // mulmxK // !pid_mx_id /rMN ?pid_mx_1. Qed. Arguments mulmx_max_rank [r m n].
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice", "From mathcomp Require Import fintype finfun bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
mulmx_max_rank
mxrank_trm n (A : 'M_(m, n)) : \rank A^T = \rank A. Proof. apply/eqP; rewrite eqn_leq -{3}[A]trmxK -{1}(mulmx_base A) -{1}(mulmx_base A^T). by rewrite !trmx_mul !mulmx_max_rank. 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 bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
mxrank_tr
mxrank_addm n (A B : 'M_(m, n)) : \rank (A + B)%R <= \rank A + \rank B. Proof. by rewrite -{1}(mulmx_base A) -{1}(mulmx_base B) -mul_row_col mulmx_max_rank. 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 bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
mxrank_add
mxrankM_maxlm n p (A : 'M_(m, n)) (B : 'M_(n, p)) : \rank (A *m B) <= \rank A. Proof. by rewrite -{1}(mulmx_base A) -mulmxA mulmx_max_rank. 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 bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
mxrankM_maxl
mxrankM_maxrm n p (A : 'M_(m, n)) (B : 'M_(n, p)) : \rank (A *m B) <= \rank B. Proof. by rewrite -mxrank_tr -(mxrank_tr B) trmx_mul mxrankM_maxl. 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 bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
mxrankM_maxr
mxrank_scalem n a (A : 'M_(m, n)) : \rank (a *: A) <= \rank A. Proof. by rewrite -mul_scalar_mx mxrankM_maxr. 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 bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
mxrank_scale
mxrank_scale_nzm n a (A : 'M_(m, n)) : a != 0 -> \rank (a *: A) = \rank A. Proof. move=> nza; apply/eqP; rewrite eqn_leq -{3}[A]scale1r -(mulVf nza). by rewrite -scalerA !mxrank_scale. 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 bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
mxrank_scale_nz
mxrank_oppm n (A : 'M_(m, n)) : \rank (- A) = \rank A. Proof. by rewrite -scaleN1r mxrank_scale_nz // oppr_eq0 oner_eq0. 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 bigop finset fingroup perm order", "From mathcomp Require Import div prime binomial ssralg finalg zmodp matrix" ]
algebra/mxalgebra.v
mxrank_opp