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.

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} [Fintype V] {s t : Finset 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_bipartiteAbove {V : Type u_1} {v : V} {G : SimpleGraph V} [Fintype V] {s t : Finset 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_neighborFinset_subset {V : Type u_1} {v : V} {G : SimpleGraph V} [Fintype V] {s t : Finset 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 a subset of s.

    theorem SimpleGraph.isBipartiteWith_neighborFinset_disjoint {V : Type u_1} {v : V} {G : SimpleGraph V} [Fintype V] {s t : Finset 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 disjoint to s.

    theorem SimpleGraph.isBipartiteWith_degree_le {V : Type u_1} {v : V} {G : SimpleGraph V} [Fintype V] {s t : Finset V} [DecidableRel G.Adj] (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' {V : Type u_1} {w : V} {G : SimpleGraph V} [Fintype V] {s t : Finset V} [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_bipartiteBelow {V : Type u_1} {w : V} {G : SimpleGraph V} [Fintype V] {s t : Finset V} [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} {w : V} {G : SimpleGraph V} [Fintype V] {s t : Finset V} [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 a subset of s.

    theorem SimpleGraph.isBipartiteWith_neighborFinset_disjoint' {V : Type u_1} {w : V} {G : SimpleGraph V} [Fintype V] {s t : Finset V} [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 disjoint to t.

    theorem SimpleGraph.isBipartiteWith_degree_le' {V : Type u_1} {w : V} {G : SimpleGraph V} [Fintype V] {s t : Finset V} [DecidableRel G.Adj] (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} [Fintype V] {s t : Finset V} [DecidableRel G.Adj] (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} [Fintype V] {s t : Finset V} [DecidableRel G.Adj] [DecidableEq V] (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} [Fintype V] {s t : Finset V} [DecidableRel G.Adj] [DecidableEq V] (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".