File: Mathlib/Algebra/Module/LinearMap/Defs.lean

full_name: IsLinearMap.map_smul
code: /-- A map `f` between modules over a semiring is linear if it satisfies the two properties
`f (x + y) = f x + f y` and `f (c • x) = c • f x`. The predicate `IsLinearMap R f` asserts this
property. A bundled version is available with `LinearMap`, and should be favored over
`IsLinearMap` most of the time. -/
structure IsLinearMap (R : Type u) {M : Type v} {M₂ : Type w} [Semiring R] [AddCommMonoid M]
  [AddCommMonoid M₂] [Module R M] [Module R M₂] (f : M → M₂) : Prop where
  /-- A linear map preserves addition. -/
  map_add : ∀ x y, f (x + y) = f x + f y
  /-- A linear map preserves scalar multiplication. -/
  map_smul : ∀ (c : R) (x), f (c • x) = c • f x
goal: f (c • x) = c • f x

full_name: IsLinearMap
code: /-- A map `f` between modules over a semiring is linear if it satisfies the two properties
`f (x + y) = f x + f y` and `f (c • x) = c • f x`. The predicate `IsLinearMap R f` asserts this
property. A bundled version is available with `LinearMap`, and should be favored over
`IsLinearMap` most of the time. -/
structure IsLinearMap (R : Type u) {M : Type v} {M₂ : Type w} [Semiring R] [AddCommMonoid M]
  [AddCommMonoid M₂] [Module R M] [Module R M₂] (f : M → M₂) : Prop where
  /-- A linear map preserves addition. -/
  map_add : ∀ x y, f (x + y) = f x + f y
  /-- A linear map preserves scalar multiplication. -/
  map_smul : ∀ (c : R) (x), f (c • x) = c • f x
goal: Prop

full_name: IsLinearMap.map_add
code: /-- A map `f` between modules over a semiring is linear if it satisfies the two properties
`f (x + y) = f x + f y` and `f (c • x) = c • f x`. The predicate `IsLinearMap R f` asserts this
property. A bundled version is available with `LinearMap`, and should be favored over
`IsLinearMap` most of the time. -/
structure IsLinearMap (R : Type u) {M : Type v} {M₂ : Type w} [Semiring R] [AddCommMonoid M]
  [AddCommMonoid M₂] [Module R M] [Module R M₂] (f : M → M₂) : Prop where
  /-- A linear map preserves addition. -/
  map_add : ∀ x y, f (x + y) = f x + f y
  /-- A linear map preserves scalar multiplication. -/
  map_smul : ∀ (c : R) (x), f (c • x) = c • f x
goal: f (x + y) = f x + f y

full_name: LinearMap
code: /-- A map `f` between an `R`-module and an `S`-module over a ring homomorphism `σ : R →+* S`
is semilinear if it satisfies the two properties `f (x + y) = f x + f y` and
`f (c • x) = (σ c) • f x`. Elements of `LinearMap σ M M₂` (available under the notation
`M →ₛₗ[σ] M₂`) are bundled versions of such maps. For plain linear maps (i.e. for which
`σ = RingHom.id R`), the notation `M →ₗ[R] M₂` is available. An unbundled version of plain linear
maps is available with the predicate `IsLinearMap`, but it should be avoided most of the time. -/
structure LinearMap {R S : Type*} [Semiring R] [Semiring S] (σ : R →+* S) (M : Type*)
    (M₂ : Type*) [AddCommMonoid M] [AddCommMonoid M₂] [Module R M] [Module S M₂] extends
    AddHom M M₂, MulActionHom σ M M₂
goal: Type (max u_19 u_20)

full_name: _aux_Mathlib_Algebra_Module_LinearMap_Defs___unexpand_LinearMap_1
code: /-- `M →ₛₗ[σ] N` is the type of `σ`-semilinear maps from `M` to `N`. -/
notation:25 M " →ₛₗ[" σ:25 "] " M₂:0 => LinearMap σ M M₂
goal: Lean.PrettyPrinter.Unexpander

full_name: «_aux_Mathlib_Algebra_Module_LinearMap_Defs___macroRules_term_→ₛₗ[_]__1»
code: /-- `M →ₛₗ[σ] N` is the type of `σ`-semilinear maps from `M` to `N`. -/
notation:25 M " →ₛₗ[" σ:25 "] " M₂:0 => LinearMap σ M M₂
goal: Lean.Macro

full_name: «_aux_Mathlib_Algebra_Module_LinearMap_Defs___macroRules_term_→ₗ[_]__1»
code: /-- `M →ₗ[R] N` is the type of `R`-linear maps from `M` to `N`. -/
notation:25 M " →ₗ[" R:25 "] " M₂:0 => LinearMap (RingHom.id R) M M₂
goal: Lean.Macro

full_name: _aux_Mathlib_Algebra_Module_LinearMap_Defs___unexpand_LinearMap_2
code: /-- `M →ₗ[R] N` is the type of `R`-linear maps from `M` to `N`. -/
notation:25 M " →ₗ[" R:25 "] " M₂:0 => LinearMap (RingHom.id R) M M₂
goal: Lean.PrettyPrinter.Unexpander

full_name: SemilinearMapClass
code: /-- `SemilinearMapClass F σ M M₂` asserts `F` is a type of bundled `σ`-semilinear maps `M → M₂`.

See also `LinearMapClass F R M M₂` for the case where `σ` is the identity map on `R`.

A map `f` between an `R`-module and an `S`-module over a ring homomorphism `σ : R →+* S`
is semilinear if it satisfies the two properties `f (x + y) = f x + f y` and
`f (c • x) = (σ c) • f x`. -/
class SemilinearMapClass (F : Type*) {R S : outParam Type*} [Semiring R] [Semiring S]
  (σ : outParam (R →+* S)) (M M₂ : outParam Type*) [AddCommMonoid M] [AddCommMonoid M₂]
    [Module R M] [Module S M₂] [FunLike F M M₂]
    extends AddHomClass F M M₂, MulActionSemiHomClass F σ M M₂ : Prop
goal: Prop

full_name: LinearMapClass
code: /-- `LinearMapClass F R M M₂` asserts `F` is a type of bundled `R`-linear maps `M → M₂`.

This is an abbreviation for `SemilinearMapClass F (RingHom.id R) M M₂`.
-/
abbrev LinearMapClass (F : Type*) (R : outParam Type*) (M M₂ : Type*)
    [Semiring R] [AddCommMonoid M] [AddCommMonoid M₂] [Module R M] [Module R M₂]
    [FunLike F M M₂] 
goal: Prop

full_name: LinearMapClass.map_smul
code: @[simp high]
protected lemma LinearMapClass.map_smul {R M M₂ : outParam Type*} [Semiring R] [AddCommMonoid M]
    [AddCommMonoid M₂] [Module R M] [Module R M₂]
    {F : Type*} [FunLike F M M₂] [LinearMapClass F R M M₂] (f : F) (r : R) (x : M) :
    f (r • x) = r • f x 
goal: f (r • x) = r • f x

full_name: SemilinearMapClass.instAddMonoidHomClass
code: instance (priority := 100) instAddMonoidHomClass [FunLike F M M₃] [SemilinearMapClass F σ M M₃] :
    AddMonoidHomClass F M M₃ 
goal: AddMonoidHomClass F M M₃

full_name: SemilinearMapClass.distribMulActionSemiHomClass
code: instance (priority := 100) distribMulActionSemiHomClass
    [FunLike F M M₃] [SemilinearMapClass F σ M M₃] :
    DistribMulActionSemiHomClass F σ M M₃ 
goal: DistribMulActionSemiHomClass F (⇑σ) M M₃

full_name: SemilinearMapClass.map_smul_inv
code: theorem map_smul_inv {σ' : S →+* R} [RingHomInvPair σ σ'] (c : S) (x : M) :
    c • f x = f (σ' c • x) 
goal: c • f x = f (σ' c • x)

full_name: SemilinearMapClass.semilinearMap
code: /-- Reinterpret an element of a type of semilinear maps as a semilinear map. -/
@[coe]
def semilinearMap : M →ₛₗ[σ] M₃ 
goal: M →ₛₗ[σ] M₃

full_name: SemilinearMapClass.instCoeToSemilinearMap
code: /-- Reinterpret an element of a type of semilinear maps as a semilinear map. -/
instance instCoeToSemilinearMap : CoeHead F (M →ₛₗ[σ] M₃) 
goal: CoeHead F (M →ₛₗ[σ] M₃)

full_name: LinearMapClass.linearMap
code: /-- Reinterpret an element of a type of linear maps as a linear map. -/
abbrev linearMap : M₁ →ₗ[R] M₂ 
goal: M₁ →ₗ[R] M₂

full_name: LinearMapClass.instCoeToLinearMap
code: /-- Reinterpret an element of a type of linear maps as a linear map. -/
instance instCoeToLinearMap : CoeHead F (M₁ →ₗ[R] M₂) 
goal: CoeHead F (M₁ →ₗ[R] M₂)

full_name: LinearMap.instFunLike
code: instance instFunLike : FunLike (M →ₛₗ[σ] M₃) M M₃ 
goal: FunLike (M →ₛₗ[σ] M₃) M M₃

full_name: LinearMap.semilinearMapClass
code: instance semilinearMapClass : SemilinearMapClass (M →ₛₗ[σ] M₃) σ M M₃ 
goal: SemilinearMapClass (M →ₛₗ[σ] M₃) σ M M₃

full_name: LinearMap.coe_coe
code: @[simp, norm_cast]
lemma coe_coe {F : Type*} [FunLike F M M₃] [SemilinearMapClass F σ M M₃] {f : F} :
    ⇑(f : M →ₛₗ[σ] M₃) = f 
goal: ⇑↑f = ⇑f

full_name: LinearMap.toDistribMulActionHom
code: /-- The `DistribMulActionHom` underlying a `LinearMap`. -/
def toDistribMulActionHom (f : M →ₛₗ[σ] M₃) : DistribMulActionHom σ.toMonoidHom M M₃ 
goal: M →ₑ+[↑σ] M₃

full_name: LinearMap.coe_toAddHom
code: @[simp]
theorem coe_toAddHom (f : M →ₛₗ[σ] M₃) : ⇑f.toAddHom = f 
goal: ⇑f.toAddHom = ⇑f

full_name: LinearMap.toFun_eq_coe
code: theorem toFun_eq_coe {f : M →ₛₗ[σ] M₃} : f.toFun = (f : M → M₃) 
goal: f.toFun = ⇑f

full_name: LinearMap.ext
code: @[ext]
theorem ext {f g : M →ₛₗ[σ] M₃} (h : ∀ x, f x = g x) : f = g 
goal: f = g

full_name: LinearMap.copy
code: /-- Copy of a `LinearMap` with a new `toFun` equal to the old one. Useful to fix definitional
equalities. -/
protected def copy (f : M →ₛₗ[σ] M₃) (f' : M → M₃) (h : f' = ⇑f) : M →ₛₗ[σ] M₃ 
goal: M →ₛₗ[σ] M₃

full_name: LinearMap.coe_copy
code: @[simp]
theorem coe_copy (f : M →ₛₗ[σ] M₃) (f' : M → M₃) (h : f' = ⇑f) : ⇑(f.copy f' h) = f' 
goal: ⇑(f.copy f' h) = f'

full_name: LinearMap.copy_eq
code: theorem copy_eq (f : M →ₛₗ[σ] M₃) (f' : M → M₃) (h : f' = ⇑f) : f.copy f' h = f 
goal: f.copy f' h = f

full_name: LinearMap.coe_mk
code: @[simp]
theorem coe_mk {σ : R →+* S} (f : AddHom M M₃) (h) :
    ((LinearMap.mk f h : M →ₛₗ[σ] M₃) : M → M₃) = f 
goal: ⇑{ toAddHom := f, map_smul' := h } = ⇑f

full_name: LinearMap.coe_addHom_mk
code: @[simp]
theorem coe_addHom_mk {σ : R →+* S} (f : AddHom M M₃) (h) :
    ((LinearMap.mk f h : M →ₛₗ[σ] M₃) : AddHom M M₃) = f 
goal: ↑{ toAddHom := f, map_smul' := h } = f

full_name: LinearMap.coe_semilinearMap
code: theorem coe_semilinearMap {F : Type*} [FunLike F M M₃] [SemilinearMapClass F σ M M₃] (f : F) :
    ((f : M →ₛₗ[σ] M₃) : M → M₃) = f 
goal: ⇑↑f = ⇑f

full_name: LinearMap.toLinearMap_injective
code: theorem toLinearMap_injective {F : Type*} [FunLike F M M₃] [SemilinearMapClass F σ M M₃]
    {f g : F} (h : (f : M →ₛₗ[σ] M₃) = (g : M →ₛₗ[σ] M₃)) :
    f = g 
goal: f = g

full_name: LinearMap.id
code: /-- Identity map as a `LinearMap` -/
def id : M →ₗ[R] M 
goal: M →ₗ[R] M

full_name: LinearMap.id_apply
code: theorem id_apply (x : M) : @id R M _ _ _ x = x 
goal: LinearMap.id x = x

full_name: LinearMap.id_coe
code: @[simp, norm_cast]
theorem id_coe : ((LinearMap.id : M →ₗ[R] M) : M → M) = _root_.id 
goal: ⇑LinearMap.id = id

full_name: LinearMap.id'_apply
code: /-- A generalisation of `LinearMap.id` that constructs the identity function
as a `σ`-semilinear map for any ring homomorphism `σ` which we know is the identity. -/
@[simps]
def id' {σ : R →+* R} [RingHomId σ] : M →ₛₗ[σ] M 
goal: LinearMap.id' x = x

full_name: LinearMap.id'
code: /-- A generalisation of `LinearMap.id` that constructs the identity function
as a `σ`-semilinear map for any ring homomorphism `σ` which we know is the identity. -/
@[simps]
def id' {σ : R →+* R} [RingHomId σ] : M →ₛₗ[σ] M 
goal: M →ₛₗ[σ] M

full_name: LinearMap.id'_coe
code: @[simp, norm_cast]
theorem id'_coe {σ : R →+* R} [RingHomId σ] : ((id' : M →ₛₗ[σ] M) : M → M) = _root_.id 
goal: ⇑LinearMap.id' = id

full_name: LinearMap.isLinear
code: theorem isLinear : IsLinearMap R fₗ 
goal: IsLinearMap R ⇑fₗ

full_name: LinearMap.coe_injective
code: theorem coe_injective : Injective (DFunLike.coe : (M →ₛₗ[σ] M₃) → _) 
goal: Function.Injective DFunLike.coe

full_name: LinearMap.congr_arg
code: protected theorem congr_arg {x x' : M} : x = x' → f x = f x' 
goal: x = x' → f x = f x'

full_name: LinearMap.congr_fun
code: /-- If two linear maps are equal, they are equal at each point. -/
protected theorem congr_fun (h : f = g) (x : M) : f x = g x 
goal: f x = g x

full_name: LinearMap.ext_iff
code: protected theorem ext_iff : f = g ↔ ∀ x, f x = g x 
goal: f = g ↔ ∀ (x : M), f x = g x

full_name: LinearMap.mk_coe
code: @[simp]
theorem mk_coe (f : M →ₛₗ[σ] M₃) (h) : (LinearMap.mk f h : M →ₛₗ[σ] M₃) = f 
goal: { toAddHom := ↑f, map_smul' := h } = f

full_name: LinearMap.map_add
code: protected theorem map_add (x y : M) : f (x + y) = f x + f y 
goal: f (x + y) = f x + f y

full_name: LinearMap.map_zero
code: protected theorem map_zero : f 0 = 0 
goal: f 0 = 0

full_name: LinearMap.map_smulₛₗ
code: @[simp]
protected theorem map_smulₛₗ (c : R) (x : M) : f (c • x) = σ c • f x 
goal: f (c • x) = σ c • f x

full_name: LinearMap.map_smul
code: protected theorem map_smul (c : R) (x : M) : fₗ (c • x) = c • fₗ x 
goal: fₗ (c • x) = c • fₗ x

full_name: LinearMap.map_smul_inv
code: protected theorem map_smul_inv {σ' : S →+* R} [RingHomInvPair σ σ'] (c : S) (x : M) :
    c • f x = f (σ' c • x) 
goal: c • f x = f (σ' c • x)

full_name: LinearMap.map_eq_zero_iff
code: @[simp]
theorem map_eq_zero_iff (h : Function.Injective f) {x : M} : f x = 0 ↔ x = 0 
goal: f x = 0 ↔ x = 0

full_name: LinearMap.CompatibleSMul
code: /-- A typeclass for `SMul` structures which can be moved through a `LinearMap`.
This typeclass is generated automatically from an `IsScalarTower` instance, but exists so that
we can also add an instance for `AddCommGroup.intModule`, allowing `z •` to be moved even if
`S` does not support negation.
-/
class CompatibleSMul (R S : Type*) [Semiring S] [SMul R M] [Module S M] [SMul R M₂]
  [Module S M₂] : Prop where
  /-- Scalar multiplication by `R` of `M` can be moved through linear maps. -/
  map_smul : ∀ (fₗ : M →ₗ[S] M₂) (c : R) (x : M), fₗ (c • x) = c • fₗ x
goal: Prop

full_name: LinearMap.CompatibleSMul.map_smul
code: /-- A typeclass for `SMul` structures which can be moved through a `LinearMap`.
This typeclass is generated automatically from an `IsScalarTower` instance, but exists so that
we can also add an instance for `AddCommGroup.intModule`, allowing `z •` to be moved even if
`S` does not support negation.
-/
class CompatibleSMul (R S : Type*) [Semiring S] [SMul R M] [Module S M] [SMul R M₂]
  [Module S M₂] : Prop where
  /-- Scalar multiplication by `R` of `M` can be moved through linear maps. -/
  map_smul : ∀ (fₗ : M →ₗ[S] M₂) (c : R) (x : M), fₗ (c • x) = c • fₗ x
goal: fₗ (c • x) = c • fₗ x

full_name: LinearMap.IsScalarTower.compatibleSMul
code: instance (priority := 100) IsScalarTower.compatibleSMul [SMul R S]
    [IsScalarTower R S M] [IsScalarTower R S M₂] :
    CompatibleSMul M M₂ R S 
goal: LinearMap.CompatibleSMul M M₂ R S

full_name: LinearMap.IsScalarTower.compatibleSMul'
code: instance IsScalarTower.compatibleSMul' [SMul R S] [IsScalarTower R S M] :
    CompatibleSMul S M R S 
goal: LinearMap.CompatibleSMul S M R S

full_name: LinearMap.map_smul_of_tower
code: @[simp]
theorem map_smul_of_tower [CompatibleSMul M M₂ R S] (fₗ : M →ₗ[S] M₂) (c : R) (x : M) :
    fₗ (c • x) = c • fₗ x 
goal: fₗ (c • x) = c • fₗ x

full_name: LinearMap.isScalarTower_of_injective
code: theorem isScalarTower_of_injective [SMul R S] [CompatibleSMul M M₂ R S] [IsScalarTower R S M₂]
    (f : M →ₗ[S] M₂) (hf : Function.Injective f) : IsScalarTower R S M 
goal: IsScalarTower R S M

full_name: LinearMap.isLinearMap_of_compatibleSMul
code: theorem isLinearMap_of_compatibleSMul [Module S M] [Module S M₂] [CompatibleSMul M M₂ R S]
    (f : M →ₗ[S] M₂) : IsLinearMap R f 
goal: IsLinearMap R ⇑f

full_name: LinearMap.toAddMonoidHom
code: /-- convert a linear map to an additive map -/
def toAddMonoidHom : M →+ M₃ 
goal: M →+ M₃

full_name: LinearMap.toAddMonoidHom_coe
code: @[simp]
theorem toAddMonoidHom_coe : ⇑f.toAddMonoidHom = f 
goal: ⇑f.toAddMonoidHom = ⇑f

full_name: LinearMap.restrictScalars
code: /-- If `M` and `M₂` are both `R`-modules and `S`-modules and `R`-module structures
are defined by an action of `R` on `S` (formally, we have two scalar towers), then any `S`-linear
map from `M` to `M₂` is `R`-linear.

See also `LinearMap.map_smul_of_tower`. -/
@[coe] def restrictScalars (fₗ : M →ₗ[S] M₂) : M →ₗ[R] M₂ 
goal: M →ₗ[R] M₂

full_name: LinearMap.coeIsScalarTower
code: instance coeIsScalarTower : CoeHTCT (M →ₗ[S] M₂) (M →ₗ[R] M₂) 
goal: CoeHTCT (M →ₗ[S] M₂) (M →ₗ[R] M₂)

full_name: LinearMap.coe_restrictScalars
code: @[simp, norm_cast]
theorem coe_restrictScalars (f : M →ₗ[S] M₂) : ((f : M →ₗ[R] M₂) : M → M₂) = f 
goal: ⇑(↑R f) = ⇑f

full_name: LinearMap.restrictScalars_apply
code: theorem restrictScalars_apply (fₗ : M →ₗ[S] M₂) (x) : restrictScalars R fₗ x = fₗ x 
goal: (↑R fₗ) x = fₗ x

full_name: LinearMap.restrictScalars_injective
code: theorem restrictScalars_injective :
    Function.Injective (restrictScalars R : (M →ₗ[S] M₂) → M →ₗ[R] M₂) 
goal: Function.Injective ↑R

full_name: LinearMap.restrictScalars_inj
code: @[simp]
theorem restrictScalars_inj (fₗ gₗ : M →ₗ[S] M₂) :
    fₗ.restrictScalars R = gₗ.restrictScalars R ↔ fₗ = gₗ 
goal: ↑R fₗ = ↑R gₗ ↔ fₗ = gₗ

full_name: LinearMap.toAddMonoidHom_injective
code: theorem toAddMonoidHom_injective :
    Function.Injective (toAddMonoidHom : (M →ₛₗ[σ] M₃) → M →+ M₃) 
goal: Function.Injective LinearMap.toAddMonoidHom

full_name: LinearMap.ext_ring
code: /-- If two `σ`-linear maps from `R` are equal on `1`, then they are equal. -/
@[ext high]
theorem ext_ring {f g : R →ₛₗ[σ] M₃} (h : f 1 = g 1) : f = g 
goal: f = g

full_name: LinearMap.ext_ring_iff
code: theorem ext_ring_iff {σ : R →+* R} {f g : R →ₛₗ[σ] M} : f = g ↔ f 1 = g 1 
goal: f = g ↔ f 1 = g 1

full_name: LinearMap.ext_ring_op
code: @[ext high]
theorem ext_ring_op {σ : Rᵐᵒᵖ →+* S} {f g : R →ₛₗ[σ] M₃} (h : f (1 : R) = g (1 : R)) :
    f = g 
goal: f = g

full_name: RingHom.toSemilinearMap
code: /-- Interpret a `RingHom` `f` as an `f`-semilinear map. -/
@[simps]
def _root_.RingHom.toSemilinearMap (f : R →+* S) : R →ₛₗ[f] S 
goal: R →ₛₗ[f] S

full_name: RingHom.toSemilinearMap_apply
code: /-- Interpret a `RingHom` `f` as an `f`-semilinear map. -/
@[simps]
def _root_.RingHom.toSemilinearMap (f : R →+* S) : R →ₛₗ[f] S 
goal: ∀ (a : R), f.toSemilinearMap a = (↑↑f).toFun a

full_name: LinearMap.comp
code: /-- Composition of two linear maps is a linear map -/
def comp [RingHomCompTriple σ₁₂ σ₂₃ σ₁₃] (f : M₂ →ₛₗ[σ₂₃] M₃) (g : M₁ →ₛₗ[σ₁₂] M₂) :
    M₁ →ₛₗ[σ₁₃] M₃ 
goal: M₁ →ₛₗ[σ₁₃] M₃

full_name: LinearMap._aux_Mathlib_Algebra_Module_LinearMap_Defs___macroRules_LinearMap_compNotation_1
code: /-- `∘ₗ` is notation for composition of two linear (not semilinear!) maps into a linear map.
This is useful when Lean is struggling to infer the `RingHomCompTriple` instance. -/
notation3:80 (name := compNotation) f:81 " ∘ₗ " g:80 =>
  LinearMap.comp (σ₁₂ := RingHom.id _) (σ₂₃ := RingHom.id _) (σ₁₃ := RingHom.id _) f g
goal: Lean.Macro

full_name: LinearMap.comp_apply
code: theorem comp_apply (x : M₁) : f.comp g x = f (g x) 
goal: (f.comp g) x = f (g x)

full_name: LinearMap.coe_comp
code: @[simp, norm_cast]
theorem coe_comp : (f.comp g : M₁ → M₃) = f ∘ g 
goal: ⇑(f.comp g) = ⇑f ∘ ⇑g

full_name: LinearMap.comp_id
code: @[simp]
theorem comp_id : f.comp id = f 
goal: f.comp LinearMap.id = f

full_name: LinearMap.id_comp
code: @[simp]
theorem id_comp : id.comp f = f 
goal: LinearMap.id.comp f = f

full_name: LinearMap.comp_assoc
code: theorem comp_assoc
    {R₄ M₄ : Type*} [Semiring R₄] [AddCommMonoid M₄] [Module R₄ M₄]
    {σ₃₄ : R₃ →+* R₄} {σ₂₄ : R₂ →+* R₄} {σ₁₄ : R₁ →+* R₄}
    [RingHomCompTriple σ₂₃ σ₃₄ σ₂₄] [RingHomCompTriple σ₁₃ σ₃₄ σ₁₄] [RingHomCompTriple σ₁₂ σ₂₄ σ₁₄]
    (f : M₁ →ₛₗ[σ₁₂] M₂) (g : M₂ →ₛₗ[σ₂₃] M₃) (h : M₃ →ₛₗ[σ₃₄] M₄) :
    ((h.comp g : M₂ →ₛₗ[σ₂₄] M₄).comp f : M₁ →ₛₗ[σ₁₄] M₄) = h.comp (g.comp f : M₁ →ₛₗ[σ₁₃] M₃) 
goal: (h.comp g).comp f = h.comp (g.comp f)

full_name: Function.Surjective.injective_linearMapComp_right
code: /-- The linear map version of `Function.Surjective.injective_comp_right` -/
lemma _root_.Function.Surjective.injective_linearMapComp_right (hg : Surjective g) :
    Injective fun f : M₂ →ₛₗ[σ₂₃] M₃ ↦ f.comp g 
goal: Function.Injective fun f => f.comp g

full_name: LinearMap.cancel_right
code: @[simp]
theorem cancel_right (hg : Surjective g) : f.comp g = f'.comp g ↔ f = f' 
goal: f.comp g = f'.comp g ↔ f = f'

full_name: Function.Injective.injective_linearMapComp_left
code: /-- The linear map version of `Function.Injective.comp_left` -/
lemma _root_.Function.Injective.injective_linearMapComp_left (hf : Injective f) :
    Injective fun g : M₁ →ₛₗ[σ₁₂] M₂ ↦ f.comp g 
goal: Function.Injective fun g => f.comp g

full_name: LinearMap.cancel_left
code: @[simp]
theorem cancel_left (hf : Injective f) : f.comp g = f.comp g' ↔ g = g' 
goal: f.comp g = f.comp g' ↔ g = g'

full_name: LinearMap.inverse
code: /-- If a function `g` is a left and right inverse of a linear map `f`, then `g` is linear itself. -/
def inverse [Module R M] [Module S M₂] {σ : R →+* S} {σ' : S →+* R} [RingHomInvPair σ σ']
    (f : M →ₛₗ[σ] M₂) (g : M₂ → M) (h₁ : LeftInverse g f) (h₂ : RightInverse g f) :
    M₂ →ₛₗ[σ'] M 
goal: M₂ →ₛₗ[σ'] M

full_name: LinearMap.map_neg
code: protected theorem map_neg (x : M) : f (-x) = -f x 
goal: f (-x) = -f x

full_name: LinearMap.map_sub
code: protected theorem map_sub (x y : M) : f (x - y) = f x - f y 
goal: f (x - y) = f x - f y

full_name: LinearMap.CompatibleSMul.intModule
code: instance CompatibleSMul.intModule {S : Type*} [Semiring S] [Module S M] [Module S M₂] :
    CompatibleSMul M M₂ ℤ S 
goal: LinearMap.CompatibleSMul M M₂ ℤ S

full_name: LinearMap.CompatibleSMul.units
code: instance CompatibleSMul.units {R S : Type*} [Monoid R] [MulAction R M] [MulAction R M₂]
    [Semiring S] [Module S M] [Module S M₂] [CompatibleSMul M M₂ R S] : CompatibleSMul M M₂ Rˣ S 
goal: LinearMap.CompatibleSMul M M₂ Rˣ S

full_name: Module.compHom.toLinearMap
code: /-- `g : R →+* S` is `R`-linear when the module structure on `S` is `Module.compHom S g` . -/
@[simps]
def compHom.toLinearMap {R S : Type*} [Semiring R] [Semiring S] (g : R →+* S) :
    letI := compHom S g; R →ₗ[R] S 
goal: R →ₗ[R] S

full_name: Module.compHom.toLinearMap_apply
code: /-- `g : R →+* S` is `R`-linear when the module structure on `S` is `Module.compHom S g` . -/
@[simps]
def compHom.toLinearMap {R S : Type*} [Semiring R] [Semiring S] (g : R →+* S) :
    letI := compHom S g; R →ₗ[R] S 
goal: (Module.compHom.toLinearMap g) a = g a

full_name: DistribMulActionHom.toSemilinearMap
code: /-- A `DistribMulActionHom` between two modules is a linear map. -/
@[coe]
def toSemilinearMap (fₗ : M →ₑ+[σ.toMonoidHom] M₂) : M →ₛₗ[σ] M₂ 
goal: M →ₛₗ[σ] M₂

full_name: DistribMulActionHom.instSemilinearMapClass
code: instance : SemilinearMapClass (M →ₑ+[σ.toMonoidHom] M₂) σ M M₂ 
goal: SemilinearMapClass (M →ₑ+[↑σ] M₂) σ M M₂

full_name: DistribMulActionHom.instCoeTCSemilinearMap
code: instance instCoeTCSemilinearMap : CoeTC (M →ₑ+[σ.toMonoidHom] M₂) (M →ₛₗ[σ] M₂) 
goal: CoeTC (M →ₑ+[↑σ] M₂) (M →ₛₗ[σ] M₂)

full_name: DistribMulActionHom.toLinearMap
code: /-- A `DistribMulActionHom` between two modules is a linear map. -/
def toLinearMap (fₗ : M →+[R] M₃) : M →ₗ[R] M₃ 
goal: M →ₗ[R] M₃

full_name: DistribMulActionHom.instCoeTCLinearMap
code: instance instCoeTCLinearMap : CoeTC (M →+[R] M₃) (M →ₗ[R] M₃) 
goal: CoeTC (M →+[R] M₃) (M →ₗ[R] M₃)

full_name: DistribMulActionHom.instLinearMapClassId
code: /-- A `DistribMulActionHom` between two modules is a linear map. -/
instance : LinearMapClass (M →+[R] M₃) R M M₃ 
goal: LinearMapClass (M →+[R] M₃) R M M₃

full_name: DistribMulActionHom.coe_toLinearMap
code: @[simp]
theorem coe_toLinearMap (f : M →ₑ+[σ.toMonoidHom] M₂) : ((f : M →ₛₗ[σ] M₂) : M → M₂) = f 
goal: ⇑↑f = ⇑f

full_name: DistribMulActionHom.toLinearMap_injective
code: theorem toLinearMap_injective {f g : M →ₑ+[σ.toMonoidHom] M₂}
    (h : (f : M →ₛₗ[σ] M₂) = (g : M →ₛₗ[σ] M₂)) :
    f = g 
goal: f = g

full_name: IsLinearMap.mk'
code: /-- Convert an `IsLinearMap` predicate to a `LinearMap` -/
def mk' (f : M → M₂) (lin : IsLinearMap R f) : M →ₗ[R] M₂ 
goal: M →ₗ[R] M₂

full_name: IsLinearMap.mk'_apply
code: @[simp]
theorem mk'_apply {f : M → M₂} (lin : IsLinearMap R f) (x : M) : mk' f lin x = f x 
goal: (IsLinearMap.mk' f lin) x = f x

full_name: IsLinearMap.isLinearMap_smul
code: theorem isLinearMap_smul {R M : Type*} [CommSemiring R] [AddCommMonoid M] [Module R M] (c : R) :
    IsLinearMap R fun z : M ↦ c • z 
goal: IsLinearMap R fun z => c • z

full_name: IsLinearMap.isLinearMap_smul'
code: theorem isLinearMap_smul' {R M : Type*} [Semiring R] [AddCommMonoid M] [Module R M] (a : M) :
    IsLinearMap R fun c : R ↦ c • a 
goal: IsLinearMap R fun c => c • a

full_name: IsLinearMap.map_zero
code: theorem map_zero {f : M → M₂} (lin : IsLinearMap R f) : f (0 : M) = (0 : M₂) 
goal: f 0 = 0

full_name: IsLinearMap.isLinearMap_neg
code: theorem isLinearMap_neg : IsLinearMap R fun z : M ↦ -z 
goal: IsLinearMap R fun z => -z

full_name: IsLinearMap.map_neg
code: theorem map_neg {f : M → M₂} (lin : IsLinearMap R f) (x : M) : f (-x) = -f x 
goal: f (-x) = -f x

full_name: IsLinearMap.map_sub
code: theorem map_sub {f : M → M₂} (lin : IsLinearMap R f) (x y : M) : f (x - y) = f x - f y 
goal: f (x - y) = f x - f y

full_name: AddMonoidHom.toNatLinearMap
code: /-- Reinterpret an additive homomorphism as an `ℕ`-linear map. -/
def AddMonoidHom.toNatLinearMap [AddCommMonoid M] [AddCommMonoid M₂] (f : M →+ M₂) :
    M →ₗ[ℕ] M₂ 
goal: M →ₗ[ℕ] M₂

full_name: AddMonoidHom.toNatLinearMap_injective
code: theorem AddMonoidHom.toNatLinearMap_injective [AddCommMonoid M] [AddCommMonoid M₂] :
    Function.Injective (@AddMonoidHom.toNatLinearMap M M₂ _ _) 
goal: Function.Injective AddMonoidHom.toNatLinearMap

full_name: AddMonoidHom.toIntLinearMap
code: /-- Reinterpret an additive homomorphism as a `ℤ`-linear map. -/
def AddMonoidHom.toIntLinearMap [AddCommGroup M] [AddCommGroup M₂] (f : M →+ M₂) : M →ₗ[ℤ] M₂ 
goal: M →ₗ[ℤ] M₂

full_name: AddMonoidHom.toIntLinearMap_injective
code: theorem AddMonoidHom.toIntLinearMap_injective [AddCommGroup M] [AddCommGroup M₂] :
    Function.Injective (@AddMonoidHom.toIntLinearMap M M₂ _ _) 
goal: Function.Injective AddMonoidHom.toIntLinearMap

full_name: AddMonoidHom.coe_toIntLinearMap
code: @[simp]
theorem AddMonoidHom.coe_toIntLinearMap [AddCommGroup M] [AddCommGroup M₂] (f : M →+ M₂) :
    ⇑f.toIntLinearMap = f 
goal: ⇑f.toIntLinearMap = ⇑f

full_name: LinearMap.instSMul
code: instance : SMul S (M →ₛₗ[σ₁₂] M₂) 
goal: SMul S (M →ₛₗ[σ₁₂] M₂)

full_name: LinearMap.smul_apply
code: @[simp]
theorem smul_apply (a : S) (f : M →ₛₗ[σ₁₂] M₂) (x : M) : (a • f) x = a • f x 
goal: (a • f) x = a • f x

full_name: LinearMap.coe_smul
code: theorem coe_smul (a : S) (f : M →ₛₗ[σ₁₂] M₂) : (a • f : M →ₛₗ[σ₁₂] M₂) = a • (f : M → M₂) 
goal: ⇑(a • f) = a • ⇑f

full_name: LinearMap.instSMulCommClass
code: instance [SMulCommClass S T M₂] : SMulCommClass S T (M →ₛₗ[σ₁₂] M₂) 
goal: SMulCommClass S T (M →ₛₗ[σ₁₂] M₂)

full_name: LinearMap.instIsScalarTower
code: instance [SMul S T] [IsScalarTower S T M₂] : IsScalarTower S T (M →ₛₗ[σ₁₂] M₂) 
goal: IsScalarTower S T (M →ₛₗ[σ₁₂] M₂)

full_name: LinearMap.instIsCentralScalar
code: instance [DistribMulAction Sᵐᵒᵖ M₂] [SMulCommClass R₂ Sᵐᵒᵖ M₂] [IsCentralScalar S M₂] :
    IsCentralScalar S (M →ₛₗ[σ₁₂] M₂) 
goal: IsCentralScalar S (M →ₛₗ[σ₁₂] M₂)

full_name: LinearMap.instZero
code: /-- The constant 0 map is linear. -/
instance : Zero (M →ₛₗ[σ₁₂] M₂) 
goal: Zero (M →ₛₗ[σ₁₂] M₂)

full_name: LinearMap.zero_apply
code: @[simp]
theorem zero_apply (x : M) : (0 : M →ₛₗ[σ₁₂] M₂) x = 0 
goal: 0 x = 0

full_name: LinearMap.comp_zero
code: @[simp]
theorem comp_zero (g : M₂ →ₛₗ[σ₂₃] M₃) : (g.comp (0 : M →ₛₗ[σ₁₂] M₂) : M →ₛₗ[σ₁₃] M₃) = 0 
goal: g.comp 0 = 0

full_name: LinearMap.zero_comp
code: @[simp]
theorem zero_comp (f : M →ₛₗ[σ₁₂] M₂) : ((0 : M₂ →ₛₗ[σ₂₃] M₃).comp f : M →ₛₗ[σ₁₃] M₃) = 0 
goal: LinearMap.comp 0 f = 0

full_name: LinearMap.instInhabited
code: instance : Inhabited (M →ₛₗ[σ₁₂] M₂) 
goal: Inhabited (M →ₛₗ[σ₁₂] M₂)

full_name: LinearMap.default_def
code: @[simp]
theorem default_def : (default : M →ₛₗ[σ₁₂] M₂) = 0 
goal: default = 0

full_name: LinearMap.uniqueOfLeft
code: instance uniqueOfLeft [Subsingleton M] : Unique (M →ₛₗ[σ₁₂] M₂) 
goal: Unique (M →ₛₗ[σ₁₂] M₂)

full_name: LinearMap.uniqueOfRight
code: instance uniqueOfRight [Subsingleton M₂] : Unique (M →ₛₗ[σ₁₂] M₂) 
goal: Unique (M →ₛₗ[σ₁₂] M₂)

full_name: LinearMap.instAdd
code: /-- The sum of two linear maps is linear. -/
instance : Add (M →ₛₗ[σ₁₂] M₂) 
goal: Add (M →ₛₗ[σ₁₂] M₂)

full_name: LinearMap.add_apply
code: @[simp]
theorem add_apply (f g : M →ₛₗ[σ₁₂] M₂) (x : M) : (f + g) x = f x + g x 
goal: (f + g) x = f x + g x

full_name: LinearMap.add_comp
code: theorem add_comp (f : M →ₛₗ[σ₁₂] M₂) (g h : M₂ →ₛₗ[σ₂₃] M₃) :
    ((h + g).comp f : M →ₛₗ[σ₁₃] M₃) = h.comp f + g.comp f 
goal: (h + g).comp f = h.comp f + g.comp f

full_name: LinearMap.comp_add
code: theorem comp_add (f g : M →ₛₗ[σ₁₂] M₂) (h : M₂ →ₛₗ[σ₂₃] M₃) :
    (h.comp (f + g) : M →ₛₗ[σ₁₃] M₃) = h.comp f + h.comp g 
goal: h.comp (f + g) = h.comp f + h.comp g

full_name: LinearMap.addCommMonoid
code: /-- The type of linear maps is an additive monoid. -/
instance addCommMonoid : AddCommMonoid (M →ₛₗ[σ₁₂] M₂) 
goal: AddCommMonoid (M →ₛₗ[σ₁₂] M₂)

full_name: LinearMap.instNeg
code: /-- The negation of a linear map is linear. -/
instance : Neg (M →ₛₗ[σ₁₂] N₂) 
goal: Neg (M →ₛₗ[σ₁₂] N₂)

full_name: LinearMap.neg_apply
code: @[simp]
theorem neg_apply (f : M →ₛₗ[σ₁₂] N₂) (x : M) : (-f) x = -f x 
goal: (-f) x = -f x

full_name: LinearMap.neg_comp
code: @[simp]
theorem neg_comp (f : M →ₛₗ[σ₁₂] M₂) (g : M₂ →ₛₗ[σ₂₃] N₃) : (-g).comp f = -g.comp f 
goal: (-g).comp f = -g.comp f

full_name: LinearMap.comp_neg
code: @[simp]
theorem comp_neg (f : M →ₛₗ[σ₁₂] N₂) (g : N₂ →ₛₗ[σ₂₃] N₃) : g.comp (-f) = -g.comp f 
goal: g.comp (-f) = -g.comp f

full_name: LinearMap.instSub
code: /-- The subtraction of two linear maps is linear. -/
instance : Sub (M →ₛₗ[σ₁₂] N₂) 
goal: Sub (M →ₛₗ[σ₁₂] N₂)

full_name: LinearMap.sub_apply
code: @[simp]
theorem sub_apply (f g : M →ₛₗ[σ₁₂] N₂) (x : M) : (f - g) x = f x - g x 
goal: (f - g) x = f x - g x

full_name: LinearMap.sub_comp
code: theorem sub_comp (f : M →ₛₗ[σ₁₂] M₂) (g h : M₂ →ₛₗ[σ₂₃] N₃) :
    (g - h).comp f = g.comp f - h.comp f 
goal: (g - h).comp f = g.comp f - h.comp f

full_name: LinearMap.comp_sub
code: theorem comp_sub (f g : M →ₛₗ[σ₁₂] N₂) (h : N₂ →ₛₗ[σ₂₃] N₃) :
    h.comp (g - f) = h.comp g - h.comp f 
goal: h.comp (g - f) = h.comp g - h.comp f

full_name: LinearMap.addCommGroup
code: /-- The type of linear maps is an additive group. -/
instance addCommGroup : AddCommGroup (M →ₛₗ[σ₁₂] N₂) 
goal: AddCommGroup (M →ₛₗ[σ₁₂] N₂)

full_name: LinearMap.evalAddMonoidHom
code: /-- Evaluation of a `σ₁₂`-linear map at a fixed `a`, as an `AddMonoidHom`. -/
@[simps]
def evalAddMonoidHom (a : M) : (M →ₛₗ[σ₁₂] M₂) →+ M₂ 
goal: (M →ₛₗ[σ₁₂] M₂) →+ M₂

full_name: LinearMap.evalAddMonoidHom_apply
code: /-- Evaluation of a `σ₁₂`-linear map at a fixed `a`, as an `AddMonoidHom`. -/
@[simps]
def evalAddMonoidHom (a : M) : (M →ₛₗ[σ₁₂] M₂) →+ M₂ 
goal: (LinearMap.evalAddMonoidHom a) f = f a

full_name: LinearMap.toAddMonoidHom'_apply
code: /-- `LinearMap.toAddMonoidHom` promoted to an `AddMonoidHom`. -/
@[simps]
def toAddMonoidHom' : (M →ₛₗ[σ₁₂] M₂) →+ M →+ M₂ 
goal: LinearMap.toAddMonoidHom' f = f.toAddMonoidHom

full_name: LinearMap.toAddMonoidHom'
code: /-- `LinearMap.toAddMonoidHom` promoted to an `AddMonoidHom`. -/
@[simps]
def toAddMonoidHom' : (M →ₛₗ[σ₁₂] M₂) →+ M →+ M₂ 
goal: (M →ₛₗ[σ₁₂] M₂) →+ M →+ M₂

full_name: LinearMap.identityMapOfZeroModuleIsZero
code: /-- If `M` is the zero module, then  the identity map of `M` is the zero map. -/
@[simp]
theorem identityMapOfZeroModuleIsZero [Subsingleton M] : id (R := R₁) (M := M) = 0 
goal: LinearMap.id = 0

full_name: LinearMap.instDistribMulAction
code: instance : DistribMulAction S (M →ₛₗ[σ₁₂] M₂) 
goal: DistribMulAction S (M →ₛₗ[σ₁₂] M₂)

full_name: LinearMap.smul_comp
code: theorem smul_comp (a : S₃) (g : M₂ →ₛₗ[σ₂₃] M₃) (f : M →ₛₗ[σ₁₂] M₂) :
    (a • g).comp f = a • g.comp f 
goal: (a • g).comp f = a • g.comp f

full_name: LinearMap.comp_smul
code: theorem comp_smul [Module R M₂] [Module R M₃] [SMulCommClass R S M₂] [DistribMulAction S M₃]
    [SMulCommClass R S M₃] [CompatibleSMul M₃ M₂ S R] (g : M₃ →ₗ[R] M₂) (a : S) (f : M →ₗ[R] M₃) :
    g.comp (a • f) = a • g.comp f 
goal: g ∘ₗ (a • f) = a • g ∘ₗ f

full_name: LinearMap.module
code: instance module : Module S (M →ₛₗ[σ₁₂] M₂) 
goal: Module S (M →ₛₗ[σ₁₂] M₂)

full_name: LinearMap.restrictScalars_zero
code: @[simp]
lemma restrictScalars_zero : (0 : M →ₗ[S] N).restrictScalars R = 0 
goal: ↑R 0 = 0

full_name: LinearMap.restrictScalars_add
code: @[simp]
theorem restrictScalars_add (f g : M →ₗ[S] N) :
    (f + g).restrictScalars R = f.restrictScalars R + g.restrictScalars R 
goal: ↑R (f + g) = ↑R f + ↑R g

full_name: LinearMap.restrictScalars_neg
code: @[simp]
theorem restrictScalars_neg (f : M →ₗ[S] N) : (-f).restrictScalars R = -f.restrictScalars R 
goal: ↑R (-f) = -↑R f

full_name: LinearMap.restrictScalars_smul
code: @[simp]
theorem restrictScalars_smul (c : R₁) (f : M →ₗ[S] N) :
    (c • f).restrictScalars R = c • f.restrictScalars R 
goal: ↑R (c • f) = c • ↑R f

full_name: LinearMap.restrictScalarsₗ
code: /-- `LinearMap.restrictScalars` as a `LinearMap`. -/
@[simps apply]
def restrictScalarsₗ : (M →ₗ[S] N) →ₗ[R₁] M →ₗ[R] N 
goal: (M →ₗ[S] N) →ₗ[R₁] M →ₗ[R] N

full_name: LinearMap.restrictScalarsₗ_apply
code: /-- `LinearMap.restrictScalars` as a `LinearMap`. -/
@[simps apply]
def restrictScalarsₗ : (M →ₗ[S] N) →ₗ[R₁] M →ₗ[R] N 
goal: (LinearMap.restrictScalarsₗ N) fₗ = ↑R fₗ