Skip to content

feat(Combinatorics/SimpleGraph): add ballFinset with basic identities#38388

Draft
supermanG wants to merge 1 commit intoleanprover-community:masterfrom
supermanG:lhoresh/simplegraph-ball-cardinality
Draft

feat(Combinatorics/SimpleGraph): add ballFinset with basic identities#38388
supermanG wants to merge 1 commit intoleanprover-community:masterfrom
supermanG:lhoresh/simplegraph-ball-cardinality

Conversation

@supermanG
Copy link
Copy Markdown

@supermanG supermanG commented Apr 22, 2026

Introduces SimpleGraph.ballFinset, the Finset companion to SimpleGraph.ball (#36443) on graphs with a Fintype vertex set, together with the basic identities mem_ballFinset, ballFinset_zero, and ballFinset_one.

SimpleGraph.ball is the open metric ball {u | edist u c < r} and is indexed by ℕ∞; ballFinset is typed ℕ → Finset V for ergonomics at cardinality-facing call sites. The classical closed-ball cardinality at radius r, |{u | edist u c ≤ r}|, corresponds to |ballFinset v (r + 1)| in this setup.

Opened as draft so CI can run before pinging maintainers.


First-time Mathlib contribution — happy to adjust naming, file placement, or docstring style to match house conventions. Follow-up PRs will add cardinality envelopes (sphere cardinality, geometric-series bound, polynomial bound).

@github-actions github-actions Bot added the new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! label Apr 22, 2026
@github-actions
Copy link
Copy Markdown

Welcome new contributor!

Thank you for contributing to Mathlib! If you haven't done so already, please review our contribution guidelines, as well as the style guide and naming conventions. In particular, we kindly remind contributors that we have guidelines regarding the use of AI when making pull requests.

We use a review queue to manage reviews. If your PR does not appear there, it is probably because it is not successfully building (i.e., it doesn't have a green checkmark), has the awaiting-author tag, or another reason described in the Lifecycle of a PR. The review dashboard has a dedicated webpage which shows whether your PR is on the review queue, and (if not), why.

If you haven't already done so, please come to https://leanprover.zulipchat.com/, introduce yourself, and mention your new PR.

Thank you again for joining our community.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 22, 2026

PR summary 1a5bbc7d37

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Combinatorics.SimpleGraph.BallCardinality (new file) 709

Declarations diff

+ ballFinset
+ ballFinset_one
+ ballFinset_zero
+ mem_ballFinset

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

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

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


No changes to technical debt.

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

@github-actions github-actions Bot added the t-combinatorics Combinatorics label Apr 22, 2026
@SnirBroshi
Copy link
Copy Markdown
Collaborator

The bound is nice, but why do you need a Finset version of balls? Can you use the Set version instead?

Opened as draft so CI can run before pinging maintainers.

Please do not ping maintainers, even after CI runs.

Also can you please disclose any AI usage?

Introduces `SimpleGraph.ballFinset`, the `Finset` companion to
`SimpleGraph.ball` on graphs with a `Fintype` vertex set, together
with the basic identities `mem_ballFinset`, `ballFinset_zero`, and
`ballFinset_one`.

`SimpleGraph.ball` is the *open* metric ball `{u | edist u c < r}` and
is indexed by `ℕ∞`; `ballFinset` is typed `ℕ → Finset V` for ergonomics
at cardinality-facing call sites.  The classical closed-ball
cardinality at radius `r` corresponds to `|ballFinset v (r + 1)|` in
this setup.

Follow-up PRs will add cardinality envelopes (sphere cardinality,
geometric-series bound, polynomial bound).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@supermanG supermanG force-pushed the lhoresh/simplegraph-ball-cardinality branch from 8e70193 to bd8eeb3 Compare April 23, 2026 14:14
@supermanG supermanG changed the title feat(Combinatorics/SimpleGraph): add ballFinset + polynomial cardinality envelope feat(Combinatorics/SimpleGraph): add ballFinset with basic identities Apr 23, 2026
@SnirBroshi SnirBroshi added the LLM-generated PRs with substantial input from LLMs - review accordingly label Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LLM-generated PRs with substantial input from LLMs - review accordingly new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! t-combinatorics Combinatorics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants