On Planarity of Graphs in Homotopy Type Theory

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. 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 homotopy type theory.


INTRODUCTION
Topological graph theory studies the embedding of graphs into surfaces [4,25,37] such as: the plane, the sphere, the torus, etc.Even the simplest case, embedding graphs into the plane, has inspired a lot of interesting characterisations and mathematical results.Two such characterisations are Kuratowski's theorem and the closely related Wagner's theorem [15,36].Both theorems characterise planarity by excluding two sub graphs known as the forbidden minors, namely  5 and  3,3 .Other approaches refer to algebraic methods as MacLane's Theorem [31] and Schnyder's theorem [12, §3.3].
One of the most powerful tools in topological graph theory is the combinatorial representation of graph embeddings, called rotation systems [25].These representations encode what the embedding looks like around each node -characterising the embedding up to isotopy.Section 4 will give a more detailed description of rotation systems.For now, it suffices to know that for suitably 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.
Homotopy type theory (HoTT) [39] is a variation of dependent type theory which emphasises the higher dimensional structure of types: 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 are.
The goal of this paper is to develop a proof-relevant notion of planar graphs in homotopy type theory, based on rotation systems.In other words, planarity is a structure on a graph, not a mere property.Intuitively, a proof that a graph is planar is an embedding into the plane.The question is then, when are two such embeddings equal?One good answer is that the proofs ought to be equal when the embeddings are isotopic -i.e. can be deformed continuous to one another without crossing edges.This will be the case for the notion presented here.But in order to arrive at a type of graph embeddings where the identity type corresponds to isotopy, a lot of care has to be taken when defining embeddings, and planarity.
In short, a planar graph will be a graph with a combinatorial embedding into the sphere and a fixed face where to puncture, as in Figure 1.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 symbolising infinity (in any direction) on the plane.Up to isotopy, the important data when choosing a point of puncture is which face the points lies in.
Our development here differs from other related works in the subject (see Section 6), essentially by adopting the Voevodsky's Univalence axiom (UA) present in HoTT.One consequence is that the graphs maintain the structural identity principle, i.e. isomorphic graphs are equal and share the same structures and properties.Such a correspondence turns to be crucial for formalising mathematics, as in standard mathematical practice.For example, the identity type of a graph helps us to understand its symmetries.Any automorphism of a graph gives rise to an inhabitant of its identity type and vice versa.One can then describe the group structure of the set of automorphisms for a graph by studying its identity type [26, §11], see Section 3.6.We foresee an exciting opportunity to combine ideas and prove results in combinatorics, graph theory, and homotopy type theory.
Outline.Section 2 introduces the basic terminology and notation used throughout the paper.In Section 3, the category of graphs is described, along with a few relevant examples.In Section 4, we present different types for graph-theoretic concepts, including the type of maps, faces, and spherical maps, which allows us to define in HoTT the notion of planar maps, and consequently, planar graphs in Section 5. Additionally, to construct larger planar graphs, the planarity for cyclic graphs and graph extensions are proved.Section 6 addresses the connection of this work with other developments.A few concluding remarks and future work are discussed in Section 7.
Formalisation.One exciting feature to work with systems such as HoTT is producing machineverified proofs [29].To check the correctness of this work, we use the proof assistant Agda [38], a computer system with support for dependent type theories capable of managing the same abstraction level with which we reason our mathematical theories on paper.Formal machineverified proofs can offer a window to new proofs and theorems [5].Moreover, they also serve to find flaws and corner cases that human reasoning might not see.We must therefore, pay special Proc.ACM Program.Lang., Vol. 1, No. X, Article 1. Publication date: December 2022.attention to definitions and theorems, as they are the primary input to these systems.The computer's formalisation process is an exciting and challenging activity, full of details and technical issues [3,23].We use Agda v2.6.2 to type-check the formalisation [34] of the essential parts of this paper.To be compatible with HoTT, we use the flag without-K [13] and the flag exact-split to ensure all clauses in a definition are definitional equalities.

MATHEMATICAL FOUNDATION
In this paper, we work with homotopy type theory [24,39]: a Martin-Löf intensional intuitionistic type theory extended with the Univalence Axiom [7,21], proposed originally by Voevodsky [40], and some higher inductive types (HITs), such as propositional truncation.The presentation of our constructions is informal in the style of the HoTT book [39].However, the essential constructions have been verified in the proof assistant Agda [34].
HoTT emphasises the rôle of the identity type as a path-type [6].The intended interpretation is that elements, ,  ′ : , are points and that a witness of an equality  :  =  ′ is a path from  to  ′ in .Since the identity type again is a type, we can iterate the process, which gives each type the structure of an ∞-groupoid.
This may at first seem of little relevant when working with finite combinatorics, as one would expect only types with trivial path-types (sets) to show up in combinatorics.But we will see that types with nontrivial path types do indeed arise naturally in combinatorics -which is not surprise for someone familiar with the role of groups and groupoids in this field, such as Joyal's work on combinatorial species [8,43]-and that the paths in these types are often various forms of permutations.
• The type U is an univalent universe.The notation  : U indicates that  is a type.To state that  is of type  we write  : .• The equality sign of the identity type of  is denoted by (=  ).If the type  can be inferred from the context, we simply write (=).The equalities between ,  :  are of type  =  .• The type of non-dependent function between  and  is denoted by  → .
• Type equivalences are denoted by (≃).The canonical map for types is idtoequiv : • The universe U is closed under the type formers considered above.
• The function transport/substitution is denoted by tr.We denote by tr 2 the function of type For the sake of readability in the upcoming section, we will use variables ,  and  to denote types, unless stated otherwise.

Homotopy Levels
The following establishes a level hierarchy for types with respect to the nontrivial homotopy structure of the identity type.The first four homotopy levels are of special interest for this work.These four levels are enough for expressing the mathematical objects we want to construct.
Definition 2.1.Let  be an integer such that  ≥ −2.One states that a type  is an -type and that it has homotopy level  if the proposition is-level(, ) holds.
For convenience of the presentation, one states that a type of homotopy level (−2) is a contractible type, a level (−1) is a proposition, a level (0) is a set, and finally, the level (1) is a 1-groupoid.We also define isProp() :≡ is-level(−1, ) and isSet() :≡ is-level(0, ).Types that are propositions are of type hProp and similarly with the other levels.Additionally, it is possible to have an -type out of any type  for  ≥ 2. This can be done using the construction of a higher inductive type called -truncation [39, §7.3] denoted by ∥∥  .The case for (−1)-truncation is called propositional truncation (or reflection), and is often simply denoted by ∥∥.Definition 2.2.Propositional truncation of a type  denoted by ∥∥ −1 is the universal solution to the problem of mapping  to a proposition .The elimination principle of this construction gives rise a map of type ∥∥ →  which requires a map  :  →  and a proof that  is a proposition.
Propositional truncation allows us to model the mere existence of inhabitants of type .We state that  is merely equal to  when ∥ =  ∥ for ,  : .Then, we can express in HoTT by means of propositional truncation: logical conjunction 1 , the disjunction 2 , and existential 3 quantification.
Definition 2.3.Given  : , the connected component of  in  is the collection of all  :  that are merely equal to , i.e.Σ : ∥ =  ∥.If ∥ =  ∥, one says that  is connected to .
Definition 2.4.The type  is called connected if ∥∥ holds and also, if all  :  belong to the same connected component.Lemma 2.5.Terms in the same connected component share the same propositional properties.If  :  → hProp and ,  :  are connected in  then one gets the equivalence  () ≃  ().

Finite Types
The finiteness of a type  is the existence of a bijection between  and the type [] for some  : N.However, this description is not a structure on , providing it with a specific equivalence  ≃ [], 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.
Proof.Let (, ), (, ) : isFinite( ), which we want to prove equal.Since  and  are elements of a family of propositions, it is sufficient to show that  = .This equation is a proposition, so we can apply the truncation-elimination principle to get  ≃ [] and  ≃ [].Thus, from [] ≃ [𝑚] follows that  =  -by a well-known result on finite sets.□ A type  is finite if isFinite( ) holds.The natural number  is referred as the cardinal number of  .Now, since isFinite( ) is a proposition, the total type of finite types,  :U isFinite( ), has permutations as its identity type.This shows that Definition 2.6 is equivalent to the type ∃ : ( = []).However, the former definition allows us to easily obtain  by projecting on the first coordinate.We find this distinction more practical than the latter for certain proofs, as in Lemma 2.11.Furthermore, one can show that any property on [], for example, "being a set" and "having decidable equality" can be transported to any finite type.

Cyclic Types
The notion of being a cycle for a type is not a property but a structure.The description of such a structure can be addressed in several ways.For example, one can state that a type is cyclic if it has a cycle order, i.e. there exists a (ternary) relation on the type for which the axioms of a cyclic ordering hold true [27].In our approach, Definition 2.8, we establish that being cyclic for a type is a structure given by preserving the structure of cyclic subgroups of permutations on [].
As with natural numbers, we can define counterpart functions for the successor and the predecessor in [] if  ≥ 1.The predecessor function pred, of type [] → [], can be defined as the mapping: 0 ↦ → ( − 1) and ( + 1) ↦ → .The corresponding succ function is the inverse of pred, and they are therefore both equivalences.The pred function generates a cyclic subgroup (of order ) of the group of permutations on [].An equivalent cyclic subgroup can be defined by means of the succ function; however, pred is more straightforward to define than succ.Now, we want to mirror the structure of [] given by pred for any finite type  along with an endomap  :  → .This can be done by establishing a structure-preserving map between (, ) and ([], pred) in the category of endomaps of sets.This is the idea behind Definition 2.8 and the fact that the condition structure-preserving can be attained.
A cyclic structure on a type  is denoted by a triple ⟨,  , ⟩ where ( , , -) : Cyclic().Given such a triple, we can refer to  as an -cyclic type.By Lemmas 2.9 and 2.10, one can prove that the -cyclic type  is not only a finite set, but the function  is a bijection.To avoid any confusions, we denote  by pred  and the inverse by suc  .One may also drop the previous sub-indices.To define such bijections as products of cycles, we use the same notation from group theory.For example, the permutation denoted by () () permutes  and  and fixes .Lemma 2.9.Let  be a family of propositions of type In any finite type, every element is searchable.In particular, given an -cyclic type ⟨,  , ⟩, one can search any element by iterating at most  times, the function  on any other element.Lemma 2.11.If  is an -cyclic type, then there exists a unique number  with  <  such that pred   () =  for all ,  : .The total type, :U Cyclic(), is the classifying type [30, §4.6-7] of finite cyclic groups.In the remaining of this section we compute the identity type between two finite cyclic types that we use, for example, in Example 4.13 to enumerate the maps of the bouquet graph  2 .
Lemma 2.12.The type Cyclic() is a set.Lemma 2.13.Given A and B defined by ⟨,  , ⟩ and ⟨, , ⟩, Proof.We show the equivalence by Calculation (2.1).In Equivalence (2.1a), we expand the cycle type definition for A and B. Equivalence (2.1b) follows from the characterisation of the identity type between pairs in a Σ-type [39, §3.7].Note that in Equivalence (2.1b), the type ( = ) × ( = ) is a contractible type, i.e. equivalent to 1, the one-point type.We can then simplify the inner Σ-type to its base in Equivalence (2.1c) to obtain by the equivalence Σ : 1 ≃ , Equivalence (2.1d).Finally, Equivalence (2.1e) is a consequence of transporting functions along the equality .The conclusion is that the identity type A = B is equivalent to the type of equalities  :  =  along with a proof that the structure of  is preserved in the structure of .
( Sometimes self-edges are allowed, sometimes not.Which notion is chosen in a given context depends on the application, e.g.power graphs in computational biology, quivers in category theory, and networks in network theory.

The Type of Graphs
In this work, a graph is a directed multigraph (self-edges are allowed).The type of graphs is the set-level structure of the notion of abstract graphs.
Definition 3.1.A graph is an object of type Graph.The corresponding data is a set of points in a space (also known as nodes) and a set for each pair of points (also known as edges).
Given a graph , for brevity, the set of nodes and the family of edges are denoted by N  and E  , respectively.In this way, the graph  is defined as (N  , E  , (  ,   )) : Graph where   : isSet(N  ) and   : ,:N  isSet(E  (, )).We may refer to  only as the pair (N  , E  ), unless we require to show the remaining data, the mere propositions   and   .Additionally, we will use the variables  and  to be graphs, and variables ,  and  to be nodes in , unless stated otherwise.Definition 3.2.A graph homomorphism from  to  is a pair of functions (, ) such that  : N  → N  and  : ,:N  E  (, ) → E  ( (),  ()).We denote by Hom(,  ) the type of these pairs.We denote by id  , for any graph , the identity graph homomorphism where the corresponding  and  are the identity functions.Lemma 3.3.The type Hom(,  ) forms a set.

The Category of Graphs
Graphs as objects and graph homomorphisms as the corresponding arrows form a small precategory.In fact, the type of graphs is a small univalent category in the sense of the HoTT Book [39, §9.1.1].This fact follows from Theorem 3.6 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.Lemma 3.4.Let ℎ be a graph homomorphism given by the pair-function (, ).The claim ℎ is an isomorphism, denoted by isIso(ℎ), is a proposition equivalent to stating that the functions  and  (, ) for all ,  : N  , are both bijections.
The collection of all isomorphisms between  and  is denoted by   .If  ≃  , one says that  and  are isomorphic.
Lemma 3.5.The type   forms a set.
We define a type to compare sameness in graphs in Lemma 3.4; the type of graph isomorphisms.In HoTT, the identity type (=) serves the same purpose, and one expects [14] the two notions coincide.In Theorem 3.6, we prove that they are in fact homotopy equivalent.The same correspondence for graphs also arises for many other structures [1,2], for example, groups, and topological spaces.≃ ∑︁ We first unfold definitions in Equivalence (3.1a).Equivalence (3.1b) follows from the characterisation of the identity type between pairs in a Σ-type (Lemma 3.7 in HoTT book).Equivalence (3.1c) stems from the fact that being a set is a mere proposition and, thus, equations between proofs of such are contractible, similarly as in Lemma 2.13.To get Equivalence (3.1e), we apply function extensionality twice in the inner equality in Equivalence (3.1d).By the Univalence axiom, we replace in Equivalence (3.1f) equalities by equivalences.Finally, Equivalence (3.1g) follows from Lemma 3.4 completing the calculation from which the conclusion follows.□ Lemma 3.7.The type of graphs is a 1-groupoid.
Proof.We want to show that the identity type  =  is a set for all ,  : Graph.This follows since type equivalences preserve homotopy levels.The type  =  is equivalent to the set of isomorphisms,  ≃  , by the equivalence principle, Theorem 3.6.□

Graph Classes
Graphs can be collected in different classes.A class  of graphs is a collection of graphs that holds some given structure  : Graph → U, i.e. a graph class is the total type of the corresponding predicate,  :≡ Σ :Graph  ().Examples of classes are simple graphs where the edge relation is propositional, or undirected graphs where the edge relation is symmetric.Definition 3.1 is the class of directed multigraphs, which leads us to more general statements about graphs and to write shorter proofs.It is more general, because one can see, for example that simple undirected graphs are instances of directed multigraphs.Now, since any construction in HoTT respects the structure of its constituents, a graph class is invariant under graph isomorphisms.Specifically, given a graph isomorphism, we can transport any property on graphs along the equality obtained by Theorem 3.6.Graph properties provide a way to determine if negative statements attribute on certain graphs, for example, if two given graphs are not isomorphic.

Lemma 3.8 (Leibniz principle). Isomorphic graphs hold the same properties.
A related principle is equivalence induction [22, §3.15].Lemma 3.9 (Eqivalence induction).Given a graph  and a family of properties  of type  :Graph (  ) → hProp, if the property  (, id  ) holds then the property also holds for any isomorphic graph  to , i.e.  (, ) holds for all  :   .Lastly, of importance for this work are the class of connected finite graphs stated in Definition 3.10 and Section 3.3.2.We will assume any graph in the remaining of this paper, as connected and finite, unless stated otherwise.

Finite graphs.
A graph is finite if both the node set and each edge-set are finite sets.The corresponding graph property of finite graphs is stated in Definition 3.10.Similarly, as with finite types, a finite graph has associated a cardinal to the number of nodes and of the number of edges.Consequently, one can show that for finite graphs, the equality is decidable on the node set and on each edge-set.

Connected
Graphs.Among the many notions in graph theory, the concept of a walk plays a leading role for many computer algorithms.A walk in a graph is simply a sequence of edges that forms a chain of types stated in Definition 3.11.By considering the walks in a graph, one obtains an endofunctor  in Graph by mapping a graph  to a graph formed by the same node set in , and the corresponding sets of walks in  as the edge sets.Definition 3.11.A walk between  and , is an element of the type Walk(, ), which is inductively generated by • the trivial walk ⟨⟩ when  ≡ , and • composite walks, ( ⊙ ), where  is an edge from  to some , and  a walk from  to .
Lemma 3.12.The type of walks between  to  forms a set.Definition 3.13.A graph  is (strongly) connected when a walk merely exists in  joining any pair of nodes.If  is connected then the proposition Connected() holds.

Graph Families
The path graph with  nodes is the graph   :≡ ( [],   .N-succ(toN()) = toN()).One alternative type of walks is the type of path graphs, where  represents the length of the walk.In other words, a path in  of length  between nodes  and  is a graph homomorphism from   to  mapping 0 to  and  − 1 to .Definition 3.16.The family of bouquet graphs   consists of graphs obtained by considering a single point with  self-loops.
Definition 3.17.A graph of  nodes is called complete when every pair of distinct nodes is joined by an edge.In particular, we denote by   , the complete graph with node set [𝑛].For brevity, we use a double arrow in the pictures below to denote a pair of edges of opposite directions.

Other Structures on Graphs
3.5.1 Cyclic Graphs.Similarly, as for cyclic types, we introduce a class of graphs with a cyclic structure.A graph is cyclic when it is in the connected component of an -cycle graph along with the corresponding automorphism, see Definition 2.3.Now, let us consider the homomorphism rot : Hom(  ,   ) that acts similarly as the function pred in Definition 2.8.The cyclic structure for graphs can be defined as the property of preserving the structure in   induced by the morphism rot.We will make use of the same notation as for cyclic sets to refer to cyclic graphs.
Example 3.19.We compute the identity type of the essential different colourings of the path graph  3 in Calculation (3.3).As we will see, there can only be two graph homomorphisms from  3 to  2 , namely  0 and  1 as in Figure 3. Let  1 and  2 be of type EssentiallyPartite(2,  3 ). ( In Equivalence (3.3b), the equality  :  2 =  2 is one of two alternatives: the trivial path or the path from the equivalence that swaps the only two nodes in  2 .Only the latter possibility, the equation  •  0 =  1 can hold.

The Identity Type on Graphs
For any element,  of a groupoid type,  , the type Aut  () := ( = ) has a group structure given by path composition.Applying this definition to the groupoid of graphs, the equivalence principle of Theorem 3.6 gives that for any graph , we identify Aut() with its automorphisms,  .This allows us to compute Aut() =   in the examples which follow.
(1) Aut( 2 ) is the group of two elements.With only two edges in  2 and one node, we can only have, besides the identity function, the function that swaps the two edges.In general, the identity type   =   is equivalent to the group   , the group which contains the permutations of  elements.(2) Aut( 3,3 ) is the subgroup Z 2 ×  3 ×  3 in  6 , since the nodes of  3,3 can be partitioned into two sets of three, which can be permuted independently.Additionally, the two partitions are interchangeable.
(3) Any isomorphism in Aut(  ) is completely determined by how it acts on a fixed node in   .

GRAPH EMBEDDINGS
Graphs are commonly represented by their drawings on a surface like the plane.In topology, such a drawing -also called graph embedding -can be represented as an embedding of the topological realization of the abstract graph on some given surface [37].Not all finite graphs can be drawn in the plane, but all finite graphs can be drawn on some orientable surface.If  denotes the abstract graph, then we denote by | | the topological realization of .
Given a graph embedding in the surface , say  : | | ↩→ , one can consider the space  −  (), the surface with the image of the graph removed.This space consists of a collection of connected components.Such a component is called a face if it is homeomorphic to an open disk.If all connected components are faces, one says that the graph embedding is cellular [25, §3.1.4].
Cellular embeddings are interesting because they can be characterised combinatorially -up to isotopy -by the cyclic order which they induce on the set of nodes around each node.

Locally Finite Graphs
A graph  is locally finite if the set of incident edges at every node , also called the star of  in , is a finite set.The valency of a star in a locally finite graph is the cardinal number of the corresponding set of edges.Now if we consider the graph  () as the symmetrisation of , with N  as the node set, and edges between  and , of the type E  (, ) + E  (, ), then the star at  is Type (4.1).
Lemma 4.1.The stars at each node forms a set.
Proof.It follows since the base type of Type (4.1) is the set of edges in the graph, and each of the fibers of the Σ-type is a coproduct of sets, which we know they form sets [39,Exer. 3.2].□ It is proven that if the graph has at least one node of infinite valency, such a graph can not have a cellular embedding into any surface [32,Proposition §3.2].In this work, we therefore only consider locally finite graphs, and we also assume that all graphs are connected, see Definition 3.13.One can prove that if the graph  is connected, then  () is connected.

The Type of Combinatorial Maps
Cellular embeddings are interesting because they can be characterised combinatorially -up to isotopy -by the cyclic order which they induce on the set of nodes around each node.We illustrate in Figure 4 (b) with a graph such a cyclic order.Since all embeddings in the plane are cellular, we will only work with this kind of embeddings.We forsake the topological definition of the embedding to work with their combinatorial characterisation, Definition 4.2.A graph with a map is a locally finite graph.Note that the stars of any map are finite sets, because being cyclic for a type implies that the type is a finite set.For brevity, we will use from now the variable M to denote a map of the graph .

The Type of Faces
Combinatorially, a face consists of a cyclic walk in the embedded graph where there are no edges on the inside of the cycle, and no node occur twice.Definition 4.5 is our attempt to make this intuition formal.The criterion "no edges on the inside" for a face -called map-compatibility below -is captured by the fact that each pair of sequential edges on the face is a successor-predecessor pair in the cyclic order of the edges around their common node.Also, note that our graphs are directed, and therefore, the underlying graph of a face can consist of edges in any direction.Then, faces of a map of a graph  are related to the graph  ().
(c) corner-compatible, which is the evidence that ℎ is compatible with the edge-ordering given by the map M at the node  () and the edge-ordering coming from the star at that node  in .The corresponding type is Type (4.The previous edge at  is the edge  : E N  (pred(), ), and the edge after  is the edge denoted by  + of type E N  (, suc()), see Figure 5.Given a face, we refer to ismapcomp(ℎ) () to the witness conditions of Types (4.2) and (4.3). Figure 5 illustrates part of the required data to define a face for the map of  given in Figure 4 (b).Definition 4.6.A graph homomorphism ℎ from  to  given by (, ) is edge-injective, denoted by isedgeinj(ℎ), if the function  defined below is an embedding.
Lemma 4.7.For a graph homomorphism, (1) being edge-injective is a proposition and (2) being map-compatible is a proposition.
We devote the rest of this section to proving that the type of faces forms a set in Lemma 4.9.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, (iii) the conditions, edge-injective and map-compatibe in Definition 4.5 are mere proposition.One might suspect this type forms a homotopy 1-groupoid from the previous 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.Lemma 4.8.Let  and  be edge-injective graph homomorphisms from   to a graph  and  > 0. Then the type Σ :  =  (tr  .Hom( ,) (,  ) = ) is a mere proposition.
Proof.The result follows from proving that the Σ-type in question is equivalent to a proposition.The corresponding equivalence is given by Calculation (4.4), in which we use some known results about Univalence and Lemma 3.20, as in the very last step.∑︁ ≃ ∑︁ It remains to show that the last equivalent type is a proposition.Let ( 1 ,  1 ), and ( 2 ,  2 ) be of type Σ :[] ( =  • rot  ).We must show that ( 1 ,  1 ) is equal to ( 2 ,  2 ).Since Hom(  , ) is a set, we only need to prove that  1 is equal to  2 .To show that, Lemma 3.20 is used in the proof.Let us consider the equality □ Lemma 4.9.The faces of a map forms a set.
Proof.Let  1 and  2 be two faces of a map M. We will show that the type  1 =  2 is a mere proposition in Calculation (4.7), with the following conventions.
We first unfold definitions of  1 and  2 in (4.7a), and simplifying propositions in Equivalence (4.7b), namely isedgeinj, ismapcomp, and iscyclic.Then, by expanding the definitions of A and B in (4.7c), and simplifying the propositions terms such as being a cyclic graph, one gets Equivalence (4.7d).Next, we reorder in Equivalence (4.7d) the tuple equalities to create an opportunity for path induction towards the application of Lemma 4.8.Now, since we want to prove that the type of faces is a set, and that itself is a proposition, the truncation elimination is applied to the propositions iscyclic(,   , ) and iscyclic(,   , ).Then, the graphs  and  become respectively   and   in Equivalence (4.7e).Equivalence (4.7f) follows from the characterisation of the identity type between tuples in a nested Σ-type.
( It only remains to show that Equivalence (4.7f) is a mere proposition.We show this by proving that each type in Equivalence (4.7f) is a proposition.First, we unfold the cyclic graph definition for   and   , using Definition 3.18.Secondly, a case analysis on  and  is performed.This approach creates four cases, where  and  can be zero or positive.However, we only keep the cases where  and  are structurally equal.One can show the other cases are imposible with an equality between  and . (

Face Boundary
Each face F of a map M given by ⟨, ℎ⟩ is bounded by a closed walk in  () induced by the non-empty cyclic graph  through ℎ.We refer to such a walk as the boundary of F , and it is denoted by F .The degree of F is the length of F , which is the number of nodes in .The boundary F can be walked in two directions with respect to the orientation given by its map.As illustrated by Figure 6, given two different nodes  and  in F , we can connect  to  using the walk in the clockwise direction, cw F (, ).Similarly, one can connect  to  using the walk in the counter-clockwise direction, ccw F (, ).Such walks are induced by the walks in the cyclic graph , see Lemma 4.11.Lemma 4.10.Supposing ,  : N   , the following claims hold for the cycle graph   .
(3) There exists a walk going in the clockwise direction denoted by cw   (, ) from  to .Lemma 4.11.Supposing ,  : N   , the following claims hold for the cyclic graph  (  ).
(3) There exist two quasi-simple4 walks from  to : (a) There is a walk in the clockwise direction denoted by cw  (  ) (, ).
(b) If  ≠ , then the walk denoted by ccw  (  ) (, ) is the walk in the counter-clockwise direction from  to .Otherwise, if  = , the walk ccw  (  ) (, ) is the trivial walk ⟨⟩.
(1) If  ≠ , then  is the length of each walk in Item (3) in Lemma 4.11.(2) Otherwise, the walk cw  (  ) (, ) is of a length , and the walk ccw  (  ) (, ) is of length 0.
Additionally, one can prove that  is the maximum length of a quasi-simple walk in the cyclic graph  (  ), as in Lemma 4.13 in [35].Lastly, as illustrated in Figure 6 for the face F , the graph  (  ) is completely covered by the walks ccw  (  ) (, ) and cw  (  ) (, ).

Examples of Graph Maps
In this subsection, we examine the combinatorial maps for the bouquet graph  2 and for the family of cycle graphs   from Section 3.4.We also give a map for the graph  3,3 mentioned in Section 3.5.2.
Let us introduce some notation for readability.An edge  : E  (, ) induces the edge  → in  () from  to .Similarly, the edge  : E  (, ) induces the edge  ← in  () from  to .Lastly, a face of a map is given by the corresponding cyclic graph in Definition 4.5.
Example 4.13.In Figure 7, we show the six combinatorial maps for the bouquet graph  2 .It is important to note that combinatorial maps are equal up to isomorphism.The equality of rotation systems at each node is given by Lemma 2.13.Thus, the bouquet  2 has only three distinct maps called   ,   , and   .The pairs of equal maps are respectively (, ), (, ), and (,  ) in Figure 7.
The surface arising from the maps   and   is the two-dimensional plane.For the map   , the surface is the topological torus.We recall that the torus is a surface homeomorphic to the cartesian product of a circle with itself, as the embeddings  and  in Figure 7.  Example 4.14.For cycle graphs   , only one combinatorial map exists.To show this, we consider the equivalence given by the function   for all  :   in Equation (4.9).Then, any star in   consists of two different edges.

PLANAR EMBEDDINGS
In this section, we examine the class 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 embedding and the graph embedded is called a plane graph.To discuss the notion of planar embeddings, we take inspiration from topological graph theory [25, §3].Then one can work with combinatorial maps that represent graph embeddings into a surface -up to isotopy.In the following, we focus on describing embeddings of graphs in the sphere called spherical maps.These maps are used later to establish the type of planar embeddings for a given graph.

Spherical Maps
Any graph embedding 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 [35].
5.1.1Homotopy for Walks.Given a map M for a graph , we consider the relation (∼  ) on the set of walks defined in [35].This relation is a congruence relation on the category of objects induced by the endofunctor  .The relation (∼  ) states in which way one can transform one walk into another considering adjacent faces.Then the relation strictly depends on the map M. Definition 5.1.Let  1 ,  2 be two walks from  to  in  ().The expression  1 ∼ M  2 denotes that one can deform  1 into  2 along the faces of M. We acknowledge the evidence of this deformation as a walk-homotopy between  1 and  2 , of type  1 ∼ M  2 .The relation (∼ M ) has four constructors as follows.The first three constructors are functions to indicate that homotopy for walks is an equivalence relation, i.e. hrefl, hsym, and htrans.The fourth constructor, illustrated in Figure 9, is the hcollapse function that establishes the homotopy supposing one has the following, (i) a face F given by ⟨,  ⟩ of the map M, (ii) a walk  1 of type W  () (,  ()) for  : N  with one node  : N  , and (iii) a walk  2 of type W  () ( (), ) for  : N  and  : N  .One consequence of Definition 5.1 is that, in each face F , there is a walk-homotopy between ccw F (, ) and cw F (, ) using the constructor hcollapse.

5.1.2
The Type of Spherical Maps.As a property of maps, we can now state under which conditions the surface arising from a map is simply-connected.We call such maps as spherical maps.
Proc.ACM Program.Lang., Vol. 1, No. X, Article 1. Publication date: December 2022.Definition 5.2.A map M of a graph  is spherical, of type Spherical(M), if any pair of walks sharing the same endpoints are merely walk-homotopic.
Lemma 5.3.Being spherical for a map is a proposition.
Lemma 5.4.The collection of all spherical maps for a (finite) graph is a (finite) set.Theorem 5.6.The type of all planar maps of a graph forms a set.

The Type of Planar Maps
Proof.The type of planar embeddings in Definition 5.5 is not a proposition.It encompasses two sets: the set of combinatorial maps, see Lemma 4.3, and the set of faces, see Lemma 4.9.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.□ Example 5.7.Let us prove that there exists a planar map for   with  > 0. Consequently, there exists a planar map for every cyclic graph.Beside their simple structure, cyclic graphs are building blocks in a few relevant constructions in formal systems related to the study of planarity of graphs, as planar triangulations using  3 , or a characterisation of all 2-connected planar graphs.
The graph   is connected and locally finite, which mostly follows from Lemma 4.10.We must then show that   has at least one spherical embedding and one outer face.As described in Example 4.14, there is only one such map that we denote here by M. This map gives rise to two faces,  1 and  2 , the inner face and the outer face, respectively.As the cycle graph   is a finite graph, it is only required to consider the finite set of quasi-simple walks to show that M is spherical, see Lemma 5.8 in [35].The set of such walks is precisely given in Lemma 4.11.We must now show that any pair of such walks are homotopic, from where one can conclude that the map M is spherical, and consequently planar with outer face  2 .
(1) If  = 1, the only walk to consider is the trivial walk, which is homotopic to itself.

Planar Extensions
In this subsection, we describe how to construct a planar map from another planar map.The characterisation of 2-connected graphs [41] Hereinafter, the path  in the addition  •  proceeds from  to  and its length is  + 1.The construction of  •  is equivalent to adding a path  ′ with two distinguished edges û and v, as illustrated in Figure 10b.If  = 0, the edges û and v are equal.Or else, we have one edge from  : N  to 0 : N  ′ , and another edge from  − 1 : N  ′ to .The graph  •  is formed by the set of nodes N  + N  ′ , and the corresponding edges, i.e. the set of edges in , û, v, and the set of edges in  ′ .From now on, we will assume the existence of a planar map M of .We will only consider the addition of  to  in a fixed face F of M if the endpoints of ,  and , belong to the boundary walk of F .Under these considerations, one can prove that the addition of  to  has a planar map.Lemma 5.9.There exists an extended planar map of M for  • .
Given a planar map M for , we label  (M, ) for the map given by Lemma 5.9.The extended map  (M, ) is called the face division of the face F by , assuming that  is embedded in F .To outline, the proof of Lemma 5.9 contains the following stages.First, one should define a map that extends M for the nodes in .Second, as illustrated in Figure 10, one should define two faces, both induced by collocating  on F .Finally, considering the new walks in  ( • ), given by walk-compositions with , we can prove that  (M, ) is planar.
Proof of Lemma 5.9.For brevity, let  be the graph  •  as constructed above, and  be the walk û •  ′ • v; a walk from  to .Let F be a face such that its boundary contains  and .We will define a specific map M ′ for  that extends the given planar map M of .In this way, one embeds  in F .By Definition 4.5, in F , one has the previous edge at , denoted by  : E  (pred(), ), Proc.ACM Program.Lang., Vol. 1, No. X, Article 1. Publication date: December 2022.
• If  1 is  1 •  () •  2 , and  is not a subwalk of  2 , then one can obtain the following walk homotopy.
By the constructor hcollapse with  1 ,  1 , and  2 ) (By the spherical map M applied to walks from  to ).
(5.1)  ( One can prove that if M is a planar map then  M and   ( M,) are equal.As described in the proof of Lemma 5.9 to construct  (M, ), a path addition of  of length  + 1 to  increases  by ,  by  + 1, and  by one.A major result is the characterisation of connected and finite planar graphs by Euler's formula, which states that  M is two.Using the development in this section, one could show Euler's formula for graph extensions, and for the class of biconnected graphs as described in Section 5.3.2.However, it is still unclear how to verify Euler's formula, when it is not given the cardinal of the set of faces, i.e. elements of type Face(, M), see Definition 4.5.
( M,) :≡ ( + ) − ( +  + 1) + ( + 1) =  M .There are several methods to construct graphs inductively, as the construction of  4 in Figure 12.Whitney-Robbins synthesis and an ear decomposition of a graph are some related methods.Inspired by these constructions and Lemma 5.9, we define the construction of larger planar graphs using graph extensions, in a way that we never leave the class of planar graphs.Definition 5.10.A synthesis of a graph  from a graph  is a sequence of graphs  0 ,   non-simple additions, the sequence is called a non-simple synthesis.If the graph  is only obtained by a sequence of path additions, then the sequence is called a Whitney synthesis.Lemma 5.11.In a synthesis from a connected graph, every graph in the sequence is connected.Definition 5.12.Given a planar map M of the graph , a planar synthesis of  from a graph  is a sequence ( 0 , M 0 ), ( 1 , M 1 ) • • • , (  , M  ), where  represents the length of the synthesis, ( 0 , M 0 ) is (, M), and (  , M  ) is (,  (M −1 ,  −1 )).The graph   , for  from 1 to , is the graph  •   and the map M  is  (M −1 ,  −1 ), for  from 1 to .Lemma 5.13.In a planar synthesis, every graph in the sequence is planar.
Proof.By induction on the synthesis length and Lemma 5.9.□ Lemma 5.9 can be further extended to consider non-simple additions, and consequently, one could extend Lemma 5.13 to define non-simple planar syntheses.Given a map M for , the corresponding planar map for  •  is denoted by  (M, ).Similarly, as with path additions, by extending the map by non-simple additions, new faces show up.Let  + 1 be the length of the path added to .Then the map  (M, ) induce  + 2 new faces, and one gets that   ( M,) and  M are equal.
As illustrated by Figure 10, using spike additions, larger planar graphs can be constructed.A spike addition to  is the addition of a path that only has one node in common with .Given a map for , a simple addition of a spike  to  induces a new face of a greater degree than the face where the spike is inserted.In contrast to simple additions, the number of faces of a map extended by non-simple spike additions vary as new faces arise between pairs of edges that share their endpoints.

Biconnected Planar Graphs.
One can look at how much a graph is connected by examining its node-connectivity or edge-connectivity.Some graphs, yet after removing parts of them, preserve one or both connectivity measures.In this subsection, we want to characterise how to construct the class of 2-connected planar graphs.A graph is -connected if it cannot be disconnected by removing less than  nodes.There exist, depending on , different ways to construct the class of -connected graphs.For example, it is known that one can construct any undirected (2)-connected graph, if one applies path additions to a proper cyclic graph [15, §3] The 2-connectedness of a graph is not preserved by simple path additions.Clearly, removing a node from the added path  disconnects  • .However, using non-simple path additions, we can preserve and enlarge 2-connected graphs.Lemma 5.16.Suppose  is a 2-connected graph, then the following claims hold.
(1) Every node in  has degree of minimum two.
(2) There exists a cyclic graph  and an injective morphism from  ( ) to .Lemma 5.17.In a non-simple Whitney synthesis of  of length  from a 2-connected cyclic graph  , every graph   in the sequence is a 2-connected planar graph.
Proof.By induction on .If  = 0, the graph  is 2-connected by hypothesis and is planar by a similar construction as in Example 5.7.Assuming that the claim holds for a sequence of length , then   is a 2-connected planar graph.By Item (iii) in Lemma 5.16, we get that   •  is 2-connected.Using a similar construction as in the proof of Lemma 5.9, one defines a planar map for   •   , from where the conclusion follows. □ The converse of Lemma 5.17 can be proved by closely following the informal proof of Lemma 3 and Proposition 4 for undirected 2-connected planar graphs in [42].We must formalise several notions before considering such a proof in our formalism, including, the notion of maximal sub graphs, adjacent faces, and deletion of edge sequences.One understands, therefore, that the class of 2-connected planar graphs is completely determined by all non-simple Whitney syntheses [15, §3].Any planar graph, in the sense of Definition 5.5, and 2-connected, as in Definition 5.14, can be inductively generated from a cycle graph and iterative additions of non-simple paths.
Further investigation to study of other graph extensions to generate planar graphs, as graph amalgamations, graph appendages, deletions, contractions and subdivisions should be considered [26, §7.3].

RELATED WORK
One can find the study of planar graphs and more general graph theoretic topics in relevant projects and big libraries formalised in Coq [17] and Isabelle/HOL [33].For example, the formal proof of the Four-Colour Theorem (FCT) in Coq by Gonthier [23], the proof of the discrete form of the Jordan Curve Theorem in Coq by Dufourd [20], and the proof of the Kepler's Conjecture in HOL by Bauer et al. [28] are a few of such notable projects in the subject.
Different approaches have been proposed to address planarity of graphs in formal systems.These works use different mathematical objects depending on the system.We use combinatorial maps in this work, but other related constructions are, for example, root maps defined in terms of permutations by Dubois et al. [18], and hypermaps by Dufourd and Gonthier [19,20,23], 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 fundamental construction to formalise mathematics of graph embeddings 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 hypermaps [19,20].Recently, for a more standard representation of finite graphs, Doczkal proved that, according to his notion of a plane map based on hypermaps, every  3,3 -free graph and  5 -free graph without isolating vertices is planar, a direction of Wagner's theorem [16].
An alternative approach for planarity using combinatorial maps is the iterative construction of certain kind of planar graphs.For example, Yamamoto et al. [42] showed that every 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 [26, §5.2, §7.3].Such construction defines an inductive data type that begins with a cycle graph   serving 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 [10,11].A related approach in our setting is of the treatment of planar graph extensions, as described in Section 5.3.
However, to the best of our knowledge, in type theory, related work to the planarity of graphs has been done in a different formal system and for different classes of graphs.These studies mostly define planarity for undirected finite graphs, in contrast, our definition considers the more general class of connected and locally finite directed multigraphs.Our work is closer to the foundations of mathematics, specifically, to the formalisation of mathematics in HoTT, than to more practical aspects of graph theory.This approach forces us to propose new constructions, even sometimes, for the most fundamental and basic concepts in the theory.

CONCLUDING REMARKS
This document is a case study of graph-theoretic concepts in constructive mathematics using homotopy type theory.An elementary characterisation of planarity of connected and locally finite directed multigraphs is presented in Section 5.2.We collected all the maps of a graph in the twodimensional plane -identified up to isotopy-in a homotopy set, see Theorem 5.6.The type of these planar maps displays some of our main contributions, e.g. the type of spherical maps stated in Definition 4.2 and the type of faces for a given map in Definition 4.5.As far as we know, the presentation 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 [11,23,42], see Section 4.3.
Additionally, as a way to construct planar graphs inductively, we presented extensions for planar maps.We demonstrated that any cycle graph is planar, and by means of planar extensions like path additions, one can construct larger planar graphs, e.g. to illustrate this approach, a planar map for  4 using simply path additions from a planar map of  3 is illustrated in Figure 12.Other relevant notions to this work are cyclic types, cyclic graphs, homotopy for walks [35], and spherical maps.
We chose HoTT as the reasoning framework to directly study the symmetry of our mathematical constructions.Many of the proofs supporting our development could only be constructed by adopting the Univalence Axiom, 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.6.
Another contribution of this work include the (computer-checked) proofs.The major results in this document have been formalised in the proof assistant Agda, in a development fully selfcontained way, which does not depend on any library [34].However, for technical reasons, the formalisation of Example 5.7 and further in depth studies on the main results in Section 5.3 like Lemmas 5.9 and 5.17 will be conducted in future.
This work can serve as a starting point for further developments of graph theory in HoTT or related dependent type theories.We expect further research to provide other interesting results as the equivalences between different characterisations of planarity for graphs, e.g., the Kuratowski's and Wagner's characterisations for planar graphs.

3 GFig. 1 .
Fig. 1.It is shown a graph along with three different planar embeddings, namely  1 ,  2 , and  3 .We have shaded with different colours the three faces in each embedding.
and its inverse function is called ua.Given  :  ≃ , the underlying function of type  →  is denoted by  while ua() is denoted by .The coercion along  :  =  is the function coe of type  → .• The point-wise equality for functions (also known as homotopy) is denoted by (∼).The function happly is of type  =  →  ∼  and its inverse function is called funext.• The coproduct of two types  and  is denoted by  + .The corresponding data constructors are the functions inl :  →  +  and inr :  →  + .• Dependent sum type (Σ-type) is denoted by Σ : () while dependent product type (Π-type) is denoted by Π : ().• The empty type and unit type are denoted by 0 and 1, respectively.• The type  ≠  denotes the function type ( = ) → 0. • Natural numbers are of type N. The variable  is of type N, unless stated otherwise.• The type with  points is denoted by [].

Definition 2 . 8 .
The type of cyclic structures on a type  is given by Cyclic().
If  and  are equal, such a path is closed.A closed path induces a cycle graph of size of the same length of the path.The family of cycle graphs follows Definition 3.15.Definition 3.15.An -cycle graph denoted by   is defined by   :≡ ( [],    .= pred()) if  ≥ 1.Otherwise,  0 is the one-point graph.

C 1 C 2 C 3 C 4 C 5 C0
In the treatment of embeddings of graphs on surfaces, we find out that bouquet graphs, besides their simple structure, have nontrivial embeddings, see Section 4.5.Proc.ACM Program.Lang., Vol. 1, No. X, Article 1. Publication date: December 2022.

Fig. 2 .
Fig. 2. The graph  3,3 .Each arrow in the picture represents a pair of edges, one in each direction.

1 Fig. 3 .
Fig.3.Two graph homomorphisms  0 and  1 from  3 to  2 .The dashed arrows represent how  0 and  1 map the nodes of  3 into  2 .We represent the colours of the 2-coloring of  3 by the nodes black and white in  2 .

Definition 4 . 2 .
A map for a graph , of type Map(), is a local rotation system at each node.Map() :≡(:N  ) Cyclic(Star  ()).Lemma 4.3.The type of maps for a graph forms a set.
The rotation system at node .

Fig. 4 .
Fig.4.We show in (a) the drawing of a graph  with edge crossings.A representation of the graph  embedded in the sphere is shown in (b).The graph embedded  () serves as the symmetrisation of the graph .Recall an edge  in  from  to  induces an edge in  () from  to  and an edge from  to .For brevity, we only draw a segment representing such a pair of related edges.The corresponding faces of the graph embedding shaded in (b) are named   for  from 1 to 6.It is shown in (c) with fuchsia colour the incident edges at the node  in  ().The rotation system at , i.e. the cyclic set denoted by (  ), is shown in green colour.The dashed lines represent edges not visible to the view.

Lemma 4 . 4 .
The type of maps for a finite graph is a finite set.

Fig. 5 .
Fig.5.On the right side, we shade the face  1 of the graph  embedded in the sphere given in Figure4.We have the cycle graph  3 and ℎ : Hom( 3 ,  ()) given by (, ) on the left side. 3 and ℎ can be used to define the face  1 using  3 as the graph  in Definition 4.5.

Fig. 6 .Fig. 7 .
Fig. 6.It is shown a face F given by ⟨,  ⟩ for the graph embedding  () given in Figure 4.There are two quasi-simple walks in the underlying cyclic graph  between two different nodes  and .Such walks are the clockwise and counter-clockwise closed walks in  (), denoted by cw F (, ) and ccw F (, ), respectively.

Fig. 8 .
Fig.8.A map for  3,3 in the surface of the torus.

Fig. 9 .
Fig. 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 5.1.The arrow (⇓) represents a homotopy of walks.

Fig. 10 .
Fig. 10.The figure (a) shows the planar map for  given in Figure 4 (b) with three different graph extensions: a path addition of , a cyclic addition of , and a spike addition of  .The additions of  and  replace/divide the faces  2 and  3 , we have in Figure 4, by two new faces for each addition.The addition of  replaces  4 with a face of a greater degree.The figure (b) shows the path addition discussed in the proof of Lemma 5.9.

F 1 F 3 F F 2 F F 4 Fig. 12 .
Fig. 12.The figure is a planar synthesis of the construction of a planar map for  4 from a planar map of  3 .One first divides the face F into  1 and  2 .Then one splits  1 into  3 and  4 .
Proc.ACM Program.Lang., Vol. 1, No. X, Article 1. Publication date: December 2022.Lemma Definition 3.18.A graph  is cyclic if it is of type CyclicGraph().a bipartite complete graph with six nodes is the graph  3,3 .The collection of all -colourings of a graph forms a set by Lemma 3.3, and the collection of -partite graphs forms a 1-groupoid.Since there are some -partite graphs that are equal up to isomorphism, we have the following distinction.Two graph colourings of , namely  ,  : Hom(,   ) are essentially different if a nontrivial isomorphism  :     exists and if the functions  and  •  are equal.The type of essentially different colourings of a graph  is Type (3.2).
( (rot  1 ) (),  (rot  1 ) (), ( (rot  1 ) (, , ) 1) If both,  and , are zero, then, by definition,   and   are the one-point graph.In this case, the conclusion easily follows.The base type  =  of the total space in Equivalence (4.7f) is a proposition because N is a set.The type  0 =  0 is a proposition since it is contractible.The identity graph homomorphism is the unique automorphism of  0 .Lastly, because Hom(  ,   ) is a set, the remaining type of the Σ-type is a mere proposition, completing the proof obligations.(2)If  and  are positive, we reason similarly.The type  =  is a proposition.By path induction on  :  = , the second base type of the Σ-type becomes Type (4.8).∑︁ (:  =  ) (tr  .Hom( , ()) (,  ) = ).(4.8) Type (4.8) is a proposition by Lemma 4.8.The remaining type of the Σ-type is a mere proposition, because Hom(  ,   ) is a set.Therefore, the Σ-type in Equivalence (4.7f) is a proposition as required.□ , ear decompositions[9,  §5.3], reliable networks, and planar graph extensions for undirected graphs[26,  §5.2,7.3] are related constructions.In the current section,  is a locally connected finite graph with decidable equality on the set of nodes.For brevity, the variables  and   will represent finite path graphs of a positive length..3.1 Path Additions.An internal node of a path is any node that is not an endpoint of the path.A simple path addition to  is the graph formed by adding  to  between two existing nodes of , such that the edges and internal nodes of  are not in .A simple cyclic addition is the addition of a cyclic graph to  with exactly one node in common with .A non-simple path addition is the path addition of the graph  () to  for a path graph .Similarly, one can define non-simple cyclic additions.The simple and non-simple addition of  to  are denoted by  •  and  • , respectively, and are referred as graph extensions.The operator (•) is regarded as a left-associative operator.
Proc.ACM Program.Lang., Vol. 1, No. X, Article 1. Publication date: December 2022.5 2 is  •  1 for a walk  from  to , then, by right whiskering of walk homotopies, one gets that 1 •  1 ∼ M ′  •  1 .By assumption, M is spherical, and then  1 ∼ M , which implies by definition of M ′ that  1 ∼ M ′ .Similarly, by left whiskering, one can also prove that if  1 is  2 •  2 and  2 is  2 •  where,  is a walk from  to , then there is a walk homotopy such that 2 •  2 ∼ M ′  2 • .For the remainder cases of  1 and  2 , one can similarly construct the required walk homotopy.Therefore, M ′ is spherical, and is also a planar map of  with the outer face  1 .□If is a finite graph with a map M, then the Euler's characteristic of  by M, denoted by  M , is the number relating the cardinal of the set of nodes (), edges (), and faces ( ).
, • • • ,   where  0 is  ,   is , and   is the addition of   to  −1 for  from 1 to .If the sequence only contains simple additions, then it is called a simple synthesis.Else, if the sequence only contains Proc.ACM Program.Lang., Vol. 1, No. X, Article 1. Publication date: December 2022.

.
Definition 5.14.A graph  is 2-connected or biconnected if the graph formed by removing from  a node , denoted by  − , is connected.If  is 2-connected then the proposition Biconnected() holds.Precisely,  −  is the graph formed by the set of nodes, Σ :N  ( ≠ ), and the corresponding edges in .