Full source
/-- The basis on `ι →₀ M` with basis vectors `fun ⟨i, x⟩ ↦ single i (b i x)`. -/
protected def basis {φ : ι → Type*} (b : ∀ i, Basis (φ i) R M) : Basis (Σi, φ i) R (ι →₀ M) :=
Basis.ofRepr
{ toFun := fun g =>
{ toFun := fun ix => (b ix.1).repr (g ix.1) ix.2
support := g.support.sigma fun i => ((b i).repr (g i)).support
mem_support_toFun := fun ix => by
simp only [Finset.mem_sigma, mem_support_iff, and_iff_right_iff_imp, Ne]
intro b hg
simp [hg] at b }
invFun := fun g =>
{ toFun := fun i => (b i).repr.symm (g.comapDomain _ sigma_mk_injective.injOn)
support := g.support.image Sigma.fst
mem_support_toFun := fun i => by
rw [Ne, ← (b i).repr.injective.eq_iff, (b i).repr.apply_symm_apply,
DFunLike.ext_iff]
simp only [exists_prop, LinearEquiv.map_zero, comapDomain_apply, zero_apply,
exists_and_right, mem_support_iff, exists_eq_right, Sigma.exists, Finset.mem_image,
not_forall] }
left_inv := fun g => by
ext i
rw [← (b i).repr.injective.eq_iff]
ext x
simp only [coe_mk, LinearEquiv.apply_symm_apply, comapDomain_apply]
right_inv := fun g => by
ext ⟨i, x⟩
simp only [coe_mk, LinearEquiv.apply_symm_apply, comapDomain_apply]
map_add' := fun g h => by
ext ⟨i, x⟩
simp only [coe_mk, add_apply, LinearEquiv.map_add]
map_smul' := fun c h => by
ext ⟨i, x⟩
simp only [coe_mk, smul_apply, LinearEquiv.map_smul, RingHom.id_apply] }