leanprover-community / leanprover-community/mathlib4
Tracking Issue: Naming consistency
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 4.2k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
This is a tracking issue for naming inconsistencies. It is intended as a location for people to post naming inconsistencies they don't have bandwidth to fix, and for contributors or new users with free time to find ideas for making the naming system of Mathlib more coherent.
Other contributors should feel free to edit this comment to add items to it.
-
Develop PR #11385 into something that will identify inconsistencies between different, but semantically similar, namespaces.
-
Polynomial.monomial_mul_monomialis analogous toMvPolynomial.monomial_mul? -
Finset.pred_card_le_card_erase: Why does this use- 1instead ofpredwhenpredrather thansub_oneis in the name?- Seems that either
- The name of this lemma should be changed
- The lemma should be changed to use
pred
- Seems that either
-
We have
Finset.sum_add_distrib, but we also have a number of lemmas named more likesum_add. -
Closure operations refer to base relation constructor differently
EqvGenusesrelfor the base relation constructorRelation.ReflGenusessinglefor the base relation constructorRelation.TransGenusessingletooconGenusesoffor the base relation constructor.
-
OrderedSubhas a field with the substringtsubbut as far as I can tell, this subtraction is not necessarily truncated. -
Monotonicity
- We seem to have lemmas proving
Monotonefor various functions named with the formsmonotone_fooandbar_monotone, seems like we could choose one form for consistency.
- We seem to have lemmas proving
-
The
List.sumfunction is sometimes referred to in lemma names bylist_sumand sometimes bylistSum -
The contents of
Algebra/BigOperators/Group/*mainly referenceMonoids, rather thanGroups. (see here #22145 and zulip #mathlib4 > long files @ 💬)- The directory should be renamed
Algebra/BigOperators/Monoid/* - Lemmas that really are about groups should be then brought back to a new
Algebra/BigOperators/Group/*
- The directory should be renamed
-
tsum_geometric_nnreal seems like it should be named
NNReal.tsum_geometric -
LinearEquiv.prod should be
LinearEquiv.prodCongrinstead: #24145 renames this -
Make the lower-case form of
AEStronglyMeasurableconsistent: #mathlib4 > Naming convention @ 💬; might need further discussion -
Should Prod.swap_prod_mk and friends be renamed to
Prod.swap_prodMk? Still being discussed on zulip -
Both
inv_twoandtwo_invappear in lemma names. We should make a consistent naming format for postfix functions like this. -
EReal.add_pos does not seem to have an analogue for(I guess this makes sense because of the generic add_pos, but this still feels odd to me somehow, see discussion below)Real -
Nat.digits_len- spelling out "length" seems to be the more normal way to referenceList.lengthin a lemma name.
In general, this zulip thread may have further not-yet-resolved naming questions on them. (It may be necessary to gather consensus of those first.)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the unchecked items in this tracking issue and inspect the linked definitions in Mathlib/Algebra/Polynomial/Basic.html, Mathlib/Data/Finset/Card.html, Mathlib/Logic/Relation.html, and the other referenced files. Review the linked Zulip discussions and related issues before choosing one item; done means consensus on a specific naming change and a focused change with the affected references updated.
Written by the indexing model from the issue text.
Assessment
- Domain
- developer-experience, tooling
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100