Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Combinatorics/SimpleGraph): API for bipartite simple graph double-counting #20838

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

mitchell-horner
Copy link
Collaborator

Implement an API for bipartite double-counting arguments using simple graph definitions. Notably define the predicate IsBipartite: G.IsBipartite s t is the proposition that G is bipartite in sets s, t.


Open in Gitpod

@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 Jan 19, 2025
Copy link

PR summary 7ef28bbfbb

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Combinatorics.SimpleGraph.Finite 559 563 +4 (+0.72%)
Import changes for all files
Files Import difference
Mathlib.Combinatorics.SimpleGraph.DegreeSum 2
Mathlib.Combinatorics.SimpleGraph.IncMatrix 3
Mathlib.Combinatorics.SimpleGraph.Finite 4
Mathlib.Combinatorics.SimpleGraph.Bipartite (new file) 931

Declarations diff

+ IsBipartite
+ IsBipartite.mem_of_mem_adj
+ IsBipartite.mem_of_mem_adj'
+ IsBipartite.symm
+ card_edgeFinset_induce_of_support_subset
+ card_edgeFinset_induce_support
+ card_support_le
+ degree_eq_zero_iff_not_mem_support
+ degree_induce_of_support_subset
+ degree_induce_support
+ instance : DecidablePred (· ∈ G.support) := by
+ isBipartite_bipartiteAbove
+ isBipartite_bipartiteBelow
+ isBipartite_comm
+ isBipartite_degree_le
+ isBipartite_degree_le'
+ isBipartite_neighborFinset
+ isBipartite_neighborFinset'
+ isBipartite_neighborFinset_disjoint
+ isBipartite_neighborFinset_disjoint'
+ isBipartite_neighborFinset_subset
+ isBipartite_neighborFinset_subset'
+ isBipartite_neighborSet
+ isBipartite_neighborSet'
+ isBipartite_neighborSet_disjoint
+ isBipartite_neighborSet_disjoint'
+ isBipartite_neighborSet_subset
+ isBipartite_neighborSet_subset'
+ isBipartite_sum_degrees_eq
+ isBipartite_sum_degrees_eq_card_edges
+ isBipartite_sum_degrees_eq_card_edges'
+ isBipartite_sum_degrees_eq_twice_card_edges
+ isBipartite_support_subset
+ sum_degrees_support_eq_twice_card_edges

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-combinatorics Combinatorics label Jan 19, 2025
@mathlib4-dependent-issues-bot
Copy link
Collaborator

@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot added the blocked-by-other-PR This PR depends on another PR to Mathlib (this label is automatically managed by a bot) label Jan 19, 2025
not cover all the vertices, one recovers a covering of all the vertices by unioning the missing
vertices `(s ∪ t)ᶜ` to either `s` or `t`.

* `SimpleGraph.isBipartite_sum_degrees_eq` is the proof that if `G.IsBipartite s t`, then the sum
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like there's quite a bit of overlap between this and the material in DoubleCounting.lean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked-by-other-PR This PR depends on another PR to Mathlib (this label is automatically managed by a bot) 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.

3 participants