Documentation

Mathlib.Combinatorics.SimpleGraph.Basic

Simple graphs #

This module defines simple graphs on a vertex type V as an irreflexive symmetric relation.

Main definitions #

TODO #

def aesop_graph :
Lean.ParserDescr

A variant of the aesop tactic for use in the graph library. Changes relative to standard aesop:

  • We use the SimpleGraph rule set in addition to the default rule sets.
  • We instruct Aesop's intro rule to unfold with default transparency.
  • We instruct Aesop to fail if it can't fully solve the goal. This allows us to use aesop_graph for auto-params.
Instances For
    def aesop_graph? :
    Lean.ParserDescr

    Use aesop_graph? to pass along a Try this suggestion when using aesop_graph

    Instances For
      def aesop_graph_nonterminal :
      Lean.ParserDescr

      A variant of aesop_graph which does not fail if it is unable to solve the goal. Use this only for exploration! Nonterminal Aesop is even worse than nonterminal simp.

      Instances For
        structure SimpleGraph (V : Type u) :

        A simple graph is an irreflexive symmetric relation Adj on a vertex type V. The relation describes which pairs of vertices are adjacent. There is exactly one edge for every pair of adjacent vertices; see SimpleGraph.edgeSet for the corresponding edge set.

        • Adj : V โ†’ V โ†’ Prop

          The adjacency relation of a simple graph.

        • symm : Symmetric self.Adj
        • loopless : Std.Irrefl self.Adj
        Instances For
          theorem SimpleGraph.ext {V : Type u} {x y : SimpleGraph V} (Adj : x.Adj = y.Adj) :
          x = y
          theorem SimpleGraph.ext_iff {V : Type u} {x y : SimpleGraph V} :
          x = y โ†” x.Adj = y.Adj
          def SimpleGraph.mk' {V : Type u} :
          { adj : V โ†’ V โ†’ Bool // (โˆ€ (x y : V), adj x y = adj y x) โˆง โˆ€ (x : V), ยฌadj x x = true } โ†ช SimpleGraph V

          Constructor for simple graphs using a symmetric irreflexive Boolean function.

          Instances For
            @[simp]
            theorem SimpleGraph.mk'_apply_adj {V : Type u} (x : { adj : V โ†’ V โ†’ Bool // (โˆ€ (x y : V), adj x y = adj y x) โˆง โˆ€ (x : V), ยฌadj x x = true }) (v w : V) :
            (mk' x).Adj v w = (โ†‘x v w = true)
            @[implicit_reducible]
            instance instFintypeSimpleGraphOfDecidableEq {V : Type u} [Fintype V] [DecidableEq V] :

            We can enumerate simple graphs by enumerating all functions V โ†’ V โ†’ Bool and filtering on whether they are symmetric and irreflexive.

            There are finitely many simple graphs on a given finite type.

            def SimpleGraph.fromRel {V : Type u} (r : V โ†’ V โ†’ Prop) :

            Construct the simple graph induced by the given relation. It symmetrizes the relation and makes it irreflexive.

            Instances For
              @[simp]
              theorem SimpleGraph.fromRel_adj {V : Type u} (r : V โ†’ V โ†’ Prop) (v w : V) :
              (fromRel r).Adj v w โ†” v โ‰  w โˆง (r v w โˆจ r w v)
              @[implicit_reducible]
              instance instDecidableRelAdjFromRelOfDecidableEq {V : Type u} [DecidableEq V] (r : V โ†’ V โ†’ Prop) [DecidableRel r] :
              DecidableRel (SimpleGraph.fromRel r).Adj
              def completeBipartiteGraph (V : Type u_1) (W : Type u_2) :
              SimpleGraph (V โŠ• W)

              Two vertices are adjacent in the complete bipartite graph on two vertex types if and only if they are not from the same side. Any bipartite graph may be regarded as a subgraph of one of these.

              Instances For
                @[simp]
                theorem completeBipartiteGraph_adj (V : Type u_1) (W : Type u_2) (v w : V โŠ• W) :
                (completeBipartiteGraph V W).Adj v w = (v.isLeft = true โˆง w.isRight = true โˆจ v.isRight = true โˆง w.isLeft = true)
                @[simp]
                theorem SimpleGraph.irrefl {V : Type u} (G : SimpleGraph V) {v : V} :
                ยฌG.Adj v v
                theorem SimpleGraph.adj_comm {V : Type u} (G : SimpleGraph V) (u v : V) :
                G.Adj u v โ†” G.Adj v u
                theorem SimpleGraph.adj_symm {V : Type u} (G : SimpleGraph V) {u v : V} (h : G.Adj u v) :
                G.Adj v u
                theorem SimpleGraph.Adj.symm {V : Type u} {G : SimpleGraph V} {u v : V} (h : G.Adj u v) :
                G.Adj v u
                theorem SimpleGraph.ne_of_adj {V : Type u} (G : SimpleGraph V) {a b : V} (h : G.Adj a b) :
                a โ‰  b
                theorem SimpleGraph.Adj.ne {V : Type u} {G : SimpleGraph V} {a b : V} (h : G.Adj a b) :
                a โ‰  b
                theorem SimpleGraph.Adj.ne' {V : Type u} {G : SimpleGraph V} {a b : V} (h : G.Adj a b) :
                b โ‰  a
                theorem SimpleGraph.ne_of_adj_of_not_adj {V : Type u} (G : SimpleGraph V) {v w x : V} (h : G.Adj v x) (hn : ยฌG.Adj w x) :
                v โ‰  w
                theorem SimpleGraph.adj_injective {V : Type u} :
                Function.Injective Adj
                @[simp]
                theorem SimpleGraph.adj_inj {V : Type u} {G H : SimpleGraph V} :
                G.Adj = H.Adj โ†” G = H
                theorem SimpleGraph.adj_congr_of_sym2 {V : Type u} (G : SimpleGraph V) {u v w x : V} (h : s(u, v) = s(w, x)) :
                G.Adj u v โ†” G.Adj w x
                instance SimpleGraph.symm_adj {ฮน : Sort u_1} {V : Type u} (G : SimpleGraph V) (f : ฮน โ†’ V) :
                Std.Symm fun (i j : ฮน) => G.Adj (f i) (f j)
                @[deprecated "use `โ‰ค` instead" (since := "2026-03-25")]

                The relation that one SimpleGraph is a subgraph of another. Note that this should be spelled โ‰ค.

                Instances For
                  @[implicit_reducible]
                  instance SimpleGraph.instLE {V : Type u} :

                  For graphs G, H, G โ‰ค H iff โˆ€ a b, G.Adj a b โ†’ H.Adj a b.

                  theorem SimpleGraph.le_iff_adj {V : Type u} {G H : SimpleGraph V} :
                  G โ‰ค H โ†” โˆ€ (v w : V), G.Adj v w โ†’ H.Adj v w
                  @[implicit_reducible]
                  instance SimpleGraph.instMax {V : Type u} :
                  Max (SimpleGraph V)

                  The supremum of two graphs x โŠ” y has edges where either x or y have edges.

                  @[simp]
                  theorem SimpleGraph.sup_adj {V : Type u} (x y : SimpleGraph V) (v w : V) :
                  (x โŠ” y).Adj v w โ†” x.Adj v w โˆจ y.Adj v w
                  @[implicit_reducible]
                  instance SimpleGraph.instMin {V : Type u} :
                  Min (SimpleGraph V)

                  The infimum of two graphs x โŠ“ y has edges where both x and y have edges.

                  @[simp]
                  theorem SimpleGraph.inf_adj {V : Type u} (x y : SimpleGraph V) (v w : V) :
                  (x โŠ“ y).Adj v w โ†” x.Adj v w โˆง y.Adj v w
                  @[implicit_reducible]

                  We define Gแถœ to be the SimpleGraph V such that no two adjacent vertices in G are adjacent in the complement, and every nonadjacent pair of vertices is adjacent (still ensuring that vertices are not adjacent to themselves).

                  @[simp]
                  theorem SimpleGraph.compl_adj {V : Type u} (G : SimpleGraph V) (v w : V) :
                  Gแถœ.Adj v w โ†” v โ‰  w โˆง ยฌG.Adj v w
                  @[implicit_reducible]
                  instance SimpleGraph.sdiff {V : Type u} :
                  SDiff (SimpleGraph V)

                  The difference of two graphs x \ y has the edges of x with the edges of y removed.

                  @[simp]
                  theorem SimpleGraph.sdiff_adj {V : Type u} (x y : SimpleGraph V) (v w : V) :
                  (x \ y).Adj v w โ†” x.Adj v w โˆง ยฌy.Adj v w
                  @[implicit_reducible]
                  @[implicit_reducible]
                  @[simp]
                  theorem SimpleGraph.sSup_adj {V : Type u} {s : Set (SimpleGraph V)} {a b : V} :
                  (sSup s).Adj a b โ†” โˆƒ G โˆˆ s, G.Adj a b
                  @[simp]
                  theorem SimpleGraph.sInf_adj {V : Type u} {a b : V} {s : Set (SimpleGraph V)} :
                  (sInf s).Adj a b โ†” (โˆ€ G โˆˆ s, G.Adj a b) โˆง a โ‰  b
                  @[simp]
                  theorem SimpleGraph.iSup_adj {ฮน : Sort u_1} {V : Type u} {a b : V} {f : ฮน โ†’ SimpleGraph V} :
                  (โจ† (i : ฮน), f i).Adj a b โ†” โˆƒ (i : ฮน), (f i).Adj a b
                  @[simp]
                  theorem SimpleGraph.iInf_adj {ฮน : Sort u_1} {V : Type u} {a b : V} {f : ฮน โ†’ SimpleGraph V} :
                  (โจ… (i : ฮน), f i).Adj a b โ†” (โˆ€ (i : ฮน), (f i).Adj a b) โˆง a โ‰  b
                  theorem SimpleGraph.sInf_adj_of_nonempty {V : Type u} {a b : V} {s : Set (SimpleGraph V)} (hs : s.Nonempty) :
                  (sInf s).Adj a b โ†” โˆ€ G โˆˆ s, G.Adj a b
                  theorem SimpleGraph.iInf_adj_of_nonempty {ฮน : Sort u_1} {V : Type u} {a b : V} [Nonempty ฮน] {f : ฮน โ†’ SimpleGraph V} :
                  (โจ… (i : ฮน), f i).Adj a b โ†” โˆ€ (i : ฮน), (f i).Adj a b
                  @[reducible, inline]

                  The complete graph on a type V is the simple graph with all pairs of distinct vertices.

                  Instances For
                    @[reducible, inline]

                    The graph with no edges on a given vertex type V.

                    Instances For
                      @[simp]
                      theorem SimpleGraph.top_adj {V : Type u} (v w : V) :
                      โŠค.Adj v w โ†” v โ‰  w
                      @[simp]
                      theorem SimpleGraph.bot_adj {V : Type u} (v w : V) :
                      โŠฅ.Adj v w โ†” False
                      theorem SimpleGraph.eq_bot_iff_forall_not_adj {V : Type u} {G : SimpleGraph V} :
                      G = โŠฅ โ†” โˆ€ (a b : V), ยฌG.Adj a b
                      theorem SimpleGraph.ne_bot_iff_exists_adj {V : Type u} {G : SimpleGraph V} :
                      G โ‰  โŠฅ โ†” โˆƒ (a : V) (b : V), G.Adj a b
                      theorem SimpleGraph.eq_top_iff_forall_ne_adj {V : Type u} {G : SimpleGraph V} :
                      G = โŠค โ†” โˆ€ (a b : V), a โ‰  b โ†’ G.Adj a b
                      theorem SimpleGraph.ne_top_iff_exists_not_adj {V : Type u} {G : SimpleGraph V} :
                      G โ‰  โŠค โ†” โˆƒ (a : V) (b : V), a โ‰  b โˆง ยฌG.Adj a b
                      @[implicit_reducible]
                      instance SimpleGraph.instInhabited (V : Type u) :
                      Inhabited (SimpleGraph V)
                      @[implicit_reducible]
                      instance SimpleGraph.uniqueOfSubsingleton {V : Type u} [Subsingleton V] :
                      @[implicit_reducible]
                      instance SimpleGraph.Bot.adjDecidable (V : Type u) :
                      DecidableRel โŠฅ.Adj
                      @[implicit_reducible]
                      instance SimpleGraph.Sup.adjDecidable (V : Type u) (G H : SimpleGraph V) [DecidableRel G.Adj] [DecidableRel H.Adj] :
                      DecidableRel (G โŠ” H).Adj
                      @[implicit_reducible]
                      instance SimpleGraph.Inf.adjDecidable (V : Type u) (G H : SimpleGraph V) [DecidableRel G.Adj] [DecidableRel H.Adj] :
                      DecidableRel (G โŠ“ H).Adj
                      @[implicit_reducible]
                      instance SimpleGraph.Sdiff.adjDecidable (V : Type u) (G H : SimpleGraph V) [DecidableRel G.Adj] [DecidableRel H.Adj] :
                      DecidableRel (G \ H).Adj
                      @[implicit_reducible]
                      instance SimpleGraph.Top.adjDecidable (V : Type u) [DecidableEq V] :
                      DecidableRel โŠค.Adj
                      @[implicit_reducible]
                      instance SimpleGraph.Compl.adjDecidable (V : Type u) (G : SimpleGraph V) [DecidableRel G.Adj] [DecidableEq V] :
                      DecidableRel Gแถœ.Adj
                      def SimpleGraph.support {V : Type u} (G : SimpleGraph V) :
                      Set V

                      G.support is the set of vertices that form edges in G.

                      Instances For
                        theorem SimpleGraph.mem_support {V : Type u} (G : SimpleGraph V) {v : V} :
                        v โˆˆ G.support โ†” โˆƒ (w : V), G.Adj v w
                        theorem SimpleGraph.support_mono {V : Type u} {G G' : SimpleGraph V} (h : G โ‰ค G') :
                        G.support โІ G'.support
                        @[simp]

                        All vertices are in the support of the complete graph if there is more than one vertex.

                        @[simp]
                        theorem SimpleGraph.support_bot {V : Type u} :
                        โŠฅ.support = โˆ…

                        The support of the empty graph is empty.

                        @[simp]
                        theorem SimpleGraph.support_eq_bot_iff {V : Type u} (G : SimpleGraph V) :
                        G.support = โˆ… โ†” G = โŠฅ

                        Only the empty graph has empty support.

                        @[simp]
                        theorem SimpleGraph.support_of_subsingleton {V : Type u} (G : SimpleGraph V) [Subsingleton V] :
                        G.support = โˆ…

                        The support of a graph is empty if there at most one vertex.

                        def SimpleGraph.neighborSet {V : Type u} (G : SimpleGraph V) (v : V) :
                        Set V

                        G.neighborSet v is the set of vertices adjacent to v in G.

                        Instances For
                          @[implicit_reducible]
                          instance SimpleGraph.neighborSet.memDecidable {V : Type u} (G : SimpleGraph V) (v : V) [DecidableRel G.Adj] :
                          DecidablePred fun (x : V) => x โˆˆ G.neighborSet v

                          The edges of G consist of the unordered pairs of vertices related by G.Adj. This is the order embedding; for the edge set of a particular graph, see SimpleGraph.edgeSet.

                          The way edgeSet is defined is such that mem_edgeSet is proved by Iff.rfl. (That is, s(v, w) โˆˆ G.edgeSet is definitionally equal to G.Adj v w.)

                          Instances For
                            @[reducible, inline]
                            abbrev SimpleGraph.edgeSet {V : Type u} (G : SimpleGraph V) :
                            Set (Sym2 V)

                            G.edgeSet is the edge set for G. This is an abbreviation for edgeSetEmbedding G that permits dot notation.

                            Instances For
                              @[simp]
                              theorem SimpleGraph.mem_edgeSet {V : Type u} (G : SimpleGraph V) {v w : V} :
                              s(v, w) โˆˆ G.edgeSet โ†” G.Adj v w
                              theorem SimpleGraph.not_isDiag_of_mem_edgeSet {V : Type u} (G : SimpleGraph V) {e : Sym2 V} :
                              e โˆˆ G.edgeSet โ†’ ยฌe.IsDiag
                              @[simp]
                              theorem SimpleGraph.not_mem_edgeSet_of_isDiag {V : Type u} (G : SimpleGraph V) {e : Sym2 V} :
                              e.IsDiag โ†’ e โˆ‰ G.edgeSet
                              theorem SimpleGraph.edgeSet_inj {V : Type u} {Gโ‚ Gโ‚‚ : SimpleGraph V} :
                              Gโ‚.edgeSet = Gโ‚‚.edgeSet โ†” Gโ‚ = Gโ‚‚
                              @[simp]
                              theorem SimpleGraph.edgeSet_subset_edgeSet {V : Type u} {Gโ‚ Gโ‚‚ : SimpleGraph V} :
                              Gโ‚.edgeSet โІ Gโ‚‚.edgeSet โ†” Gโ‚ โ‰ค Gโ‚‚
                              @[simp]
                              theorem SimpleGraph.edgeSet_ssubset_edgeSet {V : Type u} {Gโ‚ Gโ‚‚ : SimpleGraph V} :
                              Gโ‚.edgeSet โŠ‚ Gโ‚‚.edgeSet โ†” Gโ‚ < Gโ‚‚
                              theorem SimpleGraph.edgeSet_mono {V : Type u} {Gโ‚ Gโ‚‚ : SimpleGraph V} :
                              Gโ‚ โ‰ค Gโ‚‚ โ†’ Gโ‚.edgeSet โІ Gโ‚‚.edgeSet

                              Alias of the reverse direction of SimpleGraph.edgeSet_subset_edgeSet.

                              theorem SimpleGraph.edgeSet_strict_mono {V : Type u} {Gโ‚ Gโ‚‚ : SimpleGraph V} :
                              Gโ‚ < Gโ‚‚ โ†’ Gโ‚.edgeSet โŠ‚ Gโ‚‚.edgeSet

                              Alias of the reverse direction of SimpleGraph.edgeSet_ssubset_edgeSet.

                              @[deprecated SimpleGraph.edgeSet_subset_compl_diagSet (since := "2025-12-10")]

                              Alias of SimpleGraph.edgeSet_subset_compl_diagSet.

                              @[simp]
                              theorem SimpleGraph.edgeSet_sup {V : Type u} (Gโ‚ Gโ‚‚ : SimpleGraph V) :
                              (Gโ‚ โŠ” Gโ‚‚).edgeSet = Gโ‚.edgeSet โˆช Gโ‚‚.edgeSet
                              @[simp]
                              theorem SimpleGraph.edgeSet_inf {V : Type u} (Gโ‚ Gโ‚‚ : SimpleGraph V) :
                              (Gโ‚ โŠ“ Gโ‚‚).edgeSet = Gโ‚.edgeSet โˆฉ Gโ‚‚.edgeSet
                              @[simp]
                              theorem SimpleGraph.edgeSet_sdiff {V : Type u} (Gโ‚ Gโ‚‚ : SimpleGraph V) :
                              (Gโ‚ \ Gโ‚‚).edgeSet = Gโ‚.edgeSet \ Gโ‚‚.edgeSet
                              @[simp]
                              theorem SimpleGraph.disjoint_edgeSet {V : Type u} {Gโ‚ Gโ‚‚ : SimpleGraph V} :
                              Disjoint Gโ‚.edgeSet Gโ‚‚.edgeSet โ†” Disjoint Gโ‚ Gโ‚‚
                              @[simp]
                              theorem SimpleGraph.edgeSet_eq_empty {V : Type u} {G : SimpleGraph V} :
                              G.edgeSet = โˆ… โ†” G = โŠฅ
                              @[simp]
                              theorem SimpleGraph.edgeSet_nonempty {V : Type u} {G : SimpleGraph V} :
                              G.edgeSet.Nonempty โ†” G โ‰  โŠฅ
                              @[simp]

                              This lemma, combined with edgeSet_sdiff and edgeSet_fromEdgeSet, allows proving (G \ fromEdgeSet s).edgeSet = G.edgeSet \ s by simp.

                              theorem SimpleGraph.adj_iff_exists_edge {V : Type u} {G : SimpleGraph V} {v w : V} :
                              G.Adj v w โ†” v โ‰  w โˆง โˆƒ e โˆˆ G.edgeSet, v โˆˆ e โˆง w โˆˆ e

                              Two vertices are adjacent iff there is an edge between them. The condition v โ‰  w ensures they are different endpoints of the edge, which is necessary since when v = w the existential โˆƒ (e โˆˆ G.edgeSet), v โˆˆ e โˆง w โˆˆ e is satisfied by every edge incident to v.

                              theorem SimpleGraph.adj_iff_exists_edge_coe {V : Type u} {G : SimpleGraph V} {a b : V} :
                              G.Adj a b โ†” โˆƒ (e : โ†‘G.edgeSet), โ†‘e = s(a, b)
                              theorem SimpleGraph.edge_other_ne {V : Type u} (G : SimpleGraph V) {e : Sym2 V} (he : e โˆˆ G.edgeSet) {v : V} (h : v โˆˆ e) :
                              Sym2.Mem.other h โ‰  v
                              @[implicit_reducible]
                              instance SimpleGraph.decidableMemEdgeSet {V : Type u} (G : SimpleGraph V) [DecidableRel G.Adj] :
                              DecidablePred fun (x : Sym2 V) => x โˆˆ G.edgeSet
                              @[implicit_reducible]
                              instance SimpleGraph.fintypeEdgeSet {V : Type u} (G : SimpleGraph V) [Fintype (Sym2 V)] [DecidableRel G.Adj] :
                              Fintype โ†‘G.edgeSet
                              @[implicit_reducible]
                              instance SimpleGraph.fintypeEdgeSetSup {V : Type u} (Gโ‚ Gโ‚‚ : SimpleGraph V) [DecidableEq V] [Fintype โ†‘Gโ‚.edgeSet] [Fintype โ†‘Gโ‚‚.edgeSet] :
                              Fintype โ†‘(Gโ‚ โŠ” Gโ‚‚).edgeSet
                              @[implicit_reducible]
                              instance SimpleGraph.fintypeEdgeSetInf {V : Type u} (Gโ‚ Gโ‚‚ : SimpleGraph V) [DecidableEq V] [Fintype โ†‘Gโ‚.edgeSet] [Fintype โ†‘Gโ‚‚.edgeSet] :
                              Fintype โ†‘(Gโ‚ โŠ“ Gโ‚‚).edgeSet
                              @[implicit_reducible]
                              instance SimpleGraph.fintypeEdgeSetSdiff {V : Type u} (Gโ‚ Gโ‚‚ : SimpleGraph V) [DecidableEq V] [Fintype โ†‘Gโ‚.edgeSet] [Fintype โ†‘Gโ‚‚.edgeSet] :
                              Fintype โ†‘(Gโ‚ \ Gโ‚‚).edgeSet

                              fromEdgeSet constructs a SimpleGraph from a set of edges, without loops.

                              Instances For
                                @[implicit_reducible]
                                instance SimpleGraph.instDecidableRelAdjFromEdgeSetOfDecidablePredSym2MemSetOfDecidableEq {V : Type u} (s : Set (Sym2 V)) [DecidablePred fun (x : Sym2 V) => x โˆˆ s] [DecidableEq V] :
                                DecidableRel (fromEdgeSet s).Adj
                                @[simp]
                                theorem SimpleGraph.fromEdgeSet_adj {V : Type u} {v w : V} (s : Set (Sym2 V)) :
                                (fromEdgeSet s).Adj v w โ†” s(v, w) โˆˆ s โˆง v โ‰  w
                                @[simp]
                                theorem SimpleGraph.fromEdgeSet_le {V : Type u} (G : SimpleGraph V) {s : Set (Sym2 V)} :
                                fromEdgeSet s โ‰ค G โ†” s \ Sym2.diagSet โІ G.edgeSet
                                theorem SimpleGraph.edgeSet_eq_iff {V : Type u} (G : SimpleGraph V) (s : Set (Sym2 V)) :
                                G.edgeSet = s โ†” G = fromEdgeSet s โˆง Disjoint s Sym2.diagSet
                                @[simp]
                                theorem SimpleGraph.fromEdgeSet_inter {V : Type u} (s t : Set (Sym2 V)) :
                                fromEdgeSet (s โˆฉ t) = fromEdgeSet s โŠ“ fromEdgeSet t
                                @[simp]
                                theorem SimpleGraph.fromEdgeSet_union {V : Type u} (s t : Set (Sym2 V)) :
                                fromEdgeSet (s โˆช t) = fromEdgeSet s โŠ” fromEdgeSet t
                                @[implicit_reducible]
                                instance SimpleGraph.instFintypeElemSym2EdgeSetFromEdgeSetOfDecidableEq {V : Type u} (s : Set (Sym2 V)) [DecidableEq V] [Fintype โ†‘s] :
                                theorem SimpleGraph.disjoint_left {V : Type u} {G H : SimpleGraph V} :
                                Disjoint G H โ†” โˆ€ (x y : V), G.Adj x y โ†’ ยฌH.Adj x y

                                Incidence set #

                                def SimpleGraph.incidenceSet {V : Type u} (G : SimpleGraph V) (v : V) :
                                Set (Sym2 V)

                                Set of edges incident to a given vertex, aka incidence set.

                                Instances For
                                  theorem SimpleGraph.mk'_mem_incidenceSet_iff {V : Type u} (G : SimpleGraph V) {a b c : V} :
                                  s(b, c) โˆˆ G.incidenceSet a โ†” G.Adj b c โˆง (a = b โˆจ a = c)
                                  theorem SimpleGraph.mk'_mem_incidenceSet_left_iff {V : Type u} (G : SimpleGraph V) {a b : V} :
                                  s(a, b) โˆˆ G.incidenceSet a โ†” G.Adj a b
                                  theorem SimpleGraph.mk'_mem_incidenceSet_right_iff {V : Type u} (G : SimpleGraph V) {a b : V} :
                                  s(a, b) โˆˆ G.incidenceSet b โ†” G.Adj a b
                                  theorem SimpleGraph.edge_mem_incidenceSet_iff {V : Type u} (G : SimpleGraph V) {a : V} {e : โ†‘G.edgeSet} :
                                  โ†‘e โˆˆ G.incidenceSet a โ†” a โˆˆ โ†‘e
                                  theorem SimpleGraph.incidenceSet_inter_incidenceSet_subset {V : Type u} (G : SimpleGraph V) {a b : V} (h : a โ‰  b) :
                                  G.incidenceSet a โˆฉ G.incidenceSet b โІ {s(a, b)}
                                  theorem SimpleGraph.adj_of_mem_incidenceSet {V : Type u} (G : SimpleGraph V) {a b : V} {e : Sym2 V} (h : a โ‰  b) (ha : e โˆˆ G.incidenceSet a) (hb : e โˆˆ G.incidenceSet b) :
                                  G.Adj a b
                                  theorem SimpleGraph.incidenceSet_inter_incidenceSet_of_not_adj {V : Type u} (G : SimpleGraph V) {a b : V} (h : ยฌG.Adj a b) (hn : a โ‰  b) :
                                  G.incidenceSet a โˆฉ G.incidenceSet b = โˆ…
                                  @[implicit_reducible]
                                  instance SimpleGraph.decidableMemIncidenceSet {V : Type u} (G : SimpleGraph V) [DecidableEq V] [DecidableRel G.Adj] (v : V) :
                                  DecidablePred fun (x : Sym2 V) => x โˆˆ G.incidenceSet v
                                  @[simp]
                                  theorem SimpleGraph.mem_neighborSet {V : Type u} (G : SimpleGraph V) (v w : V) :
                                  w โˆˆ G.neighborSet v โ†” G.Adj v w
                                  @[simp]
                                  theorem SimpleGraph.mem_incidenceSet {V : Type u} (G : SimpleGraph V) (v w : V) :
                                  s(v, w) โˆˆ G.incidenceSet v โ†” G.Adj v w
                                  theorem SimpleGraph.mem_incidence_iff_neighbor {V : Type u} (G : SimpleGraph V) {v w : V} :
                                  s(v, w) โˆˆ G.incidenceSet v โ†” w โˆˆ G.neighborSet v
                                  theorem SimpleGraph.adj_incidenceSet_inter {V : Type u} (G : SimpleGraph V) {v : V} {e : Sym2 V} (he : e โˆˆ G.edgeSet) (h : v โˆˆ e) :
                                  G.incidenceSet v โˆฉ G.incidenceSet (Sym2.Mem.other h) = {e}
                                  def SimpleGraph.commonNeighbors {V : Type u} (G : SimpleGraph V) (v w : V) :
                                  Set V

                                  The set of common neighbors between two vertices v and w in a graph G is the intersection of the neighbor sets of v and w.

                                  Instances For
                                    theorem SimpleGraph.mem_commonNeighbors {V : Type u} (G : SimpleGraph V) {u v w : V} :
                                    u โˆˆ G.commonNeighbors v w โ†” G.Adj v u โˆง G.Adj w u
                                    @[implicit_reducible]
                                    instance SimpleGraph.decidableMemCommonNeighbors {V : Type u} (G : SimpleGraph V) [DecidableRel G.Adj] (v w : V) :
                                    DecidablePred fun (x : V) => x โˆˆ G.commonNeighbors v w
                                    def SimpleGraph.otherVertexOfIncident {V : Type u} (G : SimpleGraph V) [DecidableEq V] {v : V} {e : Sym2 V} (h : e โˆˆ G.incidenceSet v) :
                                    V

                                    Given an edge incident to a particular vertex, get the other vertex on the edge.

                                    Instances For
                                      theorem SimpleGraph.edge_other_incident_set {V : Type u} (G : SimpleGraph V) [DecidableEq V] {v : V} {e : Sym2 V} (h : e โˆˆ G.incidenceSet v) :
                                      theorem SimpleGraph.incidence_other_prop {V : Type u} (G : SimpleGraph V) [DecidableEq V] {v : V} {e : Sym2 V} (h : e โˆˆ G.incidenceSet v) :
                                      @[simp]
                                      theorem SimpleGraph.incidence_other_neighbor_edge {V : Type u} (G : SimpleGraph V) [DecidableEq V] {v w : V} (h : w โˆˆ G.neighborSet v) :
                                      G.otherVertexOfIncident โ‹ฏ = w
                                      def SimpleGraph.incidenceSetEquivNeighborSet {V : Type u} (G : SimpleGraph V) [DecidableEq V] (v : V) :
                                      โ†‘(G.incidenceSet v) โ‰ƒ โ†‘(G.neighborSet v)

                                      There is an equivalence between the set of edges incident to a given vertex and the set of vertices adjacent to the vertex.

                                      Instances For
                                        @[simp]
                                        theorem SimpleGraph.incidenceSetEquivNeighborSet_apply_coe {V : Type u} (G : SimpleGraph V) [DecidableEq V] (v : V) (e : โ†‘(G.incidenceSet v)) :
                                        @[simp]
                                        theorem SimpleGraph.incidenceSetEquivNeighborSet_symm_apply_coe {V : Type u} (G : SimpleGraph V) [DecidableEq V] (v : V) (w : โ†‘(G.neighborSet v)) :
                                        โ†‘((G.incidenceSetEquivNeighborSet v).symm w) = s(v, โ†‘w)
                                        def SimpleGraph.IsCompleteBetween {V : Type u} (G : SimpleGraph V) (s t : Set V) :

                                        The condition that the portion of the simple graph G between s and t is complete, that is, every vertex in s is adjacent to every vertex in t, and vice versa.

                                        Instances For
                                          theorem SimpleGraph.IsCompleteBetween.symm {V : Type u} (G : SimpleGraph V) {s t : Set V} :

                                          Alias of the forward direction of SimpleGraph.isCompleteBetween_comm.

                                          theorem SimpleGraph.subsingleton_iff {V : Type u} :
                                          Subsingleton (SimpleGraph V) โ†” Subsingleton V