Lean4
@[to_additive]
instance : Semigroup (AssocQuotient α)
where
mul x
y := by
refine Quot.liftOn₂ x y (fun x y ↦ Quot.mk _ (x * y)) ?_ ?_
· rintro a b₁ b₂ (⟨c, d, e⟩ | ⟨c, d, e, f⟩) <;> simp only
· exact quot_mk_assoc_left _ _ _ _
· rw [← quot_mk_assoc, quot_mk_assoc_left, quot_mk_assoc]
· rintro a₁ a₂ b (⟨c, d, e⟩ | ⟨c, d, e, f⟩) <;> simp only
· simp only [quot_mk_assoc, quot_mk_assoc_left]
·
rw [quot_mk_assoc, quot_mk_assoc, quot_mk_assoc_left, quot_mk_assoc_left, quot_mk_assoc_left, ←
quot_mk_assoc c d, ← quot_mk_assoc c d, quot_mk_assoc_left]
mul_assoc x y z := Quot.induction_on₃ x y z fun a b c ↦ quot_mk_assoc a b c