ArticlePDF Available

On planarity of graphs in homotopy type theory

Authors:

Abstract and Figures

In this paper, we present a constructive and proof-relevant development of graph theory, including the notion of maps, their faces and maps of graphs embedded in the sphere, in homotopy type theory (HoTT). This allows us to provide an elementary characterisation of planarity for locally directed finite and connected multigraphs that takes inspiration from topological graph theory, particularly from combinatorial embeddings of graphs into surfaces. A graph is planar if it has a map and an outer face with which any walk in the embedded graph is walk-homotopic to another. A result is that this type of planar maps forms a homotopy set for a graph. As a way to construct examples of planar graphs inductively, extensions of planar maps are introduced. We formalise the essential parts of this work in the proof assistant Agda with support for HoTT.
Content may be subject to copyright.
Mathematical Structures in Computer Science (2024), 1–41
doi:10.1017/S0960129524000100
PAPER
On planarity of graphs in homotopy type theory
Jonathan Prieto-Cubides and Håkon Robbestad Gylterud
Department of Informatics, University of Bergen, Bergen, Norway
Corresponding author: Jonathan Prieto-Cubides; Email: jonathan.cubides@uib.no
(Received 10 April 2022; revised 12 December 2023; accepted 21 March 2024)
Abstract
In this paper, we present a constructive and proof-relevant development of graph theory, including the
notion of maps, their faces and maps of graphs embedded in the sphere, in homotopy type theory (HoTT).
This allows us to provide an elementary characterisation of planarity for locally directed finite and con-
nected multigraphs that takes inspiration from topological graph theory, particularly from combinatorial
embeddings of graphs into surfaces. A graph is planar if it has a map and an outer face with which any
walk in the embedded graph is walk-homotopic to another. A result is that this type of planar maps forms
a homotopy set for a graph. As a way to construct examples of planar graphs inductively, extensions of
planar maps are introduced. We formalise the essential parts of this work in the proof assistant Agda with
support for HoTT.
Keywords: Planarity; combinatorial maps; univalent mathematics; formalisation of mathematics
1. Introduction
Topological graph theory investigates the embedding of graphs into diverse surfaces such as the
plane, sphere and torus (Archdeacon 1996; Gross and Tucker 1987;Stahl1978). The simplest case,
graph map into the plane, has generated numerous intriguing characterisations and mathemati-
cal results. Kuratowski’s theorem and Wagner’s theorem (Diestel 2012;Rahman2017) are two
such characterisations, both defining planarity by excluding two forbidden minors, K5and K3,3.
Alternative approaches include algebraic methods like MacLane’s theorem (MacLane 1937)and
Schnyder’s theorem (Baur 2012, Section 3.3).
One of the most powerful tools in topological graph theory is the combinatorial representation
of graph embeddings, called graph maps, also known as rotation systems (Gross and Tucker 1987).
These representations encode what the embedding looks like around each node, characterising
the embedding up to isotopy. It is known that for a suitable general class of embeddings into
closed surfaces namely, the cellular ones the embedding is characterised by the cyclic order of
outgoing edges from each node as they lie around the node on the surface.
In this paper, we present a constructive and proof-relevant definition of these combinato-
rial representations of graph embeddings in homotopy type theory (HoTT for short) (Univalent
Foundations Program 2013). HoTT is a variation of dependent-type theory which emphasises the
higher-dimensional structure of types. In HoTT, equalities within a type are seen as paths, and
the type of all equalities between two elements the identity type is thought of as a path space.
In this way, HoTT takes seriously the notion of proof-relevancy, and interesting questions arise
when considering what the equality between two proofs is.
© The Author(s), 2024. Published by Cambridge University Press. This is an Open Access article, distributed under the terms of the
Creative Commons Attribution licence (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution and
reproduction, provided the original article is properly cited.
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
2 J. Prieto-Cubides and H.R. Gylterud
)III()II()I(
1
23
451
23
45
1
23
45
Figure 1. Different visual representations for the same graph map of the house graph given in Example 1.1. Note how the
cyclic order of edges around each node is preserved consistently across all representations. The first two representations
correspond to drawings the result of planar maps for the house graph, while the last representation does not, as it features
an edge crossing, so it is not an embedding.
In this context, we present planarity as a structure imposed on a graph, rather than a simple
property of it as is the case in classical graph theory. The intuitive explanation is that a proof of
a graphs planarity is its embedding into the plane.
The question is then, when are two such embeddings considered equal? A plausible response
is that the proofs should be regarded as equal when the embeddings are isotopic, meaning they
can be continuously deformed into one another without edge crossing. This will hold true for the
concept proposed in this paper. However, to reach a type of graph maps where the identity type
corresponds to isotopy, a lot of care must be taken with respect to the definition of embeddings
and planarity.
In short, a planar graph will be defined as a graph with a combinatorial embedding into the
sphere, along with a designated face for puncturing. The intuition is that an embedding into the
plane can be obtained from an embedding into the sphere by puncturing the sphere at a point sym-
bolising infinity (in any direction) on the plane. Up to isotopy, the important data when choosing
a point puncture is which face the points lies in.
In contrast to previous works in planarity of graphs and related formal verification, our devel-
opment adopts Voevodsky’s Univalence Axiom (UA) from HoTT. As a result, isomorphic graphs
are equal and share the same structures and properties. This correspondence is crucial for formal-
ising mathematics, as it allows us to understand a graph’s symmetry through its identity type, as
in standard mathematical practice. Any automorphism of a graph gives rise to an inhabitant of its
identity type and vice versa. By studying its identity type, we can describe the group structure of
the set of automorphisms for a graph.
To conclude, let us consider a familiar example to gain a clearer understanding of the concepts
presented in this paper.
Example 1.1. Consider the house graph G depicted in Fig. 1. This graph consists of five nodes and
six edges: (1, 2),(1, 3),(2, 3),(2, 4),(3, 5),and(4, 5).
As previously hinted, a graph map assigns to each node a counterclockwise cycle of its adjacent
nodes. Consider mas a graph map for our house graph induced from Fig. 1(I). At node 2,thegraph
map results in the sequence [1,4,3]. This sequence not only lists the adjacent nodes but also specifies
a counterclockwise order among the connecting edges. Thus, edge (2, 1) is followed by (2, 4) and then
by (2, 3) in this established order, see Fig. 2.
On the planarity of the house graph, we notice that it has six planar drawings split into two
sets based on (I) and (II) in Fig. 1, respectively. With the graph map m, there are three options for
the outer face, as illustrated in Fig. 3. The absence of edge crossings and the existence of a graph
map with an outer face confirm the graph’s planarity, at least for now. To be able to prove this
kindofclaiminthecontextofthispaper,wemustdevelopourplanaritycriteria,asdetailedin
Section 6.
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
Mathematical Structures in Computer Science 3
(a)
(b)
Figure 2. Graph map mfor the house graph Gdepicted in Fig. 1(I).
Figure 3. The house graph Gand its planar maps. The three distinct planar drawings (G,m,fi)formare presented. Each
drawing corresponds to an individually selected outer face: f1,f2and f3. These faces, enclosed by a pentagon, triangle and
rectangle, respectively, are differentiated by distinct shading. The unbounded region of the plane, represented as a splashed
area, denotes the outer face in each planar drawing.
1.1 Outline
The paper is structured as follows: Section 2 introduces the basic terminology and notation. Next,
the category of graphs, along with pertinent examples, is described in Section 3.InSection 4,we
present different types for graph-theoretic concepts, which allows us to define planar maps and,
consequently, planar graphs in HoTT. The construction of larger planar graphs, including the
proof of planarity for cyclic graphs and graph extensions, is detailed in Section 6. Connections
between this work and other developments are explored in Section 7. Finally, Section 8 concludes
the paper with a discussion on future work and some concluding remarks.
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
4 J. Prieto-Cubides and H.R. Gylterud
1.2 Formalisation
Working with systems like HoTT brings the opportunity to produce machine-verified proofs
(Harrison 2008). We employ Agda, a proof assistant rooted in Martin-Löf type theory (The Agda
Development Team 2023), for verification of the fundamental constructions in this paper. Agda,
a robust dependently typed programming language, facilitates working at an abstraction-level
equivalent to our paper-based mathematical reasoning. This rigorous approach instills confidence
and enables us to formalise mathematical concepts and proofs.
Machine-verified proofs not only provide insights into new proofs and theorems (Avigad and
Harrison 2014) but also help identify overlooked flaws and corner cases. Therefore, special atten-
tion must be given to definitions and theorems, being the primary input for these systems. The
process of formalising on a computer is both exciting and challenging, replete with intricate details
and technical issues (Appel and Haken 1986; Gonthier 2008).
We use Agda v2.6.2.2-442c76b for type-checking the formalisation (Prieto-Cubides 2022a)of
this paper’s essential parts. The flags without-K (Cockx et al. 2016)andexact-split are used
to ensure compatibility with HoTT and to guarantee that all clauses in a definition are definitional
equalities, respectively.
2. Mathematical Foundation
In this paper, we work with HoTT, a Martin-Löf intensional type theory extended with the
UA (Awo d e y 2018; Voevodsky 2010), and some higher inductive types (HITs), such as proposi-
tional truncation (Escardó 2018; Univalent Foundations Program 2013). The presentation of our
constructions is informal, in a similar style as in the HoTT book (Univalent Foundations Program
2013).
HoTT emphasises the role of the identity type as a path type. The intended interpretation is
that elements, a,a:A,arepoints and that a witness of an equality p:a=ais a path from ato a
in A. Since the identity type is again a type, we can iterate the process, which gives each type the
structure of an -groupoid (Awodey 2012).
This may at first seem of little relevance when working with finite combinatorics, as one would
expect only types with trivial path types (sets) to show up in combinatorics. However, we will see
that types with non-trivial path types do arise naturally in combinatorics which should come as
no surprise to anyone familiar with the role of groups and groupoids in this field, such as Joyal’s
work on combinatorial species (Baez et al. 2009 08; Yorgey 2014) and that the paths in these
types are often various forms of permutations.
2.1 Notation
An informal type theoretical notation derived from the HoTT book (Univalent Foundations
Program 2013) and the formal system Agda (Norrell 2007) is used throughout this paper. The
following list summarises the most important conventions and notations used in this paper.
Definitions are introduced by (:≡), while judgemental equalities use ().
The type
U
is a univalent universe.
The notation A:
U
indicates that Ais a type. A term aof type Ais denoted by a:Aand Ais
referred to as a type inhabited.
The equality sign of the identity type of Ais denoted by (=A). The constructor of the identity
type x=Axis denoted by relf(x)forx:A.IfthetypeAcan be inferred from the context, we
simply write (=). The equalities between x,y:Aare of type x=y.
The type of non-dependent functions between Aand Bis denoted by AB.
Type equivalences are denoted by (). The canonical map for types is the function idtoequiv
of type A=BABand its inverse function is called ua. Given the equivalence e:AB,
the application, ua(e) is denoted by e, while the underlying function of the equivalence eof
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
Mathematical Structures in Computer Science 5
type ABcan be also denoted by e. Moreover, the coercion along a path p:A=Bis the
function denoted by coe(p)oftypeAB.
The point-wise equality for functions (also known as homotopy) is denoted by (). The
function happly is of type f=gfgand its inverse function is called funext.
The coproduct of two types Aand Bis denoted by A+B. The corresponding data
constructors are the functions inl :AA+Band inr :BA+B.
Dependent product types (-types) are denoted by x:AB(x)foratypeAand a type family
B:A
U
, while dependent sum types (-types) are denoted by x:AB(x). If x:Aand y:
B(x), then the pair (x,y)isoftypex:AB(x). The corresponding projection functions for a
pair are denoted by π1and π2so that π1(x,y):≡ xand π2(x,y):≡ y. If the type family Bover
Ais constant, then we may denote the type x:AB(x)byA×B,andthex:AB(x)byAB.
The empty type and the unit type are denoted by 0and 1, respectively.
The type x= ydenotes the function type (x=y)0.
Natural numbers are of type N.0:N. The successor of n:Nis denoted by S(n)orn+1. The
variable nis of type N, unless stated otherwise.
Given n:N, the standard type with nelements is denoted by n.
The universe
U
is closed under the type formers considered above.
The function transport/substitution is denoted by tr of type u:x=xB(x)B(x),
where x,x:Aand B:A
U
. Furthermore, we denote by tr2the function of type
p:a1=a2trB(p,b1)=b2C(a1,b1)C(a2,b2), where the type family Bis indexed by the
type A,a1,a2:A,b1:B(a1), b2:B(a2), and the type Cis of type x:A(B(x)
U
).
In the next sections, we will use variables A,Band Xto denote types, unless stated otherwise.
To define some inductive types, we adopt a similar notation as in Agda, including the keyword
data and the curly braces for implicit arguments, for example, {a:A}denotes ais of type A,and
it is an implicit variable. The type may be omitted in the former notation, as they can usually be
inferred from the context.
2.2 Homotopy levels
The following establishes a level hierarchy for types with respect to the non-trivial homotopy
structure of the identity type.
Definition 2.1. Let n be an integer such that n ≥−2. One states that a type A is an n-type and that
it has homotopy level n if the type is-level(n,A)is inhabited:
is-level(2, A):≡
(c:A)
(x:A)
(c=x),
is-level(n+1, A):≡
(x,y:A)
is-level(n,x=y).
For this document, the first four homotopy levels are enough to express the mathematical
objects we want to construct. They are referred to in order, starting from 2, as contractible types,
propositions, sets and groupoids. For convenience, we use the following predicates:
isContr(A):≡ is-level(2, A),
isProp(A):≡ is-level(1, A),
isSet(A):≡ is-level(0, A), and
isGroupoid(A):≡ is-level(1, A).
Types that are propositions are of type hProp and similarly with the other levels. If Ais an
inhabited proposition, then we say that Aholds. Additionally, it is possible to have an n-type
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
6 J. Prieto-Cubides and H.R. Gylterud
out of any type Afor n≥−2. This can be done using the construction of a HIT called n-
truncation (Univalent Foundations Program 2013, Section 7.3) denoted by An. The case for
(1)-truncation is called propositional truncation (or reflection) and is often simply denoted by
A.
Definition 2.2. Propositional truncation of a type A denoted by A1is the universal solution
to the problem of mapping A to a proposition P. The elimination principle of this construction gives
rise to a map of type A→P, which requires a map f :AP and a proof that P is a proposition.
Propositional truncation allows us to model the mere existence of inhabitants of type A.We
state that xis merely equal to ywhen x=yfor x,y:A.IfAis inhabited, then we say that type
Ais non-empty.
Definition 2.3. Given x :A, the connected component of x in A is the type y:Ay=x.
Definition 2.4. The type A is called connected if Aholds and each x :A belongs to the same
connected component.
Theorem 2.5. Let P :AhProp and x,y:A. If y=x,thenP(x)P(y). Thus, terms in the same
connected component share the same propositional properties.
Proof. The proof is established by constructing a term of type x=y→f:P(x)P(y)isEquiv(f).
The type isEquiv(g) is the proposition that fis an equivalence; see the HoTT book (Univalent
Foundations Program 2013, Section 4). We apply the elimination principle of propositional trun-
cation to obtain this map, given that its codomain is a proposition, as it is a -type of propositions.
Further, we apply path induction over a path of type x=y, setting a new goal to find an equivalence
of type P(x)P(x), which is the trivial provided by the identity function.
2.3 Finite types
In the following, we make precise the intuition that a type is finite when it is equivalent to n
for some n:N.Thetypenis the standard type with nelements, which can be defined as the
following -type:
n:≡
(m:N)
m<n,(1)
where the binary relation (<) can be defined by cases, that is, 0 <m+1forallmand for all nif
m<nthen m+1<n+1.
Definition 2.6. AtypeXisfinite if the type isFinite(X)in (2)is inhabited:
isFinite(X):≡
(n:N)
Xn
.(2)
The finiteness of a type Ais the existence of a bijection between Aand the type nfor some n:
N. However, this description is not a structure on A, which provides it with a specific equivalence
An, but rather a property, a mere proposition. This ensures that the identity type on the total
type of finite types is free to permute the elements, without having to respect a chosen equivalence.
Theorem 2.7. The type isFinite(X)is a proposition.
Proof. Let (n,p), (m,q):isFinite(X), which we want to prove equal. Since pand qare elements of
a family of propositions, it is sufficient to show that n=m. This equation is a proposition, so we
can apply the truncation-elimination principle to get Xnand Xm. Thus, from nm
follows that n=mby a well-known result on finite sets.
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
Mathematical Structures in Computer Science 7
The natural number nin (2) is referred to as the cardinal number of X, which is also denoted
by #X.IfXand Yare finite and the identity type X=Yis inhabited, then both types have the same
cardinal number and Yis a permutation of X. Furthermore, Definition 2.6 is equivalent to the type
n:N(X=n). However, the former definition makes it easier to obtain the cardinal number nby
projecting on the first coordinate. This is more practical for certain proofs, such as Theorem 2.15.
Additionally, any property of n, like ‘being a set’ and ‘being discrete’ can be transferred to any
finite type.
Theorem 2.8 (Hedberg’s theorem). Any type A with decidable equality, that is, x =y+x= yfor
all x,y:A, is a set. Types like A are below referred to as discrete sets.
Theorem 2.9. Finite sets are closed under (co) products, type equivalences, -types, -types and
propositional truncation.
2.4 Cyclic types
We want to define a notion of cyclic type to capture the idea of a finite type together with a per-
mutation within orbiting freely over the whole type. To do so, we use the pred function which
generates a cyclic subgroup (of order n) of the group of permutations on n. An equivalent cyclic
subgroup can be defined by means of the suc function, where the function suc is the inverse of
pred.
Definition 2.10. Let pred be a function from n+1to itself defined by induction on n and the
following equations. If n =0,thenpred is the trivial function. If n >0,then,
pred :n+1n+1.
pred((0, !)) :≡ (n,p).
pred((m+1, q)) :≡ (m,r).
Where p is a proof that n <n+1and r is a proof that m <n+1using q, which is a proof that
m+1<n+1.
Definition 2.11. Cyclic(A)defines the type of cyclic structures on type A:
Cyclic(A):≡
(ϕ:AA)
(n:N)
(e:An)
(eϕ=pred e)
.(3)
Notice that the type Cyclic(A) mirrors the structure of ngiven by pred for any finite type A
along with an endomap ϕ:AA.Thisisreectedin(3) by establishing a structure-preserving
map between (A,ϕ)and(
n,pred). Therefore, a type Awith cyclic structure is a triple such as
A,f,nwhere (f,n,-):Cyclic(A). Given such a triple, we refer to Aas an n-cyclic and fas the
corresponding cyclic function. As a notation, if p:Cyclic(A)andx:A,thenp(x)istheimageofx
under the cyclic function f.
Theorem 2.12. Let P be a family of propositions of type X:
U
(XX)hProp and an n-cyclic
structure A,f,n.IfP(n,pred),thenP(A,f).
Proof. It follows from Theorem 2.5. Note that being cyclic for a type is equivalent to saying (A,f)
and (n,pred) are connected in X:
U
(XX).
Theorem 2.13. Let P be a family of propositions of type
U
hProp and an n-cyclic structure
A,f,n.IfP(n),thenP(A).
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
8 J. Prieto-Cubides and H.R. Gylterud
By Theorems 2.12 and 2.13, one could prove that any n-cyclic type A,f,nis a finite set and
that the function fis a bijection. For convenience, we denote fby pred and its inverse by suc.
To define the functions pred and suc for a cyclic structure A,f,n, we borrow the notation
from group theory, expressing permutations as products of cycles. For example, a permutation
in 3can be defined as the product of two cycles: pred :≡ (0)(12), meaning that 0 is fixed and the
elements 1 and 2 are swapped.
Theorem 2.14. Let A be a type. If Cyclic(A)is inhabited, then A is a finite set.
Proof. Let Abe an n-cyclic type. The conclusion follows immediately from Theorem 2.13 and the
fact that the standard finite type nis a finite set.
In any finite type, every element is searchable. In particular, given an n-cyclic type A,f,n, one
can search any element by iterating the function fon any other element at most ntimes.
Theorem 2.15. If A is an n-cyclic type, then for every a and b in A, there exists a unique number k
with k <nsuchthatpredk
A(a)=b.
The total type, A:
U
Cyclic(A), is the classifying type of finite cyclic groups (Bezem et al. 2022,
Section 4.6-7). Let us now compute the identity type between two finite cyclic types that we use,
for example, in Example 5.12 to enumerate the maps of the bouquet graph B2.
Theorem 2.16. Given two cyclic types,
A
and
B
,denedbyA,f,nand B,g,m, respectively,
the identity type between them is given by the following equivalence:
(
A
=
B
)(α:A=B)(coe (α)f=gcoe (α)).
AB
AB
f
coe(α)
g
coe(α)
Proof. We show the equivalence via calculation (4). In (4b), we unfold the cycle-type definitions
for
A
and
B
. The numbers nand mare the cardinalities of the types Aand B, respectively, and p
and qare propositions of the truncation appearing in the type in (3). The type in the equivalence
in (4c) follows from the characterisation of the identity type between pairs in a -type (Univalent
Foundations Program 2013, Section 3.7). In (4c), we have the product of two propositions, the
identity types, n=mand p=q. These two types are, in fact, contractible, therefore, equivalent to
the one-point type. The numbers nand mare equal because Aand Bare finite and equal by α,and
pand qare equal because truncation of any type is also a proposition. We can then simplify the
inner -type to its base in (4d) to obtain by the equivalence x:A1Ain (4e):
(
A
=
B
)(4a)
((A,(f,n,p)) =(B,(g,m,q))) (4b)
(α:A=B)
(β:tr λX.XX(α,f)=g)
(n=m)×(p=q)(4c)
(α:A=B)
(β:tr λX.XX(α,f)=g)
1(4d)
(α:A=B)
tr λX.XX(α,f)=g(4e)
(α:A=B)
coe (α)f=gcoe (α).(4f)
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
Mathematical Structures in Computer Science 9
Finally, as a consequence of transporting functions along the equality α,weobtainthetypein(4f).
The conclusion is that the identity type
A
=
B
is equivalent to the type of equalities between A
and Balong with a proof that the structure of fis preserved in the structure of g.
Theorem 2.17. Cyclic(A)is a finite set for any type A.
Proof. We unfold the definition of Cyclic(A) to obtain the type ϕ:AAn:NP(A,n)where
P(A,n):≡ e:An(eϕ=pred e).
Given the finiteness of type A, it follows that AAis finite. We now aim to show that
n:NP(A,n)is finite. We can show this by establishing the equivalence:
(n:N)
P(A,n)P(A,#A)(5)
and demonstrating that the type P(A,#A) is finite. Once established, we can conclude that the
equivalence preserves the finiteness of the type P(A,#A), by the closure property of finite types
under -types and propositional truncation.
To establish the equivalence in (5), as both types are propositions, we only need to construct
two functions fand gas follows using the propositional truncation elimination principle:
f:(n:N)P(A,n)→P(A,#A).
f((n,|p|)) :≡ |p|.
g:P(A,#A)→(n:N)P(A,n).
g(|r|):≡ (#A,|r|).
The -type, P(A,#A), is finite given that the base type is an equivalence between two finite
types, Aand #A, and each fibre is an identity type over a finite type, which is finite. This leads us
to conclude that the type n:NP(A,n)is finite, thereby implying that Cyclic(A) is finite.
3. Notions of Graph Theory
Graphs are a fundamental mathematical concept that has found widespread applications in vari-
ous fields, including mathematics and computer science. They are used to modelling relationships
between objects or entities, making them a versatile tool for analysing complex systems. However,
the definition of a graph can vary depending on the context in which it is used. The choice of a
specific notion of a graph in a given context depends on the application, such as power graphs in
computational biology, quivers in category theory, and networks in network theory. In some cases,
graphs are undirected, while in others, they are directed. Additionally, the inclusion of self-edges
may be allowed or prohibited.
3.1 The type of graphs
The following is our working definition of graphs. We later introduce concepts such as graph
homomorphism, finite graphs, and cyclic graphs.
Definition 3.1. A graph is an term of type Graph. The corresponding data of a graph consists of a
set N whose elements are referred to as points, vertices or nodes. Additionally, for every pair of nodes
a and b, there is a family of sets E, each of which corresponds to the edges connecting a and b. The
elements of these sets are called edges:
Graph :≡
(N:
U
)
(E:NN
U
)
isSet(N)×
(x,y:N)
isSet(E(x,y)).
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
10 J. Prieto-Cubides and H.R. Gylterud
Given a graph G, for brevity, the set of nodes and the family of edges are denoted by NGand
EG, respectively. In this way, the graph Gis defined as (NG,EG,(pG,qG)) where pG:isSet(NG)
and qG:x,y:NGisSet(EG(x,y)). We may refer to Gonly as the pair (NG,EG), unless we require
showing the remaining data, the propositions pGand qG. For example, we define the empty graph
and the unit graph, respectively, as (0,λuv.0)and(1,λuv.0). We will use variables Gand Has
graphs, and variables x,y,andzas nodes in G, unless otherwise specified.
Remark 3.2. Our primary objective is to provide a comprehensive characterisation of graph
planarity. To achieve this, we utilise a set-level concept of graphs, which includes directed multi-
graphs and those with self-edges, diverging from the traditional focus on undirected graphs.
The choice of a set-level structure is based on the common use of sets in the objects and rela-
tions studied within graph theory. However, this constraint can be easily modified for different
applications.
Definition 3.3. Agraph homomorphism from G to H is a pair of functions (α,β)such that α:
NGNHand β:x,y:NGEG(x,y)EH(α(x), α(y)).WedenotebyHom(G,H)the type of these
pairs.
We denote by idG,foranygraphG, the identity graph homomorphism where the correspond-
ing αand β(x,y) are the corresponding identity functions.
Theorem 3.4. The type Hom(G,H)forms a set.
Proof. Since sets are closed under -and-types, and given that both NGNHand
x,y:NGEG(x,y)EH(α(x), α(y)) are function types with set codomains, it follows that
Hom(G,H), being comprised of these types, is a set.
3.2 The category of graphs
Graphs as objects and graph homomorphisms as the corresponding arrows form a small pre-
category. In fact, the type of graphs is a small univalent category in the sense of the HoTT book
(Univalent Foundations Program 2013, Section 9.1.1). This fact follows from Theorem 3.7 and,
morally, because the Graph type is a set-level structure.
In a (pre-) category, an isomorphism is a morphism which has an inverse. In the particular case
of graphs, this can be formulated in terms of the underlying maps being equivalences.
Theorem 3.5. Let h be a graph homomorphism given by the pair-function (α,β). The claim h is
an isomorphism, denoted by isIso(h), is a proposition equivalent to stating that the functions αand
β(x,y)for all x,y:NG, are all bijections:
isIso(h):≡ isEquiv (α)×
(x,y:NG)
isEquiv (β(x,y)).
The type of all isomorphisms between Gand His denoted by G
=Hand defined as:
G
=H:≡
(h:Hom(G,H))
isIso(h), (6)
or equivalently, as the following type,
(α:NGNH)
(x,y:NG)
EG(x,y)EH(α(x), α(y)). (7)
If the type G
=His inhabited, it is said that Gand Hare isomorphic.
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
Mathematical Structures in Computer Science 11
Theorem 3.6. ThetypeG
=H forms a set.
Proof. Given G
=Has a subtype of Hom(G,H), and by Theorem 3.4 asserting that Hom(G,H)is
a set, it immediately follows from (6)thatG
=Hinherits the set structure.
We define a type to compare the sameness in graphs in Theorem 3.5; the type of graph isomor-
phisms. In HoTT, the identity type (=) serves the same purpose, and one expects the two notions
to coincide (Coquand and Danielsson 2013). In Theorem 3.7, we prove that they are, in fact,
homotopy equivalent. The same correspondence for graphs also arises for many other structures,
for example, groups and topological spaces (Ahrens and North 2019; Ahrens et al. 2020).
Theorem 3.7 (Equivalence principle). The canonical map
idtoiso :(G=H)(G
=H)
is an equivalence and its inverse function is denoted by isotoid.
Proof. It is sufficient to show that (G=H)(G
=H). Remember that being an equivalence
for a function constitutes a proposition. We consider the following type families to shorten the
presentation:
F1(X):≡ XX
U
and
F2(X,R):≡ x,y:XisSet(R(x,y)) where Ris of type F1(X).
The required equivalence follows from the calculation below in (8):
(G=H)(8a)
((NG,EG,(pG,qG)) =(NH,EH,(sH,tH))) (8b)
(α:NG=NH)
(β:trF1(α,EG)=EH)
(trisSet(α,pG)=sH)×(trF2
2(α,β,qG)=tH)(8c)
(α:NG=NH)
(β:trF1(α,EG)=EH)
1×1(8d)
(α:NG=NH)
trF1(α,EG)=EH(8e)
(α:NG=NH)
(x,y:NG)
EG(x,y)=EH(coe(α)(x), coe(α)(y)) (8f)
(α:NGNH)
(x,y:NG)
EG(x,y)EH(α(x), α(y)) (8g)
(G
=H). (8h)
We first unfold definitions in (8b). The equivalence in (8c) follows from the characterisation of
the identity type between pairs in a -type (Lemma 3.7 in HoTT book). The equivalence in (8d)
stems from the fact that being a set is a mere proposition and, thus, equations between proofs of
such are contractible, similarly as in (2.16). To get (8f), we apply function extensionality twice in
the inner equality in (8e). By the UA, we replace in (8g) equalities by equivalences. Finally, (8h)
follows from (3.5) completing the calculation from which the conclusion follows.
Theorem 3.8. The type of graphs is a groupoid.
Proof. Consider graphs Gand H. We want to show that the identity type G=His a set, for which
we apply Theorem 3.7. This yields an equivalence between the type G=Hand the set of isomor-
phisms G
=H(refer to Theorem 3.6). Since equivalences preserve set structures, it follows that
G=His indeed a set.
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
12 J. Prieto-Cubides and H.R. Gylterud
3.3 Subtypes and structures on graphs
In graph theory, graphs are often classified according to their structure in different graph classes.
This can be mirrored in type theory by considering type families over the type Graph.Thesetype
families result in a subtype of graphs if they are propositions; otherwise, they might provide a
structure on graphs.
A notable example of such a structure is our characterisation of planar graphs. We define a type
family Planar over Graph and establish that Planar(G) is a set, not a proposition, for any graph G.
Here are some informal examples of graph subtypes that one can define in type theory.
Simple graphs: The edge relation is propositional.
Undirected graphs: The edge relation is symmetric.
Connected graphs: A walk exists between any two nodes.
Complete graphs: Each node is connected to every other node by an edge.
Trees: These are connected graphs without cycles.
Regular graphs: Each node has the same number of connected edges.
Bipartite graphs: Nodes can be split into two disjoint sets with all edges connecting a node in
one set to a node in the other.
In HoTT, constructions preserve the structure of their constituents; thus, graph subtypes are
stable under isomorphisms. Theorem 3.7 enables property transport across isomorphic graphs,
affirming that they share any property a manifestation of the Leibniz principle for graphs. For
further discussion on a related principle, equivalence induction,seeEscardó(2019, Section 3.15).
3.4 Finite graphs
Agraphisfinite if its node set and each edge set are finite sets, as stated in Definition 3.9.Like
finite types, a finite graph has an associated cardinal number for the count of nodes and edges.
Hence, we can demonstrate that equality is decidable on both the node set and each edge set for
finite graphs.
Definition 3.9. AgraphGissaidtobefinite when the following proposition isFiniteGraph(G)
holds.
isFiniteGraph(G):≡ isFinite(NG)×isFinite
(x,y:NG)
EG(x,y)
.
ForafinitegraphG,thecardinalityofthenodesetandedgesetarerepresentedas#NGand #EG,
respectively.
3.5 Walks and strongly connected graphs
AgraphGis considered to be strongly connected or (connected for short) when for any pair of
nodes xand y, there is a walk from xto yin G. Intuitively, a walk in a graph is a sequence of edges
that forms a chain, of the type stated in Definition 3.10.
Definition 3.10. Awalk in G from x to y is a sequence of connected edges that we construct using
the following inductive data type:
data W:NGNG
U
_:(x:NG)W(x,x)
(__):{xyz :NG}.EG(x,y)W(y,z)W(x,z).
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
Mathematical Structures in Computer Science 13
Consider was a walk from xto y,thatis,atermoftypeWG(x,y). Here, xand yare the head and
end of w, respectively. A trivial or one-point walk is denoted by x.Ifwtakes the form (ex), it
represents a one-edge walk e. Walks of the form (ew) are non-trivial, and a loop signifies a walk
with identical head and end. The notion of walk can also be understood as a path, as suggested
in Remark 3.14.
Theorem 3.11. The type of walks for any graph forms a set.
Proof. Consider the type of walks W(x,y)foranygraphGand nodes xand y.Onecanshowthat
such a type is equivalent to n:Nˆ
W(n,x,y)with ˆ
Wdefined as follows:
ˆ
W:NNGNG
U
.(9a)
ˆ
W(0, x,y):≡ (x=y). (9b)
ˆ
W(S(n), x,y):≡
(k:NG)
EG(x,k)׈
W(n,k,y). (9c)
It suffices to show that the type ˆ
W(n,x,y) forms a set for n:N, which will be proven by induc-
tion on n.Ifn=0, one obtains the proposition x=y, which is a set. Consequently, we must
now show that the type in (9c) is a set. By the graph definition, the base type NGand EGare
both sets. Thus, one only requires that ˆ
W(n,k,y) forms a set, which is precisely the induction
hypothesis.
Definition 3.12. A graph G is said to be connected when the proposition Connected(G)holds.
Connected(G):≡
(x,y:NG)
EW(G)(x,y).
3.6 Graph families
Let us define some graph families indexed by the type of natural numbers.
Definition 3.13. The path graph with n nodes is the non-connected graph Pn,denedas:
Pn:≡ (n,λuv.toNat(u)+1=toNat(v)),
where
toNat :nN.
toNat (k,!):≡ k.
The length of path graph Pnis defined as the number of edges in Pn.GraphsP
0and P1have zero
length, and P2has one edge. Therefore, for n >0,P
nhas length n 1.
Remark 3.14. The path graph definition allows us to alternatively define graph walks. Specifically,
a walk in a connected graph Gof length nbetween nodes aand bcan be defined as a graph homo-
morphism from Pn+1to Gfor n>0. This homomorphism maps node 0 to aand nto b. A trivial
walk is a graph homomorphism from P1to G, selecting only one node ain G.Ifaequals b,the
walk is closed. Closed walks, also known as cycles, are introduced using an alternative definition
in Definition 3.18 that reflects cyclic types.
Definition 3.15. An n-cycle graph denoted by Cnis a graph with n edges defined as:
Cn:≡ (n,λuv.u=pred(v)),
when n 1. Otherwise, C0is the one-point graph with one trivial loop. The function pred is defined
in Definition 2.10. Similarly to path graphs, the length of an n-cycle graph is n.
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
14 J. Prieto-Cubides and H.R. Gylterud
C1C2C3C4C5
C0
In the treatment of embeddings of graphs on surfaces, we found that bouquet graphs, besides
their simple structure, have non-trivial embeddings.
Definition 3.16. The family of bouquet graphs Bn,givenby:
Bn:≡ (1,λuv.n),
consists of graphs obtained by considering a single point with n self-loops.
B2B3B4B5
B1
Definition 3.17. A graph of n nodes is called complete when every pair of distinct nodes is joined
by an edge. The complete standard graph with node set nis denoted by Kn:
Kn:≡ (n,λuv.u= v).
K3K4K5
K2
K1
For brevity, we will use a double arrow in the pictures from now on to denote a pair of edges in
opposite directions.
3.7 Cyclic graphs
Similarly, as for cyclic types, we introduce a type of graphs with a cyclic structure. A graph is cyclic
when it is in the connected component of an n-cycle graph in the Graph type.
Let us consider the homomorphism rot :Hom(Cn,Cn) that acts similarly as the function pred
in Definition 2.11. The homomorphism rot is an isomorphism on Cn, and then we can iterate it
ktimes to obtain the isomorphism denoted by rotk. Any of these isomorphisms can be used to
define what it means for a graph to be cyclic.
In particular, the cyclic structure for graphs can be defined as the property of preserving the
structure in Cninduced by the morphism rot. We will make use of the same notation as for cyclic
sets to refer to cyclic graphs.
Definition 3.18. AgraphGisconsideredtobecyclic if the type CyclicGraph(G)is inhabited:
CyclicGraph(G):≡
(ϕ:Hom(G,G))
(n:N)
isCyclic(G,ϕ,n),
where isCyclic(G,ϕ,n):≡ (G,ϕ)=(Cn,rot).
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
Mathematical Structures in Computer Science 15
3.8 The identity type on graphs
For any element, xof a groupoid type, X,thetypeAutX(x):≡ (x=x) has a group structure given
by reflexivity, symmetry and path composition. Applying this definition to the groupoid of graphs,
the equivalence principle of Theorem 3.7 gives that for any graph G, we identify Aut(G)withits
automorphisms, G
=G.ThisallowsustocomputeAut(G):≡ G
=Gin the examples below:
(1) Aut(B2) is the group of two elements. With only two edges in B2and one node, we can
only have, besides the identity function, the function that swaps the two edges. In gen-
eral, the identity type Bn=Bnis equivalent to the group Sn, the group which contains the
permutations of nelements.
(2) Any isomorphism in Aut(Cn) is completely determined by how it acts on a fixed node in
Cn, stated in the following.
Theorem 3.19. Let n :N.Ifn>0, then there exists an equivalence between the type Aut(Cn)and
the type n.
Proof. The result follows from considering the isomorphism rot as introduced in Definition 3.18
and the isomorphisms rotkfor k<n. The equivalence between the type nand the collection of
isomorphisms Cn
=Cnis then given by the following function fand its inverse g.
f:n(Cn
=Cn). g:(Cn
=Cn)n.
f(k,!):≡ (rotk,p). g(h,!):≡ (r,s).
The term pused to define fis the proof that rotkis an isomorphism. The term ris the solution to
the equation rotr=h,andsis the proof that r<n.Now,sincenis a set, we obtain a homotopy
gfidn. The other homotopy condition, that is, fgid(Cn
=Cn), can be derived from the
intermediate result, stating that if rotp=rotqand p,q<n,thenp=q.
The family of graphs Cnis presented intentionally, serving as a crucial component in defining
the type of faces of a combinatorial map, referenced in Section 5. The previous result contributes
to the proof that the type of faces of a given map for a graph forms a set, elaborated in Theorem 5.7.
4. Graph Maps
We explore the use of graph maps as an alternative approach to directly working with surfaces
on which graphs are embedded. Our aim is to characterise graphs with no edge crossing in the
two-dimensional plane without needing to represent the surface explicitly. This is motivated by
the fact that the concept of surface is not well defined in HoTT, and for our purpose, working with
real numbers can be laborious, as discussed in Yamamoto et al. (1995).
To avoid the complexities associated with the explicit notion of the surface in type theory, we
focus on representing the drawings of graphs in a more abstract way, which is defining the type
of graph maps, also called cellular embeddings, using their combinatorial characterisation (Stahl
1978). By leveraging the power of combinatorial representation of graph maps, we provide a more
comprehensive framework for analysing graph planarity, rather than focusing exclusively on the
geometric properties and how two-edges cross in the plane, which can be more challenging to
study.
4.1 Symmetrisation of graphs
Here, we introduce the symmetrisation construction which allows us to establish two key concepts
related to graph maps, stars and faces. The symmetrisation of a graph G, denoted by Sym(G), is
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
16 J. Prieto-Cubides and H.R. Gylterud
one solution used here to encode how the edges are oriented in a graph map. This construc-
tion is similar to the concept of half-edges for signed rotation maps in the literature of embedded
undirected graphs (Ellis-Monaghan and Moffatt 2013, Section 1.1.8).
Definition 4.1. The symmetrisation of a graph G is the graph Sym(G)defined as follows:
Sym :Graph Graph.
Sym(G):≡ (NG,λxy.EG(x,y)+EG(y,x), pG,r(qG)),
where r is a proof that the coproduct EG(x,y)+EG(y,x)is a set using qGas a proof that EG(x,y)is a
set for all x,y:NG.
Every edge a:EG(x,y)inGinduces two edges in Sym(G). The first is inl(a) keeping the same
direction as a. This edge is denoted by
afor short. The second is inr(a), which goes in the opposite
direction of a.Thisedgeisdenotedby
afor short. Since the nodes of Sym(G)arethesameas
the nodes of G, we will use the same notation for the nodes of both graphs. The following is an
immediate consequence of the induced edges in Sym(G) by the edges in G.
Theorem 4.2. Consider a graph G. For every walk w in G, we can induce a corresponding walk in
the symmetrisation Sym(G), denoted by sym(w).
Proof. The function sym in (10) generates the induced walk in Sym(G) from a walk win G:
sym :
(x,y:NG)
WG(x,y)WSym(G)(x,y).
sym(x,_,x):≡ x.
sym(x,y,ew):≡ inl(e)sym(_, y,w).
(10)
Theorem 4.3. The Sym operation on a graph G preserves the following properties:
connectedness of G and
finiteness of G.
Proof. Let us begin by proving the first property. Assume that Gis connected, and our objective
is to show that Sym(G) is also connected. This can be established by showing the existence of a
function of type:
(x,y:NG)
WG(x,y)
(x,y:NSym(G))
WSym(G)(x,y)
.
Since the fact that Gis connected is a proposition, we can construct such a function using the
elimination rule for propositional truncation and the function sym defined in Theorem 4.2 when
applied to a walk in G. In general, for Aand Btypes, a function of type ABcan be lifted
A→Bby similar reasoning.
On the other hand, to prove that Sym(G) is finite when Gis finite, we only need to consider the
family of edges in Sym(G). This family consists of finite coproducts, as it is the coproduct of two
finite sets. Furthermore, the set of nodes in Sym(G) is identical to the set of nodes in G,whichis
finite by assumption.
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
Mathematical Structures in Computer Science 17
Figure 4. On the left we show a part of a graph Gwith two distinguished edges, aand b. On the right we show the corre-
sponding symmetrisation, Sym(G), including the two edges,
aand
ainduced by a,andsimilarly,
band
binduced by b.
For brevity, we will only draw a segment representing related edges in the symmetrisation, as in Fig. 5(b).
4.2 Stars
Definition 4.4. GivenanodexinagraphG,itsstar is defined as the type StarG(x)consisting of all
edges incident to x:
StarG(x):≡
(y:NG)
ESym(G)(x,y). (11)
Let ybe a node in G.Ife:EG(x,y), then the pair (y,inl(e)) is referred to as an outgoing edge in
the start at x. Similarly, if e:EG(y,x), then the pair (y,inr(e)) is referred to as an incoming edge in
the start at x.Anincident edge of xis either an outgoing or an incoming edge in the star at x.The
cardinality of the set of incident edges at xis known as the valency of x.
Example 4.5. The graph Cnis a basic example of a planar graph and a building block to construct
more complex planar graphs. To enable this construction, we need to characterise the stars at any
node in Cnfor n >0. The case when n is zero is trivial, as the star at any node in the empty graph is
empty.
As Cnis a graph consisting of n nodes in narranged in a polygon/cycle, one can associate the
previous and the next node in the cycle, pred(x)and suc(x),foreachnodexinC
n, respectively. We
will prove that the valency of any node in Cnis two by proving that there exists an equivalence fx
from StarCn(x)to 2for every node x in Cn. The candidate to be the inverse of fxis the function gx
defined below:
fx:StarCn(x)2.gx:2StarCn(x).
fx(y,inl(p)) :≡ (0, !). gx(0, !):≡ (suc(x), inl(a+)).
fx(y,inr(p)) :≡ (1, !). gx(1, !):≡ (pred(x), inr(a)).
(12)
One can easily prove that both ECn(pred(x), x)and ECn(x,suc(x)) are contractible types. Therefore,
without loss of generality, we write a+to denote the edge from x to suc(x)and a to denote the edge
from pred(x)to x in Cn.
To complete the proof that fxis an equivalence, we need to show that fxgxid2and gxfx
idStarCn(x). The first is immediate by case analysis. For example, (fxgx)((0, !)) fx(gx((0, !)))
fx(suc(x), inl(p)) (0, !), and one can similarly show that fxgx((1, !)) =(1, !).
To prove the second part, we show that gxfxidStarCn(x)by performing a case analysis on the
second component of a term (y,z):StarCn(x). Specifically, we consider whether z is either inl(u)
or inr(v). For the first case, we need to prove that gx(fx((y,inl(u)))) =(y,inl(u)). Evaluating the
expression of the composite, we obtain an equality with the question mark below, which we need to
show one can inhabit:
gx(fx((y,inl(u)))) gx((0, !)) (suc(x), inl(a+)) ?
=(y,inl(u)).
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
18 J. Prieto-Cubides and H.R. Gylterud
(a) (b) (c)
Figure 5. We show in (a) the drawing of a graph Gwith edge crossings. A representation of the graph Gembedded in the
sphere is shown in (b). The corresponding faces of the graph map shaded in (b) are named Fifor ifrom 1 to 6. It is shown in
(c) with fuchsia colour the incident edges at the node ain Sym(G). The rotation system at a, that is, the cyclic set denoted by
(ba ad ax), is shown in green colour. The dashed lines represent edges not visible to the view.
However, we can establish the required equality by noting that ECn(x,suc(x)) is contractible. This
implies that ESym(Cn)(x,suc(x)) is a proposition, which in turn implies that a+=u and that we have
y=suc(x). Similarly, we can show that gx(fx((y,inr(v)))) =(y,inr(v)). This completes the proof that
fxis an equivalence and shows that StarCn(x)has only two elements.
Theorem 4.6. IfGisa(nite)graph,thenthetypeStarG(x)is a (finite) set.
Proof. The conclusion follows since the base type in Definition 4.4 is the set of edges in the graph,
and each of the fibres of the -type is a set since they are coproducts of sets. In particular, if
the graph is finite, then all the types appearing in the type StarG(x) are finite sets, and then our
conclusion follows.
4.3 The type of graph maps
A combinatorial map is a specific type of data structure that is used to represent a graph that
is embedded in a surface. This data structure offers a powerful substitute for traditional ana-
lytic/geometric techniques for representing such embeddings. Unlike geometric methods, com-
binatorial maps allow us to represent the combinatorial structure of the topological embedding
without the need to explicitly work with the surface in which the graph is embedded.
In this work, we focus on defining the type of combinatorial maps in type theory;
see Definition 4.7. We then turn our attention to a particular kind of embedding, cellular embed-
dings. The reason for this focus is that all graph maps in the two-dimensional plane are cellular
embeddings. Therefore, drawing graphs in the plane without edge crossings can be represented
by cellular embeddings.
Cellular embeddings are particularly interesting because they can be characterised combinato-
rially up to isotopy by the cyclic order they induce in the set of nodes around each node in the
graph (Gross and Tucker 1987), as illustrated in Fig. 5(b). This characterisation is minimal, as no
additional information is required beyond the cyclic orders.
One observation is that not all finite graphs can be drawn in the plane, but all finite graphs
can be drawn on some orientable surface (Stahl 1978). The literature in graph theory has proven
that a graph cannot have a cellular embedding on any surface if it has at least one node of infinite
valency (Mohar 1988, Proposition Section S3.2). As our focus is on cellular embeddings, we will
only examine locally finite graphs throughout the document.
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
Mathematical Structures in Computer Science 19
Definition 4.7. Map(G)is the type of combinatorial maps (maps for short) for a graph G defined as
follows:
Map(G):≡
(x:NG)
Cyclic(StarG(x)).
Definition 4.8. AgraphGislocally finite if the set of incident edges at the star at any node x in G,
is a finite set.
Theorem 4.9. If the type Map(G)is inhabited, then the graph G is locally finite.
Proof. AmapofGprovides each node a cyclic order on its star. Since these orders are finite by
Theorem 2.17, the local finiteness of Gfollows.
Theorem 4.10. The type of maps for a (finite) graph forms a (finite) set.
Proof. The type Map(G) is a set using the closure property of -types under (finite) sets. The type
Cyclic(StarG(x)) is a finite set by Theorem 2.17.
For brevity, we use from now the variable
M
to denote a map of the graph G.
Example 4.11. ThepossiblemapsforthecycleC
nfor n >0can be listed considering the cyclic
structures of the two-point type. These correspond to the cyclic structures of the stars of Cn,seethe
correspondence exhibited in Example 4.5. The two maps are given by the following functions:
c1:≡ 2,pred,2and
c2:≡ 2,suc,2.
5. TheTypeofFaces
In the context of cellular embeddings, faces correspond to regions homeomorphic, to the open
disk. Combinatorially, a face associated with a graph map consists of a cyclic walk in the embedded
graph where no edges are inside the cycle, and no node occurs twice. Definition 5.3 is our attempt
to make this intuition formal.
The first component of a face, as in Definition 5.3, captures the concept that its edges form a
cyclic walk in the embedded graph. While working with such walks would typically necessitate a
fixed starting point, this point does not contribute to the face’s combinatorial structure. Hence, we
can employ a cyclic graph to represent all such cyclic walks, thereby obviating the need for any
distinguished starting point in such walks.
The second component, the map-compatibility property, explicitly defines the ‘no edges on the
inside’ criterion for a face. This criterion is captured by the fact that each pair of consecutive edges
on the face is a successor-predecessor pair in the cyclic order of the edges around their common
node. In other words, when we move along the edges of the face either clockwise or counterclock-
wise, we will never come across an edge that goes through the inside of the face. As our graphs
are directed, we must traverse the edges in the symmetrisation of the graph rather than the graph
itself.
The following two definitions are used in the definition of the type of faces.
Definition 5.1. A graph homomorphism h from G to H given by (α,β)is edge-injective, denoted
by isEdgeInj(h), if the function f defined below is an embedding:
f:
(x,y:NG)
EG(x,y)
(x,y:NH)
EH(x,y).
f(x,y,e):≡ (α(x), α(y), β(x,y,e)).
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
20 J. Prieto-Cubides and H.R. Gylterud
Figure 6. On the right side, we shade the face Fof the graph Gembedded in the sphere given in Fig. 5.Wehavethecycle
graph C3and h:Hom(C3,Sym(G)) given by (α,β) on the left side. C3and hcan be used to define the face Fusing C3as the
graph Ain Definition 5.3.
Definition 5.2. The function flip changes the direction of an edge in Sym(G):
flip :
(x,y:NG)
ESym(G)(x,y)ESym(G)(y,x).
flip (x,y,inl(e)) :≡ inr(e).
flip (x,y,inr(e)) :≡ inl(e).
Since the first two arguments of the function flip are inferrable from the third argument, we will omit
them below.
Definition 5.3. The type Face(G,
M
)is the type of faces of a combinatorial map
M
of a graph G.
A face of type Face(G,
M
)consists of:
(1) a cyclic graph A,
(2) a graph homomorphism h given by (α,β)of type Hom(A,Sym(G)),suchthat
a. h is edge-injective,
b. h is map-compatible, denoted by isMapComp(h), meaning that h is star-compatible and
corner-preserving, properties defined below, respectively.
*hisstar-compatible, if the condition in (13)holds for every x :NA,
isStarComp(h)(x):≡ StarG(α(x))→StarA(x). (13)
*hiscorner-compatible, if there is evidence that h is compatible with the edge-ordering
given by the map
M
at the node α(x)and the edge-ordering coming from the star at that
node x in A. To state this property, let us consider the following notation.
*The previous edge at x is the edge a :ENA(pred(x), x),
*the edge after axis the edge denoted by a+
x
of type ENA(x,suc(x)),asillustratedinFig.6,and
*since
M
(α(x)) is a triple like f,m,! of type
Cyclic(StarG(α(x)))
for some function f :StarG(α(x)) StarG(α(x)) and some number m (the cardinality
of the star at α(x)), we abuse notation and use
M
(α(x)) to denote the function f . See
more on the cyclic type in Definition 2.11:
isCornerComp(h)(x):≡
M
(α(x))((α(pred(x)), flip(β(pred(x), x,a))))
=StarG(α(x)) (α(suc(x)) , β(x,suc(x), a+)). (14)
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
Mathematical Structures in Computer Science 21
It should be noted that the truncation in (13) is intentional. By incorporating this, we aim to
emphasise that if the graph Ghas at least one edge at a given node, then a face covering that node,
represented by the cyclic graph A, must have at least one edge at the corresponding node as well.
Without this condition, the type of faces could be inhabited with empty faces using Aas the cyclic
graph without edges (C0) at every node of the graph G.InFig.6, we illustrate a portion of the
required data to define a face F1for the map of graph Ggiven in Fig. 5(b).
Theorem 5.4. For a graph homomorphism, being edge-injective is a proposition.
Proof. Edge-injectivity is a proposition by iteratively applying the closure of -types to propo-
sitions. Ultimately, we need to show that for any two terms (x,y,e1)and(x,y,e2)in
x,y:NGEG(x,y), the identity type (x,y,e1)=(x,y,e2) is a proposition. This is true because the
-type in question is a set, and sets are closed under -types, given that both NGand EG(x,y)are
sets.
Theorem 5.5. For a graph homomorphism, being map-compatible is a proposition.
Proof. For a graph homomorphism h, map-compatibility decomposes into star-compatibility and
corner-compatibility. We must show each type in this product is a proposition. Star-compatibility
is a proposition as it involves a function type with a propositional codomain the proposi-
tional truncation of a set. Corner-compatibility is also a proposition, being a function type whose
codomain is the identity type on StarG(α(x)) at α(x). This identity type is a proposition since stars
are sets, as established in Theorem 4.6.
We devote the rest of this section to proving that the type of faces forms a set in Theorem 5.7.
This claim rests on the fact that (i) the type of cyclic graphs forms a set, (ii) the type of graph
homomorphisms forms a set, and (iii) the conditions, edge-injective and map-compatible in,
Definition 5.3 are propositions. One might suspect that this type forms a groupoid based on previ-
ous facts. However, the edge-injectivity property of the underlying graph homomorphism of each
face suffices to show that the type of faces is a set.
Theorem 5.6. Let f and g be edge-injective graph homomorphisms from Cnto a graph G and
n>0.Thenthetypee:Cn=Cn(trλX.Hom(X,G)(e,f)=g)is a proposition.
CnCn
G
f
e
g
Proof. The result follows from the proof that the -type in question is equivalent to a proposi-
tion. The corresponding equivalence is given in (15), in which we use some known results about
Univalence and Theorem 3.19, as in the very last step:
(e:Cn=Cn)
(trλX.Hom(X,G)(e,f)=g)
(e:Cn=Cn)
(f=gcoe (e)) (15a)
(e:CnCn)
(f=ge) (15b)
(k:n)
(f=grotk). (15c)
It remains to show that the last equivalent type is a proposition. Let (k1,p1)and(k2,p2)be
of type k:n(f=grotk). We must show that (k1,p1) is equal to (k2,p2). Since Hom(Cn,G)is
a set, we only need to prove that k1is equal to k2. To show that, Theorem 3.19 is used in the
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
22 J. Prieto-Cubides and H.R. Gylterud
proof. By computing the identity type of graph isomorphisms, we obtain that p1
1·p2of type
grotk1=grotk2is equivalent to having two equalities:
p:π1(grotk1)=π1(grotk2)and
q:trλe.x,y:NCnECn(x,y)EG(e(x),e(y))(, )pπ2(grotk1)=π2(grotk2).
By characterising the identity of the -types and with the previous equalities, pand q, one can
get another equality rof the type in (16)forx,y:NCnand e:ECn(x,y):
((π1(grotki))(x), (π1(grotki))(y), (π2(grotki))(x,y,e)) =
((((π1(g))(π1(rotki)))(x)), (((π1(g))(π1(rotki)))(y)), (((π2(g))(π2(rotki)))(x,y,e))). (16)
Now since the graph homomorphism gis edge-injective, applying Definition 5.1 to the equality r,
one gets an equality rof the type below in (17). By applying Theorem 3.19 to r, we conclude that
k1is equal to k2from which the required conclusion follows:
((π1(rotk1))(x), (π1(rotk1))(y), (π2(rotk1))(x,y,e)) =
((π1(rotk2))(x), (π1(rotk2))(y), (π2(rotk2))(x,y,e)). (17)
Theorem 5.7. The type of faces for a graph map forms a set.
Proof. Let F1and F2be two faces of a map
M
. We will show that the type F1=F2is a proposition
in (18), with the following conventions.
A
is the cyclic graph related to the face F1:
A
:≡ (A,(ϕA,n,isCyclic(A,ϕA,n))).
B
is the cyclic graph related to the face F2:
B
:≡ (B,(ϕB,m,isCyclic(B,ϕB,m))).
We first unfold the definitions of F1and F2in (18a) and simplify the propositions in (18b),
namely isEdgeInj,isMapComp and isCyclic. Then, by expanding the definitions of
A
and
B
in (18c) and simplifying the propositions in terms such as being a cyclic graph, one gets (18d).
Next, we reorder in (18d) the tuple equalities to create an opportunity for path induction towards
the application of Theorem 5.6. Now, since we want to prove that the type of faces is a set, and
that itself is a proposition, the truncation elimination principle is applied to the propositions
isCyclic(A,ϕA,n)andisCyclic(A,ϕA,n). Then, the graphs Aand Bbecome, respectively, Cnand
Cmin (18e). The step in (18f) follows from the characterisation of the identity type between tuples
in a nested -type:
(F1=F2)
((
A
,f,isEdgeInj(f), isMapComp(f)) =(
B
,g,isEdgeInj(g), isMapComp(g))) (18a)
((
A
,f)=(
B
,g)) (18b)
((A,(ϕA,n,isCyclic(A,ϕA,n))), f)=((B,(ϕB,m,isCyclic(B,ϕB,m))), g)(18c)
((A,(ϕA,n)), f)=((B,(ϕB,m)), g)(18d)
((n,((Cn,f), ϕCn)) =(m,((Cm,g), ϕCm))) (18e)
(p:n=m)
(e,):(e:Cn=Cm)trλX.Hom(X,Sym(G))(e,f)=g
trλX.Hom(X,X)(e,ϕCn)=ϕCm. (18f)
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
Mathematical Structures in Computer Science 23
Figure 7. The graph embedding Sym(G), as depicted in Fig. 5, is associated with a face
F
defined by A,f. The underlying
cyclic graph Acontains two highlighted walks between distinct nodes xand y. These walks correspond to clockwise and
counterclockwise closed walks in Sym(G), represented as cw
F
(x,y)andccw
F
(x,y), respectively.
It only remains to show that the type in (18f) is a proposition. We show this by proving that
each type in (18f) is a proposition. First, we unfold the cyclic graph definition for Cnand Cm,
using Definition 3.18. Second, a case analysis on nand mis performed. This approach creates four
cases where nand mcan be zero or positive. However, we only keep the cases where nand mare
structurally equal. One can show that the other cases are imposible with an equality between n
and m.
(1) If nand mare zero, then, by definition, Cnand Cmare the one-point graph. In this case, the
conclusion follows easily. The base type n=mof the total space in (18f) is a proposition
because Nis a set. The type C0=C0is a proposition, since it is contractible. The identity
graph homomorphism is the unique automorphism of C0. Lastly, because Hom(Cn,Cn)is
a set, the remaining type of the -type is a proposition, completing the proof obligations.
(2) If nand mare positive, we reason similarly. The type n=mis a proposition. By path
induction on p:n=m, the second base type of the -type becomes the type in (19):
(e:Cn=Cn)
(trλX.Hom(X,Sym(G))(e,f)=g), (19)
which is a proposition by Theorem 5.6. The remaining type of the -type is a propo-
sition, because Hom(Cn,Cn) is a set. Therefore, the -type in (18f) is a proposition as
required.
5.1 The boundary of a face
Each face
F
of a map
M
consisting of a cyclic graph A, a homomorphism hand some extra data
as described in Definition 5.3 induced a closed walk that follows the edges of its defining polygon,
which we refer to as its boundary.
Definition 5.8. Let
F
beafaceforamapofthegraphG,theboundaryof
F
is the subgraph of the
image of the associated function, h, given in the definition of the type of
F
:
F
((A,(h,))) :≡ Img(h).
Here, Img(h)is the induced subgraph of G by the image of h. More specifically, it is defined as:
Img(h):≡ (x:NA,π1(h)(x), λx.λy.λe.π2(h)(x,y,e)).
The degree of a face
F
is the length of
F
, which is the number of nodes in A. The boundary
F
can be walked in two directions with respect to the orientation given by its map.
As illustrated by Fig. 7, given two different nodes xand yin
F
, we can connect xto yusing
the walk in the clockwise direction, cw
F
(x,y). Similarly, one can connect xto yusing the walk
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
24 J. Prieto-Cubides and H.R. Gylterud
in the counterclockwise direction, ccw
F
(x,y). Such walks are induced by the walks in the cyclic
graph A,seeTheorem 5.10.
For brevity, we omit the proofs of Theorems 5.9 and 5.10. These lemmas refer to proper-
ties inherent in the construction of Cnand its symmetrisation, see Fig. 4. Thus, the proofs are
straightforward applications of definitions.
Theorem 5.9. Supposing x,y:NCn, the following claims hold for the cycle graph Cn.
(1) The type ECn(x,y)is a proposition.
(2) For n >0, there exists an edge of type ECn(pred(x), x)and an edge of type ECn(x,suc(x)).
(3) For n >0, there exists a walk going in the clockwise direction denoted by cwCn(x,y)from x
to y.
Theorem 5.10. Supposing x,y:NCn, the following claims hold for the graph Sym(Cn).
(1) If n >1, then the type ESym(Cn)(x,y)is a proposition.
(2) There exists an edge of type ESym(Cn)(pred(x), x)and of type ESym(Cn)(x,suc(x)).
(3) There exist two walks from x to y in Sym(Cn), denoted by cwSym(Cn)(x,y)and
ccwSym(Cn)(x,y), respectively.
a. The walk cwSym(Cn)(x,y)represents the walk in the clockwise direction from x to y.
b. On the other hand, the walk ccwSym(Cn)(x,y)represents the walk in the counterclockwise
direction from x to y. In case x =y, the walk ccwSym(Cn)(x,y)corresponds to the trivial
walk x.
Example 5.11. For cycle graphs Cn, only one combinatorial map exists. Cyclic structures of two-
point type c1and c2,denedinExample 4.5, precisely induce the maps of Cn. In other words, one
canobtainamap
M
using c1by (20)and
(pred,2,|(ideqv,reflpred)|):Cyclic(2).
Moreover, using function extensionality, Theorem 2.16 implies that the map induced by c2and the
map
M
are equal.
Map(Cn)
(x:n)
Cyclic(StarCn(x))
(x:n)
Cyclic(2).
(20)
Example 5.12. Recall that a graph consisting of a single node and n loop edges is referred to as an n-
bouquet, denoted by Bn.ToenumeratethemapsofB
2, we can label the edges of its sole star as (
x,
x,
y , and
y ). It is important to note that reflection is not treated as symmetry here. Consequently,
we identify six distinct combinatorial maps for B2, each distinct cyclic permutation of the set of edges
creates a map in this case, as depicted in Fig. 8.
6. Planar Maps
In this section, we examine the type of graphs with an embedding in the two-dimensional plane.
Such embeddings are called planar embeddings or planar maps. A graph is planar if it has a planar
map and the graph embedded is called a plane graph. To discuss the notion of planar embeddings,
we take inspiration from topological graph theory (Gross and Tucker 1987, Section 3). Then one
can work with combinatorial maps that represent graph maps into a surface up to isotopy.
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
Mathematical Structures in Computer Science 25
(a)
(d)
(b) (c)
(f)(e)
Figure 8. The six possible maps of the bouquet B2. Respectively, they are denoted and defined as follows:
a:≡ (
x,
x,
y,
y), b:(
x,
x,
y,
y), c:(
x,
y,
x,
y), d:(
x,
y,
y,
x), e:(
x,
y,
x,
y)andf:(
x,
y,
y,
x).
In the following, we focus on describing embeddings of graphs in the sphere called spherical maps.
These graph maps are used later to establish the type of planar embeddings for a given graph.
6.1 Spherical maps and homotopy for walks
Any graph map gives rise to an implicit surface. For planar embeddings, this surface is a space
homeomorphic to the sphere. In particular, any embedding in the sphere induces an embedding
in the plane. To see this, for a graph embedded in the sphere, one can puncture the sphere at some
distinguished point, and subsequently, apply the stereographic projection to it.
The sphere in topology has two main invariants: path-connectedness and simply-
connectedness. The former states that a path connects any pair of points in the sphere, and the
latter states that any two paths with the same endpoints in the sphere can be deformed into one
another.
If we now consider a walk as a path in the corresponding space induced by the map, then the
path-connectedness property coincides with being connected for the graph embedded. However,
if we want to address simply connectedness for the surface induced by a graph embedding, then
we need to have an equivalent notion to saying how a pair of walks can be deformed into one
the other. One proposal of such a notion is homotopy for walks in directed multigraphs (Prieto-
Cubides 2022b).
In this subsection, we present a binary relation, denoted by (
M
), on the set of walks between
fixed endpoints in a graph as in introduced in Prieto-Cubides (2022b). This relation is designed
to capture the behaviour of walks in an embedded graph in a surface such as the two-dimensional
plane, where all the walks can be deformed one into another along the faces of the graph map in
use.
Definition 6.1. Let w1,w2be two walks from x to y in Sym(G). The expression w1
M
w2denotes
that one can deform w1into w2along the faces of
M
. We acknowledge evidence of this deformation
as a walk homotopy between w1and w2,oftypew
1
M
w2.
The relation (
M
)has four constructors, as follows. The first three constructors are functions to
indicate that homotopy for walks is an equivalence relation; they are hrefl,hsym and htrans.Let
x,y:NG.
hrefl :
(w1:WSym(G)(x,y))
w1
M
w1.
hsym :
(w1,w2:WSym(G)(x,y))
w1
M
w2w2
M
w1.
htrans :
(w1,w2,w3:WSym(G)(x,y))
w1
M
w2w2
M
w3w1
M
w3.
(21)
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
26 J. Prieto-Cubides and H.R. Gylterud
Figure 9. Given a face
F
of a map
M
, we illustrate here hcollapse, one of the four constructors of the homotopy relation on
walks in Definition 6.1. The arrow ( ) represents a homotopy of walks.
The fourth constructor, illustrated in Fig. 9,isthehcollapse function that establishes the walk
homotopy:
(w1·ccw
F
(a,b)·w2)
M
(w1·cw
F
(a,b)·w2),
supposing one has the following,
(i) a face
F
given by A,fof the map
M
,
(ii) a walk w1of type WSym(G)(x,f(a)) for a node x in G with a node a in A, and
(iii) a walk w2of type WSym(G)(f(b), y)for a node b in A with a node y in G.
One consequence of Definition 6.1 is that, in each face
F
, there is a walk homotopy between
ccw
F
(x,y)andcw
F
(x,y) using the constructor hcollapse.
The following shows how to compose walk homotopies horizontally and vertically. We con-
sider a map
M
for a graph Gand distinguishable nodes, x,y,andzwhere w,w1and w2are walks
from xto y.
Theorem 6.2. The following claims hold for the homotopy relation on walks.
(1) (Right whiskering) Let w3be a walk of type WSym(G)(y,z).Ifw
1
M
w2then
(w1·w3)
M
(w2·w3).
xyzxz
w1
w2
w3
w1·w3
w2·w3
(2) (Left whiskering) Let p1,p2be walks of type WSym(G)(y,z).Ifp
1
M
p2,then
(w·p1)
M
(w·p2).
xyzxz
w
p1w·p1
w·p2
p2
(3) (Horizontal composition) Let p1,p2be walks of type WSym(G)(y,z).Ifw
1
M
w2and
p1
M
p2,then(w1·p1)
M
(w2·p2).
xyzxz
w1
w2
p1
p2
w1·p1
w2·p2
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
Mathematical Structures in Computer Science 27
6.2 The type of spherical maps
In topology, the property of being simply connected to the sphere states that one can freely
deform/contract any walk on the sphere into another whenever they share the same endpoints.
This property of the sphere leads to the predicate in Definition 6.3, which sets the criteria for a
graph to be embeddable in the 2-sphere.
Definition 6.3. Given a graph G, a map
M
for G is said to be spherical if the type in (22)is
inhabited:
isSpherical(
M
):≡
(x,y:NSym(G))
(w1,w2:WSym(G)(x,y))
w1
M
w2. (22)
Theorem 6.4. Being spherical for a map is a proposition.
Proof. Since the codomain of the function type in (22) is a propositional truncation of a set of
walk homotopies, it follows that it is indeed a proposition.
Theorem 6.5. The collection of all spherical maps for a graph forms a set.
Proof. Spherical maps constitute a subtype within the set of all graph maps by Theorem 6.4,thus
forming a set.
Remark 1. When examining the definition of spherical maps in Definition 6.3, it becomes clear
that showing that a map is spherical is not a simple task. To label a map as spherical, as per (22),
one must evaluate all potential walk pairs for every node pair. This task can be daunting unless
the set of walks exhibits a particular property. As a result, we suggest an alternative formulation
for spherical maps based on a loop reduction procedure within a graph with a discrete node set.
Specifically, employing walk homotopies within a graph with a discrete node set and a pre-
existing spherical map allows the reduction of any walk to an inner loop-free form, termed the
normal form of a walk. The idea stems from the redundancy of loops, or the potential to simplify
a loop into a point. Eradicating these loops results in a more tractable, yet equivalent, definition
for spherical maps based on a loop reduction procedure for walks. Each walk is walk-homotopic
to its normal form. It is also worth noting that one can determine if a map is spherical for graphs
with a discrete node set. Additionally, the number of spherical maps for a graph is finite. For these
results and their proofs, which exceed the scope of this text, we refer the reader to Prieto-Cubides
(2022b).
6.3 The type of planar maps
Our goal is to characterise graph planarity within the framework of HoTT, guided by the intuitive
idea that edges on a plane should not intersect. Defining the concept of edge intersection with
precision poses a significant challenge. If we align with the geometric essence of this intuitive
description, using the two-dimensional plane as our basis, it requires the use of real num-
bers (Univalent Foundations Program 2013, Section 10). This implies defining edge intersections
in terms of points on the R2plane and considering edges as curves within it. However, given its
complexity, we opt for a combinatorial approach instead. As previously discussed, this method
enables us to represent graph maps on the plane or, equivalently, a punctured 2-sphere, without
any mention of real numbers.
Definition 6.6. AconnectedandlocallyfinitegraphGisplanar if the type Planar(G)is inhabited.
Elements of Planar(G)are called planar maps of G:
Planar(G):≡
(
M
:Map(G))
isSpherical(
M
)×Face(G,
M
)

outerface
.
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
28 J. Prieto-Cubides and H.R. Gylterud
We define the type Planar(G) to represent all possible embeddings of Ginto the plane, specifi-
cally focusing on plane graphs. Although Planar(G) is not a planarity test in itself, it can be used to
determine if a finite graph is planar or not by generating all the maps of the graph and subsequently
verifying their spherical nature and the presence of an outer face, see Theorem 6.4.
Theorem 6.7. The type of all planar maps of a graph forms a set.
Proof. The type of planar maps in Definition 6.6 is not a proposition. It encompasses two sets: the
set of combinatorial maps, see Theorem 4.10, and the set of faces, see Theorem 5.7. Since being
spherical for a map is a mere proposition, one concludes that the -type collecting all planar maps
of a graph forms a set.
In addition to their simple structure, cyclic graphs, and in particular Cngraphs, are building blocks
in a few relevant constructions in formal systems related to the study of the planarity of graphs,
such as planar triangulations and the characterisation of all 2-connected planar graphs.
Example 6.8. To show the planarity of Cn, we begin with the base case n =0.ThegraphC
0is a unit
graph, a graph with a single node and no edges. Without edges, the type of functions mapping this
node to any cyclic order of its star is a contractible type, yielding a unique, trivially spherical map.
The map is spherical since the only walk to consider is the empty walk, which is trivially homotopic
to itself. Planarity follows as C0is connected by definition and possesses an outer face. To define this
face,weuseasthebasecyclicgraph,thegraphC
0itself along with identity graph homomorphism
h, see that Sym(C0)
=C0. The other conditions to inhabit the type of faces for our map are thus
trivially satisfied.
For n >0,C
nis connected and locally finite as shown by Theorem 5.9. Its planarity is supported
by Example 5.11, which confirms the existence of a unique map
M
for Cn.Toshowthismapis
spherical, it suffices to show that any two walks w1and w2with identical endpoints are homotopic.
Inner loops in walks can be ignored since they are irrelevant to walk homotopy, as shown in Prieto-
Cubides (2022b). Let us now consider the following cases. For n =1, the only walk is the trivial one,
which is self-homotopic. For n >1, when examining nodes x and y in Cn,wehave:
If x = y, the relevant walks are ccwSym(Cn)(x,y)and cwSym(Cn)(x,y),asperTheorem 5.10.
These walks are homotopic via hcollapse(
F
,x,y,x,y,x,y), where
F
denotes the face
associated with Sym(Cn)where these walks form the boundary of
F
.
If x =y, the walks under consideration are the trivial walk at x and cwSym(Cn)(x,x). Similarly
to the previous case, these walks are homotopic via hcollapse.
Finally, the outer face of
M
is naturally induced by Cn,whichsatisesDefinition 5.3 by construc-
tion. In fact, the definition of faces in Definition 5.3 was informed by the structure of Cn. Hence, we
conclude that Cnis planar for all n.
In order to expand our collection of planar map examples, we will now explore the con-
cept of planar extensions in the context of graph maps. This approach will provide a deeper
understanding and additional instances of planar structures in graph theory.
6.4 Planar extensions
This subsection outlines the construction of planar maps from existing ones using the path
addition operation. The inspiration for this construction derives from ear decompositions (Bang-
Jensen and Gutin 2009, Section 5.3), reliable networks, extensions of planar graphs for undirected
graphs (Gross et al. 2018, Section 5.2,7.3) and the characterisation of 2-connected graphs
(Whitney 1932).
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
Mathematical Structures in Computer Science 29
Definition 6.9. Let G be a graph with nodes u, v and Pndenote a path graph of n nodes as defined
in Definition 3.13. The (simple) path addition of PntoGatnodesuandvinGisanewgraph
constructed using the function path-addition with arguments G,u,v,n and r showing that n is
positive, as illustrated in Fig. 13(a). For short, this new graph is denoted by G u,vPn. Here, u and v
arereferredtoastheendpoints of the addition:
path-addition :
(G:Graph)
(u,v:NG)
(n:N)
(0 <n)Graph.
path-addition (G,u,v,n,r):≡ (N,E,h1,h2).
The types of nodes Nand the family of edges Eare defined below. The functions h1and h2are well
defined, although not elaborated here, see Prieto-Cubides (2022a) for details on these functions, their
properties and other functions related to path additions:
N:≡ NG+n.
E:NN
U
.
E(inl(x), inl(y)) :≡ EG(x,y).
E(inl(x), inr(y)) :≡ (x=u)×(y=(0, r)).
E(inr(x), inl(y)) :≡ (x=pred((0, r))) ×(y=v).
E(inr(x), inr(y)) :≡ EPn(x,y).
Remember that the path graph Pnwith nnodes can be defined as follows:
Pn:≡ (n,λuv.toNat(u)+1=toNat(v)),
where toNat is defined as follows:
toNat :nN.
toNat(k,!):≡ k.
We also conveniently define the non-simple path addition of Pnto Gat nodes uand vin G.This
operation mirrors the symmetrisation of a simple path addition. This construction of non-simple
path addition is needed for subsequent sections, as it is used to establish the planar graphs, which
involve the symmetrisation of the given graph.
Definition 6.10. Let G be a graph with nodes u, v. The non-simple path addition of Pnto G at these
nodes yields a new graph. This graph is constructed in a similar fashion as the simple path addition,
by linking G and the graph Sym(Pn)using four edges. Two of these edges go from node u to 0in
Sym(Pn)and back. The other two edges link v to n in Sym(Pn)and back.
To ease the upcoming discussion, we must introduce the following conventions:
Gis a locally connected finite graph with decidable equality on its nodes.
nis a positive natural number.
In the graph Gu,vPn, we denote the walk from uto vvia the addition of Pnto Gas p.Thisis
illustrated in Fig. 10(a). By an abuse of notation, we may also refer to this walk as e0·Pn·en.
Here, e0and enare the edges connecting nodes uto 0 and nodes n1tov, respectively. The
remaining edges, denoted as ei, connect nodes i1andiand represent the new additions
from the path addition.
For brevity, we denote Gu,vPnby Gp. This notation is often used below when the specifics
of nand u,vare not crucial to the discussion.
We denote Gu,vSym(Pn)byGp.Here,prepresents the subgraph added to Gthrough the
non-simple path addition of Pnat nodes uand v. This is illustrated in Fig. 10(b).
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
30 J. Prieto-Cubides and H.R. Gylterud
Figure 10. Path graph additions of Pnto G. The left figure illustrates the path addition Gu,vPn, achieved by adding path
graph Pnto graph Gat nodes uand v. This process introduces two new edges, e0and en, along with nnew nodes from path
Pn.Wedenepas the walk e0·Pn·enfrom uto vin Gu,vPn, simplifying notation. Similarly, the right figure depicts the
non-simple path addition of Pnto Gat nodes uand v, extending graph Gwith Pn’s symmetrisation and four additional edges.
In Gp, we adopt similar notation regarding edges in the symmetrisation of a graph, as
introduced in Fig. 4. The walk
psignifies the walk in pinduced by the sequence
e0·
e1·
····
en. Conversely,
pdenotes the opposite direction walk, induced by the sequence
en·
en1·····
e0. See Fig. 10(b) for an illustration.
Both Gpand Gpare referred to as graph extensions.
The operator () is left associative.
The variables pidenote finite path graphs of positive length, with respective endpoints uiand
vi, adhering to the same considerations as for pin the previous items.
Asimple cyclic addition to Gis the path addition Gu,upfor some p, where uis a node in G.
Theorem 6.11. IfagraphGisconnected,thenbothGpandGp remain connected.
Proof. To show the connectedness of Gu,vPn, it suffices to consider connectivity between all
node pairs in the augmented graph. The case for Gu,vSym(Pn) is analogous. Additionally, we
assume a walk can always be constructed to connect any two nodes in G. This is justified by elim-
inating the propositional truncation in the definition of connectedness since we want to prove
connectedness for a graph, which is a proposition itself. The proof is followed by cases, depending
on the location of the nodes in the augmented graph.
Let xand ybe distinct nodes in Gu,vPn; for identical nodes, a trivial walk suffices. If both are
in G, their connectivity is inherent. If xis in Gand yis in Pn, their connectivity is established via
a concatenated walk from xto uwithin G, followed by the subwalk of e0·Pn·enthat connects 0
to y.Ifxand ylie in Pn, say they correspond to iand j, we can use as the walk to connect them,
ei+1·····ejif i<j. Otherwise, the walk is ei·····en·w·e0·····ej, where wdenotes a given walk
from vto uin G.
We establish that graph symmetrisation is functorial with respect to path addition.
Theorem 6.12. Sym(Gp)
=Sym(G)p.
Proof. To show these graphs are isomorphic, we compare their node and edge sets for equivalence.
By definitions of Sym and path-addition, the node sets are identical:
NSym(Gp)NG+nNSym(G)+nNSym(G)p.
For the edge sets, we want to show that for given nodes xand y,
ESym(Gp)(x,y)ESym(G)p(x,y).
To address this equivalence, we notice how the path addition operation affects the edge sets of the
original graph. This operation affects the edges differently based on the location of xand y,but
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
Mathematical Structures in Computer Science 31
within Gor Pn, and because symmetrisation does not alter the edge sets:
ESym(Gp)(x,y)ESym(G)(x,y)ESym(G)p(x,y).
When xis in Gand yin Pn, or vice versa, symmetry allows us to consider two cases: xuand
y0, or xvand yn. In both scenarios, the new edges introduced by path addition result in
equivalent edge sets:
ESym(Gu,vPn)(u,0)2ESym(G)p(u,0).
The first part of this chain, the equivalence, ESym(Gu,vPn)(u,0)2which is due to the fact that
uand 0 are adjacent in Sym(Gu,vPn). These two edges are the one induced in Gu,vPnand the
other one from the symmetrisation process. On the other hand, the equivalence ESym(G)p(u,0)
2follows by applying ( p)toSym(G).Thecaseforxvand ynis analogous. Consequently,
the edge sets coincide, confirming the expected isomorphism.
Theorem 6.13. Let
M
represent a planar map of G,
F
a specific face, and u and v two nodes on
the boundary walk of
F
.AnextendedplanarmapofGp can be constructed from
M
,wherepis
situated onto
F
, splitting it into two faces.
The proof of Theorem 6.13 unfolds in several steps. We first define a map that extends
M
to
apropermapofGpwith defined values for the nodes in p. Next, as illustrated in Fig. 12,we
establish two faces resulting from placing ponto
F
. The final step involves demonstrating that
the candidate map for Gpis planar. That is, per Definition 6.6, that all pairs of walks in the
symmetrisation of Gpare walk-homotopic with respect to the given map.
Proof of Theorem 6.13.Let
M
be a planar map of G,
F
a specific face, and uand vtwo nodes on
the boundary walk of
F
.WedenotethegraphGpas Hand the prospective planar map for
this graph as
M
.InthecontextofDefinition 5.3, within the face walk boundary
F
of the given
face
F
, we identify an edge preceding u, represented as a:EG(pred(u), u), and its succeeding
edge a+:EG(u,suc(u)). Analogously for v,wehaveb:EG(pred(v), v)andb+:EG(v,suc(v)), as
depicted in Fig. 11(a).
We define the map
M
at each node xin H. We begin with the endpoints of p,thatis,x=u
and x=v.Forx=u, we alter the cycle
M
(u) by introducing e0between the edges aand a+,
resulting in the cycle
M
(u)=(···ae
0a+··· ). Similarly, for x=v, the modified cycle
M
(v)is
(···be
nb+··· ). For internal nodes of p, that is, nodes xin Pn,themap
M
is defined directly.
At each of these nodes, we encounter only two edges, denoted as eiand ei+1, where iranges from
0ton1. Remember that e0connects nodes uand 0, enlinks nodes n1andv, and for the
remaining, eibridges nodes i1andi.
Assume the face
F
,inducedby(A,h)ofdegreemaccording to Definition 5.3.Here,his
an edge-injective graph homomorphism from Ato Sym(H), satisfying the map-compatibility
condition. Let
F
be the boundary walk of
F
of length kand define n1,n2as k+(n+1) and
(mk)+(n+1), respectively.
Let us denote F1,F2as faces induced by (Cn1,h1)and(Cn2,h2), respectively, where h1=(α1,β1)
and h2=(α2,β2) are morphisms of type Hom(Cni,Sym(H)) for i=1, 2. The boundary walks of
these faces, F1and F2, are defined as cw
F
(u,v)·
pand ccw
F
(u,v)·
p, respectively. The
subsequent image provides a visual representation of this concept.
To establish the planarity of
M
, we must first demonstrate that for each face F1and F2of
M
,h1and h2satisfy the map-compatibility condition and uphold the edge-injectivity property.
Beginning with h1, consider the nodes in Cn1, namely 0, 1, ...,n11. Each node i:NCn1maps to
a node defined by αfrom
F
. Specifically, α1(i)equalsα(i)fori<k,whileα(i) positions the node
in cw
F
(u,v). For the corresponding edges, e:ECn1(i,i+1), we employ the function βfrom
F
to
define β1, such that β1(i,i+1, e) corresponds to β(i,i+1, e).
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
32 J. Prieto-Cubides and H.R. Gylterud
(a) (b)
Figure 11. Figure (a) in the caption illustrates the path addition Gpas detailed in Theorem 6.13. Figure (b) presents the
planar map for Gfrom Fig. 5(b), showcasing three graph extensions: the path addition of p, cyclic addition of qand spike
addition of r. Though it is feasible to define the construction of r, it is not necessary for this discussion. The additions of p
and qsplit faces F2and F3from Fig. 5, generating two new faces each. The spike addition of rsubstitutes F4with a face of
higher degree.
Figure 12. The figure demonstrates the partitioning of face
F
into two, F1and F2,viaGpwhen presides on face
F
.
However, if kin1, node imust be placed in p,thenα1(i)isni. Correspondingly, for
edges, we set β1(i,i+1, e)astheedgeinl(ei)inSym(H). It is clear by construction that h1is
an edge-injective, map-compatible graph homomorphism with the map
M
, properties naturally
inherited from h. In a similar vein, it can be proven that h2is well defined and fulfils the map-
compatibility condition and the edge-injectivity property.
To prove that
M
is planar, we must first show that it is spherical. To see this, we rely on
Theorem 6.4, which allows us to apply the elimination of the propositional truncation to the
evidence that
M
is spherical. This enables us to obtain a walk homotopy for any pair of walks
in Sym(G) sharing endpoints, which is perhaps used henceforth without explicit mention. This
entails that homotopic walks in Sym(G), deforming along faces other than
F
, maintain their
homotopy in Sym(H). Therefore, our focus narrows down to:
(i) the set of walks in Sym(G) deforming along
F
,and
(ii) the set of walks resulting from possible compositions of pwith existing walks in Sym(G).
For both walks originating from set (i), their homotopy is defined by the vertical composition
of homotopies along F1and F2, as referenced in Theorem 6.2, (Prieto-Cubides 2022b, Section 5).
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
Mathematical Structures in Computer Science 33
Figure 13. The figure shows a part of the graph Sym(Gp) embedded in the 2-sphere. As constructed in the proof of
Theorem 6.13, the faces, F1and F2, of the map
M
are given by a face division of
F
by the path p. Such gives rise to new walk
homotopies, as hF1and hF2in the picture. The walk
pfrom uto vis the walk composition of p1,awalkfromuto y,andp2,a
walk from yto v.Thewalksδ1and δ2are walks in Sym(G)fromxto z.
In case (ii), we consider walks without inner loops, following Lemma 5.8 in Prieto-Cubides
(2022b). We examine three subcases without loss of generality, where the walk pfrom uto v
decomposes into p1and p2.Here,p1is a walk from uto node yin Sym(Gp), and p2from y
to v, as shown in Fig. 13. Recall that a walk homotopy for any pair of walks in Sym(G)sharing
endpoints is always accessible by hypothesis.
(a) Either w1,w2, or both, include
pas a subwalk from xto z.Ifw1composes as δ1·
p·δ2,
and
pis not a subwalk of w2,withδ1and δ2being walks in Sym(G) from xto uand vto
z, a homotopy of walks can be obtained as in the calculation below. The remaining cases are
demonstrated similarly:
w1δ1·
p·δ2
w1δ1·ccwF1(u,v)·δ2(By construction of F1)
w1
M
δ1·cwF1(u,v)·δ2(By hcollapse constructor applied to F1,δ1and δ2)
w1δ1·cw
F
(u,v)·δ2(By construction of F1)
w1
M
w2(By hypothesis: walks in Sym(G) are homotopic).
(b) The walks w1and w2from xto yshare a suffix (p1)oraprex(p2). Without loss of gen-
erality, let w1=δ1·p1and w2=δ·p1,whereδis a walk from xto u. These walks are
homotopic in Sym(G) via the spherical map
M
,thatis,δ1
M
δ. The construction of
M
ensures δ1
M
δ. Utilising right whiskering, we deduce δ1·p1
M
δ·p1, thereby reaching
our desired conclusion. Similarly, if w1is p2·δ2and w2is p2·δ,whereδis a walk from vto
z, one can show that δ2
M
δ, and hence δ2·p2
M
δ·p2by left whiskering.
(c) The walks w1and w2from xto ycan be expressed as composites of δ·p1and δ·
p2,respec-
tively. Here, δand δare walks from xto uand xto v, without sharing a common prefix or
suffix subwalk. We aim to show w1
M
w2via F2deformation:
w1δ·
p1
w1δ·cwF2(u,y) (By construction of F2)
w1
M
δ·ccwF2(u,y) (By constructor hcollapse applied to F2,δ1and y)
w1δ·(ccw
F
(u,v)·
p2) (By construction of F2)
w1(δ·ccw
F
(u,v)) ·
p2(By assoc. of walk concat.)
w1
M
δ·
p2(By whiskering applied to the walk htpy. by hyp.)
w1w2.
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
34 J. Prieto-Cubides and H.R. Gylterud
Figure 14. The figure illustrates a planar synthesis for constructing a K4planar map using a C3planar map. Initially, face
F
is divided into F1and F2.Subsequently,F1is split into F3and F4. The resulting map ends up with four faces, including the
outer face.
Concluding our proof of Theorem 6.13,wehaveshownthat
M
extends to a spherical map
M
of Gp. By identifying F1as the outer face, we further establish that
M
is a planar map.
Given that
M
is a planar map, we denote its planar extension derived from Theorem 6.13 by
E(
M
,
F
,u,v,Pn). To shorten the notation, this planar extension is denoted by E(
M
,
F
,p), when
the specifics of u,vand Pnare not really crucial to the discussion. We refer to this as the face
division of
F
by p, since this construction results in the placement of pin
F
, dividing it into two
new faces.
Definition 6.14. For a finite graph G with map
M
, the Euler characteristic χ
M
is defined as the
number v e+f , where v, e and f denote the cardinalities of the sets of nodes, edges and faces,
respectively:
χ
M
:=ve+f. (23)
Theorem 6.15. For a graph G with planar map
M
, any planar extension of
M
maintains Euler’s
characteristic. That is, for any face
F
of
M
and nodes u, v within
F
connected by a path Pn,wehave
χ
M
equals χE(
M
,
F
,u,v,Pn).
Proof. The lemma follows from the construction detailed in the proof of Theorem 6.13.Thepath
addition of Pnbetween nodes uand von face
F
increases the node count by n+1, edges by n+2
and faces by 1, preserving the Euler characteristic.
Euler characteristic serves as a planarity criterion for connected finite graphs. Specifically,
according to Euler’s formula, a graph Gis planar under the map
M
if and only if χ
M
equals
2. The constructions detailed in this section facilitate the verification of Euler’s formula for graphs
constructed via path additions, an approach also employed later for biconnected planar graphs.
However, for arbitrary graphs not derived from graph extensions, validating Eulers formula
remains challenging, primarily due to the non-trivial task of determining the cardinality of the set
of faces for an arbitrary map
M
of a given graph G, that is, computing the set of elements of type
Face(G,
M
)(seeDefinition 5.3). Progress was made by establishing that the type of faces forms a
finite set. This suggests the feasibility of extracting this number in practice, possibly utilising the
employed proof-assistant. We leave this to future work.
6.5 Planar synthesis of graphs
Inductive graph construction methods abound, such as Whitney–Robbins synthesis, ear decom-
position of a graph and the K4construction depicted in Fig. 14. Drawing inspiration from these
methods and face divisions as in Theorem 6.13, we propose a method to build larger planar graphs
using graph extensions, ensuring that we remain within the type of planar graphs.
Definition 6.16. AWhitneysynthesis (synthesis for short) of graph G from graph H is defined as
asequenceofgraphsG
0,G1,··· ,Gn,whereG
0is H, Gnis G, and each Giresults from the path
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
Mathematical Structures in Computer Science 35
Figure 15. The figure illustrates the face division of
F
by a non-simple path addition.
addition of pito Gi1for i in the range 1to n. Consequently, G can be viewed as the result of adding
paths p1,p2,··· ,pnto H:
GHp1p2•···•pn.
The length of this synthesis is n. A simple synthesis refers to a sequence containing only simple
additions. Conversely, a sequence composed solely of non-simple additions is termed a non-simple
synthesis.
Theorem 6.17. Syntheses preserve graph-connectedness. Specifically, if a graph H is connected and
G is synthesised from H, then each intermediate graph Giin the synthesis sequence is also connected.
Proof. We prove this by induction on the length of the synthesis and the fact that path additions
preserve connectedness, Theorem 6.11.
Definition 6.18. Given a planar map
M
of the graph H with outer face
F
,wedeneaplanar
synthesis of G from H of length n as a sequence:
(G0,
M
0,
F
0), (G1,
M
1,
F
1)··· ,(Gn,
M
n,
F
n),
where
(G0,
M
0,
F
0)is equivalent to (H,
M
,
F
),and
(Gn,
M
n)corresponds to (G,E(
M
n1,
F
n1,pn1)).
Foreachiintherange1to n, the graph Giis Gi1pi,andthemap
M
iis E(
M
i1,
F
i1,pi1),
where
F
i1is a face of
M
i1.
Theorem 6.19. If a graph G is synthesised from a planar graph H via planar synthesis, then G and
every graph in the corresponding sequence are planar.
Proof. Through planar synthesis, each Giis derived from Gi1via path addition, ensuring
planarity by Theorem 6.13.
While we have not yet employed non-simple additions, they have become relevant when we
characterise planar biconnected graphs in the next section. It is possible to extend the face divi-
sion theorem and its construction to utilise non-simple additions, Theorem 6.13, allowing us to
adapt not only the planar synthesis in Definition 6.18 to non-simple planar syntheses but also
Theorem 6.19 to accommodate non-simple additions. Hence, given a map
M
for Gwith a face
F
,
the corresponding planar map for Gpis denoted as E(
M
,
F
,p), maintaining a similar notation
as before. As with path additions, extending the map with non-simple additions introduces new
faces.
Taking into account Gu,vSym(Pn)andthemapE(
M
,
F
,p), the number of faces increases to
n+3, the number of nodes increases to v+n+1 and the number of edges increases to 2 ·(n+2),
as illustrated in Figure 15. Consequently, the Euler characteristic of E(
M
,
F
,p) is equal to the
Euler characteristic of
M
.
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
36 J. Prieto-Cubides and H.R. Gylterud
Consequently, the Euler characteristic of E(
M
,
F
,p) is equal to the Euler characteristic of
M
:
χE(
M
,p):≡ (v+(n+1)) (e+2·(n+2)) +(f+(n+3)) χ
M
.
Fig. 13(b) demonstrates the construction of larger planar graphs using various path, cycle and
spike additions. A spike addition to G, although not precisely defined here, as it is not extensively
used for further constructions, can be essentially described as a path addition sharing only one
node with G. With a given map for G, a simple addition of a spike creates a new face of a higher
degree than the face where the spike is inserted. Consequently, non-simple spike additions also
increase the number of faces for the extended map due to the emergence of new faces between
edge pairs that share endpoints.
The remainder of this section aims to characterise the construction of all 2-connected planar
graphs. In general, a graph is k-connected if it cannot be disconnected by removing less than k
nodes. Depending on k, there are various methods to construct the set of k-connected graphs.
For instance, any undirected 2-connected graph can be constructed by applying path additions
to an appropriate cyclic graph (Diestel 2012, Section 3). Our focus in the following will be on the
construction of 2-connected planar graphs.
Definition 6.20. AgraphGisdenedas2-connected, or biconnected, when the proposition
Biconnected(G)holds. This is, when the resulting graph G x, formed by removing a node x from
G, remains connected.
Specifically, G x is the graph made up of the set of nodes, y:NG(x= y), and their corresponding
edges in G:
Biconnected(G):≡
(x:NG)
Connected(Gx).
Theorem 6.21. If G is a cyclic graph, then Sym(G)is 2-connected.
Proof. The cyclic nature of Gensures that in Sym(G), there are two inner loop-free walks between
any pair of nodes: a direct walk following the cycle of Gand a reverse walk counter to the cycle.
These walks are edge-disjoint and thus preserve the graph’s connectivity despite the removal
of any single node-only one of the walks might be affected, leaving the other intact to sustain
connectedness.
The property of 2-connectedness in a graph does not remain invariant under simple path addi-
tions. Clearly, removing a node from the added path pdisconnects Gp. Yet, through non-simple
path additions, it is possible to maintain and even augment 2-connected graphs.
Theorem 6.22. Let G denote a 2-connected graph. The graph extensions, G pandSym(G)p,
preserve the 2-connected graph property.
Proof. To show that Gu,vSym(Pn)xremains connected for any node xin Gp, we consider
the location of x.Ifxis within G,thenGxis connected by hypothesis. Applying Theorem 6.11,
it follows that Gpxis also connected, showing the 2-connectivity of Gp. Otherwise, if xlies
on p, its removal divides pinto two parts, p1and p2. For any two nodes in Gpx, we show they
are connected. If both nodes are in Gor the same part pi, they are connected by prior arguments
or direct traversal, respectively. If they are located in distinct subgraphs, say xis in p1and yis in
p2. We can construct a walk from xto u, another walk across Gfrom uto v(since Gis connected),
and then to the second node, Hence, Gpmaintains 2-connectivity.
Inspired by Yamamoto’s work (Yamamoto et al. 1995), our focus is on the construction of 2-
connected planar graphs. Within a different theoretical setting (HOL) and using a different graph
definition, Yamamoto shows that any undirected 2-connected planar graph can be inductively
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
Mathematical Structures in Computer Science 37
built by adding diverse paths to circuits (their term for cyclic graphs). In our context, we initi-
ate constructions with any 2-connected graph Sym(Cn) and subsequently extend these graphs by
non-simple planar additions.
Theorem 6.23. In a non-simple Whitney synthesis of G originating from a 2-connected graph H,
with planarity ensured by a map
M
, each graph in the synthesis maintains 2-connectivity and
planarity via planar extension of
M
using non-simple additions.
Proof. Assuming a non-simple Whitney synthesis of Gfrom Hof length nis given, we proceed by
induction on n.
Base case (n=0). The graph Gis H,andbyhypothesis,His a 2-connected planar graph.
Thus, the conclusion follows.
Inductive step. For the inductive step, we assume that the claim holds for a sequence of
length n, thus establishing Gnas a 2-connected planar graph via map
M
n. We then aim to
demonstrate that G,denedasGnpifor some path pi, also qualifies as a 2-connected planar
graph.
Given that Gnis 2-connected, it follows from Theorem 6.22 that Gnpialso retains this
property. We then extend the planar map
M
nof Gnto a planar map
M
for G,preserving
the outer face or selecting a new outer face from the additions. This construction of
M
fol-
lows the method in Theorem 6.13, where we expand planar maps using simple additions, as
required here.
Theorem 6.24. Any graph synthesised from Sym(Cn)through non-simple Whitney syntheses is a
2-connected planar graph.
Proof. Given that Cnis planar by Example 6.8 and consequently connected, Sym(Cn)is2-
connected by Theorem 6.21. By repeatedly applying Theorem 6.23 to each step in the given
synthesis sequence, we ensure the resulting graphs 2-connectivity and planarity.
Lemma 3 and Proposition 4 in Yamamoto et al. (1995) discuss undirected 2-connected pla-
nar graphs similar to the converse of Theorem 6.24. It is possible to follow Yamamoto’s argument
closely, even though it was presented in an informal way. However, this requires preliminary for-
malisation of several technicalities, such as maximal subgraphs, adjacent faces and edge sequence
deletion. Subsequently, one can assert that non-simple Whitney syntheses entirely determine 2-
connected planar graphs, as expressed similarly in Diestel (2012, Section 3). In essence, any graph
defined as planar in Definition 6.6 and 2-connected in Definition 6.20 can be inductively generated
from Sym(Cn) via iterative non-simple path additions and proper map extensions.
Further exploration of graph extensions, such as amalgamations, appendages, deletions, con-
tractions and subdivisions, should be considered to generate planar graphs (Gross et al. 2018,
Section 7.3).
7. Related Work
The study of planar graphs and more general graph-theoretic topics can be found in relevant
projects and large libraries formalised in Coq (Doczkal and Pous 2020), Isabelle/HOL (Noschinski
2015), and most recently, in Agda (Rijke et al. 2023), and Lean (The Mathlib Community 2020).
Examples of notable projects on the subject include the formal proof of the Four-Colour Theorem
(FCT) in Coq (Gonthier 2008), the proof of the discrete form of the Jordan Curve Theorem in
Coq (Dufourd and Puitg 2000), and the verification of Kepler’s Conjecture in HOL (Hales et al.
2017).
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
38 J. Prieto-Cubides and H.R. Gylterud
Different approaches have been proposed to address the planarity of graphs in formal systems.
These works use different mathematical objects depending on the system. We use combinato-
rial maps in this work, but other related constructions are, for example, root maps defined in
terms of permutations (Dubois et al. 2016) and hypermaps (Dufourd 2009; Dufourd and Puitg
2000; Gonthier 2008), among others. In particular, one can see that the notion of a hypermap is a
generalisation of a combinatorial map for undirected finite graphs. Such a concept is one funda-
mental construction to formalise mathematics of graph maps amongst in theorem provers, along
with the computer-checked proof of FCT. Additionally, Dufourd states and proves the Euler’s
polyhedral formula and the Jordan Curve Theorem using an inductive characterisation of hyper-
maps (Dufourd 2009; Dufourd and Puitg 2000). Recently, for a more standard representation of
finite graphs, Doczkal proved that, according to his notion of a plane map based on hypermaps,
every K3,3-free graph and K5-free graph without isolating nodes is planar, a direction of Wagner’s
theorem (Doczkal 2021).
An alternate strategy for planar graphs is to build them iteratively. For example, in Yamamoto
et al. (1995), the authors showed that any biconnected and finite planar graph can be decomposed
as a finite set of cycle graphs, where every face is the region bounded by a closed walk (Gross
et al. 2018, Sections 5.2, 7.3). This construction defines an inductive data type that begins with a
cycle graph Cnserving as the base case, and by repeatedly merging new instances of cycle graphs,
one gets the final planar graph. Bauer formalises in Isabelle/HOL a similar construction of planar
graphs from a set of faces (Bauer and Nipkow 2002;Bauer2005). A related approach in our setting
is of the treatment of planar graph extensions, as described in Section 6.4.
To our knowledge, previous work in type theory related to graph planarity has been conducted
within different formal systems and for distinct classes and notions of graphs. These studies
predominantly define planarity for undirected finite graphs. In contrast, our definition encom-
passes the broader class of connected and locally finite directed multigraphs. Our research aligns
more closely with the foundations of mathematics, particularly the formalisation of mathemat-
ics in HoTT, rather than the practical aspects of graph theory. This necessitates proposing new
constructs, occasionally even for the most fundamental concepts within the theory.
8. Concluding Remarks
This document is a case study of graph-theoretic concepts in constructive mathematics using
HoTT. An elementary characterisation of planarity of connected and locally finite directed multi-
graphs is presented in Section 6.3. We collected all the maps of a graph in the two-dimensional
plane identified up to isotopy in a homotopy set, see Theorem 6.7. The type of these planar
maps displays some of our main contributions, for example, the type of spherical maps stated in
Definition 6.3 and the type of faces for a given map in Definition 5.3.Asfarasweknow,thepre-
sentation of these types in a dependent type theory like HoTT is novel. For example, besides its
rather technical definition, we believe the type of faces encodes in a better combinatorial way the
essence of the topological intuition behind it, rather than, being defined as simply cyclic lists of
nodes, as by other authors (Bauer 2005; Gonthier 2008; Yamamoto et al. 1995), see Section 5.We
did not include a proof that the type of faces of a map of a finite graph is finite. We omitted it here
due to its technical complexity, involving multiple applications of finiteness results and identifica-
tion of convenient equivalences. This detailed proof is included in an upcoming thesis by the first
author, an extended version of this work and related formalisations in Agda.
Additionally, as a way to construct planar graphs inductively, we presented extensions for pla-
nar maps. We demonstrated that any cycle graph is planar, and by means of planar extensions
such as path additions, one can construct larger planar graphs; for example, to illustrate this
approach, a planar map for K4using simply path additions from a planar map of C3is illustrated
in Fig. 14. Other relevant notions for this work are cyclic types, cyclic graphs, homotopy for walks
(Prieto-Cubides 2022b) and spherical maps.
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
Mathematical Structures in Computer Science 39
We chose HoTT as the reasoning framework to directly study the symmetry of our mathemat-
ical constructions. Many of the proofs supporting our development could only be constructed by
adopting the UA, a main principle in HoTT. A primary example of using Univalence in this paper
is the structural identity principle for graphs, as stated in Theorem 3.7.
Another contribution of this work includes the (computer-checked) proofs. Not all but the
relevant concepts in this document have been formalised in the proof assistant Agda, in a fully self-
contained development (Prieto-Cubides 2022a). However, for technical reasons, the formalisation
of Example 6.8 and further in-depth studies on the main results in Section 6.4 like Theorems 6.13
and 6.24 are left for future work.
This work can serve as a starting point for further developments of graph theory in HoTT or
related dependently typed theories. We expect further research to provide other interesting results,
such as the equivalences between different characterisations of planarity for graphs, for example,
the Kuratowski’s and Wagner’s characterisations for planar graphs, and the realisation of planar
graphs defined via HITs.
Acknowledgements. We express our gratitude to the anonymous reviewers and Marc Bezem, whose insightful comments
significantly enhanced this paper. Our thanks also extend to the organisers of TYPES2019 and the referees for their valuable
critique on our initial presentation of the backbone of this work. The first author would like to express appreciation to the
organisers of the Midlands Graduate School 2019 and particularly to Noam Zeilberger for engaging discussions on rooted
maps, planarity criteria and an early version of this work. Thanks to Benjamin Chetioui and Tam Thanh Truong for their
assistance in proofreading earlier drafts. Lastly, we acknowledge the unwavering support of the Agda Team in maintaining
the Agda proof assistant.
References
Ahrens, B. and North, P. R. (2019). Univalent Foundations and the Equivalence Principle, Cham, Springer International
Publishing, 137–150. https://doi.org/10.1007/978-3- 030-15655- 8_6
Ahrens, B., North, P. R., Shulman, M. and Tsementzis, D. (2020). A higher structure identity principle. In: Proceedings of
the 35th Annual ACM/IEEE Symposium on Logic in Computer Science,ACM. https://doi.org/10.1145/3373718.
3394755
Appel, K. and Haken, W. (1986). The four color proof suffices. The Mathematical Intelligencer 8(1) 10–20. https://doi.
org/10.1007/bf03023914
Archdeacon, D. (1996). Topological graph theory a survey. Congressus Numerantium 115 115–5.
Avigad, J. and Harrison, J. (2014). Formally verified mathematics. Communications of the ACM 57 (4) 66–75.
Awodey, S. (2012). Type theory and homotopy. In: Epistemology versus Ontology, Pitt, USA, Springer Netherlands, 183–201.
https://doi.org/10.1007/978-94- 007-4435- 6_9
Awodey, S. (2018). Univalence as a principle of logic. Indagationes Mathematicae 29 (6) 1497–1510. https://doi.org/
10.1016/j.indag.2018.01.011
Baez, J. C., Hoffnung, A. E. and Walker, C. D. (2009-08). Higher-dimensional algebra VII: groupoidification. Theory and
Applications of Categories 24 489–553. http://arxiv.org/abs/0908.4305
Bang-Jensen, J. and Gutin, G. Z. (2009). Digraphs, London, UK, Springer London. https://doi.org/10.1007/
978-1- 84800-998- 1
Bauer, G. and Nipkow, T. (2002). The 5 colour theorem in Isabelle/Isar. In: Carreño, V. A., Muñoz, C. A. and Tahar,
S. (eds.) Theorem Proving in Higher Order Logics, 15th International Conference, TPHOLs 2002, Hampton, VA, USA,
August 20–23, 2002, Proceedings, Berlin, Heidelberg, Springer Berlin Heidelberg, 67–82. https://doi.org/10.1007/
3-540- 45685-6_6
Bauer, G. J. (2005). Formalizing Plane Graph Theory: Towards a Formalized Proof of the Kepler Conjecture. Phd Dissertation,
Technische Universität München, Germany. https://mediatum.ub.tum.de/doc/601794/document.pdf
Baur, M. (2012). Combinatorial Concepts and Algorithms for Drawing Planar Graphs. Phd Dissertation, Universität Konstanz,
Konstanz. http://nbn-resolving.de/urn:nbn:de:bsz:352- 202281
Bezem, M., Buchholtz, U., Cagne, P., et al. (2022). Symmetry. https://github.com/UniMath/SymmetryBook. Commit:
870cb20.
Cockx, J., Devriese, D. and Piessens,F. (2016). Eliminating dependent pattern matching without K. Journal of Functional
Programming 26 e16. https://doi.org/10.1017/s0956796816000174
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
40 J. Prieto-Cubides and H.R. Gylterud
Coquand, T. and Danielsson, N. A. (2013). Isomorphism is equality. Indagationes Mathematicae 24 (4) 1105–1120. https://
doi.org/10.1016/j.indag.2013.09.002
Diestel, R. (2012). Graph Theory, 4th ed., Graduate Texts in Mathematics, vol. 173, Hamburg, Germany, Springer. https://
doi.org/10.1007/978-3- 662-53622- 3
Doczkal, C. (2021). A Variant of Wagner’s Theorem Based on Combinatorial Hypermaps. https://hal.
archives-ouvertes.fr/hal- 03142192, working paper or preprint.
Doczkal, C. and Pous, D. (2020). Graph theory in Coq: minors, treewidth, and isomorphisms. Journal of Automated Reasoning
64 (5) 795–825. https://doi.org/10.1007/s10817-020- 09543-2
Dubois, C., Giorgetti, A. and Genestier, R. (2016). Tests and proofs for enumerative combinatorics. In: Aichernig, B. K.
andFuria,C.A.(eds.)Tests and Proofs - 10th International Conference, TAPSTAF 2016, Vienna, Austria, July 5–7, 2016,
Proceedings,(Lecture Notes in Computer Science, vol. 9762), Vienna, Austria, Springer, 57–75. https://doi.org/10.
1007/978-3- 319-41135- 4_4
Dufourd, J. F. (2009). An intuitionistic proof of a discrete form of the Jordan curve theorem formalized in Coq with combina-
torial hypermaps. Journal of Automated Reasoning 43 (1), 19–51. https://doi.org/10.1007/s10817-009- 9117-x
Dufourd, J.-F. and Puitg, F. (2000). Functional specification and prototyping with oriented combinatorial maps.
Computational Geometry 16 (2) 129–156. https://doi.org/10.1016/S0925-7721(00)00004-3
Ellis-Monaghan, J. and Moffatt, I. (2013). Graphs on Surfaces: Dualities, Polynomials, and Knots, 1 ed., New York, NY,
Springer.
Escardó, M. (2018). A self-contained, brief and complete formulation of Voevodsky’s Univalence Axiom.
arXiv:1803.02294 [math.LO]. https://arxiv.org/abs/1803.02294
Escardó, M. (2019). Introduction to Univalent Foundations of Mathematics with Agda. arXiv:1911.00580. http://arxiv.
org/abs/1911.00580
Gonthier, G. (2008). The four colour theorem: engineering of a formal Proof. In: Computer Mathematics, Springer Berlin
Heidelberg, 333–333. https://doi.org/10.1007/978-3- 540-87827- 8_28
Gross, J. L. and Tucker, T. W.. 1987. Topological Graph Theory, New York, John Wiley & Sons Inc., xvi+351 pp. . A
Wiley-Interscience Publication.
Gross, J., Yellen, J. and Anderson, M. (2018). GraphTheoryandItsApplications, NY, USA, Chapman and Hall/CRC.
https://doi.org/10.1201/9780429425134
Hales, T., Adams, M., Bauer, G., et al. (2017). A formal proof of the kepler conjecture. Forum of Mathematics, Pi 5e2.
https://doi.org/10.1017/fmp.2017.1
Harrison, J. (2008). Formal proof theory and practice. Notices of the American Mathematical Society 55 1395–1406.
MacLane,S. (1937). A combinatorial condition for planar graphs.
Mohar, B. (1988). Embeddings of infinite graphs. Journal of Combinatorial Theory, Series B 44 (1) 29–43. https://doi.
org/10.1016/0095-8956(88)90094- 9
Norrell, U. (2007). Towards a practical programming Language Based on Dependent Type Theory. Phd thesis, Chalmers
University of Technology. https://research.chalmers.se/en/publication/46311
Noschinski, L. (2015). Formalizing Graph Theory and Planarity Certificates. Phd Dissertation, Technischen Universität
München, Germany. https://d-nb.info/1104933624/34
Prieto-Cubides, J. (2022a). Agda Formalisation.https://doi.org/10.5281/zenodo.5775569. Agda Formalisation.
Prieto-Cubides, J. (2022b). On homotopy of walks and spherical maps in homotopy type theory. In: Proceedings of the 11th
ACM SIGPLAN International Conference on Certified Programs and Proofs (Philadelphia, PA, USA), (CPP 2022),New
York, NY, USA, Association for Computing Machinery, 338–351. https://doi.org/10.1145/3497775.3503671
Rahman, Md. S. (2017). Planar Graphs, Cham, Springer International Publishing, 77–89. https://doi.org/10.1007/
978-3- 319-49475- 3_6
Rijke, E., Bonnevier, E., Prieto-Cubides, J., Bakke, F., et al. (2023). Univalent mathematics in Agda.https://github.com/
UniMath/agda-unimath/
Stahl, S. (1978). The embeddings of a graph–a survey. Journal of Graph Theory 2(4) 275–298. https://doi.org/10.
1002/jgt.3190020402
The Agda Development Team. (2023). Agda 2.6.3 documentation. https://agda.readthedocs.io/en/v2.6.3/
The Mathlib Community. (2020). The lean mathematical library. In: Proceedings of the 9th ACM SIGPLAN International
Conference on Certified Programs and Proofs (New Orleans, LA, USA) (CPP 2020),NewYork,NY,USA,Associationfor
Computing Machinery, 367–381. https://doi.org/10.1145/3372885.3373824
The Univalent Foundations Program. (2013). Homotopy Type Theory: Univalent Foundations of Mathematics,https://
homotopytypetheory.org/book, Institute for Advanced Study.
Voevodsky, V. (2010). The equivalence axiom and univalent models of type theory. (Talk at CMU on February 4, 2010),
1–11 pp. https://arxiv.org/abs/1402.5556
Whitney, H. (1932). Non-separable and planar graphs. Transactions of the American Mathematical Society 34 (2) 339–339.
https://doi.org/10.1090/s0002-9947- 1932-1501641- 2
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
Mathematical Structures in Computer Science 41
Yamamoto, M. Nishizaki, S., Hagiya, M., et al. (1995). Formalization of planar graphs. In: Thomas Schubert, E., Windley,
P. J. and Alves-Foss, J. (eds.) Higher Order Logic Theorem Proving and Its Applications, 8th International Workshop, Aspen
Grove, UT, USA, September 11–14, 1995, Proceedings, Vol. 971, Lecture Notes in Computer Science, Ut, USA, Springer,
369–384. https://doi.org/10.1007/3-540- 60275-5_77
Yorgey, B. A. (2014). Combinatorial Species and Labelled Structures. Phd Dissertation, University of Pennsylvania, PA, USA.
https://www.cis.upenn.edu/~sweirich/papers/yorgey-thesis.pdf
Cite this article: Prieto-Cubides J and Gylterud HR (2024). On planarity of graphs in homotopy type theory. Mathematical
Structures in Computer Science.https://doi.org/10.1017/S0960129524000100
https://doi.org/10.1017/S0960129524000100 Published online by Cambridge University Press
... The topological graph theory approach inspires our definition of a combinatorial notion of embedding/map in the sphere for graphs [23], referred to as spherical maps in this paper, see Definition 5.4. A graph map can be described by the graph itself and the circular ordering of the edges incident to each vertex [10, §3]. ...
... Given a map M, the faces of M are the regions obtained by the cellular decomposition of the corresponding surface by M. We omit the formal type of faces herein, so as not to distract the reader from the goals of this paper. The type of faces requires proper attention [23]. Put briefly, a face is a cyclic walk in the embedded graph without repeating nodes and without edges inside [10]. ...
... Later, we show an alternative definition for graphs with a node set in Definition 5.5. Given a distinguished face in a connected graph, being spherical for a graph embedding serves to establish elementary planarity criteria for graphs [23]. ...
... The topological graph theory approach inspires our definition of a combinatorial notion of embedding/map in the sphere for graphs [23], referred to as spherical maps in this paper, see Definition 5.4. A graph map can be described by the graph itself and the circular ordering of the edges incident to each vertex [10, §3]. ...
... Given a map M, the faces of M are the regions obtained by the cellular decomposition of the corresponding surface by M. We omit the formal type of faces herein, so as not to distract the reader from the goals of this paper. The type of faces requires proper attention [23]. Put briefly, a face is a cyclic walk in the embedded graph without repeating nodes and without edges inside [10]. ...
... Later, we show an alternative definition for graphs with a node set in Definition 5.5. Given a distinguished face in a connected graph, being spherical for a graph embedding serves to establish elementary planarity criteria for graphs [23]. ...
Preprint
Full-text available
We work with combinatorial maps to represent graph embeddings into surfaces up to isotopy. The surface in which the graph is embedded is left implicit in this approach. The constructions herein are proof-relevant and stated with a subset of the language of homotopy type theory. This article presents a refinement of one characterisation of embeddings in the sphere, called spherical maps, of connected and directed multigraphs with discrete node sets. A combinatorial notion of homotopy for walks and the normal form of walks under a reduction relation is introduced. The first characterisation of spherical maps states that a graph can be embedded in the sphere if any pair of walks with the same endpoints are merely walk-homotopic. The refinement of this definition filters out any walk with inner cycles. As we prove in one of the lemmas, if a spherical map is given for a graph with a discrete node set, then any walk in the graph is merely walk-homotopic to a normal form. The proof assistant Agda contributed to formalising the results recorded in this article.
Article
Introduction: Increasing network communication area has lot of unstructured routing to create complex structures. The communication structure is non-linear to create connective edges to degrade the communication performance. Many non-linear solutions and distance theory models contains maximum non-liability of variables are taken to solve the problems. But structure difference and dynamic variables are constantly applied to make solution which leads errors and complex solutions. To resolve this problem, to propose a Redundant mathematical solution for complex homotopy structures using Multinomial-Cordial Graph Theory (MCGT) based on Bipartite Chromatic Polynomial Distribution Theory (BCPDT) for solving distance problems. To apply neighbor-based distance coverage model with cordial labeling variable structure to reduce the complexity variable structure problems, this paper explores a novel strategy for encapsulating the non-linear complex homotopy in its entirety by employing graph theory and the concept of cordial labeling. By establishing a connection between algebraic topology and graph theoretical constructs, we formulate a redundant solution that illuminates the intricacies of complex homotopy but also provides practical methodologies for solving distance-related issues prevalent in various mathematical and applied fields as well, compared to the previous models.
Article
Full-text available
We present a library for graph theory in Coq/Ssreflect. This library covers various notions on simple graphs, directed graphs, and multigraphs. We use it to formalize several results from the literature: Menger’s theorem, the excluded-minor characterization of treewidth-two graphs, and a correspondence between multigraphs of treewidth at most two and terms of certain algebras.
Article
Full-text available
In introductions to the subject for a general audience of mathematicians or logicians, the univalence axiom is typically explained by handwaving. This gives rise to several misconceptions, which cannot be properly addressed in the absence of a precise definition. In this short set of notes we give a complete formulation of the univalence axiom from scratch. The underlying idea of these notes is that they should be as concise as possible (and not more). They are not meant to be an Encyclopedia of Univalence.
Chapter
In this paper, we explore the ‘equivalence principle’ (EP): roughly, statements about mathematical objects should be invariant under an appropriate notion of equivalence for the kinds of objects under consideration. In set theoretic foundations, EP may not always hold: for instance, ‘1N1 \in \mathbb {N}’ under isomorphism of sets. In univalent foundations, on the other hand, EP has been proven for many mathematical structures. We first give an overview of earlier attempts at designing foundations that satisfy EP. We then describe how univalent foundations validates EP.
Article
It is sometimes convenient or useful in mathematics to treat isomorphic structures as the same. The recently proposed Univalence Axiom for the foundations of mathematics elevates this idea to a foundational principle in the setting of homotopy type theory. It provides a simple and precise way in which isomorphic structures can be identified. We explore the motivations and consequences, both mathematical and philosophical, of making such a new logical postulate.
Book
This standard textbook of modern graph theory, now in its fifth edition, combines the authority of a classic with the engaging freshness of style that is the hallmark of active mathematics. It covers the core material of the subject with concise yet reliably complete proofs, while offering glimpses of more advanced methods in each field by one or two deeper results, again with proofs given in full detail. The book can be used as a reliable text for an introductory course, as a graduate text, and for self-study. From the reviews: “This outstanding book cannot be substituted with any other book on the present textbook market. It has every chance of becoming the standard textbook for graph theory.”Acta Scientiarum Mathematiciarum “Deep, clear, wonderful. This is a serious book about the heart of graph theory. It has depth and integrity. ”Persi Diaconis & Ron Graham, SIAM Review “The book has received a very enthusiastic reception, which it amply deserves. A masterly elucidation of modern graph theory.” Bulletin of the Institute of Combinatorics and its Applications “Succeeds dramatically ... a hell of a good book.” MAA Reviews “A highlight of the book is what is by far the best account in print of the Seymour-Robertson theory of graph minors.” Mathematika “ ... like listening to someone explain mathematics.” Bulletin of the AMS
Article
Dependent pattern matching is an intuitive way to write programs and proofs in dependently typed languages. It is reminiscent of both pattern matching in functional languages and case analysis in on-paper mathematics. However, in general, it is incompatible with new type theories such as homotopy type theory (HoTT). As a consequence, proofs in such theories are typically harder to write and to understand. The source of this incompatibility is the reliance of dependent pattern matching on the so-called K axiom – also known as the uniqueness of identity proofs – which is inadmissible in HoTT. In this paper, we propose a new criterion for dependent pattern matching without K, and prove it correct by a translation to eliminators in the style of Goguen et al . (2006 Algebra, Meaning, and Computation ). Our criterion is both less restrictive than existing proposals, and solves a previously undetected problem in the old criterion offered by Agda. It has been implemented in Agda and is the first to be supported by a formal proof. Thus, it brings the benefits of dependent pattern matching to contexts where we cannot assume K, such as HoTT.