Documentation

Mathlib.LinearAlgebra.Finsupp.LinearCombination

Finsupp.linearCombination #

Main definitions #

Tags #

function with finite support, module, linear algebra

def Finsupp.linearCombination {α : Type u_1} {M : Type u_2} (R : Type u_5) [Semiring R] [AddCommMonoid M] [Module R M] (v : αM) :
(α →₀ R) →ₗ[R] M

Interprets (l : α →₀ R) as a linear combination of the elements in the family (v : α → M) and evaluates this linear combination.

Equations
Instances For
    theorem Finsupp.linearCombination_apply {α : Type u_1} {M : Type u_2} (R : Type u_5) [Semiring R] [AddCommMonoid M] [Module R M] {v : αM} (l : α →₀ R) :
    (linearCombination R v) l = l.sum fun (i : α) (a : R) => a v i
    theorem Finsupp.linearCombination_apply_of_mem_supported {α : Type u_1} {M : Type u_2} (R : Type u_5) [Semiring R] [AddCommMonoid M] [Module R M] {v : αM} {l : α →₀ R} {s : Finset α} (hs : l supported R R s) :
    (linearCombination R v) l = is, l i v i
    @[simp]
    theorem Finsupp.linearCombination_single {α : Type u_1} {M : Type u_2} (R : Type u_5) [Semiring R] [AddCommMonoid M] [Module R M] {v : αM} (c : R) (a : α) :
    (linearCombination R v) (single a c) = c v a
    theorem Finsupp.linearCombination_zero_apply {α : Type u_1} {M : Type u_2} (R : Type u_5) [Semiring R] [AddCommMonoid M] [Module R M] (x : α →₀ R) :
    @[simp]
    theorem Finsupp.linearCombination_zero (α : Type u_1) (M : Type u_2) (R : Type u_5) [Semiring R] [AddCommMonoid M] [Module R M] :
    @[simp]
    theorem Finsupp.linearCombination_single_index (α : Type u_1) (M : Type u_2) (R : Type u_5) [Semiring R] [AddCommMonoid M] [Module R M] (c : M) (a : α) (f : α →₀ R) [DecidableEq α] :
    (linearCombination R (Pi.single a c)) f = f a c
    theorem Finsupp.linearCombination_linear_comp {α : Type u_1} {M : Type u_2} (R : Type u_5) [Semiring R] [AddCommMonoid M] [Module R M] {M' : Type u_8} [AddCommMonoid M'] [Module R M'] {v : αM} (f : M →ₗ[R] M') :
    theorem Finsupp.apply_linearCombination {α : Type u_1} {M : Type u_2} (R : Type u_5) [Semiring R] [AddCommMonoid M] [Module R M] {M' : Type u_8} [AddCommMonoid M'] [Module R M'] (f : M →ₗ[R] M') (v : αM) (l : α →₀ R) :
    f ((linearCombination R v) l) = (linearCombination R (f v)) l
    theorem Finsupp.apply_linearCombination_id {M : Type u_2} (R : Type u_5) [Semiring R] [AddCommMonoid M] [Module R M] {M' : Type u_8} [AddCommMonoid M'] [Module R M'] (f : M →ₗ[R] M') (l : M →₀ R) :
    theorem Finsupp.linearCombination_unique {α : Type u_1} {M : Type u_2} (R : Type u_5) [Semiring R] [AddCommMonoid M] [Module R M] [Unique α] (l : α →₀ R) (v : αM) :
    theorem Finsupp.linearCombination_surjective {α : Type u_1} {M : Type u_2} (R : Type u_5) [Semiring R] [AddCommMonoid M] [Module R M] {v : αM} (h : Function.Surjective v) :
    theorem Finsupp.linearCombination_range {α : Type u_1} {M : Type u_2} (R : Type u_5) [Semiring R] [AddCommMonoid M] [Module R M] {v : αM} (h : Function.Surjective v) :

    Any module is a quotient of a free module. This is stated as surjectivity of Finsupp.linearCombination R id : (M →₀ R) →ₗ[R] M.

    theorem Finsupp.range_linearCombination {α : Type u_1} {M : Type u_2} (R : Type u_5) [Semiring R] [AddCommMonoid M] [Module R M] {v : αM} :
    theorem Finsupp.lmapDomain_linearCombination {α : Type u_1} {M : Type u_2} (R : Type u_5) [Semiring R] [AddCommMonoid M] [Module R M] {α' : Type u_7} {M' : Type u_8} [AddCommMonoid M'] [Module R M'] {v : αM} {v' : α'M'} (f : αα') (g : M →ₗ[R] M') (h : ∀ (i : α), g (v i) = v' (f i)) :
    theorem Finsupp.linearCombination_comp_lmapDomain {α : Type u_1} (R : Type u_5) [Semiring R] {α' : Type u_7} {M' : Type u_8} [AddCommMonoid M'] [Module R M'] {v' : α'M'} (f : αα') :
    @[simp]
    theorem Finsupp.linearCombination_embDomain {α : Type u_1} (R : Type u_5) [Semiring R] {α' : Type u_7} {M' : Type u_8} [AddCommMonoid M'] [Module R M'] {v' : α'M'} (f : α α') (l : α →₀ R) :
    (linearCombination R v') (embDomain f l) = (linearCombination R (v' f)) l
    @[simp]
    theorem Finsupp.linearCombination_mapDomain {α : Type u_1} (R : Type u_5) [Semiring R] {α' : Type u_7} {M' : Type u_8} [AddCommMonoid M'] [Module R M'] {v' : α'M'} (f : αα') (l : α →₀ R) :
    @[simp]
    theorem Finsupp.linearCombination_equivMapDomain {α : Type u_1} (R : Type u_5) [Semiring R] {α' : Type u_7} {M' : Type u_8} [AddCommMonoid M'] [Module R M'] {v' : α'M'} (f : α α') (l : α →₀ R) :

    A version of Finsupp.range_linearCombination which is useful for going in the other direction

    theorem Finsupp.mem_span_iff_linearCombination {M : Type u_2} (R : Type u_5) [Semiring R] [AddCommMonoid M] [Module R M] (s : Set M) (x : M) :
    x Submodule.span R s ∃ (l : s →₀ R), (linearCombination R Subtype.val) l = x
    theorem Finsupp.mem_span_range_iff_exists_finsupp {α : Type u_1} {M : Type u_2} {R : Type u_5} [Semiring R] [AddCommMonoid M] [Module R M] {v : αM} {x : M} :
    x Submodule.span R (Set.range v) ∃ (c : α →₀ R), (c.sum fun (i : α) (a : R) => a v i) = x
    theorem Finsupp.span_image_eq_map_linearCombination {α : Type u_1} {M : Type u_2} (R : Type u_5) [Semiring R] [AddCommMonoid M] [Module R M] {v : αM} (s : Set α) :
    theorem Finsupp.mem_span_image_iff_linearCombination {α : Type u_1} {M : Type u_2} (R : Type u_5) [Semiring R] [AddCommMonoid M] [Module R M] {v : αM} {s : Set α} {x : M} :
    x Submodule.span R (v '' s) lsupported R R s, (linearCombination R v) l = x
    theorem Finsupp.linearCombination_option {α : Type u_1} {M : Type u_2} (R : Type u_5) [Semiring R] [AddCommMonoid M] [Module R M] (v : Option αM) (f : Option α →₀ R) :
    theorem Finsupp.linearCombination_linearCombination {M : Type u_2} (R : Type u_5) [Semiring R] [AddCommMonoid M] [Module R M] {α : Type u_9} {β : Type u_10} (A : αM) (B : βα →₀ R) (f : β →₀ R) :
    (linearCombination R A) ((linearCombination R B) f) = (linearCombination R fun (b : β) => (linearCombination R A) (B b)) f
    theorem Finsupp.linearCombination_smul {α : Type u_1} {M : Type u_2} (R : Type u_5) {S : Type u_6} [Semiring R] [Semiring S] [AddCommMonoid M] [Module R M] {α' : Type u_7} {v : αM} [Module R S] [Module S M] [IsScalarTower R S M] {w : α'S} :
    @[simp]
    theorem Finsupp.linearCombination_fin_zero {M : Type u_2} (R : Type u_5) [Semiring R] [AddCommMonoid M] [Module R M] (f : Fin 0M) :
    def Finsupp.linearCombinationOn (α : Type u_1) (M : Type u_2) (R : Type u_5) [Semiring R] [AddCommMonoid M] [Module R M] (v : αM) (s : Set α) :
    (supported R R s) →ₗ[R] (Submodule.span R (v '' s))

    Finsupp.linearCombinationOn M v s interprets p : α →₀ R as a linear combination of a subset of the vectors in v, mapping it to the span of those vectors.

    The subset is indicated by a set s : Set α of indices.

    Equations
    Instances For
      theorem Finsupp.linearCombinationOn_range {α : Type u_1} {M : Type u_2} (R : Type u_5) [Semiring R] [AddCommMonoid M] [Module R M] {v : αM} (s : Set α) :
      theorem Finsupp.linearCombination_restrict {α : Type u_1} {M : Type u_2} (R : Type u_5) [Semiring R] [AddCommMonoid M] [Module R M] {v : αM} (s : Set α) :
      theorem Finsupp.linearCombination_comp {α : Type u_1} {M : Type u_2} (R : Type u_5) [Semiring R] [AddCommMonoid M] [Module R M] {α' : Type u_7} {v : αM} (f : α'α) :
      theorem Finsupp.linearCombination_comapDomain {α : Type u_1} {M : Type u_2} (R : Type u_5) [Semiring R] [AddCommMonoid M] [Module R M] {α' : Type u_7} {v : αM} (f : αα') (l : α' →₀ R) (hf : Set.InjOn f (f ⁻¹' l.support)) :
      (linearCombination R v) (comapDomain f l hf) = il.support.preimage f hf, l (f i) v i
      theorem Finsupp.linearCombination_onFinset {α : Type u_1} {M : Type u_2} (R : Type u_5) [Semiring R] [AddCommMonoid M] [Module R M] {s : Finset α} {f : αR} (g : αM) (hf : ∀ (a : α), f a 0a s) :
      (linearCombination R g) (onFinset s f hf) = xs, f x g x
      def Fintype.linearCombination {α : Type u_1} {M : Type u_2} (R : Type u_3) [Fintype α] [Semiring R] [AddCommMonoid M] [Module R M] (S : Type u_4) [Semiring S] [Module S M] [SMulCommClass R S M] :
      (αM) →ₗ[S] (αR) →ₗ[R] M

      Fintype.linearCombination R S v f is the linear combination of vectors in v with weights in f. This variant of Finsupp.linearCombination is defined on fintype indexed vectors.

      This map is linear in v if R is commutative, and always linear in f. See note [bundled maps over different rings] for why separate R and S semirings are used.

      Equations
      • Fintype.linearCombination R S = { toFun := fun (v : αM) => { toFun := fun (f : αR) => i : α, f i v i, map_add' := , map_smul' := }, map_add' := , map_smul' := }
      Instances For
        theorem Fintype.linearCombination_apply {α : Type u_1} {M : Type u_2} (R : Type u_3) [Fintype α] [Semiring R] [AddCommMonoid M] [Module R M] {S : Type u_4} [Semiring S] [Module S M] [SMulCommClass R S M] (v : αM) (f : αR) :
        ((Fintype.linearCombination R S) v) f = i : α, f i v i
        @[simp]
        theorem Fintype.linearCombination_apply_single {α : Type u_1} {M : Type u_2} (R : Type u_3) [Fintype α] [Semiring R] [AddCommMonoid M] [Module R M] {S : Type u_4} [Semiring S] [Module S M] [SMulCommClass R S M] (v : αM) [DecidableEq α] (i : α) (r : R) :
        theorem Finsupp.linearCombination_eq_fintype_linearCombination_apply {α : Type u_1} {M : Type u_2} (R : Type u_3) [Fintype α] [Semiring R] [AddCommMonoid M] [Module R M] (S : Type u_4) [Semiring S] [Module S M] [SMulCommClass R S M] (v : αM) (x : αR) :
        theorem Finsupp.linearCombination_eq_fintype_linearCombination {α : Type u_1} {M : Type u_2} (R : Type u_3) [Fintype α] [Semiring R] [AddCommMonoid M] [Module R M] (S : Type u_4) [Semiring S] [Module S M] [SMulCommClass R S M] (v : αM) :
        @[simp]
        theorem Fintype.range_linearCombination {α : Type u_1} {M : Type u_2} (R : Type u_3) [Fintype α] [Semiring R] [AddCommMonoid M] [Module R M] {S : Type u_4} [Semiring S] [Module S M] [SMulCommClass R S M] (v : αM) :
        theorem mem_span_range_iff_exists_fun {α : Type u_1} {M : Type u_2} (R : Type u_3) [Fintype α] [Semiring R] [AddCommMonoid M] [Module R M] {v : αM} {x : M} :
        x Submodule.span R (Set.range v) ∃ (c : αR), i : α, c i v i = x

        An element x lies in the span of v iff it can be written as sum ∑ cᵢ • vᵢ = x.

        theorem top_le_span_range_iff_forall_exists_fun {α : Type u_1} {M : Type u_2} (R : Type u_3) [Fintype α] [Semiring R] [AddCommMonoid M] [Module R M] {v : αM} :
        Submodule.span R (Set.range v) ∀ (x : M), ∃ (c : αR), i : α, c i v i = x

        A family v : α → V is generating V iff every element (x : V) can be written as sum ∑ cᵢ • vᵢ = x.

        theorem mem_span_image_iff_exists_fun {α : Type u_1} {M : Type u_2} (R : Type u_3) [Semiring R] [AddCommMonoid M] [Module R M] {v : αM} {x : M} {s : Set α} :
        x Submodule.span R (v '' s) ∃ (t : Finset α), t s ∃ (c : { x : α // x t }R), i : { x : α // x t }, c i v i = x
        theorem Fintype.mem_span_image_iff_exists_fun {α : Type u_1} {M : Type u_2} (R : Type u_3) [Semiring R] [AddCommMonoid M] [Module R M] {v : αM} {x : M} {s : Set α} [Fintype s] :
        x Submodule.span R (v '' s) ∃ (c : sR), i : s, c i v i = x
        @[irreducible]
        def Span.repr (R : Type u_4) {M : Type u_5} [Semiring R] [AddCommMonoid M] [Module R M] (w : Set M) (x : (Submodule.span R w)) :
        w →₀ R

        Pick some representation of x : span R w as a linear combination in w, ((Finsupp.mem_span_iff_linearCombination _ _ _).mp x.2).choose

        Equations
        Instances For
          theorem Span.repr_def (R : Type u_4) {M : Type u_5} [Semiring R] [AddCommMonoid M] [Module R M] (w : Set M) (x : (Submodule.span R w)) :
          repr R w x = .choose
          @[simp]
          theorem Span.finsupp_linearCombination_repr (R : Type u_1) {M : Type u_2} [Semiring R] [AddCommMonoid M] [Module R M] {w : Set M} (x : (Submodule.span R w)) :
          theorem LinearMap.map_finsupp_linearCombination {R : Type u_1} {M : Type u_2} {N : Type u_3} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] (f : M →ₗ[R] N) {ι : Type u_4} {g : ιM} (l : ι →₀ R) :
          theorem mem_span_finset {R : Type u_1} {M : Type u_2} [Semiring R] [AddCommMonoid M] [Module R M] {s : Finset M} {x : M} :
          x Submodule.span R s ∃ (f : MR), is, f i i = x
          theorem mem_span_set {R : Type u_1} {M : Type u_2} [Semiring R] [AddCommMonoid M] [Module R M] {m : M} {s : Set M} :
          m Submodule.span R s ∃ (c : M →₀ R), c.support s (c.sum fun (mi : M) (r : R) => r mi) = m

          An element m ∈ M is contained in the R-submodule spanned by a set s ⊆ M, if and only if m can be written as a finite R-linear combination of elements of s. The implementation uses Finsupp.sum.

          theorem mem_span_set' {R : Type u_1} {M : Type u_2} [Semiring R] [AddCommMonoid M] [Module R M] {m : M} {s : Set M} :
          m Submodule.span R s ∃ (n : ) (f : Fin nR) (g : Fin ns), i : Fin n, f i (g i) = m

          An element m ∈ M is contained in the R-submodule spanned by a set s ⊆ M, if and only if m can be written as a finite R-linear combination of elements of s. The implementation uses a sum indexed by Fin n for some n.

          theorem span_eq_iUnion_nat {R : Type u_1} {M : Type u_2} [Semiring R] [AddCommMonoid M] [Module R M] (s : Set M) :
          (Submodule.span R s) = ⋃ (n : ), (fun (f : Fin nR × M) => i : Fin n, (f i).1 (f i).2) '' {f : Fin nR × M | ∀ (i : Fin n), (f i).2 s}

          The span of a subset s is the union over all n of the set of linear combinations of at most n terms belonging to s.