Zulip Chat Archive

Stream: mathlib4

Topic: Documentation messed up for Submonoid.units


Wrenna Robson (Feb 14 2024 at 20:28):

I recently merged a PR adding GroupTheory/Submonoid/Units.lean. Unfortunately the documentation does not look as expected.

docs#Submonoid.units

In particular:
a) the Markdown table has not rendered as expected (despite rendering fine in separate markdown files)
b) I feel as if the "to_additives" have added a lot of extraneous proofs which, apart from anything else, make the page quite hard to read.

I want to address both of these but I don't know how. Any help?

Wrenna Robson (Feb 14 2024 at 20:31):

What on earth is going on with docs#AddSubmonoid.ofAddUnits_addUnits_le.match_1, for instance?

Jireh Loreaux (Feb 14 2024 at 21:04):

Markdown tables have different syntax depending on the parser. I can't remember which one we use, but that's my best guess without really diving in.

Jireh Loreaux (Feb 14 2024 at 21:04):

The to_additive seems like a doc-gen issue, @Henrik Böving ?

Wrenna Robson (Feb 14 2024 at 21:07):

It might be I got the configuration of to_additive wrong of course.

Reflecting in what went wrong here, btw, I realise I rarely build and look at documentation as I go, and I'm not even sure if this is part of the CI?

Henrik Böving (Feb 14 2024 at 21:30):

I don't have any special handling for to_additive in doc-gen.

Wrenna Robson (Feb 14 2024 at 21:36):

So these strange additional theorems, they must be created by to_additive itself

Henrik Böving (Feb 14 2024 at 21:38):

I think match_1 is just generated by the equation compiler

Wrenna Robson (Feb 14 2024 at 21:38):

Right. But I don't seem to have one for the originals - only the additive versions.

Ruben Van de Velde (Feb 14 2024 at 21:41):

I think it's more likely that they also exist for the multiplicative versions, but doc-gen successfully filters them out

Wrenna Robson (Feb 14 2024 at 21:41):

Aha.

Ruben Van de Velde (Feb 14 2024 at 21:41):

I think it's more likely that they also exist for the multiplicative versions, but doc-gen successfully filters them out

Wrenna Robson (Feb 14 2024 at 21:42):

So why wouldn't it filter them out for the additive versions?

Ruben Van de Velde (Feb 14 2024 at 21:43):

Maybe some metadata gets lost in translation? I'm not sure

Henrik Böving (Feb 14 2024 at 21:45):

https://github.com/leanprover/doc-gen4/blob/780bbec107cba79d18ec55ac2be3907a77f27f98/DocGen4/Process/DocInfo.lean#L120-L130 this is the logic for filtering

Ruben Van de Velde (Feb 14 2024 at 21:51):

I think declName.isInternal is supposed to catch those

Eric Wieser (Feb 14 2024 at 22:09):

Jireh Loreaux said:

Markdown tables have different syntax depending on the parser. I can't remember which one we use, but that's my best guess without really diving in.

Tables are not part of https://spec.commonmark.org/0.31.2/, and the doc-gen4 markdown parser is the reference implementation of the spec with some math hacked on, which is much less feature-rich than what we used in Lean 3

Wrenna Robson (Feb 16 2024 at 12:18):

Bugger

Wrenna Robson (Feb 16 2024 at 12:19):

So we can't do tables at all?

Eric Wieser (Feb 16 2024 at 12:43):

Not till we replace the markdown parser, which we already need to do anyway for non-broken math support

Wrenna Robson (Feb 16 2024 at 12:44):

Fair

Wrenna Robson (Feb 16 2024 at 12:44):

Well, it would also be good to understand why I've had this to_additive issue


Last updated: May 02 2025 at 03:31 UTC