-
Notifications
You must be signed in to change notification settings - Fork 63
/
embeddings-undirected-graphs.lagda.md
135 lines (105 loc) · 4.63 KB
/
embeddings-undirected-graphs.lagda.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# Embeddings of undirected graphs
```agda
module graph-theory.embeddings-undirected-graphs where
```
<details><summary>Imports</summary>
```agda
open import foundation.dependent-pair-types
open import foundation.embeddings
open import foundation.propositions
open import foundation.universe-levels
open import graph-theory.morphisms-undirected-graphs
open import graph-theory.undirected-graphs
```
</details>
## Idea
An **embedding of undirected graphs** is a
[morphism](graph-theory.morphisms-undirected-graphs.md) `f : G → H` of
[undirected graphs](graph-theory.undirected-graphs.md) which is an
[embedding](foundation.embeddings.md) on vertices such that for each
[unordered pair](foundation.unordered-pairs.md) `p` of vertices in `G` the map
```text
edge-hom-Undirected-Graph G H :
edge-Undirected-Graph G p →
edge-Undirected-Graph H (unordered-pair-vertices-hom-Undirected-Graph G H f)
```
is also an embedding. Embeddings of undirected graphs correspond to undirected
subgraphs.
**Note:** Our notion of embeddings of directed graphs differs quite
substantially from the graph theoretic notion of _graph embedding_, which
usually refers to an embedding of a graph into the plane.
## Definition
```agda
module _
{l1 l2 l3 l4 : Level}
(G : Undirected-Graph l1 l2) (H : Undirected-Graph l3 l4)
where
is-emb-hom-undirected-graph-Prop :
hom-Undirected-Graph G H → Prop (lsuc lzero ⊔ l1 ⊔ l2 ⊔ l3 ⊔ l4)
is-emb-hom-undirected-graph-Prop f =
prod-Prop
( is-emb-Prop (vertex-hom-Undirected-Graph G H f))
( Π-Prop
( unordered-pair-vertices-Undirected-Graph G)
( λ p →
is-emb-Prop (edge-hom-Undirected-Graph G H f p)))
is-emb-hom-Undirected-Graph :
hom-Undirected-Graph G H → UU (lsuc lzero ⊔ l1 ⊔ l2 ⊔ l3 ⊔ l4)
is-emb-hom-Undirected-Graph f = type-Prop (is-emb-hom-undirected-graph-Prop f)
is-prop-is-emb-hom-Undirected-Graph :
(f : hom-Undirected-Graph G H) → is-prop (is-emb-hom-Undirected-Graph f)
is-prop-is-emb-hom-Undirected-Graph f =
is-prop-type-Prop (is-emb-hom-undirected-graph-Prop f)
emb-Undirected-Graph : UU (lsuc lzero ⊔ l1 ⊔ l2 ⊔ l3 ⊔ l4)
emb-Undirected-Graph =
Σ (hom-Undirected-Graph G H) is-emb-hom-Undirected-Graph
module _
{l1 l2 l3 l4 : Level}
(G : Undirected-Graph l1 l2) (H : Undirected-Graph l3 l4)
(f : emb-Undirected-Graph G H)
where
hom-emb-Undirected-Graph : hom-Undirected-Graph G H
hom-emb-Undirected-Graph = pr1 f
is-emb-emb-Undirected-Graph :
is-emb-hom-Undirected-Graph G H hom-emb-Undirected-Graph
is-emb-emb-Undirected-Graph = pr2 f
vertex-emb-Undirected-Graph :
vertex-Undirected-Graph G → vertex-Undirected-Graph H
vertex-emb-Undirected-Graph =
vertex-hom-Undirected-Graph G H hom-emb-Undirected-Graph
is-emb-vertex-emb-Undirected-Graph :
is-emb vertex-emb-Undirected-Graph
is-emb-vertex-emb-Undirected-Graph = pr1 is-emb-emb-Undirected-Graph
emb-vertex-emb-Undirected-Graph :
vertex-Undirected-Graph G ↪ vertex-Undirected-Graph H
pr1 emb-vertex-emb-Undirected-Graph = vertex-emb-Undirected-Graph
pr2 emb-vertex-emb-Undirected-Graph = is-emb-vertex-emb-Undirected-Graph
unordered-pair-vertices-emb-Undirected-Graph :
unordered-pair-vertices-Undirected-Graph G →
unordered-pair-vertices-Undirected-Graph H
unordered-pair-vertices-emb-Undirected-Graph =
unordered-pair-vertices-hom-Undirected-Graph G H hom-emb-Undirected-Graph
edge-emb-Undirected-Graph :
(p : unordered-pair-vertices-Undirected-Graph G) →
edge-Undirected-Graph G p →
edge-Undirected-Graph H (unordered-pair-vertices-emb-Undirected-Graph p)
edge-emb-Undirected-Graph =
edge-hom-Undirected-Graph G H hom-emb-Undirected-Graph
is-emb-edge-emb-Undirected-Graph :
(p : unordered-pair-vertices-Undirected-Graph G) →
is-emb (edge-emb-Undirected-Graph p)
is-emb-edge-emb-Undirected-Graph = pr2 is-emb-emb-Undirected-Graph
emb-edge-emb-Undirected-Graph :
(p : unordered-pair-vertices-Undirected-Graph G) →
edge-Undirected-Graph G p ↪
edge-Undirected-Graph H (unordered-pair-vertices-emb-Undirected-Graph p)
pr1 (emb-edge-emb-Undirected-Graph p) = edge-emb-Undirected-Graph p
pr2 (emb-edge-emb-Undirected-Graph p) = is-emb-edge-emb-Undirected-Graph p
```
## See also
- [Faithful morphisms of undirected graphs](graph-theory.faithful-morphisms-undirected-graphs.md)
- [Totally faithful morphisms of undirected graphs](graph-theory.totally-faithful-morphisms-undirected-graphs.md)
## External links
- [Graph homomorphism](https://www.wikidata.org/wiki/Q3385162) on Wikidata
- [Graph homomorphism](https://en.wikipedia.org/wiki/Graph_homomorphism) on
Wikipedia