Zulip Chat Archive
Stream: mathlib4
Topic: Deprecated since 2022
Yury G. Kudryashov (Jun 07 2024 at 20:03):
I'm looking at the definitions and lemmas deprecated since 2022. In some cases, it's not clear what's the substitute. E.g., what about docs#castPosNum and nearby definitions?
Yury G. Kudryashov (Jun 07 2024 at 20:58):
According to #607, these defs are deprecated because they use bit0
and bit1
. I'm going to unfold bit*
in their definitions instead of deleting them.
Michael Rothgang (Jun 07 2024 at 21:11):
Thank you for looking into this. Just as a data point: I tried simply removing these declarations - this failed; they are used somewhere in mathlib.
Jon Eugster (Jun 07 2024 at 22:30):
I remember that during the port it was definitely a thing to blindly add deprecation attrs to anything using bit*
without much thinking about whether the statement is used or not. So it may well be that your approach of avoiding to use bit*
is completely correct and the deprecation attr may therefore be removed again?
Johan Commelin (Jun 08 2024 at 04:09):
That sounds very reasonable to me.
Yury G. Kudryashov (Jun 08 2024 at 05:52):
About Num
: I started #13627 but marked it as help-wanted
and please-adopt
. The lazy way is to disable the linter in the Lemmas
file again. The proper way is to drop all references to bit0
and bit1
in that file.
Yury G. Kudryashov (Jun 14 2024 at 06:12):
@Mario Carneiro What do you want to happen to docs#bit0 and docs#bit1 ? They are no longer used for numeric literals but they are used for docs#Num, authored by (according to the copyright header) Leo and you. I assume that if Leo cared about it, he would move it to core, so probably you're the person who cares most about this file and its dependencies.
Mario Carneiro (Jun 14 2024 at 21:17):
you should just be able to replace bit0 n
and bit1 n
with 2*n
and 2*n+1
respectively. They are not used in any way in Num
incompatibly with that
Mario Carneiro (Jun 14 2024 at 21:17):
although Num
has constructors named bit0
and bit1
which should be left as is
Yury G. Kudryashov (Jun 14 2024 at 21:17):
What's the right binary recursion in Lean 4?
Mario Carneiro (Jun 14 2024 at 21:18):
the same one?
Mario Carneiro (Jun 14 2024 at 21:18):
IIRC Nat.binaryRecOn
still exists
Yury G. Kudryashov (Jun 14 2024 at 21:19):
OK
Last updated: May 02 2025 at 03:31 UTC