Zulip Chat Archive

Stream: general

Topic: pow/mul associativity


Reid Barton (Dec 13 2021 at 04:07):

What's going on here?
image.png

Bolton Bailey (Dec 13 2021 at 04:08):

docs#pow_mul

Bolton Bailey (Dec 13 2021 at 04:11):

I'm not seeing anything amiss, do you find something surprising about this lemma?

Yakov Pechersky (Dec 13 2021 at 04:12):

That the LHS should look like a ^ (m * n), otherwise it looks like (a ^ m) * n.

Bolton Bailey (Dec 13 2021 at 04:16):

It seems like the parentheses are there in the code, I guess the doc-gen just removes them?

Reid Barton (Dec 13 2021 at 04:20):

docgen uses the pretty printer I think. But Lean itself displays the lemma correctly for me (if I just import the file that contains this lemma). Maybe there is some other notation elsewhere that confuses it?

Yury G. Kudryashov (Dec 13 2021 at 06:16):

What if you import all.lean?

Eric Wieser (Dec 13 2021 at 08:43):

What's the precedence of pow and *?

Kevin Buzzard (Dec 13 2021 at 09:24):

Just to remark that pow is right associative and mul left associative

Eric Wieser (Dec 13 2021 at 09:38):

#print notation ^  -- _ `^`:80 _:79 := has_pow.pow #1 #0
#print notation *  -- _ `*`:70 _:70 := has_mul.mul #1 #

Eric Wieser (Dec 13 2021 at 10:00):

Except, after doc-gen runs open_all_locales to agressively turn on notation, it becomes

#print notation *  -- _ `*`:9001 _:70 := has_mul.mul #1 #0

Eric Wieser (Dec 13 2021 at 10:01):

Which is the fault of this line

Gabriel Ebner (Dec 13 2021 at 10:48):

Feel free to submit a PR to ignore this notation (we already have a long list of ignored localized notation).

Eric Wieser (Dec 13 2021 at 11:07):

Do we want to ignore that notation though, for files about parsers?

Gabriel Ebner (Dec 13 2021 at 11:12):

We can only ignore notations globally in doc-gen, so we don't really have a choice there.

Eric Wieser (Dec 13 2021 at 11:29):

Do you mean that in a "that was the easiest thing to implement" way, or "there is no lean core API that would allow us to do anything different"?

Gabriel Ebner (Dec 13 2021 at 11:45):

In both ways, yes. Right now we generate all documentation in the same tactic call (with the same open locales). Maybe we can now open locales programmatically (using run_parser), but it would be a bit of refactoring.


Last updated: Dec 20 2023 at 11:08 UTC