The Sierpinski Carpet as a Final Coalgebra
Abstract
We advance the program of connections between final coalgebras as sources of circularity in mathematics and fractal sets of real numbers. In particular, we are interested in the Sierpinski carpet, taking it as a fractal subset of the unit square. We construct a category of square sets and an endofunctor on it which corresponds to the operation of gluing copies of a square set along segments. We show that the initial algebra and final coalgebra exist for our functor, and that the final coalgebra is bi-Lipschitz equivalent to the Sierpinski carpet. Along the way, we make connections to topics such as the iterative construction of initial algebras as -colimits, corecursive algebras, and the classic treatment of fractal sets due to Hutchinson [9].
1 Introduction
This paper continues work on fractal sets modeled as final coalgebras. It builds on a line of work that began with Freyd’s result [7] that the unit interval is the final coalgebra of a certain endofunctor on the category of bi-pointed sets. This was generalized by Leinster [10], in work which represents many of what would be intuitively called self-similar spaces using (a) bimodules (also called profunctors or distributors); (b) an examination of non-degeneracy conditions on functors of various sorts; (c) a construction of final coalgebras for the types of functors of interest using a notion of resolution. In addition to the characterization of fractal sets as final coalgebras for endofunctors on sets, his seminal paper also characterizes them as final coalgebras for endofunctors on topological spaces.
In a somewhat different direction, work related to Freyd’s Theorem continues with development of tri-pointed sets [5, 4] and the proof that the Sierpinski gasket is related to the final coalgebra of a functor modeled on that of Freyd [7]. Although it might seem that this result is but a special case of the much better results in Leinster [10], the work on tri-pointed sets was carried out in the setting of metric spaces rather than topological spaces (and so it re-proved Freyd’s result in that setting, too). Work in the metric setting is unfortunately more complicated. It originates in Hasuo, Jacobs, and Niqui [8], a paper which emphasized algebras in addition to coalgebras, and proposed endofunctors defined using quotient metrics. Following this [5, 4] show that for the unit interval, the initial algebra of Freyd’s functor is also interesting, being the metric space of dyadic rationals, and thus the unit interval itself is its Cauchy completion. For the Sierpinski gasket, the initial algebra of the functor on tripointed sets is connected to the finite addresses used in building the gasket as a fractal; its completion again turns out to be the final coalgebra. While the gasket itself is not the final coalgebra, the two metric spaces are bi-Lipschitz isomorphic.
In this paper, we take the next step in this area by considering the Sierpinski carpet . The difference between this and the gasket (or the unit interval) is that the gluing of spaces needed to define the functor involves gluing along line segments, not just along points. This turns out to complicate matters at every step. The main results of the paper are analogs of what we saw for the gasket: we have a category of metric spaces that we call square metric spaces, an endofunctor which takes a space to 8 scaled copies of itself glued along segments (the notation recalls Leinster’s paper, and again we are in the metric setting), a proof that the initial algebra and final coalgebra exist, that the latter is the completion of the former, and a verification that the actual Sierpinski carpet with the Euclidean metric is bi-Lipschitz isomorphic to the final coalgebra. Along the way, we need to consider a different functor which is like but involves 9 copies (no “hole” in the middle). The final coalgebra for turns out to be the unit square with the taxicab metric. Moreover, in much of this work we have found it convenient to work with corecursive algebras as a stepping stone to the final coalgebra; the unit square with the taxicab metric turns out to be a corecursive algebra for on square metric spaces.
This extended abstract omits nearly all of the proofs and is really a very high-level view of our subject. Many of the results are much more general, since we aim to provide a foundation for future work in this area. But none of that is reflected in this abstract.
1.1 Background on the Sierpinski Carpet
![]() |
In this section, we recall the definition of the Sierpinski carpet (shown above) in terms of contractions of the unit square . We also quote without proof special cases of the classical results of Hutchinson [9] on fractals.
Let be the set of non-empty closed subsets of , with the Hausdorff metric . Let
For each in , let . let be the contracting map
That is, we scale the input by , and then we move it by adding . Then the setwise extension of is defined (as always) by taking images: for , . Define by
This function is a contracting map, and we let be its unique fixed point. is called the invariant set determined by the finite set . It is also called the Sierpinski carpet.
Definition 1.
For each finite sequence of elements of , and each , is defined by recursion on , starting with and the empty sequence :
For every infinite sequence ,
(1.1) |
By the Cantor Intersection Theorem, is a singleton set, and we write its (unique) member as .
Proposition 1.
(cf. [9]) If is a non-empty bounded set and is an infinite sequence in ,
-
1.
as .
-
2.
as . In particular, as in the Hausdorff metric.
2 Square Sets and Square Metric Spaces
We start by defining the categories of interest in this paper. First, MS is the category of metric spaces of diameter and short maps: . The reason for the diameter to be rather than will be apparent from the next example.
Let
be the boundary of the unit square. A square set is a set with an injective map . The idea is that designates the four sides of the square. We obtain a category SquaSet by taking as morphisms the functions between the sets with the property that .
Example 1.
Here are some examples of square sets. First, itself, with . Next, the unit square with the inclusion. Finally, the Sierpinski carpet , again with the inclusion.
We are most interested in square sets which are metric spaces. is a square metric space if is a metric space bounded by and is also square set, and satisfies the following:
-
()
For and ,
That is, along each side of the square, distances coincide with distances on the unit interval. (Note that it follows from this that the image of is compact.)
-
()
For , . This is a non-degeneracy requirement, which prevents our squares from “collapsing”.
Note that we do not require that the metric on the boundary of the square coincides with the Euclidean metric (we are not requiring that opposite corners have distance ). In fact, we will be interested in a path metric around the square.
Example 2.
Here are some examples of square metric spaces:
-
1.
with the path metric: for , if they are on the same side, their distance coincides with the unit interval, if they are on adjacent sides which share a corner , , and if they are on opposite sides, is the minimum (between the two sides) of where are endpoints of a side not containing either or , with on the side containing and on the side containing . Note that these distances are all bounded by (the distance between opposite corners is ).
-
2.
with the taxicab metric. That is, for and ,
Note that in the taxicab metric, the distance from to is , whereas with the path metric, it is .
-
3.
where is the inclusion map, with the taxicab metric.
Let SquaMS be the category whose objects are square metric spaces (bounded by ) whose morphisms are short maps which preserve . That is, is a map such that for , and for , .
Proposition 2.
with the path metric is an initial object in SquaMS. There is no final object in SquaMS.
We will find that the concrete description of the requirements on objects in SquaMS is useful for our purposes, but alternatively we can view the relationship between and as follows:
Corollary 3.
For every square metric space and every ,
where is the taxicab metric and is the path metric.
Proof.
Follows from () and the fact that there is a (unique) short map such that . ∎
Proposition 4.
The monomorphisms in SquaMS are the morphisms which are one-to-one.
2.1 The Functors and
In this section we will define a functor
which, when applied to the initial object, will give us objects which correspond to iterations of the Sierpinski carpet. The idea is that will be a set of indices indicating positions to place scaled copies of , and by showing that is a functor, we will be able to apply it repeatedly in order to form a chain whose colimit will be an object whose completion is bi-Lipschitz equivalent to the Sierpinski carpet.
As before, . will indicate a (column, row) entry in the grid.
For any set , we naturally consider as a set of eight copies of , and would be in the copy labeled by .
Let be the smallest equivalence relation on such that for , we take
In words, relates the segments which overlap in the grid pictured above. For example, tells us the top of the bottom left square is identified with the bottom of the square immediately above it. Incidentally, on , we have a characterization of in terms of the maps from Section 1.1, if and only if .
So far, we have defined on . But we can define a similar relation on any square set by “adding everywhere.” For example we would want . We shall drop in our notation for .
The square set
Let be a square set. The set is , the set of equivalence classes of on . We always write for the equivalence class . For the square set structure, we define each side of by scaling the copies of the corresponding side and pasting them together at the appropriate points. For example, the left side will be given by
is well-defined, and so we have a square set . If is a SquaSet morphism, we take to be . It is easy to check that this gives an endofunctor on square sets.
for square spaces
We next upgrade this functor to an endofunctor on SquaMS.
For the metric structure on , we use the quotient metric. We start with the following metric on the set :
So the distance is scaled by in the same copy of , and otherwise, it is (the maximum distance). Now we take the quotient metric on determined by . So given points and , the distance between them will be defined as the infimum over all finite paths (ordered lists of elements) in of the score, where the score is the sum of the distances (in ) along the path, but where we count for pairs of equivalent points.
First note that this is a pseudometric: clearly this is symmetric, the distance between any point and itself is , and it will satisfy the triangle inequality since the concatenation of two paths is a path. The following conditions are sufficient to show that this is in fact a metric: distinct points will have positive distance.
Proposition 5.
Let be a square space. The following facts hold:
-
•
For , if and , then
-
•
For every object we have an injective map , such that for all , for some and (where and only depend on , not ).
-
•
For any and , for any path ,
-
•
Let . Suppose that and are sequences with and . If for all , then .
-
•
For and in , there is a geodesic of the form
(where we may omit or if or are in the image of respectively) such that .
This shows us that the distances in are witnessed by an actual finite path, not just an infimum of paths. This gives us the following:
Corollary 6.
-
1.
For , given by is an embedding such that for , .
-
2.
is a square metric space.
We complete the definition of as a functor as with SquaSet: for a morphism of SquaMS, we let be . Using Proposition 5, this is a functor. It is not hard to check that this functor preserves monomorphisms and isometric embeddings.
The functor
Let . So . We define a functor on square spaces. The definition is just like , except that we use the “middle point” as a possible index point. In pictures, is nine copies of (not , as per ). The metric again is obtained by shrinking the metric in by and using the quotient metric obtained by “gluing on the edges of the grid”. The square space structure is as for . All of the verifications for are easier than for .
3 Initial Algebras
We assume that the reader is familiar with the notions of algebra and coalgebra for an endofunctor on a category. We mention a few examples and then quickly mention the initial algebras of and on SquaMS.
The algebra on SquaSet
We have an algebra . It is defined as follows:
Notice that here is a pair; earlier we wrote it as . Similarly, ; earlier we wrote it as . It takes a few routine elementary calculations to be sure that is well-defined.
In the result below, recall that our default metric for is the taxicab metric.
Proposition 7.
In SquaMS, is an isomorphism.
When we turn to , we have an algebra . It is defined the same way as , except that the index is not used. Here is a way to picture this:
This picture is misleading, because it suggests that maps via the inclusion into . The map is not the inclusion. This is because is really eight copies of , each copy with the taxicab metric, and then the overall space is given by the quotient, as discussed above.
Proposition 8.
is a (short) injective map.
Here is what is happening. In , we have to navigate around the hole, potentially making the distance longer. For example, if we consider the midpoints of the bottom and top of the middle square,
whereas
We construct the initial algebra of these functors by iteration in steps. For example, consider . We have the initial -sequence of the functor :
(3.1) |
Unlike the situation with bipointed and tripointed sets, the maps in the chain are not isometric embeddings. Nevertheless, the colimit exists, and (by an argument) the colimit maps are injective. (The key point here is that each space has an injective short map into the carrier of an injective algebra, namely the unit square .)
Theorem 9.
The colimits of the initial -sequences exist, and the functors preserve these colimits. Thus by Adámek’s Theorem [2] there are initial algebras and .
4 Final Coalgebras
4.1 Corecursive Algebras
As a technical tool to obtain the final coalgebras, it will be useful to use a different kind of structure.
Definition 2 (Capretta, Uustalu and Vene [6]).
Let be an endofunctor on any category. An algebra is corecursive if for every coalgebra there is a unique coalgebra-to-algebra morphism . This means that :
The map is also called the solution to in the algebra .
This section provides a few examples, beginning with the following one on Set. First fix a real number . The rest of this example depends on this parameter, and in later sections we are going to take . Let . (We mean this as a subset of the reals.) For the functor, we take to be given by . For a function , is given by . We have an algebra , where is the unit interval , and
is given by , for and .
Proposition 10 (cf. [3]).
is a corecursive algebra for .
Proposition 11 ([6]).
If a corecursive -algebra has an invertible structure map , then is a final coalgebra for the same functor. And if is a final coalgebra, then is a corecursive algebra.
Lemma 12.
Let and be coalgebras, and let be a coalgebra morphism. Let be corecursive algebra. Then .
4.2 Square Sets
Lemma 13.
is a corecursive algebra for on SquaSet.
4.3 Square Spaces
The next main result is that is a final coalgebra on square spaces. As above, the metric on is the taxicab metric. We need a few preliminary lemmas. In these, we fix an coalgebra on SquaMS, . We already know that there is a unique SquaSet morphism . Also, is an isometry, hence is short. Our main work in this section shows that is short (on all of ), of course using that is a short map. The surprising feature of our proof is that we must consider other coalgebras in order to prove the shortness of . Notice that is also an coalgebra. Furthermore, is a coalgebra morphism.
Lemma 14.
.
Definition 3.
Let . We say that is short on if for all , .
Also, we write for .
Lemma 15.
For all and ,
Lemma 16.
Let be any set that includes the image . If is short on , then is short on .
Lemma 17.
Let , and let . There is a coalgebra , a coalgebra morphism , and a set so that
-
1.
.
-
2.
is short on .
-
3.
For every there is some such that , and also .
Lemma 18.
is short.
Proof.
Theorem 19.
is a corecursive algebra for on SquaMS, and is a final coalgebra for this same functor.
Proof.
We already know that if we forget the metric, is a corecursive algebra for on SquaSet. In the case that we have a short coalgebra structure, , the unique SquaSet map is short, by Lemma 18. The forgetful functor is faithful, and so is the unique coalgebra-to-algebra map in SquaMS. This shows the first assertion in our result. The second follows since is invertible (Proposition 11). ∎
4.4 is Isomorphic to the Completion of the Initial Algebra
Recall the initial sequence of the functor in (3.1). We write for the colimit. And we write for the canonical injection. There are canonical maps
given by: , and . The maps are a cocone. It is easy to see that , where
(4.1) |
is given by . Thus is short. By the colimit property of , we have a unique short map
so that for all , .
Lemma 20.
The Cauchy completion operation on MS has a lift to . For all , .
Observe that since (by Lambek’s Lemma), we have an isomorphism
Lemma 21.
is an isometry, and extends to an isomorphism .
Although we lack the space to show it, this last result is quite involved, requiring work with maps that are not short and also requiring special work on the relation between each space and its “cousin” .
Theorem 22.
is the final coalgebra, where and is the map above.
Proof.
Let be a coalgebra. Consider the metric space . As usual, this is complete because is. The subspace of short maps which preserve the square space structure is a closed subset, and (crucially) it is non-empty. This is because we have a short map by Lemma 18, and a short map by Lemma 21. We also have a -contracting map given by . Thus, has a unique fixed point. The fixed points of are exactly the coalgebra morphisms . Thus, there is a unique coalgebra morphism . ∎
4.5 Final Coalgebra for
Recall that is the initial algebra. Let be its completion and let be the completion functor applied to the inverse of the isomorphism from to . We aim to show that is the final coalgebra.
The main goal in this section is to exhibit a short map , where is an arbitrary coalgebra. With this in mind, let be given. Then we can choose and be such that for all
This is where we will use our work on the functor . Note that the inclusion is a short map, since every path in is a path in , and thus, the inclusion is a morphism. So we can view any coalgebra as an coalgebra by taking the composition of the inclusion morphism with .
Let be .
Now we have a short map from to . Our aim is to get to , which is the completion of , which is a colimit of the chain (see (3.1)), but with instead of . So to connect these, we will restrict our attention to corner points in , and show that the inclusion into restricted to these corner points is an isometry. This way, we will be able to define approximate maps from to and in turn, to whose limit will be our required map from to . Note that we cannot expect to define a morphism directly from the image of in to , since (as we will see in our discussion of bi-Lipschitz equivalence) such a map with the required properties will not be a short map.
Definition 4.
The set of corner points of is defined as follows:
For example, , , and are the intersections of segments in each of these squares, respectively.
Lemma 23.
Let and be corner points in (via the inclusion ). Then there exists a geodesic as in Proposition 5 such that every entry on the path is also a corner point in .
Corollary 24.
Let . Then for ,
That is, the distance between corners in coincides with the distance in .
For each natural number , define by
Note that is not a short map. Moreover, the map
is not a short map itself, but it approximates in the following sense: for ,
Finally, we define by . This is a Cauchy sequence of elements of the initial algebra , since for , .
Proposition 25.
is a short map.
Theorem 26.
is a final coalgebra.
5 Bi-Lipschitz Equivalence
Two metric spaces and are bi-Lipschitz equivalent if there is a bijection and a number such that
Here we will show that the final coalgebra is bi-Lipschitz equivalent to , the Sierpinski carpet as a subset of with the taxicab metric. Note that with the taxicab metric is bi-Lipschitz equivalent to with the Euclidean metric.
As in our proof that is the final coalgebra, we can view it as an coalgebra, so by Lemmas 13 and 18, there is a morphism such that .
Proposition 27.
is injective.
Clearly the image of under is non-empty, so to see that is a bijection between and , we show that the image is compact with respect to the taxicab metric on , and that it is fixed under .
Proposition 28.
.
Theorem 29.
The metric space is bi-Lipschitz equivalent to the Sierpinski Carpet as a subset of the plane with the taxicab metric, and thus, the Euclidean metric. Specifically, for ,
Since we can view the taxicab metric as the sum of the horizontal and vertical components of the distance, to prove this theorem, we will focus our attention on these. We use the following lemma, comparing distances in to those in .
Recall we have defined the morphisms using . Then if is the inclusion map (that is, ), we can define a morphism by .
Lemma 30.
Let and be such that and are on a horizontal or vertical line segment in the unit square, on which they are distance apart (via the Euclidean metric). Then .
The idea is that a path between points on a line segment may require navigating around a hole, but the score of this path is not more than times the length of the segment. Here is a typical case:
Then, in calculating the taxicab metric, we may run into the situation where we must go around a corner to avoid a hole, but we find that this does not affect the score. The full proof is an induction on .
To prove Theorem 26 we approximate the distances in to get the required inequality by looking at corresponding points in as .
Conclusion
Stepping back, the main point of this paper has been to further the interaction between the subject of coalgebra broadly considered (including corecursive algebras) and continuous mathematics. The questions that we asked in this paper concerned the relationship between very natural and very concrete fractal sets on the one hand, and more abstract ideas like initial algebras and final coalgbebras on the other. We came to this work in order to explore these general issues. What we found in the expolaration was a set of ideas connecting category-theoretic and analytic concepts: colimits in metric spaces, short maps approximated by non-short maps, corecursive algebras as an alternative to infinite sums, and the like. We hope that the results in this paper further these connections.
References
- [1]
- [2] Jiří Adámek (1974): Free algebras and automata realizations in the language of categories. Commentationes Mathematicae Universitatis Carolinae 15(4), pp. 589–602.
- [3] Jiří Adámek, Mahdieh Haddadi & Stefan Milius (2014): Corecursive Algebras, Corecursive Monads and Bloom Monads. Log. Methods Comput. Sci. 10(3:19), p. 51 pp., 10.2168/LMCS-10(3:19)2014.
- [4] Prasit Bhattacharya, Lawrence S Moss, Jayampathy Ratnayake & Robert Rose (2013): Fractal Sets as Final Coalgebras Obtained by Completing an Initial Algebra. Topology, Algebra, and Categories in Logic, p. 157, 10.29007/pw5g.
- [5] Prasit Bhattacharya, Lawrence S. Moss, Jayampathy Ratnayake & Robert Rose (2014): Fractal Sets as Final Coalgebras Obtained by Completing an Initial Algebra, pp. 146–167. Springer International Publishing, Cham. Available at https://doi.org/10.1007/978-3-319-06880-0_7.
- [6] Venanzio Capretta, Tarmo Uustalu & Varmo Vene (2006): Recursive coalgebras from comonads. Inform. and Comput. 204, pp. 437–468, 10.1016/j.ic.2005.08.005.
- [7] Peter Freyd (1999): Real coalgebra. Post on the Categories mailing list, December 22, 1999, available at www.mta.ca/cat-dist.
- [8] Ichiro Hasuo, Bart Jacobs & Milad Niqui (2010): Coalgebraic representation theory of fractals. In: Proc. Mathematical Foundations of Programming Semantics (MFPS XXVI), 265, Elsevier, pp. 351–368, 10.1016/j.entcs.2010.08.021.
- [9] John E. Hutchinson (1981): Fractals and Self Similarity. Indiana University Mathematics Journal 30(5), pp. 713–747, 10.1512/iumj.1981.30.30055.
- [10] Tom Leinster (2011): A general theory of self-similarity. Advances in Mathematics 226(4), pp. 2935–3017, 10.1016/j.aim.2010.10.009.