Skip to content

[Merged by Bors] - chore(Mathlib/Tactic): stop norm_num importing the Bochner integral#39602

Closed
b-mehta wants to merge 9 commits into
leanprover-community:masterfrom
b-mehta:norm-num-bochner
Closed

[Merged by Bors] - chore(Mathlib/Tactic): stop norm_num importing the Bochner integral#39602
b-mehta wants to merge 9 commits into
leanprover-community:masterfrom
b-mehta:norm-num-bochner

Conversation

@b-mehta

@b-mehta b-mehta commented May 20, 2026

Copy link
Copy Markdown
Contributor

Motivation: importing Mathlib.Tactic.NormNum shouldn't require us to build the Bochner integral and fundamental theorem of algebra.

To enable this, we move FiniteField.primitiveChar_to_Complex to a new file.
We also make FiniteField.primitiveChar_to_Complex not exposed, since its definitional properties should not be relied upon.


Open in Gitpod

@b-mehta b-mehta added the WIP Work in progress label May 20, 2026
@b-mehta

b-mehta commented May 20, 2026

Copy link
Copy Markdown
Contributor Author

!radar

@leanprover-radar

leanprover-radar commented May 20, 2026

Copy link
Copy Markdown

Benchmark results for c6776c8 against 260979c are in. No significant results found. @b-mehta

  • 🟥 build//instructions: +45.7G (+0.03%)

Small changes (5✅)

  • build/module/Mathlib.Lean.Name//instructions: -172.6M (-5.22%)
  • build/module/Mathlib.NumberTheory.JacobiSum.Basic//instructions: -656.9M (-2.09%)
  • build/module/Mathlib.NumberTheory.LegendreSymbol.AddCharacter//instructions: -1.4G (-7.38%)
  • build/module/Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum//instructions: -547.5M (-4.16%)
  • build/module/Mathlib.Tactic//instructions: -470.9M (-6.38%)

@github-actions

github-actions Bot commented May 20, 2026

Copy link
Copy Markdown

PR summary 41c067a2d5

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.NumberTheory.LegendreSymbol.AddCharacter 3025 2608 -417 (-13.79%)
Import changes for all files
Files Import difference
10 files Mathlib.NumberTheory.DirichletCharacter.GaussSum Mathlib.NumberTheory.Fermat Mathlib.NumberTheory.GaussSum Mathlib.NumberTheory.JacobiSum.Basic Mathlib.NumberTheory.LegendreSymbol.AddCharacter Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity Mathlib.NumberTheory.LucasLehmer Mathlib.Tactic.NormNum.LegendreSymbol
-417
Mathlib.Tactic -393
Mathlib.NumberTheory.LegendreSymbol.Complex (new file) 3026

Declarations diff

No declarations were harmed in the making of this PR! 🐙

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.


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

@b-mehta

b-mehta commented May 20, 2026

Copy link
Copy Markdown
Contributor Author

!radar

@leanprover-radar

leanprover-radar commented May 20, 2026

Copy link
Copy Markdown

Benchmark results for 68dd1fa against 260979c are in. No significant results found. @b-mehta

  • 🟥 build//instructions: +38.7G (+0.02%)

Small changes (4✅, 1🟥)

  • build/module/Mathlib.NumberTheory.JacobiSum.Basic//instructions: -598.1M (-1.91%)
  • build/module/Mathlib.NumberTheory.LegendreSymbol.AddCharacter//instructions: -1.4G (-7.51%)
  • build/module/Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum//instructions: -546.9M (-4.15%)
  • build/module/Mathlib.Tactic//instructions: -473.3M (-6.41%)
  • 🟥 build/profile/import//wall-clock: +1m 46s (+1.54%)

@b-mehta b-mehta removed the WIP Work in progress label May 20, 2026
@grunweg grunweg added the tech debt Tracking cross-cutting technical debt, see e.g. the "Technical debt counters" stream on zulip label May 22, 2026
@grunweg grunweg self-assigned this May 22, 2026
Comment thread Mathlib/Analysis/SpecialFunctions/Complex/CircleAddChar.lean Outdated
@grunweg

grunweg commented May 22, 2026

Copy link
Copy Markdown
Contributor

@adomani The module doc-string linter does not fire on this PR in CI.
It should fire here (the newly added module has no module doc-string); it does fire locally in VS Code --- but lake build passes locally and in CI. Do you have any idea what's causing this?

@grunweg

grunweg commented May 22, 2026

Copy link
Copy Markdown
Contributor

On current master, the linter works: removing the module doc-string in an existing file (WhitneyEmbedding.lean) causes a linter error both in VS Code and in lake build.

@grunweg grunweg left a comment

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.

Basically LGTM --- but we should investigate the linter bug!

Comment thread Mathlib/NumberTheory/LegendreSymbol/Complex.lean
Comment thread Mathlib/NumberTheory/LegendreSymbol/Complex.lean
@grunweg

grunweg commented May 22, 2026

Copy link
Copy Markdown
Contributor

The linter also errors in lake build if I copy-paste literally the same file on current master. Can you merge master on this PR?

@grunweg

grunweg commented May 22, 2026

Copy link
Copy Markdown
Contributor

Merging master on this PR fixes the linter: this is the diff between the two points:
260979c...master

@adomani

adomani commented May 22, 2026

Copy link
Copy Markdown
Contributor

Some part of this linter relies on an IO.Ref and therefore may produce unreliable results locally. I think that I had aimed to making it silent, when it is unreliable.

In CI, though, the warnings should be correct. So I'm surprised that CI passed when it shouldn't.

@b-mehta

b-mehta commented May 25, 2026

Copy link
Copy Markdown
Contributor Author

@MichaelStollBayreuth if you have a moment, I'd also like your opinion on the new location for the definition, and the module doc. On hindsight, I'm not sure that Cyclotomic.lean really makes sense here.
Also, this could be a good opportunity to un-expose this definition, as I think the idea is that it's not meant to have good definitional properties, other than being a primitive character on a finite field.

@MichaelStollBayreuth

Copy link
Copy Markdown
Contributor
  • A separate file definitely makes sense. Maybe "Mathlib.NumberTheory.LegendreSymbol.Complex"?
  • The module docstring looks OK to me.
  • Un-exposeing the definition is fine as far as I am concerned. I agree that it should not matter how the character is constructed (one can obtain one from any other by pre-composing with multiplication by a unit), which, I assume, involves choice anyway somewhere (when picking a primitive pth root of unity).

@grunweg

grunweg commented May 25, 2026

Copy link
Copy Markdown
Contributor

Thanks for doing this! This PR looks good to me. I'll let @MichaelStollBayreuth take a final look, as they wrote the code.
bors d=MichaelStollBayreuth

@mathlib-bors

mathlib-bors Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

✌️ MichaelStollBayreuth can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@mathlib-triage mathlib-triage Bot added the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label May 25, 2026
@grunweg grunweg added the t-number-theory Number theory (also use t-algebra or t-analysis to specialize) label May 25, 2026
@MichaelStollBayreuth

Copy link
Copy Markdown
Contributor

Thanks!

bors r+

mathlib-bors Bot pushed a commit that referenced this pull request May 25, 2026
…39602)

Motivation: importing `Mathlib.Tactic.NormNum` shouldn't require us to build the Bochner integral and fundamental theorem of algebra.

To enable this, we move `FiniteField.primitiveChar_to_Complex` to a new file.
We also make `FiniteField.primitiveChar_to_Complex` not exposed, since its definitional properties should not be relied upon.

Co-authored-by: Michael Rothgang <rothgang@math.uni-bonn.de>
@mathlib-bors

mathlib-bors Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title chore(Mathlib/Tactic): stop norm_num importing the Bochner integral [Merged by Bors] - chore(Mathlib/Tactic): stop norm_num importing the Bochner integral May 25, 2026
@mathlib-bors mathlib-bors Bot closed this May 25, 2026
b-mehta added a commit to b-mehta/mathlib4 that referenced this pull request Jun 2, 2026
…eanprover-community#39602)

Motivation: importing `Mathlib.Tactic.NormNum` shouldn't require us to build the Bochner integral and fundamental theorem of algebra.

To enable this, we move `FiniteField.primitiveChar_to_Complex` to a new file.
We also make `FiniteField.primitiveChar_to_Complex` not exposed, since its definitional properties should not be relied upon.

Co-authored-by: Michael Rothgang <rothgang@math.uni-bonn.de>
Bergschaf pushed a commit to Bergschaf/mathlib4 that referenced this pull request Jun 3, 2026
…eanprover-community#39602)

Motivation: importing `Mathlib.Tactic.NormNum` shouldn't require us to build the Bochner integral and fundamental theorem of algebra.

To enable this, we move `FiniteField.primitiveChar_to_Complex` to a new file.
We also make `FiniteField.primitiveChar_to_Complex` not exposed, since its definitional properties should not be relied upon.

Co-authored-by: Michael Rothgang <rothgang@math.uni-bonn.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). t-number-theory Number theory (also use t-algebra or t-analysis to specialize) tech debt Tracking cross-cutting technical debt, see e.g. the "Technical debt counters" stream on zulip

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants