Zulip Chat Archive

Stream: Is there code for X?

Topic: neg_zero for has_distrib_neg


Eric Rodriguez (Mar 29 2022 at 18:28):

do we have this somehwere already? else, should it be near the definition of docs#has_distrib_neg?

import algebra.algebra.basic

example {α} [mul_zero_class α] [has_distrib_neg α] : (-0 : α) = 0 :=
begin
  nth_rewrite 0 [zero_mul (0 : α)],
  rw [neg_mul, mul_zero]
end

Eric Wieser (Mar 29 2022 at 19:18):

Pretty sure that's missing, I didn't think of it when I wrote has_distrib_neg

Eric Rodriguez (Mar 29 2022 at 19:41):

#13049

Eric Wieser (Mar 29 2022 at 20:06):

Oh, the downside here is that this isn't just a generalization of docs#neg_zero

Eric Wieser (Mar 29 2022 at 20:07):

This is for your sign PR I assume?

Yaël Dillies (Mar 29 2022 at 20:07):

Soon, the has_neg_zero typeclass :rofl:

Eric Rodriguez (Mar 29 2022 at 20:30):

yeah, it's a shame :/ but yes, it is for sign


Last updated: Dec 20 2023 at 11:08 UTC