Theorem: DirectSum.mul_assoc
File: Mathlib/Algebra/DirectSum/Ring.lean

tactic: suffices (mulHom A).compHom.comp (mulHom A) =
    (AddMonoidHom.compHom flipHom <| (mulHom A).flip.compHom.comp (mulHom A)).flip by
    have sol := FunLike.congr_fun (FunLike.congr_fun (FunLike.congr_fun this a) b) c
    have aux : ∀ a b, (mulHom A) a b = a * b := fun _ _ ↦ rfl
    simp only [coe_comp, Function.comp_apply, AddMonoidHom.compHom_apply_apply, aux, flip_apply,
      AddMonoidHom.flipHom_apply] at sol
    exact sol
state_before: ι : Type u_1
inst✝³ : DecidableEq ι
A : ι → Type u_2
inst✝² : (i : ι) → AddCommMonoid (A i)
inst✝¹ : AddMonoid ι
inst✝ : GSemiring A
a b c : ⨁ (i : ι), A i
⊢ a * b * c = a * (b * c)

tactic: refine DirectSum.addHom_ext' (fun ai ↦ AddMonoidHom.ext (fun ax ↦ ?_))
state_before: ι : Type u_1
inst✝³ : DecidableEq ι
A : ι → Type u_2
inst✝² : (i : ι) → AddCommMonoid (A i)
inst✝¹ : AddMonoid ι
inst✝ : GSemiring A
a b c : ⨁ (i : ι), A i
⊢ AddMonoidHom.comp (↑compHom (mulHom A)) (mulHom A) =
    AddMonoidHom.flip (↑(↑compHom flipHom) (AddMonoidHom.comp (↑compHom (AddMonoidHom.flip (mulHom A))) (mulHom A)))

tactic: refine DirectSum.addHom_ext' (fun bi ↦ AddMonoidHom.ext (fun bx ↦ ?_))
state_before: ι : Type u_1
inst✝³ : DecidableEq ι
A : ι → Type u_2
inst✝² : (i : ι) → AddCommMonoid (A i)
inst✝¹ : AddMonoid ι
inst✝ : GSemiring A
a b c : ⨁ (i : ι), A i
ai : ι
ax : A ai
⊢ ↑(AddMonoidHom.comp (AddMonoidHom.comp (↑compHom (mulHom A)) (mulHom A)) (of (fun i => A i) ai)) ax =
    ↑(AddMonoidHom.comp
          (AddMonoidHom.flip
            (↑(↑compHom flipHom) (AddMonoidHom.comp (↑compHom (AddMonoidHom.flip (mulHom A))) (mulHom A))))
          (of (fun i => A i) ai))
      ax

tactic: refine DirectSum.addHom_ext' (fun ci ↦ AddMonoidHom.ext (fun cx ↦ ?_))
state_before: ι : Type u_1
inst✝³ : DecidableEq ι
A : ι → Type u_2
inst✝² : (i : ι) → AddCommMonoid (A i)
inst✝¹ : AddMonoid ι
inst✝ : GSemiring A
a b c : ⨁ (i : ι), A i
ai : ι
ax : A ai
bi : ι
bx : A bi
⊢ ↑(AddMonoidHom.comp
          (↑(AddMonoidHom.comp (AddMonoidHom.comp (↑compHom (mulHom A)) (mulHom A)) (of (fun i => A i) ai)) ax)
          (of (fun i => A i) bi))
      bx =
    ↑(AddMonoidHom.comp
          (↑(AddMonoidHom.comp
                (AddMonoidHom.flip
                  (↑(↑compHom flipHom) (AddMonoidHom.comp (↑compHom (AddMonoidHom.flip (mulHom A))) (mulHom A))))
                (of (fun i => A i) ai))
            ax)
          (of (fun i => A i) bi))
      bx

tactic: dsimp only [coe_comp, Function.comp_apply, AddMonoidHom.compHom_apply_apply, flip_apply,
  AddMonoidHom.flipHom_apply]
state_before: ι : Type u_1
inst✝³ : DecidableEq ι
A : ι → Type u_2
inst✝² : (i : ι) → AddCommMonoid (A i)
inst✝¹ : AddMonoid ι
inst✝ : GSemiring A
a b c : ⨁ (i : ι), A i
ai : ι
ax : A ai
bi : ι
bx : A bi
ci : ι
cx : A ci
⊢ ↑(AddMonoidHom.comp
          (↑(AddMonoidHom.comp
                (↑(AddMonoidHom.comp (AddMonoidHom.comp (↑compHom (mulHom A)) (mulHom A)) (of (fun i => A i) ai)) ax)
                (of (fun i => A i) bi))
            bx)
          (of (fun i => A i) ci))
      cx =
    ↑(AddMonoidHom.comp
          (↑(AddMonoidHom.comp
                (↑(AddMonoidHom.comp
                      (AddMonoidHom.flip
                        (↑(↑compHom flipHom) (AddMonoidHom.comp (↑compHom (AddMonoidHom.flip (mulHom A))) (mulHom A))))
                      (of (fun i => A i) ai))
                  ax)
                (of (fun i => A i) bi))
            bx)
          (of (fun i => A i) ci))
      cx

tactic: simp_rw [mulHom_of_of]
state_before: ι : Type u_1
inst✝³ : DecidableEq ι
A : ι → Type u_2
inst✝² : (i : ι) → AddCommMonoid (A i)
inst✝¹ : AddMonoid ι
inst✝ : GSemiring A
a b c : ⨁ (i : ι), A i
ai : ι
ax : A ai
bi : ι
bx : A bi
ci : ι
cx : A ci
⊢ ↑(↑(mulHom A) (↑(↑(mulHom A) (↑(of (fun i => A i) ai) ax)) (↑(of (fun i => A i) bi) bx)))
      (↑(of (fun i => A i) ci) cx) =
    ↑(↑(mulHom A) (↑(of (fun i => A i) ai) ax))
      (↑(↑(mulHom A) (↑(of (fun i => A i) bi) bx)) (↑(of (fun i => A i) ci) cx))

tactic: exact of_eq_of_gradedMonoid_eq (_root_.mul_assoc (GradedMonoid.mk ai ax) ⟨bi, bx⟩ ⟨ci, cx⟩)
state_before: ι : Type u_1
inst✝³ : DecidableEq ι
A : ι → Type u_2
inst✝² : (i : ι) → AddCommMonoid (A i)
inst✝¹ : AddMonoid ι
inst✝ : GSemiring A
a b c : ⨁ (i : ι), A i
ai : ι
ax : A ai
bi : ι
bx : A bi
ci : ι
cx : A ci
⊢ ↑(of A (ai + bi + ci)) (GradedMonoid.GMul.mul (GradedMonoid.GMul.mul ax bx) cx) =
    ↑(of A (ai + (bi + ci))) (GradedMonoid.GMul.mul ax (GradedMonoid.GMul.mul bx cx))

tactic: have sol := FunLike.congr_fun (FunLike.congr_fun (FunLike.congr_fun this a) b) c
state_before: ι : Type u_1
inst✝³ : DecidableEq ι
A : ι → Type u_2
inst✝² : (i : ι) → AddCommMonoid (A i)
inst✝¹ : AddMonoid ι
inst✝ : GSemiring A
a b c : ⨁ (i : ι), A i
this :
  AddMonoidHom.comp (↑compHom (mulHom A)) (mulHom A) =
    AddMonoidHom.flip (↑(↑compHom flipHom) (AddMonoidHom.comp (↑compHom (AddMonoidHom.flip (mulHom A))) (mulHom A)))
⊢ a * b * c = a * (b * c)

tactic: have aux : ∀ a b, (mulHom A) a b = a * b := fun _ _ ↦ rfl
state_before: ι : Type u_1
inst✝³ : DecidableEq ι
A : ι → Type u_2
inst✝² : (i : ι) → AddCommMonoid (A i)
inst✝¹ : AddMonoid ι
inst✝ : GSemiring A
a b c : ⨁ (i : ι), A i
this :
  AddMonoidHom.comp (↑compHom (mulHom A)) (mulHom A) =
    AddMonoidHom.flip (↑(↑compHom flipHom) (AddMonoidHom.comp (↑compHom (AddMonoidHom.flip (mulHom A))) (mulHom A)))
sol :
  ↑(↑(↑(AddMonoidHom.comp (↑compHom (mulHom A)) (mulHom A)) a) b) c =
    ↑(↑(↑(AddMonoidHom.flip
                  (↑(↑compHom flipHom) (AddMonoidHom.comp (↑compHom (AddMonoidHom.flip (mulHom A))) (mulHom A))))
              a)
          b)
      c
⊢ a * b * c = a * (b * c)

tactic: simp only [coe_comp, Function.comp_apply, AddMonoidHom.compHom_apply_apply, aux, flip_apply,
  AddMonoidHom.flipHom_apply] at sol
state_before: ι : Type u_1
inst✝³ : DecidableEq ι
A : ι → Type u_2
inst✝² : (i : ι) → AddCommMonoid (A i)
inst✝¹ : AddMonoid ι
inst✝ : GSemiring A
a b c : ⨁ (i : ι), A i
this :
  AddMonoidHom.comp (↑compHom (mulHom A)) (mulHom A) =
    AddMonoidHom.flip (↑(↑compHom flipHom) (AddMonoidHom.comp (↑compHom (AddMonoidHom.flip (mulHom A))) (mulHom A)))
sol :
  ↑(↑(↑(AddMonoidHom.comp (↑compHom (mulHom A)) (mulHom A)) a) b) c =
    ↑(↑(↑(AddMonoidHom.flip
                  (↑(↑compHom flipHom) (AddMonoidHom.comp (↑compHom (AddMonoidHom.flip (mulHom A))) (mulHom A))))
              a)
          b)
      c
aux : ∀ (a b : ⨁ (i : ι), A i), ↑(↑(mulHom A) a) b = a * b
⊢ a * b * c = a * (b * c)

tactic: exact sol
state_before: ι : Type u_1
inst✝³ : DecidableEq ι
A : ι → Type u_2
inst✝² : (i : ι) → AddCommMonoid (A i)
inst✝¹ : AddMonoid ι
inst✝ : GSemiring A
a b c : ⨁ (i : ι), A i
this :
  AddMonoidHom.comp (↑compHom (mulHom A)) (mulHom A) =
    AddMonoidHom.flip (↑(↑compHom flipHom) (AddMonoidHom.comp (↑compHom (AddMonoidHom.flip (mulHom A))) (mulHom A)))
aux : ∀ (a b : ⨁ (i : ι), A i), ↑(↑(mulHom A) a) b = a * b
sol : a * b * c = a * (b * c)
⊢ a * b * c = a * (b * c)