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

Generalized definition of bipartite graphs with explicit partitions #1339

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

binghe
Copy link
Member

@binghe binghe commented Nov 14, 2024

Hi,

In fsgraphTheory (under "examples/generic_graphs") the existing definition of "partite" graphs asserts the existence of partitions without explicitly putting them as parameters (NOTE: the existing definition makes sense, because the partitions are not unique, even w.r.t {A; B} = {B; A}. e.g. an isolated vertex can belong to any partition.)

[bipartite_def]
⊢ ∀g. bipartite g ⇔
      ∃A B.
        DISJOINT A B ∧ A ≠ ∅ ∧ B ≠ ∅ ∧ A ∪ B = V ∧
        ∀n1 n2. {n1; n2} ∈ E ⇒ n1 ∈ A ∧ n2 ∈ B ∨ n1 ∈ B ∧ n2 ∈ A

But sometimes this definition is not enough. There are theorems explicitly talking about properties of partitions in the statements (e.g. "G contains a matching of A if and only if ...", where A is one partition of the bipartite graph G, among A and B but chosen arbitrarily).

For this purpose, I added the following "gen_bipartite" concept, which has the partitions explicitly as part of the parameters:

[gen_bipartite_def]
⊢ ∀g A B.
    gen_bipartite g A B ⇔
    DISJOINT A B ∧ A ≠ ∅ ∧ B ≠ ∅ ∧ A ∪ B = V ∧
    ∀n1 n2. {n1; n2} ∈ E ⇒ n1 ∈ A ∧ n2 ∈ B ∨ n1 ∈ B ∧ n2 ∈ A

And there's also one alternative definition (just like bipartite_def vs. bipartite_alt):

[gen_bipartite_alt]
⊢ ∀g A B.
    gen_bipartite g A B ⇔
    DISJOINT A B ∧ A ≠ ∅ ∧ B ≠ ∅ ∧ A ∪ B = V ∧
    ∀e. e ∈ E ⇒ ∃n1 n2. e = {n1; n2} ∧ n1 ∈ A ∧ n2 ∈ B

P. S. The code changes are backward compatible to existing user code (i.e. all existing theorems and definitions are still there with the same statements as before.)

Chun

@mn200
Copy link
Member

mn200 commented Nov 14, 2024

Thanks for this!

@mn200 mn200 merged commit 20530ab into HOL-Theorem-Prover:develop Nov 14, 2024
4 checks passed
@binghe binghe deleted the gen_bipartite branch November 15, 2024 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants