Theorem: AddMonoidAlgebra.decomposeAux_single
File: Mathlib/Algebra/MonoidAlgebra/Grading.lean

tactic: refine' (lift_single _ _ _).trans _
state_before: 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)) }

tactic: refine' (DirectSum.of_smul R _ _ _).symm.trans _
state_before: 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)) }

tactic: apply DirectSum.of_eq_of_gradedMonoid_eq
state_before: 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)) }

tactic: refine' Sigma.subtype_ext rfl _
state_before: 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)) }

tactic: refine' (Finsupp.smul_single' _ _ _).trans _
state_before: 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

tactic: rw [mul_one]
state_before: 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

tactic: rfl
state_before: 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