Zulip Chat Archive

Stream: new members

Topic: Using mul_assoc on middle values


Shadman Sakib (Jul 23 2021 at 03:06):

Hi, how would I manipulate mul_assoc to encapsulate the middle values of an equation in parenthesis?

Shadman Sakib (Jul 23 2021 at 03:06):

import analysis.complex.circle
import group_theory.specific_groups.dihedral
import analysis.special_functions.trigonometric

lemma mid_mul_assoc (a b c d: ) : a * b * c * d  = a * (b * c) * d :=
begin
  sorry,
end

Adam Topaz (Jul 23 2021 at 03:11):

When rewriting, you can use mul_assoc a b c to specify exactly what three variables to apply the lemma to. I would just use simp [mul_assoc] to associate everything in sight, and that should close the goal

Shadman Sakib (Jul 23 2021 at 03:16):

Ahh okay, thank you!

Yakov Pechersky (Jul 23 2021 at 03:18):

There is also the tactic ac_refl, which uses available associativity lemmas to find a rfl proof. Underused in mathlib


Last updated: Dec 20 2023 at 11:08 UTC