Zulip Chat Archive

Stream: Is there code for X?

Topic: In a monoid, (gh)^n g = g (hg)^n


Mitchell Lee (Mar 17 2024 at 04:53):

Here's my proof that in a monoid, (gh)ng=g(hg)n(g h)^n g = g (h g)^n.

import Mathlib

example {M : Type} [Monoid M] (g h : M) (n : ) : (g * h) ^ n * g = g * (h * g) ^ n := by
  refine (SemiconjBy.eq (SemiconjBy.pow_right ?_ n)).symm
  unfold SemiconjBy
  group

Any easier way to do it?

Kim Morrison (Mar 17 2024 at 05:05):

I would probably have written

import Mathlib

example {M : Type} [Monoid M] (g h : M) (n : ) : (g * h) ^ n * g = g * (h * g) ^ n := by
  induction n <;> simp_all [pow_succ, mul_assoc]

Last updated: May 02 2025 at 03:31 UTC