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

Commit 4c4243c

Browse files
feat(linear_algebra): determinant of vectors in a basis (#3919)
From the sphere eversion project, define the determinant of a family of vectors with respects to a basis. The main result is `is_basis.iff_det` asserting a family of vectors is a basis iff its determinant in some basis is invertible. Also renames `equiv_fun_basis` to `is_basis.equiv_fun` and `equiv_fun_basis_symm_apply` to `is_basis.equiv_fun_symm_apply`, in order to use dot notation. Co-authored-by: Anne Baanen t.baanen@vu.nl Co-authored-by: Rob Lewis <Rob.y.lewis@gmail.com> Co-authored-by: Rob Lewis <rob.y.lewis@gmail.com>
1 parent 94b1292 commit 4c4243c

File tree

5 files changed

+185
-31
lines changed

5 files changed

+185
-31
lines changed

src/algebra/big_operators/pi.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ lemma finset.prod_apply {α : Type*} {β : α → Type*} {γ} [∀a, comm_monoid
3737
show (s.val.map g).prod a = (s.val.map (λc, g c a)).prod,
3838
by rw [pi.multiset_prod_apply, multiset.map_map]
3939

40+
@[simp, to_additive]
41+
lemma fintype.prod_apply {α : Type*} {β : α → Type*} {γ : Type*} [fintype γ]
42+
[∀a, comm_monoid (β a)] (a : α) (g : γ → Πa, β a) : (∏ c, g c) a = ∏ c, g c a :=
43+
finset.prod_apply a finset.univ g
44+
4045
@[to_additive prod_mk_sum]
4146
lemma prod_mk_prod {α β γ : Type*} [comm_monoid α] [comm_monoid β] (s : finset γ)
4247
(f : γ → α) (g : γ → β) : (∏ x in s, f x, ∏ x in s, g x) = ∏ x in s, (f x, g x) :=

src/analysis/normed_space/finite_dimension.lean

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ all norms are equivalent in finite dimension.
7474
This statement is superceded by the fact that every linear map on a finite-dimensional space is
7575
continuous, in `linear_map.continuous_of_finite_dimensional`. -/
7676
lemma continuous_equiv_fun_basis {ι : Type v} [fintype ι] (ξ : ι → E) (hξ : is_basis 𝕜 ξ) :
77-
continuous (equiv_fun_basis hξ) :=
77+
continuous hξ.equiv_fun :=
7878
begin
7979
unfreezingI { induction hn : fintype.card ι with n IH generalizing ι E },
8080
{ apply linear_map.continuous_of_bound _ 0 (λx, _),
81-
have : equiv_fun_basis hξ x = 0,
81+
have : hξ.equiv_fun x = 0,
8282
by { ext i, exact (fintype.card_eq_zero_iff.1 hn i).elim },
83-
change ∥equiv_fun_basis hξ x∥ ≤ 0 * ∥x∥,
83+
change ∥hξ.equiv_fun x∥ ≤ 0 * ∥x∥,
8484
rw this,
8585
simp [norm_nonneg] },
8686
{ haveI : finite_dimensional 𝕜 E := of_finite_basis hξ,
@@ -90,11 +90,11 @@ begin
9090
{ assume s s_dim,
9191
rcases exists_is_basis_finite 𝕜 s with ⟨b, b_basis, b_finite⟩,
9292
letI : fintype b := finite.fintype b_finite,
93-
have U : uniform_embedding (equiv_fun_basis b_basis).symm.to_equiv,
93+
have U : uniform_embedding b_basis.equiv_fun.symm.to_equiv,
9494
{ have : fintype.card b = n,
9595
by { rw ← s_dim, exact (findim_eq_card_basis b_basis).symm },
96-
have : continuous (equiv_fun_basis b_basis) := IH (subtype.val : b → s) b_basis this,
97-
exact (equiv_fun_basis b_basis).symm.uniform_embedding (linear_map.continuous_on_pi _) this },
96+
have : continuous b_basis.equiv_fun := IH (subtype.val : b → s) b_basis this,
97+
exact b_basis.equiv_fun.symm.uniform_embedding (linear_map.continuous_on_pi _) this },
9898
have : is_complete (s : set E),
9999
from complete_space_coe_iff_is_complete.1 ((complete_space_congr U).1 (by apply_instance)),
100100
exact this.is_closed },
@@ -124,9 +124,9 @@ begin
124124
exact linear_map.continuous_iff_is_closed_ker.2 this },
125125
-- third step: applying the continuity to the linear form corresponding to a coefficient in the
126126
-- basis decomposition, deduce that all such coefficients are controlled in terms of the norm
127-
have : ∀i:ι, ∃C, 0 ≤ C ∧ ∀(x:E), ∥equiv_fun_basis hξ x i∥ ≤ C * ∥x∥,
127+
have : ∀i:ι, ∃C, 0 ≤ C ∧ ∀(x:E), ∥hξ.equiv_fun x i∥ ≤ C * ∥x∥,
128128
{ assume i,
129-
let f : E →ₗ[𝕜] 𝕜 := (linear_map.proj i).comp (equiv_fun_basis hξ),
129+
let f : E →ₗ[𝕜] 𝕜 := (linear_map.proj i).comp hξ.equiv_fun,
130130
let f' : E →L[𝕜] 𝕜 := { cont := H₂ f, ..f },
131131
exact ⟨∥f'∥, norm_nonneg _, λx, continuous_linear_map.le_op_norm f' x⟩ },
132132
-- fourth step: combine the bound on each coefficient to get a global bound and the continuity
@@ -149,12 +149,12 @@ begin
149149
-- argue that all linear maps there are continuous.
150150
rcases exists_is_basis_finite 𝕜 E with ⟨b, b_basis, b_finite⟩,
151151
letI : fintype b := finite.fintype b_finite,
152-
have A : continuous (equiv_fun_basis b_basis) :=
152+
have A : continuous b_basis.equiv_fun :=
153153
continuous_equiv_fun_basis _ b_basis,
154-
have B : continuous (f.comp ((equiv_fun_basis b_basis).symm : (b → 𝕜) →ₗ[𝕜] E)) :=
154+
have B : continuous (f.comp (b_basis.equiv_fun.symm : (b → 𝕜) →ₗ[𝕜] E)) :=
155155
linear_map.continuous_on_pi _,
156-
have : continuous ((f.comp ((equiv_fun_basis b_basis).symm : (b → 𝕜) →ₗ[𝕜] E))
157-
(equiv_fun_basis b_basis)) := B.comp A,
156+
have : continuous ((f.comp (b_basis.equiv_fun.symm : (b → 𝕜) →ₗ[𝕜] E))
157+
∘ b_basis.equiv_fun) := B.comp A,
158158
convert this,
159159
ext x,
160160
dsimp,
@@ -183,10 +183,10 @@ lemma finite_dimensional.complete [finite_dimensional 𝕜 E] : complete_space E
183183
begin
184184
rcases exists_is_basis_finite 𝕜 E with ⟨b, b_basis, b_finite⟩,
185185
letI : fintype b := finite.fintype b_finite,
186-
have : uniform_embedding (equiv_fun_basis b_basis).symm :=
186+
have : uniform_embedding b_basis.equiv_fun.symm :=
187187
linear_equiv.uniform_embedding _ (linear_map.continuous_of_finite_dimensional _)
188188
(linear_map.continuous_of_finite_dimensional _),
189-
change uniform_embedding (equiv_fun_basis b_basis).symm.to_equiv at this,
189+
change uniform_embedding b_basis.equiv_fun.symm.to_equiv at this,
190190
exact (complete_space_congr this).1 (by apply_instance)
191191
end
192192

@@ -221,7 +221,7 @@ lemma finite_dimensional.proper [finite_dimensional 𝕜 E] : proper_space E :=
221221
begin
222222
rcases exists_is_basis_finite 𝕜 E with ⟨b, b_basis, b_finite⟩,
223223
letI : fintype b := finite.fintype b_finite,
224-
let e := equiv_fun_basis b_basis,
224+
let e := b_basis.equiv_fun,
225225
let f : E →L[𝕜] (b → 𝕜) :=
226226
{ cont := linear_map.continuous_of_finite_dimensional _, ..e.to_linear_map },
227227
refine metric.proper_image_of_proper e.symm

src/linear_algebra/basic.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,6 +1738,9 @@ rfl
17381738
@[simp] theorem map_zero : e 0 = 0 := e.to_linear_map.map_zero
17391739
@[simp] theorem map_smul (c : R) (x : M) : e (c • x) = c • e x := e.map_smul' c x
17401740

1741+
@[simp] lemma map_sum {s : finset ι} (u : ι → M) : e (∑ i in s, u i) = ∑ i in s, e (u i) :=
1742+
e.to_linear_map.map_sum
1743+
17411744
@[simp] theorem map_eq_zero_iff {x : M} : e x = 0 ↔ x = 0 :=
17421745
e.to_add_equiv.map_eq_zero_iff
17431746
theorem map_ne_zero_iff {x : M} : e x ≠ 0 ↔ x ≠ 0 :=

src/linear_algebra/basis.lean

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,10 @@ end
777777
lemma is_basis.repr_eq_single {i} : hv.repr (v i) = finsupp.single i 1 :=
778778
by apply hv.1.repr_eq_single; simp
779779

780+
@[simp]
781+
lemma is_basis.repr_self_apply (i j : ι) : hv.repr (v i) j = if i = j then 1 else 0 :=
782+
by rw [hv.repr_eq_single, finsupp.single_apply]
783+
780784
/-- Construct a linear map given the value at the basis. -/
781785
def is_basis.constr (f : ι → M') : M →ₗ[R] M' :=
782786
(finsupp.total M' M' R id).comp $ (finsupp.lmap_domain R R f).comp hv.repr
@@ -976,7 +980,7 @@ variables [fintype ι] (h : is_basis R v)
976980

977981
/-- A module over `R` with a finite basis is linearly equivalent to functions from its basis to `R`.
978982
-/
979-
def equiv_fun_basis : M ≃ₗ[R] (ι → R) :=
983+
def is_basis.equiv_fun : M ≃ₗ[R] (ι → R) :=
980984
linear_equiv.trans (module_equiv_finsupp h)
981985
{ to_fun := finsupp.to_fun,
982986
map_add' := λ x y, by ext; exact finsupp.add_apply,
@@ -985,17 +989,17 @@ linear_equiv.trans (module_equiv_finsupp h)
985989

986990
/-- A module over a finite ring that admits a finite basis is finite. -/
987991
def module.fintype_of_fintype [fintype R] : fintype M :=
988-
fintype.of_equiv _ (equiv_fun_basis h).to_equiv.symm
992+
fintype.of_equiv _ h.equiv_fun.to_equiv.symm
989993

990994
theorem module.card_fintype [fintype R] [fintype M] :
991995
card M = (card R) ^ (card ι) :=
992-
calc card M = card (ι → R) : card_congr (equiv_fun_basis h).to_equiv
996+
calc card M = card (ι → R) : card_congr h.equiv_fun.to_equiv
993997
... = card R ^ card ι : card_fun
994998

995999
/-- Given a basis `v` indexed by `ι`, the canonical linear equivalence between `ι → R` and `M` maps
9961000
a function `x : ι → R` to the linear combination `∑_i x i • v i`. -/
997-
@[simp] lemma equiv_fun_basis_symm_apply (x : ι → R) :
998-
(equiv_fun_basis h).symm x = ∑ i, x i • v i :=
1001+
@[simp] lemma is_basis.equiv_fun_symm_apply (x : ι → R) :
1002+
h.equiv_fun.symm x = ∑ i, x i • v i :=
9991003
begin
10001004
change finsupp.sum
10011005
((finsupp.equiv_fun_on_fintype.symm : (ι → R) ≃ (ι →₀ R)) x) (λ (i : ι) (a : R), a • v i)
@@ -1008,6 +1012,18 @@ begin
10081012
{ simp [H], refl }
10091013
end
10101014

1015+
lemma is_basis.equiv_fun_apply (u : M) : h.equiv_fun u = h.repr u := rfl
1016+
1017+
lemma is_basis.equiv_fun_total (u : M) : ∑ i, h.equiv_fun u i • v i = u:=
1018+
begin
1019+
conv_rhs { rw ← h.total_repr u },
1020+
simp [finsupp.total_apply, finsupp.sum_fintype, h.equiv_fun_apply]
1021+
end
1022+
1023+
@[simp]
1024+
lemma is_basis.equiv_fun_self (i j : ι) : h.equiv_fun (v i) j = if i = j then 1 else 0 :=
1025+
by { rw [h.equiv_fun_apply, h.repr_self_apply] }
1026+
10111027
end module
10121028

10131029
section vector_space

src/linear_algebra/matrix.lean

Lines changed: 141 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/-
22
Copyright (c) 2019 Johannes Hölzl. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
4-
Author: Johannes Hölzl, Casper Putz
4+
Author: Johannes Hölzl, Patrick Massot, Casper Putz
55
-/
66
import linear_algebra.finite_dimensional
77
import linear_algebra.nonsingular_inverse
8+
import linear_algebra.multilinear
89

910
/-!
1011
# Linear maps and matrices
@@ -15,16 +16,37 @@ to matrices. This defines a linear equivalence between linear maps
1516
between finite-dimensional vector spaces and matrices indexed by
1617
the respective bases.
1718
19+
It also defines the trace of an endomorphism, and the determinant of a family of vectors with
20+
respect to some basis.
21+
1822
Some results are proved about the linear map corresponding to a
1923
diagonal matrix (`range`, `ker` and `rank`).
2024
2125
## Main definitions
2226
23-
`to_lin`, `to_matrix`, `linear_equiv_matrix`
27+
In the list below, and in all this file, `R` is a commutative ring (semiring
28+
is sometimes enough), `M` and its variations are `R`-modules, `ι`, `κ`, `n` and `m` are finite
29+
types used for indexing.
30+
31+
* `to_lin`: the `R`-linear map from `matrix m n R` to `R`-linear maps from `n → R` to `m → R`
32+
* `to_matrix`: the map in the other direction
33+
* `linear_equiv_matrix`: given bases `v₁ : ι → M₁` and `v₂ : κ → M₂`, the `R`-linear equivalence
34+
from `M₁ →ₗ[R] M₂` to `matrix κ ι R`
35+
* `linear_equiv_matrix'`: the same thing but with `M₁ = n → R` and `M₂ = m → R`, using their
36+
standard bases
37+
* `alg_equiv_matrix`: given a basis indexed by `n`, the `R`-algebra equivalence between
38+
`R`-endomorphisms of `M` and `matrix n n R`
39+
* `matrix.trace`: the trace of a square matrix
40+
* `linear_map.trace`: the trace of an endomorphism
41+
* `is_basis.to_matrix`: the matrix whose columns are a given family of vectors in a given basis
42+
* `is_basis.to_matrix_equiv`: given a basis, the linear equivalence between families of vectors
43+
and matrices arising from `is_basis.to_matrix`
44+
* `is_basis.det`: the determinant of a family of vectors with respect to a basis, as a multilinear
45+
map
2446
2547
## Tags
2648
27-
linear_map, matrix, linear_equiv, diagonal
49+
linear_map, matrix, linear_equiv, diagonal, det, trace
2850
2951
-/
3052

@@ -202,16 +224,16 @@ variables {ι κ M₁ M₂ : Type*}
202224
equivalence between linear maps `M₁ →ₗ M₂` and matrices over `R` indexed by the bases. -/
203225
def linear_equiv_matrix (hv₁ : is_basis R v₁) (hv₂ : is_basis R v₂) :
204226
(M₁ →ₗ[R] M₂) ≃ₗ[R] matrix κ ι R :=
205-
linear_equiv.trans (linear_equiv.arrow_congr (equiv_fun_basis hv₁) (equiv_fun_basis hv₂)) linear_equiv_matrix'
227+
linear_equiv.trans (linear_equiv.arrow_congr hv₁.equiv_fun hv₂.equiv_fun) linear_equiv_matrix'
206228

207229
variables (hv₁ : is_basis R v₁) (hv₂ : is_basis R v₂)
208230

209231
lemma linear_equiv_matrix_apply (f : M₁ →ₗ[R] M₂) (i : κ) (j : ι) :
210-
linear_equiv_matrix hv₁ hv₂ f i j = equiv_fun_basis hv₂ (f (v₁ j)) i :=
232+
linear_equiv_matrix hv₁ hv₂ f i j = hv₂.equiv_fun (f (v₁ j)) i :=
211233
by simp only [linear_equiv_matrix, to_matrix, to_matrixₗ, ite_smul,
212234
linear_equiv.trans_apply, linear_equiv.arrow_congr_apply,
213235
linear_equiv.coe_coe, linear_equiv_matrix'_apply, finset.mem_univ, if_true,
214-
one_smul, zero_smul, finset.sum_ite_eq, equiv_fun_basis_symm_apply]
236+
one_smul, zero_smul, finset.sum_ite_eq, hv₁.equiv_fun_symm_apply]
215237

216238
lemma linear_equiv_matrix_apply' (f : M₁ →ₗ[R] M₂) (i : κ) (j : ι) :
217239
linear_equiv_matrix hv₁ hv₂ f i j = hv₂.repr (f (v₁ j)) i :=
@@ -221,7 +243,7 @@ linear_equiv_matrix_apply hv₁ hv₂ f i j
221243
lemma linear_equiv_matrix_id : linear_equiv_matrix hv₁ hv₁ id = 1 :=
222244
begin
223245
ext i j,
224-
simp [linear_equiv_matrix_apply, equiv_fun_basis, matrix.one_apply, finsupp.single, eq_comm]
246+
simp [linear_equiv_matrix_apply, is_basis.equiv_fun, matrix.one_apply, finsupp.single, eq_comm]
225247
end
226248

227249
@[simp] lemma linear_equiv_matrix_symm_one : (linear_equiv_matrix hv₁ hv₁).symm 1 = id :=
@@ -242,7 +264,7 @@ begin
242264
← equiv.of_injective_apply _ hv₁.injective, ← equiv.of_injective_apply _ hv₂.injective,
243265
to_matrix_of_equiv, ← linear_equiv.trans_apply, linear_equiv.arrow_congr_trans], congr' 3;
244266
refine function.left_inverse.injective linear_equiv.symm_symm _; ext x;
245-
simp_rw [linear_equiv.symm_trans_apply, equiv_fun_basis_symm_apply, fun_congr_left_symm,
267+
simp_rw [linear_equiv.symm_trans_apply, is_basis.equiv_fun_symm_apply, fun_congr_left_symm,
246268
fun_congr_left_apply, fun_left_apply],
247269
convert (finset.sum_equiv (equiv.of_injective _ hv₁.injective) _).symm,
248270
simp_rw [equiv.symm_apply_apply, equiv.of_injective_apply, subtype.coe_mk],
@@ -275,7 +297,7 @@ lemma linear_equiv_matrix_comp [decidable_eq ι] (f : M₂ →ₗ[R] M₃) (g :
275297
linear_equiv_matrix hv₁ hv₃ (f.comp g) =
276298
linear_equiv_matrix hv₂ hv₃ f ⬝ linear_equiv_matrix hv₁ hv₂ g :=
277299
by simp_rw [linear_equiv_matrix, linear_equiv.trans_apply, linear_equiv_matrix'_apply,
278-
linear_equiv.arrow_congr_comp _ (equiv_fun_basis hv₂), comp_to_matrix_mul]
300+
linear_equiv.arrow_congr_comp _ hv₂.equiv_fun, comp_to_matrix_mul]
279301

280302
lemma linear_equiv_matrix_mul [decidable_eq ι] (f g : M₁ →ₗ[R] M₁) :
281303
linear_equiv_matrix hv₁ hv₁ (f * g) = linear_equiv_matrix hv₁ hv₁ f * linear_equiv_matrix hv₁ hv₁ g :=
@@ -294,8 +316,81 @@ end
294316

295317
end comp
296318

297-
section det
319+
end matrix
320+
321+
section is_basis_to_matrix
322+
323+
variables {ι ι' R M : Type*} [fintype ι] [decidable_eq ι]
324+
[comm_ring R] [add_comm_group M] [module R M]
325+
326+
open function matrix
327+
328+
/-- From a basis `e : ι → M` and a family of vectors `v : ι → M`, make the matrix whose columns
329+
are the vectors `v i` written in the basis `e`. -/
330+
def is_basis.to_matrix {e : ι → M} (he : is_basis R e) (v : ι → M) : matrix ι ι R :=
331+
linear_equiv_matrix he he (he.constr v)
332+
333+
variables {e : ι → M} (he : is_basis R e) (v : ι → M) (i j : ι)
334+
335+
namespace is_basis
336+
337+
lemma to_matrix_apply : he.to_matrix v i j = he.equiv_fun (v j) i :=
338+
by simp [is_basis.to_matrix, linear_equiv_matrix_apply]
339+
340+
@[simp] lemma to_matrix_self : he.to_matrix e = 1 :=
341+
begin
342+
rw is_basis.to_matrix,
343+
ext i j,
344+
simp [linear_equiv_matrix_apply, is_basis.equiv_fun, matrix.one_apply, finsupp.single, eq_comm]
345+
end
346+
347+
lemma to_matrix_update (x : M) :
348+
he.to_matrix (function.update v i x) = matrix.update_column (he.to_matrix v) i (he.repr x) :=
349+
begin
350+
ext j k,
351+
rw [is_basis.to_matrix, linear_equiv_matrix_apply' he he (he.constr (update v i x)),
352+
matrix.update_column_apply, constr_basis, he.to_matrix_apply],
353+
split_ifs,
354+
{ rw [h, update_same i x v] },
355+
{ rw [update_noteq h, he.equiv_fun_apply] },
356+
end
357+
358+
/-- From a basis `e : ι → M`, build a linear equivalence between families of vectors `v : ι → M`,
359+
and matrices, making the matrix whose columns are the vectors `v i` written in the basis `e`. -/
360+
def to_matrix_equiv {e : ι → M} (he : is_basis R e) : (ι → M) ≃ₗ[R] matrix ι ι R :=
361+
{ to_fun := he.to_matrix,
362+
map_add' := λ v w, begin
363+
ext i j,
364+
change _ = _ + _,
365+
simp [he.to_matrix_apply]
366+
end,
367+
map_smul' := begin
368+
intros c v,
369+
ext i j,
370+
simp [he.to_matrix_apply]
371+
end,
372+
inv_fun := λ m j, ∑ i, (m i j) • e i,
373+
left_inv := begin
374+
intro v,
375+
ext j,
376+
simp [he.to_matrix_apply, he.equiv_fun_total (v j)]
377+
end,
378+
right_inv := begin
379+
intros x,
380+
ext k l,
381+
simp [he.to_matrix_apply, he.equiv_fun.map_sum, he.equiv_fun.map_smul,
382+
fintype.sum_apply k (λ i, x i l • he.equiv_fun (e i)),
383+
he.equiv_fun_self]
384+
end }
385+
386+
end is_basis
298387

388+
end is_basis_to_matrix
389+
390+
open_locale matrix
391+
392+
section det
393+
open matrix
299394
variables {R ι M M' : Type*} [comm_ring R]
300395
[add_comm_group M] [module R M]
301396
[add_comm_group M'] [module R M']
@@ -335,8 +430,43 @@ def linear_equiv.of_is_unit_det {f : M →ₗ[R] M'} {hv : is_basis R v} {hv' :
335430
simp [h]
336431
end }
337432

433+
variables {e : ι → M} (he : is_basis R e)
434+
435+
/-- The determinant of a family of vectors with respect to some basis, as a multilinear map. -/
436+
def is_basis.det : multilinear_map R (λ i : ι, M) R :=
437+
{ to_fun := λ v, det (he.to_matrix v),
438+
map_add' := begin
439+
intros v i x y,
440+
simp only [he.to_matrix_update, linear_map.map_add],
441+
apply det_update_column_add
442+
end,
443+
map_smul' := begin
444+
intros u i c x,
445+
simp only [he.to_matrix_update, algebra.id.smul_eq_mul, map_smul_eq_smul_map],
446+
apply det_update_column_smul
447+
end }
448+
449+
lemma is_basis.det_apply (v : ι → M) : he.det v = det (he.to_matrix v) := rfl
450+
451+
lemma is_basis.det_self : he.det e = 1 :=
452+
by simp [he.det_apply]
453+
454+
lemma is_basis.iff_det {v : ι → M} : is_basis R v ↔ is_unit (he.det v) :=
455+
begin
456+
split,
457+
{ intro hv,
458+
change is_unit (linear_equiv_matrix he he (equiv_of_is_basis he hv $ equiv.refl ι)).det,
459+
apply linear_equiv.is_unit_det },
460+
{ intro h,
461+
convert linear_equiv.is_basis he (linear_equiv.of_is_unit_det h),
462+
ext i,
463+
exact (constr_basis he).symm },
464+
end
465+
338466
end det
339467

468+
namespace matrix
469+
340470
section trace
341471

342472
variables (n) (R : Type v) (M : Type w) [semiring R] [add_comm_monoid M] [semimodule R M]
@@ -685,4 +815,4 @@ square matrices. -/
685815
def alg_equiv_matrix {R : Type v} {M : Type w}
686816
[comm_ring R] [add_comm_group M] [module R M] [decidable_eq n] {b : n → M} (h : is_basis R b) :
687817
module.End R M ≃ₐ[R] matrix n n R :=
688-
(equiv_fun_basis h).alg_conj.trans alg_equiv_matrix'
818+
h.equiv_fun.alg_conj.trans alg_equiv_matrix'

0 commit comments

Comments
 (0)