Skip to content

[Merged by Bors] - feat: generalise algebraMap_injective by weakening its typeclass assumptions#21287

Closed
ocfnash wants to merge 24 commits intomasterfrom
ocfnash/alg_inj
Closed

[Merged by Bors] - feat: generalise algebraMap_injective by weakening its typeclass assumptions#21287
ocfnash wants to merge 24 commits intomasterfrom
ocfnash/alg_inj

Conversation

@ocfnash
Copy link
Copy Markdown
Contributor

@ocfnash ocfnash commented Jan 31, 2025

As shown in the new lemma faithfulSMul_iff_algebraMap_injective, injectivity of algebraMap R A is equivalent to the typeclass hypothesis [FaithfulSMul R A]. We thus generalise (and rename) the existing lemma NoZeroSMulDivisors.algebraMap_injective to FaithfulSMul.algebraMap_injective. The rename is responsible for much of the diff.

By weakening the assumptions [Nontrivial A] [NoZeroSMulDivisors R A] to just [FaithfulSMul R A], results which need to use algebraMap_injective can be applied in the case that we have [Ring A] [CharZero A] but fail to have [NoZeroSMulDivisors ℤ A]. This is the motivation for these changes.

There are quite a few places in the library where a lemma consumes an explicit argument of the form Injective (algebraMap R A). Most / all of these should probably be restated to accept the typeclass argument [FaithfulSMul R A] but we do not attempt such a refactor here.


Open in Gitpod

…mptions

By weakening the assumptions `[Nontrivial A] [NoZeroSMulDivisors R A]` to just
`[FaithfulSMul R A]`, results which need to use `algebraMap_injective` can be
applied in that case that we have `[Ring A] [CharZero A]` but fail to have
`[NoZeroSMulDivisors ℤ A]`. This is the motivation for these changes.
@ocfnash ocfnash added WIP Work in progress t-algebra Algebra (groups, rings, fields, etc) labels Jan 31, 2025
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 31, 2025

PR summary 14c33aa1b7

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Topology.Algebra.Module.FiniteDimension 1616 1609 -7 (-0.43%)
Mathlib.Algebra.Algebra.Basic 693 692 -1 (-0.14%)
Import changes for all files
Files Import difference
412 files Mathlib.Analysis.Analytic.Polynomial Mathlib.Analysis.BoundedVariation Mathlib.Analysis.BoxIntegral.Basic Mathlib.Analysis.BoxIntegral.DivergenceTheorem Mathlib.Analysis.BoxIntegral.Integrability Mathlib.Analysis.BoxIntegral.Partition.Measure Mathlib.Analysis.CStarAlgebra.ContinuousLinearMap Mathlib.Analysis.CStarAlgebra.Matrix Mathlib.Analysis.Calculus.AddTorsor.Coord Mathlib.Analysis.Calculus.BumpFunction.Basic Mathlib.Analysis.Calculus.BumpFunction.Convolution Mathlib.Analysis.Calculus.BumpFunction.FiniteDimension Mathlib.Analysis.Calculus.BumpFunction.InnerProduct Mathlib.Analysis.Calculus.BumpFunction.Normed Mathlib.Analysis.Calculus.Conformal.InnerProduct Mathlib.Analysis.Calculus.ContDiff.FiniteDimension Mathlib.Analysis.Calculus.ContDiff.RCLike Mathlib.Analysis.Calculus.Deriv.Abs Mathlib.Analysis.Calculus.FDeriv.Extend Mathlib.Analysis.Calculus.FDeriv.Measurable Mathlib.Analysis.Calculus.FDeriv.Norm Mathlib.Analysis.Calculus.FDeriv.Symmetric Mathlib.Analysis.Calculus.FirstDerivativeTest Mathlib.Analysis.Calculus.Gradient.Basic Mathlib.Analysis.Calculus.Implicit Mathlib.Analysis.Calculus.InverseFunctionTheorem.ContDiff Mathlib.Analysis.Calculus.InverseFunctionTheorem.FiniteDimensional Mathlib.Analysis.Calculus.LHopital Mathlib.Analysis.Calculus.LineDeriv.IntegrationByParts Mathlib.Analysis.Calculus.LineDeriv.Measurable Mathlib.Analysis.Calculus.MeanValue Mathlib.Analysis.Calculus.Monotone Mathlib.Analysis.Calculus.ParametricIntegral Mathlib.Analysis.Calculus.ParametricIntervalIntegral Mathlib.Analysis.Calculus.Rademacher Mathlib.Analysis.Calculus.SmoothSeries Mathlib.Analysis.Calculus.Taylor Mathlib.Analysis.Calculus.UniformLimitsDeriv Mathlib.Analysis.Calculus.VectorField Mathlib.Analysis.Complex.AbsMax Mathlib.Analysis.Complex.Angle Mathlib.Analysis.Complex.Arg Mathlib.Analysis.Complex.CauchyIntegral Mathlib.Analysis.Complex.Hadamard Mathlib.Analysis.Complex.Liouville Mathlib.Analysis.Complex.LocallyUniformLimit Mathlib.Analysis.Complex.OpenMapping Mathlib.Analysis.Complex.Periodic Mathlib.Analysis.Complex.PhragmenLindelof Mathlib.Analysis.Complex.Positivity Mathlib.Analysis.Complex.RemovableSingularity Mathlib.Analysis.Complex.Schwarz Mathlib.Analysis.Complex.TaylorSeries Mathlib.Analysis.Complex.Tietze Mathlib.Analysis.Convex.AmpleSet Mathlib.Analysis.Convex.Cone.Closure Mathlib.Analysis.Convex.Cone.InnerDual Mathlib.Analysis.Convex.Cone.Pointed Mathlib.Analysis.Convex.Cone.Proper Mathlib.Analysis.Convex.Continuous Mathlib.Analysis.Convex.Deriv Mathlib.Analysis.Convex.GaugeRescale Mathlib.Analysis.Convex.Integral Mathlib.Analysis.Convex.Intrinsic Mathlib.Analysis.Convex.KreinMilman Mathlib.Analysis.Convex.Measure Mathlib.Analysis.Convex.Normed Mathlib.Analysis.Convex.Side Mathlib.Analysis.Convex.SpecificFunctions.Deriv Mathlib.Analysis.Convex.StrictConvexBetween Mathlib.Analysis.Convex.StrictConvexSpace Mathlib.Analysis.Convex.Strong Mathlib.Analysis.Convex.Uniform Mathlib.Analysis.Convolution Mathlib.Analysis.Distribution.AEEqOfIntegralContDiff Mathlib.Analysis.Distribution.SchwartzSpace Mathlib.Analysis.Fourier.FiniteAbelian.Orthogonality Mathlib.Analysis.Fourier.FourierTransform Mathlib.Analysis.Fourier.Inversion Mathlib.Analysis.Fourier.RiemannLebesgueLemma Mathlib.Analysis.FunctionalSpaces.SobolevInequality Mathlib.Analysis.InnerProductSpace.Adjoint Mathlib.Analysis.InnerProductSpace.Basic Mathlib.Analysis.InnerProductSpace.Calculus Mathlib.Analysis.InnerProductSpace.Completion Mathlib.Analysis.InnerProductSpace.ConformalLinearMap Mathlib.Analysis.InnerProductSpace.Dual Mathlib.Analysis.InnerProductSpace.EuclideanDist Mathlib.Analysis.InnerProductSpace.GramSchmidtOrtho Mathlib.Analysis.InnerProductSpace.LaxMilgram Mathlib.Analysis.InnerProductSpace.LinearMap Mathlib.Analysis.InnerProductSpace.LinearPMap Mathlib.Analysis.InnerProductSpace.MeanErgodic Mathlib.Analysis.InnerProductSpace.NormPow Mathlib.Analysis.InnerProductSpace.OfNorm Mathlib.Analysis.InnerProductSpace.Orientation Mathlib.Analysis.InnerProductSpace.Orthogonal Mathlib.Analysis.InnerProductSpace.Orthonormal Mathlib.Analysis.InnerProductSpace.PiL2 Mathlib.Analysis.InnerProductSpace.Positive Mathlib.Analysis.InnerProductSpace.ProdL2 Mathlib.Analysis.InnerProductSpace.Projection Mathlib.Analysis.InnerProductSpace.Rayleigh Mathlib.Analysis.InnerProductSpace.Subspace Mathlib.Analysis.InnerProductSpace.Symmetric Mathlib.Analysis.InnerProductSpace.TwoDim Mathlib.Analysis.InnerProductSpace.WeakOperatorTopology Mathlib.Analysis.InnerProductSpace.l2Space Mathlib.Analysis.LocallyConvex.WeakOperatorTopology Mathlib.Analysis.LocallyConvex.WeakSpace Mathlib.Analysis.Matrix Mathlib.Analysis.MellinInversion Mathlib.Analysis.MellinTransform Mathlib.Analysis.Normed.Affine.AddTorsorBases Mathlib.Analysis.Normed.Algebra.MatrixExponential Mathlib.Analysis.Normed.Algebra.QuaternionExponential Mathlib.Analysis.Normed.Module.Complemented Mathlib.Analysis.Normed.Module.Dual Mathlib.Analysis.Normed.Module.FiniteDimension Mathlib.Analysis.Normed.Module.WeakDual Mathlib.Analysis.NormedSpace.HahnBanach.Extension Mathlib.Analysis.NormedSpace.HahnBanach.SeparatingDual Mathlib.Analysis.NormedSpace.HahnBanach.Separation Mathlib.Analysis.ODE.Gronwall Mathlib.Analysis.ODE.PicardLindelof Mathlib.Analysis.PSeriesComplex Mathlib.Analysis.Quaternion Mathlib.Analysis.RCLike.Inner Mathlib.Analysis.RCLike.Lemmas Mathlib.Analysis.SpecialFunctions.Arsinh Mathlib.Analysis.SpecialFunctions.BinaryEntropy Mathlib.Analysis.SpecialFunctions.Complex.Analytic Mathlib.Analysis.SpecialFunctions.Complex.Arctan Mathlib.Analysis.SpecialFunctions.Complex.LogBounds Mathlib.Analysis.SpecialFunctions.Complex.LogDeriv Mathlib.Analysis.SpecialFunctions.ExpDeriv Mathlib.Analysis.SpecialFunctions.Gamma.Basic Mathlib.Analysis.SpecialFunctions.Gamma.Beta Mathlib.Analysis.SpecialFunctions.Gamma.BohrMollerup Mathlib.Analysis.SpecialFunctions.Gamma.Deligne Mathlib.Analysis.SpecialFunctions.Gamma.Deriv Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform Mathlib.Analysis.SpecialFunctions.Gaussian.GaussianIntegral Mathlib.Analysis.SpecialFunctions.ImproperIntegrals Mathlib.Analysis.SpecialFunctions.Integrals Mathlib.Analysis.SpecialFunctions.JapaneseBracket Mathlib.Analysis.SpecialFunctions.Log.Deriv Mathlib.Analysis.SpecialFunctions.Log.NegMulLog Mathlib.Analysis.SpecialFunctions.Log.Summable Mathlib.Analysis.SpecialFunctions.NonIntegrable Mathlib.Analysis.SpecialFunctions.PolarCoord Mathlib.Analysis.SpecialFunctions.Pow.Deriv Mathlib.Analysis.SpecialFunctions.Pow.Integral Mathlib.Analysis.SpecialFunctions.SmoothTransition Mathlib.Analysis.SpecialFunctions.Stirling Mathlib.Analysis.SpecialFunctions.Trigonometric.ArctanDeriv Mathlib.Analysis.SpecialFunctions.Trigonometric.Bounds Mathlib.Analysis.SpecialFunctions.Trigonometric.ComplexDeriv Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd Mathlib.Analysis.SpecialFunctions.Trigonometric.InverseDeriv Mathlib.Analysis.SumIntegralComparisons Mathlib.Analysis.VonNeumannAlgebra.Basic Mathlib.Combinatorics.Additive.AP.Three.Behrend Mathlib.Combinatorics.Additive.Randomisation Mathlib.Combinatorics.Extremal.RuzsaSzemeredi Mathlib.Computability.AkraBazzi.AkraBazzi Mathlib.Data.Complex.ExponentialBounds Mathlib.Data.Real.Pi.Bounds Mathlib.Data.Real.Pi.Leibniz Mathlib.Data.Real.Pi.Wallis Mathlib.Dynamics.Ergodic.Action.OfMinimal Mathlib.Dynamics.Ergodic.AddCircle Mathlib.Geometry.Euclidean.Angle.Oriented.Affine Mathlib.Geometry.Euclidean.Angle.Oriented.Basic Mathlib.Geometry.Euclidean.Angle.Oriented.RightAngle Mathlib.Geometry.Euclidean.Angle.Oriented.Rotation Mathlib.Geometry.Euclidean.Angle.Sphere Mathlib.Geometry.Euclidean.Angle.Unoriented.Affine Mathlib.Geometry.Euclidean.Angle.Unoriented.Basic Mathlib.Geometry.Euclidean.Angle.Unoriented.Conformal Mathlib.Geometry.Euclidean.Angle.Unoriented.RightAngle Mathlib.Geometry.Euclidean.Basic Mathlib.Geometry.Euclidean.Circumcenter Mathlib.Geometry.Euclidean.Inversion.Basic Mathlib.Geometry.Euclidean.Inversion.Calculus Mathlib.Geometry.Euclidean.Inversion.ImageHyperplane Mathlib.Geometry.Euclidean.MongePoint Mathlib.Geometry.Euclidean.PerpBisector Mathlib.Geometry.Euclidean.Sphere.Basic Mathlib.Geometry.Euclidean.Sphere.Power Mathlib.Geometry.Euclidean.Sphere.Ptolemy Mathlib.Geometry.Euclidean.Sphere.SecondInter Mathlib.Geometry.Euclidean.Triangle Mathlib.Geometry.Manifold.Algebra.LeftInvariantDerivation Mathlib.Geometry.Manifold.Algebra.LieGroup Mathlib.Geometry.Manifold.Algebra.Monoid Mathlib.Geometry.Manifold.Algebra.SmoothFunctions Mathlib.Geometry.Manifold.Algebra.Structures Mathlib.Geometry.Manifold.AnalyticManifold Mathlib.Geometry.Manifold.BumpFunction Mathlib.Geometry.Manifold.Complex Mathlib.Geometry.Manifold.ContMDiff.Atlas Mathlib.Geometry.Manifold.ContMDiff.Basic Mathlib.Geometry.Manifold.ContMDiff.Defs Mathlib.Geometry.Manifold.ContMDiff.NormedSpace Mathlib.Geometry.Manifold.ContMDiff.Product Mathlib.Geometry.Manifold.ContMDiffMFDeriv Mathlib.Geometry.Manifold.ContMDiffMap Mathlib.Geometry.Manifold.DerivationBundle Mathlib.Geometry.Manifold.Diffeomorph Mathlib.Geometry.Manifold.Instances.Real Mathlib.Geometry.Manifold.Instances.Sphere Mathlib.Geometry.Manifold.Instances.UnitsOfNormedAlgebra Mathlib.Geometry.Manifold.IntegralCurve.Basic Mathlib.Geometry.Manifold.IntegralCurve.ExistUnique Mathlib.Geometry.Manifold.IntegralCurve.Transform Mathlib.Geometry.Manifold.IntegralCurve.UniformTime Mathlib.Geometry.Manifold.IsManifold.Basic Mathlib.Geometry.Manifold.IsManifold.InteriorBoundary Mathlib.Geometry.Manifold.LocalDiffeomorph Mathlib.Geometry.Manifold.MFDeriv.Atlas Mathlib.Geometry.Manifold.MFDeriv.Basic Mathlib.Geometry.Manifold.MFDeriv.Defs Mathlib.Geometry.Manifold.MFDeriv.FDeriv Mathlib.Geometry.Manifold.MFDeriv.NormedSpace Mathlib.Geometry.Manifold.MFDeriv.SpecificFunctions Mathlib.Geometry.Manifold.MFDeriv.Tangent Mathlib.Geometry.Manifold.MFDeriv.UniqueDifferential Mathlib.Geometry.Manifold.Metrizable Mathlib.Geometry.Manifold.PartitionOfUnity Mathlib.Geometry.Manifold.PoincareConjecture Mathlib.Geometry.Manifold.Sheaf.Smooth Mathlib.Geometry.Manifold.VectorBundle.Basic Mathlib.Geometry.Manifold.VectorBundle.FiberwiseLinear Mathlib.Geometry.Manifold.VectorBundle.Hom Mathlib.Geometry.Manifold.VectorBundle.MDifferentiable Mathlib.Geometry.Manifold.VectorBundle.Pullback Mathlib.Geometry.Manifold.VectorBundle.SmoothSection Mathlib.Geometry.Manifold.VectorBundle.Tangent Mathlib.Geometry.Manifold.VectorField Mathlib.Geometry.Manifold.WhitneyEmbedding Mathlib.LinearAlgebra.Matrix.Hermitian Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap Mathlib.MeasureTheory.Constructions.HaarToSphere Mathlib.MeasureTheory.Constructions.UnitInterval Mathlib.MeasureTheory.Covering.BesicovitchVectorSpace Mathlib.MeasureTheory.Covering.Besicovitch Mathlib.MeasureTheory.Covering.DensityTheorem Mathlib.MeasureTheory.Covering.Differentiation Mathlib.MeasureTheory.Covering.LiminfLimsup Mathlib.MeasureTheory.Covering.OneDim Mathlib.MeasureTheory.Decomposition.IntegralRNDeriv Mathlib.MeasureTheory.Decomposition.Lebesgue Mathlib.MeasureTheory.Decomposition.RadonNikodym Mathlib.MeasureTheory.Decomposition.SignedLebesgue Mathlib.MeasureTheory.Function.AEEqFun.DomAct Mathlib.MeasureTheory.Function.AEEqOfIntegral Mathlib.MeasureTheory.Function.ConditionalExpectation.AEMeasurable Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic Mathlib.MeasureTheory.Function.ConditionalExpectation.CondexpL1 Mathlib.MeasureTheory.Function.ConditionalExpectation.CondexpL2 Mathlib.MeasureTheory.Function.ConditionalExpectation.Indicator Mathlib.MeasureTheory.Function.ConditionalExpectation.Real Mathlib.MeasureTheory.Function.ConditionalExpectation.Unique Mathlib.MeasureTheory.Function.ContinuousMapDense Mathlib.MeasureTheory.Function.Intersectivity Mathlib.MeasureTheory.Function.Jacobian Mathlib.MeasureTheory.Function.L1Space.AEEqFun Mathlib.MeasureTheory.Function.L1Space.Integrable Mathlib.MeasureTheory.Function.L2Space Mathlib.MeasureTheory.Function.LocallyIntegrable Mathlib.MeasureTheory.Function.LpSpace.ContinuousCompMeasurePreserving Mathlib.MeasureTheory.Function.LpSpace.DomAct.Basic Mathlib.MeasureTheory.Function.LpSpace.DomAct.Continuous Mathlib.MeasureTheory.Function.SimpleFuncDenseLp Mathlib.MeasureTheory.Function.SpecialFunctions.Inner Mathlib.MeasureTheory.Function.SpecialFunctions.RCLike Mathlib.MeasureTheory.Function.StronglyMeasurable.Inner Mathlib.MeasureTheory.Function.StronglyMeasurable.Lemmas Mathlib.MeasureTheory.Function.StronglyMeasurable.Lp Mathlib.MeasureTheory.Function.UnifTight Mathlib.MeasureTheory.Function.UniformIntegrable Mathlib.MeasureTheory.Group.AddCircle Mathlib.MeasureTheory.Group.FundamentalDomain Mathlib.MeasureTheory.Group.GeometryOfNumbers Mathlib.MeasureTheory.Group.Integral Mathlib.MeasureTheory.Integral.Asymptotics Mathlib.MeasureTheory.Integral.Average Mathlib.MeasureTheory.Integral.Bochner Mathlib.MeasureTheory.Integral.BoundedContinuousFunction Mathlib.MeasureTheory.Integral.CircleIntegral Mathlib.MeasureTheory.Integral.CircleTransform Mathlib.MeasureTheory.Integral.DivergenceTheorem Mathlib.MeasureTheory.Integral.DominatedConvergence Mathlib.MeasureTheory.Integral.ExpDecay Mathlib.MeasureTheory.Integral.FundThmCalculus Mathlib.MeasureTheory.Integral.Gamma Mathlib.MeasureTheory.Integral.IntegrableOn Mathlib.MeasureTheory.Integral.IntegralEqImproper Mathlib.MeasureTheory.Integral.IntervalAverage Mathlib.MeasureTheory.Integral.IntervalIntegral Mathlib.MeasureTheory.Integral.Layercake Mathlib.MeasureTheory.Integral.PeakFunction Mathlib.MeasureTheory.Integral.Periodic Mathlib.MeasureTheory.Integral.Pi Mathlib.MeasureTheory.Integral.Prod Mathlib.MeasureTheory.Integral.SetIntegral Mathlib.MeasureTheory.Integral.SetToL1 Mathlib.MeasureTheory.Integral.TorusIntegral Mathlib.MeasureTheory.Integral.VitaliCaratheodory Mathlib.MeasureTheory.Measure.DiracProba Mathlib.MeasureTheory.Measure.FiniteMeasureProd Mathlib.MeasureTheory.Measure.FiniteMeasure Mathlib.MeasureTheory.Measure.Haar.Disintegration Mathlib.MeasureTheory.Measure.Haar.InnerProductSpace Mathlib.MeasureTheory.Measure.Haar.NormedSpace Mathlib.MeasureTheory.Measure.Haar.OfBasis Mathlib.MeasureTheory.Measure.Haar.Quotient Mathlib.MeasureTheory.Measure.Haar.Unique Mathlib.MeasureTheory.Measure.Hausdorff Mathlib.MeasureTheory.Measure.Lebesgue.Basic Mathlib.MeasureTheory.Measure.Lebesgue.Complex Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar Mathlib.MeasureTheory.Measure.Lebesgue.Integral Mathlib.MeasureTheory.Measure.Lebesgue.VolumeOfBalls Mathlib.MeasureTheory.Measure.LevyProkhorovMetric Mathlib.MeasureTheory.Measure.LogLikelihoodRatio Mathlib.MeasureTheory.Measure.Portmanteau Mathlib.MeasureTheory.Measure.ProbabilityMeasure Mathlib.MeasureTheory.Measure.SeparableMeasure Mathlib.MeasureTheory.Measure.Tilted Mathlib.MeasureTheory.Measure.WithDensityFinite Mathlib.MeasureTheory.Order.UpperLower Mathlib.MeasureTheory.VectorMeasure.WithDensity Mathlib.NumberTheory.AbelSummation Mathlib.NumberTheory.Bertrand Mathlib.NumberTheory.EulerProduct.ExpLog Mathlib.NumberTheory.Harmonic.Bounds Mathlib.NumberTheory.Harmonic.EulerMascheroni Mathlib.NumberTheory.Harmonic.GammaDeriv Mathlib.NumberTheory.LSeries.AbstractFuncEq Mathlib.NumberTheory.LSeries.Basic Mathlib.NumberTheory.LSeries.Convergence Mathlib.NumberTheory.LSeries.Convolution Mathlib.NumberTheory.LSeries.Deriv Mathlib.NumberTheory.LSeries.Injectivity Mathlib.NumberTheory.LSeries.Linearity Mathlib.NumberTheory.LSeries.MellinEqDirichlet Mathlib.NumberTheory.LSeries.Positivity Mathlib.NumberTheory.LSeries.SumCoeff Mathlib.NumberTheory.SiegelsLemma Mathlib.NumberTheory.WellApproximable Mathlib.Probability.BorelCantelli Mathlib.Probability.CDF Mathlib.Probability.CondVar Mathlib.Probability.ConditionalExpectation Mathlib.Probability.Density Mathlib.Probability.Distributions.Exponential Mathlib.Probability.Distributions.Gamma Mathlib.Probability.Distributions.Gaussian Mathlib.Probability.Distributions.Pareto Mathlib.Probability.Distributions.Uniform Mathlib.Probability.IdentDistrib Mathlib.Probability.Independence.Conditional Mathlib.Probability.Independence.Integrable Mathlib.Probability.Independence.ZeroOne Mathlib.Probability.Integration Mathlib.Probability.Kernel.Composition.IntegralCompProd Mathlib.Probability.Kernel.Composition.Lemmas Mathlib.Probability.Kernel.Composition.MeasureCompProd Mathlib.Probability.Kernel.Composition.MeasureComp Mathlib.Probability.Kernel.CondDistrib Mathlib.Probability.Kernel.Condexp Mathlib.Probability.Kernel.Disintegration.Basic Mathlib.Probability.Kernel.Disintegration.CDFToKernel Mathlib.Probability.Kernel.Disintegration.CondCDF Mathlib.Probability.Kernel.Disintegration.Density Mathlib.Probability.Kernel.Disintegration.Integral Mathlib.Probability.Kernel.Disintegration.StandardBorel Mathlib.Probability.Kernel.Disintegration.Unique Mathlib.Probability.Kernel.Integral Mathlib.Probability.Kernel.MeasurableIntegral Mathlib.Probability.Kernel.RadonNikodym Mathlib.Probability.Kernel.WithDensity Mathlib.Probability.Martingale.Basic Mathlib.Probability.Martingale.BorelCantelli Mathlib.Probability.Martingale.Centering Mathlib.Probability.Martingale.Convergence Mathlib.Probability.Martingale.OptionalSampling Mathlib.Probability.Martingale.OptionalStopping Mathlib.Probability.Martingale.Upcrossing Mathlib.Probability.Moments.Basic Mathlib.Probability.Moments.ComplexMGF Mathlib.Probability.Moments.IntegrableExpMul Mathlib.Probability.Moments.MGFAnalytic Mathlib.Probability.Notation Mathlib.Probability.ProbabilityMassFunction.Integrals Mathlib.Probability.Process.Adapted Mathlib.Probability.Process.Filtration Mathlib.Probability.Process.HittingTime Mathlib.Probability.Process.PartitionFiltration Mathlib.Probability.Process.Stopping Mathlib.Probability.StrongLaw Mathlib.Probability.Variance Mathlib.RingTheory.Polynomial.Hermite.Gaussian Mathlib.Tactic.FunProp.ContDiff Mathlib.Tactic.FunProp.Differentiable Mathlib.Topology.Algebra.Module.FiniteDimension Mathlib.Topology.CWComplex Mathlib.Topology.Category.TopCat.Sphere Mathlib.Topology.MetricSpace.HausdorffDimension
-7
Mathlib.Geometry.Manifold.Sheaf.LocallyRingedSpace -2
67 files Mathlib.Algebra.Algebra.Basic Mathlib.Algebra.Algebra.Equiv Mathlib.Algebra.Algebra.Hom.Rat Mathlib.Algebra.Algebra.Hom Mathlib.Algebra.Algebra.NonUnitalHom Mathlib.Algebra.Algebra.Opposite Mathlib.Algebra.Algebra.Pi Mathlib.Algebra.Algebra.Prod Mathlib.Algebra.Category.Grp.Biproducts Mathlib.Algebra.Category.Grp.FilteredColimits Mathlib.Algebra.Category.Grp.Limits Mathlib.Algebra.Category.MonCat.FilteredColimits Mathlib.Algebra.Category.MonCat.Limits Mathlib.Algebra.Category.Ring.FilteredColimits Mathlib.Algebra.Category.Ring.Limits Mathlib.Algebra.Equiv.TransferInstance Mathlib.Algebra.Group.AddChar Mathlib.Algebra.Homology.Embedding.RestrictionHomology Mathlib.Algebra.Homology.ExactSequence Mathlib.Algebra.Homology.Factorizations.Basic Mathlib.Algebra.Homology.HomologicalComplexAbelian Mathlib.Algebra.Homology.HomologySequence Mathlib.Algebra.Homology.Refinements Mathlib.Algebra.Homology.ShortComplex.ExactFunctor Mathlib.Algebra.Homology.ShortComplex.Exact Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex Mathlib.Algebra.Homology.ShortComplex.Preadditive Mathlib.Algebra.Homology.ShortComplex.ShortExact Mathlib.Algebra.Homology.ShortComplex.SnakeLemma Mathlib.Algebra.Homology.SingleHomology Mathlib.Algebra.Lie.NonUnitalNonAssocAlgebra Mathlib.Algebra.Small.Group Mathlib.Algebra.Small.Module Mathlib.Algebra.Small.Ring Mathlib.Algebra.Star.StarAlgHom Mathlib.AlgebraicTopology.AlternatingFaceMapComplex Mathlib.AlgebraicTopology.DoldKan.Notations Mathlib.CategoryTheory.Abelian.DiagramLemmas.Four Mathlib.CategoryTheory.Abelian.EpiWithInjectiveKernel Mathlib.CategoryTheory.Abelian.Exact Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Basic Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.FunctorCategory Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Sheaf Mathlib.CategoryTheory.Abelian.GrothendieckCategory Mathlib.CategoryTheory.Abelian.Opposite Mathlib.CategoryTheory.Abelian.Refinements Mathlib.CategoryTheory.Abelian.Transfer Mathlib.CategoryTheory.Adjunction.Additive Mathlib.CategoryTheory.Galois.Basic Mathlib.CategoryTheory.Galois.Decomposition Mathlib.CategoryTheory.Galois.GaloisObjects Mathlib.CategoryTheory.Galois.Prorepresentability Mathlib.CategoryTheory.Generator.Abelian Mathlib.CategoryTheory.Generator.Preadditive Mathlib.CategoryTheory.Linear.Yoneda Mathlib.CategoryTheory.Localization.CalculusOfFractions.Preadditive Mathlib.CategoryTheory.Preadditive.Opposite Mathlib.CategoryTheory.Preadditive.Transfer Mathlib.CategoryTheory.Preadditive.Yoneda.Basic Mathlib.CategoryTheory.Preadditive.Yoneda.Projective Mathlib.CategoryTheory.Shift.Opposite Mathlib.CategoryTheory.Shift.ShiftedHomOpposite Mathlib.CategoryTheory.Sites.Abelian Mathlib.CategoryTheory.Triangulated.Opposite.Basic Mathlib.CategoryTheory.Triangulated.Opposite.Triangle Mathlib.Geometry.RingedSpace.Basic Mathlib.MeasureTheory.Constructions.AddChar
-1

Declarations diff

+ Algebra.charZero_of_charZero
+ FaithfulSMul.ker_algebraMap_eq_bot
+ FaithfulSMul.of_field_isFractionRing
+ NoZeroSMulDivisors.iff_ker_algebraMap_eq_bot
+ NoZeroSMulDivisors.ker_algebraMap_eq_bot
+ NoZeroSMulDivisors.of_ker_algebraMap_eq_bot
+ NoZeroSMulDivisors.trans_faithfulSMul
+ _root_.NeZero.of_faithfulSMul
+ _root_.NoZeroSMulDivisors.algebraMap_eq_one_iff
+ _root_.NoZeroSMulDivisors.algebraMap_eq_zero_iff
+ _root_.NoZeroSMulDivisors.algebraMap_injective
+ algebraMap_comp_intCast
+ algebraMap_comp_natCast
+ faithfulSMul_iff_algebraMap_injective
+ faithfulSMul_iff_injective_smul_one
+ iff_faithfulSMul
+ instFaithfulSMul
+ instance (R : Type*) [NonAssocSemiring R] : FaithfulSMul R R := ⟨fun {r₁ r₂} h ↦ by simpa using h 1⟩
+ instance (priority := 100) (R : Type*) [Ring R] [CharZero R] : FaithfulSMul ℤ R := by
+ instance (priority := 100) : FaithfulSMul R K
+ instance (priority := 100) [CharZero R] : FaithfulSMul ℕ R := by
+ instance (priority := 100) [IsDomain R] : NoZeroSMulDivisors R M := by
+ instance (priority := 100) instOfFaithfulSMul {R A : Type*}
+ instance [Algebra R A] [FaithfulSMul R A] : FaithfulSMul R (FractionRing A) := by
+ instance [IsFractionRing A K] : NoZeroSMulDivisors A (CyclotomicField n K) := by
+ instance [Nontrivial A] [NoZeroSMulDivisors R A] : FaithfulSMul R A
- CyclotomicField.noZeroSMulDivisors
- NoZeroSMulDivisors.trans
- iff_ker_algebraMap_eq_bot
- instance (priority := 100) CharZero.noZeroSMulDivisors_int [Ring R] [NoZeroDivisors R]
- instance (priority := 100) CharZero.noZeroSMulDivisors_nat [Semiring R] [NoZeroDivisors R]
- instance (priority := 100) [NoZeroDivisors K] : NoZeroSMulDivisors R K
- instance [Algebra R A] [NoZeroSMulDivisors R A] : NoZeroSMulDivisors R (FractionRing A) := by
- instance [IsDomain R] : NoZeroSMulDivisors R M := by
- instance [P.IsPrime] : NoZeroSMulDivisors (A ⧸ p) (B ⧸ P)
- ker_algebraMap_eq_bot
- of_ker_algebraMap_eq_bot

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

@ocfnash
Copy link
Copy Markdown
Contributor Author

ocfnash commented Jan 31, 2025

!bench

@leanprover-bot
Copy link
Copy Markdown
Collaborator

Here are the benchmark results for commit c083b02.
The entire run failed.
Found no significant differences.

I am witnessing a bizarre situation where everything builds fine,
including `inftyValuation.polynomial` (which typechecks very quickly)
but the `simpNF` linter falls over reporting:
```
/- The `simpNF` linter reports:
SOME SIMP LEMMAS ARE NOT IN SIMP-NORMAL FORM.
see note [simp-normal form] for tips how to debug this.
https://leanprover-community.github.io/mathlib_docs/notes.html#simp-normal%20form -/
-- Mathlib.NumberTheory.FunctionField
././././Mathlib/NumberTheory/FunctionField.lean:210:1: error: FunctionField.inftyValuation.polynomial LINTER FAILED:
simplify fails on left-hand side:
failed to synthesize
  FaithfulSMul (Polynomial Fq) (RatFunc Fq)
(deterministic) timeout at `typeclass`, maximum number of heartbeats (20000) has been reached
Use `set_option synthInstance.maxHeartbeats <num>` to set the limit.
```

This change is a test (which I hope is not successful) to check whether
it is the new form of this proof which triggers the failure.
Somewhat mitigated by the fact that this is only a conditional simp
lemma (i.e., it needs the hypothesis `p ≠ 0`).
@ocfnash
Copy link
Copy Markdown
Contributor Author

ocfnash commented Jan 31, 2025

!bench

@leanprover-bot
Copy link
Copy Markdown
Collaborator

Here are the benchmark results for commit 9b13d1b.
There were significant changes against commit c7a5e3b:

  Benchmark                                 Metric         Change
  ===============================================================
- ~Mathlib.Algebra.Lie.Weights.RootSystem   instructions     5.8%
- ~Mathlib.FieldTheory.Galois.Infinite      instructions    16.5%
- ~Mathlib.FieldTheory.IsAlgClosed.Basic    instructions     9.1%

@github-actions
Copy link
Copy Markdown

File Instructions %
build +123.646⬝10⁹ (+0.08%)
lint +5.964⬝10⁹ (+0.07%)
2 files, Instructions +11.0⬝10⁹
File Instructions %
Mathlib.Algebra.Lie.Weights.RootSystem +11.455⬝10⁹ (+5.79%)
Mathlib.FieldTheory.IsAlgClosed.Basic +11.27⬝10⁹ (+9.11%)
File Instructions %
Mathlib.FieldTheory.Galois.Infinite +10.725⬝10⁹ (+16.51%)
Mathlib.RingTheory.TensorProduct.Nontrivial +8.347⬝10⁹ (+40.50%)
Mathlib.RingTheory.Valuation.LocalSubring +7.161⬝10⁹ (+18.24%)
Mathlib.LinearAlgebra.Orientation +5.965⬝10⁹ (+7.09%)
Mathlib.NumberTheory.NumberField.Norm +4.550⬝10⁹ (+16.75%)
3 files, Instructions +3.0⬝10⁹
File Instructions %
Mathlib.RingTheory.Spectrum.Prime.Polynomial +3.615⬝10⁹ (+2.71%)
Mathlib.FieldTheory.SeparableDegree +3.558⬝10⁹ (+2.34%)
Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure +3.394⬝10⁹ (+6.65%)
6 files, Instructions +2.0⬝10⁹
File Instructions %
Mathlib.NumberTheory.LSeries.ZMod +2.982⬝10⁹ (+4.94%)
Mathlib.FieldTheory.Minpoly.IsConjRoot +2.685⬝10⁹ (+9.28%)
Mathlib.Algebra.Module.ZLattice.Basic +2.461⬝10⁹ (+1.76%)
Mathlib.Algebra.Module.Presentation.Differentials +2.439⬝10⁹ (+3.88%)
Mathlib.RingTheory.Unramified.Field +2.342⬝10⁹ (+3.83%)
Mathlib.NumberTheory.NumberField.Embeddings +2.35⬝10⁹ (+1.97%)
17 files, Instructions +1.0⬝10⁹
File Instructions %
Mathlib.FieldTheory.PurelyInseparable +1.991⬝10⁹ (+1.21%)
Mathlib.FieldTheory.Normal.Closure +1.882⬝10⁹ (+4.26%)
Mathlib.RingTheory.IntegralClosure.IntegralRestrict +1.837⬝10⁹ (+0.76%)
Mathlib.FieldTheory.IsSepClosed +1.668⬝10⁹ (+6.87%)
Mathlib.Analysis.Convex.Birkhoff +1.635⬝10⁹ (+4.69%)
Mathlib.Algebra.Algebra.Basic +1.574⬝10⁹ (+5.50%)
Mathlib.FieldTheory.Extension +1.565⬝10⁹ (+1.32%)
Mathlib.NumberTheory.RamificationInertia.Basic +1.536⬝10⁹ (+0.77%)
Mathlib.NumberTheory.NumberField.CanonicalEmbedding.ConvexBody +1.504⬝10⁹ (+1.11%)
Mathlib.NumberTheory.Cyclotomic.Rat +1.502⬝10⁹ (+1.33%)
Mathlib.FieldTheory.SeparableClosure +1.500⬝10⁹ (+2.90%)
Mathlib.Algebra.Lie.TraceForm +1.398⬝10⁹ (+0.80%)
Mathlib.NumberTheory.Padics.MahlerBasis +1.256⬝10⁹ (+3.20%)
Mathlib.FieldTheory.Isaacs +1.238⬝10⁹ (+5.84%)
Mathlib.Algebra.Lie.Weights.Killing +1.223⬝10⁹ (+0.57%)
Mathlib.RingTheory.Extension +1.143⬝10⁹ (+0.67%)
Mathlib.Analysis.Complex.Polynomial.Basic +1.136⬝10⁹ (+4.22%)
4 files, Instructions -2.0⬝10⁹
File Instructions %
Mathlib.NumberTheory.KummerDedekind -1.36⬝10⁹ (-1.28%)
Mathlib.RingTheory.Ideal.Over -1.48⬝10⁹ (-1.28%)
Mathlib.RingTheory.Localization.FractionRing -1.517⬝10⁹ (-2.68%)
Mathlib.NumberTheory.NumberField.Discriminant.Basic -1.988⬝10⁹ (-1.34%)

CI run

…rmance impact.

It seems unlikely this should matter but maybe worth testing.

Also fixing an unrelated naming issue.
@ocfnash
Copy link
Copy Markdown
Contributor Author

ocfnash commented Jan 31, 2025

!bench

@leanprover-bot
Copy link
Copy Markdown
Collaborator

Here are the benchmark results for commit 9ae2bbc.
There were significant changes against commit c7a5e3b:

  Benchmark                                 Metric         Change
  ===============================================================
- ~Mathlib.Algebra.Lie.Weights.RootSystem   instructions     5.8%
- ~Mathlib.FieldTheory.Galois.Infinite      instructions    16.4%
- ~Mathlib.FieldTheory.IsAlgClosed.Basic    instructions     9.6%

@github-actions
Copy link
Copy Markdown

File Instructions %
build +120.337⬝10⁹ (+0.07%)
lint +5.916⬝10⁹ (+0.07%)
2 files, Instructions +11.0⬝10⁹
File Instructions %
Mathlib.FieldTheory.IsAlgClosed.Basic +11.664⬝10⁹ (+9.63%)
Mathlib.Algebra.Lie.Weights.RootSystem +11.458⬝10⁹ (+5.79%)
File Instructions %
Mathlib.FieldTheory.Galois.Infinite +10.644⬝10⁹ (+16.38%)
Mathlib.RingTheory.TensorProduct.Nontrivial +8.346⬝10⁹ (+40.49%)
Mathlib.RingTheory.Valuation.LocalSubring +7.159⬝10⁹ (+18.23%)
Mathlib.LinearAlgebra.Orientation +5.967⬝10⁹ (+7.10%)
Mathlib.NumberTheory.NumberField.Norm +4.548⬝10⁹ (+16.74%)
3 files, Instructions +3.0⬝10⁹
File Instructions %
Mathlib.RingTheory.Spectrum.Prime.Polynomial +3.618⬝10⁹ (+2.71%)
Mathlib.FieldTheory.SeparableDegree +3.394⬝10⁹ (+2.23%)
Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure +3.382⬝10⁹ (+6.62%)
7 files, Instructions +2.0⬝10⁹
File Instructions %
Mathlib.NumberTheory.LSeries.ZMod +2.983⬝10⁹ (+4.94%)
Mathlib.FieldTheory.Minpoly.IsConjRoot +2.684⬝10⁹ (+9.28%)
Mathlib.Algebra.Module.ZLattice.Basic +2.463⬝10⁹ (+1.76%)
Mathlib.Algebra.Module.Presentation.Differentials +2.448⬝10⁹ (+3.89%)
Mathlib.RingTheory.Unramified.Field +2.345⬝10⁹ (+3.83%)
Mathlib.FieldTheory.PurelyInseparable +2.81⬝10⁹ (+1.27%)
Mathlib.NumberTheory.NumberField.Embeddings +2.28⬝10⁹ (+1.96%)
16 files, Instructions +1.0⬝10⁹
File Instructions %
Mathlib.FieldTheory.Normal.Closure +1.872⬝10⁹ (+4.23%)
Mathlib.RingTheory.IntegralClosure.IntegralRestrict +1.846⬝10⁹ (+0.76%)
Mathlib.FieldTheory.IsSepClosed +1.750⬝10⁹ (+7.20%)
Mathlib.NumberTheory.RamificationInertia.Basic +1.716⬝10⁹ (+0.86%)
Mathlib.Analysis.Convex.Birkhoff +1.633⬝10⁹ (+4.69%)
Mathlib.FieldTheory.Extension +1.588⬝10⁹ (+1.34%)
Mathlib.NumberTheory.NumberField.CanonicalEmbedding.ConvexBody +1.509⬝10⁹ (+1.11%)
Mathlib.NumberTheory.Cyclotomic.Rat +1.503⬝10⁹ (+1.33%)
Mathlib.FieldTheory.SeparableClosure +1.493⬝10⁹ (+2.89%)
Mathlib.Algebra.Lie.TraceForm +1.398⬝10⁹ (+0.80%)
Mathlib.NumberTheory.Padics.MahlerBasis +1.341⬝10⁹ (+3.42%)
Mathlib.FieldTheory.Isaacs +1.236⬝10⁹ (+5.83%)
Mathlib.Algebra.Lie.Weights.Killing +1.223⬝10⁹ (+0.57%)
Mathlib.Algebra.Algebra.Basic +1.153⬝10⁹ (+4.03%)
Mathlib.RingTheory.Extension +1.150⬝10⁹ (+0.67%)
Mathlib.Analysis.Complex.Polynomial.Basic +1.135⬝10⁹ (+4.22%)
5 files, Instructions -2.0⬝10⁹
File Instructions %
Mathlib.RingTheory.Ideal.Over -1.51⬝10⁹ (-1.29%)
Mathlib.NumberTheory.KummerDedekind -1.58⬝10⁹ (-1.31%)
Mathlib.Data.Array.Lemmas -1.91⬝10⁹ (-24.58%)
Mathlib.RingTheory.Localization.FractionRing -1.326⬝10⁹ (-2.34%)
Mathlib.NumberTheory.NumberField.Discriminant.Basic -1.989⬝10⁹ (-1.34%)

CI run

@ocfnash ocfnash added awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. and removed WIP Work in progress labels Jan 31, 2025
@github-actions github-actions bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Jan 31, 2025
@leanprover-bot
Copy link
Copy Markdown
Collaborator

Here are the benchmark results for commit 3c55810.
There were significant changes against commit c7a5e3b:

  Benchmark                                 Metric         Change
  ===============================================================
+ ~Mathlib.Algebra.Lie.Weights.RootSystem   instructions   -17.9%

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 1, 2025

File Instructions %
build -37.761⬝10⁹ (-0.02%)
lint +5.47⬝10⁹ (+0.06%)
Mathlib.RingTheory.TensorProduct.Nontrivial +8.343⬝10⁹ (+40.47%)
Mathlib.RingTheory.Valuation.LocalSubring +7.429⬝10⁹ (+18.92%)
2 files, Instructions +3.0⬝10⁹
File Instructions %
Mathlib.RingTheory.Spectrum.Prime.Polynomial +3.507⬝10⁹ (+2.63%)
Mathlib.FieldTheory.IsAlgClosed.Basic +3.329⬝10⁹ (+2.75%)
File Instructions %
Mathlib.Algebra.Module.Presentation.Differentials +2.441⬝10⁹ (+3.88%)
4 files, Instructions +1.0⬝10⁹
File Instructions %
Mathlib.RingTheory.IntegralClosure.IntegralRestrict +1.683⬝10⁹ (+0.70%)
Mathlib.Algebra.Algebra.Basic +1.644⬝10⁹ (+5.75%)
Mathlib.NumberTheory.Padics.MahlerBasis +1.382⬝10⁹ (+3.52%)
Mathlib.RingTheory.Extension +1.142⬝10⁹ (+0.67%)
8 files, Instructions -2.0⬝10⁹
File Instructions %
Mathlib.NumberTheory.NumberField.Embeddings -1.0⬝10⁹ (-0.96%)
Mathlib.NumberTheory.KummerDedekind -1.30⬝10⁹ (-1.28%)
Mathlib.RingTheory.Ideal.Over -1.55⬝10⁹ (-1.29%)
Mathlib.Algebra.Module.ZLattice.Covolume -1.374⬝10⁹ (-2.14%)
Mathlib.RingTheory.Localization.FractionRing -1.380⬝10⁹ (-2.44%)
Mathlib.NumberTheory.NumberField.Basic -1.600⬝10⁹ (-3.18%)
Mathlib.NumberTheory.Cyclotomic.Rat -1.818⬝10⁹ (-1.61%)
Mathlib.Algebra.Lie.Weights.Killing -1.844⬝10⁹ (-0.86%)
File Instructions %
Mathlib.NumberTheory.NumberField.Discriminant.Basic -2.914⬝10⁹ (-1.97%)
Mathlib.NumberTheory.LSeries.ZMod -4.105⬝10⁹ (-6.80%)
Mathlib.Algebra.Module.ZLattice.Basic -9.352⬝10⁹ (-6.69%)
Mathlib.Algebra.Lie.Weights.RootSystem -35.371⬝10⁹ (-17.89%)
CI run

@ocfnash ocfnash requested a review from alreadydone February 1, 2025 14:37
Copy link
Copy Markdown
Contributor

@alreadydone alreadydone left a comment

Choose a reason for hiding this comment

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

Thanks!

Comment on lines 210 to 212

@[simp]
theorem inftyValuation.polynomial {p : Fq[X]} (hp : p ≠ 0) :
inftyValuationDef Fq (algebraMap Fq[X] (RatFunc Fq) p) =
Multiplicative.ofAdd (p.natDegree : ℤ) := 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.

add a comment maybe?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'd like to test this in isolation so I will come back to this after everything else has built.

It is a legacy of a bizarre situation where I saw everything build fine, including inftyValuation.polynomial (which typechecked very quickly) but the simpNF linter fell over reporting:

/- The `simpNF` linter reports:
SOME SIMP LEMMAS ARE NOT IN SIMP-NORMAL FORM.
see note [simp-normal form] for tips how to debug this.
https://leanprover-community.github.io/mathlib_docs/notes.html#simp-normal%20form -/
-- Mathlib.NumberTheory.FunctionField
././././Mathlib/NumberTheory/FunctionField.lean:210:1: error: FunctionField.inftyValuation.polynomial LINTER FAILED:
simplify fails on left-hand side:
failed to synthesize
  FaithfulSMul (Polynomial Fq) (RatFunc Fq)
(deterministic) timeout at `typeclass`, maximum number of heartbeats (20000) has been reached
Use `set_option synthInstance.maxHeartbeats <num>` to set the limit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I just ran lake exe runLinter Mathlib locally twice and confirmed that the above simpNF error occurs iff this @[simp] is present. I do not understand why.

Copy link
Copy Markdown
Contributor Author

@ocfnash ocfnash Feb 2, 2025

Choose a reason for hiding this comment

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

I asked about this here

Added a comment with a link there.

…d n K)`

On further reflection, I have convinced myself it is best to avoid all
possible refactoring while making the other changes in this PR.
Copy link
Copy Markdown
Contributor

@alreadydone alreadydone left a comment

Choose a reason for hiding this comment

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

Thanks 🎉
maintainer delegate

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 2, 2025

🚀 Pull request has been placed on the maintainer queue by alreadydone.

@github-actions github-actions bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Feb 2, 2025
@Ruben-VandeVelde Ruben-VandeVelde changed the title feat: generalise algebraMap_injective by weaking its typeclass assumptions feat: generalise algebraMap_injective by weakening its typeclass assumptions Feb 2, 2025
ocfnash and others added 2 commits February 2, 2025 20:31
Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>
@riccardobrasca
Copy link
Copy Markdown
Member

Thanks!

bors d+

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Feb 3, 2025

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

@ghost ghost added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. labels Feb 3, 2025
@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Feb 3, 2025
@github-actions github-actions bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Feb 3, 2025
@ocfnash
Copy link
Copy Markdown
Contributor Author

ocfnash commented Feb 3, 2025

bors merge

@ghost ghost added the ready-to-merge This PR has been sent to bors. label Feb 3, 2025
mathlib-bors bot pushed a commit that referenced this pull request Feb 3, 2025
…sumptions (#21287)

As shown in the new lemma `faithfulSMul_iff_algebraMap_injective`, injectivity of `algebraMap R A` is equivalent to the typeclass hypothesis `[FaithfulSMul R A]`. We thus generalise (and rename) the existing lemma `NoZeroSMulDivisors.algebraMap_injective` to `FaithfulSMul.algebraMap_injective`. The rename is responsible for much of the diff.

By weakening the assumptions `[Nontrivial A] [NoZeroSMulDivisors R A]` to just `[FaithfulSMul R A]`, results which need to use `algebraMap_injective` can be applied in the case that we have `[Ring A] [CharZero A]` but fail to have `[NoZeroSMulDivisors ℤ A]`. This is the motivation for these changes.

There are quite a few places in the library where a lemma consumes an explicit argument of the form `Injective (algebraMap R A)`. Most / all of these should probably be restated to accept the typeclass argument `[FaithfulSMul R A]` but we do not attempt such a refactor here.



Co-authored-by: Oliver Nash <7734364+ocfnash@users.noreply.github.com>
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Feb 3, 2025

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: generalise algebraMap_injective by weakening its typeclass assumptions [Merged by Bors] - feat: generalise algebraMap_injective by weakening its typeclass assumptions Feb 3, 2025
@mathlib-bors mathlib-bors bot closed this Feb 3, 2025
@mathlib-bors mathlib-bors bot deleted the ocfnash/alg_inj branch February 3, 2025 14:57
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). ready-to-merge This PR has been sent to bors. t-algebra Algebra (groups, rings, fields, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants