Skip to content

Conversation

JovanGerb
Copy link
Collaborator

@JovanGerb JovanGerb commented Oct 20, 2025

This PR removes all occurrences of patterns like mul := (· * ·) in definitions of instances. These patterns are unneccessary, and sometimes they cause the instance to behave inefficiently during unification.

I have no idea why these patterns were there in the first place. Maybe it was a Lean3 thing?

As a result, we get a pretty good speedup: 0.63% less instructions.


Open in Gitpod

@JovanGerb JovanGerb marked this pull request as draft October 20, 2025 20:28
@JovanGerb JovanGerb added the bench-after-CI Once the PR passes CI, comment `!bench` on the PR label Oct 20, 2025
Copy link

github-actions bot commented Oct 20, 2025

PR summary dde1cfffb6

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

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

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/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).

@leanprover-community-mathlib4-bot
Copy link
Collaborator

!bench

@leanprover-bot
Copy link
Collaborator

Here are the benchmark results for commit 523815b.
There were significant changes against commit dde1cff:

  Benchmark                                             Metric         Change
  ===========================================================================
+ ~Mathlib.Analysis.Distribution.SchwartzSpace          instructions    -4.6%
+ ~Mathlib.Analysis.Fourier.FourierTransformDeriv       instructions    -4.7%
+ ~Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk   instructions    -9.4%
+ ~Mathlib.Computability.AkraBazzi.GrowsPolynomially    instructions   -13.1%
+ ~Mathlib.Computability.AkraBazzi.SumTransform         instructions   -11.3%
+ ~Mathlib.Geometry.Manifold.VectorBundle.Riemannian    instructions    -6.6%
+ ~Mathlib.RingTheory.Extension.Cotangent.Basic         instructions    -5.6%
+ ~Mathlib.RingTheory.Kaehler.JacobiZariski             instructions   -12.1%
+ ~Mathlib.RingTheory.Kaehler.Polynomial                instructions    -7.0%
+ ~Mathlib.Topology.VectorBundle.Riemannian             instructions    -5.8%

Copy link

File Instructions %
build -1018.547⬝10⁹ (-0.63%)
lint -47.303⬝10⁹ (-0.72%)
Mathlib.Algebra.Category.AlgCat.Monoidal +1.605⬝10⁹ (+6.93%)
150 files, Instructions -2.0⬝10⁹
File Instructions %
Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd -1.0⬝10⁹ (-2.34%)
Mathlib.AlgebraicTopology.FundamentalGroupoid.Basic -1.0⬝10⁹ (-2.56%)
Mathlib.RingTheory.Unramified.Pi -1.7⬝10⁹ (-5.74%)
Mathlib.NumberTheory.LSeries.AbstractFuncEq -1.7⬝10⁹ (-2.02%)
Mathlib.Geometry.Euclidean.Angle.Unoriented.RightAngle -1.13⬝10⁹ (-3.10%)
Mathlib.RingTheory.MvPolynomial.WeightedHomogeneous -1.23⬝10⁹ (-3.37%)
Mathlib.Analysis.Calculus.ContDiff.Basic -1.23⬝10⁹ (-0.38%)
Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics -1.28⬝10⁹ (-4.18%)
Mathlib.Analysis.Calculus.ContDiff.Operations -1.29⬝10⁹ (-0.58%)
Mathlib.Algebra.Category.ModuleCat.Presheaf.Monoidal -1.34⬝10⁹ (-1.76%)
Mathlib.Analysis.LocallyConvex.WithSeminorms -1.37⬝10⁹ (-1.18%)
Mathlib.Analysis.SpecialFunctions.Trigonometric.Series -1.49⬝10⁹ (-4.97%)
Mathlib.Analysis.InnerProductSpace.PiL2 -1.54⬝10⁹ (-0.61%)
Mathlib.Analysis.NormedSpace.Alternating.Uncurry.Fin -1.54⬝10⁹ (-1.79%)
Mathlib.RingTheory.Polynomial.Cyclotomic.Eval -1.55⬝10⁹ (-3.28%)
Mathlib.Probability.Moments.Basic -1.67⬝10⁹ (-3.73%)
Mathlib.NumberTheory.ModularForms.EisensteinSeries.Summable -1.68⬝10⁹ (-4.18%)
Mathlib.Analysis.SpecialFunctions.Trigonometric.Bounds -1.69⬝10⁹ (-3.67%)
Mathlib.Combinatorics.Enumerative.IncidenceAlgebra -1.71⬝10⁹ (-2.21%)
Mathlib.GroupTheory.DivisibleHull -1.71⬝10⁹ (-2.53%)
Mathlib.Analysis.InnerProductSpace.StarOrder -1.72⬝10⁹ (-2.83%)
Mathlib.Geometry.Euclidean.Incenter -1.72⬝10⁹ (-1.59%)
Mathlib.Data.Complex.Basic -1.73⬝10⁹ (-2.95%)
Mathlib.Analysis.SpecialFunctions.Pow.Complex -1.78⬝10⁹ (-4.41%)
Mathlib.RepresentationTheory.Induced -1.78⬝10⁹ (-0.61%)
Mathlib.RingTheory.Smooth.Pi -1.80⬝10⁹ (-4.51%)
Mathlib.NumberTheory.Transcendental.Liouville.LiouvilleNumber -1.82⬝10⁹ (-7.19%)
Mathlib.LinearAlgebra.CliffordAlgebra.Even -1.84⬝10⁹ (-1.65%)
Mathlib.Topology.Path -1.85⬝10⁹ (-2.76%)
Mathlib.NumberTheory.SiegelsLemma -1.89⬝10⁹ (-2.54%)
Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff -1.100⬝10⁹ (-2.39%)
Mathlib.NumberTheory.Zsqrtd.GaussianInt -1.102⬝10⁹ (-4.81%)
Mathlib.Analysis.Seminorm -1.106⬝10⁹ (-0.79%)
Mathlib.RingTheory.PowerSeries.NoZeroDivisors -1.108⬝10⁹ (-4.68%)
Mathlib.Topology.UrysohnsLemma -1.110⬝10⁹ (-4.46%)
Mathlib.Analysis.CStarAlgebra.ContinuousMap -1.113⬝10⁹ (-2.36%)
Mathlib.LinearAlgebra.Orientation -1.116⬝10⁹ (-2.20%)
Mathlib.RingTheory.Localization.Basic -1.116⬝10⁹ (-2.02%)
Mathlib.RingTheory.TensorProduct.MvPolynomial -1.117⬝10⁹ (-1.80%)
Mathlib.RingTheory.SimpleModule.WedderburnArtin -1.134⬝10⁹ (-1.80%)
Mathlib.NumberTheory.Modular -1.134⬝10⁹ (-1.63%)
Mathlib.Geometry.Euclidean.SignedDist -1.140⬝10⁹ (-1.98%)
Mathlib.Analysis.Fourier.AddCircleMulti -1.144⬝10⁹ (-2.80%)
Mathlib.Analysis.Complex.Basic -1.159⬝10⁹ (-1.97%)
Mathlib.Probability.Moments.ComplexMGF -1.168⬝10⁹ (-4.17%)
Mathlib.Analysis.Meromorphic.Order -1.171⬝10⁹ (-1.73%)
Mathlib.NumberTheory.Transcendental.Liouville.Basic -1.175⬝10⁹ (-4.29%)
Mathlib.Analysis.Normed.Unbundled.SeminormFromBounded -1.176⬝10⁹ (-5.07%)
Mathlib.Combinatorics.Additive.Corner.Roth -1.178⬝10⁹ (-4.37%)
Mathlib.MeasureTheory.Function.LocallyIntegrable -1.181⬝10⁹ (-2.64%)
Mathlib.Analysis.Normed.Operator.Banach -1.185⬝10⁹ (-1.05%)
Mathlib.Topology.Homotopy.Path -1.185⬝10⁹ (-3.28%)
Mathlib.FieldTheory.RatFunc.Basic -1.187⬝10⁹ (-0.46%)
Mathlib.Analysis.Convex.Continuous -1.191⬝10⁹ (-3.26%)
Mathlib.MeasureTheory.Integral.Bochner.Basic -1.200⬝10⁹ (-1.09%)
Mathlib.Analysis.Complex.Hadamard -1.200⬝10⁹ (-3.33%)
Mathlib.SetTheory.Ordinal.Notation -1.208⬝10⁹ (-2.22%)
Mathlib.Analysis.NormedSpace.RieszLemma -1.215⬝10⁹ (-7.78%)
Mathlib.Analysis.Normed.Algebra.QuaternionExponential -1.224⬝10⁹ (-4.83%)
Mathlib.Analysis.InnerProductSpace.Rayleigh -1.236⬝10⁹ (-3.26%)
Mathlib.NumberTheory.NumberField.CanonicalEmbedding.FundamentalCone -1.242⬝10⁹ (-1.40%)
Mathlib.Analysis.Calculus.FDeriv.Mul -1.245⬝10⁹ (-0.44%)
Mathlib.Analysis.AbsoluteValue.Equivalence -1.245⬝10⁹ (-1.79%)
Mathlib.MeasureTheory.Integral.FinMeasAdditive -1.246⬝10⁹ (-2.14%)
Mathlib.NumberTheory.TsumDivsorsAntidiagonal -1.247⬝10⁹ (-5.13%)
Mathlib.Analysis.InnerProductSpace.NormPow -1.253⬝10⁹ (-4.11%)
Mathlib.Analysis.SpecialFunctions.BinaryEntropy -1.259⬝10⁹ (-3.09%)
Mathlib.NumberTheory.NumberField.CanonicalEmbedding.ConvexBody -1.260⬝10⁹ (-1.33%)
Mathlib.Analysis.Calculus.TangentCone -1.266⬝10⁹ (-2.16%)
Mathlib.Algebra.Category.ModuleCat.Algebra -1.267⬝10⁹ (-12.77%)
Mathlib.Analysis.SpecialFunctions.Gamma.BohrMollerup -1.285⬝10⁹ (-3.89%)
Mathlib.MeasureTheory.Measure.Lebesgue.VolumeOfBalls -1.286⬝10⁹ (-2.29%)
Mathlib.Analysis.SpecialFunctions.Log.PosLog -1.293⬝10⁹ (-7.96%)
Mathlib.NumberTheory.Niven -1.305⬝10⁹ (-3.84%)
Mathlib.MeasureTheory.Integral.Bochner.Set -1.310⬝10⁹ (-1.48%)
Mathlib.NumberTheory.Padics.WithVal -1.323⬝10⁹ (-4.58%)
Mathlib.Analysis.Normed.Group.ControlledClosure -1.344⬝10⁹ (-7.66%)
Mathlib.Analysis.SpecialFunctions.Exp -1.349⬝10⁹ (-4.79%)
Mathlib.Topology.ContinuousMap.Compact -1.355⬝10⁹ (-3.29%)
Mathlib.Topology.Algebra.Polynomial -1.369⬝10⁹ (-7.52%)
Mathlib.Analysis.Meromorphic.FactorizedRational -1.370⬝10⁹ (-3.31%)
Mathlib.Algebra.Lie.TraceForm -1.376⬝10⁹ (-1.04%)
Mathlib.NumberTheory.LSeries.HurwitzZetaOdd -1.380⬝10⁹ (-2.73%)
Mathlib.Geometry.Manifold.Riemannian.Basic -1.383⬝10⁹ (-1.46%)
Mathlib.Analysis.SpecialFunctions.Gaussian.GaussianIntegral -1.403⬝10⁹ (-3.52%)
Mathlib.Analysis.Normed.Module.Ball.Homeomorph -1.414⬝10⁹ (-6.49%)
Mathlib.Analysis.Calculus.FDeriv.Norm -1.419⬝10⁹ (-3.60%)
Mathlib.MeasureTheory.Integral.CircleTransform -1.430⬝10⁹ (-4.01%)
Mathlib.Geometry.Euclidean.Triangle -1.446⬝10⁹ (-3.62%)
Mathlib.Analysis.SpecialFunctions.Gamma.Beta -1.446⬝10⁹ (-3.26%)
Mathlib.Analysis.Calculus.FDeriv.Analytic -1.452⬝10⁹ (-0.57%)
Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle -1.462⬝10⁹ (-3.00%)
Mathlib.Combinatorics.Additive.VerySmallDoubling -1.467⬝10⁹ (-1.77%)
Mathlib.Analysis.Calculus.UniformLimitsDeriv -1.486⬝10⁹ (-2.94%)
Mathlib.Analysis.SpecialFunctions.Integrals.Basic -1.489⬝10⁹ (-2.43%)
Mathlib.MeasureTheory.Measure.IntegralCharFun -1.492⬝10⁹ (-6.00%)
Mathlib.NumberTheory.ModularForms.EisensteinSeries.Defs -1.498⬝10⁹ (-3.30%)
Mathlib.AlgebraicGeometry.AffineSpace -1.499⬝10⁹ (-0.97%)
Mathlib.Analysis.MellinTransform -1.503⬝10⁹ (-3.39%)
Mathlib.NumberTheory.Padics.PadicNumbers -1.503⬝10⁹ (-1.77%)
Mathlib.Analysis.Normed.Module.Ball.Pointwise -1.510⬝10⁹ (-3.18%)
Mathlib.RepresentationTheory.Homological.GroupHomology.Basic -1.514⬝10⁹ (-3.47%)
Mathlib.Analysis.BoxIntegral.Integrability -1.527⬝10⁹ (-4.94%)
Mathlib.Analysis.Normed.Lp.lpSpace -1.528⬝10⁹ (-0.76%)
Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar -1.533⬝10⁹ (-1.66%)
Mathlib.Probability.Distributions.Gaussian.Fernique -1.541⬝10⁹ (-3.43%)
Mathlib.RingTheory.PowerSeries.WeierstrassPreparation -1.547⬝10⁹ (-2.24%)
Mathlib.Analysis.Fourier.AddCircle -1.549⬝10⁹ (-2.43%)
Mathlib.Analysis.SpecialFunctions.JapaneseBracket -1.551⬝10⁹ (-7.70%)
Mathlib.MeasureTheory.Integral.MeanInequalities -1.577⬝10⁹ (-3.73%)
Mathlib.RingTheory.AdicCompletion.Algebra -1.584⬝10⁹ (-2.33%)
Mathlib.NumberTheory.LSeries.SumCoeff -1.587⬝10⁹ (-3.90%)
Mathlib.NumberTheory.ModularForms.Basic -1.608⬝10⁹ (-3.22%)
Mathlib.AlgebraicGeometry.ProjectiveSpectrum.Basic -1.610⬝10⁹ (-1.72%)
Mathlib.Analysis.NormedSpace.PiTensorProduct.InjectiveSeminorm -1.615⬝10⁹ (-1.12%)
Mathlib.NumberTheory.Harmonic.ZetaAsymp -1.626⬝10⁹ (-4.15%)
Mathlib.RingTheory.Spectrum.Prime.FreeLocus -1.630⬝10⁹ (-1.58%)
Mathlib.LinearAlgebra.TensorProduct.Graded.External -1.649⬝10⁹ (-1.64%)
Mathlib.Analysis.Real.OfDigits -1.686⬝10⁹ (-9.08%)
Mathlib.LinearAlgebra.TensorPower.Basic -1.724⬝10⁹ (-2.56%)
Mathlib.RingTheory.Etale.Kaehler -1.727⬝10⁹ (-0.82%)
Mathlib.MeasureTheory.Function.Jacobian -1.767⬝10⁹ (-1.84%)
Mathlib.NumberTheory.Bernoulli -1.770⬝10⁹ (-3.40%)
Mathlib.FieldTheory.LinearDisjoint -1.771⬝10⁹ (-0.75%)
Mathlib.LinearAlgebra.QuadraticForm.QuadraticModuleCat.Monoidal -1.772⬝10⁹ (-3.76%)
Mathlib.Analysis.Quaternion -1.776⬝10⁹ (-5.75%)
Mathlib.RepresentationTheory.Rep -1.776⬝10⁹ (-1.24%)
Mathlib.Analysis.BoxIntegral.Basic -1.794⬝10⁹ (-2.35%)
Mathlib.MeasureTheory.Measure.Lebesgue.Basic -1.802⬝10⁹ (-4.02%)
Mathlib.Analysis.ODE.PicardLindelof -1.804⬝10⁹ (-3.17%)
Mathlib.Analysis.SpecificLimits.Normed -1.811⬝10⁹ (-1.90%)
Mathlib.Analysis.SpecialFunctions.Pow.NNReal -1.823⬝10⁹ (-3.02%)
Mathlib.Analysis.InnerProductSpace.Basic -1.838⬝10⁹ (-2.12%)
Mathlib.MeasureTheory.Integral.CurveIntegral.Basic -1.855⬝10⁹ (-2.54%)
Mathlib.MeasureTheory.Integral.CircleIntegral -1.873⬝10⁹ (-2.96%)
Mathlib.NumberTheory.Padics.Hensel -1.873⬝10⁹ (-1.91%)
Mathlib.Probability.Moments.CovarianceBilinDual -1.876⬝10⁹ (-2.50%)
Mathlib.Analysis.Calculus.DerivativeTest -1.883⬝10⁹ (-7.32%)
Mathlib.MeasureTheory.Function.UniformIntegrable -1.895⬝10⁹ (-3.02%)
Mathlib.Analysis.InnerProductSpace.TwoDim -1.899⬝10⁹ (-2.12%)
Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Order -1.907⬝10⁹ (-1.27%)
Mathlib.Analysis.Calculus.ContDiff.FaaDiBruno -1.908⬝10⁹ (-1.14%)
Mathlib.Analysis.SpecialFunctions.Complex.Arg -1.908⬝10⁹ (-3.92%)
Mathlib.MeasureTheory.VectorMeasure.Decomposition.Hahn -1.909⬝10⁹ (-6.81%)
Mathlib.Analysis.Analytic.OfScalars -1.927⬝10⁹ (-4.02%)
Mathlib.NumberTheory.LSeries.PrimesInAP -1.952⬝10⁹ (-5.59%)
Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic -1.965⬝10⁹ (-1.95%)
Mathlib.NumberTheory.DiophantineApproximation.Basic -1.981⬝10⁹ (-5.24%)
Mathlib.LinearAlgebra.CliffordAlgebra.EvenEquiv -1.983⬝10⁹ (-2.64%)
Mathlib.Analysis.CStarAlgebra.ApproximateUnit -1.994⬝10⁹ (-1.12%)
47 files, Instructions -3.0⬝10⁹
File Instructions %
Mathlib.LinearAlgebra.PiTensorProduct -2.15⬝10⁹ (-2.19%)
Mathlib.NumberTheory.NumberField.CanonicalEmbedding.NormLeOne -2.35⬝10⁹ (-1.94%)
Mathlib.Analysis.Normed.Unbundled.SmoothingSeminorm -2.57⬝10⁹ (-3.88%)
Mathlib.Analysis.Complex.Exponential -2.58⬝10⁹ (-3.55%)
Mathlib.Analysis.Calculus.ContDiff.FTaylorSeries -2.66⬝10⁹ (-0.83%)
Mathlib.Analysis.Complex.UpperHalfPlane.Metric -2.75⬝10⁹ (-2.21%)
Mathlib.NumberTheory.NumberField.Units.DirichletTheorem -2.99⬝10⁹ (-2.73%)
Mathlib.Analysis.Normed.Module.FiniteDimension -2.103⬝10⁹ (-2.26%)
Mathlib.RingTheory.Ideal.Quotient.Basic -2.125⬝10⁹ (-8.49%)
Mathlib.Algebra.Module.Presentation.Differentials -2.142⬝10⁹ (-6.17%)
Mathlib.Analysis.SpecialFunctions.Log.Base -2.150⬝10⁹ (-5.65%)
Mathlib.Analysis.FunctionalSpaces.SobolevInequality -2.150⬝10⁹ (-1.86%)
Mathlib.Analysis.CStarAlgebra.CStarMatrix -2.161⬝10⁹ (-1.69%)
Mathlib.NumberTheory.ModularForms.JacobiTheta.Bounds -2.170⬝10⁹ (-7.09%)
Mathlib.Analysis.CStarAlgebra.GelfandDuality -2.174⬝10⁹ (-3.16%)
Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform -2.189⬝10⁹ (-3.17%)
Mathlib.Algebra.Category.BialgCat.Monoidal -2.194⬝10⁹ (-2.69%)
Mathlib.Analysis.Calculus.BumpFunction.FiniteDimension -2.204⬝10⁹ (-3.72%)
Mathlib.RingTheory.PiTensorProduct -2.205⬝10⁹ (-3.33%)
Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic -2.227⬝10⁹ (-2.57%)
Mathlib.Analysis.Calculus.Rademacher -2.236⬝10⁹ (-3.48%)
Mathlib.Analysis.Calculus.FDeriv.Symmetric -2.253⬝10⁹ (-1.96%)
Mathlib.LinearAlgebra.CliffordAlgebra.Basic -2.305⬝10⁹ (-4.07%)
Mathlib.Topology.MetricSpace.GromovHausdorffRealized -2.311⬝10⁹ (-5.53%)
Mathlib.NumberTheory.LSeries.HurwitzZetaEven -2.361⬝10⁹ (-3.74%)
Mathlib.Analysis.SpecialFunctions.Pow.Real -2.366⬝10⁹ (-4.08%)
Mathlib.RingTheory.Kaehler.Basic -2.382⬝10⁹ (-0.91%)
Mathlib.Analysis.CStarAlgebra.Unitary.Connected -2.382⬝10⁹ (-2.90%)
Mathlib.Analysis.MeanInequalities -2.408⬝10⁹ (-3.58%)
Mathlib.Analysis.Complex.PhragmenLindelof -2.473⬝10⁹ (-4.50%)
Mathlib.Algebra.Module.FinitePresentation -2.538⬝10⁹ (-1.48%)
Mathlib.MeasureTheory.Integral.PeakFunction -2.552⬝10⁹ (-4.81%)
Mathlib.Algebra.Category.CoalgCat.ComonEquivalence -2.568⬝10⁹ (-2.77%)
Mathlib.NumberTheory.ModularForms.JacobiTheta.TwoVariable -2.603⬝10⁹ (-3.74%)
Mathlib.GroupTheory.HNNExtension -2.637⬝10⁹ (-4.90%)
Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Basic -2.690⬝10⁹ (-1.84%)
Mathlib.Analysis.Analytic.IteratedFDeriv -2.711⬝10⁹ (-4.25%)
Mathlib.Analysis.Analytic.Inverse -2.755⬝10⁹ (-2.13%)
Mathlib.Analysis.Convex.Strong -2.761⬝10⁹ (-8.25%)
Mathlib.MeasureTheory.Function.LpSeminorm.Basic -2.796⬝10⁹ (-2.55%)
Mathlib.LinearAlgebra.FreeProduct.Basic -2.812⬝10⁹ (-9.56%)
Mathlib.Analysis.Calculus.InverseFunctionTheorem.ApproximatesLinearOn -2.829⬝10⁹ (-4.98%)
Mathlib.Analysis.Calculus.ContDiff.Bounds -2.850⬝10⁹ (-2.09%)
Mathlib.Analysis.SpecialFunctions.Integrals.LogTrigonometric -2.852⬝10⁹ (-13.48%)
Mathlib.NumberTheory.NumberField.Discriminant.Basic -2.889⬝10⁹ (-2.45%)
Mathlib.NumberTheory.Ostrowski -2.910⬝10⁹ (-7.05%)
Mathlib.MeasureTheory.Integral.RieszMarkovKakutani.Real -2.974⬝10⁹ (-5.03%)
25 files, Instructions -4.0⬝10⁹
File Instructions %
Mathlib.RingTheory.PowerSeries.Restricted -3.68⬝10⁹ (-8.84%)
Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.Rpow.Basic -3.69⬝10⁹ (-1.48%)
Mathlib.Topology.MetricSpace.PiNat -3.129⬝10⁹ (-7.74%)
Mathlib.Analysis.SpecialFunctions.Log.Deriv -3.137⬝10⁹ (-7.53%)
Mathlib.RingTheory.AdicCompletion.AsTensorProduct -3.157⬝10⁹ (-2.52%)
Mathlib.Probability.Moments.SubGaussian -3.199⬝10⁹ (-5.30%)
Mathlib.Analysis.Complex.Trigonometric -3.206⬝10⁹ (-4.71%)
Mathlib.RingTheory.MatrixAlgebra -3.220⬝10⁹ (-6.87%)
Mathlib.Analysis.Analytic.ConvergenceRadius -3.327⬝10⁹ (-3.26%)
Mathlib.Probability.Distributions.Gaussian.Real -3.395⬝10⁹ (-6.20%)
Mathlib.NumberTheory.NumberField.CanonicalEmbedding.Basic -3.464⬝10⁹ (-1.96%)
Mathlib.NumberTheory.NumberField.House -3.538⬝10⁹ (-7.34%)
Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.PosPart.Basic -3.559⬝10⁹ (-3.49%)
Mathlib.Analysis.SpecialFunctions.Complex.LogBounds -3.565⬝10⁹ (-3.34%)
Mathlib.Combinatorics.SimpleGraph.Triangle.Removal -3.577⬝10⁹ (-7.95%)
Mathlib.Analysis.SpecialFunctions.Stirling -3.724⬝10⁹ (-9.95%)
Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv -3.728⬝10⁹ (-3.07%)
Mathlib.MeasureTheory.Covering.BesicovitchVectorSpace -3.738⬝10⁹ (-7.28%)
Mathlib.Probability.StrongLaw -3.751⬝10⁹ (-4.62%)
Mathlib.Analysis.Matrix.Order -3.815⬝10⁹ (-2.65%)
Mathlib.Combinatorics.Additive.AP.Three.Behrend -3.831⬝10⁹ (-7.95%)
Mathlib.Analysis.SpecialFunctions.Bernstein -3.856⬝10⁹ (-8.96%)
Mathlib.Analysis.Calculus.FDeriv.Measurable -3.875⬝10⁹ (-3.73%)
Mathlib.Analysis.Complex.AbelLimit -3.898⬝10⁹ (-9.52%)
Mathlib.Analysis.BoxIntegral.UnitPartition -3.979⬝10⁹ (-8.29%)
8 files, Instructions -5.0⬝10⁹
File Instructions %
Mathlib.Topology.ContinuousMap.CompactlySupported -4.48⬝10⁹ (-4.77%)
Mathlib.MeasureTheory.Integral.RieszMarkovKakutani.Basic -4.99⬝10⁹ (-7.58%)
Mathlib.Analysis.SpecialFunctions.Pow.Deriv -4.126⬝10⁹ (-4.29%)
Mathlib.Analysis.RCLike.Basic -4.140⬝10⁹ (-3.63%)
Mathlib.Probability.Moments.IntegrableExpMul -4.241⬝10⁹ (-7.92%)
Mathlib.Analysis.Analytic.Basic -4.299⬝10⁹ (-2.14%)
Mathlib.RingTheory.Kaehler.TensorProduct -4.304⬝10⁹ (-3.30%)
Mathlib.Analysis.SpecialFunctions.Trigonometric.Cotangent -4.562⬝10⁹ (-6.68%)
8 files, Instructions -6.0⬝10⁹
File Instructions %
Mathlib.LinearAlgebra.Matrix.ToLin -5.9⬝10⁹ (-4.25%)
Mathlib.MeasureTheory.Measure.Haar.OfBasis -5.23⬝10⁹ (-7.58%)
Mathlib.RepresentationTheory.Coinvariants -5.294⬝10⁹ (-5.04%)
Mathlib.Analysis.NormedSpace.Multilinear.Curry -5.375⬝10⁹ (-2.48%)
Mathlib.Analysis.Calculus.Taylor -5.382⬝10⁹ (-8.12%)
Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Semisimple -5.524⬝10⁹ (-2.87%)
Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.Rpow.IntegralRepresentation -5.586⬝10⁹ (-5.15%)
Mathlib.Algebra.Category.Ring.Under.Limits -5.686⬝10⁹ (-8.94%)
6 files, Instructions -7.0⬝10⁹
File Instructions %
Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Unique -6.125⬝10⁹ (-4.99%)
Mathlib.Analysis.SpecificLimits.FloorPow -6.152⬝10⁹ (-12.41%)
Mathlib.RingTheory.Smooth.Kaehler -6.167⬝10⁹ (-2.92%)
Mathlib.Analysis.NormedSpace.Multilinear.Basic -6.298⬝10⁹ (-2.36%)
Mathlib.Probability.Distributions.Fernique -6.369⬝10⁹ (-7.88%)
Mathlib.MeasureTheory.Measure.ProbabilityMeasure -6.462⬝10⁹ (-13.04%)
2 files, Instructions -8.0⬝10⁹
File Instructions %
Mathlib.RingTheory.TensorProduct.Pi -7.429⬝10⁹ (-21.69%)
Mathlib.Analysis.Analytic.Composition -7.907⬝10⁹ (-5.55%)
2 files, Instructions -9.0⬝10⁹
File Instructions %
Mathlib.AlgebraicGeometry.Modules.Tilde -8.74⬝10⁹ (-12.57%)
Mathlib.Computability.AkraBazzi.AkraBazzi -8.480⬝10⁹ (-9.11%)
2 files, Instructions -10.0⬝10⁹
File Instructions %
Mathlib.Topology.ContinuousMap.StoneWeierstrass -9.511⬝10⁹ (-5.26%)
Mathlib.Algebra.GroupWithZero.Action.Pointwise.Set -9.573⬝10⁹ (-35.71%)
4 files, Instructions -11.0⬝10⁹
File Instructions %
Mathlib.Combinatorics.SimpleGraph.Regularity.Chunk -10.1⬝10⁹ (-9.41%)
Mathlib.Geometry.Manifold.VectorBundle.Riemannian -10.619⬝10⁹ (-6.61%)
Mathlib.Analysis.Distribution.SchwartzSpace -10.659⬝10⁹ (-4.56%)
Mathlib.RingTheory.Kaehler.Polynomial -10.913⬝10⁹ (-7.03%)
3 files, Instructions -12.0⬝10⁹
File Instructions %
Mathlib.RingTheory.Extension.Cotangent.Basic -11.64⬝10⁹ (-5.56%)
Mathlib.Topology.VectorBundle.Riemannian -11.133⬝10⁹ (-5.84%)
Mathlib.Computability.AkraBazzi.GrowsPolynomially -11.841⬝10⁹ (-13.10%)
File Instructions %
Mathlib.Computability.AkraBazzi.SumTransform -13.185⬝10⁹ (-11.27%)
Mathlib.Analysis.Fourier.FourierTransformDeriv -14.858⬝10⁹ (-4.69%)
Mathlib.RingTheory.Kaehler.JacobiZariski -42.455⬝10⁹ (-12.05%)
CI run Lakeprof report

@github-actions github-actions bot removed the bench-after-CI Once the PR passes CI, comment `!bench` on the PR label Oct 21, 2025
@JovanGerb JovanGerb marked this pull request as ready for review October 21, 2025 03:56
@kbuzzard
Copy link
Member

kbuzzard commented Oct 21, 2025

The +44 lines is misleading -- this is doing essentially nothing other than deleting code (and then occasionally moving brackets to confuse github). The only changes not of this form are a couple of changes of nsmul := fun n z => n • z to nsmul := (· • ·) or the analogous change for zsmul. I've reviewed (and have nothing to say): I don't feel competent to merge as this is playing with a subtlety in the typeclass system which I don't understand well enough, but LGTM. I especially like that literally no files are + on instructions.

@jcommelin
Copy link
Member

Thanks 🎉

bors merge

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the ready-to-merge This PR has been sent to bors. label Oct 21, 2025
mathlib-bors bot pushed a commit that referenced this pull request Oct 21, 2025
This PR removes all occurrences of patterns like `mul := (· * ·)` in definitions of instances. These patterns are unneccessary, and sometimes they cause the instance to behave inefficiently during unification.

I have no idea why these patterns were there in the first place. Maybe it was a Lean3 thing?

As a result, we get a pretty good speedup: 0.63% less instructions.
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Oct 21, 2025

Build failed:

@jcommelin
Copy link
Member

bors r-

bors d+

@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Oct 21, 2025

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

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed ready-to-merge This PR has been sent to bors. delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). labels Oct 21, 2025
@bryangingechen
Copy link
Contributor

bors r+

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the ready-to-merge This PR has been sent to bors. label Oct 21, 2025
mathlib-bors bot pushed a commit that referenced this pull request Oct 21, 2025
This PR removes all occurrences of patterns like `mul := (· * ·)` in definitions of instances. These patterns are unneccessary, and sometimes they cause the instance to behave inefficiently during unification.

I have no idea why these patterns were there in the first place. Maybe it was a Lean3 thing?

As a result, we get a pretty good speedup: 0.63% less instructions.
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Oct 21, 2025

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title chore: remove redundant fields from instances [Merged by Bors] - chore: remove redundant fields from instances Oct 21, 2025
@mathlib-bors mathlib-bors bot closed this Oct 21, 2025
@mattrobball
Copy link
Collaborator

  1. Yes, I believe these are vestigial from Lean 3. That was feedback I got when I removed some a while back.
  2. To test my expectations, these are resulting artificially eta expanded terms or is it something else?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge This PR has been sent to bors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants