Zulip Chat Archive

Stream: general

Topic: export?


Kevin Buzzard (Jun 13 2018 at 08:03):

From lean core:

Kevin Buzzard (Jun 13 2018 at 08:03):

class has_pow (α : Type u) (β : Type v) :=
(pow : α  β  α)

export has_andthen (andthen)
export has_pow (pow)

Kevin Buzzard (Jun 13 2018 at 08:03):

What does export do? The line reminds me of those old batman TV shows.

Kenny Lau (Jun 13 2018 at 08:04):

like open

Kevin Buzzard (Jun 13 2018 at 08:04):

oh I just remembered #help

Kevin Buzzard (Jun 13 2018 at 08:05):

export: create aliases for declarations

Kevin Buzzard (Jun 13 2018 at 08:05):

At the end of the day, does this just mean that pow can be used instead of has_pow.pow?

Kevin Buzzard (Jun 13 2018 at 08:06):

Aah -- does it mean that this is true globally?

Kevin Buzzard (Jun 13 2018 at 08:06):

I see -- #check pow seems to work fine in a new file

Kevin Buzzard (Jun 13 2018 at 08:07):

so it's open on steroids

Kevin Buzzard (Jun 13 2018 at 08:07):

"open and never close"?

Johan Commelin (Jun 13 2018 at 08:09):

No, I guess that is an artifact of the fact that it is in core.

Johan Commelin (Jun 13 2018 at 08:09):

Hmm, no... that is not what I meant.

Sebastian Ullrich (Jun 13 2018 at 08:09):

"open and never close"?

Yes, basically. You can locally "close" it with hide.

Kevin Buzzard (Jun 13 2018 at 08:10):

Thanks Sebastian.

Kevin Buzzard (Jun 13 2018 at 08:12):

The reason I asked was that I noticed that if I import tactic.ring then I can do a ^ 2 for a in a comm_ring, but I can't do this otherwise. I was just trying to figure out where that instance was defined, but I don't know how to do this, short of looking at what tactic.ring imports and importing all of those things instead, until I finally find the import which actually makes it work.

Kevin Buzzard (Jun 13 2018 at 08:12):

That's one approach -- and searching for has_pow.pow is another, but actually I should just search for pow perhaps

Kevin Buzzard (Jun 13 2018 at 08:13):

Got it -- obviously to get powers in a ring the key import is group_power.lean ;-)

Kevin Buzzard (Jun 13 2018 at 08:13):

[mumble mumble monoid]


Last updated: Dec 20 2023 at 11:08 UTC