The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V30. Combinatorics

Mathlib.Combinatorics.SimpleGraph.Prod

45 declarations. Mathlib docs · Source

theorem SimpleGraph.Walk.ofBoxProdLeft.match_1.congr_eq_1 E1 #

∀ {α : Type u_1} {β : Type u_2} {G : SimpleGraph α} {H : SimpleGraph β} {x : α × β}
  (motive : (y : α × β) → (G □ H).Walk x y → Sort u_3) (y : α × β) (x_1 : (G □ H).Walk x y)
  (h_1 : Unit → motive x SimpleGraph.Walk.nil)
  (h_2 : (y v : α × β) → (h : (G □ H).Adj x v) → (w : (G □ H).Walk v y) → motive y (SimpleGraph.Walk.cons h w)),
  y = x →
    x_1 ≍ SimpleGraph.Walk.nil →
      (match y, x_1 with
        | .(x), SimpleGraph.Walk.nil => h_1 ()
        | y, SimpleGraph.Walk.cons h w => h_2 y v h w) ≍
        h_1 ()

theorem SimpleGraph.Walk.ofBoxProdLeft.match_1.congr_eq_2 E1 #

∀ {α : Type u_1} {β : Type u_2} {G : SimpleGraph α} {H : SimpleGraph β} {x : α × β}
  (motive : (y : α × β) → (G □ H).Walk x y → Sort u_3) (y : α × β) (x_1 : (G □ H).Walk x y)
  (h_1 : Unit → motive x SimpleGraph.Walk.nil)
  (h_2 : (y v : α × β) → (h : (G □ H).Adj x v) → (w : (G □ H).Walk v y) → motive y (SimpleGraph.Walk.cons h w))
  (y_1 v : α × β) (h : (G □ H).Adj x v) (w : (G □ H).Walk v y_1),
  y = y_1 →
    x_1 ≍ SimpleGraph.Walk.cons h w →
      (match y, x_1 with
        | .(x), SimpleGraph.Walk.nil => h_1 ()
        | y, SimpleGraph.Walk.cons h w => h_2 y v h w) ≍
        h_2 y_1 v h w

def SimpleGraph.boxProd E1 #

{α : Type u_1} → {β : Type u_2} → SimpleGraph α → SimpleGraph β → SimpleGraph (α × β)

Box product of simple graphs. It relates (a₁, b) and (a₂, b) if G relates a₁ and a₂, and (a, b₁) and (a, b₂) if H relates b₁ and b₂.

def SimpleGraph.«term_□_» E1 #

Lean.TrailingParserDescr

Box product of simple graphs. It relates (a₁, b) and (a₂, b) if G relates a₁ and a₂, and (a, b₁) and (a, b₂) if H relates b₁ and b₂.

theorem SimpleGraph.boxProd_adj E0 #

∀ {α : Type u_1} {β : Type u_2} {G : SimpleGraph α} {H : SimpleGraph β} {x y : α × β},
  (G □ H).Adj x y ↔ G.Adj x.1 y.1 ∧ x.2 = y.2 ∨ H.Adj x.2 y.2 ∧ x.1 = y.1

theorem SimpleGraph.boxProd_adj_left E1 #

∀ {α : Type u_1} {β : Type u_2} {G : SimpleGraph α} {H : SimpleGraph β} {a₁ : α} {b : β} {a₂ : α},
  (G □ H).Adj (a₁, b) (a₂, b) ↔ G.Adj a₁ a₂

theorem SimpleGraph.boxProd_adj_right E1 #

∀ {α : Type u_1} {β : Type u_2} {G : SimpleGraph α} {H : SimpleGraph β} {a : α} {b₁ b₂ : β},
  (G □ H).Adj (a, b₁) (a, b₂) ↔ H.Adj b₁ b₂

theorem SimpleGraph.neighborSet_boxProd E1 #

∀ {α : Type u_1} {β : Type u_2} {G : SimpleGraph α} {H : SimpleGraph β} (x : α × β),
  (G □ H).neighborSet x = G.neighborSet x.1 ×ˢ {x.2} ∪ {x.1} ×ˢ H.neighborSet x.2

def SimpleGraph.boxProdComm E1 #

{α : Type u_1} → {β : Type u_2} → (G : SimpleGraph α) → (H : SimpleGraph β) → G □ H ≃g H □ G

The box product is commutative up to isomorphism. Equiv.prodComm as a graph isomorphism.

theorem SimpleGraph.boxProdComm_symm_apply E0 #

∀ {α : Type u_1} {β : Type u_2} (G : SimpleGraph α) (H : SimpleGraph β) (a : β × α),
  (RelIso.symm (G.boxProdComm H)) a = a.swap

theorem SimpleGraph.boxProdComm_apply E0 #

∀ {α : Type u_1} {β : Type u_2} (G : SimpleGraph α) (H : SimpleGraph β) (a : α × β), (G.boxProdComm H) a = a.swap

def SimpleGraph.boxProdAssoc E1 #

{α : Type u_1} →
  {β : Type u_2} →
    {γ : Type u_3} → (G : SimpleGraph α) → (H : SimpleGraph β) → (I : SimpleGraph γ) → G □ H □ I ≃g G □ (H □ I)

The box product is associative up to isomorphism. Equiv.prodAssoc as a graph isomorphism.

theorem SimpleGraph.boxProdAssoc_apply E0 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} (G : SimpleGraph α) (H : SimpleGraph β) (I : SimpleGraph γ)
  (p : (α × β) × γ), (G.boxProdAssoc H I) p = (p.1.1, p.1.2, p.2)

theorem SimpleGraph.boxProdAssoc_symm_apply E0 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} (G : SimpleGraph α) (H : SimpleGraph β) (I : SimpleGraph γ)
  (p : α × β × γ), (RelIso.symm (G.boxProdAssoc H I)) p = ((p.1, p.2.1), p.2.2)

def SimpleGraph.boxProdLeft E1 #

{α : Type u_1} → {β : Type u_2} → (G : SimpleGraph α) → (H : SimpleGraph β) → β → G ↪g G □ H

The embedding of G into G □ H given by b.

theorem SimpleGraph.boxProdLeft_apply E0 #

∀ {α : Type u_1} {β : Type u_2} (G : SimpleGraph α) (H : SimpleGraph β) (b : β) (a : α), (G.boxProdLeft H b) a = (a, b)

def SimpleGraph.boxProdRight E1 #

{α : Type u_1} → {β : Type u_2} → (G : SimpleGraph α) → (H : SimpleGraph β) → α → H ↪g G □ H

The embedding of H into G □ H given by a.

theorem SimpleGraph.boxProdRight_apply E0 #

∀ {α : Type u_1} {β : Type u_2} (G : SimpleGraph α) (H : SimpleGraph β) (a : α) (snd : β),
  (G.boxProdRight H a) snd = (a, snd)

def SimpleGraph.Iso.boxProdSumDistrib E1 #

{V : Type u_4} →
  {W₁ : Type u_8} →
    {W₂ : Type u_9} →
      (G : SimpleGraph V) → (H₁ : SimpleGraph W₁) → (H₂ : SimpleGraph W₂) → G □ (H₁ ⊕g H₂) ≃g G □ H₁ ⊕g G □ H₂

The box product distributes over the disjoint sum of graphs.

theorem SimpleGraph.Iso.boxProdSumDistrib_symm_apply E0 #

∀ {V : Type u_4} {W₁ : Type u_8} {W₂ : Type u_9} (G : SimpleGraph V) (H₁ : SimpleGraph W₁) (H₂ : SimpleGraph W₂)
  (a : V × W₁ ⊕ V × W₂),
  (RelIso.symm (SimpleGraph.Iso.boxProdSumDistrib G H₁ H₂)) a =
    ((Equiv.sumProdDistrib W₁ W₂ V).symm (Sum.map Prod.swap Prod.swap a)).swap

theorem SimpleGraph.Iso.boxProdSumDistrib_apply E0 #

∀ {V : Type u_4} {W₁ : Type u_8} {W₂ : Type u_9} (G : SimpleGraph V) (H₁ : SimpleGraph W₁) (H₂ : SimpleGraph W₂)
  (a : V × (W₁ ⊕ W₂)),
  (SimpleGraph.Iso.boxProdSumDistrib G H₁ H₂) a = Sum.map Prod.swap Prod.swap ((Equiv.sumProdDistrib W₁ W₂ V) a.swap)

theorem SimpleGraph.Iso.boxProdSumDistrib_toEquiv E0 #

∀ {V : Type u_4} {W₁ : Type u_8} {W₂ : Type u_9} (G : SimpleGraph V) (H₁ : SimpleGraph W₁) (H₂ : SimpleGraph W₂),
  (SimpleGraph.Iso.boxProdSumDistrib G H₁ H₂).toEquiv = Equiv.prodSumDistrib V W₁ W₂

def SimpleGraph.Iso.sumBoxProdDistrib E1 #

{V₁ : Type u_5} →
  {V₂ : Type u_6} →
    {W : Type u_7} →
      (G₁ : SimpleGraph V₁) → (G₂ : SimpleGraph V₂) → (H : SimpleGraph W) → (G₁ ⊕g G₂) □ H ≃g G₁ □ H ⊕g G₂ □ H

The box product distributes over the disjoint sum of graphs.

theorem SimpleGraph.Iso.sumBoxProdDistrib_apply E0 #

∀ {V₁ : Type u_5} {V₂ : Type u_6} {W : Type u_7} (G₁ : SimpleGraph V₁) (G₂ : SimpleGraph V₂) (H : SimpleGraph W)
  (p : (V₁ ⊕ V₂) × W), (SimpleGraph.Iso.sumBoxProdDistrib G₁ G₂ H) p = Sum.map (fun x ↦ (x, p.2)) (fun x ↦ (x, p.2)) p.1

theorem SimpleGraph.Iso.sumBoxProdDistrib_symm_apply E0 #

∀ {V₁ : Type u_5} {V₂ : Type u_6} {W : Type u_7} (G₁ : SimpleGraph V₁) (G₂ : SimpleGraph V₂) (H : SimpleGraph W)
  (s : V₁ × W ⊕ V₂ × W),
  (RelIso.symm (SimpleGraph.Iso.sumBoxProdDistrib G₁ G₂ H)) s = Sum.elim (Prod.map Sum.inl id) (Prod.map Sum.inr id) s

theorem SimpleGraph.Iso.sumBoxProdDistrib_toEquiv E0 #

∀ {V₁ : Type u_5} {V₂ : Type u_6} {W : Type u_7} (G₁ : SimpleGraph V₁) (G₂ : SimpleGraph V₂) (H : SimpleGraph W),
  (SimpleGraph.Iso.sumBoxProdDistrib G₁ G₂ H).toEquiv = Equiv.sumProdDistrib V₁ V₂ W

def SimpleGraph.Walk.boxProdLeft E1 #

{α : Type u_1} →
  {β : Type u_2} →
    {G : SimpleGraph α} → (H : SimpleGraph β) → {a₁ a₂ : α} → (b : β) → G.Walk a₁ a₂ → (G □ H).Walk (a₁, b) (a₂, b)

Turn a walk on G into a walk on G □ H.

def SimpleGraph.Walk.boxProdRight E1 #

{α : Type u_1} →
  {β : Type u_2} →
    (G : SimpleGraph α) → {H : SimpleGraph β} → {b₁ b₂ : β} → (a : α) → H.Walk b₁ b₂ → (G □ H).Walk (a, b₁) (a, b₂)

Turn a walk on H into a walk on G □ H.

def SimpleGraph.Walk.ofBoxProdLeft E1 #

{α : Type u_1} →
  {β : Type u_2} →
    {G : SimpleGraph α} →
      {H : SimpleGraph β} → [DecidableEq β] → [DecidableRel G.Adj] → {x y : α × β} → (G □ H).Walk x y → G.Walk x.1 y.1

Project a walk on G □ H to a walk on G by discarding the moves in the direction of H.

def SimpleGraph.Walk.ofBoxProdRight E1 #

{α : Type u_1} →
  {β : Type u_2} →
    {G : SimpleGraph α} →
      {H : SimpleGraph β} → [DecidableEq α] → [DecidableRel H.Adj] → {x y : α × β} → (G □ H).Walk x y → H.Walk x.2 y.2

Project a walk on G □ H to a walk on H by discarding the moves in the direction of G.

theorem SimpleGraph.Walk.ofBoxProdLeft_boxProdLeft E0 #

∀ {α : Type u_1} {β : Type u_2} {G : SimpleGraph α} {H : SimpleGraph β} [inst : DecidableEq β]
  [inst_1 : DecidableRel G.Adj] {a₁ a₂ : α} {b : β} (w : G.Walk a₁ a₂),
  (SimpleGraph.Walk.boxProdLeft H b w).ofBoxProdLeft = w

theorem SimpleGraph.Walk.ofBoxProdRight_boxProdRight E0 #

∀ {α : Type u_1} {G : SimpleGraph α} [inst : DecidableEq α] [inst_1 : DecidableRel G.Adj] {a b₁ b₂ : α}
  (w : G.Walk b₁ b₂), (SimpleGraph.Walk.boxProdRight G a w).ofBoxProdRight = w

theorem SimpleGraph.Walk.length_boxProd E1 #

∀ {α : Type u_1} {β : Type u_2} {G : SimpleGraph α} {H : SimpleGraph β} {a₁ a₂ : α} {b₁ b₂ : β} [inst : DecidableEq α]
  [inst_1 : DecidableEq β] [inst_2 : DecidableRel G.Adj] [inst_3 : DecidableRel H.Adj]
  (w : (G □ H).Walk (a₁, b₁) (a₂, b₂)), w.length = w.ofBoxProdLeft.length + w.ofBoxProdRight.length

theorem SimpleGraph.Preconnected.boxProd E1 #

∀ {α : Type u_1} {β : Type u_2} {G : SimpleGraph α} {H : SimpleGraph β},
  G.Preconnected → H.Preconnected → (G □ H).Preconnected

theorem SimpleGraph.Preconnected.ofBoxProdLeft E1 #

∀ {α : Type u_1} {β : Type u_2} {G : SimpleGraph α} {H : SimpleGraph β} [Nonempty β],
  (G □ H).Preconnected → G.Preconnected

theorem SimpleGraph.Preconnected.ofBoxProdRight E1 #

∀ {α : Type u_1} {β : Type u_2} {G : SimpleGraph α} {H : SimpleGraph β} [Nonempty α],
  (G □ H).Preconnected → H.Preconnected

theorem SimpleGraph.Connected.boxProd E1 #

∀ {α : Type u_1} {β : Type u_2} {G : SimpleGraph α} {H : SimpleGraph β}, G.Connected → H.Connected → (G □ H).Connected

theorem SimpleGraph.Connected.ofBoxProdLeft E1 #

∀ {α : Type u_1} {β : Type u_2} {G : SimpleGraph α} {H : SimpleGraph β}, (G □ H).Connected → G.Connected

theorem SimpleGraph.Connected.ofBoxProdRight E1 #

∀ {α : Type u_1} {β : Type u_2} {G : SimpleGraph α} {H : SimpleGraph β}, (G □ H).Connected → H.Connected

theorem SimpleGraph.connected_boxProd E0 #

∀ {α : Type u_1} {β : Type u_2} {G : SimpleGraph α} {H : SimpleGraph β}, (G □ H).Connected ↔ G.Connected ∧ H.Connected

instance SimpleGraph.boxProdFintypeNeighborSet E0 #

{α : Type u_1} →
  {β : Type u_2} →
    {G : SimpleGraph α} →
      {H : SimpleGraph β} →
        (x : α × β) → [Fintype ↑(G.neighborSet x.1)] → [Fintype ↑(H.neighborSet x.2)] → Fintype ↑((G □ H).neighborSet x)

theorem SimpleGraph.neighborFinset_boxProd E1 #

∀ {α : Type u_1} {β : Type u_2} {G : SimpleGraph α} {H : SimpleGraph β} (x : α × β)
  [inst : Fintype ↑(G.neighborSet x.1)] [inst_1 : Fintype ↑(H.neighborSet x.2)]
  [inst_2 : Fintype ↑((G □ H).neighborSet x)],
  (G □ H).neighborFinset x = (G.neighborFinset x.1 ×ˢ {x.2}).disjUnion ({x.1} ×ˢ H.neighborFinset x.2) ⋯

theorem SimpleGraph.degree_boxProd E1 #

∀ {α : Type u_1} {β : Type u_2} {G : SimpleGraph α} {H : SimpleGraph β} (x : α × β)
  [inst : Fintype ↑(G.neighborSet x.1)] [inst_1 : Fintype ↑(H.neighborSet x.2)]
  [inst_2 : Fintype ↑((G □ H).neighborSet x)], (G □ H).degree x = G.degree x.1 + H.degree x.2

theorem SimpleGraph.reachable_boxProd E1 #

∀ {α : Type u_1} {β : Type u_2} {G : SimpleGraph α} {H : SimpleGraph β} {x y : α × β},
  (G □ H).Reachable x y ↔ G.Reachable x.1 y.1 ∧ H.Reachable x.2 y.2

theorem SimpleGraph.edist_boxProd E0 #

∀ {α : Type u_1} {β : Type u_2} {G : SimpleGraph α} {H : SimpleGraph β} (x y : α × β),
  (G □ H).edist x y = G.edist x.1 y.1 + H.edist x.2 y.2