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

Commit ae6a7c3

Browse files
committed
feat(linear_algebra/multilinear/finite_dimensional): generalize to finite and free (#14199)
This also renames some `free` and `finite` instances which had garbage names.
1 parent 59facea commit ae6a7c3

File tree

4 files changed

+69
-30
lines changed

4 files changed

+69
-30
lines changed

src/linear_algebra/free_module/basic.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ instance self : module.free R R := of_basis $ basis.singleton unit R
128128
instance of_subsingleton [subsingleton N] : module.free R N :=
129129
of_basis (basis.empty N : basis pempty R N)
130130

131+
@[priority 100]
132+
instance of_subsingleton' [subsingleton R] : module.free R N :=
133+
by letI := module.subsingleton R N; exact module.free.of_subsingleton R N
134+
131135
instance dfinsupp {ι : Type*} (M : ι → Type*) [Π (i : ι), add_comm_monoid (M i)]
132136
[Π (i : ι), module R (M i)] [Π (i : ι), module.free R (M i)] : module.free R (Π₀ i, M i) :=
133137
of_basis $ dfinsupp.basis $ λ i, choose_basis R (M i)

src/linear_algebra/free_module/finite/basic.lean

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ section comm_ring
5050
variables [comm_ring R] [add_comm_group M] [module R M] [module.free R M]
5151
variables [add_comm_group N] [module R N] [module.free R N]
5252

53-
instance [nontrivial R] [module.finite R M] [module.finite R N] : module.free R (M →ₗ[R] N) :=
53+
instance linear_map [module.finite R M] [module.finite R N] : module.free R (M →ₗ[R] N) :=
5454
begin
55+
casesI subsingleton_or_nontrivial R,
56+
{ apply module.free.of_subsingleton' },
5557
classical,
5658
exact of_equiv
5759
(linear_map.to_matrix (module.free.choose_basis R M) (module.free.choose_basis R N)).symm,
@@ -72,9 +74,13 @@ instance _root_.module.finite.matrix {ι₁ : Type*} [fintype ι₁] {ι₂ : Ty
7274
module.finite R (matrix ι₁ ι₂ R) :=
7375
module.finite.of_basis $ pi.basis $ λ i, pi.basis_fun R _
7476

75-
instance [nontrivial R] [module.finite R M] [module.finite R N] :
77+
variables (M)
78+
79+
instance _root_.module.finite.linear_map [module.finite R M] [module.finite R N] :
7680
module.finite R (M →ₗ[R] N) :=
7781
begin
82+
casesI subsingleton_or_nontrivial R,
83+
{ apply_instance },
7884
classical,
7985
have f := (linear_map.to_matrix (choose_basis R M) (choose_basis R N)).symm,
8086
exact module.finite.of_surjective f.to_linear_map (linear_equiv.surjective f),
@@ -87,11 +93,14 @@ section integer
8793
variables [add_comm_group M] [module.finite ℤ M] [module.free ℤ M]
8894
variables [add_comm_group N] [module.finite ℤ N] [module.free ℤ N]
8995

90-
instance : module.finite ℤ (M →+ N) :=
96+
instance _root_.module.finite.add_monoid_hom : module.finite ℤ (M →+ N) :=
9197
module.finite.equiv (add_monoid_hom_lequiv_int ℤ).symm
9298

93-
instance : module.free ℤ (M →+ N) :=
94-
module.free.of_equiv (add_monoid_hom_lequiv_int ℤ).symm
99+
instance add_monoid_hom : module.free ℤ (M →+ N) :=
100+
begin
101+
letI : module.free ℤ (M →ₗ[ℤ] N) := module.free.linear_map _ _ _,
102+
exact module.free.of_equiv (add_monoid_hom_lequiv_int ℤ).symm
103+
end
95104

96105
end integer
97106

src/linear_algebra/multilinear/finite_dimensional.lean

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,59 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Oliver Nash
55
-/
66
import linear_algebra.multilinear.basic
7-
import linear_algebra.matrix.to_lin
7+
import linear_algebra.free_module.finite.basic
88

99
/-! # Multilinear maps over finite dimensional spaces
1010
11-
The main result of this file is `multilinear_map.finite_dimensional`.
11+
The main results are that multilinear maps over finitely-generated, free modules are
12+
finitely-generated and free.
1213
13-
We do not put this in `linear_algebra/multilinear_map/basic`, as `matrix.to_lin` pulls in a lot of
14-
imports, which can cause timeouts downstream.
14+
* `module.finite.multilinear_map`
15+
* `module.free.multilinear_map`
16+
17+
We do not put this in `linear_algebra/multilinear_map/basic` to avoid making the imports too large
18+
there.
1519
-/
1620

1721
namespace multilinear_map
1822

1923
variables {ι R M₂ : Type*} {M₁ : ι → Type*}
2024
variables [decidable_eq ι]
21-
variables [fintype ι] [field R] [add_comm_group M₂] [module R M₂] [finite_dimensional R M₂]
22-
variables [∀ i, add_comm_group (M₁ i)] [∀ i, module R (M₁ i)] [∀ i, finite_dimensional R (M₁ i)]
25+
variables [fintype ι] [comm_ring R] [add_comm_group M₂] [module R M₂]
26+
variables [Π i, add_comm_group (M₁ i)] [Π i, module R (M₁ i)]
27+
variables [module.finite R M₂] [module.free R M₂]
28+
variables [∀ i, module.finite R (M₁ i)] [∀ i, module.free R (M₁ i)]
2329

24-
instance : finite_dimensional R (multilinear_map R M₁ M₂) :=
30+
-- the induction requires us to show both at once
31+
private lemma free_and_finite :
32+
module.free R (multilinear_map R M₁ M₂) ∧ module.finite R (multilinear_map R M₁ M₂) :=
2533
begin
26-
suffices : ∀ n (N : fin n → Type*) [∀ i, add_comm_group (N i)],
27-
by exactI ∀ [∀ i, module R (N i)], by exactI ∀ [∀ i, finite_dimensional R (N i)],
28-
finite_dimensional R (multilinear_map R N M₂),
29-
{ haveI := this _ (M₁ ∘ (fintype.equiv_fin ι).symm),
34+
-- the `fin n` case is sufficient
35+
suffices : ∀ n (N : fin n → Type*) [Π i, add_comm_group (N i)],
36+
by exactI ∀ [Π i, module R (N i)],
37+
by exactI ∀ [∀ i, module.finite R (N i)] [∀ i, module.free R (N i)],
38+
module.free R (multilinear_map R N M₂) ∧ module.finite R (multilinear_map R N M₂),
39+
{ casesI this _ (M₁ ∘ (fintype.equiv_fin ι).symm),
3040
have e := dom_dom_congr_linear_equiv' R M₁ M₂ (fintype.equiv_fin ι),
31-
exact e.symm.finite_dimensional, },
32-
intros,
33-
induction n with n ih,
34-
{ exactI (const_linear_equiv_of_is_empty R N M₂ : _).finite_dimensional, },
35-
{ resetI,
36-
suffices : finite_dimensional R (N 0 →ₗ[R] multilinear_map R (λ (i : fin n), N i.succ) M₂),
37-
{ exact (multilinear_curry_left_equiv R N M₂).finite_dimensional, },
38-
apply linear_map.finite_dimensional, },
41+
exact ⟨module.free.of_equiv e.symm, module.finite.equiv e.symm⟩, },
42+
introsI n N _ _ _ _,
43+
unfreezingI { induction n with n ih },
44+
{ exact ⟨module.free.of_equiv (const_linear_equiv_of_is_empty R N M₂),
45+
module.finite.equiv (const_linear_equiv_of_is_empty R N M₂)⟩ },
46+
{ suffices :
47+
module.free R (N 0 →ₗ[R] multilinear_map R (λ (i : fin n), N i.succ) M₂) ∧
48+
module.finite R (N 0 →ₗ[R] multilinear_map R (λ (i : fin n), N i.succ) M₂),
49+
{ casesI this,
50+
exact ⟨module.free.of_equiv (multilinear_curry_left_equiv R N M₂),
51+
module.finite.equiv (multilinear_curry_left_equiv R N M₂)⟩ },
52+
casesI ih (λ i, N i.succ),
53+
exact ⟨module.free.linear_map _ _ _, module.finite.linear_map _ _⟩ },
3954
end
4055

56+
instance _root_.module.finite.multilinear_map : module.finite R (multilinear_map R M₁ M₂) :=
57+
free_and_finite.2
58+
59+
instance _root_.module.free.multilinear_map : module.free R (multilinear_map R M₁ M₂) :=
60+
free_and_finite.1
61+
4162
end multilinear_map

src/ring_theory/noetherian.lean

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -674,17 +674,22 @@ lemma is_noetherian_ring_iff_ideal_fg (R : Type*) [semiring R] :
674674
is_noetherian_ring_iff.trans is_noetherian_def
675675

676676
@[priority 80] -- see Note [lower instance priority]
677-
instance ring.is_noetherian_of_fintype (R M) [fintype M] [semiring R] [add_comm_monoid M]
678-
[module R M] :
677+
instance is_noetherian_of_fintype (R M) [fintype M] [semiring R] [add_comm_monoid M] [module R M] :
679678
is_noetherian R M :=
680679
by letI := classical.dec; exact
681680
⟨assume s, ⟨to_finset s, by rw [set.coe_to_finset, submodule.span_eq]⟩⟩
682681

683-
theorem ring.is_noetherian_of_zero_eq_one {R} [semiring R] (h01 : (0 : R) = 1) :
682+
/-- Modules over the trivial ring are Noetherian. -/
683+
@[priority 100] -- see Note [lower instance priority]
684+
instance is_noetherian_of_subsingleton (R M) [subsingleton R] [semiring R] [add_comm_monoid M]
685+
[module R M] : is_noetherian R M :=
686+
by haveI := module.subsingleton R M;
687+
exact is_noetherian_of_fintype R M
688+
689+
@[priority 100] -- see Note [lower instance priority]
690+
instance ring.is_noetherian_of_subsingleton {R} [semiring R] [subsingleton R] :
684691
is_noetherian_ring R :=
685-
by haveI := subsingleton_of_zero_eq_one h01;
686-
haveI := fintype.of_subsingleton (0:R);
687-
exact is_noetherian_ring_iff.2 (ring.is_noetherian_of_fintype R R)
692+
⟨⟩
688693

689694
theorem is_noetherian_of_submodule_of_noetherian (R M) [semiring R] [add_comm_monoid M] [module R M]
690695
(N : submodule R M) (h : is_noetherian R M) : is_noetherian R N :=

0 commit comments

Comments
 (0)