Profiniteness and representability of spectra of Heyting algebras

We prove that there exist profinite Heyting algebras that are not isomorphic to the profinite completion of any Heyting algebra. This resolves an open problem from 2009. More generally, we characterize those varieties of Heyting algebras in which profinite algebras are isomorphic to profinite completions. It turns out that there exists largest such. We give different characterizations of this variety and show that it is finitely axiomatizable and locally finite. From this it follows that it is decidable whether in a finitely axiomatizable variety of Heyting algebras all profinite members are profinite completions. In addition, we introduce and characterize representable varieties of Heyting algebras, thus drawing connection to the classical problem of representing posets as prime spectra.


INTRODUCTION
An algebra is profinite if it is isomorphic to the inverse limit of an inverse system of finite algebras. This concept has its origin in the study of profinite groups. One of the basic results states that a group G is profinite if and only if it is a topological group whose topology is compact, Hausdorff, and zerodimensional (i.e., a Stone topology). This result generalizes to many settings, including semigroups, monoids, rings, modules, distributive lattices, etc. (see for instance [43,Sec. VI.2] or more recent [21,61]).
The profinite completion A of an algebra A is the inverse limit of the inverse system of its finite homomorphic images. It follows from the definition that A is a profinite algebra. However, not every profinite algebra A is isomorphic to B for some algebra B. In lattice theory, the problem of determining whether a profinite distributive lattice A is isomorphic to B for some distributive lattice B is related to Grätzer's celebrated problem of representable posets. Grätzer himself gave two formulations of this problem, for distributive lattices as for bounded distributive lattices (see [35,Problems 33 and 34,p. 156]). In this paper we will mainly concentrate on the bounded case. A poset X is representable if it is isomorphic to the prime spectrum (the poset of prime filters) of a bounded distributive lattice. Grätzer's problem asks for an internal characterization of representable posets. The same problem for prime spectra of commutative rings was posed by Kaplansky [45, pp. 5-7]. In fact, bounded distributive lattices and commutative rings with unit give rise to the same prime spectra up to isomorphism (see, e.g., [58,Thm. 1.1]). Even more is true. It is a well-known result of Hochster [37] that the prime spectra of commutative rings with unit are precisely the spectral spaces. Cornish [22] showed that these spaces form a category isomorphic to that of Priestley spaces, i.e., prime spectra of bounded distributive lattices [56,57].
It follows from Priestley duality that a poset X is representable if and only if there is a Stone topology on X such that the resulting ordered space is a Priestley space. Furthermore, in view of the work of Joyal [44] and Speed [64], a poset X is representable precisely when it is profinite. Thus, Grätzer's problem asks for a description of profinite posets, or equivalently of the posets underlying Priestley spaces.
A solution of Grätzer's problem for linearly ordered sets was given independently by Balbes [3,Thm. 9] (by lattice-theoretic means) and Lewis [48,Thm. 3.1] (by ring-theoretic means). It follows from their characterizations that representable chains are necessarily complete, whence a simple example of a chain that is not representable is given by the set of natural numbers with the usual order.
Grätzer's problem is connected to the problem of determining when a profinite bounded distributive lattice A is isomorphic to the profinite completion of some bounded distributive lattice B, as we proceed to explain. Utilizing Priestley duality, it was shown in [7,Thm. 4.4] that A is a profinite bounded distributive lattice if and only if A is isomorphic to the lattice Up(X) of all upsets (upward closed sets) of a poset X. On the other hand, by [10,Thm. 5.3], A is isomorphic to B for some bounded distributive lattice B if and only if A is isomorphic to Up(X) for some representable poset X. Consequently, if the poset X is not representable and A = Up(X), then A is not isomorphic to B for any bounded distributive lattice B [10,Cor. 5.4]. This allows us to construct easily profinite bounded distributive lattices A that are not isomorphic to profinite completions of bounded distributive lattices; for instance, take A = Up(X) where X is any chain that is not complete.
In this paper we are interested in Heyting algebras. These are special bounded distributive lattices in which the meet operation has an adjoint, usually referred to as implication. Heyting algebras have been studied extensively as they have applications to different branches of mathematics, including: • Logic (algebraic models of intuitionistic logic are Heyting algebras), • Topology (the lattice of open sets of every topological space is a Heyting algebra), • Point-free Topology (each locale is a Heyting algebra), • Domain Theory (each continuous distributive lattice is a Heyting algebra), • Topos Theory (the subobject classifier of every topos is a Heyting algebra). • Lattice Theory/Universal Algebra (every algebraic distributive lattice and hence the congruence lattice of every algebra in a congruence-distributive variety is a Heyting algebra). Grätzer's problem of representability was reformulated by Esakia for Heyting algebras in [28, Appendix A.5]. We call a poset X Esakia representable if X is isomorphic to the prime spectrum of some Heyting algebra. A poset X is image-finite if the upset ↑x := {y ∈ X : x y} is finite for each x ∈ X. For a poset X, let X fin = {x ∈ X : ↑x is finite} be the image-finite subposet of X. By [7,Thm. 3

.6], a Heyting algebra A is profinite if and only if
A is isomorphic to Up(X) for some image-finite poset X. By [10, Thm. 5.8], a Heyting algebra A is isomorphic to B for some Heyting algebra B if and only if A is isomorphic to Up(X fin ) for some Esakia representable poset X. This implies that if there is an image-finite poset X that is not isomorphic to Y fin for any Esakia representable poset Y, then Up(X) is an example of a profinite Heyting algebra that is not isomorphic to the profinite completion of any Heyting algebra [10,Cor. 5.9]. Finding such an image-finite poset is nontrivial, and was left as an open problem in [10].
We will resolve this problem by providing many such examples. In fact, we will provide a characterization of all varieties of Heyting algebras whose profinite members are profinite completions of some Heyting algebras. This we do by proving that there exists a largest such variety. We denote this variety by DHA and term its members diamond Heyting algebras. To explain the terminology, DHA is a subvariety of the variety CHA of cascade Heyting algebras of Esakia [28,Appendix A.9]. We recall that CHA is generated by Boolean cascades, i.e., algebras whose prime spectrum is a linear sum of finitely many antichains. If each antichain has at most two elements and we do not allow two "back-to-back" two-element antichains, then the poset can be viewed as a linear sum of "diamonds," and we refer to it as a diamond sequence. Let DHA be the subvariety of CHA generated by the Boolean cascades whose prime spectra are diamond sequences. This provides motivation for denoting this variety by DHA and calling its members diamond Heyting algebras. We call prime spectra of diamond Heyting algebras diamond systems. Thus, diamond sequences are special diamond systems.
Our main result states that the profinite members of a variety V of Heyting algebras are isomorphic to profinite completions of some Heyting algebras (which can always be chosen from V) if and only if V is a subvariety of DHA (Theorem 6.1). Consequently, DHA is the largest variety of Heyting algebras whose profinite members are profinite completions.
Among various characterizations of diamond Heyting algebras that we give, one is of special interest. Let P 1 , P 2 , P 3 , and P 4 be the posets shown in Figure 1. 1 The Heyting algebras Up(P i ) of upsets of these posets are shown in Figure 2. We prove that the variety of diamond Heyting algebras is axiomatized by the Jankov formulas of Up(P i ) for i = 1, . . . , 4. Consequently, the problem of determining whether a variety of Heyting algebras is such that its profinite members are profinite completions of some Heyting algebras is decidable, both for varieties presented by a finite set of equations and for varieties presented by a finite number of finite algebras (Theorem 7.1).
The Heyting algebras of upsets of P 1 , P 2 , P 3 , and P 4 .
Our methods are based on a marriage of combinatorics of infinite posets, topology, and algebra. This is made possible by the use of Esakia duality [26,28] that allows us to study Heyting algebras through the lenses of certain ordered topological spaces (known as Esakia spaces), which in turn are amenable to combinatorial principles such as Brouwer's Fan Theorem (see, e.g., [24,Thm. 3.3.20]). Our main insight is a careful analysis of the structure of the diamond systems that can be endowed with a Stone topology so that the resulting structures are Esakia spaces.
Some of our results have purely logical formulation. We recall that an intermediate logic is a consistent axiomatic extension of intuitionistic propositional logic (see, e.g., [18,Sec. 2]). These are exactly the logics that are situated between intuitionistic and classical logics and are algebraized by nontrivial varieties of Heyting algebras [14]. Interemdiate logics algebraized by varieties of diamond Heyting algebra share many properties with the well-known Gödel-Dummett logic (see, e.g., [23,Sec. 5.1] and [36,Sec. 4.2]). On the one hand, they are all finitely axiomatizable, locally tabular, and form a countable set (see Theorem 7.2). On the other hand, they are all structurally complete [60] and have the infinite Beth definability property [16] (see Theorem 7.4).
Finally, our results give a new insight on the representability problem as follows. Call a variety V of Heyting algebras representable if Up(X) ∈ V implies that X is Esakia representable. We give a full characterization of representable varieties by proving that a variety V is representable if and only if V ⊆ DHA and the depth of V is bounded by some positive integer (see Theorem 7.6). Consequently, every diamond system of bounded depth is Esakia representable. It follows that if a poset of finite depth validates the four axioms defining DHA, then it is Esakia representable. Since the axiomatization of DHA is given by Jankov formulas of the Heyting algebras of the posets P 1 , . . . , P 4 (see Figures 1 and 2), we obtain that if a poset of finite depth does not contain any of the posets P 1 , . . . , P 4 as a forbidden configuration (a p-morphic image of an upset), then it is Esakia representable. In particular, every root system (that is, a poset whose principal upsets are chains) [54] of bounded depth is Esakia representable. It remains an interesting open problem to give a full characterization of Esakia representable posets of finite depth. A solution of this problem would shed further new light on the difficult problem of Esakia representability.

HEYTING ALGEBRAS AND ESAKIA SPACES
We start by recalling that a bounded distributive lattice A is a Heyting algebra if ∧ has an adjoint → given by It is well known (see, e.g., [59,4,28]) that the class HA of Heyting algebras forms a variety (i.e., it is closed under homomorphic images, subalgebras, and direct products) and hence is equationally definable by Birkhoff's Theorem (see, e.g., [17,Thm. II.11.9]).
2.1. Esakia duality. The celebrated Esakia duality [26,28] provides a representation of Heyting algebras by means of special ordered Stone spaces, and can be viewed as a restricted version of Priestley duality [56,57] for bounded distributive lattices.
For a poset X = X, and U ⊆ X, let ↑U and ↓U be the smallest upset and downset containing U, i.e., We call U an upset if U = ↑U and a downset if U = ↓U. If U = {x}, we simply write ↑x and ↓x instead of ↑{x} and ↓{x}.
where X, τ is a Stone space (compact, Hausdorff, and zero-dimensional) and is a partial order on X that is continuous; meaning that (i) ↑x is closed for all x ∈ X; (ii) if U ⊆ X is clopen, then ↓U is clopen.
Given an Esakia space X, we denote its underlying poset by X as well.
Remark 2.2. The partial order is continuous if and only if the corresponding map ρ : X → V X from X to the Vietoris space V X, given by ρ(x) = ↑x, is a well-defined continuous map (see [26,1,46]).
As usual, we denote by cl(Y) the closure of a subset Y of a topological space. Also, we denote the set of maximal elements of a poset X by max X. The following fundamental properties of Esakia spaces will be used repeatedly in the paper. Proposition 2.3. The following conditions hold for an Esakia space X.
(i) Priestley separation axiom: for all x, y ∈ X such that x y there is a clopen upset U such that x ∈ U and y / ∈ U. (ii) Dedekind completeness: Every nonempty chain C ⊆ X has an infimum and a supremum in X.
(iii) If C is a closed subset of X, then for every x ∈ C there is y ∈ max C such that x y. (iv) For every Y ⊆ X, ↑cl(Y) = cl(↑Y). Consequently, the closure of an upset is an upset and principal upsets are closed. We recall that a p-morphism (or bounded morphism) between two posets X and Y is a map f : Definition 2.4. An Esakia morphism between Esakia spaces is a continuous p-morphism. Let ES be the category of Esakia spaces and Esakia morphisms between them.

Theorem 2.5 (Esakia duality). HA is dually equivalent to ES.
We briefly describe the contravariant functors (−) * : HA → ES and (−) * : ES → HA establishing Esakia duality. For this we first recall that for a poset X, the set Up(X) of all upsets of X forms a Heyting algebra where join and meet are set-theoretic union and intersection, and → is defined by For a Heyting algebra A, let X A be the poset of prime filters of A ordered by inclusion. Define γ A : A → Up(X A ) by γ A (a) = {x ∈ X A : a ∈ x}. Then A * = X A , τ, ⊆ is an Esakia space, where τ is the topology on X A given by the subbasis If α : A → B is a homomorphism between Heyting algebras, define α * : B * → A * by setting α * (U) = α −1 (U) for all U ⊆ B * . Then α * is an Esakia morphism, and this defines the contravariant functor (−) * : HA → ES.
For an Esakia space X, let X * be the subalgebra of Up(X) consisting of clopen upsets of X. If f : X → Y is an Esakia morphism between Esakia spaces, define f * : Then f * is a homomorphism between the Heyting algebras Y * and X * , and this defines the contravariant functor (−) * : ES → HA.
The topology of a finite Esakia space is discrete (since it is Hausdorff). Therefore, the full subcategory of ES consisting of finite Esakia spaces is isomorphic to the category of finite posets and p-morphisms between them. Consequently, Esakia duality restricts to the following: Theorem 2.6 (Finite Esakia duality). The category of finite Heyting algebras is dually equivalent to the category of finite posets and p-morphisms between them.
In addition, Stone spaces can be identified with the Esakia spaces whose underlying order is the identity. Under this identification, Esakia duality restricts to the famous Stone duality [65,66] between the categories of Boolean algebras and Stone spaces.
To characterize homomorphic images and subalgebras of a Heyting algebra, we recall the notions of Esakia subspaces and Esakia quotients. Definition 2.7. Let X be an Esakia space.
(1) An Esakia subspace (E-subspace for short) is a closed upset of X equipped with the subspace topology and the restriction of the order. (2) An Esakia equivalence (or E-partition for short) is an equivalence relation R on X satisfying for all x, y, z ∈ X: (i) if xRy and y z, then x w and wRz for some w ∈ X; (ii) if x Ry, then there is an R-saturated clopen U (a union of equivalence classes of R) such that x ∈ U and y / ∈ U.
It is well known that E-subspaces of Esakia spaces are Esakia spaces [28,Lem. 3.4.11]. In particular, closed subspaces of Stone spaces are Stone spaces.
If R is an E-partition on X, we denote by X/R the Esakia space consisting of the quotient space of X with respect to R, equipped with the partial order R defined as follows for every x, y ∈ X: x R y ⇐⇒ there are x ∈ x and y ∈ y such that x y .
The map x → x is an Esakia morphism from X to X/R, and for every Esakia morphism f : X → Y, the kernel of f is an E-partition of X [12, Thm. 2. 3.9]. An algebra A is subdirectly irreducible (SI for short) if the identity relation is completely meetirreducible, and A is finitely subdirectly irreducible (FSI for short) if the identity relation is meet-irreducible in the congruence lattice of A (see, e.g., [5,17]).
The following lemma collects some well-known consequences of Esakia duality. Lemma 2.9. Let A be a Heyting algebra.
(i) A is FSI iff its top element 1 is prime (x ∨ y = 1 implies x = 1 or y = 1), which happens iff A * is rooted (has a least element). 2.2. Depth and width in Heyting algebras. We next recall how to define finite depth and width for Esakia spaces and Heyting algebras, and prove that the set of elements of depth n (resp. width n) of an Esakia space forms an E-subspace. Definition 2.10. Let X be a poset, n a positive integer, and x ∈ X.
(1) X is said to have depth at most n if it does not contain any chain of n + 1 elements. (2) x ∈ X is said to be of depth n if the subposet ↑x has depth n.
(3) x ∈ X is said to be of width n if ↑x does not contain any antichain of n + 1 elements. (4) X is said to have width at most n if every x ∈ X is of width n. Definition 2.11. Let A be a Heyting algebra and n a positive integer.
(1) A has depth at most n if A * has depth at most n. When this is the case, we write d(A) n.
(2) A has depth exactly n if d(A) n and d(A) n − 1.
(3) A has width at most n if A * has width at most n. When this is the case, we write w(A) n. The notion of depth originates in [38], while width was introduced for modal logics above K4 in [30], and was adapted to Heyting algebras in [63].
Given a Heyting algebra A and a formula ϕ, we write A ϕ as a shorthand for A ϕ ≈ 1. In this case, we say that ϕ is valid in A. The following result is well known.
Consequently, the class D n of Heyting algebras of depth at most n is a variety.
(ii) w(A) n iff the formula w n is valid in A, where Consequently, the class W n of Heyting algebras of width at most n is a variety.
Heyting algebras of width at most one are called Gödel algebras [36,Sec. 4.2]. In view of the above result, they form a variety which, moreover, algebraizes the Gödel-Dummett logic [25]. Posets of width at most one have been called root systems and coincide with disjoint unions of posets whose order duals are trees [54]. Proposition 2.13. Let X be an Esakia space and n a positive integer.
(i) The set of points of X of depth n is an E-subspace of X.
(ii) The set of points of X of width n is an E-subspace of X.
Proof. Condition (i) originates in [6,Lem. 7]. Thus, we only give a proof of (ii). Let X n be the set of points of X of width n. Since x y implies ↑y ⊆ ↑x, it is clear that x ∈ X n implies y ∈ X n . Therefore, X n is an upset of X. Thus, it is sufficient to show that X n is closed in X. Since X n is an upset, so is its closure cl(X n ) by Proposition 2.3(iv). Thus, cl(X n ) is an E-subspace of X.
Let A be the Heyting algebra of clopen upsets of cl(X n ). For each x ∈ X, we have that ↑x is an E-subspace of X by Proposition 2.3(iv). Let A x be the Heyting algebra of clopen upsets of ↑x. Since for each x ∈ X n we have ↑x ⊆ X n , we see that A x ∈ W n . Moreover, since X n is dense in cl(X n ), the Heyting algebra A is a subalgebra of the product of {A x : x ∈ X n } [28, Appendix A.1]. Therefore, A ∈ W n . Thus, the width of cl(X n ) is n by Theorem 2.12(ii). Consequently, cl(X n ) = X n , and hence X n is closed in X.
Notice that, by interpreting X n as the set of all elements of X of depth n, the above argument becomes a proof of (i).
Remark 2.14. The above result fails for Priestley spaces. To see this, let X be the one-point compactification of an infinite discrete space Y. We endow X with a partial order by setting x y if and only if x = y or x is the unique limit point of X. It is well known and easy to check that the resulting ordered topological space is a Priestley space in which max X is dense. Thus, max X is the set of points of X of both depth and width 1. But its closure is X, whose depth is 2 and width is infinite.
We next recall the following definition from the introduction.

Definition 2.15.
For an Esakia space X, let X fin = X fin , be the subposet of X where We call X fin the image-finite part of X.
The next corollary to Proposition 2.13 will be used throughout the paper.
Corollary 2.16. Let X be a poset of depth and width n for some positive integer n. If there exists an Esakia space whose image-finite part is X, then there is a Stone topology τ on X such that X, τ is an Esakia space.
Proof. Suppose that X is the image-finite part of an Esakia space Y. Let Z be the set of elements of Y of depth and width n. By Proposition 2.13, Z is an E-subspace of Y. Therefore, it is sufficient to show that X = Z. By assumption, X has depth and width n. Since X is an upset of Y, we see that X ⊆ Z. To prove the other inclusion, let z ∈ Z. Since z has depth and width n in Y, it belongs to the image-finite part of Y, so z ∈ X. Thus, X = Z.

Profinite algebras and completions.
We recall that an inverse system of Heyting algebras is a family {A i : i ∈ I}, indexed by a directed poset I, together with a family of homomorphisms α ij : A j → A i for i j, satisfying: (i) α kj = α ki • α ij for all k i j; (ii) α ii is the identity homomorphism for each i ∈ I. The inverse limit of such an inverse system is a Heyting algebra A together with a family α i : A → A i of homomorphisms satisfying α ij • α j = α i for each i j, and having the following universal mapping property: For each Heyting algebra B and each family of homomorphisms β i : It is well known that A is isomorphic to the subalgebra of the product ∏ i∈I A i consisting of For inverse limits see, e.g., [2,Ex. 13.13].
Definition 2.17. We call a Heyting algebra A profinite if it is isomorphic to the inverse limit of an inverse system of finite Heyting algebras.
Let A be a Heyting algebra and θ a congruence on A. We say θ has finite index if the quotient algebra A/θ is finite. Let I be the set of congruences of A of finite index. If θ ⊆ φ are congruences of A, then there is a canonical homomorphism π φθ : A/θ → A/φ given by π φθ ( a θ ) = a φ . Furthermore, if θ and φ have finite index, then so does θ ∩ φ because A/(θ ∩ φ) embeds into A/θ × A/φ via the map given by a θ∩φ −→ a θ , a φ , see, e.g., [17, Ch. II, Lem. 8.2]. Therefore, (I, ⊇) is a directed poset, and {A/θ : θ ∈ I} endowed with the homomorphisms π φθ is an inverse system.

Definition 2.18.
The profinite completion A of a Heyting algebra A is the inverse limit of the inverse system described above.
Given a class K of similar algebras, we denote by I(K), H(K), S(K), and P(K) the classes of isomorphic copies, homomorphic images, subalgebras, and direct products of elements of K, respectively. When K = {A}, we write I(A) as a shorthand for I({A}). The same convention applies to H, S, and P.
Remark 2.19. If a Heyting algebra A is a profinite completion of some Heyting algebra B, then A is also the profinite completion of some Heyting algebra C that belongs to the variety generated by A; namely, HSP(A). This is because A is also the profinite completion of C := B/θ, where θ is the intersection of all the congruences {θ i : i ∈ I} of B of finite index. Since B/θ j ∈ H(A) for all j ∈ I and B/θ ∈ ISP({B/θ i :∈ I}), we obtain that C ∈ ISPH(A) ⊆ HSP(A).
By [9], A is a profinite Heyting algebra if and only if there is a compact Hausdorff topology on A under which the Heyting operations are continuous. We will rely on the following characterization of profinite Heyting algebras and profinite completions of Heyting algebras. Theorem 2.20. Let A be a Heyting algebra and X its Esakia dual.

.6] A is a profinite Heyting algebra if and only if there is an image-finite poset Y such that
Clearly each profinite completion is a profinite Heyting algebra. However, as we will see, there are profinite Heyting algebras that are not isomorphic to the profinite completion of any Heyting algebra.

CASCADE HEYTING ALGEBRAS
In this section we recall cascade Heyting algebras and their dual description. We also give their axiomatization via Jankov formulas.
Let X 1 , . . . , X n be Esakia spaces. We recall that the linear sum X 1 ⊕ · · · ⊕ X n is defined as the disjoint union of the spaces X 1 , . . . , X n , where the partial order is given by x y ⇐⇒ (x, y ∈ X i and x i y for some i n) or (x ∈ X i and y ∈ X j for some j < i n).
Figuratively speaking, we are forming a tower by putting X n , . . . , X 1 on top of each other. We emphasize that X 1 is at the top of the tower and X n is at the bottom. It is well known that a linear sum of Esakia spaces is again an Esakia space [28,Prop. A.8.6]. If X is the linear sum of X 1 , . . . , X n and A 1 , . . . , A n are dual Heyting algebras to X 1 , . . . , X n , then the dual Heyting algebra A of X is obtained by putting the algebras A 1 , . . . , A n on top of each other and identifying the top element of A i with the bottom element of A i+1 (see, e.g., [53,Lem. 5

.1]).
If each X i is a Stone space, then the linear sum X = X 1 ⊕ · · · ⊕ X n is a tower of antichains. Moreover, the dual of each X i is a Boolean algebra. Consequently, Esakia called a Heyting algebra whose dual Esakia space is a linear sum of Stone spaces a Boolean cascade [28, Appendix A.9] .
Thus, the logic WPL of the weak Pierce law is algebraized by the variety CHA of cascade Heyting agebras.

Theorem 3.3. CHA is locally finite.
In view of the above result and the fact that the class of Boolean cascades is closed under subalgebras, CHA is generated by finite Boolean cascades. Hence, for many purposes, it is sufficient to work with linear sums of finite antichains.
Several useful characterizations of cascade Heyting algebras were given by Esakia [28] and Mardaev [51]. The Mardaev characterization utilizes the technique of Jankov formulas [40,41,42]. We recall that with each finite SI Heyting algebra A, we can associate the Jankov formula J (A) of A, which axiomatizes the largest variety of Heyting algebras omitting the algebra A. By Theorem 2.6 and Lemma 2.9(i), finite SI algebras correspond to finite rooted posets. Because of this, given a finite rooted poset X, we denote by J (X) the Jankov formula of the finite SI algebra Up(X). In view of Lemma 2.9, Jankov's Lemma can be rephrased as follows.
Lemma 3.5. Let X, Y be Esakia spaces with X finite and rooted. Then Y * J (X) if and only if X is not a p-morphic image of an E-subspace of Y.
Definition 3.6 ([28, pg. 86]). A poset X is said to satisfy the three point rule provided for every distinct x, y, z ∈ X, if x and y are incomparable, then x z implies y z.
In the following theorem, P 5 and P 6 are the posets depicted in Figure 3.
. The posets P 5 and P 6 .
Theorem 3.7. For a Heyting algebra A, the following are equivalent.
(i) A is a cascade Heyting algebra; (ii) ↑x satisfies the three point rule for each x ∈ A * ; (iii) A validates the Jankov formulas J (P 2 ), J (P 5 ), and J (P 6 ).
Proof sketch. The equivalence of Conditions (i) and (ii) goes back to [27]; see also [ Let CHA n = CHA ∩ W n . In other words, CHA n is the subvariety of CHA consisting of cascade Heyting algebras of width n. We conclude this section by showing that CHA n can be axiomatized by the Jankov formulas of the "(n + 1)-fork" F n+1 and "(n + 1)-diamond" D n+1 . For every positive integer m, let F m and D m be the finite rooted posets depicted in Figure 4. Our proof is based on the following two lemmas.
Proof. Since A ∈ W n and W n is a variety, each B ∈ SH(A) is also in W n . Therefore, each such B has width n. On the other hand, the width of both Up(F n+1 ) and Up(D n+1 ) is n + 1. Therefore, neither belong to SH(A). Thus, by Jankov's Lemma, A validates J (F n+1 ) and J (D n+1 ). Lemma 3.9. If A is a finite subdirectly irreducible cascade Heyting algebra and A / ∈ W n , then A refutes either J (F n+1 ) or J (D n+1 ).
Proof. By finite Esakia duality, since A is finite and subdirectly irreducible, we may assume without loss of generality that A is Up(X) for some finite rooted poset X. In addition, since A is a finite cascade Heyting algebra and X is rooted, X satisfies the three point rule by Theorem 3.7. It follows that X is a linear sum of finite antichains. Since A / ∈ W n and X is rooted, there is an (n + 1)-element antichain C in X. Then C is a subset of one of the antichains whose linear sum is X. Let x be an immediate predecessor of the elements of C and let Q = ↑x. Then Q is an upset of X. If C ⊆ max X, then Q is isomorphic to F n+1 , so Up(F n+1 ) ∈ H(A). Therefore, by Jankov's Lemma, A J (F n+1 ). Otherwise, define an equivalence relation R on Q by identifying all y / ∈ C ∪ {x}. It is straightforward to check that R is an E-partition of Q and that Q/R is isomorphic to D n+1 . Therefore, J (D n+1 ) ∈ SH(A). Thus, by Jankov's Lemma, A J (D n+1 ).
Putting together Lemmas 3.8 and 3.9 yields the following: Theorem 3.10. CHA n is axiomatized over CHA by the Jankov formulas J (F n+1 ) and J (D n+1 ).
Proof. It follows from Lemmas 3.8 and 3.9 that CHA n and the subvariety of CHA axiomatized by J (F n+1 ) and J (D n+1 ) have the same finite subdirectly irreducible members. The result follows since CHA is locally finite by Theorem 3.3.
Remark 3.11. The description of algebras of width n given in Theorem 3.10 cannot be extended to arbitrary Heyting algebras. For instance, the Heyting algebra of uspets of the poset P 7 depicted in Figure 5 validates J (F 3 ) and J (D 3 ) but is not of width 2. Consequently, W n is not axiomatized over HA by J (F n+1 ) and J (D n+1 ).

DIAMOND SYSTEMS AND ALGEBRAS
In this section we introduce the key concept of diamond systems and the corresponding variety DHA of diamond Heyting algebras. We prove that DHA is finitely axiomatizable by Jankov formulas. Definition 4.1. We call a poset X a diamond system if it satisfies the following conditions: (D1) ↑x satisfies the three point rule for each x ∈ X; (D2) X has width at most two; (D3) Principal upsets are upward directed in X; If X is in addition downward directed, then we call it a diamond sequence.
Notice that finite diamond sequences are simply linear sums of antichains of size 2 in which we do not allow two "back-to-back" antichains. Typical examples of diamond sequences are displayed in Figure 6, thus justifying the name. An image-finite diamond system that is not a diamond sequence is depicted in Figure 7. Observe that root systems coincide with diamond systems of width at most one.
Image-finite diamond systems admit a simple characterization in terms of linear sums.

Proposition 4.2.
An image-finite poset X is a diamond system if and only if for every x ∈ X there are posets Y 1 , . . . , Y n such that ↑x is order-isomorphic to Y 1 ⊕ · · · ⊕ Y n , where Y 1 is a singleton, and for all j > 1, either Y j is a singleton or isomorphic to P 3 .  · · · · · · · · · · · · · · FIGURE 7. An image-finite diamond system.
Proof. The "if" part is straightforward. To prove the "only if" part, consider an image-finite diamond system X and an element x ∈ X. Then ↑x is finite since X is image-finite. Therefore, by (D1), ↑x can be partitioned into a finite family of disjoint nonempty sets X 1 , . . . , X m such that X 1 = {x} and for every y, z x, y z ⇐⇒ either y = z or (y ∈ X i and z ∈ X j for some i < j). Notice that, as X has width at most two by (D2), each X i has at most two elements. Furthermore, if X i has two elements, then i − 1 is positive, since X 1 is a singleton. Together with Condition (D4), this implies that if X i has two elements, then X i−1 exists and has one element. Thus, there are posets Y 1 , . . . , Y n such that ↑x is order-isomorphic to the sum Y 1 ⊕ · · · ⊕ Y n where each Y i is either a singleton or isomorphic to P 3 . To conclude the proof, it only remains to show that Y 1 is a singleton. But this is a consequence of the fact that X is upward directed by (D3).
Notice that the assumption that X is image-finite in the above result is essential since the chain of natural numbers (or the second poset in Figure 6) are diamond systems that do not satisfy Proposition 4.2. Notice that, by definition, DHA is a subvariety of CHA. Furthermore, since the variety GA of Gödel algebra is generated by the algebras of upsets of finite chains, which are diamond sequences, we obtain that GA is a subvariety of DA.
Diamond systems and algebras are related by the following theorem, the hardest implication of which is (iv)⇒(ii). (i) A is a diamond Heyting algebra; (ii) A * is a diamond system; (iii) Every principal upset in A * is a diamond sequence; (iv) A validates the Jankov formulas J (P 1 ), J (P 2 ), J (P 3 ), and J (P 4 ).
Proof. (i)⇒(iv): Notice that, by definition, diamond Heyting algebras are cascade Heyting algebras and have width 2. Hence, by Theorem 3.7 and Lemma 3.10, they validate J (P 1 ) and J (P 2 ). It only remains to prove that diamond Heyting algebras validate J (P 3 ) and J (P 4 ). In view of Lemma 3.5, it suffices to show that P 3 and P 4 cannot be obtained as p-morphic images of upsets of finite diamond sequences. To this end, let X be a finite diamond sequence. If X is empty, we are done. Then suppose that X = ∅. In this case, X has a maximum, whence every nonempty p-morphic image of an upset of X has also a maximum. It follows that P 3 cannot be a p-morphic image of an upset of X. The fact that P 4 is not a p-morphic image of an upset of X follows from the fact that, by Proposition 4.2, X can be viewed as linear sum Y 1 ⊕ · · · ⊕ Y n , where Y 1 is a singleton, and for all j > 1, either Y j is a singleton or isomorphic to P 3 .
(iv)⇒(ii): First we prove that A is a cascade Heyting algebra. To this end, observe that P 3 can be obtained as a p-morphic image of an upset of both P 5 and P 6 . Consequently, if a variety of Heyting algebras contains either Up(P 5 ) or Up(P 6 ), it also contains Up(P 3 ). From the fact that A validates J (P 3 ) it follows that the variety generated by A omits Up(P 3 ), whence it also omits Up(P 5 ) and Up(P 6 ). We obtain that the Jankov formulas J (P 5 ) and J (P 6 ) are valid in A. Recall also that, by assumption, A validates J (P 2 ). Hence, by Theorem 3.7, we conclude that A is a cascade Heyting algebra. From the same theorem it follows that principal upsets in A * satisfy the three point rule. Thus, A * satisfies Condition (D1).
We next prove that A * satisfies Condition (D2), i.e., that it has width 2. In view of Theorem 3.10 it suffices to prove that A validates J (F 3 ) and J (D 3 ). Observe that D 3 = P 1 and that A validates J (P 1 ) by assumption. On the other hand, P 3 is a p-morphic image of F 3 . It follows that if a variety of Heyting algebras contains Up(F 3 ), then it also contains Up(P 3 ). Since A validates J (P 3 ), the variety generated by A omits Up(P 3 ). It follows that the variety generated by A also omits Up(F 3 ), whence A validates J (F 3 ). Thus, A * has width 2.
The next two claims conclude the proof that A * is a diamond system. Proof. Suppose not. Then there are x, y, z ∈ A * such that x y, z and ↑y ∩ ↑z = ∅. As principal upsets are closed, we can apply Proposition 2.3(iii) to obtain that both ↑y and ↑z contain maximal elements. Since ↑y ∩ ↑z = ∅, we may assume without loss of generality that these maximal elements are y and z. Similarly, as principal downsets are closed, Proposition 2.3(iii) implies that there is an element that is maximal in ↓z ∩ ↓y. We may assume without loss of generality that this element is x. Thus, y and z are maximal and x is maximal among the lower bounds of y and z. We show that ↑x = {x, y, z}.
The inclusion from right to left is clear. Suppose, with a view to contradiction, that the other inclusion fails. Then there is a > x different from y and z. Since A * has width 2 and y and z are incomparable (since ↑y ∩ ↑z = ∅), a is comparable either with y or z. By symmetry we may assume that a is comparable with y. Since y is maximal and a = y, we get a < y. Because x < a < y and x is maximal among the lower bounds of y and z, we have a z. As z is maximal, this implies that a and z are incomparable. Since x a, y, z and a y and a, y, z are different, the three point rule yields a z, a contradiction. Since principal upsets are closed in Esakia spaces, ↑x is the universe of an E-subspace X of A * . From (1) it follows that X is isomorphic to P 3 endowed with the discrete topology. Hence, by Lemma 2.9(ii), Up(P 3 ) ∈ H(A) ⊆ DHA. But this contradicts the fact that A validates J (P 3 ). Claim 4.6. For every ⊥, x, y, z, v, ∈ A * , if ⊥ x, y z, v , there is w ∈ A * such that x, y w z, v.
Proof. Suppose, with a view to contradiction, that there are ⊥, x, y, z, v, ∈ A * such that ⊥ x, y z, v and ↑x ∩ ↑y ∩ ↓z ∩ ↓v = ∅. Notice that x and y must be incomparable, otherwise {x, y} ∩ ↑x ∩ ↑y ∩ ↓z ∩ ↓v = ∅, a contradiction. Similarly, z is incomparable with v. Consequently, the elements ⊥, x, y, z, v, are all different.
Recall that ⊥ is a lower bound of x and y. Therefore, since principal donwsets are closed, Proposition 2.3(iii) implies the existence of a maximal lower bound of x and y. We may assume without loss of generality that this maximal lower bound is ⊥. Bearing this in mind, we will prove that ↑⊥ = {⊥} ∪ ↑x ∪ ↑y.
The inclusion from right to left is clear. To prove the other inclusion, consider an element w > ⊥ different from x and y. As A * has width 2, w must be comparable either with x or y. By symmetry we may assume that w is comparable with x. If w x, then w ∈ {⊥} ∪ ↑x ∪ ↑y, as desired. Otherwise, w < x. We show this leads to a contradiction. Since ⊥ is a maximal lower bound of x and y and ⊥ < w x, we get w y. Moreover, y w, since x and y are incomparable and w x. Thus, x, y, w are different, y and w are incomparable and w x. By the three point rule, y x, a contradiction. This establishes (2). Furthermore, observe that ↑x ∪ ↑y = {x, y, z, v} ∪ (↑z ∩ ↑v).
The inclusion from right to left is clear. Suppose, with a view to contradiction, that the other inclusion fails. Then there is w ∈ A * {x, y, z, v} such that w ∈ ↑x ∪ ↑y and w / ∈ ↑z ∩ ↑v. Since w ∈ ↑x ∪ ↑y, by symmetry we may assume that x w. Similarly, as w / ∈ ↑z ∩ ↑v, by symmetry we may assume that z w. Since A * has width 2, from x w, z, v and the fact that z and v are incomparable it follows that w is comparable either with z or v. We have two cases: either w ∈ ↓z ∪ ↓v or w / ∈ ↓z ∪ ↓v. First suppose that w ∈ ↓z ∪ ↓v. Since w / ∈ {x, z, v}, either x < w < z or x < w < v. By symmetry, we may assume that x < w < z. Since x and y are incomparable, ⊥ x, y, and x < w, we can apply the three point rule to obtain y w. It follows that w ∈ ↑x ∩ ↑y ∩ ↓z. Together with the assumption that ↑x ∩ ↑y ∩ ↓z ∩ ↓v is empty, this yields w v. Furthermore, from w z and the fact that z and v are incomparable it follows that v w. Hence, w and v are also incomparable. Therefore, since x w, v and w < z, we can apply the three point rule to obtain v < z, a contradiction.
Next we consider the case where w / ∈ ↓z ∪ ↓v. Together with the fact that w is comparable either with z or v and z w, this implies v < w. Since z, v, w are distinct upper bounds of x such that z and v are incomparable and v w, we can apply the three point rule to obtain z v, a contradiction. This establishes (3).
Since ↑⊥ is a closed upset of A * , it is the universe of an E-subspace X of A * . Similarly, ↑z ∩ ↑v is closed in X. In view of (4), this implies that {⊥, x, y, z, v} is open in X. As X is Hausdorff, we conclude that the points ⊥, x, y, z, v are isolated in X. Furthermore, {⊥, x, y, z, v} is closed because it is finite and X is Hausdorff. By (4) We denote the elements of the poset P 4 as follows: Bearing this in mind, consider the map f : X → P 4 defined by Notice that f is a well-defined p-morphism by (4). Moreover, when P 4 is endowed with the discrete topology, f becomes an Esakia morphism. This is because f −1 (k) is open in X for every k ∈ P 4 by (5). Thus, there is an E-partition R of X such that X/R ∼ = P 4 . Together with the fact that X is an E-subspace of A * , this implies that Up(P 4 ) ∈ ISH(A) by Lemma 2.9(ii, iii). But this contradicts the fact that A validates J (P 4 ).
(ii)⇒(iii): Immediate from the definitions. (iii)⇒(i): For each x ∈ A * , let A x be the algebra dual to the E-subspace of A * with the universe ↑x. From Esakia duality it follows that A is a subalgebra of the product of the family {A x : x ∈ X}. Since varieties are closed under S and P, it suffices to prove that each A x is a diamond Heyting algebra. To this end, take some x ∈ A * . Since A * is a diamond system, the dual ↑x of A * is a diamond sequence. Accordingly, it satisfies the three point rule, whence A x is a cascade Heyting algebra by Theorem 3.7. Hence, A x is locally finite by Theorem 3.3. It follows that A x belongs to the variety generated by its finite subalgebras. Therefore, to conclude the proof, it suffices to show that all finite subalgebras of A x are diamond Heyting algebras. Consider one such algebra B. The dual space B * is a finite p-morphic image of the diamond sequence ↑x. Thus, B * is a finite diamond sequence, whence B is a diamond Heyting algebra by definition. We close this section with the following corollary to Theorem 4.4 which will be used in Section 6. Corollary 4.8. Let X be an image-finite poset. If Up(X) is a diamond algebra, then X is a diamond system.
Proof. As Up(X) is a diamond algebra, by Theorem 4.4 the poset underlying Up(X) * is a diamond system. It is well known that the map ε : X → Up(X) * , defined by is a well-defined order embedding. Consequently, from the fact that Up(X) * is a diamond system it follows that X satisfies Conditions (D1) and (D2).
Suppose with a view to contradiction, that X does not satisfy Condition (D3). Then there are x, y, z ∈ X such that x y, z and ↑y ∩ ↑z = ∅. As X is image-finite, ↑x is finite. Thus, we may assume without loss of generality that y and z are maximal and that x is maximal among the lower bounds of y and z. Then we can repeat the proof of Claim 4.5 and obtain the desired contradiction.
It only remains to prove that X satisfies Condition (D4). Suppose not. Then there are ⊥, x, y, z, v, ∈ X such that ⊥ x, y z, v and ↑x ∩ ↑y ∩ ↓z ∩ ↓v = ∅. Since X is image-finite, the upset ↑⊥ is finite, whence we may assume without loss of generality that ⊥ is maximal among the lower bounds of x and y. Thus, repeating the proof of Claim 4.6 we obtain a contradiction, as desired.

FORBIDDEN POSETS
The aim of this section is to prove the following result. To this end, recall that a poset X, is Esakia representable if there exists a topology τ on X such that X, , τ is an Esakia space. In order to establish Theorem 5.1, we require the following: Proposition 5.2. If P ∈ {P 1 , P 2 , P 3 , P 4 }, then there is a poset X which is a p-morphic image of a disjoint union of copies of P and is not Esakia representable.
To derive Theorem 5.1 from Proposition 5.2 we recall the following well-known fact (the proof of which can essentially be found in [15,Thm. 5 Proof of Theorem 5.1. We reason by contraposition. Suppose V is a variety of Heyting algebras such that V DHA. By Corollary 4.7, DHA is axiomatized by the Jankov formulas J (P 1 ), J (P 2 ), J (P 3 ), and J (P 4 ). Therefore, V DHA implies Consequently, there is P ∈ {P 1 , P 2 , P 3 , P 4 } such that Up(P) ∈ V. By Proposition 5.2, there is a p-morphic image X of a disjoint union of copies of P that is not Esakia representable. We have Up(X) ∈ V by Lemma 5.3. Furthermore, as P has bounded depth and width, so does X. In particular, this guarantees that X is image-finite, and hence Up(X) is a profinite member of V by Theorem 2.20(i).
On the other hand, by Theorem 2.20(ii) and Corollary 2.16, the algebra Up(X) is a profinite completion if and only if X is Esakia representable. As the latter is not the case, we conclude that Up(X) is not a profinite completion. Thus, V has a profinite member that is not a profinite completion.
The rest of this section is devoted to proving Proposition 5.2.
Definition 5.4. Let X be a poset and D, E ⊆ X. We say that (D, E) is a surjective matching if the following conditions hold: (M1) D ∩ E = ∅; (M2) for every x ∈ D there is y ∈ E such that y < x; (M3) for every y ∈ E there is x ∈ D such that y < x; (M4) for every x, z ∈ D and y ∈ E, if y < x, z then x = z.
A surjective matching (D, E) is said to be a bijective matching if it satisfies the following additional conditions: (M5) for every x, y ∈ D ∪ E, if y < x then x ∈ D and y ∈ E; (M6) for every x ∈ D and y, z ∈ E, if y, z < x then y = z. In this case, E ∪ D becomes a disjoint union of two-element chains when endowed with the order inherited from X. If E and F are compact, then so is D.
Proof. Suppose that E is compact and consider an open cover K of D. For U ∈ K, define U = ↓(U (E ∪ F)) and K = {U : U ∈ K}.
We will prove that K is an open cover of E.
Therefore, it remains to show that U ∩ D ⊆ U.
For this we first show that (↑D) D ⊆ F. (6) Let x ∈ (↑D) D. We show that x / ∈ E. From x ∈ (↑D) D it follows that there is y ∈ D such that y < x. If x ∈ E, by Condition (M3) there is z ∈ D such that x < z. Since y ∈ D, by Condition (M2), v < y for some v ∈ E. Now, v ∈ E and v < y, z ∈ D. Therefore, y = z by Condition (M4), contradicting y < x < z. This establishes x / ∈ E. Consequently, concluding the proof of (6). Now suppose x ∈ U ∩ D. By (6), Therefore, there is y ∈ U ((↑D) D) such that x y. From x ∈ D and x y, it follows that y ∈ ↑D. Together with y ∈ U ((↑D) D), this implies y ∈ D. Finally, in view of x ∈ D, by Condition (M2) there is z ∈ E such that z < x. Consequently, z x, y ∈ D. By Condition (M4) we obtain x = y, whence x = y ∈ U. Hence, U ∩ D ⊆ U.
(iii): Suppose x ∈ D and y ∈ E with y < x. Since U is a downset and y < x, if x ∈ U , then y ∈ U . To prove the converse, suppose that y ∈ U . Then there is z ∈ U (E ∪ F) such that y z. Notice that z ∈ ↑E as z y ∈ E. Together with z / ∈ F, this implies z ∈ D ∪ E. Furthermore, since z / ∈ E, we obtain z ∈ D, whence y ∈ E, x, z ∈ D, and y x, z. Thus, by Condition (M4), x = z ∈ U . Now, observe that K is a family of open sets by Condition (i) of the Claim. We prove that it is a cover of E. Let y ∈ E. By Condition (M3), there is x ∈ D such that y < x. Since K is a cover of D, by Condition (ii) of the Claim, the same holds for K . Thus, x ∈ U for some U ∈ K . By Condition (iii) of the Claim, we conclude that y ∈ U . Hence, K is an open cover of E.
Since E is compact, K has a finite subcover {U 1 , . . . , U n }. We prove that {U 1 , . . . , U n } is a cover of D. Let x ∈ D. By Condition (M2), there is y ∈ E such that y < x. Therefore, y ∈ U i for some i. Furthermore, x ∈ U i by Condition (iii) of the Claim. Thus, applying Condition (ii) of the Claim yields that x ∈ U i . Consequently, D is compact.
We prove Proposition 5.2 by contradiction. Once we have a candidate X, for a poset which is not Esakia representable, we suppose that there is a topology τ on X such that X, , τ is an Esakia space. Then we find a bijective matching (D, E) in X such that E is compact and D is not, a contradiction with the Matching Lemma.
For the compactness of E we use the fact that in Esakia spaces principal downsets are closed, and hence compact. In the part of the proof regarding P 1 and P 2 , the set E has the form ↓x ∩ ↓y for distinct elements x and y. When dealing with P 3 , we take E of the form ↓x {x}, where x is an isolated point. The case of P 4 will be reduced to that of P 3 . The non-compact set D will be constructed with the help of the following known result. We give a short proof for the sake of completeness. Lemma 5.7. Let X be a Hausdorff space and Y an infinite subset of it. There is y ∈ Y such that for every finite subset Z of Y the set Y ({y} ∪ Z) is not compact in X.
Proof. First suppose that Y is not compact. In this case, subtracting from Y any finite set gives a noncompact set. Thus, we can choose any y ∈ Y. Next suppose that Y is compact. Since Y is infinite, this implies that Y has a limit point y, i.e., an element y ∈ Y such that every open neighbourhood U of y contains an element of Y {y}. To conclude the proof, it suffices to show that Y {y} is not compact (as this implies that subtracting from Y {y} any finite set produces a noncompact set). Since Lastly, we make use of the following observation. Lemma 5.8. Let X and Y be posets and min X the set of minimal elements of X. If X = ↑min X and Y ∼ = ↑x for every x ∈ min X, then X is a p-morphic image of a disjoint union of copies of Y.
Proof. For each x ∈ min X, let Y x be a copy of Y and let f x : Y x → ↑x be an order-isomorphism. We let Z be the disjoint union of the various Y x . Then the union of the maps f x is a well-defined p-morphism f : Z → X, which is onto since X = ↑min X. Thus, X is a p-morphic image of a disjoint union of copies of Y.
Proof of Proposition 5.2. The proof is divided into four cases, corresponding to the posets P 1 , P 2 , P 3 , and P 4 .
The case of P 1 . We construct a p-morphic image X of a disjoint union of copies of P 1 that is not Esakia representable. for every x, y ∈ X, x y ⇐⇒ either x = y or y = or (x = ⊥ {n,m,k} and y ∈ {n, m, k} for some n, m, k ∈ N).
By Lemma 5.8, X is a p-morphic image of a disjoint union of copies of P 1 . Therefore, it only remains to prove that X is not Esakia representable. Suppose the contrary, with a view to contradiction. Then there is an Esakia space X, , τ . Choose a natural number k and define Y = N {k}. By Lemma 5.7, there is m ∈ N {k} such that the set     Furthermore, the set is finite. Consequently, as X is a Hausdorff, F is closed. In order to obtain a contradiction with the Matching Lemma, it only remains to prove that (D, E) is a surjective matching in X. But this follows immediately from the construction of X and (D, E), as illustrated in Figure 8.
The case of P 2 . We construct a p-morphic image X of a disjoint union of copies of P 2 that is not Esakia representable. Let N = {1 , 2 , 3 , . . .} be a disjoint copy of the set N of natural numbers. For every pair of distinct natural numbers n and k, take a new element ⊥ n,k . Consider two new elements and σ and define X = N ∪ N ∪ { , σ} ∪ {⊥ n,k : n and k are distinct natural numbers}; for every x, y ∈ X, x y ⇐⇒ either x = y or y = or (y = σ and x ∈ X (N ∪ { })) or (x = ⊥ n,k and y ∈ {n, k } for some n, k ∈ N).
By Lemma 5.8, X is a p-morphic image of a disjoint union of copies of P 2 .
Suppose, with a view to contradiction, that X is Esakia representable. Then there is an Esakia space X, , τ . By Lemma 5.7, there exists a natural number k such that N {k} is not compact in X. Define D = N {k} and E = {⊥ n,k : n ∈ D} = ↓k ∩ ↓σ.
Then E is closed, hence compact. Moreover, as illustrated in Figure 9, the set is finite. Consequently, as X is Hausdorff, F is closed. In order to obtain a contradiction with Matching Lemma, it only remains to prove that (D, E) is a surjective matching in X. But this is a direct consequence of the construction of X and (D, E), as shown in Figure 9.
. . . The case of P 3 . We follow the same pattern as in the previous two cases. First, we construct a poset X which is a p-morphic image of a disjoint union of copies of P 3 . For every pair of integers n and k such that n + 1 < k, consider a new element ⊥ {n,k} and define X = Z ∪ {⊥ {n,k} : n, k ∈ Z and n + 1 < k}; for every x, y ∈ X, x y ⇐⇒ either x = y or (x = ⊥ {n,k} and y ∈ {n, k} for some n, k ∈ N).
By Lemma 5.8, X is a p-morphic image of a disjoint union of copies of P 3 . It only remains to show that X is not Esakia representable. Suppose the contrary, with a view to contradiction. Then there exists an Esakia space X, , τ . As in in the previous cases, we need to find a surjective matching (D, E) in X such that E is compact, but D is not. To this end, we rely on the following: Theorem 5.9 ([62,Thm. 8.5.4]). Every countable compact Hausdorff space has an isolated point.
We shall construct a bijective matching in X with the aid of the following: Claim 5.10. There exists an integer k that is isolated in X and such that Z {k − 1, k, k + 1} is not compact in X.
Proof. Notice that Z is the set of maximal elements of X. Therefore, by Proposition 2.13, Z is closed in X. This means that the subspace Z of X is a Stone space. Thus, we can apply Theorem 5.9, obtaining that Z has an isolated point x, i.e., a point x such that {x} is open in Z. Since Z is compact and infinite, it must have a limit point. Hence, Z is the union of the two disjoint nonempty sets, respectively, of isolated points in Z and of limits points in Z. As a consequence, there exist two consecutive integers such that one of them is a limit point in Z and the other is an isolated point in Z (otherwise either the set of isolated or limit points in Z would be empty).
Let k be the isolated point in this pair. Then either k − 1 or k + 1 is a limit point in Z, whence the set Z {k−1, k, k+1} is not compact in Z, and hence in X. To conclude the proof, it only remains to show that k is isolated in X too. Since k is isolated in Z, there exists an open set U of X such that U ∩ Z = {k}. Let V = X ↓(X U) = {x ∈ X : ↑x ⊆ U}. As downsets of closed sets are closed in Esakia spaces, V is open in X. Furthermore, V Z = ∅ as every element in X Z has exactly two successors in Z and one of them should be different from k. Together with the fact that U ∩ Z = {k}, this yields that V = {k}. Consequently, k is isolated in X.
Let k be as in Claim 5.10 and define Then D is not compact and E is closed, hence compact. From the definition of the order relation on X it follows that F := (↑(D ∪ E)) (D ∪ E) = {k} (see Figure 10). Thus, F is finite, and hence closed. As (D, E) is a bijective matching in X (see Figure 10 The case of P 4 . Let X be the poset defined in the case of P 3 . We define a new poset Y in which X is a downset. Consider three new elements σ, τ, and and define Y = X ∪ {σ, τ, }; for every x, y ∈ Y, x y ⇐⇒ either x = y or y = or (x ∈ X and y ∈ {σ, τ}) or (x = ⊥ {n,k} and y ∈ {n, k} for some n, k ∈ N).
A portion of X is depicted in Figure 11. By Lemma 5.8, X is a p-morphic image of a disjoint union of copies of P 4 . Therefore, to conclude the proof, it suffices to show that Y is not Esakia representable. As before, suppose with a view to contradiction, that there is an Esakia space Y, , τ . We prove that the ordered subspace X of Y is an Esakia space. For this it suffices to show that X is a clopen of Y as, in this case, the conditions in the definition of an Esakia space follow [28,Thm. 3.2.6]. First notice that X is open in Y since Y is Hausdorff and Y X is finite. Moreover, X is closed in Y since X = ↓σ ∩ ↓τ. Consequently, X is clopen in Y and, hence, X is an Esakia space. But this contradicts the fact that X is not Esakia representable, which was established in the case of P 3 .

TOPOLOGIES FOR DIAMOND SYSTEMS
The aim of this section is to establish our main result: Notice that Theorem 5.1 provides one half of the above result. To prove the other half, we require the following: Proposition 6.2. Let X be an image-finite diamond system. Then there exists an Esakia space X + such that its underlying poset is also a diamond system and X is the image-finite part of X + . Proposition 6.2 implies Theorem 6.1 as follows.
Proof of Theorem 6.1. The "only if" part is Theorem 5.1. To prove the "if" part, suppose that V ⊆ DHA and consider a profinite algebra A ∈ V. By Theorem 2.20(i), there is an image-finite poset X such that A ∼ = Up(X). In particular, Up(X) is a diamond Heyting algebra, whence X is a diamond system by Corollary 4.8. In view of Proposition 6.2, X is the image-finite part of some Esakia space. Consequently, Up(X) is a profinite completion by Theorem 2.20(ii). Since A ∼ = Up(X), we conclude that A is a profinite completion.
The rest of this section is devoted to proving Proposition 6.2.
Proof of Proposition 6.2. Recall from Definition 4.1 that diamond sequences are downward directed diamond systems. Let A ∞ be the set of all infinite diamond sequences in X that are maximal with respect to inclusion. With every A ∈ A ∞ we associate a new element ⊥ A (so that A = B implies ⊥ A = ⊥ B ). Let X + = X ∪ {⊥ A : A ∈ A ∞ } and extend the order on X to that on X + by setting for x, y ∈ X + , x y ⇐⇒ either x = y or x y in X or x = ⊥ A and y ∈ A for some A ∈ A ∞ .
The resulting poset X + is then obtained by adding a new lower bound ⊥ A for each maximal diamond sequence A. It follows that ↑⊥ A = {⊥ A } ∪ A. Notice that X + is a diamond system and X is the image-finite part of X + . In particular, if X has finite depth, then X = X + . To complete the proof, it suffices to show that X + can be endowed with a topology τ such that X + , τ, is an Esakia space. Notice that such a topology is not unique. For example, let Y be an infinite poset of depth two with a maximum. We can turn Y into an Esakia space by making any of its elements the unique limit point of the space. This results in different Esakia spaces with the same underlying poset Y.
To define τ on X + , choose a maximal element of X (equiv. of X + ). Also, for every pair x, y of incomparable elements in X such that ↓x ∩ ↓y is nonempty, choose an immediate predecessor ⊥ {x,y} of x and y in X. The existence of ⊥ {x,y} follows from the fact that X is image-finite and Proposition 4.2.
We define a topology τ on X + as follows. A set U ⊆ X + is open in τ if and only if it satisfies the following conditions: (T1) If ∈ U, then there is a finite set Z ⊆ X such that X + ↓Z ⊆ U; (T2) For every x ∈ X, if x ∈ U, then there is a finite set Z ⊆ X ↑x such that ↓x ↓Z ⊆ U; (T3) For every pair of incomparable elements x, y of X such that ↓x ∩ ↓y = ∅, if ⊥ {x,y} ∈ U, then there is a finite set Z ⊆ ↓x ∩ ↓y such that (↓x ∩ ↓y) ↓Z ⊆ U; (T4) For every A ∈ A ∞ , if ⊥ A ∈ U, then there is x ∈ A such that ↓x ⊆ U. Remark 6.3. The following provides an intuitive meaning of τ. Postulate (T1) asserts that if belongs to an open set U, then almost all the space belongs to U. Similarly, (T2) should be read as stating that if an element x ∈ X belongs to U, then almost all the downset ↓x belongs to U. The remaining postulates can be explained along the same lines. Claim 6.4. The set τ is a topology on X + .
Proof. That ∅, X + ∈ τ and that τ is closed under arbitrary unions follow from the definition. Thus, it is enough to consider two sets U 1 , U 2 ∈ τ and verify that their intersection U 1 ∩ U 2 satisfies (T1)-(T4).
To show that U 1 ∩ U 2 satisfies (T4), suppose that ⊥ A ∈ U 1 ∩ U 2 for some A ∈ A ∞ . Then there are x 1 , x 2 ∈ A such that ↓x 1 ⊆ U 1 and ↓x 2 ⊆ U 2 . Since A is a diamond sequence, there exists x ∈ A such that x x 1 , x 2 . Thus, ↓x ⊆ U 1 ∩ U 2 , as desired.
To prove that the ordered topological space X + := X + , , τ is an Esakia space, we show three facts: that downsets of open sets are open in X + , that the space X + is compact, and that it satisfies the Priestley separation axiom. The verification of each of these is independent from the others. Proof. We need to prove that ↓U satisfies (T1)-(T4). To prove (T1), suppose that ∈ ↓U. Since is maximal, this yields ∈ U. As U satisfies (T1), there is a finite set Z such that X ↓Z ⊆ U, whence also X ↓Z ⊆ ↓U.
Condition (T2) holds for every downset, and in particular for ↓U. To prove (T3), consider a pair of incomparable elements x, y ∈ X such that ↓x ∩ ↓y = ∅. Suppose that ⊥ {x,y} ∈ ↓U. If ⊥ {x,y} ∈ U, then the fact that ↓U satisfies (T3) follows from the assumption that U satisfies (T3) and the inclusion U ⊆ ↓U. On the other hand, if ⊥ {x,y} / ∈ U, we have ⊥ {x,y} < u for some u ∈ U. Since x and y are immediate successors of ⊥ {x,y} , Proposition 4.2 implies that x u or y u. Thus, ↓x ∩ ↓y ⊆ ↓u ⊆ ↓U.
It only remains to prove (T4). Suppose that ⊥ A ∈ ↓U for some A ∈ A ∞ . If ⊥ A ∈ U, then the fact that ↓U satisfies (T4) follows from the assumption that U satisfies (T4) and the inclusion U ⊆ ↓U. On the other hand, if ⊥ A / ∈ U, there is x ∈ U such that ⊥ A < x. By the definition of the order on X + , we get x ∈ A. Therefore, ↓x ⊆ ↓U.
We next turn to proving that X + is a compact space. Consider an open cover K of X + . Our aim is to find a finite subcover of K. The proof consists of a series of technical claims.
Let U be a member of K containing . By (T1), there exists a finite subset Z of X such that For every z ∈ Z, let z • be the unique maximal element in X such that z z • . The existence and uniqueness of z • is guaranteed by the fact that X is image-finite and Proposition 4.2. Define where ↓Y 1 is computed in X + . Claim 6.6. For every x ∈ X there is a finite subset K x of K and a finite subset P x of immediate predecessors of x such that ↓x ↓P x ⊆ K x .
Proof. There is U x ∈ K such that x ∈ U x . By (T2), there is a finite subset Z x of X ↑x such that ↓x ↓Z x ⊆ U x . Clearly we may assume that ↓x ∩ ↓z = ∅ for every z ∈ Z x . Define x and z are incomparable}. Then Z x is the union of the disjoint sets Z x 1 and Z x 2 . Since X is image-finite, we may assume without loss of generality that Z x 1 is a set of immediate predecessors of x. Consider z ∈ Z x 2 . Since we assumed that ↓x ∩ ↓z = ∅, there is an element in ↓x ∩ ↓z of the form ⊥ {x,z} . Let U ⊥ {x,z} be a member of K containing ⊥ {x,z} . By (T3), there exists a finite subset Q x,z of ↓x ∩ ↓z such that (↓x ∩ ↓z) ↓Q x,z ⊆ U ⊥ {x,z} . Since X is image-finite, we may assume without loss of generality that Q x,z is a set of immediate predecessors of x. Define Notice that K x is a finite subset of K and P x is a finite subset of the immediate predecessors of x. Therefore, it only remains to prove that ↓x ↓P x ⊆ K x , i.e., that ↓x K x ⊆ ↓P x . To this end, consider y ∈ ↓x K x . Since y ∈ U x and y x, we have y ∈ ↓Z x = ↓(Z x 1 ∪ Z x 2 ). If y ∈ ↓Z x 1 , then y ∈ ↓P x as desired. So suppose that y z for some z ∈ Z x 2 . Then y ∈ ↓x ∩ ↓z. Together with y ∈ U ⊥ {x,z} this yields y ∈ ↓Q x,z ⊆ ↓P x .
We define recursively a sequence of subsets S n of Y as follows: where Y 1 is defined in (8) and P y in (9). Then each S k is a set of elements of depth k in X. For every positive integer k, set S k = S 1 ∪ · · · ∪ S k .
By Claim 6.6, the sets S 1 , . . . , S k are finite, whence we obtain: Claim 6.7. For every positive integer k, the set S k is finite.
Define S = {S k : k is a positive integer}, For every A ∈ A ∞ such that the set A ∩ S is infinite, choose an element U ⊥ A ∈ K containing ⊥ A . By (T4), there exists x ∈ A such that ↓x ⊆ U ⊥ A . As A, is an image-finite diamond sequence and x ∈ A, by Proposition 4.2 the set A ↓x is finite. Since A ∩ S is infinite, this implies that A ∩ S ∩ ↓x = ∅. Therefore, there is x A ∈ S ∩ A such that x A x. Thus, Bearing this in mind, set B = {x A : A ∈ A ∞ and A ∩ S is infinite} and S − = S ↓B. (13) We show that S − is finite. For this we use the classical Brouwer's fan theorem; see for instance [24,Thm. 3.3.20]. We recall that a poset is a fan if it is rooted, its principal downsets are finite chains, and every element has only finitely many immediate successors. Theorem 6.8 (Brouwer's Fan Theorem). If all chains in a fan F are finite, then their length is bounded by some positive integer.
We turn S − , into a tree by means of a variant of the standard technique in modal logic known as unravelling; see for instance [18,Thm. 2.19]. Consider the following set of finite sequences . . , x n : n is a nonnegative integer, x 1 ∈ S 1 ∩ S − , . . . , x n ∈ S n ∩ S − , and x n < · · · < x 2 < x 1 }.
We assume that the empty sequence, denoted by , belongs to T. 2 Notice that since the elements of each S k have depth exactly k, the assumptions that x n < · · · < x 2 < x 1 and x 1 ∈ S 1 , . . . , x n ∈ S n imply that x i is an immediate successor of x i+1 for every i < n. We define an order relation on T by setting for every s, t ∈ T that s t ⇐⇒ s is an initial segment of t. Proof. It is well known that T is a tree with root (see, e.g., [18,Thm. 2.19]). To see that every element of T has only finitely many immediate successors, consider a sequence x 1 , . . . , x n ∈ T. The immediate successors of x 1 , . . . , x n have the form x 1 , . . . , x n , y where y ∈ S n+1 and y < x n . Since the set S n+1 is finite, we conclude that x 1 , . . . , x n has only finitely many immediate successors.
Claim 6.10. The set S − is finite.
Proof. Since |S − | |T|, it is enough to show that T is finite. In view of Brouwer's Fan Theorem and Claim 6.9, it suffices to prove that T does not have infinite chains. Suppose, with a view to contradiction, that there is an infinite chain C in T. Define D = {x ∈ S − : there exists x 1 , . . . , x n ∈ C such that x = x n }.
Observe that C is a set of finite sequences without repetitions of elements of D. Since C is infinite, so is D. We show that D is a chain in S − , . Let y, z ∈ D. Then there are sequences s = (s 1 , . . . , s n ) and t = (t 1 , . . . , t k ) in C such that y = s n and z = t k . Since C is a chain, either s t or t s in T. By symmetry we may assume that s t. Then n k and s = (t 1 , . . . , t n ). Consequently, y = s n = t n · · · t k = z, as desired. Thus, D is an infinite chain in S − , . Define A = {↑y : y ∈ D}, where the upsets are computed in X. We show that A is an infinite maximal diamond sequence in X. First, A is infinite since D ⊆ A. Because A is a subset of X which is a diamond system, it is a diamond system itself. Moreover, A is downward directed since D is a chain. Hence, A is a diamond sequence in X.
To prove that A is maximal, consider a diamond sequence A in X such that A ⊆ A . Let x ∈ A . Suppose the depth of x is n and let y be an element of A of depth n + 1 (its existence follows from the fact that D is infinite). Since x, y ∈ A and A is downward directed, there is z ∈ A such that z x, y. Thus, there is v ∈ X of depth n + 1 such that z v x. If v = y, then y x, whence x ∈ A (as y ∈ A and A is an upset of X). Otherwise, having the same depth, v and y are incomparable. Therefore, applying the three point rule to z v, y, x and v x, we get y x. Thus, x ∈ A, whence A ⊆ A. We conclude that A is an infinite maximal diamond sequence in X, i.e., A ∈ A ∞ . In particular, this implies that X + contains an element of the form ⊥ A . Now, since D ⊆ A is infinite and D ⊆ S, also A ∩ S is infinite. Then the set B, defined in (13), contains an element of the form x A . By the definition of A, there exists y ∈ D such that y x A . Therefore, y ∈ ↓B. But this contradicts the fact that D ⊆ S − = S ↓B.
Let B be the set of maximal elements of the set B, , defined in (13). Since X is image-finite, ↓B = ↓B. Claim 6.11. The set B is finite.
Proof. Recall from (13) that B ⊆ S and S − = S ↓B. We show that every element of B is either in S 1 or has an immediate successor in S − . Let x ∈ B S 1 . Since B ⊆ S, we get x ∈ S k for some integer k > 1. By definition of S k , there is an immediate successor y ∈ S k−1 of x. Notice that x is maximal in B and x < y. Consequently, y / ∈ ↓B, whence y ∈ S k−1 ↓B ⊆ S − . Thus, x has an immediate successor in S − . By Claim 6.10, there is a positive integer k such that S − ⊆ S k . Recall that S n is a set of elements of depth n in X, for every positive integer n. Therefore, the set of elements of S with an immediate successor in S − ⊆ S k is contained in S k+1 . As every element of B ⊆ S is either in S 1 or has an immediate successor in S − , we conclude that B ⊆ S k+1 . By Claim 6.7, the set S k+1 is finite. Thus, so is B . Claim 6.12. The space X + is compact.
Proof. Recalling that K is an open cover of X + , define where U is defined before Claim 6.6, each K x is defined in (9), and each U ⊥ A is defined in the paragraph preceding (12). It follows from the definition that K ⊆ K. By Claims 6.6, 6.10 and 6.11, the set K is finite. Thus, it only remains to prove that K covers X + . Let x ∈ X + . We have two cases: either x ∈ S + or x / ∈ S + . First suppose that x ∈ S + . If x ∈ S − , then x ∈ U x by the definition of K x in (9). Thus, x ∈ U x ∈ K x ⊆ K . Next suppose that x ∈ S + S − . Then The above inclusions are justified as follows. The first one follows from the definitions of S + and S − . The second one from the fact that for every A ∈ A ∞ such that A ∩ S is infinite, the element x A ∈ B (defined in the paragraph before (13)) belongs to A, whence ⊥ A x A ∈ B. The last one is justified right before Claim 6.11. Finally, by (14) there is x A ∈ B such that x x A . Together with the definition of U ⊥ A , this implies that x ∈ ↓x A ⊆ U ⊥ A ∈ K .
Next we consider the case where x / ∈ S + . We have three subcases: (i) ↑x ∩ S = ∅; (ii) ↑x ∩ S is infinite; (iii) ↑x ∩ S is nonempty and finite.
(i): Since Y 1 = S 1 ⊆ S, we get x ∈ ↓Y 1 . As Y 1 is the set of maximal elements of ↓Z and X is image-finite, this implies that x / ∈ ↓Z. Thus, by (7), x ∈ U ∈ K . (ii): Since X is image-finite, necessarily x ∈ X + X. Thus, there is A ∈ A ∞ such that x = ⊥ A . As we pointed out after the definition of X + , we have ↑x = {⊥ A } ∪ A. As ⊥ A / ∈ S (by definition of S), this implies that A ∩ S = ↑x ∩ S. Therefore, by assumption, A ∩ S is infinite, and hence x = ⊥ A ∈ S + , a contradiction with the assumption that x / ∈ S + . (iii): Let y be a minimal element in ↑x ∩ S. Since x / ∈ S + and S ⊆ S + , we have x / ∈ S, whence x < y. As y ∈ S, either y ∈ ↓B or y ∈ S ↓B = S − . If y ∈ ↓B, then there is x A ∈ B such that y x A (since ↓B = ↓B ). By (12) and x y x A , we obtain x ∈ U ⊥ A ∈ K , as desired. Next suppose that y ∈ S − . Suppose, with a view to contradiction, that P y ∩ ↑x = ∅, where P y is defined in (9). Then there is x ∈ P y with x z. By Claim 6.6, z is an immediate predecessor of y. Therefore, x z < y. Moreover, from y ∈ S it follows that there is a positive integer k such that y ∈ S k . By definition of S k+1 and z ∈ P y , we have z ∈ S k+1 ⊆ S. Together with x z < y, this contradicts the minimality of y in ↑x ∩ S. Thus, P y ∩ ↑x = ∅, i.e., x ∈ ↓P y . Consequently, x ∈ ↓y ↓P y . By Claim 6.6, x ∈ K y . Since y ∈ S − , we have K y ⊆ K . We conclude that x ∈ K .
The final step consists in proving that the Priestley separation axiom holds in X + . Definition 6.13. We call distinguished the elements of X + of the form , ⊥ {x,y} , and ⊥ A . The remaining elements of X + will be called nondistinguished.
Claim 6.14. The following conditions hold for every u, v ∈ X + : Proof. Set U = ↓u {u} and V = ↓v. We verify that both U and V are open at once. Since is maximal and distinguished, it does not belong to U ∪ V. Thus, (T1) holds trivially for U and V. Moreover, since U and V are downsets, Condition (T2) also holds trivially. For (T3), suppose that an element of the form ⊥ {x,y} belongs to U, i.e., ⊥ {x,y} < u. Since X + is a diamond system, it has width at most two, whence x and y are the only immediate successors of ⊥ {x,y} in X + . As X is image-finite, ↑⊥ {x,y} ⊆ X, and ⊥ {x,y} < u, either x u or y u. In both cases, ↓x ∩ ↓y ⊆ ↓u {u} = U, as desired. This arguments can be adapted to the case of V. For suppose that ⊥ {x,y} ∈ V = ↓v. As v is nondistinguished, this implies ⊥ {x,y} < v. Thus, replicating the proof described for U, we obtain that (T3) holds for V as well.
Finally, let A ∈ A ∞ and ⊥ A ∈ U. Then ⊥ A < u. By definition of the order on X + , we have that u ∈ A. As A is infinite and ↑u is finite, there is x ∈ A such that u x. Since A is downward directed (being a diamond sequence), we may assume without loss of generality that x < u. Then ↓x ⊆ ↓u {u} = U, whence U satisfies (T4). Again, this arguments can be adapted to the case of V as follows. Suppose that ⊥ A ∈ V = ↓v. Since v is nondistinguished, this implies that ⊥ A < v, so we can repeat the argument for U. Claim 6.15. Let x, y, u ∈ X be such that x and y are incomparable and ↓x ∩ ↓y = ∅. If ⊥ {x,y} < u, then either ↓x ∩ ↓y ∩ ↓u = ∅ or u ∈ ↓x ∩ ↓y.
Proof. Recall that x and y are the only immediate successors of ⊥ {x,y} in X and hence in X + , and that ↑⊥ {x,y} ⊆ X. Consequently, from ⊥ {x,y} < u it follows that x, y u. Suppose there is z ∈ ↓x ∩ ↓y ∩ ↓u. Since X + has width at most two and x, y are incomparable, we may assume by symmetry that u is comparable with x. Together with x u, this yields u < x. Suppose, with a view to contradiction, that u y. As y u, this implies that u and y are incomparable. Since z u, x, y and u x, we can apply the three point rule to obtain y x, a contradiction. Thus, u y, and so u ∈ ↓x ∩ ↓y. Claim 6.16. Let A ∈ A ∞ and u ∈ X. If ⊥ A < u, then there is x ∈ A such that ↓u ∩ ↓x = ∅.
Proof. Since ⊥ A < u, the definition of the order relation on X + gives that a u for all a ∈ A.
Since ↑u is finite (as u ∈ X and X is image-finite) and A is infinite, there is y ∈ A such that u y. Then u ∈ X and y ∈ A are incomparable by (15). Consider x ∈ A such that x < y. Its existence follows from the fact that A is infinite and downward directed and ↑y is finite (as y ∈ A ⊆ X and X is image-finite).
Since u and y are incomparable and x < y, we get u x. In addition, x u by (15). Thus, x and u are also incomparable. To conclude the proof, suppose that there is z ∈ ↓u ∩ ↓x. As z u, x, y and x, u are incomparable and x y, we can apply the three point rule to obtain u y, a contradiction. Claim 6.17. If u ∈ X + is nondistinguished, then ↓u is clopen in X + .
Proof. By Claim 6.14(ii), the set ↓u is open in X + . Then it only remains to verify that X + ↓u is also open. First, observe that Condition (T1) holds for X + ↓u (just take Z = {u}). To prove Condition (T2), let x ∈ X + ↓u. Since u / ∈ ↑x and ↓x ↓u ⊆ X + ↓u, we may take Z = {u}.
It only remains to check (T4). Consider A ∈ A ∞ such that ⊥ A ∈ X + ↓u. In particular, ⊥ A < u. Since u is nondistinguished by assumption and X + X is a set of distinguished elements, u ∈ X. Therefore, u ∈ X and ⊥ A < u. Thus, we may apply Claim 6.16 to obtain x ∈ A such that ↓x ⊆ X + ↓u. Claim 6.18. If u and v are incomparable elements in X, then the set ↓u ∩ ↓v is clopen in X + .
Proof. Define U = X + (↓u ∩ ↓v). Since u and v are incomparable, Therefore, in view of Claim 6.14, the set ↓u ∩ ↓v is open in X + .
It remains to show that U is also open. First, observe that X + ↓{u, v} ⊆ U, whence U satisfies (T1). To prove (T2), let x ∈ U. By definition of U, either x u or x v. By symmetry, we may assume that x u. Together with the obvious inclusion ↓x ↓u ⊆ U, this implies that Condition (T2) holds for U. To prove (T3), suppose that U contains an element of the form ⊥ {x,y} . Then either ⊥ {x,y} u or ⊥ {x,y} v. By symmetry we may assume that ⊥ {x,y} u, whence ⊥ {x,y} < u. Now apply Claim 6.15 to obtain that either ↓x ∩ ↓y ∩ ↓u = ∅ or u ∈ ↓x ∩ ↓y. Thus, Condition (T3) follows from the inclusion ↓x ∩ ↓y ⊆ U in the first case and from the inclusion (↓x ∩ ↓y) ↓u ⊆ U in the second case.
Lastly, to prove (T4), consider A ∈ A ∞ such that ⊥ A ∈ U. By definition of U, either ⊥ A u or ⊥ A v. By symmetry, we may assume that ⊥ A u, so ⊥ A < u. Moreover, u ∈ X by assumption. Thus, we may apply Claim 6.16 to obtain x ∈ A such that ↓u ∩ ↓x = ∅. Consequently, also ↓u ∩ ↓v ∩ ↓x = ∅, and hence ↓x ⊆ X + (↓u ∩ ↓v) = U. Claim 6.19. The space X + satisfies the Priestley separation axiom.
Proof. Let u, v ∈ X + with u v. We must find a clopen downset D of X + such that u / ∈ D and v ∈ D. If v is nondistinguished, we may take D = ↓v by Claim 6.17. Suppose v is distinguished. We have the following cases: Since X is image-finite, there is a maximal element u • in X + such that u u • . Notice that u • = as u v = . Since is maximal, this implies v = / ∈ ↓u • . Being maximal in X + and different from , the element u • is nondistinguished. Thus, ↓u • is clopen by Claim 6.17. Since u • is maximal, we can apply Proposition 4.2 and obtain that the downset ↓u • is also an upset of X + . Therefore, the set D := X + ↓u • is a clopen downset of X + such that u / ∈ D and v ∈ D. (ii): If u / ∈ ↓x ∩ ↓y, then we may take D = ↓x ∩ ↓y by Claim 6.18. Suppose u ∈ ↓x ∩ ↓y. By Proposition 4.2, for every z ∈ ↓x ∩ ↓y there is a unique immediate predecessor z • of x and y such that z z • . In particular, u • is an immediate predecessor of x and y. Define Clearly u ∈ D. Moreover, since u • and v are immediate predecessors of x and y, from v u • it follows that v = u • . This contradicts the fact that u u • and u v. Therefore, v u • , and hence v = ⊥ {x,y} ∈ D.
We show that D is a clopen downset of X + . As X + has width at most two, its elements may have at most two immediate successors. It follows that among immediate predecessors of x and y there exists just one distinguished element, namely ⊥ {x,y} . Since u v = ⊥ {x,y} , the element u • is nondistinguished. Thus, by Claims 6.17 and 6.18, the set D is clopen. Finally, to prove that D is a downset, we show that z / ∈ D ⇐⇒ z • = u • for every z ∈ ↓x ∩ ↓y.
Consider z ∈ ↓x ∩ ↓y. If z • = u • , then z ∈ ↓u • (since z z • ), whence z / ∈ D. Conversely, if z / ∈ D, then z ∈ ↓u • . Therefore, u • is the unique immediate predecessor of x and y above z. Consequently, z • = u • . This establishes (16). Lastly, consider z ∈ D and t z. Since t z x, y, we get t • = z • . Moreover, (16) and z ∈ D yield z • = u • . Thus, also t • = u • . With another application of (16) we conclude that t ∈ D. Hence, D is a downset.
(iii): Since u = v, we have u = ⊥ A . Because ⊥ A is the unique element whose set of strict successors is A, from u = ⊥ A it follows that there is z ∈ A with u z. If z = or z = ⊥ {x,y} for some x, y ∈ X, then we take the clopen downset D constructed in the previous cases. Otherwise, z is nondistinguished and we may take D = ↓z by Claim 6.17.
In view of Claims 6.5, 6.12, and 6.19, we conclude that X + is an Esakia space. Corollary 6.20. Let X be an image-finite root system. Then there is an Esakia space X + whose underlying poset is also a root system such that X is the image-finite part of X + .
Proof. If X is a root system, the poset X + constructed in the proof of Proposition 6.2 is also a root system. Therefore, the result follows from Proposition 6.2. Corollary 6.21. Let n be a positive integer and X a diamond system of depth n. Then X is Esakia representable.
Proof. If X is of depth n, the poset X + constructed in the proof of Proposition 6.2 coincides with X. Consequently, X is Esakia representable by Proposition 6.2.

CONSEQUENCES
By Theorems 4.4 and 6.1, a variety of Heyting algebras is such that its profinite members are profinite completions if and only it it omits the finite algebras Up(P 1 ), Up(P 2 ), Up(P 3 ), and Up(P 4 ). Consequently, we obtain: Theorem 7.1.
(i) The problem of determining whether a finite set of equations axiomatizes a variety of Heyting algebras whose profinite members are profinite completions is decidable. (ii) The problem of determining whether a finite set of finite Heyting algebras generates a variety whose profinite members are profinite completions is decidable.
Proof. (i): Let Σ be a finite set of equations and V the variety axiomatized by it. By Theorems 4.4 and 6.1, the profinite members of V are profinite completions if and only if V validates the Jankov formulas J (P 1 ), J (P 2 ), J (P 3 ), and J (P 4 ). By Jankov's Lemma, this happens precisely when V contains none of Up(P 1 ), Up(P 2 ), Up(P 3 ), and Up(P 4 ). This condition, in turn, can be decided by checking whether the equations in Σ hold in any of the finite algebras Up(P 1 ), Up(P 2 ), Up(P 3 ), and Up(P 4 ).
(ii): The variety generated by a finite set K of finite Heyting algebras is such that its profinite members are profinite completions precisely when K validates J (P 1 ), J (P 2 ), J (P 3 ), and J (P 4 ). Since K is a finite set of finite algebras, the latter property is decidable.
We next provide some properties of diamond Heyting algebras. Recall that a variety is finitely based if it can be axiomatized by finitely many equations, and that a class of (similar) algebras is a quasivariety if it is closed under the formation of reduced products, subalgebras, and isomorphic copies, see, e.g., [ Proof. That varieties of diamond Heyting algebras are locally finite follows from Theorem 3.3 and the fact that DHA ⊆ CHA. In [19,20] it is proved that a variety of Heyting algebras is primitive if and only if it excludes the algebras of upsets of the rooted posets in Figure 12. (The original proof in [20] is in Russian. For an English version of the proof, based on Esakia duality, see [13].) From the fact that varieties of diamond Heyting algebras omit Up(P 1 ), Up(P 2 ), Up(P 3 ), and Up(P 4 ), it easily follows that they also omit the algebras of upsets of the posets P 1 , P 2 , P 5 , F 3 , and P 7 . Consequently, P 1 P 2 P 5 F 3 P 7 FIGURE 12. The posets P 1 , P 2 , P 5 , F 3 and P 7 .
varieties of diamond Heyting algebras are primitive. As it is known that there are only countably many primitive varieties of Heyting algebras and that all of them are finitely based (see for instance [13,Thm. 9.1]), we conclude that the same holds for varieties of diamond Heyting algebras. It only remains to prove that there are infinitely many varieties of diamond Heyting algebras. But this follows, for instance, from the fact that there are infinitely many varieties of Gödel algebras, which are all varieties of diamond Heyting algebras.
A variety V of Heyting algebras is said to be canonical provided that Up(X A ) ∈ V for all A ∈ V. The terminology comes from the fact that, given a Heyting algebra A, the completion Up(X A ) is called the canonical extension of A [32]. Furthermore, recall that the smallest variety containing a class of similar algebras V is HSP(V) [17, Thm. II.9.5].
Theorem 7.3. The variety DHA is canonical.
Proof. It is well known that if P is an elementary class of posets, then the variety of Heyting algebras generated by {Up(X) : X ∈ P } is canonical (see, e.g., [33,Thm. 7.1]). Let then P be the class of diamond systems. Notice that P is elementary because the conditions in Definition 4.1 can be expressed by first-order sentences, so the variety V := HSP{Up(X) : X ∈ P } is canonical. Thus, to conclude the proof, it suffices to show that V = DHA.
A straightforward adaptation of the proof of the implication (iii)⇒(i) in Theorem 4.4 shows that Up(X) ∈ DHA for all X ∈ P. Consequently, V ⊆ DHA. To prove the other inclusion, consider A ∈ DHA. From Theorem 4.4 it follows that X A is a diamond system, whence X A ∈ P. Together with the fact that A embeds into Up(X A ) via the map γ A , this implies A ∈ V, as desired.
Intermediate logics algebraized, in the sense of [14], by varieties of diamond Heyting algebras have interesting metalogical properties. First, an intermediate logic is said to be hereditarily structurally complete if all its finitary extensions [31] are structurally complete in the sense that their admissible rules are derivable (see for instance [60]). On the other hand, an intermediate logic L has the infinite Beth definability property if implicit definitions can be turned explicit in L (we refer to [16,52] for the technical details). Proof. As detailed in [60] and [16], an intermediate logic is hereditarily structurally complete (resp. has the infinite Beth definability property) precisely when it is algebraized by a variety of Heyting algebras that is primitive (resp. in which epimorphisms are surjective). The fact that varieties of diamond Heyting algebras are primitive follows from Theorem 7.2, while the fact that epimorphisms are surjective in them is a consequence of [53,Thm. 9.4] (see also [11]). We close this paper by drawing connection to the classical Representation Problem mentioned in the introduction. Definition 7.5. We call a variety V of Heyting algebras representable if X is Esakia representable for every poset X such that Up(X) ∈ V.
Recall that D n is the variety of Heyting algebras of depth n. Our aim is to prove the following: Theorem 7.6. A variety V of Heyting algebras is representable if and only if V ⊆ D n ∩ DHA for some positive integer n.
To this end, we rely on the following folklore observation. Proposition 7.7. For a variety V of Heyting algebras, the following are equivalent : (i) the members of V have depth n for some positive integer n; (ii) V omits all infinite chains; (iii) V omits some chain; (iv) V validates J (C) for some finite chain C.
Proof of Theorem 7.6. Let Z − be the poset of negative integers with the standard order. First suppose that V is representable. By Proposition 5.2 and Lemma 5.3, V omits the algebras Up(P) for all P ∈ {P 1 , P 2 , P 3 , P 4 }. In view of Theorem 4.4, we conclude that V ⊆ DHA. Moreover, Up(Z − ) / ∈ V as Z − is not Esakia representable by Proposition 2.3(ii). Thus, by Proposition 7.7 the members of V have depth n for some positive integer n.
Conversely, suppose that V ⊆ D n ∩ DHA for some positive integer n. Consider a poset X such that Up(X) ∈ V. We show that X is image-finite. It suffices to prove that X has bounded depth and width. Since Up(X) has depth n, the same holds for X (see, e.g., [18,Prop. 2.38]). Therefore, by Theorem 4.4, DHA has width 2. Thus, Up(X) also has width 2, and hence so does X (see, e.g., [18,Prop. 2.39]). Consequently, X is image-finite. As X is image-finite and Up(X) is a diamond Heyting algebra, by Corollary 4.8 we obtain that X is a diamond system of depth n. Thus, X is Esakia representable by Corollary 6.21.