Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit da6cd55

Browse files
committed
feat(determinant): towards multilinearity (#3887)
From the sphere eversion project. In a PR coming soon, this will be used to prove that the determinant of a family of vectors in a given basis is multi-linear (see [here](https://github.com/leanprover-community/sphere-eversion/blob/2c776f6a92c0f9babb521a02ab0cc341a06d3f3c/src/vec_det.lean) for a preview if needed).
1 parent 23749aa commit da6cd55

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

src/linear_algebra/determinant.lean

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import data.matrix.pequiv
77
import data.fintype.card
88
import group_theory.perm.sign
99
import ring_theory.algebra
10+
import tactic.ring
1011

1112
universes u v w z
1213
open equiv equiv.perm finset function
@@ -223,4 +224,49 @@ end
223224

224225
end det_zero
225226

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+
226272
end matrix

0 commit comments

Comments
 (0)