namespace STLC

abbrev Var := Char

inductive type where
  | base  : type
  | arrow : type → type → type

inductive term where
  | var : Var → term
  | lam : Var → type → term → term
  | app : term → term → term

def ctx := List (Var × type)

open type term in
inductive typing : ctx → term → type → Prop where
  | var  : typing ((x, A) :: Γ) (var x) A -- simplified
  | arri : typing ((x, A) :: Γ) M B → typing Γ (lam x A M) (arrow A B)
  | arre : typing Γ M (arrow A B) → typing Γ N A → typing Γ (app M N) B

open type term in
theorem no_δ : ¬ ∃ A B, typing nil (lam x A (app (var x) (var x))) (arrow A B) :=
  fun h => match h with
  | Exists.intro A (Exists.intro B h) => match h with
    | typing.arri h => match h with
      | typing.arre (A := T) h₁ h₂ => match h₂ with
        | typing.var => nomatch h₁

namespace STLC


import hilbert.wr.or

namespace clfrags
    namespace hilbert
        namespace wr
            namespace or

                theorem d₁' {a b : Prop} (h₁ : b) : or a b :=
                    have h₂ : or b a, from or.d₁ h₁,
                    show or a b, from or.d₃ h₂

                theorem d₄' {a b c : Prop} (h₁ : or (or a b) c) : or a (or b c) :=
                    have h₂ : or c (or a b), from or.d₃ h₁,
                    have h₃ : or (or c a) b, from or.d₄ h₂,
                    have h₄ : or b (or c a), from or.d₃ h₃,
                    have h₅ : or (or b c) a, from or.d₄ h₄,
                    show or a (or b c), from or.d₃ h₅

                theorem d₁_or {a b c : Prop} (h₁ : or c a) : or c (or a b) :=
                    have h₂ : or (or c a) b, from or.d₁ h₁,
                    show or c (or a b), from or.d₄' h₂

                theorem d₂_or {a b : Prop} (h₁ : or b (or a a)) : or b a :=
                    have h₂ : or (or b a) a, from or.d₄ h₁,
                    have h₃ : or a (or b a), from or.d₃ h₂,
                    have h₄ : or b (or a (or b a)), from or.d₁' h₃,
                    have h₅ : or (or b a) (or b a), from or.d₄ h₄,
                    show or b a, from or.d₂ h₅

                theorem d₃_or {a b c : Prop} (h₁ : or c (or a b)) : or c (or b a) :=
                    have h₂ : or (or c a) b, from or.d₄ h₁,
                    have h₃ : or (or (or c a) b) a, from or.d₁ h₂,
                    have h₄ : or (or c a) (or b a), from or.d₄' h₃,
                    have h₅ : or c (or a (or b a)), from or.d₄' h₄,
                    have h₆ : or (or a (or b a)) c, from or.d₃ h₅,
                    have h₇ : or a (or (or b a) c), from or.d₄' h₆,
                    have h₈ : or b (or a (or (or b a) c)), from or.d₁' h₇,
                    have h₉ : or (or b a) (or (or b a) c), from or.d₄ h₈,
                    have h₁₀ : or (or (or b a) (or b a)) c, from or.d₄ h₉,
                    have h₁₁ : or c (or (or b a) (or b a)), from or.d₃ h₁₀,
                    show or c (or b a), from or.d₂_or h₁₁

                theorem d₄_or {a b c d : Prop} (h₁ : or d (or a (or b c))) : or d (or (or a b) c) :=
                    have h₂ : or (or d a) (or b c), from or.d₄ h₁,
                    have h₃ : or (or d a) (or c b), from or.d₃_or h₂,
                    have h₄ : or (or (or d a) c) b, from or.d₄ h₃,
                    have h₅ : or (or (or (or d a) c) b) a, from or.d₁ h₄,
                    have h₆ : or (or (or d a) c) (or b a), from or.d₄' h₅,
                    have h₇ : or (or (or d a) c) (or a b), from or.d₃_or h₆,
                    have h₈ : or (or d a) (or c (or a b)), from or.d₄' h₇,
                    have h₉ : or (or d a) (or (or a b) c), from or.d₃_or h₈,
                    let e := or (or a b) c in
                        have h₁₀ : or (or d a) e, from h₉,
                        have h₁₁ : or d (or a e), from or.d₄' h₁₀,
                        have h₁₂ : or d (or e a), from or.d₃_or h₁₁,
                        have h₁₃ : or (or d e) a, from or.d₄ h₁₂,
                        have h₁₄ : or (or (or d e) a) b, from or.d₁ h₁₃,
                        have h₁₅ : or (or d e) (or a b), from or.d₄' h₁₄,
                        have h₁₆ : or (or (or d e) (or a b)) c, from or.d₁ h₁₅,
                        have h₁₇ : or (or d e) (or (or a b) c), from or.d₄' h₁₆,
                        have h₁₈ : or (or d e) e, from h₁₇,
                        have h₁₉ : or d (or e e), from or.d₄' h₁₈,
                        have h₂₀ : or d e, from or.d₂_or h₁₉,
                        show or d (or (or a b) c), from h₂₀
            end or
        end wr
    end hilbert
end clfrags


/-
Copyright (c) 2017 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro

Implementation of floating-point numbers (experimental).
-/

import data.rat data.semiquot

def int.shift2 (a b : ℕ) : ℤ → ℕ × ℕ
| (int.of_nat e) := (a.shiftl e, b)
| -[1+ e] := (a, b.shiftl e.succ)

namespace fp

inductive rmode
| NE -- round to nearest even

class float_cfg :=
(prec emax : ℕ)
(prec_pos : prec > 0)
(prec_max : prec ≤ emax)

variable [C : float_cfg]
include C

def prec := C.prec
def emax := C.emax
def emin : ℤ := 1 - C.emax

def valid_finite (e : ℤ) (m : ℕ) : Prop :=
emin ≤ e + prec - 1 ∧ e + prec - 1 ≤ emax ∧ e = max (e + m.size - prec) emin

instance dec_valid_finite (e m) : decidable (valid_finite e m) :=
by unfold valid_finite; apply_instance

inductive float
| inf : bool → float
| nan : float
| finite : bool → Π e m, valid_finite e m → float

def float.is_finite : float → bool
| (float.finite s e m f) := tt
| _ := ff

def to_rat : Π (f : float), f.is_finite → ℚ
| (float.finite s e m f) _ :=
  let (n, d) := int.shift2 m 1 e,
      r := rat.mk_nat n d in
  if s then -r else r

theorem float.zero.valid : valid_finite emin 0 :=
⟨begin
  rw add_sub_assoc,
  apply le_add_of_nonneg_right,
  apply sub_nonneg_of_le,
  apply int.coe_nat_le_coe_nat_of_le,
  exact C.prec_pos
end, by simpa [emin] using show (prec : ℤ) ≤ emax + float_cfg.emax,
  from le_trans (int.coe_nat_le.2 C.prec_max) (le_add_of_nonneg_left (int.coe_zero_le _)),
by rw max_eq_right; simp⟩

def float.zero (s : bool) : float :=
float.finite s emin 0 float.zero.valid

protected def float.sign' : float → semiquot bool
| (float.inf s) := pure s
| float.nan := ⊤
| (float.finite s e m f) := pure s

protected def float.sign : float → bool
| (float.inf s) := s
| float.nan := ff
| (float.finite s e m f) := s

protected def float.is_zero : float → bool
| (float.finite s e 0 f) := tt
| _ := ff

protected def float.neg : float → float
| (float.inf s) := float.inf (bnot s)
| float.nan := float.nan
| (float.finite s e m f) := float.finite (bnot s) e m f

def div_nat_lt_two_pow (n d : ℕ) : ℤ → bool
| (int.of_nat e) := n < d.shiftl e
| -[1+ e] := n.shiftl e.succ < d

-- TODO(Mario): Prove these and drop 'meta'
meta def of_pos_rat_dn (n : ℕ+) (d : ℕ+) : float × bool :=
begin
  let e₁ : ℤ := n.1.size - d.1.size - prec,
  cases h₁ : int.shift2 d.1 n.1 (e₁ + prec) with d₁ n₁,
  let e₂ := if n₁ < d₁ then e₁ - 1 else e₁,
  let e₃ := max e₂ emin,
  cases h₂ : int.shift2 d.1 n.1 (e₃ + prec) with d₂ n₂,
  let r := rat.mk_nat n₂ d₂,
  let m := r.floor,
  refine (float.finite ff e₃ (int.to_nat m) _, r.denom = 1),
  { exact undefined }
end

meta def next_up_pos (e m) (v : valid_finite e m) : float :=
let m' := m.succ in
if ss : m'.size = m.size then
  float.finite ff e m' (by unfold valid_finite at *; rw ss; exact v)
else if h : e = emax then
  float.inf ff
else
  float.finite ff e.succ (nat.div2 m') undefined

meta def next_dn_pos (e m) (v : valid_finite e m) : float :=
match m with
| 0 := next_up_pos _ _ float.zero.valid
| nat.succ m' :=
  if ss : m'.size = m.size then
    float.finite ff e m' (by unfold valid_finite at *; rw ss; exact v)
  else if h : e = emin then
    float.finite ff emin m' undefined
  else
    float.finite ff e.pred (bit1 m') undefined
end

meta def next_up : float → float
| (float.finite ff e m f) := next_up_pos e m f
| (float.finite tt e m f) := float.neg $ next_dn_pos e m f
| f := f

meta def next_dn : float → float
| (float.finite ff e m f) := next_dn_pos e m f
| (float.finite tt e m f) := float.neg $ next_up_pos e m f
| f := f

meta def of_rat_up : ℚ → float
| ⟨0, _, _, _⟩          := float.zero ff
| ⟨nat.succ n, d, h, _⟩ :=
  let (f, exact) := of_pos_rat_dn n.succ_pnat ⟨d, h⟩ in
  if exact then f else next_up f
| ⟨-[1+n], d, h, _⟩     := float.neg (of_pos_rat_dn n.succ_pnat ⟨d, h⟩).1

meta def of_rat_dn (r : ℚ) : float :=
float.neg $ of_rat_up (-r)

meta def of_rat : rmode → ℚ → float
| rmode.NE r :=
  let low := of_rat_dn r, high := of_rat_up r in
  if hf : high.is_finite then
    if r = to_rat _ hf then high else
    if lf : low.is_finite then
      if r - to_rat _ lf > to_rat _ hf - r then high else
      if r - to_rat _ lf < to_rat _ hf - r then low else
      match low, lf with float.finite s e m f, _ :=
        if 2 ∣ m then low else high
      end
    else float.inf tt
  else float.inf ff

namespace float

instance : has_neg float := ⟨float.neg⟩

meta def add (mode : rmode) : float → float → float
| nan      _        := nan
| _        nan      := nan
| (inf tt) (inf ff) := nan
| (inf ff) (inf tt) := nan
| (inf s₁) _        := inf s₁
| _        (inf s₂) := inf s₂
| (finite s₁ e₁ m₁ v₁) (finite s₂ e₂ m₂ v₂) :=
  let f₁ := finite s₁ e₁ m₁ v₁, f₂ := finite s₂ e₂ m₂ v₂ in
  of_rat mode (to_rat f₁ rfl + to_rat f₂ rfl)

meta instance : has_add float := ⟨float.add rmode.NE⟩

meta def sub (mode : rmode) (f1 f2 : float) : float :=
add mode f1 (-f2)

meta instance : has_sub float := ⟨float.sub rmode.NE⟩

meta def mul (mode : rmode) : float → float → float
| nan      _        := nan
| _        nan      := nan
| (inf s₁) f₂       := if f₂.is_zero then nan else inf (bxor s₁ f₂.sign)
| f₁       (inf s₂) := if f₁.is_zero then nan else inf (bxor f₁.sign s₂)
| (finite s₁ e₁ m₁ v₁) (finite s₂ e₂ m₂ v₂) :=
  let f₁ := finite s₁ e₁ m₁ v₁, f₂ := finite s₂ e₂ m₂ v₂ in
  of_rat mode (to_rat f₁ rfl * to_rat f₂ rfl)

meta def div (mode : rmode) : float → float → float
| nan      _        := nan
| _        nan      := nan
| (inf s₁) (inf s₂) := nan
| (inf s₁) f₂       := inf (bxor s₁ f₂.sign)
| f₁       (inf s₂) := zero (bxor f₁.sign s₂)
| (finite s₁ e₁ m₁ v₁) (finite s₂ e₂ m₂ v₂) :=
  let f₁ := finite s₁ e₁ m₁ v₁, f₂ := finite s₂ e₂ m₂ v₂ in
  if f₂.is_zero then inf (bxor s₁ s₂) else
  of_rat mode (to_rat f₁ rfl / to_rat f₂ rfl)

end float

end fp


/-
Copyright (c) 2019 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl

! This file was ported from Lean 3 source module algebra.direct_sum.finsupp
! leanprover-community/mathlib commit aa3a420527e0fbfd0f6615b95b761254a9166e12
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathbin.Algebra.DirectSum.Module
import Mathbin.Data.Finsupp.ToDfinsupp

/-!
# Results on direct sums and finitely supported functions.

> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
> Any changes to this file require a corresponding PR to mathlib4.

1. The linear equivalence between finitely supported functions `ι →₀ M` and
the direct sum of copies of `M` indexed by `ι`.
-/

universe u v w

noncomputable section

open DirectSum

open LinearMap Submodule

variable {R : Type u} {M : Type v} [Ring R] [AddCommGroup M] [Module R M]

section finsuppLEquivDirectSum

variable (R M) (ι : Type _) [DecidableEq ι]

/- warning: finsupp_lequiv_direct_sum -> finsuppLEquivDirectSum is a dubious translation:
lean 3 declaration is
  forall (R : Type.{u1}) (M : Type.{u2}) [_inst_1 : Ring.{u1} R] [_inst_2 : AddCommGroup.{u2} M] [_inst_3 : Module.{u1, u2} R M (Ring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u2} M _inst_2)] (ι : Type.{u3}) [_inst_4 : DecidableEq.{succ u3} ι], LinearEquiv.{u1, u1, max u3 u2, max u3 u2} R R (Ring.toSemiring.{u1} R _inst_1) (Ring.toSemiring.{u1} R _inst_1) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (Ring.toSemiring.{u1} R _inst_1))) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (Ring.toSemiring.{u1} R _inst_1))) (finsuppLEquivDirectSum._proof_1.{u1} R _inst_1) (finsuppLEquivDirectSum._proof_2.{u1} R _inst_1) (Finsupp.{u3, u2} ι M (AddZeroClass.toHasZero.{u2} M (AddMonoid.toAddZeroClass.{u2} M (SubNegMonoid.toAddMonoid.{u2} M (AddGroup.toSubNegMonoid.{u2} M (AddCommGroup.toAddGroup.{u2} M _inst_2)))))) (DirectSum.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (Finsupp.addCommMonoid.{u3, u2} ι M (AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (DirectSum.addCommMonoid.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (Finsupp.module.{u3, u2, u1} ι M R (Ring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u2} M _inst_2) _inst_3) (DirectSum.module.{u1, u3, u2} R (Ring.toSemiring.{u1} R _inst_1) ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2) (fun (i : ι) => _inst_3))
but is expected to have type
  forall (R : Type.{u1}) (M : Type.{u2}) [_inst_1 : Ring.{u1} R] [_inst_2 : AddCommGroup.{u2} M] [_inst_3 : Module.{u1, u2} R M (Ring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u2} M _inst_2)] (ι : Type.{u3}) [_inst_4 : DecidableEq.{succ u3} ι], LinearEquiv.{u1, u1, max u2 u3, max u2 u3} R R (Ring.toSemiring.{u1} R _inst_1) (Ring.toSemiring.{u1} R _inst_1) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (Ring.toSemiring.{u1} R _inst_1))) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (Ring.toSemiring.{u1} R _inst_1))) (RingHomInvPair.ids.{u1} R (Ring.toSemiring.{u1} R _inst_1)) (RingHomInvPair.ids.{u1} R (Ring.toSemiring.{u1} R _inst_1)) (Finsupp.{u3, u2} ι M (NegZeroClass.toZero.{u2} M (SubNegZeroMonoid.toNegZeroClass.{u2} M (SubtractionMonoid.toSubNegZeroMonoid.{u2} M (SubtractionCommMonoid.toSubtractionMonoid.{u2} M (AddCommGroup.toDivisionAddCommMonoid.{u2} M _inst_2)))))) (DirectSum.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.addCommMonoid.{u3, u2} ι M (AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (instAddCommMonoidDirectSum.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.module.{u3, u2, u1} ι M R (Ring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u2} M _inst_2) _inst_3) (DirectSum.instModuleDirectSumInstAddCommMonoidDirectSum.{u1, u3, u2} R (Ring.toSemiring.{u1} R _inst_1) ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3))
Case conversion may be inaccurate. Consider using '#align finsupp_lequiv_direct_sum finsuppLEquivDirectSumₓ'. -/
/-- The finitely supported functions `ι →₀ M` are in linear equivalence with the direct sum of
copies of M indexed by ι. -/
def finsuppLEquivDirectSum : (ι →₀ M) ≃ₗ[R] ⨁ i : ι, M :=
  haveI : ∀ m : M, Decidable (m ≠ 0) := Classical.decPred _
  finsuppLequivDfinsupp R
#align finsupp_lequiv_direct_sum finsuppLEquivDirectSum

/- warning: finsupp_lequiv_direct_sum_single -> finsuppLEquivDirectSum_single is a dubious translation:
lean 3 declaration is
  forall (R : Type.{u1}) (M : Type.{u2}) [_inst_1 : Ring.{u1} R] [_inst_2 : AddCommGroup.{u2} M] [_inst_3 : Module.{u1, u2} R M (Ring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u2} M _inst_2)] (ι : Type.{u3}) [_inst_4 : DecidableEq.{succ u3} ι] (i : ι) (m : M), Eq.{succ (max u3 u2)} (DirectSum.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (coeFn.{succ (max u3 u2), succ (max u3 u2)} (LinearEquiv.{u1, u1, max u3 u2, max u3 u2} R R (Ring.toSemiring.{u1} R _inst_1) (Ring.toSemiring.{u1} R _inst_1) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (Ring.toSemiring.{u1} R _inst_1))) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (Ring.toSemiring.{u1} R _inst_1))) (finsuppLEquivDirectSum._proof_1.{u1} R _inst_1) (finsuppLEquivDirectSum._proof_2.{u1} R _inst_1) (Finsupp.{u3, u2} ι M (AddZeroClass.toHasZero.{u2} M (AddMonoid.toAddZeroClass.{u2} M (SubNegMonoid.toAddMonoid.{u2} M (AddGroup.toSubNegMonoid.{u2} M (AddCommGroup.toAddGroup.{u2} M _inst_2)))))) (DirectSum.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (Finsupp.addCommMonoid.{u3, u2} ι M (AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (DirectSum.addCommMonoid.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (Finsupp.module.{u3, u2, u1} ι M R (Ring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u2} M _inst_2) _inst_3) (DirectSum.module.{u1, u3, u2} R (Ring.toSemiring.{u1} R _inst_1) ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2) (fun (i : ι) => _inst_3))) (fun (_x : LinearEquiv.{u1, u1, max u3 u2, max u3 u2} R R (Ring.toSemiring.{u1} R _inst_1) (Ring.toSemiring.{u1} R _inst_1) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (Ring.toSemiring.{u1} R _inst_1))) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (Ring.toSemiring.{u1} R _inst_1))) (finsuppLEquivDirectSum._proof_1.{u1} R _inst_1) (finsuppLEquivDirectSum._proof_2.{u1} R _inst_1) (Finsupp.{u3, u2} ι M (AddZeroClass.toHasZero.{u2} M (AddMonoid.toAddZeroClass.{u2} M (SubNegMonoid.toAddMonoid.{u2} M (AddGroup.toSubNegMonoid.{u2} M (AddCommGroup.toAddGroup.{u2} M _inst_2)))))) (DirectSum.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (Finsupp.addCommMonoid.{u3, u2} ι M (AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (DirectSum.addCommMonoid.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (Finsupp.module.{u3, u2, u1} ι M R (Ring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u2} M _inst_2) _inst_3) (DirectSum.module.{u1, u3, u2} R (Ring.toSemiring.{u1} R _inst_1) ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2) (fun (i : ι) => _inst_3))) => (Finsupp.{u3, u2} ι M (AddZeroClass.toHasZero.{u2} M (AddMonoid.toAddZeroClass.{u2} M (SubNegMonoid.toAddMonoid.{u2} M (AddGroup.toSubNegMonoid.{u2} M (AddCommGroup.toAddGroup.{u2} M _inst_2)))))) -> (DirectSum.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2))) (LinearEquiv.hasCoeToFun.{u1, u1, max u3 u2, max u3 u2} R R (Finsupp.{u3, u2} ι M (AddZeroClass.toHasZero.{u2} M (AddMonoid.toAddZeroClass.{u2} M (SubNegMonoid.toAddMonoid.{u2} M (AddGroup.toSubNegMonoid.{u2} M (AddCommGroup.toAddGroup.{u2} M _inst_2)))))) (DirectSum.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (Ring.toSemiring.{u1} R _inst_1) (Ring.toSemiring.{u1} R _inst_1) (Finsupp.addCommMonoid.{u3, u2} ι M (AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (DirectSum.addCommMonoid.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (Finsupp.module.{u3, u2, u1} ι M R (Ring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u2} M _inst_2) _inst_3) (DirectSum.module.{u1, u3, u2} R (Ring.toSemiring.{u1} R _inst_1) ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2) (fun (i : ι) => _inst_3)) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (Ring.toSemiring.{u1} R _inst_1))) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (Ring.toSemiring.{u1} R _inst_1))) (finsuppLEquivDirectSum._proof_1.{u1} R _inst_1) (finsuppLEquivDirectSum._proof_2.{u1} R _inst_1)) (finsuppLEquivDirectSum.{u1, u2, u3} R M _inst_1 _inst_2 _inst_3 ι (fun (a : ι) (b : ι) => _inst_4 a b)) (Finsupp.single.{u3, u2} ι M (AddZeroClass.toHasZero.{u2} M (AddMonoid.toAddZeroClass.{u2} M (SubNegMonoid.toAddMonoid.{u2} M (AddGroup.toSubNegMonoid.{u2} M (AddCommGroup.toAddGroup.{u2} M _inst_2))))) i m)) (coeFn.{max (succ u2) (succ (max u3 u2)), max (succ u2) (succ (max u3 u2))} (LinearMap.{u1, u1, u2, max u3 u2} R R (Ring.toSemiring.{u1} R _inst_1) (Ring.toSemiring.{u1} R _inst_1) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (Ring.toSemiring.{u1} R _inst_1))) M (DirectSum.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (AddCommGroup.toAddCommMonoid.{u2} M _inst_2) (DirectSum.addCommMonoid.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) _inst_3 (DirectSum.module.{u1, u3, u2} R (Ring.toSemiring.{u1} R _inst_1) ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2) (fun (i : ι) => _inst_3))) (fun (_x : LinearMap.{u1, u1, u2, max u3 u2} R R (Ring.toSemiring.{u1} R _inst_1) (Ring.toSemiring.{u1} R _inst_1) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (Ring.toSemiring.{u1} R _inst_1))) M (DirectSum.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (AddCommGroup.toAddCommMonoid.{u2} M _inst_2) (DirectSum.addCommMonoid.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) _inst_3 (DirectSum.module.{u1, u3, u2} R (Ring.toSemiring.{u1} R _inst_1) ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2) (fun (i : ι) => _inst_3))) => M -> (DirectSum.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2))) (LinearMap.hasCoeToFun.{u1, u1, u2, max u3 u2} R R M (DirectSum.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (Ring.toSemiring.{u1} R _inst_1) (Ring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u2} M _inst_2) (DirectSum.addCommMonoid.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) _inst_3 (DirectSum.module.{u1, u3, u2} R (Ring.toSemiring.{u1} R _inst_1) ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2) (fun (i : ι) => _inst_3)) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (Ring.toSemiring.{u1} R _inst_1)))) (DirectSum.lof.{u1, u3, u2} R (Ring.toSemiring.{u1} R _inst_1) ι (fun (a : ι) (b : ι) => _inst_4 a b) (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2) (fun (i : ι) => _inst_3) i) m)
but is expected to have type
  forall (R : Type.{u2}) (M : Type.{u3}) [_inst_1 : Ring.{u2} R] [_inst_2 : AddCommGroup.{u3} M] [_inst_3 : Module.{u2, u3} R M (Ring.toSemiring.{u2} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_2)] (ι : Type.{u1}) [_inst_4 : DecidableEq.{succ u1} ι] (i : ι) (m : M), Eq.{max (succ u3) (succ u1)} ((fun (x._@.Mathlib.Algebra.Hom.GroupAction._hyg.2186 : Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) => DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.single.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2))))) i m)) (FunLike.coe.{max (succ u3) (succ u1), max (succ u3) (succ u1), max (succ u3) (succ u1)} (LinearEquiv.{u2, u2, max u3 u1, max u3 u1} R R (Ring.toSemiring.{u2} R _inst_1) (Ring.toSemiring.{u2} R _inst_1) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1)) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1)) (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2)) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.module.{u1, u3, u2} ι M R (Ring.toSemiring.{u2} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_2) _inst_3) (DirectSum.instModuleDirectSumInstAddCommMonoidDirectSum.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3))) (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (fun (_x : Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) => (fun (x._@.Mathlib.Algebra.Hom.GroupAction._hyg.2186 : Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) => DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) _x) (SMulHomClass.toFunLike.{max u3 u1, u2, max u3 u1, max u3 u1} (LinearEquiv.{u2, u2, max u3 u1, max u3 u1} R R (Ring.toSemiring.{u2} R _inst_1) (Ring.toSemiring.{u2} R _inst_1) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1)) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1)) (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2)) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.module.{u1, u3, u2} ι M R (Ring.toSemiring.{u2} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_2) _inst_3) (DirectSum.instModuleDirectSumInstAddCommMonoidDirectSum.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3))) R (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (SMulZeroClass.toSMul.{u2, max u3 u1} R (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (AddMonoid.toZero.{max u3 u1} (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (AddCommMonoid.toAddMonoid.{max u3 u1} (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2)))) (DistribSMul.toSMulZeroClass.{u2, max u3 u1} R (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (AddMonoid.toAddZeroClass.{max u3 u1} (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (AddCommMonoid.toAddMonoid.{max u3 u1} (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2)))) (DistribMulAction.toDistribSMul.{u2, max u3 u1} R (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (MonoidWithZero.toMonoid.{u2} R (Semiring.toMonoidWithZero.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (AddCommMonoid.toAddMonoid.{max u3 u1} (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2))) (Module.toDistribMulAction.{u2, max u3 u1} R (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (Ring.toSemiring.{u2} R _inst_1) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2)) (Finsupp.module.{u1, u3, u2} ι M R (Ring.toSemiring.{u2} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_2) _inst_3))))) (SMulZeroClass.toSMul.{u2, max u3 u1} R (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (AddMonoid.toZero.{max u3 u1} (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (AddCommMonoid.toAddMonoid.{max u3 u1} (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)))) (DistribSMul.toSMulZeroClass.{u2, max u3 u1} R (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (AddMonoid.toAddZeroClass.{max u3 u1} (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (AddCommMonoid.toAddMonoid.{max u3 u1} (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)))) (DistribMulAction.toDistribSMul.{u2, max u3 u1} R (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (MonoidWithZero.toMonoid.{u2} R (Semiring.toMonoidWithZero.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (AddCommMonoid.toAddMonoid.{max u3 u1} (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2))) (Module.toDistribMulAction.{u2, max u3 u1} R (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Ring.toSemiring.{u2} R _inst_1) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (DirectSum.instModuleDirectSumInstAddCommMonoidDirectSum.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3)))))) (DistribMulActionHomClass.toSMulHomClass.{max u3 u1, u2, max u3 u1, max u3 u1} (LinearEquiv.{u2, u2, max u3 u1, max u3 u1} R R (Ring.toSemiring.{u2} R _inst_1) (Ring.toSemiring.{u2} R _inst_1) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1)) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1)) (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2)) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.module.{u1, u3, u2} ι M R (Ring.toSemiring.{u2} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_2) _inst_3) (DirectSum.instModuleDirectSumInstAddCommMonoidDirectSum.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3))) R (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (MonoidWithZero.toMonoid.{u2} R (Semiring.toMonoidWithZero.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (AddCommMonoid.toAddMonoid.{max u3 u1} (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2))) (AddCommMonoid.toAddMonoid.{max u3 u1} (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2))) (Module.toDistribMulAction.{u2, max u3 u1} R (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (Ring.toSemiring.{u2} R _inst_1) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2)) (Finsupp.module.{u1, u3, u2} ι M R (Ring.toSemiring.{u2} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_2) _inst_3)) (Module.toDistribMulAction.{u2, max u3 u1} R (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Ring.toSemiring.{u2} R _inst_1) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (DirectSum.instModuleDirectSumInstAddCommMonoidDirectSum.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3))) (SemilinearMapClass.distribMulActionHomClass.{u2, max u3 u1, max u3 u1, max u3 u1} R (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (LinearEquiv.{u2, u2, max u3 u1, max u3 u1} R R (Ring.toSemiring.{u2} R _inst_1) (Ring.toSemiring.{u2} R _inst_1) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1)) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1)) (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2)) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.module.{u1, u3, u2} ι M R (Ring.toSemiring.{u2} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_2) _inst_3) (DirectSum.instModuleDirectSumInstAddCommMonoidDirectSum.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3))) (Ring.toSemiring.{u2} R _inst_1) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2)) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.module.{u1, u3, u2} ι M R (Ring.toSemiring.{u2} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_2) _inst_3) (DirectSum.instModuleDirectSumInstAddCommMonoidDirectSum.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3)) (SemilinearEquivClass.instSemilinearMapClass.{u2, u2, max u3 u1, max u3 u1, max u3 u1} R R (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (LinearEquiv.{u2, u2, max u3 u1, max u3 u1} R R (Ring.toSemiring.{u2} R _inst_1) (Ring.toSemiring.{u2} R _inst_1) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1)) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1)) (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2)) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.module.{u1, u3, u2} ι M R (Ring.toSemiring.{u2} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_2) _inst_3) (DirectSum.instModuleDirectSumInstAddCommMonoidDirectSum.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3))) (Ring.toSemiring.{u2} R _inst_1) (Ring.toSemiring.{u2} R _inst_1) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2)) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.module.{u1, u3, u2} ι M R (Ring.toSemiring.{u2} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_2) _inst_3) (DirectSum.instModuleDirectSumInstAddCommMonoidDirectSum.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3)) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1)) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1)) (LinearEquiv.instSemilinearEquivClassLinearEquiv.{u2, u2, max u3 u1, max u3 u1} R R (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Ring.toSemiring.{u2} R _inst_1) (Ring.toSemiring.{u2} R _inst_1) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2)) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.module.{u1, u3, u2} ι M R (Ring.toSemiring.{u2} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_2) _inst_3) (DirectSum.instModuleDirectSumInstAddCommMonoidDirectSum.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3)) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1)) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1))))))) (finsuppLEquivDirectSum.{u2, u3, u1} R M _inst_1 _inst_2 _inst_3 ι (fun (a : ι) (b : ι) => _inst_4 a b)) (Finsupp.single.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2))))) i m)) (FunLike.coe.{max (succ u1) (succ u3), succ u3, max (succ u1) (succ u3)} (LinearMap.{u2, u2, u3, max u3 u1} R R (Ring.toSemiring.{u2} R _inst_1) (Ring.toSemiring.{u2} R _inst_1) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) M (DirectSum.{u1, u3} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) _inst_3 (DirectSum.instModuleDirectSumInstAddCommMonoidDirectSum.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3))) M (fun (_x : M) => (fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : M) => DirectSum.{u1, u3} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) _x) (LinearMap.instFunLikeLinearMap.{u2, u2, u3, max u1 u3} R R M (DirectSum.{u1, u3} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Ring.toSemiring.{u2} R _inst_1) (Ring.toSemiring.{u2} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) _inst_3 (DirectSum.instModuleDirectSumInstAddCommMonoidDirectSum.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3)) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1)))) (DirectSum.lof.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (a : ι) (b : ι) => _inst_4 a b) (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3) i) m)
Case conversion may be inaccurate. Consider using '#align finsupp_lequiv_direct_sum_single finsuppLEquivDirectSum_singleₓ'. -/
@[simp]
theorem finsuppLEquivDirectSum_single (i : ι) (m : M) :
    finsuppLEquivDirectSum R M ι (Finsupp.single i m) = DirectSum.lof R ι _ i m :=
  Finsupp.toDfinsupp_single i m
#align finsupp_lequiv_direct_sum_single finsuppLEquivDirectSum_single

/- warning: finsupp_lequiv_direct_sum_symm_lof -> finsuppLEquivDirectSum_symm_lof is a dubious translation:
lean 3 declaration is
  forall (R : Type.{u1}) (M : Type.{u2}) [_inst_1 : Ring.{u1} R] [_inst_2 : AddCommGroup.{u2} M] [_inst_3 : Module.{u1, u2} R M (Ring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u2} M _inst_2)] (ι : Type.{u3}) [_inst_4 : DecidableEq.{succ u3} ι] (i : ι) (m : M), Eq.{max (succ u3) (succ u2)} (Finsupp.{u3, u2} ι M (AddZeroClass.toHasZero.{u2} M (AddMonoid.toAddZeroClass.{u2} M (SubNegMonoid.toAddMonoid.{u2} M (AddGroup.toSubNegMonoid.{u2} M (AddCommGroup.toAddGroup.{u2} M _inst_2)))))) (coeFn.{succ (max u3 u2), succ (max u3 u2)} (LinearEquiv.{u1, u1, max u3 u2, max u3 u2} R R (Ring.toSemiring.{u1} R _inst_1) (Ring.toSemiring.{u1} R _inst_1) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (Ring.toSemiring.{u1} R _inst_1))) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (Ring.toSemiring.{u1} R _inst_1))) (finsuppLEquivDirectSum._proof_2.{u1} R _inst_1) (finsuppLEquivDirectSum._proof_1.{u1} R _inst_1) (DirectSum.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (Finsupp.{u3, u2} ι M (AddZeroClass.toHasZero.{u2} M (AddMonoid.toAddZeroClass.{u2} M (SubNegMonoid.toAddMonoid.{u2} M (AddGroup.toSubNegMonoid.{u2} M (AddCommGroup.toAddGroup.{u2} M _inst_2)))))) (DirectSum.addCommMonoid.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (Finsupp.addCommMonoid.{u3, u2} ι M (AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (DirectSum.module.{u1, u3, u2} R (Ring.toSemiring.{u1} R _inst_1) ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2) (fun (i : ι) => _inst_3)) (Finsupp.module.{u3, u2, u1} ι M R (Ring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u2} M _inst_2) _inst_3)) (fun (_x : LinearEquiv.{u1, u1, max u3 u2, max u3 u2} R R (Ring.toSemiring.{u1} R _inst_1) (Ring.toSemiring.{u1} R _inst_1) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (Ring.toSemiring.{u1} R _inst_1))) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (Ring.toSemiring.{u1} R _inst_1))) (finsuppLEquivDirectSum._proof_2.{u1} R _inst_1) (finsuppLEquivDirectSum._proof_1.{u1} R _inst_1) (DirectSum.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (Finsupp.{u3, u2} ι M (AddZeroClass.toHasZero.{u2} M (AddMonoid.toAddZeroClass.{u2} M (SubNegMonoid.toAddMonoid.{u2} M (AddGroup.toSubNegMonoid.{u2} M (AddCommGroup.toAddGroup.{u2} M _inst_2)))))) (DirectSum.addCommMonoid.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (Finsupp.addCommMonoid.{u3, u2} ι M (AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (DirectSum.module.{u1, u3, u2} R (Ring.toSemiring.{u1} R _inst_1) ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2) (fun (i : ι) => _inst_3)) (Finsupp.module.{u3, u2, u1} ι M R (Ring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u2} M _inst_2) _inst_3)) => (DirectSum.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) -> (Finsupp.{u3, u2} ι M (AddZeroClass.toHasZero.{u2} M (AddMonoid.toAddZeroClass.{u2} M (SubNegMonoid.toAddMonoid.{u2} M (AddGroup.toSubNegMonoid.{u2} M (AddCommGroup.toAddGroup.{u2} M _inst_2))))))) (LinearEquiv.hasCoeToFun.{u1, u1, max u3 u2, max u3 u2} R R (DirectSum.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (Finsupp.{u3, u2} ι M (AddZeroClass.toHasZero.{u2} M (AddMonoid.toAddZeroClass.{u2} M (SubNegMonoid.toAddMonoid.{u2} M (AddGroup.toSubNegMonoid.{u2} M (AddCommGroup.toAddGroup.{u2} M _inst_2)))))) (Ring.toSemiring.{u1} R _inst_1) (Ring.toSemiring.{u1} R _inst_1) (DirectSum.addCommMonoid.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (Finsupp.addCommMonoid.{u3, u2} ι M (AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (DirectSum.module.{u1, u3, u2} R (Ring.toSemiring.{u1} R _inst_1) ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2) (fun (i : ι) => _inst_3)) (Finsupp.module.{u3, u2, u1} ι M R (Ring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u2} M _inst_2) _inst_3) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (Ring.toSemiring.{u1} R _inst_1))) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (Ring.toSemiring.{u1} R _inst_1))) (finsuppLEquivDirectSum._proof_2.{u1} R _inst_1) (finsuppLEquivDirectSum._proof_1.{u1} R _inst_1)) (LinearEquiv.symm.{u1, u1, max u3 u2, max u3 u2} R R (Finsupp.{u3, u2} ι M (AddZeroClass.toHasZero.{u2} M (AddMonoid.toAddZeroClass.{u2} M (SubNegMonoid.toAddMonoid.{u2} M (AddGroup.toSubNegMonoid.{u2} M (AddCommGroup.toAddGroup.{u2} M _inst_2)))))) (DirectSum.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (Ring.toSemiring.{u1} R _inst_1) (Ring.toSemiring.{u1} R _inst_1) (Finsupp.addCommMonoid.{u3, u2} ι M (AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (DirectSum.addCommMonoid.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (Finsupp.module.{u3, u2, u1} ι M R (Ring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u2} M _inst_2) _inst_3) (DirectSum.module.{u1, u3, u2} R (Ring.toSemiring.{u1} R _inst_1) ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2) (fun (i : ι) => _inst_3)) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (Ring.toSemiring.{u1} R _inst_1))) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (Ring.toSemiring.{u1} R _inst_1))) (finsuppLEquivDirectSum._proof_1.{u1} R _inst_1) (finsuppLEquivDirectSum._proof_2.{u1} R _inst_1) (finsuppLEquivDirectSum.{u1, u2, u3} R M _inst_1 _inst_2 _inst_3 ι (fun (a : ι) (b : ι) => _inst_4 a b))) (coeFn.{max (succ u2) (succ (max u3 u2)), max (succ u2) (succ (max u3 u2))} (LinearMap.{u1, u1, u2, max u3 u2} R R (Ring.toSemiring.{u1} R _inst_1) (Ring.toSemiring.{u1} R _inst_1) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (Ring.toSemiring.{u1} R _inst_1))) M (DirectSum.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (AddCommGroup.toAddCommMonoid.{u2} M _inst_2) (DirectSum.addCommMonoid.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) _inst_3 (DirectSum.module.{u1, u3, u2} R (Ring.toSemiring.{u1} R _inst_1) ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2) (fun (i : ι) => _inst_3))) (fun (_x : LinearMap.{u1, u1, u2, max u3 u2} R R (Ring.toSemiring.{u1} R _inst_1) (Ring.toSemiring.{u1} R _inst_1) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (Ring.toSemiring.{u1} R _inst_1))) M (DirectSum.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (AddCommGroup.toAddCommMonoid.{u2} M _inst_2) (DirectSum.addCommMonoid.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) _inst_3 (DirectSum.module.{u1, u3, u2} R (Ring.toSemiring.{u1} R _inst_1) ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2) (fun (i : ι) => _inst_3))) => M -> (DirectSum.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2))) (LinearMap.hasCoeToFun.{u1, u1, u2, max u3 u2} R R M (DirectSum.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) (Ring.toSemiring.{u1} R _inst_1) (Ring.toSemiring.{u1} R _inst_1) (AddCommGroup.toAddCommMonoid.{u2} M _inst_2) (DirectSum.addCommMonoid.{u3, u2} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2)) _inst_3 (DirectSum.module.{u1, u3, u2} R (Ring.toSemiring.{u1} R _inst_1) ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2) (fun (i : ι) => _inst_3)) (RingHom.id.{u1} R (Semiring.toNonAssocSemiring.{u1} R (Ring.toSemiring.{u1} R _inst_1)))) (DirectSum.lof.{u1, u3, u2} R (Ring.toSemiring.{u1} R _inst_1) ι (fun (a : ι) (b : ι) => _inst_4 a b) (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u2} M _inst_2) (fun (i : ι) => _inst_3) i) m)) (Finsupp.single.{u3, u2} ι M (AddZeroClass.toHasZero.{u2} M (AddMonoid.toAddZeroClass.{u2} M (SubNegMonoid.toAddMonoid.{u2} M (AddGroup.toSubNegMonoid.{u2} M (AddCommGroup.toAddGroup.{u2} M _inst_2))))) i m)
but is expected to have type
  forall (R : Type.{u2}) (M : Type.{u3}) [_inst_1 : Ring.{u2} R] [_inst_2 : AddCommGroup.{u3} M] [_inst_3 : Module.{u2, u3} R M (Ring.toSemiring.{u2} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_2)] (ι : Type.{u1}) [_inst_4 : DecidableEq.{succ u1} ι] (i : ι) (m : M), Eq.{max (succ u3) (succ u1)} ((fun (x._@.Mathlib.Algebra.Hom.GroupAction._hyg.2186 : DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) => Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (FunLike.coe.{max (succ u1) (succ u3), succ u3, max (succ u1) (succ u3)} (LinearMap.{u2, u2, u3, max u3 u1} R R (Ring.toSemiring.{u2} R _inst_1) (Ring.toSemiring.{u2} R _inst_1) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) M (DirectSum.{u1, u3} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) _inst_3 (DirectSum.instModuleDirectSumInstAddCommMonoidDirectSum.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3))) M (fun (a : M) => (fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : M) => DirectSum.{u1, u3} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) a) (LinearMap.instFunLikeLinearMap.{u2, u2, u3, max u1 u3} R R M (DirectSum.{u1, u3} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Ring.toSemiring.{u2} R _inst_1) (Ring.toSemiring.{u2} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) _inst_3 (DirectSum.instModuleDirectSumInstAddCommMonoidDirectSum.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3)) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1)))) (DirectSum.lof.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (a : ι) (b : ι) => _inst_4 a b) (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3) i) m)) (FunLike.coe.{max (succ u3) (succ u1), max (succ u3) (succ u1), max (succ u3) (succ u1)} (LinearEquiv.{u2, u2, max u3 u1, max u3 u1} R R (Ring.toSemiring.{u2} R _inst_1) (Ring.toSemiring.{u2} R _inst_1) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1)) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1)) (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2)) (DirectSum.instModuleDirectSumInstAddCommMonoidDirectSum.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3)) (Finsupp.module.{u1, u3, u2} ι M R (Ring.toSemiring.{u2} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_2) _inst_3)) (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (fun (_x : DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) => (fun (x._@.Mathlib.Algebra.Hom.GroupAction._hyg.2186 : DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) => Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) _x) (SMulHomClass.toFunLike.{max u3 u1, u2, max u3 u1, max u3 u1} (LinearEquiv.{u2, u2, max u3 u1, max u3 u1} R R (Ring.toSemiring.{u2} R _inst_1) (Ring.toSemiring.{u2} R _inst_1) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1)) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1)) (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2)) (DirectSum.instModuleDirectSumInstAddCommMonoidDirectSum.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3)) (Finsupp.module.{u1, u3, u2} ι M R (Ring.toSemiring.{u2} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_2) _inst_3)) R (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (SMulZeroClass.toSMul.{u2, max u3 u1} R (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (AddMonoid.toZero.{max u3 u1} (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (AddCommMonoid.toAddMonoid.{max u3 u1} (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)))) (DistribSMul.toSMulZeroClass.{u2, max u3 u1} R (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (AddMonoid.toAddZeroClass.{max u3 u1} (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (AddCommMonoid.toAddMonoid.{max u3 u1} (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)))) (DistribMulAction.toDistribSMul.{u2, max u3 u1} R (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (MonoidWithZero.toMonoid.{u2} R (Semiring.toMonoidWithZero.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (AddCommMonoid.toAddMonoid.{max u3 u1} (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2))) (Module.toDistribMulAction.{u2, max u3 u1} R (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Ring.toSemiring.{u2} R _inst_1) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (DirectSum.instModuleDirectSumInstAddCommMonoidDirectSum.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3)))))) (SMulZeroClass.toSMul.{u2, max u3 u1} R (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (AddMonoid.toZero.{max u3 u1} (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (AddCommMonoid.toAddMonoid.{max u3 u1} (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2)))) (DistribSMul.toSMulZeroClass.{u2, max u3 u1} R (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (AddMonoid.toAddZeroClass.{max u3 u1} (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (AddCommMonoid.toAddMonoid.{max u3 u1} (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2)))) (DistribMulAction.toDistribSMul.{u2, max u3 u1} R (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (MonoidWithZero.toMonoid.{u2} R (Semiring.toMonoidWithZero.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (AddCommMonoid.toAddMonoid.{max u3 u1} (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2))) (Module.toDistribMulAction.{u2, max u3 u1} R (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (Ring.toSemiring.{u2} R _inst_1) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2)) (Finsupp.module.{u1, u3, u2} ι M R (Ring.toSemiring.{u2} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_2) _inst_3))))) (DistribMulActionHomClass.toSMulHomClass.{max u3 u1, u2, max u3 u1, max u3 u1} (LinearEquiv.{u2, u2, max u3 u1, max u3 u1} R R (Ring.toSemiring.{u2} R _inst_1) (Ring.toSemiring.{u2} R _inst_1) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1)) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1)) (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2)) (DirectSum.instModuleDirectSumInstAddCommMonoidDirectSum.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3)) (Finsupp.module.{u1, u3, u2} ι M R (Ring.toSemiring.{u2} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_2) _inst_3)) R (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (MonoidWithZero.toMonoid.{u2} R (Semiring.toMonoidWithZero.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (AddCommMonoid.toAddMonoid.{max u3 u1} (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2))) (AddCommMonoid.toAddMonoid.{max u3 u1} (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2))) (Module.toDistribMulAction.{u2, max u3 u1} R (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Ring.toSemiring.{u2} R _inst_1) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (DirectSum.instModuleDirectSumInstAddCommMonoidDirectSum.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3))) (Module.toDistribMulAction.{u2, max u3 u1} R (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (Ring.toSemiring.{u2} R _inst_1) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2)) (Finsupp.module.{u1, u3, u2} ι M R (Ring.toSemiring.{u2} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_2) _inst_3)) (SemilinearMapClass.distribMulActionHomClass.{u2, max u3 u1, max u3 u1, max u3 u1} R (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (LinearEquiv.{u2, u2, max u3 u1, max u3 u1} R R (Ring.toSemiring.{u2} R _inst_1) (Ring.toSemiring.{u2} R _inst_1) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1)) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1)) (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2)) (DirectSum.instModuleDirectSumInstAddCommMonoidDirectSum.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3)) (Finsupp.module.{u1, u3, u2} ι M R (Ring.toSemiring.{u2} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_2) _inst_3)) (Ring.toSemiring.{u2} R _inst_1) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2)) (DirectSum.instModuleDirectSumInstAddCommMonoidDirectSum.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3)) (Finsupp.module.{u1, u3, u2} ι M R (Ring.toSemiring.{u2} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_2) _inst_3) (SemilinearEquivClass.instSemilinearMapClass.{u2, u2, max u3 u1, max u3 u1, max u3 u1} R R (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (LinearEquiv.{u2, u2, max u3 u1, max u3 u1} R R (Ring.toSemiring.{u2} R _inst_1) (Ring.toSemiring.{u2} R _inst_1) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1)) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1)) (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2)) (DirectSum.instModuleDirectSumInstAddCommMonoidDirectSum.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3)) (Finsupp.module.{u1, u3, u2} ι M R (Ring.toSemiring.{u2} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_2) _inst_3)) (Ring.toSemiring.{u2} R _inst_1) (Ring.toSemiring.{u2} R _inst_1) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2)) (DirectSum.instModuleDirectSumInstAddCommMonoidDirectSum.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3)) (Finsupp.module.{u1, u3, u2} ι M R (Ring.toSemiring.{u2} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_2) _inst_3) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1)) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1)) (LinearEquiv.instSemilinearEquivClassLinearEquiv.{u2, u2, max u3 u1, max u3 u1} R R (DirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (Ring.toSemiring.{u2} R _inst_1) (Ring.toSemiring.{u2} R _inst_1) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2)) (DirectSum.instModuleDirectSumInstAddCommMonoidDirectSum.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (_i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3)) (Finsupp.module.{u1, u3, u2} ι M R (Ring.toSemiring.{u2} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_2) _inst_3) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1)) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1))))))) (LinearEquiv.symm.{u2, u2, max u3 u1, max u3 u1} R R (Finsupp.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2)))))) (DirectSum.{u1, u3} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Ring.toSemiring.{u2} R _inst_1) (Ring.toSemiring.{u2} R _inst_1) (Finsupp.addCommMonoid.{u1, u3} ι M (AddCommGroup.toAddCommMonoid.{u3} M _inst_2)) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Finsupp.module.{u1, u3, u2} ι M R (Ring.toSemiring.{u2} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} M _inst_2) _inst_3) (DirectSum.instModuleDirectSumInstAddCommMonoidDirectSum.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3)) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1)) (RingHomInvPair.ids.{u2} R (Ring.toSemiring.{u2} R _inst_1)) (finsuppLEquivDirectSum.{u2, u3, u1} R M _inst_1 _inst_2 _inst_3 ι (fun (a : ι) (b : ι) => _inst_4 a b))) (FunLike.coe.{max (succ u1) (succ u3), succ u3, max (succ u1) (succ u3)} (LinearMap.{u2, u2, u3, max u3 u1} R R (Ring.toSemiring.{u2} R _inst_1) (Ring.toSemiring.{u2} R _inst_1) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1))) M (DirectSum.{u1, u3} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) _inst_3 (DirectSum.instModuleDirectSumInstAddCommMonoidDirectSum.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3))) M (fun (_x : M) => (fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : M) => DirectSum.{u1, u3} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) _x) (LinearMap.instFunLikeLinearMap.{u2, u2, u3, max u1 u3} R R M (DirectSum.{u1, u3} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) (Ring.toSemiring.{u2} R _inst_1) (Ring.toSemiring.{u2} R _inst_1) (AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (instAddCommMonoidDirectSum.{u1, u3} ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2)) _inst_3 (DirectSum.instModuleDirectSumInstAddCommMonoidDirectSum.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3)) (RingHom.id.{u2} R (Semiring.toNonAssocSemiring.{u2} R (Ring.toSemiring.{u2} R _inst_1)))) (DirectSum.lof.{u2, u1, u3} R (Ring.toSemiring.{u2} R _inst_1) ι (fun (a : ι) (b : ι) => _inst_4 a b) (fun (i : ι) => M) (fun (i : ι) => AddCommGroup.toAddCommMonoid.{u3} ((fun (_i : ι) => M) i) _inst_2) (fun (i : ι) => _inst_3) i) m)) (Finsupp.single.{u1, u3} ι M (NegZeroClass.toZero.{u3} M (SubNegZeroMonoid.toNegZeroClass.{u3} M (SubtractionMonoid.toSubNegZeroMonoid.{u3} M (SubtractionCommMonoid.toSubtractionMonoid.{u3} M (AddCommGroup.toDivisionAddCommMonoid.{u3} M _inst_2))))) i m)
Case conversion may be inaccurate. Consider using '#align finsupp_lequiv_direct_sum_symm_lof finsuppLEquivDirectSum_symm_lofₓ'. -/
@[simp]
theorem finsuppLEquivDirectSum_symm_lof (i : ι) (m : M) :
    (finsuppLEquivDirectSum R M ι).symm (DirectSum.lof R ι _ i m) = Finsupp.single i m :=
  letI : ∀ m : M, Decidable (m ≠ 0) := Classical.decPred _
  Dfinsupp.toFinsupp_single i m
#align finsupp_lequiv_direct_sum_symm_lof finsuppLEquivDirectSum_symm_lof

end finsuppLEquivDirectSum


/-
Copyright (c) 2018 Kenny Lau. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Kenny Lau, Joey van Langen, Casper Putz
-/
import Mathlib.PrePort
import Mathlib.Lean3Lib.init.default
import Mathlib.data.fintype.basic
import Mathlib.data.nat.choose.default
import Mathlib.data.int.modeq
import Mathlib.algebra.module.basic
import Mathlib.algebra.iterate_hom
import Mathlib.group_theory.order_of_element
import Mathlib.algebra.group.type_tags
import Mathlib.PostPort

universes u l u_1 u_2 v

namespace Mathlib

/-!
# Characteristic of semirings
-/

/-- The generator of the kernel of the unique homomorphism ℕ → α for a semiring α -/
class char_p (α : Type u) [semiring α] (p : ℕ) where
  cast_eq_zero_iff : ∀ (x : ℕ), ↑x = 0 ↔ p ∣ x

theorem char_p.cast_eq_zero (α : Type u) [semiring α] (p : ℕ) [char_p α p] : ↑p = 0 :=
  iff.mpr (char_p.cast_eq_zero_iff α p p) (dvd_refl p)

@[simp] theorem char_p.cast_card_eq_zero (R : Type u_1) [ring R] [fintype R] :
    ↑(fintype.card R) = 0 :=
  sorry

theorem char_p.int_cast_eq_zero_iff (R : Type u) [ring R] (p : ℕ) [char_p R p] (a : ℤ) :
    ↑a = 0 ↔ ↑p ∣ a :=
  sorry

theorem char_p.int_coe_eq_int_coe_iff (R : Type u_1) [ring R] (p : ℕ) [char_p R p] (a : ℤ) (b : ℤ) :
    ↑a = ↑b ↔ int.modeq (↑p) a b :=
  sorry

theorem char_p.eq (α : Type u) [semiring α] {p : ℕ} {q : ℕ} (c1 : char_p α p) (c2 : char_p α q) :
    p = q :=
  nat.dvd_antisymm (iff.mp (char_p.cast_eq_zero_iff α p q) (char_p.cast_eq_zero α q))
    (iff.mp (char_p.cast_eq_zero_iff α q p) (char_p.cast_eq_zero α p))

protected instance char_p.of_char_zero (α : Type u) [semiring α] [char_zero α] : char_p α 0 :=
  char_p.mk
    fun (x : ℕ) =>
      eq.mpr (id (Eq._oldrec (Eq.refl (↑x = 0 ↔ 0 ∣ x)) (propext zero_dvd_iff)))
        (eq.mpr (id (Eq._oldrec (Eq.refl (↑x = 0 ↔ x = 0)) (Eq.symm nat.cast_zero)))
          (eq.mpr (id (Eq._oldrec (Eq.refl (↑x = ↑0 ↔ x = 0)) (propext nat.cast_inj)))
            (iff.refl (x = 0))))

theorem char_p.exists (α : Type u) [semiring α] : ∃ (p : ℕ), char_p α p := sorry

theorem char_p.exists_unique (α : Type u) [semiring α] : exists_unique fun (p : ℕ) => char_p α p :=
  sorry

theorem char_p.congr {R : Type u} [semiring R] {p : ℕ} (q : ℕ) [hq : char_p R q] (h : q = p) :
    char_p R p :=
  h ▸ hq

/-- Noncomputable function that outputs the unique characteristic of a semiring. -/
def ring_char (α : Type u) [semiring α] : ℕ := classical.some (char_p.exists_unique α)

namespace ring_char

theorem spec (R : Type u) [semiring R] (x : ℕ) : ↑x = 0 ↔ ring_char R ∣ x := sorry

theorem eq (R : Type u) [semiring R] {p : ℕ} (C : char_p R p) : p = ring_char R :=
  and.right (classical.some_spec (char_p.exists_unique R)) p C

protected instance char_p (R : Type u) [semiring R] : char_p R (ring_char R) := char_p.mk (spec R)

theorem of_eq {R : Type u} [semiring R] {p : ℕ} (h : ring_char R = p) : char_p R p :=
  char_p.congr (ring_char R) h

theorem eq_iff {R : Type u} [semiring R] {p : ℕ} : ring_char R = p ↔ char_p R p :=
  { mp := of_eq, mpr := Eq.symm ∘ eq R }

theorem dvd {R : Type u} [semiring R] {x : ℕ} (hx : ↑x = 0) : ring_char R ∣ x :=
  iff.mp (spec R x) hx

end ring_char

theorem add_pow_char_of_commute (R : Type u) [semiring R] {p : ℕ} [fact (nat.prime p)] [char_p R p]
    (x : R) (y : R) (h : commute x y) : (x + y) ^ p = x ^ p + y ^ p :=
  sorry

theorem add_pow_char_pow_of_commute (R : Type u) [semiring R] {p : ℕ} [fact (nat.prime p)]
    [char_p R p] {n : ℕ} (x : R) (y : R) (h : commute x y) :
    (x + y) ^ p ^ n = x ^ p ^ n + y ^ p ^ n :=
  sorry

theorem sub_pow_char_of_commute (R : Type u) [ring R] {p : ℕ} [fact (nat.prime p)] [char_p R p]
    (x : R) (y : R) (h : commute x y) : (x - y) ^ p = x ^ p - y ^ p :=
  sorry

theorem sub_pow_char_pow_of_commute (R : Type u) [ring R] {p : ℕ} [fact (nat.prime p)] [char_p R p]
    {n : ℕ} (x : R) (y : R) (h : commute x y) : (x - y) ^ p ^ n = x ^ p ^ n - y ^ p ^ n :=
  sorry

theorem add_pow_char (α : Type u) [comm_semiring α] {p : ℕ} [fact (nat.prime p)] [char_p α p]
    (x : α) (y : α) : (x + y) ^ p = x ^ p + y ^ p :=
  add_pow_char_of_commute α x y (commute.all x y)

theorem add_pow_char_pow (R : Type u) [comm_semiring R] {p : ℕ} [fact (nat.prime p)] [char_p R p]
    {n : ℕ} (x : R) (y : R) : (x + y) ^ p ^ n = x ^ p ^ n + y ^ p ^ n :=
  add_pow_char_pow_of_commute R x y (commute.all x y)

theorem sub_pow_char (α : Type u) [comm_ring α] {p : ℕ} [fact (nat.prime p)] [char_p α p] (x : α)
    (y : α) : (x - y) ^ p = x ^ p - y ^ p :=
  sub_pow_char_of_commute α x y (commute.all x y)

theorem sub_pow_char_pow (R : Type u) [comm_ring R] {p : ℕ} [fact (nat.prime p)] [char_p R p]
    {n : ℕ} (x : R) (y : R) : (x - y) ^ p ^ n = x ^ p ^ n - y ^ p ^ n :=
  sub_pow_char_pow_of_commute R x y (commute.all x y)

theorem eq_iff_modeq_int (R : Type u_1) [ring R] (p : ℕ) [char_p R p] (a : ℤ) (b : ℤ) :
    ↑a = ↑b ↔ int.modeq (↑p) a b :=
  sorry

theorem char_p.neg_one_ne_one (R : Type u_1) [ring R] (p : ℕ) [char_p R p] [fact (bit0 1 < p)] :
    -1 ≠ 1 :=
  sorry

theorem ring_hom.char_p_iff_char_p {K : Type u_1} {L : Type u_2} [field K] [field L] (f : K →+* L)
    (p : ℕ) : char_p K p ↔ char_p L p :=
  sorry

/-- The frobenius map that sends x to x^p -/
def frobenius (R : Type u) [comm_semiring R] (p : ℕ) [fact (nat.prime p)] [char_p R p] : R →+* R :=
  ring_hom.mk (fun (x : R) => x ^ p) sorry sorry sorry (add_pow_char R)

theorem frobenius_def {R : Type u} [comm_semiring R] (p : ℕ) [fact (nat.prime p)] [char_p R p]
    (x : R) : coe_fn (frobenius R p) x = x ^ p :=
  rfl

theorem iterate_frobenius {R : Type u} [comm_semiring R] (p : ℕ) [fact (nat.prime p)] [char_p R p]
    (x : R) (n : ℕ) : nat.iterate (⇑(frobenius R p)) n x = x ^ p ^ n :=
  sorry

theorem frobenius_mul {R : Type u} [comm_semiring R] (p : ℕ) [fact (nat.prime p)] [char_p R p]
    (x : R) (y : R) :
    coe_fn (frobenius R p) (x * y) = coe_fn (frobenius R p) x * coe_fn (frobenius R p) y :=
  ring_hom.map_mul (frobenius R p) x y

theorem frobenius_one {R : Type u} [comm_semiring R] (p : ℕ) [fact (nat.prime p)] [char_p R p] :
    coe_fn (frobenius R p) 1 = 1 :=
  one_pow p

theorem monoid_hom.map_frobenius {R : Type u} [comm_semiring R] {S : Type v} [comm_semiring S]
    (f : R →* S) (p : ℕ) [fact (nat.prime p)] [char_p R p] [char_p S p] (x : R) :
    coe_fn f (coe_fn (frobenius R p) x) = coe_fn (frobenius S p) (coe_fn f x) :=
  monoid_hom.map_pow f x p

theorem ring_hom.map_frobenius {R : Type u} [comm_semiring R] {S : Type v} [comm_semiring S]
    (g : R →+* S) (p : ℕ) [fact (nat.prime p)] [char_p R p] [char_p S p] (x : R) :
    coe_fn g (coe_fn (frobenius R p) x) = coe_fn (frobenius S p) (coe_fn g x) :=
  ring_hom.map_pow g x p

theorem monoid_hom.map_iterate_frobenius {R : Type u} [comm_semiring R] {S : Type v}
    [comm_semiring S] (f : R →* S) (p : ℕ) [fact (nat.prime p)] [char_p R p] [char_p S p] (x : R)
    (n : ℕ) :
    coe_fn f (nat.iterate (⇑(frobenius R p)) n x) = nat.iterate (⇑(frobenius S p)) n (coe_fn f x) :=
  function.semiconj.iterate_right (monoid_hom.map_frobenius f p) n x

theorem ring_hom.map_iterate_frobenius {R : Type u} [comm_semiring R] {S : Type v} [comm_semiring S]
    (g : R →+* S) (p : ℕ) [fact (nat.prime p)] [char_p R p] [char_p S p] (x : R) (n : ℕ) :
    coe_fn g (nat.iterate (⇑(frobenius R p)) n x) = nat.iterate (⇑(frobenius S p)) n (coe_fn g x) :=
  monoid_hom.map_iterate_frobenius (ring_hom.to_monoid_hom g) p x n

theorem monoid_hom.iterate_map_frobenius {R : Type u} [comm_semiring R] (x : R) (f : R →* R) (p : ℕ)
    [fact (nat.prime p)] [char_p R p] (n : ℕ) :
    nat.iterate (⇑f) n (coe_fn (frobenius R p) x) = coe_fn (frobenius R p) (nat.iterate (⇑f) n x) :=
  monoid_hom.iterate_map_pow f x n p

theorem ring_hom.iterate_map_frobenius {R : Type u} [comm_semiring R] (x : R) (f : R →+* R) (p : ℕ)
    [fact (nat.prime p)] [char_p R p] (n : ℕ) :
    nat.iterate (⇑f) n (coe_fn (frobenius R p) x) = coe_fn (frobenius R p) (nat.iterate (⇑f) n x) :=
  ring_hom.iterate_map_pow f x n p

theorem frobenius_zero (R : Type u) [comm_semiring R] (p : ℕ) [fact (nat.prime p)] [char_p R p] :
    coe_fn (frobenius R p) 0 = 0 :=
  ring_hom.map_zero (frobenius R p)

theorem frobenius_add (R : Type u) [comm_semiring R] (p : ℕ) [fact (nat.prime p)] [char_p R p]
    (x : R) (y : R) :
    coe_fn (frobenius R p) (x + y) = coe_fn (frobenius R p) x + coe_fn (frobenius R p) y :=
  ring_hom.map_add (frobenius R p) x y

theorem frobenius_nat_cast (R : Type u) [comm_semiring R] (p : ℕ) [fact (nat.prime p)] [char_p R p]
    (n : ℕ) : coe_fn (frobenius R p) ↑n = ↑n :=
  ring_hom.map_nat_cast (frobenius R p) n

theorem frobenius_neg (R : Type u) [comm_ring R] (p : ℕ) [fact (nat.prime p)] [char_p R p] (x : R) :
    coe_fn (frobenius R p) (-x) = -coe_fn (frobenius R p) x :=
  ring_hom.map_neg (frobenius R p) x

theorem frobenius_sub (R : Type u) [comm_ring R] (p : ℕ) [fact (nat.prime p)] [char_p R p] (x : R)
    (y : R) :
    coe_fn (frobenius R p) (x - y) = coe_fn (frobenius R p) x - coe_fn (frobenius R p) y :=
  ring_hom.map_sub (frobenius R p) x y

theorem frobenius_inj (α : Type u) [comm_ring α] [no_zero_divisors α] (p : ℕ) [fact (nat.prime p)]
    [char_p α p] : function.injective ⇑(frobenius α p) :=
  sorry

namespace char_p

theorem char_p_to_char_zero (α : Type u) [ring α] [char_p α 0] : char_zero α :=
  char_zero_of_inj_zero
    fun (n : ℕ) (h0 : ↑n = 0) => eq_zero_of_zero_dvd (iff.mp (cast_eq_zero_iff α 0 n) h0)

theorem cast_eq_mod (α : Type u) [ring α] (p : ℕ) [char_p α p] (k : ℕ) : ↑k = ↑(k % p) := sorry

theorem char_ne_zero_of_fintype (α : Type u) [ring α] (p : ℕ) [hc : char_p α p] [fintype α] :
    p ≠ 0 :=
  fun (h : p = 0) =>
    (fun (this : char_zero α) => absurd nat.cast_injective (not_injective_infinite_fintype coe))
      (char_p_to_char_zero α)

theorem char_ne_one (α : Type u) [integral_domain α] (p : ℕ) [hc : char_p α p] : p ≠ 1 := sorry

theorem char_is_prime_of_two_le (α : Type u) [integral_domain α] (p : ℕ) [hc : char_p α p]
    (hp : bit0 1 ≤ p) : nat.prime p :=
  sorry

theorem char_is_prime_or_zero (α : Type u) [integral_domain α] (p : ℕ) [hc : char_p α p] :
    nat.prime p ∨ p = 0 :=
  sorry

theorem char_is_prime_of_pos (α : Type u) [integral_domain α] (p : ℕ) [h : fact (0 < p)]
    [char_p α p] : fact (nat.prime p) :=
  or.resolve_right (char_is_prime_or_zero α p) (iff.mp pos_iff_ne_zero h)

theorem char_is_prime (α : Type u) [integral_domain α] [fintype α] (p : ℕ) [char_p α p] :
    nat.prime p :=
  or.resolve_right (char_is_prime_or_zero α p) (char_ne_zero_of_fintype α p)

protected instance subsingleton {R : Type u_1} [semiring R] [char_p R 1] : subsingleton R :=
  subsingleton.intro
    ((fun (this : ∀ (r : R), r = 0) (a b : R) =>
        (fun (this : a = b) => this)
          (eq.mpr (id (Eq._oldrec (Eq.refl (a = b)) (this a)))
            (eq.mpr (id (Eq._oldrec (Eq.refl (0 = b)) (this b))) (Eq.refl 0))))
      fun (r : R) =>
        Eq.trans
          (Eq.trans
            (Eq.trans (eq.mpr (id (Eq._oldrec (Eq.refl (r = 1 * r)) (one_mul r))) (Eq.refl r))
              (eq.mpr (id (Eq._oldrec (Eq.refl (1 * r = ↑1 * r)) nat.cast_one)) (Eq.refl (1 * r))))
            (eq.mpr (id (Eq._oldrec (Eq.refl (↑1 * r = 0 * r)) (cast_eq_zero R 1)))
              (Eq.refl (0 * r))))
          (eq.mpr (id (Eq._oldrec (Eq.refl (0 * r = 0)) (zero_mul r))) (Eq.refl 0)))

theorem false_of_nontrivial_of_char_one {R : Type u_1} [semiring R] [nontrivial R] [char_p R 1] :
    False :=
  false_of_nontrivial_of_subsingleton R

theorem ring_char_ne_one {R : Type u_1} [semiring R] [nontrivial R] : ring_char R ≠ 1 := sorry

theorem nontrivial_of_char_ne_one {v : ℕ} (hv : v ≠ 1) {R : Type u_1} [semiring R]
    [hr : char_p R v] : nontrivial R :=
  sorry

end char_p

theorem char_p_of_ne_zero (n : ℕ) (R : Type u_1) [comm_ring R] [fintype R] (hn : fintype.card R = n)
    (hR : ∀ (i : ℕ), i < n → ↑i = 0 → i = 0) : char_p R n :=
  sorry

theorem char_p_of_prime_pow_injective (R : Type u_1) [comm_ring R] [fintype R] (p : ℕ)
    [hp : fact (nat.prime p)] (n : ℕ) (hn : fintype.card R = p ^ n)
    (hR : ∀ (i : ℕ), i ≤ n → ↑p ^ i = 0 → i = n) : char_p R (p ^ n) :=
  sorry

end Mathlib