Skip to content

[Merged by Bors] - feat(Combinatorics/Graph): infimum#37620

Closed
Jun2M wants to merge 19 commits intoleanprover-community:masterfrom
Jun2M:GraphInter
Closed

[Merged by Bors] - feat(Combinatorics/Graph): infimum#37620
Jun2M wants to merge 19 commits intoleanprover-community:masterfrom
Jun2M:GraphInter

Conversation

@Jun2M
Copy link
Copy Markdown
Collaborator

@Jun2M Jun2M commented Apr 3, 2026

Adds Mathlib/Combinatorics/Graph/Lattice.lean, which defines intersections, as Inf, of Graph α β values and proves the lattice structure induced by binary intersection.

Main additions

  • SemilatticeInf (Graph α β)

Co-authored-by: Peter Nelson apn.uni@gmail.com


Open in Gitpod

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 3, 2026

PR summary f3dd886f91

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Combinatorics.Graph.Lattice (new file) 493

Declarations diff

+ Compatible.edgeSet_inf
+ disjoint_iff
+ edgeSet_inf
+ inf_inc_iff
+ inf_isLink
+ inf_isLoopAt_iff
+ inf_isNonloopAt_iff
+ instance : SemilatticeInf (Graph α β)
+ vertexSet_inf

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.

You can run this locally as

./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 3, 2026
@vihdzp
Copy link
Copy Markdown
Collaborator

vihdzp commented Apr 3, 2026

I think what you instead want to prove is that graphs are a complete lattice, similar to how it's done for simple graphs.

@Jun2M
Copy link
Copy Markdown
Collaborator Author

Jun2M commented Apr 3, 2026

It would be marvelous if Graph forms a complete lattice. However, due to compatibility issue, this is not true: Consider two path graphs of length 1, uev & xey where e is the only edge in both graphs. What is the union of the two graphs? As Graph is not a hypergraph, e must be incident to at most 2 vertices yet the first graph would suggest it should be incident to u and v whlie the second graph would disagree and suggest that it should be incident to x and y.

It is true that if you consider 1. all subgraphs of a particular graph or 2. WithTop (Graph α β), then they form CompleteLattice. I have proof for both of them but as they are talking about a different type, I thought I should add it to another file in a later PR.

@vihdzp
Copy link
Copy Markdown
Collaborator

vihdzp commented Apr 3, 2026

I think what you're describing is a ConditionallyCompletePartialOrder?

@Jun2M
Copy link
Copy Markdown
Collaborator Author

Jun2M commented Apr 3, 2026

Thank you! I didn't know about this one. I have just proved that Graph is indeed ConditionallyCompletePartialOrder. However, it required using , the empty graph, as the error value which is in PR #37610 not yet merged. If I understand correctly, this is orthogonal to SemilatticeInf instance so I will leave it as is and add ConditionallyCompletePartialOrder to a later PR that depends on this PR and #37610.

@Jun2M Jun2M changed the title feat(Combinatorics/Graph): Add Graph intersection operations feat(Combinatorics/Graph): Graph intersection operations Apr 6, 2026
@Jun2M Jun2M requested a review from YaelDillies April 15, 2026 04:10
Comment thread Mathlib/Combinatorics/Graph/InterUnion.lean Outdated
Comment thread Mathlib/Combinatorics/Graph/InterUnion.lean Outdated
Comment thread Mathlib/Combinatorics/Graph/InterUnion.lean Outdated
@YaelDillies YaelDillies added the awaiting-author A reviewer has asked the author a question or requested changes. label Apr 15, 2026
@Jun2M Jun2M added awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. and removed awaiting-author A reviewer has asked the author a question or requested changes. labels Apr 15, 2026
@github-actions github-actions Bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Apr 15, 2026
Comment thread Mathlib/Combinatorics/Graph/Lattice.lean Outdated
grind

@[grind =]
lemma sInf_isLink (Gs : Set (Graph α β)) [Decidable Gs.Nonempty] :
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Likewise elsewhere.

Suggested change
lemma sInf_isLink (Gs : Set (Graph α β)) [Decidable Gs.Nonempty] :
lemma isLink_sInf (Gs : Set (Graph α β)) [Decidable Gs.Nonempty] :

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This came up in #35879 and isLink was merged as a postfix at the end. @YaelDillies?

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.

I already expressed my preference that isLink should be a prefix, and Bhavik's that it should be a postfix

Comment thread Mathlib/Combinatorics/Graph/Lattice.lean Outdated
Comment thread Mathlib/Combinatorics/Graph/Lattice.lean Outdated
Comment thread Mathlib/Combinatorics/Graph/Lattice.lean Outdated
Comment thread Mathlib/Combinatorics/Graph/Lattice.lean Outdated
Comment thread Mathlib/Combinatorics/Graph/Lattice.lean Outdated
@YaelDillies YaelDillies changed the title feat(Combinatorics/Graph): Graph intersection operations feat(Combinatorics/Graph): lattice operations Apr 16, 2026
@Jun2M Jun2M added blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) and removed awaiting-author A reviewer has asked the author a question or requested changes. labels Apr 18, 2026
@Jun2M Jun2M changed the title feat(Combinatorics/Graph): lattice operations feat(Combinatorics/Graph): SemilatticeInf operation Apr 19, 2026
@Jun2M
Copy link
Copy Markdown
Collaborator Author

Jun2M commented Apr 19, 2026

I have removed the sInf related things as order theory PRs has to be merged first for that. With just SemilatticeInf, this PR should be fine to be merged. In the future, I will add the instance for sInf once Mathlib has the right class.

@mathlib-dependent-issues mathlib-dependent-issues Bot removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Apr 19, 2026
Comment thread Mathlib/Combinatorics/Graph/Lattice.lean Outdated
Comment thread Mathlib/Combinatorics/Graph/Lattice.lean Outdated
Comment thread Mathlib/Combinatorics/Graph/Lattice.lean Outdated
Comment thread Mathlib/Combinatorics/Graph/Lattice.lean Outdated
@YaelDillies YaelDillies changed the title feat(Combinatorics/Graph): SemilatticeInf operation feat(Combinatorics/Graph): infimum Apr 19, 2026
@YaelDillies YaelDillies added the awaiting-author A reviewer has asked the author a question or requested changes. label Apr 19, 2026
Jun2M and others added 4 commits April 19, 2026 09:23
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
@Jun2M Jun2M removed the awaiting-author A reviewer has asked the author a question or requested changes. label Apr 19, 2026
Comment thread Mathlib/Combinatorics/Graph/Lattice.lean Outdated
Copy link
Copy Markdown
Contributor

@YaelDillies YaelDillies left a comment

Choose a reason for hiding this comment

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

Thanks! 🚀

maintainer merge

@github-actions
Copy link
Copy Markdown

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

@mathlib-triage mathlib-triage Bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Apr 20, 2026
@b-mehta
Copy link
Copy Markdown
Contributor

b-mehta commented Apr 20, 2026

Thanks!

bors merge

@mathlib-triage mathlib-triage Bot added ready-to-merge This PR has been sent to bors. and removed maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. labels Apr 20, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Apr 20, 2026
Adds `Mathlib/Combinatorics/Graph/Lattice.lean`, which defines intersections, as `Inf`, of Graph α β values and proves the lattice structure induced by binary intersection. 

## Main additions
- `SemilatticeInf (Graph α β)`

Co-authored-by: Peter Nelson [apn.uni@gmail.com](mailto:apn.uni@gmail.com)
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors Bot commented Apr 20, 2026

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title feat(Combinatorics/Graph): infimum [Merged by Bors] - feat(Combinatorics/Graph): infimum Apr 20, 2026
@mathlib-bors mathlib-bors Bot closed this Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge This PR has been sent to bors. t-combinatorics Combinatorics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants