File: Mathlib/LinearAlgebra/Basis.lean

full_name: Basis.ofRepr
code: /-- A `Basis ι R M` for a module `M` is the type of `ι`-indexed `R`-bases of `M`.

The basis vectors are available as `DFunLike.coe (b : Basis ι R M) : ι → M`.
To turn a linear independent family of vectors spanning `M` into a basis, use `Basis.mk`.
They are internally represented as linear equivs `M ≃ₗ[R] (ι →₀ R)`,
available as `Basis.repr`.
-/
structure Basis where
  /-- `Basis.ofRepr` constructs a basis given an assignment of coordinates to each vector. -/
  ofRepr ::
    /-- `repr` is the linear equivalence sending a vector `x` to its coordinates:
    the `c`s such that `x = ∑ i, c i`. -/
    repr : M ≃ₗ[R] ι →₀ R
goal: Basis ι R M

full_name: Basis
code: /-- A `Basis ι R M` for a module `M` is the type of `ι`-indexed `R`-bases of `M`.

The basis vectors are available as `DFunLike.coe (b : Basis ι R M) : ι → M`.
To turn a linear independent family of vectors spanning `M` into a basis, use `Basis.mk`.
They are internally represented as linear equivs `M ≃ₗ[R] (ι →₀ R)`,
available as `Basis.repr`.
-/
structure Basis where
  /-- `Basis.ofRepr` constructs a basis given an assignment of coordinates to each vector. -/
  ofRepr ::
    /-- `repr` is the linear equivalence sending a vector `x` to its coordinates:
    the `c`s such that `x = ∑ i, c i`. -/
    repr : M ≃ₗ[R] ι →₀ R
goal: Type (max (max u_1 u_3) u_6)

full_name: Basis.repr
code: /-- A `Basis ι R M` for a module `M` is the type of `ι`-indexed `R`-bases of `M`.

The basis vectors are available as `DFunLike.coe (b : Basis ι R M) : ι → M`.
To turn a linear independent family of vectors spanning `M` into a basis, use `Basis.mk`.
They are internally represented as linear equivs `M ≃ₗ[R] (ι →₀ R)`,
available as `Basis.repr`.
-/
structure Basis where
  /-- `Basis.ofRepr` constructs a basis given an assignment of coordinates to each vector. -/
  ofRepr ::
    /-- `repr` is the linear equivalence sending a vector `x` to its coordinates:
    the `c`s such that `x = ∑ i, c i`. -/
    repr : M ≃ₗ[R] ι →₀ R
goal: M ≃ₗ[R] ι →₀ R

full_name: uniqueBasis
code: instance uniqueBasis [Subsingleton R] : Unique (Basis ι R M) 
goal: Unique (Basis ι R M)

full_name: Basis.instInhabitedFinsupp
code: instance : Inhabited (Basis ι R (ι →₀ R)) 
goal: Inhabited (Basis ι R (ι →₀ R))

full_name: Basis.repr_injective
code: theorem repr_injective : Injective (repr : Basis ι R M → M ≃ₗ[R] ι →₀ R) 
goal: Function.Injective Basis.repr

full_name: Basis.instFunLike
code: /-- `b i` is the `i`th basis vector. -/
instance instFunLike : FunLike (Basis ι R M) ι M 
goal: FunLike (Basis ι R M) ι M

full_name: Basis.coe_ofRepr
code: @[simp]
theorem coe_ofRepr (e : M ≃ₗ[R] ι →₀ R) : ⇑(ofRepr e) = fun i => e.symm (Finsupp.single i 1) 
goal: ⇑{ repr := e } = fun i => e.symm (Finsupp.single i 1)

full_name: Basis.injective
code: protected theorem injective [Nontrivial R] : Injective b 
goal: Function.Injective ⇑b

full_name: Basis.repr_symm_single_one
code: theorem repr_symm_single_one : b.repr.symm (Finsupp.single i 1) = b i 
goal: b.repr.symm (Finsupp.single i 1) = b i

full_name: Basis.repr_symm_single
code: theorem repr_symm_single : b.repr.symm (Finsupp.single i c) = c • b i 
goal: b.repr.symm (Finsupp.single i c) = c • b i

full_name: Basis.repr_self
code: @[simp]
theorem repr_self : b.repr (b i) = Finsupp.single i 1 
goal: b.repr (b i) = Finsupp.single i 1

full_name: Basis.repr_self_apply
code: theorem repr_self_apply (j) [Decidable (i = j)] : b.repr (b i) j = if i = j then 1 else 0 
goal: (b.repr (b i)) j = if i = j then 1 else 0

full_name: Basis.repr_symm_apply
code: @[simp]
theorem repr_symm_apply (v) : b.repr.symm v = Finsupp.total ι M R b v 
goal: b.repr.symm v = (Finsupp.total ι M R ⇑b) v

full_name: Basis.coe_repr_symm
code: @[simp]
theorem coe_repr_symm : ↑b.repr.symm = Finsupp.total ι M R b 
goal: ↑b.repr.symm = Finsupp.total ι M R ⇑b

full_name: Basis.repr_total
code: @[simp]
theorem repr_total (v) : b.repr (Finsupp.total _ _ _ b v) = v 
goal: b.repr ((Finsupp.total ι M R ⇑b) v) = v

full_name: Basis.total_repr
code: @[simp]
theorem total_repr : Finsupp.total _ _ _ b (b.repr x) = x 
goal: (Finsupp.total ι M R ⇑b) (b.repr x) = x

full_name: Basis.repr_range
code: theorem repr_range : LinearMap.range (b.repr : M →ₗ[R] ι →₀ R) = Finsupp.supported R R univ 
goal: LinearMap.range ↑b.repr = Finsupp.supported R R Set.univ

full_name: Basis.mem_span_repr_support
code: theorem mem_span_repr_support (m : M) : m ∈ span R (b '' (b.repr m).support) 
goal: m ∈ Submodule.span R (⇑b '' ↑(b.repr m).support)

full_name: Basis.repr_support_subset_of_mem_span
code: theorem repr_support_subset_of_mem_span (s : Set ι) {m : M}
    (hm : m ∈ span R (b '' s)) : ↑(b.repr m).support ⊆ s 
goal: ↑(b.repr m).support ⊆ s

full_name: Basis.mem_span_image
code: theorem mem_span_image {m : M} {s : Set ι} : m ∈ span R (b '' s) ↔ ↑(b.repr m).support ⊆ s 
goal: m ∈ Submodule.span R (⇑b '' s) ↔ ↑(b.repr m).support ⊆ s

full_name: Basis.self_mem_span_image
code: @[simp]
theorem self_mem_span_image [Nontrivial R] {i : ι} {s : Set ι} :
    b i ∈ span R (b '' s) ↔ i ∈ s 
goal: b i ∈ Submodule.span R (⇑b '' s) ↔ i ∈ s

full_name: Basis.coord
code: /-- `b.coord i` is the linear function giving the `i`'th coordinate of a vector
with respect to the basis `b`.

`b.coord i` is an element of the dual space. In particular, for
finite-dimensional spaces it is the `ι`th basis vector of the dual space.
-/
@[simps!]
def coord : M →ₗ[R] R 
goal: M →ₗ[R] R

full_name: Basis.coord_apply
code: /-- `b.coord i` is the linear function giving the `i`'th coordinate of a vector
with respect to the basis `b`.

`b.coord i` is an element of the dual space. In particular, for
finite-dimensional spaces it is the `ι`th basis vector of the dual space.
-/
@[simps!]
def coord : M →ₗ[R] R 
goal: ∀ (a : M), (b.coord i) a = (b.repr a) i

full_name: Basis.forall_coord_eq_zero_iff
code: theorem forall_coord_eq_zero_iff {x : M} : (∀ i, b.coord i x = 0) ↔ x = 0 
goal: (∀ (i : ι), (b.coord i) x = 0) ↔ x = 0

full_name: Basis.sumCoords
code: /-- The sum of the coordinates of an element `m : M` with respect to a basis. -/
noncomputable def sumCoords : M →ₗ[R] R 
goal: M →ₗ[R] R

full_name: Basis.coe_sumCoords
code: @[simp]
theorem coe_sumCoords : (b.sumCoords : M → R) = fun m => (b.repr m).sum fun _ => id 
goal: ⇑b.sumCoords = fun m => (b.repr m).sum fun x => id

full_name: Basis.coe_sumCoords_eq_finsum
code: theorem coe_sumCoords_eq_finsum : (b.sumCoords : M → R) = fun m => ∑ᶠ i, b.coord i m 
goal: ⇑b.sumCoords = fun m => ∑ᶠ (i : ι), (b.coord i) m

full_name: Basis.coe_sumCoords_of_fintype
code: @[simp high]
theorem coe_sumCoords_of_fintype [Fintype ι] : (b.sumCoords : M → R) = ∑ i, b.coord i 
goal: ⇑b.sumCoords = ⇑(∑ i : ι, b.coord i)

full_name: Basis.sumCoords_self_apply
code: @[simp]
theorem sumCoords_self_apply : b.sumCoords (b i) = 1 
goal: b.sumCoords (b i) = 1

full_name: Basis.dvd_coord_smul
code: theorem dvd_coord_smul (i : ι) (m : M) (r : R) : r ∣ b.coord i (r • m) 
goal: r ∣ (b.coord i) (r • m)

full_name: Basis.coord_repr_symm
code: theorem coord_repr_symm (b : Basis ι R M) (i : ι) (f : ι →₀ R) :
    b.coord i (b.repr.symm f) = f i 
goal: (b.coord i) (b.repr.symm f) = f i

full_name: Basis.ext
code: /-- Two linear maps are equal if they are equal on basis vectors. -/
theorem ext {f₁ f₂ : M →ₛₗ[σ] M₁} (h : ∀ i, f₁ (b i) = f₂ (b i)) : f₁ = f₂ 
goal: f₁ = f₂

full_name: Basis.ext'
code: /-- Two linear equivs are equal if they are equal on basis vectors. -/
theorem ext' {f₁ f₂ : M ≃ₛₗ[σ] M₁} (h : ∀ i, f₁ (b i) = f₂ (b i)) : f₁ = f₂ 
goal: f₁ = f₂

full_name: Basis.ext_elem_iff
code: /-- Two elements are equal iff their coordinates are equal. -/
theorem ext_elem_iff {x y : M} : x = y ↔ ∀ i, b.repr x i = b.repr y i 
goal: x = y ↔ ∀ (i : ι), (b.repr x) i = (b.repr y) i

full_name: Basis.repr_eq_iff
code: theorem repr_eq_iff {b : Basis ι R M} {f : M →ₗ[R] ι →₀ R} :
    ↑b.repr = f ↔ ∀ i, f (b i) = Finsupp.single i 1 
goal: ↑b.repr = f ↔ ∀ (i : ι), f (b i) = Finsupp.single i 1

full_name: Basis.repr_eq_iff'
code: theorem repr_eq_iff' {b : Basis ι R M} {f : M ≃ₗ[R] ι →₀ R} :
    b.repr = f ↔ ∀ i, f (b i) = Finsupp.single i 1 
goal: b.repr = f ↔ ∀ (i : ι), f (b i) = Finsupp.single i 1

full_name: Basis.apply_eq_iff
code: theorem apply_eq_iff {b : Basis ι R M} {x : M} {i : ι} : b i = x ↔ b.repr x = Finsupp.single i 1 
goal: b i = x ↔ b.repr x = Finsupp.single i 1

full_name: Basis.repr_apply_eq
code: /-- An unbundled version of `repr_eq_iff` -/
theorem repr_apply_eq (f : M → ι → R) (hadd : ∀ x y, f (x + y) = f x + f y)
    (hsmul : ∀ (c : R) (x : M), f (c • x) = c • f x) (f_eq : ∀ i, f (b i) = Finsupp.single i 1)
    (x : M) (i : ι) : b.repr x i = f x i 
goal: (b.repr x) i = f x i

full_name: Basis.eq_ofRepr_eq_repr
code: /-- Two bases are equal if they assign the same coordinates. -/
theorem eq_ofRepr_eq_repr {b₁ b₂ : Basis ι R M} (h : ∀ x i, b₁.repr x i = b₂.repr x i) : b₁ = b₂ 
goal: b₁ = b₂

full_name: Basis.eq_of_apply_eq
code: /-- Two bases are equal if their basis vectors are the same. -/
@[ext]
theorem eq_of_apply_eq {b₁ b₂ : Basis ι R M} : (∀ i, b₁ i = b₂ i) → b₁ = b₂ 
goal: (∀ (i : ι), b₁ i = b₂ i) → b₁ = b₂

full_name: Basis.map_repr
code: /-- Apply the linear equivalence `f` to the basis vectors. -/
@[simps]
protected def map : Basis ι R M' 
goal: (b.map f).repr = f.symm ≪≫ₗ b.repr

full_name: Basis.map
code: /-- Apply the linear equivalence `f` to the basis vectors. -/
@[simps]
protected def map : Basis ι R M' 
goal: Basis ι R M'

full_name: Basis.map_apply
code: @[simp]
theorem map_apply (i) : b.map f i = f (b i) 
goal: (b.map f) i = f (b i)

full_name: Basis.coe_map
code: theorem coe_map : (b.map f : ι → M') = f ∘ b 
goal: ⇑(b.map f) = ⇑f ∘ ⇑b

full_name: Basis.instSMul
code: /-- The action on a `Basis` by acting on each element.

See also `Basis.unitsSMul` and `Basis.groupSMul`, for the cases when a different action is applied
to each basis element. -/
instance : SMul G (Basis ι R M) 
goal: SMul G (Basis ι R M)

full_name: Basis.smul_apply
code: @[simp]
theorem smul_apply (g : G) (b : Basis ι R M) (i : ι) : (g • b) i = g • b i 
goal: (g • b) i = g • b i

full_name: Basis.coe_smul
code: @[norm_cast] theorem coe_smul (g : G) (b : Basis ι R M) : ⇑(g • b) = g • ⇑b 
goal: ⇑(g • b) = g • ⇑b

full_name: Basis.smul_eq_map
code: /-- When the group in question is the automorphisms, `•` coincides with `Basis.map`. -/
@[simp]
theorem smul_eq_map (g : M ≃ₗ[R] M) (b : Basis ι R M) : g • b = b.map g 
goal: g • b = b.map g

full_name: Basis.repr_smul
code: @[simp] theorem repr_smul (g : G) (b : Basis ι R M) :
    (g • b).repr = (DistribMulAction.toLinearEquiv _ _ g).symm.trans b.repr 
goal: (g • b).repr = (DistribMulAction.toLinearEquiv R M g).symm ≪≫ₗ b.repr

full_name: Basis.instMulAction
code: instance : MulAction G (Basis ι R M) 
goal: MulAction G (Basis ι R M)

full_name: Basis.instSMulCommClass
code: instance [SMulCommClass G G' M] : SMulCommClass G G' (Basis ι R M) 
goal: SMulCommClass G G' (Basis ι R M)

full_name: Basis.instIsScalarTower
code: instance [SMul G G'] [IsScalarTower G G' M] : IsScalarTower G G' (Basis ι R M) 
goal: IsScalarTower G G' (Basis ι R M)

full_name: Basis.mapCoeffs_repr
code: /-- If `R` and `R'` are isomorphic rings that act identically on a module `M`,
then a basis for `M` as `R`-module is also a basis for `M` as `R'`-module.

See also `Basis.algebraMapCoeffs` for the case where `f` is equal to `algebraMap`.
-/
@[simps (config := { simpRhs := true })]
def mapCoeffs : Basis ι R' M 
goal: (b.mapCoeffs f h).repr =
  LinearEquiv.restrictScalars R' b.repr ≪≫ₗ Finsupp.mapRange.linearEquiv (Module.compHom.toLinearEquiv f.symm).symm

full_name: Basis.mapCoeffs
code: /-- If `R` and `R'` are isomorphic rings that act identically on a module `M`,
then a basis for `M` as `R`-module is also a basis for `M` as `R'`-module.

See also `Basis.algebraMapCoeffs` for the case where `f` is equal to `algebraMap`.
-/
@[simps (config := { simpRhs := true })]
def mapCoeffs : Basis ι R' M 
goal: Basis ι R' M

full_name: Basis.mapCoeffs_apply
code: theorem mapCoeffs_apply (i : ι) : b.mapCoeffs f h i = b i 
goal: (b.mapCoeffs f h) i = b i

full_name: Basis.coe_mapCoeffs
code: @[simp]
theorem coe_mapCoeffs : (b.mapCoeffs f h : ι → M) = b 
goal: ⇑(b.mapCoeffs f h) = ⇑b

full_name: Basis.reindex
code: /-- `b.reindex (e : ι ≃ ι')` is a basis indexed by `ι'` -/
def reindex : Basis ι' R M 
goal: Basis ι' R M

full_name: Basis.reindex_apply
code: theorem reindex_apply (i' : ι') : b.reindex e i' = b (e.symm i') 
goal: (b.reindex e) i' = b (e.symm i')

full_name: Basis.coe_reindex
code: @[simp]
theorem coe_reindex : (b.reindex e : ι' → M) = b ∘ e.symm 
goal: ⇑(b.reindex e) = ⇑b ∘ ⇑e.symm

full_name: Basis.repr_reindex_apply
code: theorem repr_reindex_apply (i' : ι') : (b.reindex e).repr x i' = b.repr x (e.symm i') 
goal: ((b.reindex e).repr x) i' = (b.repr x) (e.symm i')

full_name: Basis.repr_reindex
code: @[simp]
theorem repr_reindex : (b.reindex e).repr x = (b.repr x).mapDomain e 
goal: (b.reindex e).repr x = Finsupp.mapDomain (⇑e) (b.repr x)

full_name: Basis.reindex_refl
code: @[simp]
theorem reindex_refl : b.reindex (Equiv.refl ι) = b 
goal: b.reindex (Equiv.refl ι) = b

full_name: Basis.range_reindex
code: /-- `simp` can prove this as `Basis.coe_reindex` + `EquivLike.range_comp` -/
theorem range_reindex : Set.range (b.reindex e) = Set.range b 
goal: Set.range ⇑(b.reindex e) = Set.range ⇑b

full_name: Basis.sumCoords_reindex
code: @[simp]
theorem sumCoords_reindex : (b.reindex e).sumCoords = b.sumCoords 
goal: (b.reindex e).sumCoords = b.sumCoords

full_name: Basis.reindexRange
code: /-- `b.reindex_range` is a basis indexed by `range b`, the basis vectors themselves. -/
def reindexRange : Basis (range b) R M 
goal: Basis (↑(Set.range ⇑b)) R M

full_name: Basis.reindexRange_self
code: theorem reindexRange_self (i : ι) (h := Set.mem_range_self i) : b.reindexRange ⟨b i, h⟩ = b i 
goal: b.reindexRange ⟨b i, h⟩ = b i

full_name: Basis.reindexRange_repr_self
code: theorem reindexRange_repr_self (i : ι) :
    b.reindexRange.repr (b i) = Finsupp.single ⟨b i, mem_range_self i⟩ 1 
goal: b.reindexRange.repr (b i) = Finsupp.single ⟨b i, ⋯⟩ 1

full_name: Basis.reindexRange_apply
code: @[simp]
theorem reindexRange_apply (x : range b) : b.reindexRange x = x 
goal: b.reindexRange x = ↑x

full_name: Basis.reindexRange_repr'
code: theorem reindexRange_repr' (x : M) {bi : M} {i : ι} (h : b i = bi) :
    b.reindexRange.repr x ⟨bi, ⟨i, h⟩⟩ = b.repr x i 
goal: (b.reindexRange.repr x) ⟨bi, ⋯⟩ = (b.repr x) i

full_name: Basis.reindexRange_repr
code: @[simp]
theorem reindexRange_repr (x : M) (i : ι) (h := Set.mem_range_self i) :
    b.reindexRange.repr x ⟨b i, h⟩ = b.repr x i 
goal: (b.reindexRange.repr x) ⟨b i, h⟩ = (b.repr x) i

full_name: Basis.reindexFinsetRange
code: /-- `b.reindexFinsetRange` is a basis indexed by `Finset.univ.image b`,
the finite set of basis vectors themselves. -/
def reindexFinsetRange : Basis (Finset.univ.image b) R M 
goal: Basis { x // x ∈ Finset.image (⇑b) Finset.univ } R M

full_name: Basis.reindexFinsetRange_self
code: theorem reindexFinsetRange_self (i : ι) (h := Finset.mem_image_of_mem b (Finset.mem_univ i)) :
    b.reindexFinsetRange ⟨b i, h⟩ = b i 
goal: b.reindexFinsetRange ⟨b i, h⟩ = b i

full_name: Basis.reindexFinsetRange_apply
code: @[simp]
theorem reindexFinsetRange_apply (x : Finset.univ.image b) : b.reindexFinsetRange x = x 
goal: b.reindexFinsetRange x = ↑x

full_name: Basis.reindexFinsetRange_repr_self
code: theorem reindexFinsetRange_repr_self (i : ι) :
    b.reindexFinsetRange.repr (b i) =
      Finsupp.single ⟨b i, Finset.mem_image_of_mem b (Finset.mem_univ i)⟩ 1 
goal: b.reindexFinsetRange.repr (b i) = Finsupp.single ⟨b i, ⋯⟩ 1

full_name: Basis.reindexFinsetRange_repr
code: @[simp]
theorem reindexFinsetRange_repr (x : M) (i : ι)
    (h := Finset.mem_image_of_mem b (Finset.mem_univ i)) :
    b.reindexFinsetRange.repr x ⟨b i, h⟩ = b.repr x i 
goal: (b.reindexFinsetRange.repr x) ⟨b i, h⟩ = (b.repr x) i

full_name: Basis.linearIndependent
code: protected theorem linearIndependent : LinearIndependent R b 
goal: LinearIndependent R ⇑b

full_name: Basis.ne_zero
code: protected theorem ne_zero [Nontrivial R] (i) : b i ≠ 0 
goal: b i ≠ 0

full_name: Basis.mem_span
code: protected theorem mem_span (x : M) : x ∈ span R (range b) 
goal: x ∈ Submodule.span R (Set.range ⇑b)

full_name: Basis.span_eq
code: @[simp]
protected theorem span_eq : span R (range b) = ⊤ 
goal: Submodule.span R (Set.range ⇑b) = ⊤

full_name: Basis.index_nonempty
code: theorem index_nonempty (b : Basis ι R M) [Nontrivial M] : Nonempty ι 
goal: Nonempty ι

full_name: Basis.mem_submodule_iff
code: /-- If the submodule `P` has a basis, `x ∈ P` iff it is a linear combination of basis vectors. -/
theorem mem_submodule_iff {P : Submodule R M} (b : Basis ι R P) {x : M} :
    x ∈ P ↔ ∃ c : ι →₀ R, x = Finsupp.sum c fun i x => x • (b i : M) 
goal: x ∈ P ↔ ∃ c, x = c.sum fun i x => x • ↑(b i)

full_name: Basis.constr
code: /-- Construct a linear map given the value at the basis, called `Basis.constr b S f` where `b` is
a basis, `f` is the value of the linear map over the elements of the basis, and `S` is an
extra semiring (typically `S = R` or `S = ℕ`).

This definition is parameterized over an extra `Semiring S`,
such that `SMulCommClass R S M'` holds.
If `R` is commutative, you can set `S := R`; if `R` is not commutative,
you can recover an `AddEquiv` by setting `S := ℕ`.
See library note [bundled maps over different rings].
-/
def constr : (ι → M') ≃ₗ[S] M →ₗ[R] M' 
goal: (ι → M') ≃ₗ[S] M →ₗ[R] M'

full_name: Basis.constr_def
code: theorem constr_def (f : ι → M') :
    constr (M' := M') b S f = Finsupp.total M' M' R id ∘ₗ Finsupp.lmapDomain R R f ∘ₗ ↑b.repr 
goal: (b.constr S) f = Finsupp.total M' M' R id ∘ₗ Finsupp.lmapDomain R R f ∘ₗ ↑b.repr

full_name: Basis.constr_apply
code: theorem constr_apply (f : ι → M') (x : M) :
    constr (M' := M') b S f x = (b.repr x).sum fun b a => a • f b 
goal: ((b.constr S) f) x = (b.repr x).sum fun b a => a • f b

full_name: Basis.constr_basis
code: @[simp]
theorem constr_basis (f : ι → M') (i : ι) : (constr (M' := M') b S f : M → M') (b i) = f i 
goal: ((b.constr S) f) (b i) = f i

full_name: Basis.constr_eq
code: theorem constr_eq {g : ι → M'} {f : M →ₗ[R] M'} (h : ∀ i, g i = f (b i)) :
    constr (M' := M') b S g = f 
goal: (b.constr S) g = f

full_name: Basis.constr_self
code: theorem constr_self (f : M →ₗ[R] M') : (constr (M' := M') b S fun i => f (b i)) = f 
goal: ((b.constr S) fun i => f (b i)) = f

full_name: Basis.constr_range
code: theorem constr_range {f : ι → M'} :
    LinearMap.range (constr (M' := M') b S f) = span R (range f) 
goal: LinearMap.range ((b.constr S) f) = Submodule.span R (Set.range f)

full_name: Basis.constr_comp
code: @[simp]
theorem constr_comp (f : M' →ₗ[R] M') (v : ι → M') :
    constr (M' := M') b S (f ∘ v) = f.comp (constr (M' := M') b S v) 
goal: (b.constr S) (⇑f ∘ v) = f ∘ₗ (b.constr S) v

full_name: Basis.equiv
code: /-- If `b` is a basis for `M` and `b'` a basis for `M'`, and the index types are equivalent,
`b.equiv b' e` is a linear equivalence `M ≃ₗ[R] M'`, mapping `b i` to `b' (e i)`. -/
protected def equiv : M ≃ₗ[R] M' 
goal: M ≃ₗ[R] M'

full_name: Basis.equiv_apply
code: @[simp]
theorem equiv_apply : b.equiv b' e (b i) = b' (e i) 
goal: (b.equiv b' e) (b i) = b' (e i)

full_name: Basis.equiv_refl
code: @[simp]
theorem equiv_refl : b.equiv b (Equiv.refl ι) = LinearEquiv.refl R M 
goal: b.equiv b (Equiv.refl ι) = LinearEquiv.refl R M

full_name: Basis.equiv_symm
code: @[simp]
theorem equiv_symm : (b.equiv b' e).symm = b'.equiv b e.symm 
goal: (b.equiv b' e).symm = b'.equiv b e.symm

full_name: Basis.equiv_trans
code: @[simp]
theorem equiv_trans {ι'' : Type*} (b'' : Basis ι'' R M'') (e : ι ≃ ι') (e' : ι' ≃ ι'') :
    (b.equiv b' e).trans (b'.equiv b'' e') = b.equiv b'' (e.trans e') 
goal: b.equiv b' e ≪≫ₗ b'.equiv b'' e' = b.equiv b'' (e.trans e')

full_name: Basis.map_equiv
code: @[simp]
theorem map_equiv (b : Basis ι R M) (b' : Basis ι' R M') (e : ι ≃ ι') :
    b.map (b.equiv b' e) = b'.reindex e.symm 
goal: b.map (b.equiv b' e) = b'.reindex e.symm

full_name: Basis.prod
code: /-- `Basis.prod` maps an `ι`-indexed basis for `M` and an `ι'`-indexed basis for `M'`
to an `ι ⊕ ι'`-index basis for `M × M'`.
For the specific case of `R × R`, see also `Basis.finTwoProd`. -/
protected def prod : Basis (ι ⊕ ι') R (M × M') 
goal: Basis (ι ⊕ ι') R (M × M')

full_name: Basis.prod_repr_inl
code: @[simp]
theorem prod_repr_inl (x) (i) : (b.prod b').repr x (Sum.inl i) = b.repr x.1 i 
goal: ((b.prod b').repr x) (Sum.inl i) = (b.repr x.1) i

full_name: Basis.prod_repr_inr
code: @[simp]
theorem prod_repr_inr (x) (i) : (b.prod b').repr x (Sum.inr i) = b'.repr x.2 i 
goal: ((b.prod b').repr x) (Sum.inr i) = (b'.repr x.2) i

full_name: Basis.prod_apply_inl_fst
code: theorem prod_apply_inl_fst (i) : (b.prod b' (Sum.inl i)).1 = b i 
goal: ((b.prod b') (Sum.inl i)).1 = b i

full_name: Basis.prod_apply_inr_fst
code: theorem prod_apply_inr_fst (i) : (b.prod b' (Sum.inr i)).1 = 0 
goal: ((b.prod b') (Sum.inr i)).1 = 0

full_name: Basis.prod_apply_inl_snd
code: theorem prod_apply_inl_snd (i) : (b.prod b' (Sum.inl i)).2 = 0 
goal: ((b.prod b') (Sum.inl i)).2 = 0

full_name: Basis.prod_apply_inr_snd
code: theorem prod_apply_inr_snd (i) : (b.prod b' (Sum.inr i)).2 = b' i 
goal: ((b.prod b') (Sum.inr i)).2 = b' i

full_name: Basis.prod_apply
code: @[simp]
theorem prod_apply (i) :
    b.prod b' i = Sum.elim (LinearMap.inl R M M' ∘ b) (LinearMap.inr R M M' ∘ b') i 
goal: (b.prod b') i = Sum.elim (⇑(LinearMap.inl R M M') ∘ ⇑b) (⇑(LinearMap.inr R M M') ∘ ⇑b') i

full_name: Basis.noZeroSMulDivisors
code: protected theorem noZeroSMulDivisors [NoZeroDivisors R] (b : Basis ι R M) :
    NoZeroSMulDivisors R M 
goal: NoZeroSMulDivisors R M

full_name: Basis.smul_eq_zero
code: protected theorem smul_eq_zero [NoZeroDivisors R] (b : Basis ι R M) {c : R} {x : M} :
    c • x = 0 ↔ c = 0 ∨ x = 0 
goal: c • x = 0 ↔ c = 0 ∨ x = 0

full_name: Basis.eq_bot_of_rank_eq_zero
code: theorem eq_bot_of_rank_eq_zero [NoZeroDivisors R] (b : Basis ι R M) (N : Submodule R M)
    (rank_eq : ∀ {m : ℕ} (v : Fin m → N), LinearIndependent R ((↑) ∘ v : Fin m → M) → m = 0) :
    N = ⊥ 
goal: N = ⊥

full_name: Basis.singleton
code: /-- `Basis.singleton ι R` is the basis sending the unique element of `ι` to `1 : R`. -/
protected def singleton (ι R : Type*) [Unique ι] [Semiring R] : Basis ι R R 
goal: Basis ι R R

full_name: Basis.singleton_apply
code: @[simp]
theorem singleton_apply (ι R : Type*) [Unique ι] [Semiring R] (i) : Basis.singleton ι R i = 1 
goal: (Basis.singleton ι R) i = 1

full_name: Basis.singleton_repr
code: @[simp]
theorem singleton_repr (ι R : Type*) [Unique ι] [Semiring R] (x i) :
    (Basis.singleton ι R).repr x i = x 
goal: ((Basis.singleton ι R).repr x) i = x

full_name: Basis.basis_singleton_iff
code: theorem basis_singleton_iff {R M : Type*} [Ring R] [Nontrivial R] [AddCommGroup M] [Module R M]
    [NoZeroSMulDivisors R M] (ι : Type*) [Unique ι] :
    Nonempty (Basis ι R M) ↔ ∃ x ≠ 0, ∀ y : M, ∃ r : R, r • x = y 
goal: Nonempty (Basis ι R M) ↔ ∃ x, x ≠ 0 ∧ ∀ (y : M), ∃ r, r • x = y

full_name: Basis.empty
code: /-- If `M` is a subsingleton and `ι` is empty, this is the unique `ι`-indexed basis for `M`. -/
protected def empty [Subsingleton M] [IsEmpty ι] : Basis ι R M 
goal: Basis ι R M

full_name: Basis.emptyUnique
code: instance emptyUnique [Subsingleton M] [IsEmpty ι] : Unique (Basis ι R M) 
goal: Unique (Basis ι R M)

full_name: Basis.equivFun
code: /-- A module over `R` with a finite basis is linearly equivalent to functions from its basis to `R`.
-/
def Basis.equivFun [Finite ι] (b : Basis ι R M) : M ≃ₗ[R] ι → R 
goal: M ≃ₗ[R] ι → R

full_name: Module.fintypeOfFintype
code: /-- A module over a finite ring that admits a finite basis is finite. -/
def Module.fintypeOfFintype [Fintype ι] (b : Basis ι R M) [Fintype R] : Fintype M 
goal: Fintype M

full_name: Module.card_fintype
code: theorem Module.card_fintype [Fintype ι] (b : Basis ι R M) [Fintype R] [Fintype M] :
    card M = card R ^ card ι 
goal: Fintype.card M = Fintype.card R ^ Fintype.card ι

full_name: Basis.equivFun_symm_apply
code: /-- Given a basis `v` indexed by `ι`, the canonical linear equivalence between `ι → R` and `M` maps
a function `x : ι → R` to the linear combination `∑_i x i • v i`. -/
@[simp]
theorem Basis.equivFun_symm_apply [Fintype ι] (b : Basis ι R M) (x : ι → R) :
    b.equivFun.symm x = ∑ i, x i • b i 
goal: b.equivFun.symm x = ∑ i : ι, x i • b i

full_name: Basis.equivFun_apply
code: @[simp]
theorem Basis.equivFun_apply [Finite ι] (b : Basis ι R M) (u : M) : b.equivFun u = b.repr u 
goal: b.equivFun u = ⇑(b.repr u)

full_name: Basis.map_equivFun
code: @[simp]
theorem Basis.map_equivFun [Finite ι] (b : Basis ι R M) (f : M ≃ₗ[R] M') :
    (b.map f).equivFun = f.symm.trans b.equivFun 
goal: (b.map f).equivFun = f.symm ≪≫ₗ b.equivFun

full_name: Basis.sum_equivFun
code: theorem Basis.sum_equivFun [Fintype ι] (b : Basis ι R M) (u : M) :
    ∑ i, b.equivFun u i • b i = u 
goal: ∑ i : ι, b.equivFun u i • b i = u

full_name: Basis.sum_repr
code: theorem Basis.sum_repr [Fintype ι] (b : Basis ι R M) (u : M) : ∑ i, b.repr u i • b i = u 
goal: ∑ i : ι, (b.repr u) i • b i = u

full_name: Basis.equivFun_self
code: @[simp]
theorem Basis.equivFun_self [Finite ι] [DecidableEq ι] (b : Basis ι R M) (i j : ι) :
    b.equivFun (b i) j = if i = j then 1 else 0 
goal: b.equivFun (b i) j = if i = j then 1 else 0

full_name: Basis.repr_sum_self
code: theorem Basis.repr_sum_self [Fintype ι] (b : Basis ι R M) (c : ι → R) :
    b.repr (∑ i, c i • b i) = c 
goal: ⇑(b.repr (∑ i : ι, c i • b i)) = c

full_name: Basis.ofEquivFun
code: /-- Define a basis by mapping each vector `x : M` to its coordinates `e x : ι → R`,
as long as `ι` is finite. -/
def Basis.ofEquivFun [Finite ι] (e : M ≃ₗ[R] ι → R) : Basis ι R M 
goal: Basis ι R M

full_name: Basis.ofEquivFun_repr_apply
code: @[simp]
theorem Basis.ofEquivFun_repr_apply [Finite ι] (e : M ≃ₗ[R] ι → R) (x : M) (i : ι) :
    (Basis.ofEquivFun e).repr x i = e x i 
goal: ((Basis.ofEquivFun e).repr x) i = e x i

full_name: Basis.coe_ofEquivFun
code: @[simp]
theorem Basis.coe_ofEquivFun [Finite ι] [DecidableEq ι] (e : M ≃ₗ[R] ι → R) :
    (Basis.ofEquivFun e : ι → M) = fun i => e.symm (Function.update 0 i 1) 
goal: ⇑(Basis.ofEquivFun e) = fun i => e.symm (Function.update 0 i 1)

full_name: Basis.ofEquivFun_equivFun
code: @[simp]
theorem Basis.ofEquivFun_equivFun [Finite ι] (v : Basis ι R M) :
    Basis.ofEquivFun v.equivFun = v 
goal: Basis.ofEquivFun v.equivFun = v

full_name: Basis.equivFun_ofEquivFun
code: @[simp]
theorem Basis.equivFun_ofEquivFun [Finite ι] (e : M ≃ₗ[R] ι → R) :
    (Basis.ofEquivFun e).equivFun = e 
goal: (Basis.ofEquivFun e).equivFun = e

full_name: Basis.constr_apply_fintype
code: @[simp]
theorem Basis.constr_apply_fintype [Fintype ι] (b : Basis ι R M) (f : ι → M') (x : M) :
    (constr (M' := M') b S f : M → M') x = ∑ i, b.equivFun x i • f i 
goal: ((b.constr S) f) x = ∑ i : ι, b.equivFun x i • f i

full_name: Basis.mem_submodule_iff'
code: /-- If the submodule `P` has a finite basis,
`x ∈ P` iff it is a linear combination of basis vectors. -/
theorem Basis.mem_submodule_iff' [Fintype ι] {P : Submodule R M} (b : Basis ι R P) {x : M} :
    x ∈ P ↔ ∃ c : ι → R, x = ∑ i, c i • (b i : M) 
goal: x ∈ P ↔ ∃ c, x = ∑ i : ι, c i • ↑(b i)

full_name: Basis.coord_equivFun_symm
code: theorem Basis.coord_equivFun_symm [Finite ι] (b : Basis ι R M) (i : ι) (f : ι → R) :
    b.coord i (b.equivFun.symm f) = f i 
goal: (b.coord i) (b.equivFun.symm f) = f i

full_name: Basis.equiv'
code: /-- If `b` is a basis for `M` and `b'` a basis for `M'`,
and `f`, `g` form a bijection between the basis vectors,
`b.equiv' b' f g hf hg hgf hfg` is a linear equivalence `M ≃ₗ[R] M'`, mapping `b i` to `f (b i)`.
-/
def equiv' (f : M → M') (g : M' → M) (hf : ∀ i, f (b i) ∈ range b') (hg : ∀ i, g (b' i) ∈ range b)
    (hgf : ∀ i, g (f (b i)) = b i) (hfg : ∀ i, f (g (b' i)) = b' i) : M ≃ₗ[R] M' 
goal: M ≃ₗ[R] M'

full_name: Basis.equiv'_apply
code: @[simp]
theorem equiv'_apply (f : M → M') (g : M' → M) (hf hg hgf hfg) (i : ι) :
    b.equiv' b' f g hf hg hgf hfg (b i) = f (b i) 
goal: (b.equiv' b' f g hf hg hgf hfg) (b i) = f (b i)

full_name: Basis.equiv'_symm_apply
code: @[simp]
theorem equiv'_symm_apply (f : M → M') (g : M' → M) (hf hg hgf hfg) (i : ι') :
    (b.equiv' b' f g hf hg hgf hfg).symm (b' i) = g (b' i) 
goal: (b.equiv' b' f g hf hg hgf hfg).symm (b' i) = g (b' i)

full_name: Basis.sum_repr_mul_repr
code: theorem sum_repr_mul_repr {ι'} [Fintype ι'] (b' : Basis ι' R M) (x : M) (i : ι) :
    (∑ j : ι', b.repr (b' j) i * b'.repr x j) = b.repr x i 
goal: ∑ j : ι', (b.repr (b' j)) i * (b'.repr x) j = (b.repr x) i

full_name: Basis.maximal
code: /-- Any basis is a maximal linear independent set.
-/
theorem maximal [Nontrivial R] (b : Basis ι R M) : b.linearIndependent.Maximal 
goal: ⋯.Maximal

full_name: Basis.mk
code: /-- A linear independent family of vectors spanning the whole module is a basis. -/
protected noncomputable def mk : Basis ι R M 
goal: Basis ι R M

full_name: Basis.mk_repr
code: @[simp]
theorem mk_repr : (Basis.mk hli hsp).repr x = hli.repr ⟨x, hsp Submodule.mem_top⟩ 
goal: (Basis.mk hli hsp).repr x = hli.repr ⟨x, ⋯⟩

full_name: Basis.mk_apply
code: theorem mk_apply (i : ι) : Basis.mk hli hsp i = v i 
goal: (Basis.mk hli hsp) i = v i

full_name: Basis.coe_mk
code: @[simp]
theorem coe_mk : ⇑(Basis.mk hli hsp) = v 
goal: ⇑(Basis.mk hli hsp) = v

full_name: Basis.mk_coord_apply_eq
code: /-- Given a basis, the `i`th element of the dual basis evaluates to 1 on the `i`th element of the
basis. -/
theorem mk_coord_apply_eq (i : ι) : (Basis.mk hli hsp).coord i (v i) = 1 
goal: ((Basis.mk hli hsp).coord i) (v i) = 1

full_name: Basis.mk_coord_apply_ne
code: /-- Given a basis, the `i`th element of the dual basis evaluates to 0 on the `j`th element of the
basis if `j ≠ i`. -/
theorem mk_coord_apply_ne {i j : ι} (h : j ≠ i) : (Basis.mk hli hsp).coord i (v j) = 0 
goal: ((Basis.mk hli hsp).coord i) (v j) = 0

full_name: Basis.mk_coord_apply
code: /-- Given a basis, the `i`th element of the dual basis evaluates to the Kronecker delta on the
`j`th element of the basis. -/
theorem mk_coord_apply [DecidableEq ι] {i j : ι} :
    (Basis.mk hli hsp).coord i (v j) = if j = i then 1 else 0 
goal: ((Basis.mk hli hsp).coord i) (v j) = if j = i then 1 else 0

full_name: Basis.span
code: /-- A linear independent family of vectors is a basis for their span. -/
protected noncomputable def span : Basis ι R (span R (range v)) 
goal: Basis ι R ↥(Submodule.span R (Set.range v))

full_name: Basis.span_apply
code: protected theorem span_apply (i : ι) : (Basis.span hli i : M) = v i 
goal: ↑((Basis.span hli) i) = v i

full_name: Basis.groupSMul_span_eq_top
code: theorem groupSMul_span_eq_top {G : Type*} [Group G] [DistribMulAction G R] [DistribMulAction G M]
    [IsScalarTower G R M] {v : ι → M} (hv : Submodule.span R (Set.range v) = ⊤) {w : ι → G} :
    Submodule.span R (Set.range (w • v)) = ⊤ 
goal: Submodule.span R (Set.range (w • v)) = ⊤

full_name: Basis.groupSMul
code: /-- Given a basis `v` and a map `w` such that for all `i`, `w i` are elements of a group,
`groupSMul` provides the basis corresponding to `w • v`. -/
def groupSMul {G : Type*} [Group G] [DistribMulAction G R] [DistribMulAction G M]
    [IsScalarTower G R M] [SMulCommClass G R M] (v : Basis ι R M) (w : ι → G) : Basis ι R M 
goal: Basis ι R M

full_name: Basis.groupSMul_apply
code: theorem groupSMul_apply {G : Type*} [Group G] [DistribMulAction G R] [DistribMulAction G M]
    [IsScalarTower G R M] [SMulCommClass G R M] {v : Basis ι R M} {w : ι → G} (i : ι) :
    v.groupSMul w i = (w • (v : ι → M)) i 
goal: (v.groupSMul w) i = (w • ⇑v) i

full_name: Basis.units_smul_span_eq_top
code: theorem units_smul_span_eq_top {v : ι → M} (hv : Submodule.span R (Set.range v) = ⊤) {w : ι → Rˣ} :
    Submodule.span R (Set.range (w • v)) = ⊤ 
goal: Submodule.span R (Set.range (w • v)) = ⊤

full_name: Basis.unitsSMul
code: /-- Given a basis `v` and a map `w` such that for all `i`, `w i` is a unit, `unitsSMul`
provides the basis corresponding to `w • v`. -/
def unitsSMul (v : Basis ι R M) (w : ι → Rˣ) : Basis ι R M 
goal: Basis ι R M

full_name: Basis.unitsSMul_apply
code: theorem unitsSMul_apply {v : Basis ι R M} {w : ι → Rˣ} (i : ι) : unitsSMul v w i = w i • v i 
goal: (v.unitsSMul w) i = w i • v i

full_name: Basis.coord_unitsSMul
code: @[simp]
theorem coord_unitsSMul (e : Basis ι R₂ M) (w : ι → R₂ˣ) (i : ι) :
    (unitsSMul e w).coord i = (w i)⁻¹ • e.coord i 
goal: (e.unitsSMul w).coord i = (w i)⁻¹ • e.coord i

full_name: Basis.repr_unitsSMul
code: @[simp]
theorem repr_unitsSMul (e : Basis ι R₂ M) (w : ι → R₂ˣ) (v : M) (i : ι) :
    (e.unitsSMul w).repr v i = (w i)⁻¹ • e.repr v i 
goal: ((e.unitsSMul w).repr v) i = (w i)⁻¹ • (e.repr v) i

full_name: Basis.isUnitSMul
code: /-- A version of `unitsSMul` that uses `IsUnit`. -/
def isUnitSMul (v : Basis ι R M) {w : ι → R} (hw : ∀ i, IsUnit (w i)) : Basis ι R M 
goal: Basis ι R M

full_name: Basis.isUnitSMul_apply
code: theorem isUnitSMul_apply {v : Basis ι R M} {w : ι → R} (hw : ∀ i, IsUnit (w i)) (i : ι) :
    v.isUnitSMul hw i = w i • v i 
goal: (v.isUnitSMul hw) i = w i • v i

full_name: Basis.mkFinCons
code: /-- Let `b` be a basis for a submodule `N` of `M`. If `y : M` is linear independent of `N`
and `y` and `N` together span the whole of `M`, then there is a basis for `M`
whose basis vectors are given by `Fin.cons y b`. -/
noncomputable def mkFinCons {n : ℕ} {N : Submodule R M} (y : M) (b : Basis (Fin n) R N)
    (hli : ∀ (c : R), ∀ x ∈ N, c • y + x = 0 → c = 0) (hsp : ∀ z : M, ∃ c : R, z + c • y ∈ N) :
    Basis (Fin (n + 1)) R M 
goal: Basis (Fin (n + 1)) R M

full_name: Basis.coe_mkFinCons
code: @[simp]
theorem coe_mkFinCons {n : ℕ} {N : Submodule R M} (y : M) (b : Basis (Fin n) R N)
    (hli : ∀ (c : R), ∀ x ∈ N, c • y + x = 0 → c = 0) (hsp : ∀ z : M, ∃ c : R, z + c • y ∈ N) :
    (mkFinCons y b hli hsp : Fin (n + 1) → M) = Fin.cons y ((↑) ∘ b) 
goal: ⇑(Basis.mkFinCons y b hli hsp) = Fin.cons y (Subtype.val ∘ ⇑b)

full_name: Basis.mkFinConsOfLE
code: /-- Let `b` be a basis for a submodule `N ≤ O`. If `y ∈ O` is linear independent of `N`
and `y` and `N` together span the whole of `O`, then there is a basis for `O`
whose basis vectors are given by `Fin.cons y b`. -/
noncomputable def mkFinConsOfLE {n : ℕ} {N O : Submodule R M} (y : M) (yO : y ∈ O)
    (b : Basis (Fin n) R N) (hNO : N ≤ O) (hli : ∀ (c : R), ∀ x ∈ N, c • y + x = 0 → c = 0)
    (hsp : ∀ z ∈ O, ∃ c : R, z + c • y ∈ N) : Basis (Fin (n + 1)) R O 
goal: Basis (Fin (n + 1)) R ↥O

full_name: Basis.coe_mkFinConsOfLE
code: @[simp]
theorem coe_mkFinConsOfLE {n : ℕ} {N O : Submodule R M} (y : M) (yO : y ∈ O) (b : Basis (Fin n) R N)
    (hNO : N ≤ O) (hli : ∀ (c : R), ∀ x ∈ N, c • y + x = 0 → c = 0)
    (hsp : ∀ z ∈ O, ∃ c : R, z + c • y ∈ N) :
    (mkFinConsOfLE y yO b hNO hli hsp : Fin (n + 1) → O) =
      Fin.cons ⟨y, yO⟩ (Submodule.inclusion hNO ∘ b) 
goal: ⇑(Basis.mkFinConsOfLE y yO b hNO hli hsp) = Fin.cons ⟨y, yO⟩ (⇑(Submodule.inclusion hNO) ∘ ⇑b)

full_name: Basis.finTwoProd
code: /-- The basis of `R × R` given by the two vectors `(1, 0)` and `(0, 1)`. -/
protected def finTwoProd (R : Type*) [Semiring R] : Basis (Fin 2) R (R × R) 
goal: Basis (Fin 2) R (R × R)

full_name: Basis.finTwoProd_zero
code: @[simp]
theorem finTwoProd_zero (R : Type*) [Semiring R] : Basis.finTwoProd R 0 = (1, 0) 
goal: (Basis.finTwoProd R) 0 = (1, 0)

full_name: Basis.finTwoProd_one
code: @[simp]
theorem finTwoProd_one (R : Type*) [Semiring R] : Basis.finTwoProd R 1 = (0, 1) 
goal: (Basis.finTwoProd R) 1 = (0, 1)

full_name: Basis.coe_finTwoProd_repr
code: @[simp]
theorem coe_finTwoProd_repr {R : Type*} [Semiring R] (x : R × R) :
    ⇑((Basis.finTwoProd R).repr x) = ![x.fst, x.snd] 
goal: ⇑((Basis.finTwoProd R).repr x) = ![x.1, x.2]

full_name: Submodule.inductionOnRankAux
code: /-- If `N` is a submodule with finite rank, do induction on adjoining a linear independent
element to a submodule. -/
def Submodule.inductionOnRankAux (b : Basis ι R M) (P : Submodule R M → Sort*)
    (ih : ∀ N : Submodule R M,
      (∀ N' ≤ N, ∀ x ∈ N, (∀ (c : R), ∀ y ∈ N', c • x + y = (0 : M) → c = 0) → P N') → P N)
    (n : ℕ) (N : Submodule R M)
    (rank_le : ∀ {m : ℕ} (v : Fin m → N), LinearIndependent R ((↑) ∘ v : Fin m → M) → m ≤ n) :
    P N 
goal: P N

full_name: Basis.mem_center_iff
code: /-- An element of a non-unital-non-associative algebra is in the center exactly when it commutes
with the basis elements. -/
lemma Basis.mem_center_iff {A}
    [Semiring R] [NonUnitalNonAssocSemiring A]
    [Module R A] [SMulCommClass R A A] [SMulCommClass R R A] [IsScalarTower R A A]
    (b : Basis ι R A) {z : A} :
    z ∈ Set.center A ↔
      (∀ i, Commute (b i) z) ∧ ∀ i j,
        z * (b i * b j) = (z * b i) * b j
          ∧ (b i * z) * b j = b i * (z * b j)
          ∧ (b i * b j) * z = b i * (b j * z) 
goal: z ∈ Set.center A ↔
  (∀ (i : ι), Commute (b i) z) ∧
    ∀ (i j : ι), z * (b i * b j) = z * b i * b j ∧ b i * z * b j = b i * (z * b j) ∧ b i * b j * z = b i * (b j * z)

full_name: Basis.restrictScalars
code: /-- Let `b` be an `S`-basis of `M`. Let `R` be a CommRing such that `Algebra R S` has no zero smul
divisors, then the submodule of `M` spanned by `b` over `R` admits `b` as an `R`-basis. -/
noncomputable def Basis.restrictScalars : Basis ι R (span R (Set.range b)) 
goal: Basis ι R ↥(Submodule.span R (Set.range ⇑b))

full_name: Basis.restrictScalars_apply
code: @[simp]
theorem Basis.restrictScalars_apply (i : ι) : (b.restrictScalars R i : M) = b i 
goal: ↑((Basis.restrictScalars R b) i) = b i

full_name: Basis.restrictScalars_repr_apply
code: @[simp]
theorem Basis.restrictScalars_repr_apply (m : span R (Set.range b)) (i : ι) :
    algebraMap R S ((b.restrictScalars R).repr m i) = b.repr m i 
goal: (algebraMap R S) (((Basis.restrictScalars R b).repr m) i) = (b.repr ↑m) i

full_name: Basis.mem_span_iff_repr_mem
code: /-- Let `b` be an `S`-basis of `M`. Then `m : M` lies in the `R`-module spanned by `b` iff all the
coordinates of `m` on the basis `b` are in `R` (see `Basis.mem_span` for the case `R = S`). -/
theorem Basis.mem_span_iff_repr_mem (m : M) :
    m ∈ span R (Set.range b) ↔ ∀ i, b.repr m i ∈ Set.range (algebraMap R S) 
goal: m ∈ Submodule.span R (Set.range ⇑b) ↔ ∀ (i : ι), (b.repr m) i ∈ Set.range ⇑(algebraMap R S)

full_name: basis_finite_of_finite_spans
code: /--
Over any nontrivial ring, the existence of a finite spanning set implies that any basis is finite.
-/
lemma basis_finite_of_finite_spans (w : Set M) (hw : w.Finite) (s : span R w = ⊤) {ι : Type w}
    (b : Basis ι R M) : Finite ι 
goal: Finite ι

full_name: union_support_maximal_linearIndependent_eq_range_basis
code: /-- Over any ring `R`, if `b` is a basis for a module `M`,
and `s` is a maximal linearly independent set,
then the union of the supports of `x ∈ s` (when written out in the basis `b`) is all of `b`.
-/
theorem union_support_maximal_linearIndependent_eq_range_basis {ι : Type w} (b : Basis ι R M)
    {κ : Type w'} (v : κ → M) (i : LinearIndependent R v) (m : i.Maximal) :
    ⋃ k, ((b.repr (v k)).support : Set ι) = Set.univ 
goal: ⋃ k, ↑(b.repr (v k)).support = Set.univ

full_name: infinite_basis_le_maximal_linearIndependent'
code: /-- Over any ring `R`, if `b` is an infinite basis for a module `M`,
and `s` is a maximal linearly independent set,
then the cardinality of `b` is bounded by the cardinality of `s`.
-/
theorem infinite_basis_le_maximal_linearIndependent' {ι : Type w} (b : Basis ι R M) [Infinite ι]
    {κ : Type w'} (v : κ → M) (i : LinearIndependent R v) (m : i.Maximal) :
    Cardinal.lift.{w'} #ι ≤ Cardinal.lift.{w} #κ 
goal: Cardinal.lift.{w', w} (Cardinal.mk ι) ≤ Cardinal.lift.{w, w'} (Cardinal.mk κ)

full_name: infinite_basis_le_maximal_linearIndependent
code: /-- Over any ring `R`, if `b` is an infinite basis for a module `M`,
and `s` is a maximal linearly independent set,
then the cardinality of `b` is bounded by the cardinality of `s`.
-/
theorem infinite_basis_le_maximal_linearIndependent {ι : Type w} (b : Basis ι R M) [Infinite ι]
    {κ : Type w} (v : κ → M) (i : LinearIndependent R v) (m : i.Maximal) : #ι ≤ #κ 
goal: Cardinal.mk ι ≤ Cardinal.mk κ