File: Mathlib/Combinatorics/SimpleGraph/Clique.lean

full_name: SimpleGraph.IsClique
code: /-- A clique in a graph is a set of vertices that are pairwise adjacent. -/
abbrev IsClique (s : Set α) : Prop 
goal: Prop

full_name: SimpleGraph.isClique_iff
code: theorem isClique_iff : G.IsClique s ↔ s.Pairwise G.Adj 
goal: G.IsClique s ↔ s.Pairwise G.Adj

full_name: SimpleGraph.isClique_iff_induce_eq
code: /-- A clique is a set of vertices whose induced graph is complete. -/
theorem isClique_iff_induce_eq : G.IsClique s ↔ G.induce s = ⊤ 
goal: G.IsClique s ↔ SimpleGraph.induce s G = ⊤

full_name: SimpleGraph.instDecidableIsCliqueToSetOfDecidableEqOfDecidableRelAdj
code: instance [DecidableEq α] [DecidableRel G.Adj] {s : Finset α} : Decidable (G.IsClique s) 
goal: Decidable (G.IsClique ↑s)

full_name: SimpleGraph.isClique_empty
code: lemma isClique_empty : G.IsClique ∅ 
goal: G.IsClique ∅

full_name: SimpleGraph.isClique_singleton
code: lemma isClique_singleton (a : α) : G.IsClique {a} 
goal: G.IsClique {a}

full_name: SimpleGraph.IsClique.of_subsingleton
code: theorem IsClique.of_subsingleton {G : SimpleGraph α} (hs : s.Subsingleton) : G.IsClique s 
goal: G.IsClique s

full_name: SimpleGraph.isClique_pair
code: lemma isClique_pair : G.IsClique {a, b} ↔ a ≠ b → G.Adj a b 
goal: G.IsClique {a, b} ↔ a ≠ b → G.Adj a b

full_name: SimpleGraph.isClique_insert
code: @[simp]
lemma isClique_insert : G.IsClique (insert a s) ↔ G.IsClique s ∧ ∀ b ∈ s, a ≠ b → G.Adj a b 
goal: G.IsClique (insert a s) ↔ G.IsClique s ∧ ∀ b ∈ s, a ≠ b → G.Adj a b

full_name: SimpleGraph.isClique_insert_of_not_mem
code: lemma isClique_insert_of_not_mem (ha : a ∉ s) :
    G.IsClique (insert a s) ↔ G.IsClique s ∧ ∀ b ∈ s, G.Adj a b 
goal: G.IsClique (insert a s) ↔ G.IsClique s ∧ ∀ b ∈ s, G.Adj a b

full_name: SimpleGraph.IsClique.insert
code: lemma IsClique.insert (hs : G.IsClique s) (h : ∀ b ∈ s, a ≠ b → G.Adj a b) :
    G.IsClique (insert a s) 
goal: G.IsClique (insert a s)

full_name: SimpleGraph.IsClique.mono
code: theorem IsClique.mono (h : G ≤ H) : G.IsClique s → H.IsClique s 
goal: G.IsClique s → H.IsClique s

full_name: SimpleGraph.IsClique.subset
code: theorem IsClique.subset (h : t ⊆ s) : G.IsClique s → G.IsClique t 
goal: G.IsClique s → G.IsClique t

full_name: SimpleGraph.isClique_bot_iff
code: @[simp]
theorem isClique_bot_iff : (⊥ : SimpleGraph α).IsClique s ↔ (s : Set α).Subsingleton 
goal: ⊥.IsClique s ↔ s.Subsingleton

full_name: SimpleGraph.IsClique.map
code: protected theorem IsClique.map (h : G.IsClique s) {f : α ↪ β} : (G.map f).IsClique (f '' s) 
goal: (SimpleGraph.map f G).IsClique (⇑f '' s)

full_name: SimpleGraph.isClique_map_iff_of_nontrivial
code: theorem isClique_map_iff_of_nontrivial {f : α ↪ β} {t : Set β} (ht : t.Nontrivial) :
    (G.map f).IsClique t ↔ ∃ (s : Set α), G.IsClique s ∧ f '' s = t 
goal: (SimpleGraph.map f G).IsClique t ↔ ∃ s, G.IsClique s ∧ ⇑f '' s = t

full_name: SimpleGraph.isClique_map_iff
code: theorem isClique_map_iff {f : α ↪ β} {t : Set β} :
    (G.map f).IsClique t ↔ t.Subsingleton ∨ ∃ (s : Set α), G.IsClique s ∧ f '' s = t 
goal: (SimpleGraph.map f G).IsClique t ↔ t.Subsingleton ∨ ∃ s, G.IsClique s ∧ ⇑f '' s = t

full_name: SimpleGraph.isClique_map_image_iff
code: @[simp] theorem isClique_map_image_iff {f : α ↪ β} :
    (G.map f).IsClique (f '' s) ↔ G.IsClique s 
goal: (SimpleGraph.map f G).IsClique (⇑f '' s) ↔ G.IsClique s

full_name: SimpleGraph.isClique_map_finset_iff_of_nontrivial
code: theorem isClique_map_finset_iff_of_nontrivial (ht : t.Nontrivial) :
    (G.map f).IsClique t ↔ ∃ (s : Finset α), G.IsClique s ∧ s.map f = t 
goal: (SimpleGraph.map f G).IsClique ↑t ↔ ∃ s, G.IsClique ↑s ∧ Finset.map f s = t

full_name: SimpleGraph.isClique_map_finset_iff
code: theorem isClique_map_finset_iff :
    (G.map f).IsClique t ↔ t.card ≤ 1 ∨ ∃ (s : Finset α), G.IsClique s ∧ s.map f = t 
goal: (SimpleGraph.map f G).IsClique ↑t ↔ t.card ≤ 1 ∨ ∃ s, G.IsClique ↑s ∧ Finset.map f s = t

full_name: SimpleGraph.IsClique.finsetMap
code: protected theorem IsClique.finsetMap {f : α ↪ β} {s : Finset α} (h : G.IsClique s) :
    (G.map f).IsClique (s.map f) 
goal: (SimpleGraph.map f G).IsClique ↑(Finset.map f s)

full_name: SimpleGraph.IsNClique
code: /-- An `n`-clique in a graph is a set of `n` vertices which are pairwise connected. -/
structure IsNClique (n : ℕ) (s : Finset α) : Prop where
  clique : G.IsClique s
  card_eq : s.card = n
goal: Prop

full_name: SimpleGraph.IsNClique.clique
code: /-- An `n`-clique in a graph is a set of `n` vertices which are pairwise connected. -/
structure IsNClique (n : ℕ) (s : Finset α) : Prop where
  clique : G.IsClique s
  card_eq : s.card = n
goal: G.IsClique ↑s

full_name: SimpleGraph.IsNClique.card_eq
code: /-- An `n`-clique in a graph is a set of `n` vertices which are pairwise connected. -/
structure IsNClique (n : ℕ) (s : Finset α) : Prop where
  clique : G.IsClique s
  card_eq : s.card = n
goal: s.card = n

full_name: SimpleGraph.isNClique_iff
code: theorem isNClique_iff : G.IsNClique n s ↔ G.IsClique s ∧ s.card = n 
goal: G.IsNClique n s ↔ G.IsClique ↑s ∧ s.card = n

full_name: SimpleGraph.instDecidableIsNCliqueOfDecidableEqOfDecidableRelAdj
code: instance [DecidableEq α] [DecidableRel G.Adj] {n : ℕ} {s : Finset α} :
    Decidable (G.IsNClique n s) 
goal: Decidable (G.IsNClique n s)

full_name: SimpleGraph.isNClique_empty
code: @[simp] lemma isNClique_empty : G.IsNClique n ∅ ↔ n = 0 
goal: G.IsNClique n ∅ ↔ n = 0

full_name: SimpleGraph.isNClique_singleton
code: @[simp]
lemma isNClique_singleton : G.IsNClique n {a} ↔ n = 1 
goal: G.IsNClique n {a} ↔ n = 1

full_name: SimpleGraph.IsNClique.mono
code: theorem IsNClique.mono (h : G ≤ H) : G.IsNClique n s → H.IsNClique n s 
goal: G.IsNClique n s → H.IsNClique n s

full_name: SimpleGraph.IsNClique.map
code: protected theorem IsNClique.map (h : G.IsNClique n s) {f : α ↪ β} :
    (G.map f).IsNClique n (s.map f) 
goal: (SimpleGraph.map f G).IsNClique n (Finset.map f s)

full_name: SimpleGraph.isNClique_map_iff
code: theorem isNClique_map_iff (hn : 1 < n) {t : Finset β} {f : α ↪ β} :
    (G.map f).IsNClique n t ↔ ∃ s : Finset α, G.IsNClique n s ∧ s.map f = t 
goal: (SimpleGraph.map f G).IsNClique n t ↔ ∃ s, G.IsNClique n s ∧ Finset.map f s = t

full_name: SimpleGraph.isNClique_bot_iff
code: @[simp]
theorem isNClique_bot_iff : (⊥ : SimpleGraph α).IsNClique n s ↔ n ≤ 1 ∧ s.card = n 
goal: ⊥.IsNClique n s ↔ n ≤ 1 ∧ s.card = n

full_name: SimpleGraph.isNClique_zero
code: @[simp]
theorem isNClique_zero : G.IsNClique 0 s ↔ s = ∅ 
goal: G.IsNClique 0 s ↔ s = ∅

full_name: SimpleGraph.isNClique_one
code: @[simp]
theorem isNClique_one : G.IsNClique 1 s ↔ ∃ a, s = {a} 
goal: G.IsNClique 1 s ↔ ∃ a, s = {a}

full_name: SimpleGraph.IsNClique.insert
code: theorem IsNClique.insert (hs : G.IsNClique n s) (h : ∀ b ∈ s, G.Adj a b) :
    G.IsNClique (n + 1) (insert a s) 
goal: G.IsNClique (n + 1) (insert a s)

full_name: SimpleGraph.is3Clique_triple_iff
code: theorem is3Clique_triple_iff : G.IsNClique 3 {a, b, c} ↔ G.Adj a b ∧ G.Adj a c ∧ G.Adj b c 
goal: G.IsNClique 3 {a, b, c} ↔ G.Adj a b ∧ G.Adj a c ∧ G.Adj b c

full_name: SimpleGraph.is3Clique_iff
code: theorem is3Clique_iff :
    G.IsNClique 3 s ↔ ∃ a b c, G.Adj a b ∧ G.Adj a c ∧ G.Adj b c ∧ s = {a, b, c} 
goal: G.IsNClique 3 s ↔ ∃ a b c, G.Adj a b ∧ G.Adj a c ∧ G.Adj b c ∧ s = {a, b, c}

full_name: SimpleGraph.is3Clique_iff_exists_cycle_length_three
code: theorem is3Clique_iff_exists_cycle_length_three :
    (∃ s : Finset α, G.IsNClique 3 s) ↔ ∃ (u : α) (w : G.Walk u u), w.IsCycle ∧ w.length = 3 
goal: (∃ s, G.IsNClique 3 s) ↔ ∃ u w, w.IsCycle ∧ w.length = 3

full_name: SimpleGraph.CliqueFree
code: /-- `G.CliqueFree n` means that `G` has no `n`-cliques. -/
def CliqueFree (n : ℕ) : Prop 
goal: Prop

full_name: SimpleGraph.IsNClique.not_cliqueFree
code: theorem IsNClique.not_cliqueFree (hG : G.IsNClique n s) : ¬G.CliqueFree n 
goal: ¬G.CliqueFree n

full_name: SimpleGraph.not_cliqueFree_of_top_embedding
code: theorem not_cliqueFree_of_top_embedding {n : ℕ} (f : (⊤ : SimpleGraph (Fin n)) ↪g G) :
    ¬G.CliqueFree n 
goal: ¬G.CliqueFree n

full_name: SimpleGraph.topEmbeddingOfNotCliqueFree
code: /-- An embedding of a complete graph that witnesses the fact that the graph is not clique-free. -/
noncomputable def topEmbeddingOfNotCliqueFree {n : ℕ} (h : ¬G.CliqueFree n) :
    (⊤ : SimpleGraph (Fin n)) ↪g G 
goal: ⊤ ↪g G

full_name: SimpleGraph.not_cliqueFree_iff
code: theorem not_cliqueFree_iff (n : ℕ) : ¬G.CliqueFree n ↔ Nonempty ((⊤ : SimpleGraph (Fin n)) ↪g G) 
goal: ¬G.CliqueFree n ↔ Nonempty (⊤ ↪g G)

full_name: SimpleGraph.cliqueFree_iff
code: theorem cliqueFree_iff {n : ℕ} : G.CliqueFree n ↔ IsEmpty ((⊤ : SimpleGraph (Fin n)) ↪g G) 
goal: G.CliqueFree n ↔ IsEmpty (⊤ ↪g G)

full_name: SimpleGraph.not_cliqueFree_card_of_top_embedding
code: theorem not_cliqueFree_card_of_top_embedding [Fintype α] (f : (⊤ : SimpleGraph α) ↪g G) :
    ¬G.CliqueFree (card α) 
goal: ¬G.CliqueFree (Fintype.card α)

full_name: SimpleGraph.cliqueFree_bot
code: @[simp]
theorem cliqueFree_bot (h : 2 ≤ n) : (⊥ : SimpleGraph α).CliqueFree n 
goal: ⊥.CliqueFree n

full_name: SimpleGraph.CliqueFree.mono
code: theorem CliqueFree.mono (h : m ≤ n) : G.CliqueFree m → G.CliqueFree n 
goal: G.CliqueFree m → G.CliqueFree n

full_name: SimpleGraph.CliqueFree.anti
code: theorem CliqueFree.anti (h : G ≤ H) : H.CliqueFree n → G.CliqueFree n 
goal: H.CliqueFree n → G.CliqueFree n

full_name: SimpleGraph.CliqueFree.comap
code: /-- If a graph is cliquefree, any graph that embeds into it is also cliquefree. -/
theorem CliqueFree.comap {H : SimpleGraph β} (f : H ↪g G) : G.CliqueFree n → H.CliqueFree n 
goal: G.CliqueFree n → H.CliqueFree n

full_name: SimpleGraph.cliqueFree_map_iff
code: @[simp] theorem cliqueFree_map_iff {f : α ↪ β} [Nonempty α] :
    (G.map f).CliqueFree n ↔ G.CliqueFree n 
goal: (SimpleGraph.map f G).CliqueFree n ↔ G.CliqueFree n

full_name: SimpleGraph.cliqueFree_of_card_lt
code: /-- See `SimpleGraph.cliqueFree_of_chromaticNumber_lt` for a tighter bound. -/
theorem cliqueFree_of_card_lt [Fintype α] (hc : card α < n) : G.CliqueFree n 
goal: G.CliqueFree n

full_name: SimpleGraph.cliqueFree_completeMultipartiteGraph
code: /-- A complete `r`-partite graph has no `n`-cliques for `r < n`. -/
theorem cliqueFree_completeMultipartiteGraph {ι : Type*} [Fintype ι] (V : ι → Type*)
    (hc : card ι < n) : (completeMultipartiteGraph V).CliqueFree n 
goal: (SimpleGraph.completeMultipartiteGraph V).CliqueFree n

full_name: SimpleGraph.CliqueFree.replaceVertex
code: /-- Clique-freeness is preserved by `replaceVertex`. -/
protected theorem CliqueFree.replaceVertex [DecidableEq α] (h : G.CliqueFree n) (s t : α) :
    (G.replaceVertex s t).CliqueFree n 
goal: (G.replaceVertex s t).CliqueFree n

full_name: SimpleGraph.cliqueFree_two
code: @[simp]
theorem cliqueFree_two : G.CliqueFree 2 ↔ G = ⊥ 
goal: G.CliqueFree 2 ↔ G = ⊥

full_name: SimpleGraph.CliqueFree.sup_edge
code: /-- Adding an edge increases the clique number by at most one. -/
protected theorem CliqueFree.sup_edge (h : G.CliqueFree n) (v w : α) :
    (G ⊔ edge v w).CliqueFree (n + 1) 
goal: (G ⊔ SimpleGraph.edge v w).CliqueFree (n + 1)

full_name: SimpleGraph.CliqueFreeOn
code: /-- `G.CliqueFreeOn s n` means that `G` has no `n`-cliques contained in `s`. -/
def CliqueFreeOn (G : SimpleGraph α) (s : Set α) (n : ℕ) : Prop 
goal: Prop

full_name: SimpleGraph.CliqueFreeOn.subset
code: theorem CliqueFreeOn.subset (hs : s₁ ⊆ s₂) (h₂ : G.CliqueFreeOn s₂ n) : G.CliqueFreeOn s₁ n 
goal: G.CliqueFreeOn s₁ n

full_name: SimpleGraph.CliqueFreeOn.mono
code: theorem CliqueFreeOn.mono (hmn : m ≤ n) (hG : G.CliqueFreeOn s m) : G.CliqueFreeOn s n 
goal: G.CliqueFreeOn s n

full_name: SimpleGraph.CliqueFreeOn.anti
code: theorem CliqueFreeOn.anti (hGH : G ≤ H) (hH : H.CliqueFreeOn s n) : G.CliqueFreeOn s n 
goal: G.CliqueFreeOn s n

full_name: SimpleGraph.cliqueFreeOn_empty
code: @[simp]
theorem cliqueFreeOn_empty : G.CliqueFreeOn ∅ n ↔ n ≠ 0 
goal: G.CliqueFreeOn ∅ n ↔ n ≠ 0

full_name: SimpleGraph.cliqueFreeOn_singleton
code: @[simp]
theorem cliqueFreeOn_singleton : G.CliqueFreeOn {a} n ↔ 1 < n 
goal: G.CliqueFreeOn {a} n ↔ 1 < n

full_name: SimpleGraph.cliqueFreeOn_univ
code: @[simp]
theorem cliqueFreeOn_univ : G.CliqueFreeOn Set.univ n ↔ G.CliqueFree n 
goal: G.CliqueFreeOn Set.univ n ↔ G.CliqueFree n

full_name: SimpleGraph.CliqueFree.cliqueFreeOn
code: protected theorem CliqueFree.cliqueFreeOn (hG : G.CliqueFree n) : G.CliqueFreeOn s n 
goal: G.CliqueFreeOn s n

full_name: SimpleGraph.cliqueFreeOn_of_card_lt
code: theorem cliqueFreeOn_of_card_lt {s : Finset α} (h : s.card < n) : G.CliqueFreeOn s n 
goal: G.CliqueFreeOn (↑s) n

full_name: SimpleGraph.cliqueFreeOn_two
code: @[simp]
theorem cliqueFreeOn_two : G.CliqueFreeOn s 2 ↔ s.Pairwise (G.Adjᶜ) 
goal: G.CliqueFreeOn s 2 ↔ s.Pairwise G.Adjᶜ

full_name: SimpleGraph.CliqueFreeOn.of_succ
code: theorem CliqueFreeOn.of_succ (hs : G.CliqueFreeOn s (n + 1)) (ha : a ∈ s) :
    G.CliqueFreeOn (s ∩ G.neighborSet a) n 
goal: G.CliqueFreeOn (s ∩ G.neighborSet a) n

full_name: SimpleGraph.cliqueSet
code: /-- The `n`-cliques in a graph as a set. -/
def cliqueSet (n : ℕ) : Set (Finset α) 
goal: Set (Finset α)

full_name: SimpleGraph.mem_cliqueSet_iff
code: @[simp]
theorem mem_cliqueSet_iff : s ∈ G.cliqueSet n ↔ G.IsNClique n s 
goal: s ∈ G.cliqueSet n ↔ G.IsNClique n s

full_name: SimpleGraph.cliqueSet_eq_empty_iff
code: @[simp]
theorem cliqueSet_eq_empty_iff : G.cliqueSet n = ∅ ↔ G.CliqueFree n 
goal: G.cliqueSet n = ∅ ↔ G.CliqueFree n

full_name: SimpleGraph.cliqueSet_mono
code: @[mono]
theorem cliqueSet_mono (h : G ≤ H) : G.cliqueSet n ⊆ H.cliqueSet n 
goal: G.cliqueSet n ⊆ H.cliqueSet n

full_name: SimpleGraph.cliqueSet_mono'
code: theorem cliqueSet_mono' (h : G ≤ H) : G.cliqueSet ≤ H.cliqueSet 
goal: G.cliqueSet ≤ H.cliqueSet

full_name: SimpleGraph.cliqueSet_zero
code: @[simp]
theorem cliqueSet_zero (G : SimpleGraph α) : G.cliqueSet 0 = {∅} 
goal: G.cliqueSet 0 = {∅}

full_name: SimpleGraph.cliqueSet_one
code: @[simp]
theorem cliqueSet_one (G : SimpleGraph α) : G.cliqueSet 1 = Set.range singleton 
goal: G.cliqueSet 1 = Set.range singleton

full_name: SimpleGraph.cliqueSet_bot
code: @[simp]
theorem cliqueSet_bot (hn : 1 < n) : (⊥ : SimpleGraph α).cliqueSet n = ∅ 
goal: ⊥.cliqueSet n = ∅

full_name: SimpleGraph.cliqueSet_map
code: @[simp]
theorem cliqueSet_map (hn : n ≠ 1) (G : SimpleGraph α) (f : α ↪ β) :
    (G.map f).cliqueSet n = map f '' G.cliqueSet n 
goal: (SimpleGraph.map f G).cliqueSet n = Finset.map f '' G.cliqueSet n

full_name: SimpleGraph.cliqueSet_map_of_equiv
code: @[simp]
theorem cliqueSet_map_of_equiv (G : SimpleGraph α) (e : α ≃ β) (n : ℕ) :
    (G.map e.toEmbedding).cliqueSet n = map e.toEmbedding '' G.cliqueSet n 
goal: (SimpleGraph.map e.toEmbedding G).cliqueSet n = Finset.map e.toEmbedding '' G.cliqueSet n

full_name: SimpleGraph.cliqueFinset
code: /-- The `n`-cliques in a graph as a finset. -/
def cliqueFinset (n : ℕ) : Finset (Finset α) 
goal: Finset (Finset α)

full_name: SimpleGraph.mem_cliqueFinset_iff
code: @[simp]
theorem mem_cliqueFinset_iff : s ∈ G.cliqueFinset n ↔ G.IsNClique n s 
goal: s ∈ G.cliqueFinset n ↔ G.IsNClique n s

full_name: SimpleGraph.coe_cliqueFinset
code: @[simp, norm_cast]
theorem coe_cliqueFinset (n : ℕ) : (G.cliqueFinset n : Set (Finset α)) = G.cliqueSet n 
goal: ↑(G.cliqueFinset n) = G.cliqueSet n

full_name: SimpleGraph.cliqueFinset_eq_empty_iff
code: @[simp]
theorem cliqueFinset_eq_empty_iff : G.cliqueFinset n = ∅ ↔ G.CliqueFree n 
goal: G.cliqueFinset n = ∅ ↔ G.CliqueFree n

full_name: SimpleGraph.card_cliqueFinset_le
code: theorem card_cliqueFinset_le : (G.cliqueFinset n).card ≤ (card α).choose n 
goal: (G.cliqueFinset n).card ≤ (Fintype.card α).choose n

full_name: SimpleGraph.cliqueFinset_mono
code: @[mono]
theorem cliqueFinset_mono (h : G ≤ H) : G.cliqueFinset n ⊆ H.cliqueFinset n 
goal: G.cliqueFinset n ⊆ H.cliqueFinset n

full_name: SimpleGraph.cliqueFinset_map
code: @[simp]
theorem cliqueFinset_map (f : α ↪ β) (hn : n ≠ 1) :
    (G.map f).cliqueFinset n = (G.cliqueFinset n).map ⟨map f, Finset.map_injective _⟩ 
goal: (SimpleGraph.map f G).cliqueFinset n = Finset.map { toFun := Finset.map f, inj' := ⋯ } (G.cliqueFinset n)

full_name: SimpleGraph.cliqueFinset_map_of_equiv
code: @[simp]
theorem cliqueFinset_map_of_equiv (e : α ≃ β) (n : ℕ) :
    (G.map e.toEmbedding).cliqueFinset n =
      (G.cliqueFinset n).map ⟨map e.toEmbedding, Finset.map_injective _⟩ 
goal: (SimpleGraph.map e.toEmbedding G).cliqueFinset n =
  Finset.map { toFun := Finset.map e.toEmbedding, inj' := ⋯ } (G.cliqueFinset n)