Zulip Chat Archive
Stream: mathlib4
Topic: Unscoped `sq`
Artie Khovanov (Jan 16 2026 at 03:18):
Why is the lemma sq (alias of pow_two) unscoped? I think this name hould be deprecated.
Yury G. Kudryashov (Jan 16 2026 at 03:36):
The alias was introduced by @Benjamin Davidson in !3#7368
Yury G. Kudryashov (Jan 16 2026 at 03:36):
CC: @Kim Morrison @Eric Wieser
Ruben Van de Velde (Jan 16 2026 at 06:49):
Why should it be deprecated?
Yury G. Kudryashov (Jan 16 2026 at 06:59):
I guess, @Artie Khovanov thinks that it's too generic to be in the root namespace. On the one hand, it has no conflicts in Mathlib (yet). OTOH, this may be inconvenient for downstream projects.
Ruben Van de Velde (Jan 16 2026 at 07:00):
I could see arguments along those lines, but think they should be made rather than implied :)
Yury G. Kudryashov (Jan 16 2026 at 07:00):
Note: right now, I'm too sleepy to decide what I think about it.
Artie Khovanov (Jan 16 2026 at 12:27):
I'm saying having "sq" be a lemma in the root namespace is bad! For instance I have an inductive class with constructor sq.
Eric Wieser (Jan 16 2026 at 14:41):
Why does a global sq clash with an inductive constructor?
Eric Wieser (Jan 16 2026 at 14:41):
(Note that I agree that sq is a weird thing to have in the root namespace; not least because it's just a bad lemma name)
Edward van de Meent (Jan 16 2026 at 14:43):
e.g. inside of the namespace List, you want cons to refer to List.cons rather than getting an error that it's ambiguous because _root_.cons also exists
Alex Meiburg (Jan 16 2026 at 16:33):
Would it be better to name it sq_eq_mul or similar? Scoping it? Removing it entirely?
Artie Khovanov (Jan 16 2026 at 16:34):
I would advocate for removing the alias. Whether we rename pow_two to sq_eq.* is a separate question imo.
Eric Wieser (Jan 16 2026 at 16:53):
We have a lot of sq aliases for other lemmas
Eric Wieser (Jan 16 2026 at 16:54):
I think renaming sq to sq_eq would be enough
Eric Wieser (Jan 16 2026 at 16:54):
It seems weird to me to have a lemma name that consists of only one token
Eric Wieser (Jan 16 2026 at 16:54):
Not least because with only one token you're fighting for names with definitions.
Artie Khovanov (Jan 16 2026 at 17:03):
That's fair, let's do that
Violeta Hernández (Jan 16 2026 at 17:09):
sq feels weird to me. We don't have an alias twice.
Eric Wieser (Jan 16 2026 at 17:17):
Allowing sq as a token lets us ever so slightly reduce the insanity of the name of Pythagoras' theorem
Last updated: Feb 28 2026 at 14:05 UTC