Semigenerated Carnot algebras and applications to sub-Riemannian perimeter

This paper contributes to the study of sets of finite intrinsic perimeter in Carnot groups. Our intent is to characterize in which groups the only sets with constant intrinsic normal are the vertical half-spaces. Our viewpoint is algebraic: such a phenomenon happens if and only if the semigroup generated by each horizontal half-space is a vertical half-space. We call semigenerated those Carnot groups with this property. For Carnot groups of nilpotency step 3 we provide a complete characterization of semigeneration in terms of whether such groups do not have any Engel-type quotients. Engel-type groups, which are introduced here, are the minimal (in terms of quotients) counterexamples. In addition, we give some sufficient criteria for semigeneration of Carnot groups of arbitrary step. For doing this, we define a new class of Carnot groups, which we call type (◊)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$(\Diamond )$$\end{document} and which generalizes the previous notion of type (⋆)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$(\star )$$\end{document} defined by M. Marchi. As an application, we get that in type (◊)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ (\Diamond ) $$\end{document} groups and in step 3 groups that do not have any Engel-type algebra as a quotient, one achieves a strong rectifiability result for sets of finite perimeter in the sense of Franchi, Serapioni, and Serra-Cassano.


Introduction
Carnot groups, which are by definition simply connected Lie groups with stratified Lie algebras, raised attention because of their natural occurrences in Geometric Measure Theory and Metric Geometry. In particular, subsets of Carnot groups whose intrinsic normal is constantly equal to a left-invariant vector field appear both in the development of a theory à la De Giorgi for sets of locally finite perimeter in sub-Riemannian spaces [1,2,8,9] and in the obstruction results for bi-Lipschitz embeddings into L 1 of non-abelian nilpotent groups [6]. The work [9] by Franchi, Serapioni and Serra-Cassano provides complete understanding of sets with constant intrinsic normal in the case of Carnot groups with nilpotency step 2 by proving that they are half-spaces when read in exponential coordinates. However, in higher step the study appears to be much more challenging due to the more complex underlying algebraic structure, and only in the case of type ( ) groups and of filiform groups we have a satisfactory understanding of sets with constant intrinsic normal, see [4,15].
In a recent paper [5], Bellettini and the first-named author of this article related the property of having constant intrinsic normal to the containment of distinguished constant-normal sets, which are semigroups generated by the horizontal half-space defined by the normal, as we shall explain soon. We shall use the following terminology: a horizontal half-space of a stratified algebra g with horizontal layer V 1 is the closure of either of the two parts into which a hyperplane divides V 1 . A vertical half-space is defined as the direct sum of a horizontal halfspace and the derived subalgebra [g, g]. By [5,Corollary 2.31], in exponential coordinates a Carnot group has the property that all its constant-normal sets are equivalent to vertical halfspaces if and only if the closure of the semigroup generated by each horizontal half-space is a vertical half-space. In Carnot groups with this property, one has the intrinsic C 1 -rectifiability result for finite-perimeter sets à la De Giorgi. In arbitrary groups, the study of semigroups can still give some weaker rectifiability results, see [7].
In this paper, we continue the study of such semigroups from an algebraic viewpoint. In particular, we get to a complete characterization of those step-3 Carnot groups for which all constant-normal sets are vertical half-spaces. In addition, for Carnot groups of arbitrary nilpotency step, we give some sufficient criteria which generalize the previous work by Marchi [15]. Definition 1.1 Given a Carnot group G with exponential map exp : g → G, we say that a set W ⊆ g is semigenerating if the closure of the semigroup generated by exp(W ) in G contains the commutator subgroup [G, G]. We say also that the Lie algebra g is semigenerated if every horizontal half-space W in g is semigenerating.
We shall use the term Carnot algebra to denote the (stratified) Lie algebra of a Carnot group, which is completely determined by the Lie group, see [13].
By the work [9] of Franchi, Serapioni and Serra-Cassano, we know that step-2 Carnot algebras are semigenerated. Their work has been then extended by Marchi to a class of Carnot algebras, called of type ( ), which includes examples of arbitrarily large nilpotency step. However, the basic example given by the Engel Lie algebra is not semigenerated, see [4,9], and also Proposition 5.10. From this example, it is easy to generate more examples of non-semigenerated algebras, because of the observation that each quotient of a semigenerated Lie algebra is semigenerated, see Proposition 2.7. Thus, for example we have that no stratified Lie algebra of rank 2 and step ≥ 3 is semigenerated because each of them has the Engel Lie algebra as quotient as pointed out in Remark 2.8.
Here, we mostly focus on step-3 Lie algebras, in which we discover a class of Lie algebras that are not semigenerated. Since they are a generalization of the Engel Lie algebra we call them Engel-type algebras. Our main result is that these algebras are the only obstruction to semigeneration. It is a challenge to understand how one can express in pure combinatorial terms the property of not having any Engel-type algebra as quotient. However, we have examples of step-3 Lie algebras that are not of type ( ) but have no Engel-type quotients. Hence, our result is a strict generalization of [15]. It is possible that Theorem 1.2 holds also in case the nilpotency step is arbitrary; we have no counterexample. However, the situation in step greater than 3 is more technical. For this reason, we are only able to give a sufficient condition to ensure semigeneration in arbitrary step. Such criterion is not necessary (see Example 4.7); however, as for the type ( ) condition, it is computable in terms of brackets of some particular basis.
In the next result, we assume the existence of a basis with specific properties. We could restate the condition in other forms (see Lemma 3.1), which alas are just as technical. Definition 1.4 Let g be a stratified Lie algebra. If, for each subalgebra h of g for which h ∩ V 1 has codimension 1 in V 1 , there exists a basis {X 1 , . . . , X m } of V 1 such that ad 2 X i X j ∈ h and ad 2 ad k X i X j (X i ) ∈ h, for all i, j = 1, . . . , m and k ≥ 2, then we say that g is of type (♦).

Theorem 1.5 Every stratified Lie algebra that is of type (♦) (as in Definition 1.4) is semigenerated.
To put the results in perspective, we remind the reader that by [9], we know that if a Carnot group has the property that every set with constant intrinsic normal is a vertical half-space, then every set of locally finite sub-Riemannian perimeter have a strong rectifiability property. Since semigroups generated by horizontal half-spaces are minimal constant-normal sets with respect to set inclusion according to [5], we obtain the following corollary. Corollary 1. 6 If the Lie algebra of a Carnot group G is semigenerated (e.g., if it is of type (♦), see Theorem 1.5, or has step 3 and does not have any Engel-type algebra as a quotient, see Theorem 1.2), then the reduced boundary of every set of locally finite perimeter in G is intrinsically C 1 -rectifiable.
The structure of the article is the following. In Sect. 2 we discuss some preliminaries. In addition to the notions of semigenerated and trimmed algebras, we introduce a useful set called the edge of a semigroup. In Sect. 3 we analyze Lie algebras of type (♦) and prove Theorem 1.5, see Corollary 3.7. Section 4 is devoted to both a list of examples and of results valid for Carnot algebras of step at most 4. In Sect. 5 we study the Engel-type algebras. We show that they are the only non-semigenerated Carnot algebras with step 3 that are minimal with respect to quotient in a sense that will be made precise with a notion that we call trimmed (see Definition 2.10). We end with the proof of Theorem 1.2.

Preliminaries
We start with a small list of notations. Then, in Definition 2.1, we define the edge e s and the wedge w s of a semigroup s. The notion of edge will be in the core of the discussion, since understanding if a horizontal half-space is semigenerating reduces to calculating the edge of its generated semigroup. We provide several preliminary results regarding the size of such edges. In particular, we consider Lemma 2.3 extremely useful and we shall exploit it repeatedly. In Proposition 2.9 we provide equivalent conditions for the definition of trimmed algebra, a notion that is fundamental in our arguments in Sect. 5.
In this paper, the Lie algebra g will always be stratified with layers V i = V i (g). We denote by Z(g) the center of a Lie algebra g. Given an ideal i of g we denote by π = π i : g → g/i the quotient map, and we shall interchangeably use the equivalent notations A/i = A + i = π i (A), for subsets A of g. We denote for a subset A of g by I g (A) the ideal generated by A within g, by Lie(A) the Lie algebra generated by A, and by Cl(A) orĀ the closure of A in g.
We say that W is a horizontal half-space of g if there exists a non-zero element λ in the dual of V 1 such that If W is a horizontal half-space defined by λ ∈ (V 1 ) * as in (2.1), then we define its (horizontal) boundary as Notice that W is a closed subset of V 1 and ∂ W is its boundary within V 1 , which in our case will always contain 0 ∈ g. Observe that ∂ W is a hyperplane in V 1 .
Given a subset W of g, which we shall usually assume to be a horizontal half-space, the semigroup S W generated by exp(W ) is described as . . , w k ∈ W }. Be aware that, even when W is closed (within V 1 ), the set S W may not be closed within exp(g).
A vector space h of a stratified Lie algebra g is said to be homogeneous if there exist subspaces h i of V i (g) such that h = h 1 ⊕. . .⊕h s . Equivalently, we have that h is homogeneous if and only if δ λ h = h for all λ > 0, where δ λ is the Lie algebra automorphism such that δ λ (v) = λv for v ∈ V 1 (g). We shall frequently use the fact that the center of a stratified Lie algebra is homogeneous: (2.3)

Lemmata in arbitrary algebras
In this subsection, let g be a Lie algebra of a simply connected Lie group G. We assume that g is stratified with nilpotency step equal to s. Since G is consequently nilpotent and simply connected, the exponential map exp : g → G is a bijection. We then have a correspondence between subsets s ⊆ g and subsets S = exp(s) ⊆ G.
Definition 2. 1 We associate with every subset s ⊆ g the following two sets The set w s is known as the tangent wedge of s and e s as the edge of the wedge w s , see [ Regarding the next result, we claim very little originality. The arguments are mostly taken from [5,12]. Also, the notions of cone and convexity that we shall use are the usual ones with respect to the vector-space structure of the Lie algebra.

Lemma 2.2
Let G be a Lie group whose exponential map exp : g → G is injective. Let s ⊆ g be such that exp(s) is a semigroup. Then the sets e s and w s , defined in (2.6) and (2.4), respectively, satisfy the following properties: (1) w s is the largest cone in s; (2) e s is the largest subalgebra of g contained in s; where we have used that ad is the differential of Ad, that Ad g is the differential of C g , that exp intertwines this differential with C g and, finally, that S is a semigroup. Hence, we have proved that e ad X s = s. Consequently, since the map e ad X is linear, it sends half-lines to half-lines and lines to lines. Thus, we have (2.8) and (2.9). We now prove (4). If exp(s) is closed, then also s is closed since exp is continuous and injective. Then the closure of w s is a cone in s. By maximality of w s , we deduce that w s is closed. Since w s is a cone, to check that w s is convex it is enough to show that X + Y ∈ s for all X , Y ∈ w s . Indeed, noticing that also R + X , R + Y ⊆ w s , this would imply that R + (X + Y ) ⊆ s and so X + Y ∈ w s . To prove that X + Y ∈ s for every X , Y ∈ w s , recall the formula, which holds in all Lie groups, by assumption, we get from (2.10) that exp(X + Y ) ∈ S. Since exp is injective, we infer that X + Y ∈ s. So the convexity of w s is proved.
We prove next a useful lemma, which states that if R + X ⊆ s, RY ⊆ s, and R ad 2 Y X ⊆ s then also R[X , Y ] ⊆ s. Recall the notions of e s and w s , defined in (2.6) and (2.4).

Lemma 2.3
Let g be a stratified Lie algebra. Let s ⊆ g be a subset such that exp(s) is a closed semigroup. If X ∈ w s and Y ∈ e s are such that ad 2 Y X ∈ e s , then [X , Y ] ∈ e s .
Proof One the one hand, since e s is a Lie algebra by Lemma 2.2.
(2) we have ad k Y X ∈ e s , for all k ≥ 2. On the other hand, from (2.8) we have that e ad tY X ∈ w s , for all t ∈ R. Hence, since w s is convex by Lemma 2.2.(4), for all t ∈ R we have Therefore, taking t to ±∞ and using that w s is closed and convex by Lemma 2.2.(4), we get [Y , X ] ∈ e s .
In the rest of the paper, we focus on semigroups generated by horizontal half-spaces in stratified Lie algebras. For every horizontal half-space W , see (2.1), in a stratified Lie algebra g, we denote by S W the semigroup generated by exp(W ) in exp(g), see (2.2), and by s W ⊂ g the set such that exp(s W ) = S W , i.e., s W := log(S W ). (2.11) If s:=s W , we stress the following two immediate facts: for every X ∈ V 1 , either X ∈ w s or − X ∈ w s ; (2.12) ∂ W = e s ∩ V 1 . (2.13) The semigeneration condition stated in the introduction can equivalently be defined as follows: A set W in g is semigenerating if Proof Regarding (2.15), we have, up to changing signs, that X , Y ∈ W . Moreover, since ∂ W is a codimension 1 subspace of V 1 , we have that, up to possibly swapping X with Y , there exists some a ∈ R for which Z :=Y − a X ∈ ∂ W . Thus, we have Z ∈ ∂ W ⊆ e s and X ∈ W ⊆ w s . Moreover, by the assumptions on X and Y , we have that Regarding (2.16), we choose {X 1 , . . . , X m } to be a basis of V 1 such that X 1 ∈ W ⊆ w s and X 2 , . . . , X m ∈ ∂ W ⊆ e s . Take Z ∈ V 2 ∩ Z(g) and express it, for some a i , b i j ∈ R, as Since e s is a Lie algebra by Lemma 2.2.2, we have that the elements Y ,Ỹ , [Y ,Ỹ ] belong to e s . Since Z ∈ Z(g), we get also , which implies that ad 2 Y X 1 ∈ e s . Since X 1 ∈ w s , Y ∈ e s , and ad 2 Y X 1 ∈ e s Lemma 2.3 tells us that [Y , X 1 ] ∈ e s . Going back to (2.17), we finally infer that Z ∈ e s , again because e s is a Lie algebra by Lemma 2.2.2.
For the next lemma, recall that π i : g → g/i is the quotient map modulo an ideal i. We also recall the basic fact that in the Lie algebra g of a simply connected nilpotent Lie group G, a subset i ⊆ g is an ideal if and only if N := exp(i) is a normal Lie subgroup of G; in this case, the quotient g/i is canonically isomorphic to the Lie algebra of G/N and we have the following commutative diagram: Moreover, if g is stratified, then g/i canonically admits a stratification if and only if i is homogeneous.
We stress that we have the following fact for each subset W ⊆ g of a Lie algebra g: Indeed, setting N := exp(i) and denoting by S(A) the semigroup generated by A, we need to show that π N (S(exp(W ))) = S(π N exp(W )). In fact, on the one hand, since the homomorphic image of a semigroup is a semigroup, we have that π N (S(exp(W ))) is a semigroup containing π N (exp(W )), so S(π N exp(W )) ⊆ π N (S(exp(W ))). On the other hand, the set π N (S(exp(W ))) = S(exp(W ))N is contained in the semigroup generated by exp(W )N = π N (exp(W )), i.e., we have π N (S(exp(W ))) ⊆ S(π N exp(W )).

Lemma 2.6
Let i be a homogeneous ideal of a stratified Lie algebra g and let W ⊆ g.
Proof Assume first that W is semigenerating. Then from (2.18) we obtain that π i (W ) is semigenerating by the following calculation: Suppose then that π i (W ) is semigenerating and that i ⊆ Cl(s W ). Then we also have the containment N := exp(i) ⊆ Cl(S W ). Since Cl(S W ) is a semigroup, we have Cl(S W ) · N = Cl(S W ).
(2.19) Therefore from (2.18) we get Taking the closure and the preimage under π N , from the fact that π N is an open map (and hence π −1 N and Cl commute) and from (2.19), we get that Consequently, taking the logarithm, Hence, since π i (W ) is semigenerating, we infer proving that W is semigenerating.
We keep reminding that a quotient algebra g/i of a Carnot algebra g is Carnot if and only if the ideal i is homogeneous. In such a case, we say that g/i is a Carnot quotient of g.

Proposition 2.7 Carnot quotients and products of semigenerated algebras are semigenerated.
Proof Consider a quotient algebra g/i of a semigenerated Carnot algebra g by a homogeneous ideal i. Then, by Lemma 2.6.i, the Carnot algebra g/i is semigenerated, since every horizontal half-space in g/i is of the form π i (W ) for some horizontal half-space W ⊆ g.
Regarding products, let g be a Carnot algebra that is the direct product g = g 1 ×g 2 of two of its Carnot subalgebras. Assume that g 1 and g 2 are semigenerated. Let W ⊂ g be a horizontal half-space. Then for each i = 1, 2 we have that the set As e(s W ) is a vector space, we have that also Hence we infer that W is semigenerating.

Remark 2.8
As a direct consequence of Proposition 2.7, one observes that if a Carnot algebra has a non-semigenerated Carnot quotient, then the algebra cannot be semigenerated. In particular, we point out that every rank-2 Carnot algebra of step at least 3 is not semigenerated, since it has the Engel algebra as a quotient. Indeed, for every such algebra g, we have that g/g (4) with g (4) = V 4 ⊕· · ·⊕ V s is a rank-2 Lie algebra of step exactly 3, i.e., either the Engel algebra or the free Lie algebra of rank 2 and step 3. Since the Engel algebra is a quotient of the free Lie algebra, the claim follows. Regarding the fact that the Engel algebra is not semigenerated, we refer to Sect. 5.1 and specifically to Proposition 5.10.
In the next proposition we verify that three conditions for a stratified Lie algebra are equivalent. In the rest of the paper, we shall call trimmed every such Lie algebra. Proposition 2.9 (Equivalent conditions for the definition of trimmed algebra) For a stratified Lie algebra g the following are equivalent: (a) every proper quotient of g has lower step; Proof The fact that (a) and (b) are equivalent comes from the correspondence between ideals and kernels of homomorphisms. If every ideal contains the last layer, then any quotient has lower step. Vice versa, if there exists an ideal that does not contain the last layer, then the quotient modulo that ideal has still step s.
To see that (b) implies (c), suppose by contradiction that dim Z(g) > 1. We consider the two cases: dim V s > 1 or dim V s = 1. In the first case, we get a contradiction since every one-dimensional subspace i of V s is a nontrivial ideal of g for which V s ⊆ i is not true. In the case dim V s = 1, recalling that Z(g) is graded by ( To see that (c) implies (b), let i ⊆ g be a nontrivial ideal. Since g is nilpotent, we have 1 we get the claim.

Definition 2.10
If g is a stratified Lie algebra that satisfies the equivalent conditions of Proposition 2.9, then we say that g is trimmed.
We expect that every non-semigenerated algebra has a trimmed non-semigenerated quotient. However, we only prove the following weaker statement, which will suffice in the step-3 case.

Proposition 2.11
Let g be a stratified Lie algebra. If g is not semigenerated, then there exists a quotient algebraĝ of g that is not semigenerated such that Proof Let W ⊆ g be a non-semigenerating horizontal half-space. Replacing g with some quotient of it, we may suppose that for every proper homogeneous ideal i of g the half-space W /i is semigenerating in g/i. Indeed, if there exists a homogeneous ideal i of g such that g/i is not semigenerated, we replace g with g/i. We repeat this procedure until every homogeneous ideal i of g has the property that g/i is semigenerated. This will happen, eventually, since every step-2 Carnot algebra is semigenerated.
We shall then show that g has the required properties. First, we check that Z(g) ∩ V 1 is trivial. Indeed, if this space is nontrivial, then, for some n ≥ 1, Since the product of two semigenerated Lie algebras is semigenerated (see Proposition 2.7), we get a contradiction.
Fix any j ≥ 3. Assume by contradiction that dim Z(g) ∩ V j > 1 and let V be a 2dimensional subspace of Z(g)∩V j . Let us also fix a scalar product on g and sets:=Cl(s W )∩V . Observe that, as V is central, each line Rv ∈ V is an ideal of g. Therefore, being W + Rv semigenerating in g/Rv, we have for all u, v ∈ V that, if π : g → g/Rv stands for the projection, where we again used that π −1 and the closure commute. Hence, denoting by B 1/n (u + Rv) the 1/n-neighborhood of the line u + Rv within g, we obtain for every n ∈ N there exists s n ∈ B 1/n (u + Rv) ∩ s W . (2.23) We claim thats where S 1 (V ) stands for the unit circle of V with respect the restricted norm on V . Indeed, denote by ∂ H the boundary of H , which is a line in V , and let ν be the inner unit normal of H . Consider the sequence (s n ) n given by (2.23) for the line 2ν + ∂ H ⊆ H . Then, for every n ∈ N, there exists h n ∈ 2ν + ∂ H such that s n − h n < 1/n. Observe that, since ν = 1 and ∂ H is orthogonal to ν, we have h n > 1 for all n ∈ N. Moreover, since V is spanned by homogeneous elements of the same degree, each path {δ λ (h n ) | λ ∈ [0, 1]} is a straight line segment between 0 and h n contained in H . Hence there exists λ n ∈ (0, 1) such Being S 1 (V ) ∩ H compact and s W invariant under dilations, we find a converging subsequence of (δ λ n (s n )) n ⊆ s W with the limit in S 1 (V ) ∩ H . Hences ∩ S 1 (V ) ∩ H = ∅, proving the claim (2.24).
Notice that since the subalgebra V is abelian, the sets is a semigroup. Since, in addition, V is spanned by elements of the same degree of homogeneity ands is dilation invariant, we have thats is a Euclidean convex cone. Namely, denoting by α the degree of homogeneity of V , we find for every p 1 , p 2 ∈s that, in coordinates, the straight segment connecting them is ins, since We therefore deduce that eithers is contained in some closed half-space H ⊆ V ors = V . In the latter case V is an ideal of g such that V ⊆ Cl(s), which implies by Lemma 2.6.ii that W /V is not semigenerating, contradicting our assumptions.
We may then assume that there exists some closed half-space H ⊆ V such thats ⊆ H . Let v denote one of the two intersection points of ∂ H and S 1 (V ). We are going to argue that v ∈s. Consider a sequence (H n ) n of closed half-spaces in V for which ∩ n (H n ∩ H ) = R + v. By (2.24) we find a sequence (s n ) n ⊆s ∩ S 1 (V ) such that each s n ∈ H n . But sinces ⊆ H , we have that s n ∈ H ∩ H n for every n. Hence s n → v and v ∈s. With a similar argument also −v ∈s and therefore {δ λ (v) | λ ∈ R} = Rv ⊆s. Now Rv is again an ideal of g contained in Cl(s), leading to a contradiction by Lemma 2.6.ii and the fact that W /Rv is semigenerating.
The following lemma is an algebraic observation. It will be essential in our proof of Theorem 3.6, which is a refinement of Theorem 1.5.

Lemma 2.12
Let g be a stratified Lie algebra, let W ⊆ g be a horizontal half-space, and let h be a subalgebra of g containing ∂ W . Then, the following conditions are equivalent.
Proof The fact that (2) implies (1) is trivial, since if [g, g] ⊆ h, then any choice of basis will satisfy the requirements. For the opposite direction, without loss of generality we may assume that g is a free nilpotent Lie algebra. Indeed, if f is the free Lie algebra of the same rank and step as g, then there exists an ideal i ⊆ [f, f] of f such that g ∼ = f/i. Namely, there is a surjective Carnot morphism π : f → g. Assume that the lemma is shown for f and that g satisfies (1) for a horizontal half-space Let then g be a free nilpotent Lie algebra of step s. We shall consider a basis for g that is constructed by a well-known algorithm due to Hall [11]. Below we say that a vector Z has degree To construct the Hall basis, first fix an ordering for {X , Since the ordering for the basis is chosen such that X is the minimal element, this implies that Hence Y ∈ h, by assumption. We have shown that [g, g] = V 2 ⊕ · · · ⊕ V s ⊆ h and the proof is complete.

Sufficient criteria for semigeneration
In Definition 3.2 we introduce Carnot groups of type (♦), which are a generalization of Carnot groups of type ( ). After that we present a proof for Theorem 1.5, which is formulated as a corollary of Theorem 3.6 (see Corollary 3.7). We conclude the section with Lemma 3.8, which is useful in the construction of examples in Sect. 4.

Carnot groups of type (♦)
Lemma 3.1 (Equivalent conditions for the definition of type (♦)). For each subalgebra h of a stratified Lie algebra g for which h ∩ V 1 has codimension one in V 1 , the following are equivalent: for all i, j = 1, . . . , m and k ≥ 2; for all i, j ∈ {1, . . . , m − 1} and k ≥ 2. The first one follows from the fact that Y i , Y j ∈ h and that h is a subalgebra. The second relation follows similarly, since Y i ∈ h and also ad k For the direction (a) implies (b), let {X 1 , . . . , X m } be a basis of V 1 for which (3.1) holds. Observe that X l ∈ V 1 \h for some l ∈ {1, . . . , m} since h ∩ V 1 is (m − 1)-dimensional. Assume, by possibly changing indexing, that l = m.
We claim that this basis together with X m ∈ V 1 \h satisfies condition (3.2). Indeed, for all k ≥ 2 we have that which proves that ad 2 X m Y i ∈ h and ad 2 . . , m, verifying the last missing condition of (3.2).
Next definition is a restating of Definition 1.4. Definition 3.2 (Diamond type). Let g be a stratified Lie algebra. If each subalgebra h of g for which h ∩ V 1 has codimension 1 in V 1 satisfies the equivalent conditions of Lemma 3.1, then we say that g is of type (♦).

Remark 3.3
Every type ( ) algebra, as introduced by Marchi, is of type (♦). Indeed, we recall that a stratified Lie algebra is of type ( ) according to [15] if there exists a basis {X 1 , . . . , X m } of V 1 such that ad 2 Therefore, every such an algebra trivially satisfies (3.1) for every subalgebra h of g.

Remark 3.4
If g is of type (♦) and admits subalgebra h of step ≤ 2 such that h ∩ V 1 has codimension 1 in V 1 , then g is of type ( ). Indeed, by (3.1) there exists a basis {X 1 , . . . , X m } of V 1 such that Despite its simplicity, the following remark will prove useful when finding out if a given Lie algebra is of type ( ).
Indeed, this follows from the fact that the map Y → ad 2 X Y is linear for every X ∈ g.
Next we prove a result that is finer than Theorem 1.5. The latter is then obtained in Corollary 3.7 as an immediate consequence of Theorem 3.6.
. . , m − 1 due to the fact that e s is a Lie algebra, we deduce that The case k ≥ 2 is proven by induction. The first step ad 2 X Y i ∈ e s is given by (3.2). Let us then assume that ad k X Y i ∈ e s for some k ≥ 2. Since also ad 2 for all i, j = 1, . . . , m and k ≥ 2. Hence W is semigenerating by Theorem 3.6. Since W was arbitrary, we conclude that g is semigenerated.
The following lemma gives a method to construct examples of algebras of type (♦) by taking suitable quotients of product Lie algebras. In Example 4.6, we shall use Lemma 3.8 to give an example of a Lie algebra of type (♦) that is not of type ( ). Lemma 3.8 Let n ∈ N and let g l be a stratified Lie algebra for each l ∈ {1, . . . , n}. Let g:= n l=1 g l with projections π l : g → g l and fix a basis {X l 1 , . . . , X l m l } for each g l . If i is a homogeneous ideal of g such that
Proof Let h be a subalgebra of g/i for which h ∩ V 1 (g/i) has codimension 1 in V 1 (g/i) and, denoting by π the projection π : g → g/i, let h be a subalgebra of g for which π( h) = h. Notice first that the set {π(X l 1 ), . . . , π(X l m l )} n l=1 spans V 1 (g/i). Taking (3.1) into account, since [X l i , X k j ] = 0 whenever l = k, to prove semigeneration of g/i it is enough to check that To do this, let ·, · be a scalar product on V 1 (g) that makes the basis {X l 1 , . . . , X l m l } n l=1 orthonormal. Let ν ∈ V 1 (g)\{0} be a vector that is orthogonal to h Without loss of generality, assume that a 1 1 = 1. Then, for every l = 2, . . . , n and i = 1, . . . , m l we have that Y l i = X l i − a l i X 1 1 ∈ h, as now Y l i , ν = 0. Since X 1 1 commutes with every g l for which l ∈ {2, . . . , n}, we immediately deduce that This proves (3.7) for all i, j ∈ {1, . . . , m l }, k ≥ 2 and l ∈ {2, . . . , n}. It is then left to show that each term in (3.6) with l = 1 is projected to h. Let Z be such a term. By (3.6), we have Z ∈ π 1 (i). Since i is homogeneous and Z ∈ [g 1 , g 1 ], there exists some Z ∈ n l=2 [g l , g l ] such that Z + Z ∈ i. But since n l=2 [g l , g l ] ⊆ h, we have that Z ∈ h + i and therefore π(Z ) ∈ h.

Some results and examples in low-step algebras
In the following section we collect some lemmata that are valid in Carnot algebras of step at most 4 and which will be used later in Section 5. However, these lemmata can also be useful when proving semigeneration of specific examples in low step. In the end of this section we provide two examples in step 3 that show that, on the one hand, algebras of type (♦) form a strictly larger class than algebras of type ( ) and, on the other hand, that yet being of type (♦) is not a necessary condition for semigeneration.
The following result gives, for step ≤ 4, equivalent conditions for being a semigenerating horizontal half-space.

Lemma 4.1 Let g be a stratified Lie algebra of step at most 4. For each horizontal half-space
W in g, writing s = Cl(s W ), the following are equivalent: Similarly to Lemma 2.3, the following lemma gives (in step at most 4) a method to deduce new directions that are contained in the edge of a semigroup generated by a horizontal half-space. Lemma 4.3 below will be used in Example 4.7 and again in the proof of Proposition 5.12.

Lemma 4.3 Let g be a stratified Lie algebra of step at most 4 and let W be a horizontal half-space in
Proof Observe that V 1 = RX ⊕ ∂ W for some X ∈ W ⊆ w s . The ideal i:=I g (Z ) is graded and, recalling that Z ∈ V 2 , we have that its layers are We plan to show that I g (Z ) ⊆ e s , where we recall that e s is a Lie algebra by Lemma  Next we prove that having a sufficiently large semigenerated subalgebra implies semigeneration. We shall exploit this fact later in the proof of Proposition 5.12.

Lemma 4.4 Let g be a stratified Lie algebra of step at most 4. If g has a semigenerated proper subalgebra h such that V 3 (g) ⊆ h, then g is semigenerated.
Proof Let W be a horizontal half-space and let us show that it is semigenerating. Set where the last containment is a consequence of the inclusions h ⊂ g and W ⊂ W . Since V 3 (g) is a vector subspace of g, then by definition of e(s W ) we have V 3 (g) ⊂ e(s W ). Hence W is semigenerating again by Lemma 4.1.
We remark that, actually, the above Lemma 4.4 has the following analogue in algebras of arbitrary step: if h is a semigenerated subalgebra of g and there exists a basis {X 1 , . . . , X m } of V 1 (g) such that the Diamond-terms (3.1) are in h, then g is semigenerated. The proof is the same, but in the final step one needs to use Theorem 3.6 instead of Lemma 4.1.

Corollary 4.5 (of Proposition 2.11).
Let g be a stratified Lie algebra of step 3. If g is not semigenerated, then there exists a quotient algebra of g that is trimmed and not semigenerated.
In the rest of this section we provide some examples. We first show a 7-dimensional Lie algebra of step 3 that is of type (♦) but that is not of type ( ), see Example 4.6. Then we provide a 6-dimensional Lie algebra that is semigenerated but not of type (♦), see Example 4.7.

Example 4.6
Let h 1 , h 2 be two copies of the four-dimensional Engel algebra E 1 and consider their product Lie algebra h 1 × h 2 . Denoting by Z 1 and Z 2 the generators of V 3 (h 1 ) and V 3 (h 2 ), respectively, and identifying h 1 and h 2 with the respective subalgebras of h 1 × h 2 , we have that is an ideal of h 1 × h 2 and the quotient algebra is a 7-dimensional (trimmed) stratified Lie algebra of step 3 (which in the Gong's classification [10, p. 57] is denoted by (137A)). We claim that g is of type (♦) but it is not of type ( ). Indeed, the fact that g is of type (♦) follows immediately from Lemma 3.8 with i = R(Z 1 − Z 2 ), as now π l (i) = V 3 (h l ) for both l = 1 and l = 2.
We argue next that g is not of type ( ). Let {X 1 , . . . , X 7 } be a basis of g for which {X 1 , . . . , X 4 } is a basis of V 1 (g) and the only nonzero brackets are [X 1 , 7 , as presented in the diagram below. Then for a vector Y := 4 i=1 a i X i ∈ V 1 we have, for instance, that ad 2 Y (X 2 ) = a 2 1 X 7 . In particular, if Y is such that ad 2 Y (V 1 ) = 0, then a 1 = 0. Consequently, the set of vectors Y ∈ V 1 satisfying ad 2 Y (V 1 ) = 0 is contained in a 3-dimensional subspace of V 1 (g). We conclude by Remark 3.5 that g is not of type ( ).
The Lie brackets of this last example can be described by the following diagram, where each pair of lines forming the shape of a V have at the extremes two vectors; the symbol should be read as follows: the bracket of the vector at the left hand of the V with the vector at the right hand of the V gives the vector at the bottom (here, for instance, [X 1 , X 2 ] = X 5 ). For more uses of these type of diagrams see [14].
Example 4.7 Let g be the 6-dimensional step-3 Lie algebra (N 6,2,6 in [10, p. 33]), where the only non-trivial brackets are given by The Lie brackets can be described by the following diagram: The above diagram should be read as the one in the previous example, except the fact that for the V-shape with an arrow going from right to left of the V, one should interpret that the bracket of the vector on the right with the vector on the left gives the bottom, i.e., [X 1 , X 4 ] = X 6 .
The Carnot algebra g of this example is semigenerated but it is not of type (♦). Indeed, to prove that it is semigenerated, let W ⊆ g be a horizontal half-space and let us show that V 3 = RX 6 ⊆ e s , where s:=Cl(s W ). This would show that W is semigenerating by Lemma 4.1.
Suppose first that X 1 / ∈ ∂ W . The rank of g is 3, so ∂ W has dimension 2. Then there exist some a, b ∈ R such that Y 2 :=X 2 − a X 1 and Y 3 :=X 3 − bX 1 form a basis for ∂ W . Since ∂ W ⊆ e s and e s is a Lie algebra by Lemma 2.2, we obtain If a = 0 or b = 0, we get where the last inclusion comes from Lemma 4.3. If instead a = b = 0, then X 2 = Y 2 ∈ e s . Since ad 2 X 2 X 1 = 0, by Lemma 2.3 we get that [X 1 , X 2 ] = X 4 ∈ e s . Again, since V 3 ⊆ I(X 4 ), by Lemma 4.3 we get that V 3 ⊆ e s .
The cases X 2 / ∈ ∂ W and X 3 / ∈ ∂ W are easier: if X 2 / ∈ ∂ W we find, like above, some a, b ∈ R such that ∂ W = span{X 1 − a X 2 , X 3 − bX 2 }. It then suffices to notice that X 6 ∈ Lie(X 1 − a X 2 , X 3 − bX 2 ) ⊆ e s , for all choices of a, b ∈ R. Similarly, the case X 3 / ∈ ∂ W follows from the fact that X 6 ∈ Lie(X 1 − a X 3 , X 2 − bX 3 ) for all a, b ∈ R. We conclude that g is semigenerated.
Finally, to justify that g is not of type (♦), observe that the span of X 2 and X 3 is an abelian stratified subalgebra of g. If g were type of (♦), then by Remark 3.4 it would be of type ( ). However, similarly to Example 4.6, we have for an arbitrary element Y = Hence vectors Y ∈ V 1 for which ad 2 Y (V 1 ) = 0 must satisfy a 1 = 0, which proves the non-existence of type ( )-basis by Remark 3.5.

Engel-type algebras
In the rest of the paper we concentrate on a family of Carnot algebras that we call of Engel type. These algebras can be constructed through an iterative process from the classical 4-dimensional Engel algebra. Similarly to the Engel algebra, every Engel-type algebra is trimmed and non-semigenerated, as we shall show in Propositions 5.8 and 5.10. A more subtle result is that, at least in step 3, the Engel-type algebras are the only Carnot algebras with these properties. For this last part, see Proposition 5.12. The proof of Theorem 1.2 will then be straightforward.

Definition and properties
Definition 5.1 (Engel-type algebra E n ). For each n ∈ N, we denote by E n and call it the n-th Engel-type algebra the 2(n + 1)-dimensional Lie algebra (of step 3 and rank n + 1) with basis {X , where the only non-trivial brackets are given by The first two Engel-type algebras are the following. The first is E 1 , and it is commonly known as Engel algebra, see [4], and we represent it by the diagram below.
The second Engel-type algebra E 2 is the six-dimensional algebra N 6,3,1a in [10, p. 135] and its diagram is presented below.
Z Each Engel-type algebra is a Lie algebra (see the simple verification in Remark 5.2) and admits a step-3 stratification: We shall also give another equivalent definition for E n in Proposition 5.7. We first list some properties of such Lie algebras.

Remark 5.2
Each Engel-type algebra given by the brackets (5.1) is indeed a Lie algebra. Namely, let us verify that the Jacobi identity is satisfied. Since the basis has a natural stratification, it is enough to check the identity for triples in the set Hence, we just consider the case X , In the second case, we have

Lemma 5.3 (Properties of Engel-type algebras)
The n-th Engel-type algebra E n with a basis satisfying (5.1) has the following properties.
(i) If n ≥ 2, then span{Y 1 , . . . , Y n } is the unique abelian n-dimensional subspace of V 1 (E n ); (ii) the line RX is the unique horizontal line satisfying [RX , V 2 ] = {0}; (iii) for every nonzero Y ∈ span{Y 1 , . . . , Y n }, we have Then there exists ν ∈ H of the form proving that H is nonabelian.
(ii) Let now where a k = 0 for some k ∈ {1, . . . , n}. Then We provide next the automorphism group of the Engel-type algebras, which will be used later in the proof of Lemma 5.5 where we characterize all stratified subalgebras of the Engeltype algebras. For the automorphism group of the Engel algebra, we refer to [4, Lemma 2.3].

Lemma 5.4 Consider the basis {X
. Fix a scalar product ·, · on V 1 (E n ) that makes {Y 1 , . . . , Y n } orthonormal. Then every linear transformation on V 1 (E n ) that in the basis {X , Y 1 , . . . , Y n } is given by the block matrix induces a Lie algebra automorphism of E n . Moreover, every automorphism of E n is induced by such a transformation on V 1 (E n ).
Proof By Lemma 5.3.(i) and (ii), every ∈ Aut(E n ) must fix the subspaces span{Y 1 , . . . , Y n } and RX . Moreover, notice that any linear map on V 1 (E n ) fixing these subspaces satisfies, for some a = 0, the two equalities: Therefore, using again that {Y j } j are orthonormal, we deduce that Recall that the basis vectors of E n satisfy [Y i , [Y j , X ]] = δ i j Z . Therefore, the map induces a Lie algebra automorphism of E n if and only if there exists some b = 0 such that According to (5.2), this is equivalent to saying that the map is, up to scaling, an orthogonal transformation on span{Y 1 , . . . , Y n } .
For a good understanding of the rest of this section, we stress that we say that a subalgebra of a stratified Lie algebra is stratified if it is homogeneous and stratified with respect to the induced grading. Lemma 5.5 Let 1 ≤ k ≤ n. If h is a stratified rank-k subalgebra of the n-th Engel-type algebra E n , then either h is abelian or it is isomorphic to E k−1 .
Proof If n = 1, the claim is trivially true. Assume then that n ≥ 2 and let {X , Y 1 , . . . , Y n } be a basis of V 1 (E n ) as in (5.1). We start by proving the case k = n. Assume first that h is the subalgebra generated by {X + aY n , Y 1 , . . . , Y n−1 } for some a ∈ R. Observe that then h is isomorphic to E n−1 for every value of a ∈ R since, for each i = 1, . . . , n − 1, we have that Recall that, by Lemma 5.3.i, the subspace span{Y 1 , . . . , Y n } is the unique abelian stratified subalgebra of E n .
Since every n-dimensional subspace of V 1 (E n ) which is not equal to span{Y 1 , . . . , Y n } can be realized from some subspace span{X + aY n , Y 1 , . . . , Y n−1 }, a ∈ R, by a rotation of V 1 (E n ) around the X -axis, we infer by Lemma 5.4 that any subalgebra generated by such subspace is isomorphic to E n−1 .
Regarding the case k < n, fix a non-abelian stratified rank-k subalgebra h k of E n . Then we find a filtration h k ⊂ h k+1 ⊂ · · · ⊂ h n ⊂ E n of non-abelian stratified rank-l subalgebras h l , l = k + 1, . . . , n. The claim follows now by the first part of this proof.
There are plenty of Lie algebras of arbitrarily large step whose first three layers coincide with the first Engel-type algebra, for example, the filiform algebras. The same phenomenon does not happen for the other Engel-type algebras. Since we need this latter fact in the proof of Proposition 5.7, we clarify such a phenomenon in the next remark.

Remark 5.6
For each n ≥ 2, the Lie algebra E n cannot be 'prolonged' in the following sense: if g is a stratified Lie algebra for which g/g (4) is isomorphic to E n for some n ≥ 2, where g (4) = V 4 ⊕ · · · ⊕ V s , then g = E n .
The Engel-type algebras have the following equivalent definition using induction. Proposition 5.7 (A characterization of Engel-type algebras) Let g be a stratified Lie algebra of rank n + 1 ≥ 4. Then g is isomorphic to E n if and only if g has a unique abelian stratified subalgebra of rank n and every other stratified subalgebra of rank n is isomorphic to E n−1 . Moreover, this characterization holds for rank n + 1 = 3 if in addition dim V 3 (g) = 1.
Proof One direction is proven in Lemmata 5.3.i and 5.5. Regarding the other direction, let g be a rank n + 1 stratified Lie algebra, with n + 1 ≥ 3, which has a unique abelian stratified subalgebra h 0 of rank n and every other rank-n stratified subalgebra is isomorphic to E n−1 .
Our first aim is to show that the condition dim V 3 (g) = 1 always holds as long as n+1 ≥ 4. We start by claiming the following property: On the one hand, if l ⊕ Rν is an abelian subalgebra of g, then l ⊕ Rν = h 0 by uniqueness of h 0 and so l ⊂ h 0 . On the other hand, if l ⊕ Rν generates a nonabelian subalgebra, then l ⊕ Rν is isomorphic to Lemma 5.3.i). Then again l ⊂ h 0 and (5.3) is proven.
Recall that as g is stratified. We are going to show that vectors ] are nonzero and let h 1 ⊇ {X 1 , X 2 , X 3 } and h 2 ⊇ { X 1 , X 2 , X 3 } be rank-n subalgebras of g. Since h 1 and h 2 have nonzero third layers, they are isomorphic to E n−1 . We may assume that ] are linearly dependent. Hence, being it the intersection of two different hyperplanes, the space is a codimension 2 subspace of V 1 (g), i.e., it has dimension n − 1.
To prove that dim V 3 (g) = 1, we have to show that V 3 (h 1 ) = V 3 (h 2 ), for all such h 1 and h 2 as above. The proof for the latter fact is divided into two cases depending on whether is closed under brackets (or equivalently, it is an abelian subalgebra) or not. Assume first that V 1 (h 1 ) ∩ V 1 (h 2 ) forms an abelian subalgebra. Then by claim (5.3) we have that ) for i = 1, 2 and write it in terms of this basis as Notice that, since h i is not abelian, we have a i = 0. Since now {Y i , Z 1 , . . . , Z n−1 } is a basis of V 1 (h i ) for i = 1, 2 and since h 0 = span{Z 1 , . . . , Z n } is abelian, we obtain where the first and the last equality follow from Lemma 5.3 (iii is not a subalgebra. Then, by Lemma 5.5, the Lie algebra generated by V 1 (h 1 ) ∩ V 1 (h 2 ) is isomorphic to E n−2 . In particular, it has step 3. Exploiting again the fact dim V 3 (h 1 ) = dim V 3 (h 2 ) = 1, we get that are linearly dependent as in the previous case. This concludes the proof for the fact that dim V 3 (g) = 1 when n + 1 ≥ 4. Hence, in what follows we may assume that V 3 (g) is one dimensional, and that n + 1 ≥ 3.
In the rest of this proof we are going to construct a basis of g that satisfies the defining commutator relations (5.1) of the Engel-type algebra E n . Let h ∼ = E n−1 be some nonabelian rank-n subalgebra of g and let {X , be a basis of h satisfying relations (5.1). We aim to find a vector Y n ∈ V 1 which together with to the defining basis of E n . Since E n cannot be prolonged (see Remark 5.6), this is enough to prove that g is isomorphic to E n . Notice that h 0 ∩ h = span{Y 1 , . . . , Y n−1 } since span{Y 1 , . . . , Y n−1 } is the unique abelian subspace of V 1 (h) by Lemma 5.3 (i). Moreover, where a, a i ∈ R, i = 1, . . . , n − 1, are values to be determined later. Now whenever a = 0 we have that span{Y 1 , . . . , Y n } = h 0 is abelian and {Y 1 , . . . , Y n , X } is a basis of V 1 (g). To conclude the proof of the proposition, we claim that it suffices to show that Indeed, we stress again that, by Remark 5.6, the Lie algebra E n cannot be prolonged and hence we indeed have that the set {X , Y i , T i , Z } n−1 i=1 is a basis of a step-3 Lie algebra isomorphic to E n .
To show (i), observe that for every i = 1, . . . , n − 1, Since V 3 (g) is one dimensional, the two vectors [Ŷ n , T i ] and Z are linearly dependent. Hence for every i = 1, . . . , n − 1 there exists a i ∈ R such that [Y n , T i ] = 0, which proves (i).
As [Y n , [Y n , V 1 (h )]] = 0 by Lemma 5.3 (iii) and since V 3 (g) = RZ , we may choose a ∈ R such that Thus (ii) is proven.
Regarding (iii), it is enough to notice that from (i) we have for every choice of b i ∈ R, i = 1, . . . , n − 1, whereas from (ii) we have This finishes the proof of (iii) and of the proposition.
Next we show that each Lie algebra E n is trimmed and that a horizontal half-space W is, for n ≥ 2, not semigenerating if and only if ∂ W is the abelian codimension 1 subspace of V 1 . Recall our definition of trimmed algebra from Proposition 2.9.

Proposition 5.8 Every Engel-type algebra is trimmed.
Proof Let n ∈ N and let E n be the Engel-type algebra with the defining basis (5.1). We shall use the third definition of trimmed Lie algebra in Proposition 2.9. Recall, see (2.3), that in every step-s stratified Lie algebra g, we have that the center Z(g) is graded and V s ⊆ Z(g). Hence, noticing that dim Then a i = 0 for some i = 1, . . . , n and hence
Proof By Lemma 5.5, we have that Lie(∂ W ) is isomorphic to E n−1 . In particular, Proof Let n ≥ 1 and let us consider the following explicit representation of the basis elements as vectors in R 2(n+1) : where i = 1, . . . , n. It is readily checked that these vector fields satisfy the commutator relations given in Definition 5.1. We consider the set We shall show that, for W := R + X ⊕ span{Y 1 , . . . , Y n }, the set C contains Cl(S W ) but exp(V 3 ) is not contained in C.
Regarding Cl(S W ) ⊂ C, we claim that it is enough to show that Indeed, assume that (5.4) holds. Since C is closed, it suffices to prove that S W ⊆ C. As 0 ∈ C, then by (5.4) we have that exp(Y ) ∈ C for all Y ∈ W . Then, again by (5.4), for every finite collection Therefore, we conclude by (2.2) that which we needed to show. To prove claim (5.4), we use the fact that the curve t → p exp(tY ) is the flow line of the vector field Y starting from p. Write Y = a X + n i=1 b i Y i with a ≥ 0 and b i ∈ R. The ODE given by this vector field is In particular, from the above expression of the vector fields in coordinates, we have that the 2(n + 1)-th component of p exp(t X) satisfies which is non-negative. Notice that if p ∈ C, then at time t = 0 the 2(n + 1)-th component is non-negative, i.e., p exp(t X) 2(n+1) = p 2(n+1) ≥ 0. Therefore, p exp(t X) ∈ C for all t ∈ R + by (5.5), and so claim (5.4) is proven. To see that exp(V 3 ) is not contained in C, we observe that V 3 = RZ and Z = ∂ 2(n+1) . We get the conclusion since C is not ∂ 2(n+1) -invariant.
For the time being, we do not know if the intrinsic C 1 -rectifiability result for finiteperimeter sets according to [9] holds in non-semigenerated Carnot groups. However, in [7, Corollary 5.12], a priori weaker intrinsic Lipschitz rectifiability of finite-perimeter sets was shown in every Carnot group that admits a non-abnormal horizontal line. As a final remark before proceeding to the proof of Theorem 1.2, we shall characterize non-abnormal horizontal lines of the n-th Engel-type algebras for n ≥ 2. The case n = 1 is treated in [7, Section 6]. As a consequence, we have that the reduced boundary of a finite-perimeter set in any Engel-type algebra is intrinsically Lipschitz rectifiable.
Assume then ν / ∈ span{Y 1 , . . . , Y n } ∪ RX and let us show that the line t → exp(tν) is non-abnormal by proving that ν satisfies conditions (i) and (ii). Now ν can be written as where a, a i ∈ R are such that a = 0 and a j = 0 for some j = 1, . . . , n. Then Consequently, condition (i) is satisfied. To prove that also (ii) holds, let j ∈ {1, . . . , n} be such that a j = 0 and notice that [ν, RY j ] = RT j . Then

Proof of Theorem 1.2
We conclude with the following characterization of trimmed non-semigenerated Carnot algebras in step 3. As a corollary, we shall obtain Theorem 1.2.

Proposition 5.12
Let g be a stratified Lie algebra of step 3. If g is trimmed and not semigenerated, then it is isomorphic to some E n .
Proof We start by proving the following fact. If g is a trimmed Lie algebra of step 3 and rank n +1 with a non-semigenerating half-space W ⊆ V 1 , then ∂ W is abelian; (5.6) and for n + 1 ≥ 3 every rank-n Carnot subalgebra h with V 1 (h) = ∂ W , is trimmed and not semigenerated. Regarding the proof of (5.6), suppose by contradiction that there exist Y 1 , Y 2 ∈ ∂ W such that [Y 1 , Y 2 ] = 0. Set s := Cl(s W ). As ∂ W ⊆ e s , we have by Lemma 2.2.2 that [Y 1 , Y 2 ] ⊆ e s . Then on the one hand, by Lemma 4.3 we have I g ([Y 1 , Y 2 ]) ⊆ e s . On the other hand, since g is trimmed, we have that V 3 ⊆ I g ([Y 1 , Y 2 ]), as the latter is a nontrivial ideal. Hence, we infer that V 3 ⊆ e s . Consequently, according to Lemma 4.1 we get a contradiction, since W was assumed not to be semigenerating. Thus (5.6) is proved.
Regarding the proof of (5.7), we show first that Indeed, since we have the decomposition V 1 (g) = ∂ W ⊕ RX and ∂ W is abelian by (5.6), we get that Y commutes with V 1 (g). Since V 1 (g) generates g, we get that Y ∈ Z(g) ∩ V 1 (g), but the latter is trivial since g is trimmed. Hence, we get (5.10).
Regarding the proof of (5.8), we assume, aiming for contradiction, that there exists a nonzero element in Z(h) ∩ V 1 (h) = Z(h) ∩ H . We have two possibilities: either the element is of the form X ∈ H \∂ W or it is of the form Y ∈ ∂ W ∩ H . In the first case, since ∂ W ∩ H is not trivial being the intersection of two hyperplanes, we can find a nonzero Y in it contradicting (5.10). In the second case, since H \∂ W is not empty being the two sets different hyperplanes, we can find X in it contradicting (5.10). Together these two cases prove (5.8).
Regarding (5.9), assume the contrary and let Z ∈ Z(h) ∩ V 2 (h) be nonzero. Applying (2.16) for h gives Z ∈ e(Cl(s W ∩H )) , where the latter is a subset of e s .
Similarly to the proof of (5.6), then by the fact that g is trimmed and by Lemma 4.3 we have Since W is not semigenerating. by Lemma 4.1 we get a contradiction. So (5.9) is proved.
Properties (5.8) and (5.9), together with the fact that Z(h) is a non-trivial homogeneous subspace of h, imply that Since V 3 (g) has dimension 1 as g is trimmed, we get that Z(h) has dimension 1, i.e., we obtained that h is a trimmed step-3 Lie algebra.
We complete the proof by an induction argument. The initial step is given for rank n+1 = 2 by the classical Engel algebra E 1 , since every trimmed Carnot algebra of rank 2 and step 3 is isomorphic to E 1 (see Remark 2.8). Let then n + 1 ≥ 3 and suppose, by induction assumption, that every trimmed step-3 non-semigenerated Lie algebra of rank n is isomorphic to E n−1 . Let g be a trimmed step-3 non-semigenerated Lie algebra of rank n+1. By (5.6) and (5.7), the Lie algebra g has a unique abelian stratified subalgebra of rank n and, by induction assumption, every other rank-n stratified subalgebra is isomorphic to E n−1 . As dim V 3 (g) = 1 since g is trimmed, we conclude that g is isomorphic to E n by Proposition 5.7.

Proof of Theorem 1.2
To prove the easy direction of Theorem 1.2, we recall that every Engel-type algebra is not semigenerated, see Proposition 5.10. Hence, if a Carnot algebra g has an Engel-type algebra as a quotient, then g is not semigenerated, see Proposition 2.7. Regarding the other implication of Theorem 1.2, let g be a step-3 Carnot algebra that is not semigenerated. By Proposition 2.11, there exists a quotient algebra of g that is trimmed and not semigenerated. Notice that, being not semigenerated, still such a quotient has step 3. Proposition 5.12 makes us conclude that such a quotient is isomorphic to some Engel-type algebra.
Funding Open access funding provided by University of Jyväskylä (JYU).
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.