File: Mathlib/Algebra/DirectSum/Module.lean

full_name: DirectSum.instModule
code: instance : Module R (⨁ i, M i) 
goal: Module R (DirectSum ι fun i => M i)

full_name: DirectSum.instSMulCommClass
code: instance {S : Type*} [Semiring S] [∀ i, Module S (M i)] [∀ i, SMulCommClass R S (M i)] :
    SMulCommClass R S (⨁ i, M i) 
goal: SMulCommClass R S (DirectSum ι fun i => M i)

full_name: DirectSum.instIsScalarTower
code: instance {S : Type*} [Semiring S] [SMul R S] [∀ i, Module S (M i)] [∀ i, IsScalarTower R S (M i)] :
    IsScalarTower R S (⨁ i, M i) 
goal: IsScalarTower R S (DirectSum ι fun i => M i)

full_name: DirectSum.instIsCentralScalar
code: instance [∀ i, Module Rᵐᵒᵖ (M i)] [∀ i, IsCentralScalar R (M i)] : IsCentralScalar R (⨁ i, M i) 
goal: IsCentralScalar R (DirectSum ι fun i => M i)

full_name: DirectSum.smul_apply
code: theorem smul_apply (b : R) (v : ⨁ i, M i) (i : ι) : (b • v) i = b • v i 
goal: (b • v) i = b • v i

full_name: DirectSum.lmk
code: /-- Create the direct sum given a family `M` of `R` modules indexed over `ι`. -/
def lmk : ∀ s : Finset ι, (∀ i : (↑s : Set ι), M i.val) →ₗ[R] ⨁ i, M i 
goal: ((i : ↑↑s) → M ↑i) →ₗ[R] DirectSum ι fun i => M i

full_name: DirectSum.lof
code: /-- Inclusion of each component into the direct sum. -/
def lof : ∀ i : ι, M i →ₗ[R] ⨁ i, M i 
goal: M i →ₗ[R] DirectSum ι fun i => M i

full_name: DirectSum.lof_eq_of
code: theorem lof_eq_of (i : ι) (b : M i) : lof R ι M i b = of M i b 
goal: (DirectSum.lof R ι M i) b = (DirectSum.of M i) b

full_name: DirectSum.single_eq_lof
code: theorem single_eq_lof (i : ι) (b : M i) : DFinsupp.single i b = lof R ι M i b 
goal: DFinsupp.single i b = (DirectSum.lof R ι M i) b

full_name: DirectSum.mk_smul
code: /-- Scalar multiplication commutes with direct sums. -/
theorem mk_smul (s : Finset ι) (c : R) (x) : mk M s (c • x) = c • mk M s x 
goal: (DirectSum.mk M s) (c • x) = c • (DirectSum.mk M s) x

full_name: DirectSum.of_smul
code: /-- Scalar multiplication commutes with the inclusion of each component into the direct sum. -/
theorem of_smul (i : ι) (c : R) (x) : of M i (c • x) = c • of M i x 
goal: (DirectSum.of M i) (c • x) = c • (DirectSum.of M i) x

full_name: DirectSum.support_smul
code: theorem support_smul [∀ (i : ι) (x : M i), Decidable (x ≠ 0)] (c : R) (v : ⨁ i, M i) :
    (c • v).support ⊆ v.support 
goal: DFinsupp.support (c • v) ⊆ DFinsupp.support v

full_name: DirectSum.toModule
code: /-- The linear map constructed using the universal property of the coproduct. -/
def toModule : (⨁ i, M i) →ₗ[R] N 
goal: (DirectSum ι fun i => M i) →ₗ[R] N

full_name: DirectSum.coe_toModule_eq_coe_toAddMonoid
code: /-- Coproducts in the categories of modules and additive monoids commute with the forgetful functor
from modules to additive monoids. -/
theorem coe_toModule_eq_coe_toAddMonoid :
    (toModule R ι N φ : (⨁ i, M i) → N) = toAddMonoid fun i ↦ (φ i).toAddMonoidHom 
goal: ⇑(DirectSum.toModule R ι N φ) = ⇑(DirectSum.toAddMonoid fun i => (φ i).toAddMonoidHom)

full_name: DirectSum.toModule_lof
code: /-- The map constructed using the universal property gives back the original maps when
restricted to each component. -/
@[simp]
theorem toModule_lof (i) (x : M i) : toModule R ι N φ (lof R ι M i x) = φ i x 
goal: (DirectSum.toModule R ι N φ) ((DirectSum.lof R ι M i) x) = (φ i) x

full_name: DirectSum.toModule.unique
code: /-- Every linear map from a direct sum agrees with the one obtained by applying
the universal property to each of its components. -/
theorem toModule.unique (f : ⨁ i, M i) : ψ f = toModule R ι N (fun i ↦ ψ.comp <| lof R ι M i) f 
goal: ψ f = (DirectSum.toModule R ι N fun i => ψ ∘ₗ DirectSum.lof R ι M i) f

full_name: DirectSum.linearMap_ext
code: /-- Two `LinearMap`s out of a direct sum are equal if they agree on the generators.

See note [partially-applied ext lemmas]. -/
@[ext]
theorem linearMap_ext ⦃ψ ψ' : (⨁ i, M i) →ₗ[R] N⦄
    (H : ∀ i, ψ.comp (lof R ι M i) = ψ'.comp (lof R ι M i)) : ψ = ψ' 
goal: ψ = ψ'

full_name: DirectSum.lsetToSet
code: /-- The inclusion of a subset of the direct summands
into a larger subset of the direct summands, as a linear map. -/
def lsetToSet (S T : Set ι) (H : S ⊆ T) : (⨁ i : S, M i) →ₗ[R] ⨁ i : T, M i 
goal: (DirectSum ↑S fun i => M ↑i) →ₗ[R] DirectSum ↑T fun i => M ↑i

full_name: DirectSum.linearEquivFunOnFintype_apply
code: /-- Given `Fintype α`, `linearEquivFunOnFintype R` is the natural `R`-linear equivalence
between `⨁ i, M i` and `∀ i, M i`. -/
@[simps apply]
def linearEquivFunOnFintype [Fintype ι] : (⨁ i, M i) ≃ₗ[R] ∀ i, M i 
goal: ∀ (a : Π₀ (i : ι), (fun i => M i) i) (a_1 : ι), (DirectSum.linearEquivFunOnFintype R ι M) a a_1 = a a_1

full_name: DirectSum.linearEquivFunOnFintype
code: /-- Given `Fintype α`, `linearEquivFunOnFintype R` is the natural `R`-linear equivalence
between `⨁ i, M i` and `∀ i, M i`. -/
@[simps apply]
def linearEquivFunOnFintype [Fintype ι] : (⨁ i, M i) ≃ₗ[R] ∀ i, M i 
goal: (DirectSum ι fun i => M i) ≃ₗ[R] (i : ι) → M i

full_name: DirectSum.linearEquivFunOnFintype_lof
code: @[simp]
theorem linearEquivFunOnFintype_lof [Fintype ι] [DecidableEq ι] (i : ι) (m : M i) :
    (linearEquivFunOnFintype R ι M) (lof R ι M i m) = Pi.single i m 
goal: (DirectSum.linearEquivFunOnFintype R ι M) ((DirectSum.lof R ι M i) m) = Pi.single i m

full_name: DirectSum.linearEquivFunOnFintype_symm_single
code: @[simp]
theorem linearEquivFunOnFintype_symm_single [Fintype ι] [DecidableEq ι] (i : ι) (m : M i) :
    (linearEquivFunOnFintype R ι M).symm (Pi.single i m) = lof R ι M i m 
goal: (DirectSum.linearEquivFunOnFintype R ι M).symm (Pi.single i m) = (DirectSum.lof R ι M i) m

full_name: DirectSum.linearEquivFunOnFintype_symm_coe
code: @[simp]
theorem linearEquivFunOnFintype_symm_coe [Fintype ι] (f : ⨁ i, M i) :
    (linearEquivFunOnFintype R ι M).symm f = f 
goal: (DirectSum.linearEquivFunOnFintype R ι M).symm ⇑f = f

full_name: DirectSum.lid
code: /-- The natural linear equivalence between `⨁ _ : ι, M` and `M` when `Unique ι`. -/
protected def lid (M : Type v) (ι : Type* := PUnit) [AddCommMonoid M] [Module R M] [Unique ι] :
    (⨁ _ : ι, M) ≃ₗ[R] M 
goal: (DirectSum ι fun x => M) ≃ₗ[R] M

full_name: DirectSum.component
code: /-- The projection map onto one component, as a linear map. -/
def component (i : ι) : (⨁ i, M i) →ₗ[R] M i 
goal: (DirectSum ι fun i => M i) →ₗ[R] M i

full_name: DirectSum.apply_eq_component
code: theorem apply_eq_component (f : ⨁ i, M i) (i : ι) : f i = component R ι M i f 
goal: f i = (DirectSum.component R ι M i) f

full_name: DirectSum.ext
code: @[ext]
theorem ext {f g : ⨁ i, M i} (h : ∀ i, component R ι M i f = component R ι M i g) : f = g 
goal: f = g

full_name: DirectSum.ext_iff
code: theorem ext_iff {f g : ⨁ i, M i} : f = g ↔ ∀ i, component R ι M i f = component R ι M i g 
goal: f = g ↔ ∀ (i : ι), (DirectSum.component R ι M i) f = (DirectSum.component R ι M i) g

full_name: DirectSum.lof_apply
code: @[simp]
theorem lof_apply (i : ι) (b : M i) : ((lof R ι M i) b) i = b 
goal: ((DirectSum.lof R ι M i) b) i = b

full_name: DirectSum.component.lof_self
code: @[simp]
theorem component.lof_self (i : ι) (b : M i) : component R ι M i ((lof R ι M i) b) = b 
goal: (DirectSum.component R ι M i) ((DirectSum.lof R ι M i) b) = b

full_name: DirectSum.component.of
code: theorem component.of (i j : ι) (b : M j) :
    component R ι M i ((lof R ι M j) b) = if h : j = i then Eq.recOn h b else 0 
goal: (DirectSum.component R ι M i) ((DirectSum.lof R ι M j) b) = if h : j = i then Eq.recOn h b else 0

full_name: DirectSum.lequivCongrLeft
code: /-- Reindexing terms of a direct sum is linear. -/
def lequivCongrLeft (h : ι ≃ κ) : (⨁ i, M i) ≃ₗ[R] ⨁ k, M (h.symm k) 
goal: (DirectSum ι fun i => M i) ≃ₗ[R] DirectSum κ fun k => M (h.symm k)

full_name: DirectSum.lequivCongrLeft_apply
code: @[simp]
theorem lequivCongrLeft_apply (h : ι ≃ κ) (f : ⨁ i, M i) (k : κ) :
    lequivCongrLeft R h f k = f (h.symm k) 
goal: ((DirectSum.lequivCongrLeft R h) f) k = f (h.symm k)

full_name: DirectSum.sigmaLcurry
code: /-- `curry` as a linear map. -/
def sigmaLcurry : (⨁ i : Σi, _, δ i.1 i.2) →ₗ[R] ⨁ (i) (j), δ i j 
goal: (DirectSum ((i : ι) × α i) fun i => δ i.fst i.snd) →ₗ[R] DirectSum ι fun i => DirectSum (α i) fun j => δ i j

full_name: DirectSum.sigmaLcurry_apply
code: @[simp]
theorem sigmaLcurry_apply (f : ⨁ i : Σ_, _, δ i.1 i.2) (i : ι) (j : α i) :
    sigmaLcurry R f i j = f ⟨i, j⟩ 
goal: (((DirectSum.sigmaLcurry R) f) i) j = f ⟨i, j⟩

full_name: DirectSum.sigmaLuncurry
code: /-- `uncurry` as a linear map. -/
def sigmaLuncurry : (⨁ (i) (j), δ i j) →ₗ[R] ⨁ i : Σ_, _, δ i.1 i.2 
goal: (DirectSum ι fun i => DirectSum (α i) fun j => δ i j) →ₗ[R] DirectSum ((x : ι) × α x) fun i => δ i.fst i.snd

full_name: DirectSum.sigmaLuncurry_apply
code: @[simp]
theorem sigmaLuncurry_apply (f : ⨁ (i) (j), δ i j) (i : ι) (j : α i) :
    sigmaLuncurry R f ⟨i, j⟩ = f i j 
goal: ((DirectSum.sigmaLuncurry R) f) ⟨i, j⟩ = (f i) j

full_name: DirectSum.sigmaLcurryEquiv
code: /-- `curryEquiv` as a linear equiv. -/
def sigmaLcurryEquiv : (⨁ i : Σ_, _, δ i.1 i.2) ≃ₗ[R] ⨁ (i) (j), δ i j 
goal: (DirectSum ((x : ι) × α x) fun i => δ i.fst i.snd) ≃ₗ[R] DirectSum ι fun i => DirectSum (α i) fun j => δ i j

full_name: DirectSum.lequivProdDirectSum
code: /-- Linear isomorphism obtained by separating the term of index `none` of a direct sum over
`Option ι`. -/
@[simps]
noncomputable def lequivProdDirectSum : (⨁ i, α i) ≃ₗ[R] α none × ⨁ i, α (some i) 
goal: (DirectSum (Option ι) fun i => α i) ≃ₗ[R] α none × DirectSum ι fun i => α (some i)

full_name: DirectSum.lequivProdDirectSum_apply
code: /-- Linear isomorphism obtained by separating the term of index `none` of a direct sum over
`Option ι`. -/
@[simps]
noncomputable def lequivProdDirectSum : (⨁ i, α i) ≃ₗ[R] α none × ⨁ i, α (some i) 
goal: ∀ (a : DirectSum (Option ι) fun i => α i), (DirectSum.lequivProdDirectSum R) a = DirectSum.addEquivProdDirectSum.toFun a

full_name: DirectSum.lequivProdDirectSum_symm_apply
code: /-- Linear isomorphism obtained by separating the term of index `none` of a direct sum over
`Option ι`. -/
@[simps]
noncomputable def lequivProdDirectSum : (⨁ i, α i) ≃ₗ[R] α none × ⨁ i, α (some i) 
goal: ∀ (a : α none × DirectSum ι fun i => α (some i)),
  (DirectSum.lequivProdDirectSum R).symm a = DirectSum.addEquivProdDirectSum.invFun a

full_name: DirectSum.coeLinearMap
code: /-- The canonical embedding from `⨁ i, A i` to `M` where `A` is a collection of `Submodule R M`
indexed by `ι`. This is `DirectSum.coeAddMonoidHom` as a `LinearMap`. -/
def coeLinearMap : (⨁ i, A i) →ₗ[R] M 
goal: (DirectSum ι fun i => ↥(A i)) →ₗ[R] M

full_name: DirectSum.coeLinearMap_eq_dfinsupp_sum
code: theorem coeLinearMap_eq_dfinsupp_sum [DecidableEq M] (x : DirectSum ι fun i => A i) :
    coeLinearMap A x = DFinsupp.sum x fun i => (fun x : A i => ↑x) 
goal: (DirectSum.coeLinearMap A) x = DFinsupp.sum x fun i x => ↑x

full_name: DirectSum.coeLinearMap_of
code: @[simp]
theorem coeLinearMap_of (i : ι) (x : A i) : DirectSum.coeLinearMap A (of (fun i ↦ A i) i x) = x 
goal: (DirectSum.coeLinearMap A) ((DirectSum.of (fun i => ↥(A i)) i) x) = ↑x

full_name: DirectSum.IsInternal.ofBijective_coeLinearMap_same
code: @[simp]
theorem IsInternal.ofBijective_coeLinearMap_same (h : IsInternal A)
    {i : ι} (x : A i) :
    (LinearEquiv.ofBijective (coeLinearMap A) h).symm x i = x 
goal: ((LinearEquiv.ofBijective (DirectSum.coeLinearMap A) h).symm ↑x) i = x

full_name: DirectSum.IsInternal.ofBijective_coeLinearMap_of_ne
code: @[simp]
theorem IsInternal.ofBijective_coeLinearMap_of_ne (h : IsInternal A)
    {i j : ι} (hij : i ≠ j) (x : A i) :
    (LinearEquiv.ofBijective (coeLinearMap A) h).symm x j = 0 
goal: ((LinearEquiv.ofBijective (DirectSum.coeLinearMap A) h).symm ↑x) j = 0

full_name: DirectSum.IsInternal.ofBijective_coeLinearMap_of_mem
code: theorem IsInternal.ofBijective_coeLinearMap_of_mem (h : IsInternal A)
    {i : ι} {x : M} (hx : x ∈ A i) :
    (LinearEquiv.ofBijective (coeLinearMap A) h).symm x i = ⟨x, hx⟩ 
goal: ((LinearEquiv.ofBijective (DirectSum.coeLinearMap A) h).symm x) i = ⟨x, hx⟩

full_name: DirectSum.IsInternal.ofBijective_coeLinearMap_of_mem_ne
code: theorem IsInternal.ofBijective_coeLinearMap_of_mem_ne (h : IsInternal A)
    {i j : ι} (hij : i ≠ j) {x : M} (hx : x ∈ A i) :
    (LinearEquiv.ofBijective (coeLinearMap A) h).symm x j = 0 
goal: ((LinearEquiv.ofBijective (DirectSum.coeLinearMap A) h).symm x) j = 0

full_name: DirectSum.IsInternal.submodule_iSup_eq_top
code: /-- If a direct sum of submodules is internal then the submodules span the module. -/
theorem IsInternal.submodule_iSup_eq_top (h : IsInternal A) : iSup A = ⊤ 
goal: iSup A = ⊤

full_name: DirectSum.IsInternal.submodule_independent
code: /-- If a direct sum of submodules is internal then the submodules are independent. -/
theorem IsInternal.submodule_independent (h : IsInternal A) : CompleteLattice.Independent A 
goal: CompleteLattice.Independent A

full_name: DirectSum.IsInternal.collectedBasis
code: /-- Given an internal direct sum decomposition of a module `M`, and a basis for each of the
components of the direct sum, the disjoint union of these bases is a basis for `M`. -/
noncomputable def IsInternal.collectedBasis (h : IsInternal A) {α : ι → Type*}
    (v : ∀ i, Basis (α i) R (A i)) : Basis (Σi, α i) R M 
goal: Basis ((i : ι) × α i) R M

full_name: DirectSum.IsInternal.collectedBasis_coe
code: @[simp]
theorem IsInternal.collectedBasis_coe (h : IsInternal A) {α : ι → Type*}
    (v : ∀ i, Basis (α i) R (A i)) : ⇑(h.collectedBasis v) = fun a : Σi, α i ↦ ↑(v a.1 a.2) 
goal: ⇑(h.collectedBasis v) = fun a => ↑((v a.fst) a.snd)

full_name: DirectSum.IsInternal.collectedBasis_mem
code: theorem IsInternal.collectedBasis_mem (h : IsInternal A) {α : ι → Type*}
    (v : ∀ i, Basis (α i) R (A i)) (a : Σi, α i) : h.collectedBasis v a ∈ A a.1 
goal: (h.collectedBasis v) a ∈ A a.fst

full_name: DirectSum.IsInternal.collectedBasis_repr_of_mem
code: theorem IsInternal.collectedBasis_repr_of_mem (h : IsInternal A) {α : ι → Type*}
    (v : ∀ i, Basis (α i) R (A i)) {x : M} {i : ι} {a : α i} (hx : x ∈ A i) :
    (h.collectedBasis v).repr x ⟨i, a⟩ = (v i).repr ⟨x, hx⟩ a 
goal: ((h.collectedBasis v).repr x) ⟨i, a⟩ = ((v i).repr ⟨x, hx⟩) a

full_name: DirectSum.IsInternal.collectedBasis_repr_of_mem_ne
code: theorem IsInternal.collectedBasis_repr_of_mem_ne (h : IsInternal A) {α : ι → Type*}
    (v : ∀ i, Basis (α i) R (A i)) {x : M} {i j : ι} (hij : i ≠ j) {a : α j} (hx : x ∈ A i) :
    (h.collectedBasis v).repr x ⟨j, a⟩ = 0 
goal: ((h.collectedBasis v).repr x) ⟨j, a⟩ = 0

full_name: DirectSum.IsInternal.isCompl
code: /-- When indexed by only two distinct elements, `DirectSum.IsInternal` implies
the two submodules are complementary. Over a `Ring R`, this is true as an iff, as
`DirectSum.isInternal_submodule_iff_isCompl`. -/
theorem IsInternal.isCompl {A : ι → Submodule R M} {i j : ι} (hij : i ≠ j)
    (h : (Set.univ : Set ι) = {i, j}) (hi : IsInternal A) : IsCompl (A i) (A j) 
goal: IsCompl (A i) (A j)

full_name: DirectSum.isInternal_submodule_of_independent_of_iSup_eq_top
code: /-- Note that this is not generally true for `[Semiring R]`; see
`CompleteLattice.Independent.dfinsupp_lsum_injective` for details. -/
theorem isInternal_submodule_of_independent_of_iSup_eq_top {A : ι → Submodule R M}
    (hi : CompleteLattice.Independent A) (hs : iSup A = ⊤) : IsInternal A 
goal: DirectSum.IsInternal A

full_name: DirectSum.isInternal_submodule_iff_independent_and_iSup_eq_top
code: /-- `iff` version of `DirectSum.isInternal_submodule_of_independent_of_iSup_eq_top`,
`DirectSum.IsInternal.submodule_independent`, and `DirectSum.IsInternal.submodule_iSup_eq_top`. -/
theorem isInternal_submodule_iff_independent_and_iSup_eq_top (A : ι → Submodule R M) :
    IsInternal A ↔ CompleteLattice.Independent A ∧ iSup A = ⊤ 
goal: DirectSum.IsInternal A ↔ CompleteLattice.Independent A ∧ iSup A = ⊤

full_name: DirectSum.isInternal_submodule_iff_isCompl
code: /-- If a collection of submodules has just two indices, `i` and `j`, then
`DirectSum.IsInternal` is equivalent to `isCompl`. -/
theorem isInternal_submodule_iff_isCompl (A : ι → Submodule R M) {i j : ι} (hij : i ≠ j)
    (h : (Set.univ : Set ι) = {i, j}) : IsInternal A ↔ IsCompl (A i) (A j) 
goal: DirectSum.IsInternal A ↔ IsCompl (A i) (A j)

full_name: DirectSum.isInternal_ne_bot_iff
code: @[simp]
theorem isInternal_ne_bot_iff {A : ι → Submodule R M} :
    IsInternal (fun i : {i // A i ≠ ⊥} ↦ A i) ↔ IsInternal A 
goal: (DirectSum.IsInternal fun i => A ↑i) ↔ DirectSum.IsInternal A

full_name: DirectSum.isInternal_biSup_submodule_of_independent
code: lemma isInternal_biSup_submodule_of_independent {A : ι → Submodule R M} (s : Set ι)
    (h : CompleteLattice.Independent <| fun i : s ↦ A i) :
    IsInternal <| fun (i : s) ↦ (A i).comap (⨆ i ∈ s, A i).subtype 
goal: DirectSum.IsInternal fun i => Submodule.comap (⨆ i ∈ s, A i).subtype (A ↑i)

full_name: DirectSum.IsInternal.addSubmonoid_independent
code: theorem IsInternal.addSubmonoid_independent {M : Type*} [AddCommMonoid M] {A : ι → AddSubmonoid M}
    (h : IsInternal A) : CompleteLattice.Independent A 
goal: CompleteLattice.Independent A

full_name: DirectSum.IsInternal.addSubgroup_independent
code: theorem IsInternal.addSubgroup_independent {M : Type*} [AddCommGroup M] {A : ι → AddSubgroup M}
    (h : IsInternal A) : CompleteLattice.Independent A 
goal: CompleteLattice.Independent A