Zulip Chat Archive

Stream: mathlib4

Topic: AkraBazzi not allowed to import measure theory


Thomas Browning (Jan 26 2026 at 16:05):

The directory dependency linter prevents files in Computability from importing files in MeasureTheory. In particular, the file Computability.AkraBazzi.AkraBazzi is not allowed to import any measure theory. But I'm running into problems on #34456 where the reasonable looking import of Analysis.Meromorphic.Basic into Analysis.SpecialFunctions.Complex.LogDeriv is resulting in a problem via the following chain:
MeasureTheory.Constructions.BorelSpace.Basic -> Analysis.Meromorphic.Basic -> Analysis.SpecialFunctions.Complex.LogDeriv -> Analysis.SpecialFunctions.Pow.Deriv -> Computability.AkraBazzi.AkraBazzi.

Any thoughts on what should be done here?

Yaël Dillies (Jan 26 2026 at 16:07):

Can the final import be made private?

Thomas Browning (Jan 26 2026 at 16:08):

Yes, but that doesn't appease the linter

Yaël Dillies (Jan 26 2026 at 16:13):

Then probably the linter should be fixed!

Yaël Dillies (Jan 26 2026 at 16:15):

We developed a lot of tooling before the module system became a thing, before even we really understood what modules were. I expect there will be a lot of thinking required to update this tooling to the new reality of things

Frédéric Dupuis (Jan 26 2026 at 16:17):

I don't think this linter makes much sense in the first place, it's simply not true that no result about computability involves measure theory. In fact the standard statement of Akra Bazzi literally has an integral in it; as far as I know mathlib is the only place that states it using a sum.

Thomas Browning (Jan 26 2026 at 16:21):

For now I've added an exception for Akra-Bazzi to the PR, but both of these points are worth looking into I think.

Thomas Browning (Jan 26 2026 at 16:23):

Yaël Dillies said:

Then probably the linter should be fixed!

Although isn't the linter mostly to avoid nasty circular import issues long-term? You can still have circular imports with private imports, right?

Yaël Dillies (Jan 26 2026 at 16:26):

Length 2 cycles only, so that's fine?

Ruben Van de Velde (Jan 26 2026 at 16:27):

No, it's more about modularizing mathlib

Yury G. Kudryashov (Jan 26 2026 at 16:37):

As far as I understand, the initial list of banned imports was built based on what was in the repo, not based on what should be banned forever. I think that it should act like a reminder to think once if the import is actually needed (and add an exception or remove an entry, if it is) rather than a big "NO".

Yury G. Kudryashov (Jan 26 2026 at 16:38):

E.g., I'm going to allow complex analysis to import algebraic topology soon, because you need simply connected sets etc for the Riemann mapping theorem.

Anne Baanen (Jan 26 2026 at 17:39):

Yury G. Kudryashov said:

As far as I understand, the initial list of banned imports was built based on what was in the repo, not based on what should be banned forever. I think that it should act like a reminder to think once if the import is actually needed (and add an exception or remove an entry, if it is) rather than a big "NO".

As the developer of this linter, Yuri is exactly right. Adding an exception allowing Computability.AkraBazzi to import MeasureTheory is the way to go here.

Johan Commelin (Jan 26 2026 at 19:02):

Should the warning/error message of the linter communicate this better? (I haven't studied it.)

Ben Eltschig (Jan 26 2026 at 20:53):

Yury G. Kudryashov said:

E.g., I'm going to allow complex analysis to import algebraic topology soon, because you need simply connected sets etc for the Riemann mapping theorem.

#33364 on abstract simplicial complexes is also currently blocked by the rule that analysis files can't import algebraic topology files, so that would be another argument to remove that specific rule - though if I understand this thread right, the solution until that happens is to just add an exception for that file?

Yury G. Kudryashov (Jan 26 2026 at 21:29):

I think that we should disable this rule, or restrict it to specific subfolders of Analysis. Say, Analysis/Calculus, until it needs algebraic topology.

Michael Rothgang (Jan 26 2026 at 22:10):

Adding an exception to the rule (e.g., for Analysis/Convex/SimplicialComplex) seems reasonable to me.


Last updated: Feb 28 2026 at 14:05 UTC