Skip to content

feat(Combinatorics/SimpleGraph/Extremal): the Kővári–Sós–Turán bound - #43483

Closed
chy4pro wants to merge 2 commits into
leanprover-community:masterfrom
chy4pro:kovari-sos-turan
Closed

feat(Combinatorics/SimpleGraph/Extremal): the Kővári–Sós–Turán bound#43483
chy4pro wants to merge 2 commits into
leanprover-community:masterfrom
chy4pro:kovari-sos-turan

Conversation

@chy4pro

@chy4pro chy4pro commented Sep 6, 2026

Copy link
Copy Markdown

This PR adds the Kővári–Sós–Turán bound (Kővári–Sós–Turán 1954) in a bipartite-relation form: if a relation r between finite sets A (size m) and B (size n) contains no K_{s,t} (s elements of A all related to t elements of B), then its number of edges e satisfies (e - (s-1) n)^s ≤ (t-1) m^s n^(s-1) (exact form in , with truncated subtraction) and hence e ≤ (s-1) n + (t-1)^(1/s) m n^(1-1/s) (real form).

New file Mathlib/Combinatorics/SimpleGraph/Extremal/KovariSosTuran.lean:

  • KovariSosTuran.sum_choose_le — the double counting of stars ∑_{b ∈ B} C(deg b, s) ≤ (t-1) C(m, s);
  • KovariSosTuran.kovari_sos_turan — the form of the bound (via (d+1-s)^s ≤ s! C(d,s) and the power-mean inequality);
  • KovariSosTuran.kovari_sos_turan_real — the classical real-exponent form.

Mathlib defines SimpleGraph.zarankiewicz but (as far as I could find) does not contain this bound. I kept the statement in the elementary bipartite-relation language; connecting it to SimpleGraph.zarankiewicz / extremalNumber would be a natural follow-up if reviewers prefer that interface.

Checks: the file compiles against the base commit of this branch, #lint reports no issues, #print axioms on the main results shows only propext, Classical.choice, Quot.sound; the import line was added to Mathlib.lean.

AI disclosure (per the Mathlib AI policy): the Lean code was drafted by Claude (Anthropic, Opus/Fable models) in an agentic session directed by me; I re-ran the compiler and the linter myself, reviewed the statements and the proof structure, and I am responsible for the content. Please add the LLM-generated label if that is the right classification.

@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 Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026

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 Zulip and join the Lean community.
Thank you again for joining our community.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

PR summary 0b27e8799c

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Combinatorics.SimpleGraph.Extremal.KovariSosTuran (new file) 1854

Declarations diff (regex)

+ HasKst
+ card_common_le
+ deg
+ kovari_sos_turan
+ kovari_sos_turan_real
+ mem_nbhd
+ nbhd
+ nbhd_subset
+ numEdges
+ sum_choose_le
+ trunc
+ trunc_pow_le

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

  • +13 new declarations
  • −0 removed declarations
+KovariSosTuran.HasKst
+KovariSosTuran.card_common_le
+KovariSosTuran.deg
+KovariSosTuran.deg.congr_simp
+KovariSosTuran.kovari_sos_turan
+KovariSosTuran.kovari_sos_turan_real
+KovariSosTuran.mem_nbhd
+KovariSosTuran.nbhd
+KovariSosTuran.nbhd.congr_simp
+KovariSosTuran.nbhd_subset
+KovariSosTuran.numEdges
+KovariSosTuran.numEdges.congr_simp
+KovariSosTuran.sum_choose_le

No changes to strong technical debt.

Increase in weak tech debt: (relative, absolute) = (1.00, 0.00)
Current number Change Type (weak)
exposed public sections 5049 1

Current commit 0b27e8799c
Reference commit 5aedf732b6

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

A bipartite relation with parts of sizes m and n and no K_{s,t} has at most (s-1)n + (t-1)^{1/s} m n^{1-1/s} edges (double counting of stars and the power-mean inequality), in an exact ℕ form and the classical real form.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BV7eJo5RCjfezZpByuCExN
@Parcly-Taxel Parcly-Taxel added the LLM-generated PRs with substantial input from LLMs - review accordingly label Sep 6, 2026
@SnirBroshi

Copy link
Copy Markdown
Collaborator

What's the reason for scooping an existing PR by a human contributor?

@chy4pro chy4pro closed this Sep 6, 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!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants