l3lab/ntp-mathlib huggingface dataset:
theorem pi_zero : pi (fun i => 0 : (i : ι) → M₂ →ₗ[R] φ i) = 0 := by ext; 

Proof state:
case h.h
R : Type u
K : Type u'
M : Type v
V : Type v'
M₂ : Type w
V₂ : Type w'
M₃ : Type y
V₃ : Type y'
M₄ : Type z
ι : Type x
ι' : Type x'
inst✝⁶ : Semiring R
inst✝⁵ : AddCommMonoid M₂
inst✝⁴ : Module R M₂
inst✝³ : AddCommMonoid M₃
inst✝² : Module R M₃
φ : ι → Type i
inst✝¹ : (i : ι) → AddCommMonoid (φ i)
inst✝ : (i : ι) → Module R (φ i)
x✝¹ : M₂
x✝ : ι
⊢ (pi fun i => 0) x✝¹ x✝ = 0 x✝¹ x✝

Next tactic:
rfl
theorem iInf_ker_proj : (⨅ i, ker (proj i : ((i : ι) → φ i) →ₗ[R] φ i) :
    Submodule R ((i : ι) → φ i)) = ⊥ :=
  bot_unique <|
    SetLike.le_def.2 fun a h => by
      

Proof state:
R : Type u
K : Type u'
M : Type v
V : Type v'
M₂ : Type w
V₂ : Type w'
M₃ : Type y
V₃ : Type y'
M₄ : Type z
ι : Type x
ι' : Type x'
inst✝⁶ : Semiring R
inst✝⁵ : AddCommMonoid M₂
inst✝⁴ : Module R M₂
inst✝³ : AddCommMonoid M₃
inst✝² : Module R M₃
φ : ι → Type i
inst✝¹ : (i : ι) → AddCommMonoid (φ i)
inst✝ : (i : ι) → Module R (φ i)
a : (i : ι) → φ i
h : a ∈ ⨅ i, ker (proj i)
⊢ a ∈ ⊥

Next tactic:
simp only [mem_iInf, mem_ker, proj_apply] at h
theorem iInf_ker_proj : (⨅ i, ker (proj i : ((i : ι) → φ i) →ₗ[R] φ i) :
    Submodule R ((i : ι) → φ i)) = ⊥ :=
  bot_unique <|
    SetLike.le_def.2 fun a h => by
      simp only [mem_iInf, mem_ker, proj_apply] at h
      

Proof state:
R : Type u
K : Type u'
M : Type v
V : Type v'
M₂ : Type w
V₂ : Type w'
M₃ : Type y
V₃ : Type y'
M₄ : Type z
ι : Type x
ι' : Type x'
inst✝⁶ : Semiring R
inst✝⁵ : AddCommMonoid M₂
inst✝⁴ : Module R M₂
inst✝³ : AddCommMonoid M₃
inst✝² : Module R M₃
φ : ι → Type i
inst✝¹ : (i : ι) → AddCommMonoid (φ i)
inst✝ : (i : ι) → Module R (φ i)
a : (i : ι) → φ i
h : ∀ (i : ι), a i = 0
⊢ a ∈ ⊥

Next tactic:
exact (mem_bot _).2 (funext fun i => h i)
/-- Linear map between the function spaces `I → M₂` and `I → M₃`, induced by a linear map `f`
between `M₂` and `M₃`. -/
@[simps]
protected def compLeft (f : M₂ →ₗ[R] M₃) (I : Type*) : (I → M₂) →ₗ[R] I → M₃ :=
  { f.toAddMonoidHom.compLeft I with
    toFun := fun h => f ∘ h
    map_smul' := fun c h => by
      

Proof state:
R : Type u
K : Type u'
M : Type v
V : Type v'
M₂ : Type w
V₂ : Type w'
M₃ : Type y
V₃ : Type y'
M₄ : Type z
ι : Type x
ι' : Type x'
inst✝⁶ : Semiring R
inst✝⁵ : AddCommMonoid M₂
inst✝⁴ : Module R M₂
inst✝³ : AddCommMonoid M₃
inst✝² : Module R M₃
φ : ι → Type i
inst✝¹ : (i : ι) → AddCommMonoid (φ i)
inst✝ : (i : ι) → Module R (φ i)
f : M₂ →ₗ[R] M₃
I : Type u_1
src✝ : (I → M₂) →+ I → M₃ := AddMonoidHom.compLeft (toAddMonoidHom f) I
c : R
h : I → M₂
⊢ AddHom.toFun
      { toFun := fun h => ⇑f ∘ h,
        map_add' :=
          (_ : ∀ (x y : I → M₂), ZeroHom.toFun (↑src✝) (x + y) = ZeroHom.toFun (↑src✝) x + ZeroHom.toFun (↑src✝) y) }
      (c • h) =
    (RingHom.id R) c •
      AddHom.toFun
        { toFun := fun h => ⇑f ∘ h,
          map_add' :=
            (_ : ∀ (x y : I → M₂), ZeroHom.toFun (↑src✝) (x + y) = ZeroHom.toFun (↑src✝) x + ZeroHom.toFun (↑src✝) y) }
        h

Next tactic:
ext x
/-- Linear map between the function spaces `I → M₂` and `I → M₃`, induced by a linear map `f`
between `M₂` and `M₃`. -/
@[simps]
protected def compLeft (f : M₂ →ₗ[R] M₃) (I : Type*) : (I → M₂) →ₗ[R] I → M₃ :=
  { f.toAddMonoidHom.compLeft I with
    toFun := fun h => f ∘ h
    map_smul' := fun c h => by
      ext x
      

Proof state:
case h
R : Type u
K : Type u'
M : Type v
V : Type v'
M₂ : Type w
V₂ : Type w'
M₃ : Type y
V₃ : Type y'
M₄ : Type z
ι : Type x
ι' : Type x'
inst✝⁶ : Semiring R
inst✝⁵ : AddCommMonoid M₂
inst✝⁴ : Module R M₂
inst✝³ : AddCommMonoid M₃
inst✝² : Module R M₃
φ : ι → Type i
inst✝¹ : (i : ι) → AddCommMonoid (φ i)
inst✝ : (i : ι) → Module R (φ i)
f : M₂ →ₗ[R] M₃
I : Type u_1
src✝ : (I → M₂) →+ I → M₃ := AddMonoidHom.compLeft (toAddMonoidHom f) I
c : R
h : I → M₂
x : I
⊢ AddHom.toFun
      { toFun := fun h => ⇑f ∘ h,
        map_add' :=
          (_ : ∀ (x y : I → M₂), ZeroHom.toFun (↑src✝) (x + y) = ZeroHom.toFun (↑src✝) x + ZeroHom.toFun (↑src✝) y) }
      (c • h) x =
    ((RingHom.id R) c •
        AddHom.toFun
          { toFun := fun h => ⇑f ∘ h,
            map_add' :=
              (_ :
                ∀ (x y : I → M₂), ZeroHom.toFun (↑src✝) (x + y) = ZeroHom.toFun (↑src✝) x + ZeroHom.toFun (↑src✝) y) }
          h)
      x

Next tactic:
exact f.map_smul' c (h x)
/-- The linear equivalence between linear functions on a finite product of modules and
families of functions on these modules. See note [bundled maps over different rings]. -/
@[simps symm_apply]
def lsum (S) [AddCommMonoid M] [Module R M] [Fintype ι] [DecidableEq ι] [Semiring S] [Module S M]
    [SMulCommClass R S M] : ((i : ι) → φ i →ₗ[R] M) ≃ₗ[S] ((i : ι) → φ i) →ₗ[R] M where
  toFun f := ∑ i : ι, (f i).comp (proj i)
  invFun f i := f.comp (single i)
  map_add' f g := by 

Proof state:
R : Type u
K : Type u'
M : Type v
V : Type v'
M₂ : Type w
V₂ : Type w'
M₃ : Type y
V₃ : Type y'
M₄ : Type z
ι : Type x
ι' : Type x'
inst✝¹³ : Semiring R
inst✝¹² : AddCommMonoid M₂
inst✝¹¹ : Module R M₂
inst✝¹⁰ : AddCommMonoid M₃
inst✝⁹ : Module R M₃
φ : ι → Type i
inst✝⁸ : (i : ι) → AddCommMonoid (φ i)
inst✝⁷ : (i : ι) → Module R (φ i)
S : Type ?u.37376
inst✝⁶ : AddCommMonoid M
inst✝⁵ : Module R M
inst✝⁴ : Fintype ι
inst✝³ : DecidableEq ι
inst✝² : Semiring S
inst✝¹ : Module S M
inst✝ : SMulCommClass R S M
f g : (i : ι) → φ i →ₗ[R] M
⊢ (fun f => ∑ i : ι, f i ∘ₗ proj i) (f + g) = (fun f => ∑ i : ι, f i ∘ₗ proj i) f + (fun f => ∑ i : ι, f i ∘ₗ proj i) g

Next tactic:
simp only [Pi.add_apply, add_comp, Finset.sum_add_distrib]
/-- The linear equivalence between linear functions on a finite product of modules and
families of functions on these modules. See note [bundled maps over different rings]. -/
@[simps symm_apply]
def lsum (S) [AddCommMonoid M] [Module R M] [Fintype ι] [DecidableEq ι] [Semiring S] [Module S M]
    [SMulCommClass R S M] : ((i : ι) → φ i →ₗ[R] M) ≃ₗ[S] ((i : ι) → φ i) →ₗ[R] M where
  toFun f := ∑ i : ι, (f i).comp (proj i)
  invFun f i := f.comp (single i)
  map_add' f g := by simp only [Pi.add_apply, add_comp, Finset.sum_add_distrib]
  map_smul' c f := by 

Proof state:
R : Type u
K : Type u'
M : Type v
V : Type v'
M₂ : Type w
V₂ : Type w'
M₃ : Type y
V₃ : Type y'
M₄ : Type z
ι : Type x
ι' : Type x'
inst✝¹³ : Semiring R
inst✝¹² : AddCommMonoid M₂
inst✝¹¹ : Module R M₂
inst✝¹⁰ : AddCommMonoid M₃
inst✝⁹ : Module R M₃
φ : ι → Type i
inst✝⁸ : (i : ι) → AddCommMonoid (φ i)
inst✝⁷ : (i : ι) → Module R (φ i)
S : Type ?u.37376
inst✝⁶ : AddCommMonoid M
inst✝⁵ : Module R M
inst✝⁴ : Fintype ι
inst✝³ : DecidableEq ι
inst✝² : Semiring S
inst✝¹ : Module S M
inst✝ : SMulCommClass R S M
c : S
f : (i : ι) → φ i →ₗ[R] M
⊢ AddHom.toFun
      { toFun := fun f => ∑ i : ι, f i ∘ₗ proj i,
        map_add' :=
          (_ :
            ∀ (f g : (i : ι) → φ i →ₗ[R] M),
              ∑ i : ι, (f + g) i ∘ₗ proj i = ∑ x : ι, f x ∘ₗ proj x + ∑ x : ι, g x ∘ₗ proj x) }
      (c • f) =
    (RingHom.id S) c •
      AddHom.toFun
        { toFun := fun f => ∑ i : ι, f i ∘ₗ proj i,
          map_add' :=
            (_ :
              ∀ (f g : (i : ι) → φ i →ₗ[R] M),
                ∑ i : ι, (f + g) i ∘ₗ proj i = ∑ x : ι, f x ∘ₗ proj x + ∑ x : ι, g x ∘ₗ proj x) }
        f

Next tactic:
simp only [Pi.smul_apply, smul_comp, Finset.smul_sum, RingHom.id_apply]
/-- The linear equivalence between linear functions on a finite product of modules and
families of functions on these modules. See note [bundled maps over different rings]. -/
@[simps symm_apply]
def lsum (S) [AddCommMonoid M] [Module R M] [Fintype ι] [DecidableEq ι] [Semiring S] [Module S M]
    [SMulCommClass R S M] : ((i : ι) → φ i →ₗ[R] M) ≃ₗ[S] ((i : ι) → φ i) →ₗ[R] M where
  toFun f := ∑ i : ι, (f i).comp (proj i)
  invFun f i := f.comp (single i)
  map_add' f g := by simp only [Pi.add_apply, add_comp, Finset.sum_add_distrib]
  map_smul' c f := by simp only [Pi.smul_apply, smul_comp, Finset.smul_sum, RingHom.id_apply]
  left_inv f := by
    

Proof state:
R : Type u
K : Type u'
M : Type v
V : Type v'
M₂ : Type w
V₂ : Type w'
M₃ : Type y
V₃ : Type y'
M₄ : Type z
ι : Type x
ι' : Type x'
inst✝¹³ : Semiring R
inst✝¹² : AddCommMonoid M₂
inst✝¹¹ : Module R M₂
inst✝¹⁰ : AddCommMonoid M₃
inst✝⁹ : Module R M₃
φ : ι → Type i
inst✝⁸ : (i : ι) → AddCommMonoid (φ i)
inst✝⁷ : (i : ι) → Module R (φ i)
S : Type ?u.37376
inst✝⁶ : AddCommMonoid M
inst✝⁵ : Module R M
inst✝⁴ : Fintype ι
inst✝³ : DecidableEq ι
inst✝² : Semiring S
inst✝¹ : Module S M
inst✝ : SMulCommClass R S M
f : (i : ι) → φ i →ₗ[R] M
⊢ (fun f i => f ∘ₗ single i)
      (AddHom.toFun
        {
            toAddHom :=
              { toFun := fun f => ∑ i : ι, f i ∘ₗ proj i,
                map_add' :=
                  (_ :
                    ∀ (f g : (i : ι) → φ i →ₗ[R] M),
                      ∑ i : ι, (f + g) i ∘ₗ proj i = ∑ x : ι, f x ∘ₗ proj x + ∑ x : ι, g x ∘ₗ proj x) },
            map_smul' :=
              (_ :
                ∀ (c : S) (f : (i : ι) → φ i →ₗ[R] M),
                  ∑ i : ι, (c • f) i ∘ₗ proj i = c • ∑ x : ι, f x ∘ₗ proj x) }.toAddHom
        f) =
    f

Next tactic:
ext i x
/-- The linear equivalence between linear functions on a finite product of modules and
families of functions on these modules. See note [bundled maps over different rings]. -/
@[simps symm_apply]
def lsum (S) [AddCommMonoid M] [Module R M] [Fintype ι] [DecidableEq ι] [Semiring S] [Module S M]
    [SMulCommClass R S M] : ((i : ι) → φ i →ₗ[R] M) ≃ₗ[S] ((i : ι) → φ i) →ₗ[R] M where
  toFun f := ∑ i : ι, (f i).comp (proj i)
  invFun f i := f.comp (single i)
  map_add' f g := by simp only [Pi.add_apply, add_comp, Finset.sum_add_distrib]
  map_smul' c f := by simp only [Pi.smul_apply, smul_comp, Finset.smul_sum, RingHom.id_apply]
  left_inv f := by
    ext i x
    

Proof state:
case h.h
R : Type u
K : Type u'
M : Type v
V : Type v'
M₂ : Type w
V₂ : Type w'
M₃ : Type y
V₃ : Type y'
M₄ : Type z
ι : Type x
ι' : Type x'
inst✝¹³ : Semiring R
inst✝¹² : AddCommMonoid M₂
inst✝¹¹ : Module R M₂
inst✝¹⁰ : AddCommMonoid M₃
inst✝⁹ : Module R M₃
φ : ι → Type i
inst✝⁸ : (i : ι) → AddCommMonoid (φ i)
inst✝⁷ : (i : ι) → Module R (φ i)
S : Type ?u.37376
inst✝⁶ : AddCommMonoid M
inst✝⁵ : Module R M
inst✝⁴ : Fintype ι
inst✝³ : DecidableEq ι
inst✝² : Semiring S
inst✝¹ : Module S M
inst✝ : SMulCommClass R S M
f : (i : ι) → φ i →ₗ[R] M
i : ι
x : φ i
⊢ ((fun f i => f ∘ₗ single i)
        (AddHom.toFun
          {
              toAddHom :=
                { toFun := fun f => ∑ i : ι, f i ∘ₗ proj i,
                  map_add' :=
                    (_ :
                      ∀ (f g : (i : ι) → φ i →ₗ[R] M),
                        ∑ i : ι, (f + g) i ∘ₗ proj i = ∑ x : ι, f x ∘ₗ proj x + ∑ x : ι, g x ∘ₗ proj x) },
              map_smul' :=
                (_ :
                  ∀ (c : S) (f : (i : ι) → φ i →ₗ[R] M),
                    ∑ i : ι, (c • f) i ∘ₗ proj i = c • ∑ x : ι, f x ∘ₗ proj x) }.toAddHom
          f)
        i)
      x =
    (f i) x

Next tactic:
simp [apply_single]
/-- The linear equivalence between linear functions on a finite product of modules and
families of functions on these modules. See note [bundled maps over different rings]. -/
@[simps symm_apply]
def lsum (S) [AddCommMonoid M] [Module R M] [Fintype ι] [DecidableEq ι] [Semiring S] [Module S M]
    [SMulCommClass R S M] : ((i : ι) → φ i →ₗ[R] M) ≃ₗ[S] ((i : ι) → φ i) →ₗ[R] M where
  toFun f := ∑ i : ι, (f i).comp (proj i)
  invFun f i := f.comp (single i)
  map_add' f g := by simp only [Pi.add_apply, add_comp, Finset.sum_add_distrib]
  map_smul' c f := by simp only [Pi.smul_apply, smul_comp, Finset.smul_sum, RingHom.id_apply]
  left_inv f := by
    ext i x
    simp [apply_single]
  right_inv f := by
    

Proof state:
R : Type u
K : Type u'
M : Type v
V : Type v'
M₂ : Type w
V₂ : Type w'
M₃ : Type y
V₃ : Type y'
M₄ : Type z
ι : Type x
ι' : Type x'
inst✝¹³ : Semiring R
inst✝¹² : AddCommMonoid M₂
inst✝¹¹ : Module R M₂
inst✝¹⁰ : AddCommMonoid M₃
inst✝⁹ : Module R M₃
φ : ι → Type i
inst✝⁸ : (i : ι) → AddCommMonoid (φ i)
inst✝⁷ : (i : ι) → Module R (φ i)
S : Type ?u.37376
inst✝⁶ : AddCommMonoid M
inst✝⁵ : Module R M
inst✝⁴ : Fintype ι
inst✝³ : DecidableEq ι
inst✝² : Semiring S
inst✝¹ : Module S M
inst✝ : SMulCommClass R S M
f : ((i : ι) → φ i) →ₗ[R] M
⊢ AddHom.toFun
      {
          toAddHom :=
            { toFun := fun f => ∑ i : ι, f i ∘ₗ proj i,
              map_add' :=
                (_ :
                  ∀ (f g : (i : ι) → φ i →ₗ[R] M),
                    ∑ i : ι, (f + g) i ∘ₗ proj i = ∑ x : ι, f x ∘ₗ proj x + ∑ x : ι, g x ∘ₗ proj x) },
          map_smul' :=
            (_ :
              ∀ (c : S) (f : (i : ι) → φ i →ₗ[R] M),
                ∑ i : ι, (c • f) i ∘ₗ proj i = c • ∑ x : ι, f x ∘ₗ proj x) }.toAddHom
      ((fun f i => f ∘ₗ single i) f) =
    f

Next tactic:
ext x
/-- The linear equivalence between linear functions on a finite product of modules and
families of functions on these modules. See note [bundled maps over different rings]. -/
@[simps symm_apply]
def lsum (S) [AddCommMonoid M] [Module R M] [Fintype ι] [DecidableEq ι] [Semiring S] [Module S M]
    [SMulCommClass R S M] : ((i : ι) → φ i →ₗ[R] M) ≃ₗ[S] ((i : ι) → φ i) →ₗ[R] M where
  toFun f := ∑ i : ι, (f i).comp (proj i)
  invFun f i := f.comp (single i)
  map_add' f g := by simp only [Pi.add_apply, add_comp, Finset.sum_add_distrib]
  map_smul' c f := by simp only [Pi.smul_apply, smul_comp, Finset.smul_sum, RingHom.id_apply]
  left_inv f := by
    ext i x
    simp [apply_single]
  right_inv f := by
    ext x
    

Proof state:
case h
R : Type u
K : Type u'
M : Type v
V : Type v'
M₂ : Type w
V₂ : Type w'
M₃ : Type y
V₃ : Type y'
M₄ : Type z
ι : Type x
ι' : Type x'
inst✝¹³ : Semiring R
inst✝¹² : AddCommMonoid M₂
inst✝¹¹ : Module R M₂
inst✝¹⁰ : AddCommMonoid M₃
inst✝⁹ : Module R M₃
φ : ι → Type i
inst✝⁸ : (i : ι) → AddCommMonoid (φ i)
inst✝⁷ : (i : ι) → Module R (φ i)
S : Type ?u.37376
inst✝⁶ : AddCommMonoid M
inst✝⁵ : Module R M
inst✝⁴ : Fintype ι
inst✝³ : DecidableEq ι
inst✝² : Semiring S
inst✝¹ : Module S M
inst✝ : SMulCommClass R S M
f : ((i : ι) → φ i) →ₗ[R] M
x : (i : ι) → φ i
⊢ (AddHom.toFun
        {
            toAddHom :=
              { toFun := fun f => ∑ i : ι, f i ∘ₗ proj i,
                map_add' :=
                  (_ :
                    ∀ (f g : (i : ι) → φ i →ₗ[R] M),
                      ∑ i : ι, (f + g) i ∘ₗ proj i = ∑ x : ι, f x ∘ₗ proj x + ∑ x : ι, g x ∘ₗ proj x) },
            map_smul' :=
              (_ :
                ∀ (c : S) (f : (i : ι) → φ i →ₗ[R] M),
                  ∑ i : ι, (c • f) i ∘ₗ proj i = c • ∑ x : ι, f x ∘ₗ proj x) }.toAddHom
        ((fun f i => f ∘ₗ single i) f))
      x =
    f x

Next tactic:
suffices f (∑ j, Pi.single j (x j)) = f x by simpa [apply_single]
/-- The linear equivalence between linear functions on a finite product of modules and
families of functions on these modules. See note [bundled maps over different rings]. -/
@[simps symm_apply]
def lsum (S) [AddCommMonoid M] [Module R M] [Fintype ι] [DecidableEq ι] [Semiring S] [Module S M]
    [SMulCommClass R S M] : ((i : ι) → φ i →ₗ[R] M) ≃ₗ[S] ((i : ι) → φ i) →ₗ[R] M where
  toFun f := ∑ i : ι, (f i).comp (proj i)
  invFun f i := f.comp (single i)
  map_add' f g := by simp only [Pi.add_apply, add_comp, Finset.sum_add_distrib]
  map_smul' c f := by simp only [Pi.smul_apply, smul_comp, Finset.smul_sum, RingHom.id_apply]
  left_inv f := by
    ext i x
    simp [apply_single]
  right_inv f := by
    ext x
    suffices f (∑ j, Pi.single j (x j)) = f x by 

Proof state:
R : Type u
K : Type u'
M : Type v
V : Type v'
M₂ : Type w
V₂ : Type w'
M₃ : Type y
V₃ : Type y'
M₄ : Type z
ι : Type x
ι' : Type x'
inst✝¹³ : Semiring R
inst✝¹² : AddCommMonoid M₂
inst✝¹¹ : Module R M₂
inst✝¹⁰ : AddCommMonoid M₃
inst✝⁹ : Module R M₃
φ : ι → Type i
inst✝⁸ : (i : ι) → AddCommMonoid (φ i)
inst✝⁷ : (i : ι) → Module R (φ i)
S : Type ?u.37376
inst✝⁶ : AddCommMonoid M
inst✝⁵ : Module R M
inst✝⁴ : Fintype ι
inst✝³ : DecidableEq ι
inst✝² : Semiring S
inst✝¹ : Module S M
inst✝ : SMulCommClass R S M
f : ((i : ι) → φ i) →ₗ[R] M
x : (i : ι) → φ i
this : f (∑ j : ι, Pi.single j (x j)) = f x
⊢ (AddHom.toFun
        {
            toAddHom :=
              { toFun := fun f => ∑ i : ι, f i ∘ₗ proj i,
                map_add' :=
                  (_ :
                    ∀ (f g : (i : ι) → φ i →ₗ[R] M),
                      ∑ i : ι, (f + g) i ∘ₗ proj i = ∑ x : ι, f x ∘ₗ proj x + ∑ x : ι, g x ∘ₗ proj x) },
            map_smul' :=
              (_ :
                ∀ (c : S) (f : (i : ι) → φ i →ₗ[R] M),
                  ∑ i : ι, (c • f) i ∘ₗ proj i = c • ∑ x : ι, f x ∘ₗ proj x) }.toAddHom
        ((fun f i => f ∘ₗ single i) f))
      x =
    f x

Next tactic:
simpa [apply_single]
/-- The linear equivalence between linear functions on a finite product of modules and
families of functions on these modules. See note [bundled maps over different rings]. -/
@[simps symm_apply]
def lsum (S) [AddCommMonoid M] [Module R M] [Fintype ι] [DecidableEq ι] [Semiring S] [Module S M]
    [SMulCommClass R S M] : ((i : ι) → φ i →ₗ[R] M) ≃ₗ[S] ((i : ι) → φ i) →ₗ[R] M where
  toFun f := ∑ i : ι, (f i).comp (proj i)
  invFun f i := f.comp (single i)
  map_add' f g := by simp only [Pi.add_apply, add_comp, Finset.sum_add_distrib]
  map_smul' c f := by simp only [Pi.smul_apply, smul_comp, Finset.smul_sum, RingHom.id_apply]
  left_inv f := by
    ext i x
    simp [apply_single]
  right_inv f := by
    ext x
    suffices f (∑ j, Pi.single j (x j)) = f x by simpa [apply_single]
    

Proof state:
case h
R : Type u
K : Type u'
M : Type v
V : Type v'
M₂ : Type w
V₂ : Type w'
M₃ : Type y
V₃ : Type y'
M₄ : Type z
ι : Type x
ι' : Type x'
inst✝¹³ : Semiring R
inst✝¹² : AddCommMonoid M₂
inst✝¹¹ : Module R M₂
inst✝¹⁰ : AddCommMonoid M₃
inst✝⁹ : Module R M₃
φ : ι → Type i
inst✝⁸ : (i : ι) → AddCommMonoid (φ i)
inst✝⁷ : (i : ι) → Module R (φ i)
S : Type ?u.37376
inst✝⁶ : AddCommMonoid M
inst✝⁵ : Module R M
inst✝⁴ : Fintype ι
inst✝³ : DecidableEq ι
inst✝² : Semiring S
inst✝¹ : Module S M
inst✝ : SMulCommClass R S M
f : ((i : ι) → φ i) →ₗ[R] M
x : (i : ι) → φ i
⊢ f (∑ j : ι, Pi.single j (x j)) = f x

Next tactic:
rw [Finset.univ_sum_single]
@[simp high]
theorem lsum_single {ι R : Type*} [Fintype ι] [DecidableEq ι] [CommRing R] {M : ι → Type*}
    [(i : ι) → AddCommGroup (M i)] [(i : ι) → Module R (M i)] :
    LinearMap.lsum R M R LinearMap.single = LinearMap.id :=
  LinearMap.ext fun x => by 

Proof state:
R✝ : Type u
K : Type u'
M✝ : Type v
V : Type v'
M₂ : Type w
V₂ : Type w'
M₃ : Type y
V₃ : Type y'
M₄ : Type z
ι✝ : Type x
ι' : Type x'
inst✝¹¹ : Semiring R✝
inst✝¹⁰ : AddCommMonoid M₂
inst✝⁹ : Module R✝ M₂
inst✝⁸ : AddCommMonoid M₃
inst✝⁷ : Module R✝ M₃
φ : ι✝ → Type i
inst✝⁶ : (i : ι✝) → AddCommMonoid (φ i)
inst✝⁵ : (i : ι✝) → Module R✝ (φ i)
ι : Type u_1
R : Type u_2
inst✝⁴ : Fintype ι
inst✝³ : DecidableEq ι
inst✝² : CommRing R
M : ι → Type u_3
inst✝¹ : (i : ι) → AddCommGroup (M i)
inst✝ : (i : ι) → Module R (M i)
x : (i : ι) → M i
⊢ ((lsum R M R) single) x = id x

Next tactic:
simp [Finset.univ_sum_single]
/-- This is used as the ext lemma instead of `LinearMap.pi_ext` for reasons explained in
note [partially-applied ext lemmas]. -/
@[ext]
theorem pi_ext' (h : ∀ i, f.comp (single i) = g.comp (single i)) : f = g := by
  

Proof state:
R : Type u
K : Type u'
M : Type v
V : Type v'
M₂ : Type w
V₂ : Type w'
M₃ : Type y
V₃ : Type y'
M₄ : Type z
ι : Type x
ι' : Type x'
inst✝¹⁰ : Semiring R
inst✝⁹ : AddCommMonoid M₂
inst✝⁸ : Module R M₂
inst✝⁷ : AddCommMonoid M₃
inst✝⁶ : Module R M₃
φ : ι → Type i
inst✝⁵ : (i : ι) → AddCommMonoid (φ i)
inst✝⁴ : (i : ι) → Module R (φ i)
inst✝³ : Finite ι
inst✝² : DecidableEq ι
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ((i : ι) → φ i) →ₗ[R] M
h : ∀ (i : ι), f ∘ₗ single i = g ∘ₗ single i
⊢ f = g

Next tactic:
refine' pi_ext fun i x => _
/-- This is used as the ext lemma instead of `LinearMap.pi_ext` for reasons explained in
note [partially-applied ext lemmas]. -/
@[ext]
theorem pi_ext' (h : ∀ i, f.comp (single i) = g.comp (single i)) : f = g := by
  refine' pi_ext fun i x => _
  

Proof state:
R : Type u
K : Type u'
M : Type v
V : Type v'
M₂ : Type w
V₂ : Type w'
M₃ : Type y
V₃ : Type y'
M₄ : Type z
ι : Type x
ι' : Type x'
inst✝¹⁰ : Semiring R
inst✝⁹ : AddCommMonoid M₂
inst✝⁸ : Module R M₂
inst✝⁷ : AddCommMonoid M₃
inst✝⁶ : Module R M₃
φ : ι → Type i
inst✝⁵ : (i : ι) → AddCommMonoid (φ i)
inst✝⁴ : (i : ι) → Module R (φ i)
inst✝³ : Finite ι
inst✝² : DecidableEq ι
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ((i : ι) → φ i) →ₗ[R] M
h : ∀ (i : ι), f ∘ₗ single i = g ∘ₗ single i
i : ι
x : φ i
⊢ f (Pi.single i x) = g (Pi.single i x)

Next tactic:
convert LinearMap.congr_fun (h i) x
/-- If `I` and `J` are disjoint index sets, the product of the kernels of the `J`th projections of
`φ` is linearly equivalent to the product over `I`. -/
def iInfKerProjEquiv {I J : Set ι} [DecidablePred fun i => i ∈ I] (hd : Disjoint I J)
    (hu : Set.univ ⊆ I ∪ J) :
    (⨅ i ∈ J, ker (proj i : ((i : ι) → φ i) →ₗ[R] φ i) :
    Submodule R ((i : ι) → φ i)) ≃ₗ[R] (i : I) → φ i := by
  

Proof state:
R : Type u
K : Type u'
M : Type v
V : Type v'
M₂ : Type w
V₂ : Type w'
M₃ : Type y
V₃ : Type y'
M₄ : Type z
ι : Type x
ι' : Type x'
inst✝⁷ : Semiring R
inst✝⁶ : AddCommMonoid M₂
inst✝⁵ : Module R M₂
inst✝⁴ : AddCommMonoid M₃
inst✝³ : Module R M₃
φ : ι → Type i
inst✝² : (i : ι) → AddCommMonoid (φ i)
inst✝¹ : (i : ι) → Module R (φ i)
I J : Set ι
inst✝ : DecidablePred fun i => i ∈ I
hd : Disjoint I J
hu : Set.univ ⊆ I ∪ J
⊢ ↥(⨅ i ∈ J, ker (proj i)) ≃ₗ[R] (i : ↑I) → φ ↑i

Next tactic:
refine'
    LinearEquiv.ofLinear (pi fun i => (proj (i : ι)).comp (Submodule.subtype _))
      (codRestrict _ (pi fun i => if h : i ∈ I then proj (⟨i, h⟩ : I) else 0) _) _ _
/-- If `I` and `J` are disjoint index sets, the product of the kernels of the `J`th projections of
`φ` is linearly equivalent to the product over `I`. -/
def iInfKerProjEquiv {I J : Set ι} [DecidablePred fun i => i ∈ I] (hd : Disjoint I J)
    (hu : Set.univ ⊆ I ∪ J) :
    (⨅ i ∈ J, ker (proj i : ((i : ι) → φ i) →ₗ[R] φ i) :
    Submodule R ((i : ι) → φ i)) ≃ₗ[R] (i : I) → φ i := by
  refine'
    LinearEquiv.ofLinear (pi fun i => (proj (i : ι)).comp (Submodule.subtype _))
      (codRestrict _ (pi fun i => if h : i ∈ I then proj (⟨i, h⟩ : I) else 0) _) _ _
  · 

Proof state:
case refine'_1
R : Type u
K : Type u'
M : Type v
V : Type v'
M₂ : Type w
V₂ : Type w'
M₃ : Type y
V₃ : Type y'
M₄ : Type z
ι : Type x
ι' : Type x'
inst✝⁷ : Semiring R
inst✝⁶ : AddCommMonoid M₂
inst✝⁵ : Module R M₂
inst✝⁴ : AddCommMonoid M₃
inst✝³ : Module R M₃
φ : ι → Type i
inst✝² : (i : ι) → AddCommMonoid (φ i)
inst✝¹ : (i : ι) → Module R (φ i)
I J : Set ι
inst✝ : DecidablePred fun i => i ∈ I
hd : Disjoint I J
hu : Set.univ ⊆ I ∪ J
⊢ ∀ (c : (i : ↑I) → φ ↑i),
    (pi fun i => if h : i ∈ I then proj { val := i, property := h } else 0) c ∈ ⨅ i ∈ J, ker (proj i)

Next tactic:
intro b
/-- If `I` and `J` are disjoint index sets, the product of the kernels of the `J`th projections of
`φ` is linearly equivalent to the product over `I`. -/
def iInfKerProjEquiv {I J : Set ι} [DecidablePred fun i => i ∈ I] (hd : Disjoint I J)
    (hu : Set.univ ⊆ I ∪ J) :
    (⨅ i ∈ J, ker (proj i : ((i : ι) → φ i) →ₗ[R] φ i) :
    Submodule R ((i : ι) → φ i)) ≃ₗ[R] (i : I) → φ i := by
  refine'
    LinearEquiv.ofLinear (pi fun i => (proj (i : ι)).comp (Submodule.subtype _))
      (codRestrict _ (pi fun i => if h : i ∈ I then proj (⟨i, h⟩ : I) else 0) _) _ _
  · intro b
    

Proof state:
case refine'_1
R : Type u
K : Type u'
M : Type v
V : Type v'
M₂ : Type w
V₂ : Type w'
M₃ : Type y
V₃ : Type y'
M₄ : Type z
ι : Type x
ι' : Type x'
inst✝⁷ : Semiring R
inst✝⁶ : AddCommMonoid M₂
inst✝⁵ : Module R M₂
inst✝⁴ : AddCommMonoid M₃
inst✝³ : Module R M₃
φ : ι → Type i
inst✝² : (i : ι) → AddCommMonoid (φ i)
inst✝¹ : (i : ι) → Module R (φ i)
I J : Set ι
inst✝ : DecidablePred fun i => i ∈ I
hd : Disjoint I J
hu : Set.univ ⊆ I ∪ J
b : (i : ↑I) → φ ↑i
⊢ (pi fun i => if h : i ∈ I then proj { val := i, property := h } else 0) b ∈ ⨅ i ∈ J, ker (proj i)

Next tactic:
simp only [mem_iInf, mem_ker, funext_iff, proj_apply, pi_apply]