M : Type u_1
ι : Type u_2
R : Type u_3
inst✝⁴ : DecidableEq M
inst✝³ : AddMonoid M
inst✝² : DecidableEq ι
inst✝¹ : AddMonoid ι
inst✝ : CommSemiring R
f : M →+ ι
m : M
r : R
⊢ r •
      ↑{
            toOneHom :=
              {
                toFun := fun m =>
                  ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) (↑f (↑Multiplicative.toAdd m)))
                    { val := Finsupp.single (↑Multiplicative.toAdd m) 1,
                      property :=
                        (_ :
                          Finsupp.single (↑Multiplicative.toAdd m) 1 ∈ gradeBy R (↑f) (↑f (↑Multiplicative.toAdd m))) },
                map_one' :=
                  (_ :
                    ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) (↑f (↑Multiplicative.toAdd 1)))
                        { val := Finsupp.single (↑Multiplicative.toAdd 1) 1,
                          property :=
                            (_ :
                              Finsupp.single (↑Multiplicative.toAdd 1) 1 ∈
                                gradeBy R (↑f) (↑f (↑Multiplicative.toAdd 1))) } =
                      ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) 0) GradedMonoid.GOne.one) },
            map_mul' :=
              (_ :
                ∀ (i j : Multiplicative M),
                  OneHom.toFun
                      {
                        toFun := fun m =>
                          ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) (↑f (↑Multiplicative.toAdd m)))
                            { val := Finsupp.single (↑Multiplicative.toAdd m) 1,
                              property :=
                                (_ :
                                  Finsupp.single (↑Multiplicative.toAdd m) 1 ∈
                                    gradeBy R (↑f) (↑f (↑Multiplicative.toAdd m))) },
                        map_one' :=
                          (_ :
                            ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) (↑f (↑Multiplicative.toAdd 1)))
                                { val := Finsupp.single (↑Multiplicative.toAdd 1) 1,
                                  property :=
                                    (_ :
                                      Finsupp.single (↑Multiplicative.toAdd 1) 1 ∈
                                        gradeBy R (↑f) (↑f (↑Multiplicative.toAdd 1))) } =
                              ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) 0) GradedMonoid.GOne.one) }
                      (i * j) =
                    OneHom.toFun
                        {
                          toFun := fun m =>
                            ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) (↑f (↑Multiplicative.toAdd m)))
                              { val := Finsupp.single (↑Multiplicative.toAdd m) 1,
                                property :=
                                  (_ :
                                    Finsupp.single (↑Multiplicative.toAdd m) 1 ∈
                                      gradeBy R (↑f) (↑f (↑Multiplicative.toAdd m))) },
                          map_one' :=
                            (_ :
                              ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) (↑f (↑Multiplicative.toAdd 1)))
                                  { val := Finsupp.single (↑Multiplicative.toAdd 1) 1,
                                    property :=
                                      (_ :
                                        Finsupp.single (↑Multiplicative.toAdd 1) 1 ∈
                                          gradeBy R (↑f) (↑f (↑Multiplicative.toAdd 1))) } =
                                ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) 0) GradedMonoid.GOne.one) }
                        i *
                      OneHom.toFun
                        {
                          toFun := fun m =>
                            ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) (↑f (↑Multiplicative.toAdd m)))
                              { val := Finsupp.single (↑Multiplicative.toAdd m) 1,
                                property :=
                                  (_ :
                                    Finsupp.single (↑Multiplicative.toAdd m) 1 ∈
                                      gradeBy R (↑f) (↑f (↑Multiplicative.toAdd m))) },
                          map_one' :=
                            (_ :
                              ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) (↑f (↑Multiplicative.toAdd 1)))
                                  { val := Finsupp.single (↑Multiplicative.toAdd 1) 1,
                                    property :=
                                      (_ :
                                        Finsupp.single (↑Multiplicative.toAdd 1) 1 ∈
                                          gradeBy R (↑f) (↑f (↑Multiplicative.toAdd 1))) } =
                                ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) 0) GradedMonoid.GOne.one) }
                        j) }
        (↑Multiplicative.ofAdd m) =
    ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) (↑f m))
      { val := Finsupp.single m r, property := (_ : Finsupp.single m r ∈ gradeBy R (↑f) (↑f m)) }
M : Type u_1
ι : Type u_2
R : Type u_3
inst✝⁴ : DecidableEq M
inst✝³ : AddMonoid M
inst✝² : DecidableEq ι
inst✝¹ : AddMonoid ι
inst✝ : CommSemiring R
f : M →+ ι
m : M
r : R
⊢ ↑(decomposeAux f) (Finsupp.single m r) =
    ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) (↑f m))
      { val := Finsupp.single m r, property := (_ : Finsupp.single m r ∈ gradeBy R (↑f) (↑f m)) }
refine' (lift_single _ _ _).trans _
M : Type u_1
ι : Type u_2
R : Type u_3
inst✝⁴ : DecidableEq M
inst✝³ : AddMonoid M
inst✝² : DecidableEq ι
inst✝¹ : AddMonoid ι
inst✝ : CommSemiring R
f : M →+ ι
m : M
r : R
⊢ ↑(DirectSum.of (fun i => (fun i => { x // x ∈ gradeBy R (↑f) i }) i)
          (↑f (↑Multiplicative.toAdd (↑Multiplicative.ofAdd m))))
      (r •
        { val := Finsupp.single (↑Multiplicative.toAdd (↑Multiplicative.ofAdd m)) 1,
          property :=
            (_ :
              Finsupp.single (↑Multiplicative.toAdd (↑Multiplicative.ofAdd m)) 1 ∈
                gradeBy R (↑f) (↑f (↑Multiplicative.toAdd (↑Multiplicative.ofAdd m)))) }) =
    ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) (↑f m))
      { val := Finsupp.single m r, property := (_ : Finsupp.single m r ∈ gradeBy R (↑f) (↑f m)) }
M : Type u_1
ι : Type u_2
R : Type u_3
inst✝⁴ : DecidableEq M
inst✝³ : AddMonoid M
inst✝² : DecidableEq ι
inst✝¹ : AddMonoid ι
inst✝ : CommSemiring R
f : M →+ ι
m : M
r : R
⊢ r •
      ↑{
            toOneHom :=
              {
                toFun := fun m =>
                  ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) (↑f (↑Multiplicative.toAdd m)))
                    { val := Finsupp.single (↑Multiplicative.toAdd m) 1,
                      property :=
                        (_ :
                          Finsupp.single (↑Multiplicative.toAdd m) 1 ∈ gradeBy R (↑f) (↑f (↑Multiplicative.toAdd m))) },
                map_one' :=
                  (_ :
                    ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) (↑f (↑Multiplicative.toAdd 1)))
                        { val := Finsupp.single (↑Multiplicative.toAdd 1) 1,
                          property :=
                            (_ :
                              Finsupp.single (↑Multiplicative.toAdd 1) 1 ∈
                                gradeBy R (↑f) (↑f (↑Multiplicative.toAdd 1))) } =
                      ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) 0) GradedMonoid.GOne.one) },
            map_mul' :=
              (_ :
                ∀ (i j : Multiplicative M),
                  OneHom.toFun
                      {
                        toFun := fun m =>
                          ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) (↑f (↑Multiplicative.toAdd m)))
                            { val := Finsupp.single (↑Multiplicative.toAdd m) 1,
                              property :=
                                (_ :
                                  Finsupp.single (↑Multiplicative.toAdd m) 1 ∈
                                    gradeBy R (↑f) (↑f (↑Multiplicative.toAdd m))) },
                        map_one' :=
                          (_ :
                            ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) (↑f (↑Multiplicative.toAdd 1)))
                                { val := Finsupp.single (↑Multiplicative.toAdd 1) 1,
                                  property :=
                                    (_ :
                                      Finsupp.single (↑Multiplicative.toAdd 1) 1 ∈
                                        gradeBy R (↑f) (↑f (↑Multiplicative.toAdd 1))) } =
                              ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) 0) GradedMonoid.GOne.one) }
                      (i * j) =
                    OneHom.toFun
                        {
                          toFun := fun m =>
                            ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) (↑f (↑Multiplicative.toAdd m)))
                              { val := Finsupp.single (↑Multiplicative.toAdd m) 1,
                                property :=
                                  (_ :
                                    Finsupp.single (↑Multiplicative.toAdd m) 1 ∈
                                      gradeBy R (↑f) (↑f (↑Multiplicative.toAdd m))) },
                          map_one' :=
                            (_ :
                              ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) (↑f (↑Multiplicative.toAdd 1)))
                                  { val := Finsupp.single (↑Multiplicative.toAdd 1) 1,
                                    property :=
                                      (_ :
                                        Finsupp.single (↑Multiplicative.toAdd 1) 1 ∈
                                          gradeBy R (↑f) (↑f (↑Multiplicative.toAdd 1))) } =
                                ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) 0) GradedMonoid.GOne.one) }
                        i *
                      OneHom.toFun
                        {
                          toFun := fun m =>
                            ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) (↑f (↑Multiplicative.toAdd m)))
                              { val := Finsupp.single (↑Multiplicative.toAdd m) 1,
                                property :=
                                  (_ :
                                    Finsupp.single (↑Multiplicative.toAdd m) 1 ∈
                                      gradeBy R (↑f) (↑f (↑Multiplicative.toAdd m))) },
                          map_one' :=
                            (_ :
                              ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) (↑f (↑Multiplicative.toAdd 1)))
                                  { val := Finsupp.single (↑Multiplicative.toAdd 1) 1,
                                    property :=
                                      (_ :
                                        Finsupp.single (↑Multiplicative.toAdd 1) 1 ∈
                                          gradeBy R (↑f) (↑f (↑Multiplicative.toAdd 1))) } =
                                ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) 0) GradedMonoid.GOne.one) }
                        j) }
        (↑Multiplicative.ofAdd m) =
    ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) (↑f m))
      { val := Finsupp.single m r, property := (_ : Finsupp.single m r ∈ gradeBy R (↑f) (↑f m)) }
refine' (DirectSum.of_smul R _ _ _).symm.trans _
case h
M : Type u_1
ι : Type u_2
R : Type u_3
inst✝⁴ : DecidableEq M
inst✝³ : AddMonoid M
inst✝² : DecidableEq ι
inst✝¹ : AddMonoid ι
inst✝ : CommSemiring R
f : M →+ ι
m : M
r : R
⊢ GradedMonoid.mk (↑f (↑Multiplicative.toAdd (↑Multiplicative.ofAdd m)))
      (r •
        { val := Finsupp.single (↑Multiplicative.toAdd (↑Multiplicative.ofAdd m)) 1,
          property :=
            (_ :
              Finsupp.single (↑Multiplicative.toAdd (↑Multiplicative.ofAdd m)) 1 ∈
                gradeBy R (↑f) (↑f (↑Multiplicative.toAdd (↑Multiplicative.ofAdd m)))) }) =
    GradedMonoid.mk (↑f m) { val := Finsupp.single m r, property := (_ : Finsupp.single m r ∈ gradeBy R (↑f) (↑f m)) }
M : Type u_1
ι : Type u_2
R : Type u_3
inst✝⁴ : DecidableEq M
inst✝³ : AddMonoid M
inst✝² : DecidableEq ι
inst✝¹ : AddMonoid ι
inst✝ : CommSemiring R
f : M →+ ι
m : M
r : R
⊢ ↑(DirectSum.of (fun i => (fun i => { x // x ∈ gradeBy R (↑f) i }) i)
          (↑f (↑Multiplicative.toAdd (↑Multiplicative.ofAdd m))))
      (r •
        { val := Finsupp.single (↑Multiplicative.toAdd (↑Multiplicative.ofAdd m)) 1,
          property :=
            (_ :
              Finsupp.single (↑Multiplicative.toAdd (↑Multiplicative.ofAdd m)) 1 ∈
                gradeBy R (↑f) (↑f (↑Multiplicative.toAdd (↑Multiplicative.ofAdd m)))) }) =
    ↑(DirectSum.of (fun i => { x // x ∈ gradeBy R (↑f) i }) (↑f m))
      { val := Finsupp.single m r, property := (_ : Finsupp.single m r ∈ gradeBy R (↑f) (↑f m)) }
apply DirectSum.of_eq_of_gradedMonoid_eq
case h
M : Type u_1
ι : Type u_2
R : Type u_3
inst✝⁴ : DecidableEq M
inst✝³ : AddMonoid M
inst✝² : DecidableEq ι
inst✝¹ : AddMonoid ι
inst✝ : CommSemiring R
f : M →+ ι
m : M
r : R
⊢ ↑(GradedMonoid.mk (↑f (↑Multiplicative.toAdd (↑Multiplicative.ofAdd m)))
          (r •
            { val := Finsupp.single (↑Multiplicative.toAdd (↑Multiplicative.ofAdd m)) 1,
              property :=
                (_ :
                  Finsupp.single (↑Multiplicative.toAdd (↑Multiplicative.ofAdd m)) 1 ∈
                    gradeBy R (↑f) (↑f (↑Multiplicative.toAdd (↑Multiplicative.ofAdd m)))) })).snd =
    ↑(GradedMonoid.mk (↑f m)
          { val := Finsupp.single m r, property := (_ : Finsupp.single m r ∈ gradeBy R (↑f) (↑f m)) }).snd
case h
M : Type u_1
ι : Type u_2
R : Type u_3
inst✝⁴ : DecidableEq M
inst✝³ : AddMonoid M
inst✝² : DecidableEq ι
inst✝¹ : AddMonoid ι
inst✝ : CommSemiring R
f : M →+ ι
m : M
r : R
⊢ GradedMonoid.mk (↑f (↑Multiplicative.toAdd (↑Multiplicative.ofAdd m)))
      (r •
        { val := Finsupp.single (↑Multiplicative.toAdd (↑Multiplicative.ofAdd m)) 1,
          property :=
            (_ :
              Finsupp.single (↑Multiplicative.toAdd (↑Multiplicative.ofAdd m)) 1 ∈
                gradeBy R (↑f) (↑f (↑Multiplicative.toAdd (↑Multiplicative.ofAdd m)))) }) =
    GradedMonoid.mk (↑f m) { val := Finsupp.single m r, property := (_ : Finsupp.single m r ∈ gradeBy R (↑f) (↑f m)) }
refine' Sigma.subtype_ext rfl _
case h
M : Type u_1
ι : Type u_2
R : Type u_3
inst✝⁴ : DecidableEq M
inst✝³ : AddMonoid M
inst✝² : DecidableEq ι
inst✝¹ : AddMonoid ι
inst✝ : CommSemiring R
f : M →+ ι
m : M
r : R
⊢ Finsupp.single (↑Multiplicative.toAdd (↑Multiplicative.ofAdd m)) (r * 1) =
    ↑(GradedMonoid.mk (↑f m)
          { val := Finsupp.single m r, property := (_ : Finsupp.single m r ∈ gradeBy R (↑f) (↑f m)) }).snd
case h
M : Type u_1
ι : Type u_2
R : Type u_3
inst✝⁴ : DecidableEq M
inst✝³ : AddMonoid M
inst✝² : DecidableEq ι
inst✝¹ : AddMonoid ι
inst✝ : CommSemiring R
f : M →+ ι
m : M
r : R
⊢ ↑(GradedMonoid.mk (↑f (↑Multiplicative.toAdd (↑Multiplicative.ofAdd m)))
          (r •
            { val := Finsupp.single (↑Multiplicative.toAdd (↑Multiplicative.ofAdd m)) 1,
              property :=
                (_ :
                  Finsupp.single (↑Multiplicative.toAdd (↑Multiplicative.ofAdd m)) 1 ∈
                    gradeBy R (↑f) (↑f (↑Multiplicative.toAdd (↑Multiplicative.ofAdd m)))) })).snd =
    ↑(GradedMonoid.mk (↑f m)
          { val := Finsupp.single m r, property := (_ : Finsupp.single m r ∈ gradeBy R (↑f) (↑f m)) }).snd
refine' (Finsupp.smul_single' _ _ _).trans _
case h
M : Type u_1
ι : Type u_2
R : Type u_3
inst✝⁴ : DecidableEq M
inst✝³ : AddMonoid M
inst✝² : DecidableEq ι
inst✝¹ : AddMonoid ι
inst✝ : CommSemiring R
f : M →+ ι
m : M
r : R
⊢ Finsupp.single (↑Multiplicative.toAdd (↑Multiplicative.ofAdd m)) r =
    ↑(GradedMonoid.mk (↑f m)
          { val := Finsupp.single m r, property := (_ : Finsupp.single m r ∈ gradeBy R (↑f) (↑f m)) }).snd
case h
M : Type u_1
ι : Type u_2
R : Type u_3
inst✝⁴ : DecidableEq M
inst✝³ : AddMonoid M
inst✝² : DecidableEq ι
inst✝¹ : AddMonoid ι
inst✝ : CommSemiring R
f : M →+ ι
m : M
r : R
⊢ Finsupp.single (↑Multiplicative.toAdd (↑Multiplicative.ofAdd m)) (r * 1) =
    ↑(GradedMonoid.mk (↑f m)
          { val := Finsupp.single m r, property := (_ : Finsupp.single m r ∈ gradeBy R (↑f) (↑f m)) }).snd
rw [mul_one]
no goals
case h
M : Type u_1
ι : Type u_2
R : Type u_3
inst✝⁴ : DecidableEq M
inst✝³ : AddMonoid M
inst✝² : DecidableEq ι
inst✝¹ : AddMonoid ι
inst✝ : CommSemiring R
f : M →+ ι
m : M
r : R
⊢ Finsupp.single (↑Multiplicative.toAdd (↑Multiplicative.ofAdd m)) r =
    ↑(GradedMonoid.mk (↑f m)
          { val := Finsupp.single m r, property := (_ : Finsupp.single m r ∈ gradeBy R (↑f) (↑f m)) }).snd
rfl