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

Commit d0804ba

Browse files
committed
feat(linear_algebra/invariant_basis_number): basic API lemmas (#7882)
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
1 parent 3b37614 commit d0804ba

File tree

6 files changed

+61
-14
lines changed

6 files changed

+61
-14
lines changed

src/algebra/module/linear_map.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,11 @@ symm_bijective.injective $ ext $ λ x, rfl
584584
{ to_fun := f, inv_fun := e,
585585
..(⟨e, h₁, h₂, f, h₃, h₄⟩ : M ≃ₗ[R] M₂).symm } := rfl
586586

587+
@[simp] lemma coe_symm_mk [module R M] [module R M₂]
588+
{to_fun inv_fun map_add map_smul left_inv right_inv} :
589+
⇑((⟨to_fun, map_add, map_smul, inv_fun, left_inv, right_inv⟩ : M ≃ₗ[R] M₂).symm) = inv_fun :=
590+
rfl
591+
587592
protected lemma bijective : function.bijective e := e.to_equiv.bijective
588593
protected lemma injective : function.injective e := e.to_equiv.injective
589594
protected lemma surjective : function.surjective e := e.to_equiv.surjective

src/linear_algebra/basic.lean

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,36 +82,38 @@ begin
8282
{ intro i, exact (h i).map_zero },
8383
end
8484

85-
variable (R)
85+
variables (α : Type*) [fintype α]
86+
variables (R M) [add_comm_monoid M] [semiring R] [module R M]
8687

8788
/-- Given `fintype α`, `linear_equiv_fun_on_fintype R` is the natural `R`-linear equivalence between
8889
`α →₀ β` and `α → β`. -/
89-
@[simps apply] noncomputable def linear_equiv_fun_on_fintype {α} [fintype α] [add_comm_monoid M]
90-
[semiring R] [module R M] :
90+
@[simps apply] noncomputable def linear_equiv_fun_on_fintype :
9191
(α →₀ M) ≃ₗ[R] (α → M) :=
9292
{ to_fun := coe_fn,
9393
map_add' := λ f g, by { ext, refl },
9494
map_smul' := λ c f, by { ext, refl },
9595
.. equiv_fun_on_fintype }
9696

97-
@[simp] lemma linear_equiv_fun_on_fintype_single {α} [decidable_eq α] [fintype α]
98-
[add_comm_monoid M] [semiring R] [module R M] (x : α) (m : M) :
99-
(@linear_equiv_fun_on_fintype R M α _ _ _ _) (single x m) = pi.single x m :=
97+
@[simp] lemma linear_equiv_fun_on_fintype_single [decidable_eq α] (x : α) (m : M) :
98+
(linear_equiv_fun_on_fintype R M α) (single x m) = pi.single x m :=
10099
begin
101100
ext a,
102101
change (equiv_fun_on_fintype (single x m)) a = _,
103102
convert _root_.congr_fun (equiv_fun_on_fintype_single x m) a,
104103
end
105104

106-
@[simp] lemma linear_equiv_fun_on_fintype_symm_single {α} [decidable_eq α] [fintype α]
107-
[add_comm_monoid M] [semiring R] [module R M] (x : α) (m : M) :
108-
(@linear_equiv_fun_on_fintype R M α _ _ _ _).symm (pi.single x m) = single x m :=
105+
@[simp] lemma linear_equiv_fun_on_fintype_symm_single [decidable_eq α]
106+
(x : α) (m : M) : (linear_equiv_fun_on_fintype R M α).symm (pi.single x m) = single x m :=
109107
begin
110108
ext a,
111109
change (equiv_fun_on_fintype.symm (pi.single x m)) a = _,
112110
convert congr_fun (equiv_fun_on_fintype_symm_single x m) a,
113111
end
114112

113+
@[simp] lemma linear_equiv_fun_on_fintype_symm_coe (f : α →₀ M) :
114+
(linear_equiv_fun_on_fintype R M α).symm f = f :=
115+
by { ext, simp [linear_equiv_fun_on_fintype], }
116+
115117
end finsupp
116118

117119
section

src/linear_algebra/basis.lean

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -644,8 +644,7 @@ calc card M = card (ι → R) : card_congr b.equiv_fun.to_equiv
644644
a function `x : ι → R` to the linear combination `∑_i x i • v i`. -/
645645
@[simp] lemma basis.equiv_fun_symm_apply (x : ι → R) :
646646
b.equiv_fun.symm x = ∑ i, x i • b i :=
647-
by { simp [basis.equiv_fun, finsupp.total_apply, finsupp.sum_fintype],
648-
refl }
647+
by simp [basis.equiv_fun, finsupp.total_apply, finsupp.sum_fintype]
649648

650649
@[simp]
651650
lemma basis.equiv_fun_apply (u : M) : b.equiv_fun u = b.repr u := rfl
@@ -666,7 +665,7 @@ by { rw [b.equiv_fun_apply, b.repr_self_apply] }
666665
/-- Define a basis by mapping each vector `x : M` to its coordinates `e x : ι → R`,
667666
as long as `ι` is finite. -/
668667
def basis.of_equiv_fun (e : M ≃ₗ[R] (ι → R)) : basis ι R M :=
669-
basis.of_repr $ e.trans $ linear_equiv.symm $ finsupp.linear_equiv_fun_on_fintype R
668+
basis.of_repr $ e.trans $ linear_equiv.symm $ finsupp.linear_equiv_fun_on_fintype R R ι
670669

671670
@[simp] lemma basis.of_equiv_fun_repr_apply (e : M ≃ₗ[R] (ι → R)) (x : M) (i : ι) :
672671
(basis.of_equiv_fun e).repr x i = e x i := rfl

src/linear_algebra/finite_dimensional.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ end linear_equiv
697697

698698
instance finite_dimensional_finsupp {ι : Type*} [fintype ι] [finite_dimensional K V] :
699699
finite_dimensional K (ι →₀ V) :=
700-
(finsupp.linear_equiv_fun_on_fintype K : (ι →₀ V) ≃ₗ[K] (ι → V)).symm.finite_dimensional
700+
(finsupp.linear_equiv_fun_on_fintype K V ι).symm.finite_dimensional
701701

702702
namespace finite_dimensional
703703

src/linear_algebra/finsupp.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ lemma splitting_of_finsupp_surjective_injective (f : M →ₗ[R] (α →₀ R))
928928
def splitting_of_fun_on_fintype_surjective [fintype α] (f : M →ₗ[R] (α → R)) (s : surjective f) :
929929
(α → R) →ₗ[R] M :=
930930
(finsupp.lift _ _ _ (λ x : α, (s (finsupp.single x 1)).some)).comp
931-
(@linear_equiv_fun_on_fintype R R α _ _ _ _).symm.to_linear_map
931+
(linear_equiv_fun_on_fintype R R α).symm.to_linear_map
932932

933933
lemma splitting_of_fun_on_fintype_surjective_splits
934934
[fintype α] (f : M →ₗ[R] (α → R)) (s : surjective f) :

src/linear_algebra/invariant_basis_number.lean

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,24 @@ lemma le_of_fin_injective [strong_rank_condition R] {n m : ℕ} (f : (fin n →
7878
injective f → n ≤ m :=
7979
strong_rank_condition.le_of_fin_injective f
8080

81+
lemma card_le_of_injective [strong_rank_condition R] {α β : Type*} [fintype α] [fintype β]
82+
(f : (α → R) →ₗ[R] (β → R)) (i : injective f) : fintype.card α ≤ fintype.card β :=
83+
begin
84+
let P := linear_map.fun_congr_left R R (fintype.equiv_fin α),
85+
let Q := linear_map.fun_congr_left R R (fintype.equiv_fin β),
86+
exact le_of_fin_injective R ((Q.symm.to_linear_map.comp f).comp P.to_linear_map)
87+
(((linear_equiv.symm Q).injective.comp i).comp (linear_equiv.injective P)),
88+
end
89+
90+
lemma card_le_of_injective' [strong_rank_condition R] {α β : Type*} [fintype α] [fintype β]
91+
(f : (α →₀ R) →ₗ[R] (β →₀ R)) (i : injective f) : fintype.card α ≤ fintype.card β :=
92+
begin
93+
let P := (finsupp.linear_equiv_fun_on_fintype R R β),
94+
let Q := (finsupp.linear_equiv_fun_on_fintype R R α).symm,
95+
exact card_le_of_injective R ((P.to_linear_map.comp f).comp Q.to_linear_map)
96+
((P.injective.comp i).comp Q.injective)
97+
end
98+
8199
/-- We say that `R` satisfies the rank condition if `(fin n → R) →ₗ[R] (fin m → R)` surjective
82100
implies `m ≤ n`. -/
83101
class rank_condition : Prop :=
@@ -87,6 +105,24 @@ lemma le_of_fin_surjective [rank_condition R] {n m : ℕ} (f : (fin n → R) →
87105
surjective f → m ≤ n :=
88106
rank_condition.le_of_fin_surjective f
89107

108+
lemma card_le_of_surjective [rank_condition R] {α β : Type*} [fintype α] [fintype β]
109+
(f : (α → R) →ₗ[R] (β → R)) (i : surjective f) : fintype.card β ≤ fintype.card α :=
110+
begin
111+
let P := linear_map.fun_congr_left R R (fintype.equiv_fin α),
112+
let Q := linear_map.fun_congr_left R R (fintype.equiv_fin β),
113+
exact le_of_fin_surjective R ((Q.symm.to_linear_map.comp f).comp P.to_linear_map)
114+
(((linear_equiv.symm Q).surjective.comp i).comp (linear_equiv.surjective P)),
115+
end
116+
117+
lemma card_le_of_surjective' [rank_condition R] {α β : Type*} [fintype α] [fintype β]
118+
(f : (α →₀ R) →ₗ[R] (β →₀ R)) (i : surjective f) : fintype.card β ≤ fintype.card α :=
119+
begin
120+
let P := (finsupp.linear_equiv_fun_on_fintype R R β),
121+
let Q := (finsupp.linear_equiv_fun_on_fintype R R α).symm,
122+
exact card_le_of_surjective R ((P.to_linear_map.comp f).comp Q.to_linear_map)
123+
((P.surjective.comp i).comp Q.surjective)
124+
end
125+
90126
/--
91127
By the universal property for free modules, any surjective map `(fin n → R) →ₗ[R] (fin m → R)`
92128
has an injective splitting `(fin m → R) →ₗ[R] (fin n → R)`
@@ -117,6 +153,11 @@ variables (R : Type u) [ring R] [invariant_basis_number R]
117153
lemma eq_of_fin_equiv {n m : ℕ} : ((fin n → R) ≃ₗ[R] (fin m → R)) → n = m :=
118154
invariant_basis_number.eq_of_fin_equiv
119155

156+
lemma card_eq_of_lequiv {α β : Type*} [fintype α] [fintype β]
157+
(f : (α → R) ≃ₗ[R] (β → R)) : fintype.card α = fintype.card β :=
158+
eq_of_fin_equiv R (((linear_map.fun_congr_left R R (fintype.equiv_fin α)).trans f).trans
159+
((linear_map.fun_congr_left R R (fintype.equiv_fin β)).symm))
160+
120161
lemma nontrivial_of_invariant_basis_number : nontrivial R :=
121162
begin
122163
by_contra h,

0 commit comments

Comments
 (0)