Zulip Chat Archive

Stream: mathlib4

Topic: align private decls


Johan Commelin (Dec 21 2022 at 08:16):

(how) should we #align private declarations?

Ruben Van de Velde (Dec 21 2022 at 08:39):

I've removed the #aligns - it's not like they can be used for anything

Reid Barton (Jan 23 2023 at 18:29):

Should we be silently discarding private? Does private exist in Lean 4?

Shreyas Srinivas (Jan 23 2023 at 18:30):

I used this chat as a reference to do just that https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/align.20private.20decls/near/317107099

Shreyas Srinivas (Jan 23 2023 at 18:31):

with a porting note

Shreyas Srinivas (Jan 23 2023 at 18:32):

Lean4 did not allow access to the private def name

Shreyas Srinivas (Jan 23 2023 at 18:32):

It suggested _private.....<def_name>, but that also gave an error.

Shreyas Srinivas (Jan 23 2023 at 18:33):

Reid Barton said:

Should we be silently discarding private? Does private exist in Lean 4?

It is possible that lean4 is complaining that I should not be able to access that def. If so, this suggests that lean 4 definitely recognizes private as a keyword that should restrict access

Mario Carneiro (Jan 23 2023 at 18:37):

yes private exists. Yes we should remove #align on private decls

Reid Barton (Jan 23 2023 at 18:47):

And should they stay private in mathlib 4?

Mario Carneiro (Jan 23 2023 at 18:48):

I think so?

Mario Carneiro (Jan 23 2023 at 18:48):

the effect is basically the same, so I don't see why not

Mario Carneiro (Jan 23 2023 at 18:48):

I mean private declarations are discouraged in mathlib to begin with, but I don't think that the move to lean 4 has anything to do with that

Reid Barton (Jan 23 2023 at 18:49):

Makes sense to me, I was just wondering because I came across a lemma that lost its private modifier in the port.

Mario Carneiro (Jan 23 2023 at 18:49):

hm, mathport didn't do that

Eric Wieser (Jan 23 2023 at 19:00):

Does mathport currently attempt to emit #aligns for private decls?

Shreyas Srinivas (Jan 23 2023 at 19:00):

It did for me.

Ruben Van de Velde (Jan 23 2023 at 19:01):

Yeah, it does

Ruben Van de Velde (Jan 23 2023 at 19:01):

Maybe that's simple enough to fix

Mario Carneiro (Jan 23 2023 at 19:02):

it does (PR's welcome)


Last updated: Dec 20 2023 at 11:08 UTC