Zulip Chat Archive

Stream: new members

Topic: Should has_neg be implied by mul_action?


Eric Wieser (Jun 29 2020 at 10:05):

As in title. If I have mul_action A B and has_neg A, should lean provide has_neg B for me?

def neg (b : B) := smul (-1 : A) b

Johan Commelin (Jun 29 2020 at 10:06):

No, due to limitations in type class search, this is (unfortunately!) not possible. It should/might become better in Lean 4

Johan Commelin (Jun 29 2020 at 10:07):

So you will have to

def has_neg_of_mul_action : has_neg B := blabla

and then at the usage site

letI : has_neg B := has_neg_of_mul_action A B,

Eric Wieser (Jun 29 2020 at 10:08):

would has_neg_of_mul_action be a sensible addition to mathlib?

Johan Commelin (Jun 29 2020 at 10:09):

I guess so. Is there more structure around? Just a has_neg without information on how it interacts with other structure doesn't seem very useful.

Eric Wieser (Jun 29 2020 at 10:20):

Not really, it just seems awkward to be unable to write -b, and have to use (-1 : A) • b instead

Scott Morrison (Jun 29 2020 at 11:14):

What is the situation you're working in? It seems a bit strange if you have a has_neg A but no other structure.

Eric Wieser (Jun 29 2020 at 11:50):

I also have field A. What I meant was that B has little other structure.


Last updated: Dec 20 2023 at 11:08 UTC