Zulip Chat Archive

Stream: mathlib4

Topic: congr_arg not unifying HMul


Yakov Pechersky (Nov 10 2022 at 23:39):

Consider:

variable [Mul α]

example (a b c : α) : a = c  a * b = c * b :=
  congrArg _ -- doesn't work

example (a b c : α) : a = c  a * b = c * b :=
  congrArg (· * b) -- does work, because resolves the HMul problem

example (a b c : α) : a = c  b * a = b * c :=
  congrArg _ -- left-multiplication works

Does one now always need to assist in unification of right-multiplication?

Mario Carneiro (Nov 11 2022 at 04:06):

I wouldn't really expect that to work. Does it work in lean 3?

Mario Carneiro (Nov 11 2022 at 04:07):

my recollection is that you almost always have to give the function like in your second example (the third example is a fairly rare case)


Last updated: Dec 20 2023 at 11:08 UTC