Zulip Chat Archive

Stream: Is there code for X?

Topic: difference of squares of commuting elements


Eric Wieser (Feb 28 2022 at 16:47):

Does something like this exist anywhere?

lemma commute.mul_self_sub_mul_self_eq {R} [ring R] {a b : R}(h : commute a b) :
  a * a - b * b = (a + b) * (a - b) :=
begin
  rw [add_mul, mul_sub, mul_sub, h.eq],
  abel,
end

lemma commute.mul_self_sub_mul_self_eq' {R} [ring R] {a b : R} (h : commute a b) :
  a * a - b * b = (a - b) * (a + b) :=
begin
  rw [mul_add, sub_mul, sub_mul, h.eq],
  abel,
end

Eric Wieser (Feb 28 2022 at 16:47):

docs#mul_self_sub_mul_self exists but requires commutativity

Eric Wieser (Mar 01 2022 at 11:03):

#12366

Johan Commelin (Mar 01 2022 at 11:05):

Does it make sense to flip these, and call them commute.add_mul_sub_eq and commute.sub_mul_add_eq?

Eric Wieser (Mar 01 2022 at 11:37):

I was certainly tempted to do that

Eric Wieser (Mar 01 2022 at 11:37):

Although arguably add_mul_sub is more ambiguous than mul_self_sub_mul_self

Eric Wieser (Mar 01 2022 at 12:04):

I figured that whoever added the lemma in the first place probably thought of that name too, and since I didn't feel that strongly I'd just leave it unchanged.


Last updated: Dec 20 2023 at 11:08 UTC