Skip to content

Commit

Permalink
feat(linear_algebra/basic): add_monoid_hom_lequiv_int (#7629)
Browse files Browse the repository at this point in the history
From LTE.



Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
  • Loading branch information
semorrison and semorrison committed May 17, 2021
1 parent d201a18 commit 36e0127
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/algebra/module/basic.lean
Expand Up @@ -338,6 +338,10 @@ end add_comm_group

namespace add_monoid_hom

lemma map_nat_module_smul [add_comm_monoid M] [add_comm_monoid M₂]
(f : M →+ M₂) (x : ℕ) (a : M) : f (x • a) = x • f a :=
by simp only [f.map_nsmul]

lemma map_int_module_smul [add_comm_group M] [add_comm_group M₂]
(f : M →+ M₂) (x : ℤ) (a : M) : f (x • a) = x • f a :=
by simp only [f.map_gsmul]
Expand Down
5 changes: 5 additions & 0 deletions src/algebra/module/linear_map.lean
Expand Up @@ -321,6 +321,11 @@ end is_linear_map
abbreviation module.End (R : Type u) (M : Type v)
[semiring R] [add_comm_monoid M] [module R M] := M →ₗ[R] M

/-- Reinterpret an additive homomorphism as a `ℕ`-linear map. -/
def add_monoid_hom.to_nat_linear_map [add_comm_monoid M] [add_comm_monoid M₂] (f : M →+ M₂) :
M →ₗ[ℕ] M₂ :=
⟨f, f.map_add, f.map_nat_module_smul⟩

/-- Reinterpret an additive homomorphism as a `ℤ`-linear map. -/
def add_monoid_hom.to_int_linear_map [add_comm_group M] [add_comm_group M₂] (f : M →+ M₂) :
M →ₗ[ℤ] M₂ :=
Expand Down
27 changes: 26 additions & 1 deletion src/linear_algebra/basic.lean
Expand Up @@ -460,7 +460,6 @@ def applyₗ' : M →+ (M →ₗ[R] M₂) →ₗ[S] M₂ :=
map_zero' := linear_map.ext $ λ f, f.map_zero,
map_add' := λ x y, linear_map.ext $ λ f, f.map_add _ _ }


section
variables (R M)

Expand Down Expand Up @@ -571,6 +570,32 @@ end comm_ring

end linear_map

/--
The `ℕ`-linear equivalence between additive morphisms `A →+ B` and `ℕ`-linear morphisms `A →ₗ[ℕ] B`.
-/
@[simps]
def add_monoid_hom_lequiv_nat {A B : Type*} [add_comm_monoid A] [add_comm_monoid B] :
(A →+ B) ≃ₗ[ℕ] (A →ₗ[ℕ] B) :=
{ to_fun := add_monoid_hom.to_nat_linear_map,
inv_fun := linear_map.to_add_monoid_hom,
map_add' := by { intros, ext, refl },
map_smul' := by { intros, ext, refl },
left_inv := by { intros f, ext, refl },
right_inv := by { intros f, ext, refl } }

/--
The `ℤ`-linear equivalence between additive morphisms `A →+ B` and `ℤ`-linear morphisms `A →ₗ[ℤ] B`.
-/
@[simps]
def add_monoid_hom_lequiv_int {A B : Type*} [add_comm_group A] [add_comm_group B] :
(A →+ B) ≃ₗ[ℤ] (A →ₗ[ℤ] B) :=
{ to_fun := add_monoid_hom.to_int_linear_map,
inv_fun := linear_map.to_add_monoid_hom,
map_add' := by { intros, ext, refl },
map_smul' := by { intros, ext, refl },
left_inv := by { intros f, ext, refl },
right_inv := by { intros f, ext, refl } }

/-! ### Properties of submodules -/

namespace submodule
Expand Down

0 comments on commit 36e0127

Please sign in to comment.