Zulip Chat Archive
Stream: mathlib4
Topic: Replace Nat.multichoose with Ring.multichoose?
Scott Carnahan (Mar 29 2024 at 16:52):
In a comment attached to #6934, @Yaël Dillies suggested eventually replacing Nat.multichoose with Ring.multichoose. I tried in in a branch back in December 2023, and the main effect was the addition of Mathlib.RingTheory.Binomial as an import to Mathlib.Data.List.Sym (along with some minor alterations to proofs). Is that considered an acceptable cost?
Kyle Miller (Mar 29 2024 at 17:01):
My gut feeling is that it's good to keep a "low-brow" definition, especially if it keeps imports low. Instead, we could have simp lemmas that transform the Nat definition into the general Ring one. Happy to hear other opinions.
Yaël Dillies (Mar 29 2024 at 17:09):
With my sublibrary carver hat (a pretty recent hat!) on, I must say that docs#Nat.multichoose is actually pretty close to being eligible for Std, so I want to retract my previous statement and claim that actually it's fine/better to have both
Scott Carnahan (Mar 29 2024 at 17:11):
Thank you. I'm glad I asked here.
Eric Wieser (Mar 29 2024 at 20:44):
Is the answer here to have a HasMultichoose
typeclass?
Eric Wieser (Mar 29 2024 at 20:44):
That way we don't have to rewrite between the definitions
Eric Wieser (Mar 29 2024 at 20:44):
(and this is just a base class of the docs#BinomialRing typeclass we already have)
Last updated: May 02 2025 at 03:31 UTC