Documentation

Mathlib.Combinatorics.SimpleGraph.Bipartite

Bipartite graphs #

This file proves results about bipartite simple graphs, including several double-counting arguments.

Main definitions #

Implementation notes #

For the formulation of double-counting arguments where a bipartite graph is considered as a relation r : α → β → Prop, see Mathlib/Combinatorics/Enumerative/DoubleCounting.lean.

TODO #

structure SimpleGraph.IsBipartiteWith {V : Type u_1} (G : SimpleGraph V) (s t : Set V) :

G is bipartite in sets s and t iff s and t are disjoint and if vertices v and w are adjacent in G then v ∈ s and w ∈ t, or v ∈ t and w ∈ s.

Instances For
    theorem SimpleGraph.IsBipartiteWith.symm {V : Type u_1} {G : SimpleGraph V} {s t : Set V} (h : G.IsBipartiteWith s t) :
    theorem SimpleGraph.IsBipartiteWith.mem_of_mem_adj {V : Type u_1} {v w : V} {G : SimpleGraph V} {s t : Set V} (h : G.IsBipartiteWith s t) (hv : v s) (hadj : G.Adj v w) :
    w t

    If G.IsBipartiteWith s t and v ∈ s, then if v is adjacent to w in G then w ∈ t.

    theorem SimpleGraph.isBipartiteWith_neighborSet {V : Type u_1} {v : V} {G : SimpleGraph V} {s t : Set V} (h : G.IsBipartiteWith s t) (hv : v s) :
    G.neighborSet v = {w : V | w t G.Adj v w}

    If G.IsBipartiteWith s t and v ∈ s, then the neighbor set of v is the set of vertices in t adjacent to v in G.

    theorem SimpleGraph.isBipartiteWith_neighborSet_subset {V : Type u_1} {v : V} {G : SimpleGraph V} {s t : Set V} (h : G.IsBipartiteWith s t) (hv : v s) :

    If G.IsBipartiteWith s t and v ∈ s, then the neighbor set of v is a subset of t.

    theorem SimpleGraph.isBipartiteWith_neighborSet_disjoint {V : Type u_1} {v : V} {G : SimpleGraph V} {s t : Set V} (h : G.IsBipartiteWith s t) (hv : v s) :

    If G.IsBipartiteWith s t and v ∈ s, then the neighbor set of v is disjoint to s.

    theorem SimpleGraph.IsBipartiteWith.mem_of_mem_adj' {V : Type u_1} {v w : V} {G : SimpleGraph V} {s t : Set V} (h : G.IsBipartiteWith s t) (hw : w t) (hadj : G.Adj v w) :
    v s

    If G.IsBipartiteWith s t and w ∈ t, then if v is adjacent to w in G then v ∈ s.

    theorem SimpleGraph.isBipartiteWith_neighborSet' {V : Type u_1} {w : V} {G : SimpleGraph V} {s t : Set V} (h : G.IsBipartiteWith s t) (hw : w t) :
    G.neighborSet w = {v : V | v s G.Adj v w}

    If G.IsBipartiteWith s t and w ∈ t, then the neighbor set of w is the set of vertices in s adjacent to w in G.

    theorem SimpleGraph.isBipartiteWith_neighborSet_subset' {V : Type u_1} {w : V} {G : SimpleGraph V} {s t : Set V} (h : G.IsBipartiteWith s t) (hw : w t) :

    If G.IsBipartiteWith s t and w ∈ t, then the neighbor set of w is a subset of s.

    theorem SimpleGraph.isBipartiteWith_support_subset {V : Type u_1} {G : SimpleGraph V} {s t : Set V} (h : G.IsBipartiteWith s t) :

    If G.IsBipartiteWith s t, then the support of G is a subset of s ∪ t.

    theorem SimpleGraph.isBipartiteWith_neighborSet_disjoint' {V : Type u_1} {w : V} {G : SimpleGraph V} {s t : Set V} (h : G.IsBipartiteWith s t) (hw : w t) :

    If G.IsBipartiteWith s t and w ∈ t, then the neighbor set of w is disjoint to t.

    theorem SimpleGraph.isBipartiteWith_neighborFinset {V : Type u_1} {v : V} {G : SimpleGraph V} {s t : Finset V} [Fintype (G.neighborSet v)] [DecidableRel G.Adj] (h : G.IsBipartiteWith s t) (hv : v s) :
    G.neighborFinset v = {wt | G.Adj v w}

    If G.IsBipartiteWith s t and v ∈ s, then the neighbor finset of v is the set of vertices in s adjacent to v in G.

    theorem SimpleGraph.isBipartiteWith_neighborFinset' {V : Type u_1} {w : V} {G : SimpleGraph V} {s t : Finset V} [Fintype (G.neighborSet w)] [DecidableRel G.Adj] (h : G.IsBipartiteWith s t) (hw : w t) :
    G.neighborFinset w = {vs | G.Adj v w}

    If G.IsBipartiteWith s t and w ∈ t, then the neighbor finset of w is the set of vertices in s adjacent to w in G.

    theorem SimpleGraph.isBipartiteWith_bipartiteAbove {V : Type u_1} {v : V} {G : SimpleGraph V} {s t : Finset V} [Fintype (G.neighborSet v)] [DecidableRel G.Adj] (h : G.IsBipartiteWith s t) (hv : v s) :

    If G.IsBipartiteWith s t and v ∈ s, then the neighbor finset of v is the set of vertices "above" v according to the adjacency relation of G.

    theorem SimpleGraph.isBipartiteWith_bipartiteBelow {V : Type u_1} {w : V} {G : SimpleGraph V} {s t : Finset V} [Fintype (G.neighborSet w)] [DecidableRel G.Adj] (h : G.IsBipartiteWith s t) (hw : w t) :

    If G.IsBipartiteWith s t and w ∈ t, then the neighbor finset of w is the set of vertices "below" w according to the adjacency relation of G.

    theorem SimpleGraph.isBipartiteWith_neighborFinset_subset {V : Type u_1} {v : V} {G : SimpleGraph V} {s t : Finset V} [Fintype (G.neighborSet v)] (h : G.IsBipartiteWith s t) (hv : v s) :

    If G.IsBipartiteWith s t and v ∈ s, then the neighbor finset of v is a subset of s.

    theorem SimpleGraph.isBipartiteWith_neighborFinset_disjoint {V : Type u_1} {v : V} {G : SimpleGraph V} {s t : Finset V} [Fintype (G.neighborSet v)] (h : G.IsBipartiteWith s t) (hv : v s) :

    If G.IsBipartiteWith s t and v ∈ s, then the neighbor finset of v is disjoint to s.

    theorem SimpleGraph.isBipartiteWith_degree_le {V : Type u_1} {v : V} {G : SimpleGraph V} {s t : Finset V} [Fintype (G.neighborSet v)] (h : G.IsBipartiteWith s t) (hv : v s) :

    If G.IsBipartiteWith s t and v ∈ s, then the degree of v in G is at most the size of t.

    theorem SimpleGraph.isBipartiteWith_neighborFinset_subset' {V : Type u_1} {w : V} {G : SimpleGraph V} {s t : Finset V} [Fintype (G.neighborSet w)] (h : G.IsBipartiteWith s t) (hw : w t) :

    If G.IsBipartiteWith s t and w ∈ t, then the neighbor finset of w is a subset of s.

    theorem SimpleGraph.isBipartiteWith_neighborFinset_disjoint' {V : Type u_1} {w : V} {G : SimpleGraph V} {s t : Finset V} [Fintype (G.neighborSet w)] (h : G.IsBipartiteWith s t) (hw : w t) :

    If G.IsBipartiteWith s t and w ∈ t, then the neighbor finset of w is disjoint to t.

    theorem SimpleGraph.isBipartiteWith_degree_le' {V : Type u_1} {w : V} {G : SimpleGraph V} {s t : Finset V} [Fintype (G.neighborSet w)] (h : G.IsBipartiteWith s t) (hw : w t) :

    If G.IsBipartiteWith s t and w ∈ t, then the degree of w in G is at most the size of s.

    theorem SimpleGraph.isBipartiteWith_sum_degrees_eq {V : Type u_1} {G : SimpleGraph V} {s t : Finset V} [G.LocallyFinite] (h : G.IsBipartiteWith s t) :
    vs, G.degree v = wt, G.degree w

    If G.IsBipartiteWith s t, then the sum of the degrees of vertices in s is equal to the sum of the degrees of vertices in t.

    See Finset.sum_card_bipartiteAbove_eq_sum_card_bipartiteBelow.

    theorem SimpleGraph.isBipartiteWith_sum_degrees_eq_card_edges {V : Type u_1} {G : SimpleGraph V} {s t : Finset V} [Fintype V] [DecidableRel G.Adj] (h : G.IsBipartiteWith s t) :
    vs, G.degree v = G.edgeFinset.card

    The degree-sum formula for bipartite graphs, summing over the "left" part.

    See SimpleGraph.sum_degrees_eq_twice_card_edges for the general version, and SimpleGraph.isBipartiteWith_sum_degrees_eq_card_edges' for the version from the "right".

    theorem SimpleGraph.isBipartiteWith_sum_degrees_eq_card_edges' {V : Type u_1} {G : SimpleGraph V} {s t : Finset V} [Fintype V] [DecidableRel G.Adj] (h : G.IsBipartiteWith s t) :
    vt, G.degree v = G.edgeFinset.card

    The degree-sum formula for bipartite graphs, summing over the "right" part.

    See SimpleGraph.sum_degrees_eq_twice_card_edges for the general version, and SimpleGraph.isBipartiteWith_sum_degrees_eq_card_edges for the version from the "left".

    @[reducible, inline]
    abbrev SimpleGraph.IsBipartite {V : Type u_1} (G : SimpleGraph V) :

    The predicate for a simple graph to be bipartite.

    Equations
    Instances For
      theorem SimpleGraph.IsBipartite.exists_isBipartiteWith {V : Type u_1} {G : SimpleGraph V} (h : G.IsBipartite) :
      ∃ (s : Set V) (t : Set V), G.IsBipartiteWith s t

      If a simple graph G is bipartite, then there exist disjoint sets s and t such that all edges in G connect a vertex in s to a vertex in t.

      theorem SimpleGraph.IsBipartiteWith.isBipartite {V : Type u_1} {G : SimpleGraph V} {s t : Set V} (h : G.IsBipartiteWith s t) :

      If a simple graph G has a bipartition, then it is bipartite.

      G.IsBipartite if and only if G.IsBipartiteWith s t.

      def SimpleGraph.between {V : Type u_1} (s t : Set V) (G : SimpleGraph V) :

      The subgraph of G containing edges that connect a vertex in the set s to a vertex in the set t.

      Equations
      Instances For
        theorem SimpleGraph.between_adj {V : Type u_1} {v w : V} {G : SimpleGraph V} {s t : Set V} :
        (between s t G).Adj v w G.Adj v w (v s w t v t w s)
        theorem SimpleGraph.between_le {V : Type u_1} {G : SimpleGraph V} {s t : Set V} :
        between s t G G
        theorem SimpleGraph.between_comm {V : Type u_1} {G : SimpleGraph V} {s t : Set V} :
        between s t G = between t s G
        theorem SimpleGraph.between_isBipartiteWith {V : Type u_1} {G : SimpleGraph V} {s t : Set V} (h : Disjoint s t) :

        G.between s t is bipartite if the sets s and t are disjoint.

        theorem SimpleGraph.between_isBipartite {V : Type u_1} {G : SimpleGraph V} {s t : Set V} (h : Disjoint s t) :

        G.between s t is bipartite if the sets s and t are disjoint.

        theorem SimpleGraph.neighborSet_subset_between_union {V : Type u_1} {v : V} {G : SimpleGraph V} {s : Set V} (hv : v s) :

        The neighbor set of v ∈ s in G.between s sᶜ excludes the vertices in s adjacent to v in G.

        theorem SimpleGraph.neighborSet_subset_between_union_compl {V : Type u_1} {w : V} {G : SimpleGraph V} {s : Set V} (hw : w s) :

        The neighbor set of w ∈ sᶜ in G.between s sᶜ excludes the vertices in sᶜ adjacent to w in G.

        theorem SimpleGraph.neighborFinset_subset_between_union {V : Type u_1} {v : V} {G : SimpleGraph V} [DecidableEq V] [Fintype V] {s : Finset V} [DecidableRel G.Adj] (hv : v s) :
        G.neighborFinset v (between (↑s) (↑s) G).neighborFinset v s

        The neighbor finset of v ∈ s in G.between s sᶜ excludes the vertices in s adjacent to v in G.

        theorem SimpleGraph.degree_le_between_add {V : Type u_1} {v : V} {G : SimpleGraph V} [DecidableEq V] [Fintype V] {s : Finset V} [DecidableRel G.Adj] (hv : v s) :
        G.degree v (between (↑s) (↑s) G).degree v + s.card

        The degree of v ∈ s in G is at most the degree in G.between s sᶜ plus the excluded vertices from s.

        The neighbor finset of w ∈ sᶜ in G.between s sᶜ excludes the vertices in sᶜ adjacent to w in G.

        theorem SimpleGraph.degree_le_between_add_compl {V : Type u_1} {w : V} {G : SimpleGraph V} [DecidableEq V] [Fintype V] {s : Finset V} [DecidableRel G.Adj] (hw : w s) :
        G.degree w (between (↑s) (↑s) G).degree w + s.card

        The degree of w ∈ sᶜ in G is at most the degree in G.between s sᶜ plus the excluded vertices from sᶜ.