Skip to content

[Merged by Bors] - feat: finset of pairs of divisors of an integer - #21912

Closed
YaelDillies wants to merge 3 commits into
masterfrom
int_divisors_antidiag
Closed

YaelDillies wants to merge 3 commits into
masterfrom
int_divisors_antidiag

Conversation

@YaelDillies

@YaelDillies YaelDillies commented Feb 15, 2025 •

Copy link
Copy Markdown
Contributor

Compute the antidiagonal of divisors of an integer z, namely the finset of pairs (a, b) : ℤ × ℤ such that a * b = n (unless z = 0, in which case we set the finset to be empty by convention).


Open in Gitpod

@github-actions github-actions Bot added the large-import Automatically added label for PRs with a significant increase in transitive imports label Feb 15, 2025
@github-actions

github-actions Bot commented Feb 15, 2025 •

Copy link
Copy Markdown

PR summary 2b103c0419

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.NumberTheory.Divisors 628 639 +11 (+1.75%)
Import changes for all files
Files Import difference
66 files Mathlib.Algebra.Algebra.ZMod Mathlib.Algebra.CharP.CharAndCard Mathlib.Algebra.CharP.Two Mathlib.Algebra.Field.NegOnePow Mathlib.Algebra.Field.ZMod Mathlib.Algebra.Homology.BifunctorAssociator Mathlib.Algebra.Homology.BifunctorFlip Mathlib.Algebra.Homology.Bifunctor Mathlib.Algebra.Homology.ComplexShapeSigns Mathlib.Algebra.Homology.Monoidal Mathlib.Algebra.Homology.TotalComplexSymmetry Mathlib.Algebra.Homology.TotalComplex Mathlib.Algebra.Order.Antidiag.Nat Mathlib.Algebra.Order.Chebyshev Mathlib.Algebra.Ring.NegOnePow Mathlib.Algebra.Ring.Periodic Mathlib.CategoryTheory.Triangulated.Functor Mathlib.CategoryTheory.Triangulated.Pretriangulated Mathlib.CategoryTheory.Triangulated.TStructure.Basic Mathlib.CategoryTheory.Triangulated.TriangleShift Mathlib.CategoryTheory.Triangulated.Triangulated Mathlib.Combinatorics.SimpleGraph.DegreeSum Mathlib.Combinatorics.SimpleGraph.Matching Mathlib.Combinatorics.SimpleGraph.UniversalVerts Mathlib.Data.Finset.NatDivisors Mathlib.Data.Nat.Factorization.PrimePow Mathlib.Data.Nat.Periodic Mathlib.Data.Nat.Squarefree Mathlib.Data.Nat.Totient Mathlib.Data.ZMod.Aut Mathlib.Data.ZMod.Basic Mathlib.Data.ZMod.Factorial Mathlib.Data.ZMod.IntUnitsPower Mathlib.Data.ZMod.Units Mathlib.Data.ZMod.ValMinAbs Mathlib.GroupTheory.CommutingProbability Mathlib.GroupTheory.Exponent Mathlib.GroupTheory.FixedPointFree Mathlib.GroupTheory.GroupAction.Period Mathlib.GroupTheory.NoncommPiCoprod Mathlib.GroupTheory.OrderOfElement Mathlib.GroupTheory.Perm.Centralizer Mathlib.GroupTheory.Perm.Closure Mathlib.GroupTheory.Perm.ConjAct Mathlib.GroupTheory.Perm.Cycle.Basic Mathlib.GroupTheory.Perm.Cycle.Concrete Mathlib.GroupTheory.Perm.Cycle.Factors Mathlib.GroupTheory.Perm.Cycle.PossibleTypes Mathlib.GroupTheory.Perm.Cycle.Type Mathlib.GroupTheory.Perm.Fin Mathlib.GroupTheory.Perm.Finite Mathlib.GroupTheory.SpecificGroups.Dihedral Mathlib.LinearAlgebra.FiniteSpan Mathlib.NumberTheory.ArithmeticFunction Mathlib.NumberTheory.DirichletCharacter.Basic Mathlib.NumberTheory.FactorisationProperties Mathlib.NumberTheory.LegendreSymbol.ZModChar Mathlib.NumberTheory.LucasLehmer Mathlib.NumberTheory.MaricaSchoenheim Mathlib.NumberTheory.MulChar.Basic Mathlib.NumberTheory.Padics.PadicNorm Mathlib.NumberTheory.Padics.PadicVal.Basic Mathlib.NumberTheory.PrimeCounting Mathlib.NumberTheory.SmoothNumbers Mathlib.RingTheory.Fintype Mathlib.SetTheory.Nimber.Field
1
Mathlib.NumberTheory.Divisors 11

Declarations diff

+ cast_eq_neg_cast
+ divisorsAntidiag
+ divisorsAntidiag_natCast
+ divisorsAntidiag_neg
+ divisorsAntidiag_neg_natCast
+ divisorsAntidiag_ofNat
+ divisorsAntidiag_zero
+ map_neg_divisorsAntidiag
+ map_prodComm_divisorsAntidiag
+ mem_divisorsAntidiag
+ neg_cast_eq_cast
+ neg_mem_divisorsAntidiag
+ swap_mem_divisorsAntidiag
++ prodMk_mem_divisorsAntidiag

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

@github-actions github-actions Bot added the t-number-theory Number theory (also use t-algebra or t-analysis to specialize) label Feb 15, 2025
`n.divisorsAntidiagonal` is the finset of pairs `(a, b) : ℕ × ℕ` such that `a * b = n`.
As a special case, `Nat.divisorsAntidiagonal 0 = ∅`.

O(n). -/

@eric-wieser eric-wieser Feb 15, 2025 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I put it to you that "$O(n)$." is not a full sentence.

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.

Comment thread Mathlib/NumberTheory/Divisors.lean Resolved
Comment thread Mathlib/NumberTheory/Divisors.lean Resolved
Comment thread Mathlib/NumberTheory/Divisors.lean Resolved
Comment thread Mathlib/NumberTheory/Divisors.lean Resolved
@eric-wieser eric-wieser added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Feb 15, 2025
@YaelDillies YaelDillies mentioned this pull request Feb 15, 2025
2 tasks done
Comment thread Mathlib/NumberTheory/Divisors.lean Resolved
Comment thread Mathlib/NumberTheory/Divisors.lean Resolved
Comment thread Mathlib/NumberTheory/Divisors.lean Resolved
@YaelDillies YaelDillies removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Feb 15, 2025
Comment thread Mathlib/NumberTheory/Divisors.lean Resolved

@eric-wieser eric-wieser left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some more (simp) lemma ideas:

  • divisorsAntidiag (-z) = (divisorsAntidiag z).map _
  • divisorsAntidiag (ofNat(n)) = disjUnion (Nat.divisorsAntidiag n).map ...

@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Feb 15, 2025
@YaelDillies
YaelDillies force-pushed the int_divisors_antidiag branch from 7011fbe to becfceb Compare February 16, 2025 11:41
@github-actions github-actions Bot removed the large-import Automatically added label for PRs with a significant increase in transitive imports label Feb 16, 2025
Compute the antidiagonal of divisors of an integer `z`, namely the finset of pairs `(a, b) : ℤ × ℤ` such that `a * b = n` (unless `z = 0`, in which case we set the finset to be empty by convention).
@YaelDillies
YaelDillies force-pushed the int_divisors_antidiag branch from becfceb to c46905b Compare February 16, 2025 11:45
@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Feb 16, 2025
@mathlib4-dependent-issues-bot

Copy link
Copy Markdown

@j-loreaux j-loreaux 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.

LGTM otherwise!

bors d+

Comment thread Mathlib/NumberTheory/Divisors.lean Resolved
Comment thread Mathlib/NumberTheory/Divisors.lean Resolved
Comment thread Mathlib/NumberTheory/Divisors.lean Resolved
@mathlib-bors

mathlib-bors Bot commented Feb 16, 2025

Copy link
Copy Markdown
Contributor

✌️ YaelDillies 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 the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Feb 16, 2025
Comment thread Mathlib/NumberTheory/Divisors.lean Resolved
@YaelDillies

Copy link
Copy Markdown
Contributor Author

bors merge

mathlib-bors Bot pushed a commit that referenced this pull request Feb 17, 2025
Compute the antidiagonal of divisors of an integer `z`, namely the finset of pairs `(a, b) : ℤ × ℤ` such that `a * b = n` (unless `z = 0`, in which case we set the finset to be empty by convention).
@YaelDillies

Copy link
Copy Markdown
Contributor Author

Sorry, forgot to push

bors r-

@mathlib-bors

mathlib-bors Bot commented Feb 17, 2025

Copy link
Copy Markdown
Contributor

Canceled.

@YaelDillies

Copy link
Copy Markdown
Contributor Author

bors merge

mathlib-bors Bot pushed a commit that referenced this pull request Feb 17, 2025
Compute the antidiagonal of divisors of an integer `z`, namely the finset of pairs `(a, b) : ℤ × ℤ` such that `a * b = n` (unless `z = 0`, in which case we set the finset to be empty by convention).
@mathlib-bors

mathlib-bors Bot commented Feb 17, 2025

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title feat: finset of pairs of divisors of an integer [Merged by Bors] - feat: finset of pairs of divisors of an integer Feb 17, 2025
@mathlib-bors mathlib-bors Bot closed this Feb 17, 2025
@mathlib-bors
mathlib-bors Bot deleted the int_divisors_antidiag branch February 17, 2025 12:50
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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants