File: Mathlib/Combinatorics/SimpleGraph/Finite.lean

full_name: SimpleGraph.edgeFinset
code: /-- The `edgeSet` of the graph as a `Finset`. -/
abbrev edgeFinset : Finset (Sym2 V) 
goal: Finset (Sym2 V)

full_name: SimpleGraph.coe_edgeFinset
code: @[norm_cast]
theorem coe_edgeFinset : (G.edgeFinset : Set (Sym2 V)) = G.edgeSet 
goal: ↑G.edgeFinset = G.edgeSet

full_name: SimpleGraph.mem_edgeFinset
code: theorem mem_edgeFinset : e ∈ G.edgeFinset ↔ e ∈ G.edgeSet 
goal: e ∈ G.edgeFinset ↔ e ∈ G.edgeSet

full_name: SimpleGraph.not_isDiag_of_mem_edgeFinset
code: theorem not_isDiag_of_mem_edgeFinset : e ∈ G.edgeFinset → ¬e.IsDiag 
goal: e ∈ G.edgeFinset → ¬e.IsDiag

full_name: SimpleGraph.edgeFinset_inj
code: theorem edgeFinset_inj : G₁.edgeFinset = G₂.edgeFinset ↔ G₁ = G₂ 
goal: G₁.edgeFinset = G₂.edgeFinset ↔ G₁ = G₂

full_name: SimpleGraph.edgeFinset_subset_edgeFinset
code: theorem edgeFinset_subset_edgeFinset : G₁.edgeFinset ⊆ G₂.edgeFinset ↔ G₁ ≤ G₂ 
goal: G₁.edgeFinset ⊆ G₂.edgeFinset ↔ G₁ ≤ G₂

full_name: SimpleGraph.edgeFinset_ssubset_edgeFinset
code: theorem edgeFinset_ssubset_edgeFinset : G₁.edgeFinset ⊂ G₂.edgeFinset ↔ G₁ < G₂ 
goal: G₁.edgeFinset ⊂ G₂.edgeFinset ↔ G₁ < G₂

full_name: SimpleGraph.edgeFinset_bot
code: @[simp]
theorem edgeFinset_bot : (⊥ : SimpleGraph V).edgeFinset = ∅ 
goal: ⊥.edgeFinset = ∅

full_name: SimpleGraph.edgeFinset_sup
code: @[simp]
theorem edgeFinset_sup [Fintype (edgeSet (G₁ ⊔ G₂))] [DecidableEq V] :
    (G₁ ⊔ G₂).edgeFinset = G₁.edgeFinset ∪ G₂.edgeFinset 
goal: (G₁ ⊔ G₂).edgeFinset = G₁.edgeFinset ∪ G₂.edgeFinset

full_name: SimpleGraph.edgeFinset_inf
code: @[simp]
theorem edgeFinset_inf [DecidableEq V] : (G₁ ⊓ G₂).edgeFinset = G₁.edgeFinset ∩ G₂.edgeFinset 
goal: (G₁ ⊓ G₂).edgeFinset = G₁.edgeFinset ∩ G₂.edgeFinset

full_name: SimpleGraph.edgeFinset_sdiff
code: @[simp]
theorem edgeFinset_sdiff [DecidableEq V] :
    (G₁ \ G₂).edgeFinset = G₁.edgeFinset \ G₂.edgeFinset 
goal: (G₁ \ G₂).edgeFinset = G₁.edgeFinset \ G₂.edgeFinset

full_name: SimpleGraph.edgeFinset_card
code: theorem edgeFinset_card : G.edgeFinset.card = Fintype.card G.edgeSet 
goal: G.edgeFinset.card = Fintype.card ↑G.edgeSet

full_name: SimpleGraph.edgeSet_univ_card
code: @[simp]
theorem edgeSet_univ_card : (univ : Finset G.edgeSet).card = G.edgeFinset.card 
goal: Finset.univ.card = G.edgeFinset.card

full_name: SimpleGraph.edgeFinset_top
code: @[simp]
theorem edgeFinset_top [DecidableEq V] :
    (⊤ : SimpleGraph V).edgeFinset = univ.filter fun e => ¬e.IsDiag 
goal: ⊤.edgeFinset = Finset.filter (fun e => ¬e.IsDiag) Finset.univ

full_name: SimpleGraph.card_edgeFinset_top_eq_card_choose_two
code: /-- The complete graph on `n` vertices has `n.choose 2` edges. -/
theorem card_edgeFinset_top_eq_card_choose_two [DecidableEq V] :
    (⊤ : SimpleGraph V).edgeFinset.card = (Fintype.card V).choose 2 
goal: ⊤.edgeFinset.card = (Fintype.card V).choose 2

full_name: SimpleGraph.card_edgeFinset_le_card_choose_two
code: /-- Any graph on `n` vertices has at most `n.choose 2` edges. -/
theorem card_edgeFinset_le_card_choose_two : G.edgeFinset.card ≤ (Fintype.card V).choose 2 
goal: G.edgeFinset.card ≤ (Fintype.card V).choose 2

full_name: SimpleGraph.edgeFinset_deleteEdges
code: theorem edgeFinset_deleteEdges [DecidableEq V] [Fintype G.edgeSet] (s : Finset (Sym2 V))
    [Fintype (G.deleteEdges s).edgeSet] :
    (G.deleteEdges s).edgeFinset = G.edgeFinset \ s 
goal: (G.deleteEdges ↑s).edgeFinset = G.edgeFinset \ s

full_name: SimpleGraph.DeleteFar
code: /-- A graph is `r`-*delete-far* from a property `p` if we must delete at least `r` edges from it to
get a graph with the property `p`. -/
def DeleteFar (p : SimpleGraph V → Prop) (r : 𝕜) : Prop 
goal: Prop

full_name: SimpleGraph.deleteFar_iff
code: theorem deleteFar_iff :
    G.DeleteFar p r ↔ ∀ ⦃H : SimpleGraph _⦄ [DecidableRel H.Adj],
      H ≤ G → p H → r ≤ G.edgeFinset.card - H.edgeFinset.card 
goal: G.DeleteFar p r ↔
  ∀ ⦃H : SimpleGraph V⦄ [inst : DecidableRel H.Adj], H ≤ G → p H → r ≤ ↑G.edgeFinset.card - ↑H.edgeFinset.card

full_name: SimpleGraph.DeleteFar.mono
code: theorem DeleteFar.mono (h : G.DeleteFar p r₂) (hr : r₁ ≤ r₂) : G.DeleteFar p r₁ 
goal: G.DeleteFar p r₁

full_name: SimpleGraph.neighborFinset
code: /-- `G.neighbors v` is the `Finset` version of `G.Adj v` in case `G` is
locally finite at `v`. -/
def neighborFinset : Finset V 
goal: Finset V

full_name: SimpleGraph.neighborFinset_def
code: theorem neighborFinset_def : G.neighborFinset v = (G.neighborSet v).toFinset 
goal: G.neighborFinset v = (G.neighborSet v).toFinset

full_name: SimpleGraph.mem_neighborFinset
code: @[simp]
theorem mem_neighborFinset (w : V) : w ∈ G.neighborFinset v ↔ G.Adj v w 
goal: w ∈ G.neighborFinset v ↔ G.Adj v w

full_name: SimpleGraph.not_mem_neighborFinset_self
code: theorem not_mem_neighborFinset_self : v ∉ G.neighborFinset v 
goal: v ∉ G.neighborFinset v

full_name: SimpleGraph.neighborFinset_disjoint_singleton
code: theorem neighborFinset_disjoint_singleton : Disjoint (G.neighborFinset v) {v} 
goal: Disjoint (G.neighborFinset v) {v}

full_name: SimpleGraph.singleton_disjoint_neighborFinset
code: theorem singleton_disjoint_neighborFinset : Disjoint {v} (G.neighborFinset v) 
goal: Disjoint {v} (G.neighborFinset v)

full_name: SimpleGraph.degree
code: /-- `G.degree v` is the number of vertices adjacent to `v`. -/
def degree : ℕ 
goal: ℕ

full_name: SimpleGraph.card_neighborFinset_eq_degree
code: @[simp]
theorem card_neighborFinset_eq_degree : (G.neighborFinset v).card = G.degree v 
goal: (G.neighborFinset v).card = G.degree v

full_name: SimpleGraph.card_neighborSet_eq_degree
code: @[simp]
theorem card_neighborSet_eq_degree : Fintype.card (G.neighborSet v) = G.degree v 
goal: Fintype.card ↑(G.neighborSet v) = G.degree v

full_name: SimpleGraph.degree_pos_iff_exists_adj
code: theorem degree_pos_iff_exists_adj : 0 < G.degree v ↔ ∃ w, G.Adj v w 
goal: 0 < G.degree v ↔ ∃ w, G.Adj v w

full_name: SimpleGraph.degree_compl
code: theorem degree_compl [Fintype (Gᶜ.neighborSet v)] [Fintype V] :
    Gᶜ.degree v = Fintype.card V - 1 - G.degree v 
goal: Gᶜ.degree v = Fintype.card V - 1 - G.degree v

full_name: SimpleGraph.incidenceSetFintype
code: instance incidenceSetFintype [DecidableEq V] : Fintype (G.incidenceSet v) 
goal: Fintype ↑(G.incidenceSet v)

full_name: SimpleGraph.incidenceFinset
code: /-- This is the `Finset` version of `incidenceSet`. -/
def incidenceFinset [DecidableEq V] : Finset (Sym2 V) 
goal: Finset (Sym2 V)

full_name: SimpleGraph.card_incidenceSet_eq_degree
code: @[simp]
theorem card_incidenceSet_eq_degree [DecidableEq V] :
    Fintype.card (G.incidenceSet v) = G.degree v 
goal: Fintype.card ↑(G.incidenceSet v) = G.degree v

full_name: SimpleGraph.card_incidenceFinset_eq_degree
code: @[simp]
theorem card_incidenceFinset_eq_degree [DecidableEq V] :
    (G.incidenceFinset v).card = G.degree v 
goal: (G.incidenceFinset v).card = G.degree v

full_name: SimpleGraph.mem_incidenceFinset
code: @[simp]
theorem mem_incidenceFinset [DecidableEq V] (e : Sym2 V) :
    e ∈ G.incidenceFinset v ↔ e ∈ G.incidenceSet v 
goal: e ∈ G.incidenceFinset v ↔ e ∈ G.incidenceSet v

full_name: SimpleGraph.incidenceFinset_eq_filter
code: theorem incidenceFinset_eq_filter [DecidableEq V] [Fintype G.edgeSet] :
    G.incidenceFinset v = G.edgeFinset.filter (Membership.mem v) 
goal: G.incidenceFinset v = Finset.filter (Membership.mem v) G.edgeFinset

full_name: SimpleGraph.LocallyFinite
code: /-- A graph is locally finite if every vertex has a finite neighbor set. -/
abbrev LocallyFinite 
goal: Type u_1

full_name: SimpleGraph.IsRegularOfDegree
code: /-- A locally finite simple graph is regular of degree `d` if every vertex has degree `d`. -/
def IsRegularOfDegree (d : ℕ) : Prop 
goal: Prop

full_name: SimpleGraph.IsRegularOfDegree.degree_eq
code: theorem IsRegularOfDegree.degree_eq {d : ℕ} (h : G.IsRegularOfDegree d) (v : V) : G.degree v = d 
goal: G.degree v = d

full_name: SimpleGraph.IsRegularOfDegree.compl
code: theorem IsRegularOfDegree.compl [Fintype V] [DecidableEq V] {G : SimpleGraph V} [DecidableRel G.Adj]
    {k : ℕ} (h : G.IsRegularOfDegree k) : Gᶜ.IsRegularOfDegree (Fintype.card V - 1 - k) 
goal: Gᶜ.IsRegularOfDegree (Fintype.card V - 1 - k)

full_name: SimpleGraph.neighborSetFintype
code: instance neighborSetFintype [DecidableRel G.Adj] (v : V) : Fintype (G.neighborSet v) 
goal: Fintype ↑(G.neighborSet v)

full_name: SimpleGraph.neighborFinset_eq_filter
code: theorem neighborFinset_eq_filter {v : V} [DecidableRel G.Adj] :
    G.neighborFinset v = Finset.univ.filter (G.Adj v) 
goal: G.neighborFinset v = Finset.filter (G.Adj v) Finset.univ

full_name: SimpleGraph.neighborFinset_compl
code: theorem neighborFinset_compl [DecidableEq V] [DecidableRel G.Adj] (v : V) :
    Gᶜ.neighborFinset v = (G.neighborFinset v)ᶜ \ {v} 
goal: Gᶜ.neighborFinset v = (G.neighborFinset v)ᶜ \ {v}

full_name: SimpleGraph.complete_graph_degree
code: @[simp]
theorem complete_graph_degree [DecidableEq V] (v : V) :
    (⊤ : SimpleGraph V).degree v = Fintype.card V - 1 
goal: ⊤.degree v = Fintype.card V - 1

full_name: SimpleGraph.bot_degree
code: theorem bot_degree (v : V) : (⊥ : SimpleGraph V).degree v = 0 
goal: ⊥.degree v = 0

full_name: SimpleGraph.IsRegularOfDegree.top
code: theorem IsRegularOfDegree.top [DecidableEq V] :
    (⊤ : SimpleGraph V).IsRegularOfDegree (Fintype.card V - 1) 
goal: ⊤.IsRegularOfDegree (Fintype.card V - 1)

full_name: SimpleGraph.minDegree
code: /-- The minimum degree of all vertices (and `0` if there are no vertices).
The key properties of this are given in `exists_minimal_degree_vertex`, `minDegree_le_degree`
and `le_minDegree_of_forall_le_degree`. -/
def minDegree [DecidableRel G.Adj] : ℕ 
goal: ℕ

full_name: SimpleGraph.exists_minimal_degree_vertex
code: /-- There exists a vertex of minimal degree. Note the assumption of being nonempty is necessary, as
the lemma implies there exists a vertex. -/
theorem exists_minimal_degree_vertex [DecidableRel G.Adj] [Nonempty V] :
    ∃ v, G.minDegree = G.degree v 
goal: ∃ v, G.minDegree = G.degree v

full_name: SimpleGraph.minDegree_le_degree
code: /-- The minimum degree in the graph is at most the degree of any particular vertex. -/
theorem minDegree_le_degree [DecidableRel G.Adj] (v : V) : G.minDegree ≤ G.degree v 
goal: G.minDegree ≤ G.degree v

full_name: SimpleGraph.le_minDegree_of_forall_le_degree
code: /-- In a nonempty graph, if `k` is at most the degree of every vertex, it is at most the minimum
degree. Note the assumption that the graph is nonempty is necessary as long as `G.minDegree` is
defined to be a natural. -/
theorem le_minDegree_of_forall_le_degree [DecidableRel G.Adj] [Nonempty V] (k : ℕ)
    (h : ∀ v, k ≤ G.degree v) : k ≤ G.minDegree 
goal: k ≤ G.minDegree

full_name: SimpleGraph.maxDegree
code: /-- The maximum degree of all vertices (and `0` if there are no vertices).
The key properties of this are given in `exists_maximal_degree_vertex`, `degree_le_maxDegree`
and `maxDegree_le_of_forall_degree_le`. -/
def maxDegree [DecidableRel G.Adj] : ℕ 
goal: ℕ

full_name: SimpleGraph.exists_maximal_degree_vertex
code: /-- There exists a vertex of maximal degree. Note the assumption of being nonempty is necessary, as
the lemma implies there exists a vertex. -/
theorem exists_maximal_degree_vertex [DecidableRel G.Adj] [Nonempty V] :
    ∃ v, G.maxDegree = G.degree v 
goal: ∃ v, G.maxDegree = G.degree v

full_name: SimpleGraph.degree_le_maxDegree
code: /-- The maximum degree in the graph is at least the degree of any particular vertex. -/
theorem degree_le_maxDegree [DecidableRel G.Adj] (v : V) : G.degree v ≤ G.maxDegree 
goal: G.degree v ≤ G.maxDegree

full_name: SimpleGraph.maxDegree_le_of_forall_degree_le
code: /-- In a graph, if `k` is at least the degree of every vertex, then it is at least the maximum
degree. -/
theorem maxDegree_le_of_forall_degree_le [DecidableRel G.Adj] (k : ℕ) (h : ∀ v, G.degree v ≤ k) :
    G.maxDegree ≤ k 
goal: G.maxDegree ≤ k

full_name: SimpleGraph.degree_lt_card_verts
code: theorem degree_lt_card_verts [DecidableRel G.Adj] (v : V) : G.degree v < Fintype.card V 
goal: G.degree v < Fintype.card V

full_name: SimpleGraph.maxDegree_lt_card_verts
code: /--
The maximum degree of a nonempty graph is less than the number of vertices. Note that the assumption
that `V` is nonempty is necessary, as otherwise this would assert the existence of a
natural number less than zero. -/
theorem maxDegree_lt_card_verts [DecidableRel G.Adj] [Nonempty V] :
    G.maxDegree < Fintype.card V 
goal: G.maxDegree < Fintype.card V

full_name: SimpleGraph.card_commonNeighbors_le_degree_left
code: theorem card_commonNeighbors_le_degree_left [DecidableRel G.Adj] (v w : V) :
    Fintype.card (G.commonNeighbors v w) ≤ G.degree v 
goal: Fintype.card ↑(G.commonNeighbors v w) ≤ G.degree v

full_name: SimpleGraph.card_commonNeighbors_le_degree_right
code: theorem card_commonNeighbors_le_degree_right [DecidableRel G.Adj] (v w : V) :
    Fintype.card (G.commonNeighbors v w) ≤ G.degree w 
goal: Fintype.card ↑(G.commonNeighbors v w) ≤ G.degree w

full_name: SimpleGraph.card_commonNeighbors_lt_card_verts
code: theorem card_commonNeighbors_lt_card_verts [DecidableRel G.Adj] (v w : V) :
    Fintype.card (G.commonNeighbors v w) < Fintype.card V 
goal: Fintype.card ↑(G.commonNeighbors v w) < Fintype.card V

full_name: SimpleGraph.Adj.card_commonNeighbors_lt_degree
code: /-- If the condition `G.Adj v w` fails, then `card_commonNeighbors_le_degree` is
the best we can do in general. -/
theorem Adj.card_commonNeighbors_lt_degree {G : SimpleGraph V} [DecidableRel G.Adj] {v w : V}
    (h : G.Adj v w) : Fintype.card (G.commonNeighbors v w) < G.degree v 
goal: Fintype.card ↑(G.commonNeighbors v w) < G.degree v

full_name: SimpleGraph.card_commonNeighbors_top
code: theorem card_commonNeighbors_top [DecidableEq V] {v w : V} (h : v ≠ w) :
    Fintype.card ((⊤ : SimpleGraph V).commonNeighbors v w) = Fintype.card V - 2 
goal: Fintype.card ↑(⊤.commonNeighbors v w) = Fintype.card V - 2