@@ -7,6 +7,7 @@ import data.matrix.pequiv
7
7
import data.fintype.card
8
8
import group_theory.perm.sign
9
9
import ring_theory.algebra
10
+ import tactic.ring
10
11
11
12
universes u v w z
12
13
open equiv equiv.perm finset function
223
224
224
225
end det_zero
225
226
227
+ lemma det_update_column_add (M : matrix n n R) (j : n) (u v : n → R) :
228
+ det (update_column M j $ u + v) = det (update_column M j u) + det (update_column M j v) :=
229
+ begin
230
+ simp only [det],
231
+ have : ∀ σ : perm n, ∏ i, M.update_column j (u + v) (σ i) i =
232
+ ∏ i, M.update_column j u (σ i) i + ∏ i, M.update_column j v (σ i) i,
233
+ { intros σ,
234
+ simp only [update_column_apply, prod_ite, filter_eq',
235
+ finset.prod_singleton, finset.mem_univ, if_true, pi.add_apply, add_mul] },
236
+ rw [← sum_add_distrib],
237
+ apply sum_congr rfl,
238
+ intros x _,
239
+ rw [this , mul_add]
240
+ end
241
+
242
+ lemma det_update_row_add (M : matrix n n R) (j : n) (u v : n → R) :
243
+ det (update_row M j $ u + v) = det (update_row M j u) + det (update_row M j v) :=
244
+ begin
245
+ rw [← det_transpose, ← update_column_transpose, det_update_column_add],
246
+ simp [update_column_transpose, det_transpose]
247
+ end
248
+
249
+ lemma det_update_column_smul (M : matrix n n R) (j : n) (s : R) (u : n → R) :
250
+ det (update_column M j $ s • u) = s * det (update_column M j u) :=
251
+ begin
252
+ simp only [det],
253
+ have : ∀ σ : perm n, ∏ i, M.update_column j (s • u) (σ i) i = s * ∏ i, M.update_column j u (σ i) i,
254
+ { intros σ,
255
+ simp only [update_column_apply, prod_ite, filter_eq', finset.prod_singleton, finset.mem_univ,
256
+ if_true, algebra.id.smul_eq_mul, pi.smul_apply],
257
+ ring },
258
+ rw mul_sum,
259
+ apply sum_congr rfl,
260
+ intros x _,
261
+ rw this ,
262
+ ring
263
+ end
264
+
265
+ lemma det_update_row_smul (M : matrix n n R) (j : n) (s : R) (u : n → R) :
266
+ det (update_row M j $ s • u) = s * det (update_row M j u) :=
267
+ begin
268
+ rw [← det_transpose, ← update_column_transpose, det_update_column_smul],
269
+ simp [update_column_transpose, det_transpose]
270
+ end
271
+
226
272
end matrix
0 commit comments