Skip to content

feat(Data/Nat/Choose/Multinomial): add positivity support#40468

Open
BoltonBailey wants to merge 8 commits into
leanprover-community:masterfrom
BoltonBailey:multiset-multinomial-positivity
Open

feat(Data/Nat/Choose/Multinomial): add positivity support#40468
BoltonBailey wants to merge 8 commits into
leanprover-community:masterfrom
BoltonBailey:multiset-multinomial-positivity

Conversation

@BoltonBailey

@BoltonBailey BoltonBailey commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

This PR adds positivity tactic support for Multiset.multinomial, by adding a _pos theorem and an extension.

This was done as a part of Project Numina's LeanTriathlon project. AI was used as an assistant in the creation of this PR.


Open in Gitpod

@github-actions github-actions Bot added the t-data Data (lists, quotients, numbers, etc) label Jun 10, 2026
@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

PR summary 0a7aa2ff62

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

+ multinomial_pos

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.

Declarations diff (Lean)

Lean-aware diff — post-build, computed from the Lean environment (commit 0a7aa2f).

  • +2 new declarations
  • −0 removed declarations
+Multiset.evalMultinomial
+Multiset.multinomial_pos

No changes to strong technical debt.

No changes to weak technical debt.

Current commit 0a7aa2ff62
Reference commit 4608056c77

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/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).

@BoltonBailey
BoltonBailey marked this pull request as ready for review June 11, 2026 18:12

@joneugster joneugster 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.

Thank you for the PR!

Comment thread Mathlib/Data/Nat/Choose/Multinomial.lean Outdated
Comment thread Mathlib/Data/Nat/Choose/Multinomial.lean Outdated
@joneugster

Copy link
Copy Markdown
Contributor

maintainer delegate

since the comments are all about better style, nothing conceptual.

@joneugster joneugster self-assigned this Jul 17, 2026
@github-actions

Copy link
Copy Markdown

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

@mathlib-triage mathlib-triage Bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Jul 17, 2026
@BoltonBailey

Copy link
Copy Markdown
Collaborator Author

Seems I had to update it just now for the new positivity extension format, but I didn't change much.

@joneugster

Copy link
Copy Markdown
Contributor

maintainer merge

@github-actions

Copy link
Copy Markdown

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

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

Labels

maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. t-data Data (lists, quotients, numbers, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants