Skip to content

chore: replace _aux with Aux in defs with no other underscores#40227

Open
thorimur wants to merge 1 commit into
leanprover-community:masterfrom
thorimur:_aux-to-Aux
Open

chore: replace _aux with Aux in defs with no other underscores#40227
thorimur wants to merge 1 commit into
leanprover-community:masterfrom
thorimur:_aux-to-Aux

Conversation

@thorimur
Copy link
Copy Markdown
Contributor

@thorimur thorimur commented Jun 4, 2026

Found by regex (def [^_]*_aux), and hand-replaced to avoid false positives.

Usually, _aux defs with more than one underscore are named after other out-of-convention defs, so we don't touch those cases here.

(Some of these are private, but naming is also a source readability concern, not just a public API concern.)


Open in Gitpod

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 4, 2026

PR summary 65d0212d7b

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

+ coeff_truncAux
+ d₂₃Aux
+ mapEquivAux
+ removeNoneAux
+ removeNoneAux_inv
+ removeNoneAux_none
+ removeNoneAux_some
+ sModNatAux
+ sModNatAux_eq
+ toStringAux
+ truncAux
- coeff_trunc_aux
- d₂₃_aux
- mapEquiv_aux
- removeNone_aux
- removeNone_aux_inv
- removeNone_aux_none
- removeNone_aux_some
- sModNat_aux
- sModNat_aux_eq
- toString_aux
- trunc_aux

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean -- pending)

Computed after the build finishes.


No changes to strong technical debt.
No changes to weak technical debt.

Current commit 65d0212d7b
Reference commit 7eaeb73d37

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@thorimur thorimur temporarily deployed to cache-upload-forks June 4, 2026 15:42 — with GitHub Actions Inactive
Copy link
Copy Markdown
Contributor

@grunweg grunweg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this! My biggest comment is that some of these renames probably require deprecations. (If you want to make some of them private first, perhaps you can omit that step :-))

There is some equivalence between `m` and `m.map f` which respects `f`.
-/
def mapEquiv_aux (m : Multiset α) (f : α → β) :
def mapEquivAux (m : Multiset α) (f : α → β) :
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need a deprecation? (and/or a TODO to make private)

we also have a value on the other side of the equivalence
-/
def removeNone_aux (x : α) : β :=
def removeNoneAux (x : α) : β :=
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

theorem removeNone_aux_some {x : α} (h : ∃ x', e (some x) = some x') :
some (removeNone_aux e x) = e (some x) := by
simp [removeNone_aux, Option.isSome_iff_exists.mpr h]
theorem removeNoneAux_some {x : α} (h : ∃ x', e (some x) = some x') :
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

theorem removeNone_aux_none {x : α} (h : e (some x) = none) :
some (removeNone_aux e x) = e none := by
simp [removeNone_aux, Option.not_isSome_iff_eq_none.mpr h]
theorem removeNoneAux_none {x : α} (h : e (some x) = none) :
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

some (removeNoneAux e x) = e none := by
simp [removeNoneAux, Option.not_isSome_iff_eq_none.mpr h]

theorem removeNone_aux_inv (x : α) : removeNone_aux e.symm (removeNone_aux e x) = x :=
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here... and this declaration is mis-named (pre-existing; leaving a TODO is fine with me)

@@ -650,28 +650,28 @@ termination_by structural x => x
Generalization of `sModNat` with arbitrary base case,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the rename in the nolints file, then we're all happy :-)

useful for proving `sModNatTR` and `sModNat` agree.
-/
def sModNat_aux (b q : ℕ) : ℕ → ℕ
def sModNatAux (b q : ℕ) : ℕ → ℕ
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deprecate?

This produces `2^n` branches when there are `n` such hypotheses in the input.
-/
partial def removeNe_aux : MVarId → List Expr → MetaM (List Branch) := fun g hs => do
partial def removeNeAux : MVarId → List Expr → MetaM (List Branch) := fun g hs => do
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs deprecation

| i + 1 => (sModNatAux b q i ^ 2 + (q - 2)) % q

theorem sModNat_aux_eq (q k : ℕ) : sModNat_aux (4 % q) q k = sModNat q k := by
theorem sModNatAux_eq (q k : ℕ) : sModNatAux (4 % q) q k = sModNat q k := by
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also here

@grunweg grunweg added awaiting-author A reviewer has asked the author a question or requested changes. awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. labels Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-author A reviewer has asked the author a question or requested changes. awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants