Products of graphs
Lax871432.GraphProducts · concepts/Lax871432/GraphProducts.lean · lax-871432
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
Two products of simple graphs, both on the product of the vertex sets.
In the categorical product , the pairs and are adjacent when and . It is the product in the category of graphs and graph homomorphisms, whence ; it also goes by tensor, Kronecker, weak or conjunction product.
In the lexicographic product , the pairs and are adjacent when , or else and .
Concept map
In the paper
- page 3 of this submission's paper
Lean source view on GitHub
| 1 | import Mathlib.Combinatorics.SimpleGraph.Prod |
| 2 | |
| 3 | /-! |
| 4 | --- |
| 5 | title: Products of graphs |
| 6 | type: definition |
| 7 | --- |
| 8 | Two products of simple graphs, both on the product of the vertex sets. |
| 9 | |
| 10 | In the *categorical product* , the pairs and are adjacent when |
| 11 | **and** . It is the product in the category of graphs and graph |
| 12 | homomorphisms, whence ; it also goes by tensor, |
| 13 | Kronecker, weak or conjunction product. |
| 14 | |
| 15 | In the *lexicographic product* , the pairs and are adjacent when |
| 16 | , or else and . |
| 17 | -/ |
| 18 | |
| 19 | namespace Lax871432.GraphProducts |
| 20 | |
| 21 | variable {α β : Type*} |
| 22 | |
| 23 | /-- The *categorical product* of simple graphs: it relates `(a₁, b₁)` and `(a₂, b₂)` when `G` |
| 24 | relates `a₁` and `a₂` and `H` relates `b₁` and `b₂`. Contrast with `SimpleGraph.boxProd`. -/ |
| 25 | def catProd (G : SimpleGraph α) (H : SimpleGraph β) : SimpleGraph (α × β) where |
| 26 | Adj x y := G.Adj x.1 y.1 ∧ H.Adj x.2 y.2 |
| 27 | symm := ⟨fun _ _ h => ⟨h.1.symm, h.2.symm⟩⟩ |
| 28 | loopless := ⟨fun _ h => G.irrefl h.1⟩ |
| 29 | |
| 30 | @[inherit_doc] |
| 31 | scoped infixl:70 " ×g " => catProd |
| 32 | |
| 33 | /-- The *lexicographic product* of simple graphs: it relates `(a₁, b₁)` and `(a₂, b₂)` when `G` |
| 34 | relates `a₁` and `a₂`, or when `a₁ = a₂` and `H` relates `b₁` and `b₂`. -/ |
| 35 | def lexProd (G : SimpleGraph α) (H : SimpleGraph β) : SimpleGraph (α × β) where |
| 36 | Adj x y := G.Adj x.1 y.1 ∨ (x.1 = y.1 ∧ H.Adj x.2 y.2) |
| 37 | symm := ⟨fun _ _ h => h.imp SimpleGraph.Adj.symm fun h' => ⟨h'.1.symm, h'.2.symm⟩⟩ |
| 38 | loopless := ⟨fun _ h => h.elim (G.irrefl ·) fun h' => H.irrefl h'.2⟩ |
| 39 | |
| 40 | end Lax871432.GraphProducts |
| 41 |
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments