# Horizontally Affine Functions on Step-2 Carnot Algebras

Enrico Le Donne<fnref n="1" />,<fnref n="2" /> ID · Daniele Morbidelli<fnref n="3" /> · Séverine Rigot<fnref n="4" />

Received: 17 August 2021 / Accepted: 19 June 2023 / Published online: 9 September 2023
© The Author(s) 2023

## Abstract

In this paper, we introduce the notion of horizontally affine, h-affine in short, function and give a complete description of such functions on step-2 Carnot algebras. We show that the vector space of h-affine functions on the free step-2 rank-n Carnot algebra is isomorphic to the exterior algebra of $\mathbb{R}^n$. Using that every Carnot algebra can be written as a quotient of a free Carnot algebra, we shall deduce from the free case a description of h-affine functions on arbitrary step-2 Carnot algebras, together with several characterizations of those step-2 Carnot algebras where h-affine functions are affine in the usual sense of vector spaces. Our interest for h-affine functions stems from their relationship with a class of sets called precisely monotone, recently introduced in the literature, as well as from their relationship with minimal hypersurfaces.

**Keywords** Step-2 Carnot groups · Step-2 Carnot algebras · Horizontally affine functions

E.L.D. was partially supported by the Academy of Finland (Grant 288501 'Geometry of subRiemannian groups' and by Grant 322898 'Sub-Riemannian Geometry via Metric-geometry and Lie- group Theory') and by the European Research Council (ERC Starting Grant 713998 GeoMeG 'Geometry of Metric Groups'). S.R. is partially supported by ANR Project SRGI (Sub-Riemannian Geometry and Interactions) ANR-15-CE40-0018.

<figure><img src="image_1.png" /></figure>

Enrico Le Donne
enrico.ledonne@unifr.ch

Daniele Morbidelli
daniele.morbidelli@unibo.it

Séverine Rigot
severine.rigot@univ-cotedazur.fr

<footnote n="1">1 Département de Mathématiques, Université de Fribourg, Ch. du musée 23, 1700 Fribourg, Switzerland</footnote>

<footnote n="2">2 Department of Mathematics and Statistics, University of Jyväskylä, P.O. Box (MaD), 40014 Jyvaskyla, Finland</footnote>

<footnote n="3">3 Dipartimento di Matematica, Alma Mater Studiorum Università di Bologna, Bologna, Italy</footnote>

<footnote n="4">4 Université Côte d'Azur, CNRS, LJAD, Nice, France</footnote>
# 1 Introduction

In this paper, we introduce the notion of horizontally affine function and give a complete description of such functions on step-2 Carnot algebras, or equivalently on step-2 Carnot groups. In the free step-2 rank-n case, we shall see that the vector space of horizontally affine functions is isomorphic to the exterior algebra of $\mathbb{R}^n$. Using the known fact that every step-2 Carnot algebra can be written as a quotient of a free step-2 Carnot algebra, we shall next deduce from the free case a description of horizontally affine functions on arbitrary step-2 Carnot algebras, together with several characterizations of those step-2 Carnot algebras where h-affine functions are affine in the usual sense of vector spaces.

To introduce the discussion, let us recall some definitions. We refer to Sect. 2 for more details. Let $g = g_1 \oplus g_2$ be a step-2 Carnot algebra, which means that $g$ is a finite dimensional real<fnref n="1" /> nilpotent Lie algebra of step 2, $g_2 := [g, g]$ denotes the derived algebra, and $g_1$ denotes a linear subspace of $g$ that is in direct sum with $g_2$. Such a Lie algebra is naturally endowed with the group law given by

$$x \cdot y := x + y + [x, y]$$

for $x, y \in g$ that makes it a step-2 Carnot group. Actually every step-2 Carnot group can be realized in this way. We shall therefore view a step-2 Carnot algebra both as a Lie algebra and as a Lie group. We also adopt the notation $y^t := ty$ for all $t \in \mathbb{R}$ and $y \in g$. A function $f: g \to \mathbb{R}$ is said to be horizontally affine, and for brevity, we say that $f$ is h-affine and write $f \in \mathrm{Aff}_h(g)$, if for all $x \in g$ and $y \in g_1$ the function $t \in \mathbb{R} \mapsto f(x \cdot y^t)$ is affine. Note that this definition is purely algebraic - it has in particular no connection with the choice of a subRiemannian metric structure on $g$ - and can be equivalently restated in geometrical terms as follows. A function $f: g \to \mathbb{R}$ is h-affine if and only if its restriction to each integral curve of every left-invariant horizontal vector field is affine when seen as a function from $\mathbb{R}$ to $\mathbb{R}$, where a left-invariant vector field is said to be horizontal whenever it belongs to $g_1$.

Horizontally affine functions appear naturally in relation with monotone sets, an important class of sets introduced by Cheeger and Kleiner [5], see also [4, 8, 12, 14] and the discussion below. However, h-affine functions are studied systematically for the first time here. See also [1] for a further study of a related notion in more general settings.

Our purposes in the present paper are twofold. We first give a description of h-affine functions on step-2 Carnot algebras, starting with the free case from which the general case will follow. We shall next deduce from this description several characterizations of those step-2 Carnot algebras where h-affine functions are affine. We shall keep the standard terminology saying that a function $f: g \to \mathbb{R}$ is affine, writing $f \in \mathrm{Aff}(g)$, to mean that $f$ is affine in the usual sense considering the vector space structure on

<footnote n="1">¹ It is worth to stress that our arguments and results can be verbatim extended to finite dimensional nilpotent Lie algebras of step 2 over an arbitrary field of characteristic zero.</footnote>
g. Note indeed that by elementary properties of step-2 Carnot algebras, each affine function $f \in \text{Aff}(g)$ is h-affine. In other words, in every step-2 Carnot algebra $g$, the vector space $\text{Aff}(g)$ is a linear subspace of $\text{Aff}_h(g)$, see the discussion in Sect. 2. This inclusion may, however, be strict, as we shall see.

More explicitly, h-affine functions can be described with the help of the *Carnot dilations* $\delta_t : g \to g$ given by $\delta_t(x_1 + x_2) := tx_1 + t^2x_2$ for $x_1 \in g_1$, $x_2 \in g_2$, and $t \in \mathbb{R}^* := \mathbb{R} \setminus \{0\}$. Given a non-negative integer $i$ we define the vector space of $i$-homogeneous h-affine functions as

$$ \text{Aff}_h(g)_i := \{ f \in \text{Aff}_h(g) : f \circ \delta_t = t^i f \text{ for all } t \in \mathbb{R}^* \}. $$

We shall prove that every $f \in \text{Aff}_h(g)$ can be written in a unique way as a finite sum of $i$-homogeneous h-affine functions for some $i$'s in $\{0, \dots, \kappa\}$ where $\kappa := \text{rank } g$ if $g$ is a free step-2 Carnot algebra and $\kappa := \text{rank } g - 1$ if $g$ is a nonfree step-2 Carnot algebra. Recall that the rank of $g$ is defined as rank $g := \dim g_1$. Furthermore, denoting by $\Lambda^k \mathbb{R}^n$ the space of alternating $k$-multilinear forms over $\mathbb{R}^n$ (see Sect. 6 for our conventions about exterior algebra), we shall also prove that for every $i \in \{0, \dots, \kappa\}$ the vector space $\text{Aff}_h(g)_i$ is isomorphic to a linear subspace of $\Lambda^{\kappa-i} \mathbb{R}^k$. See Theorems 1.1, 1.2, and 1.3 for detailed statements.

Let us first consider the free case. Throughout this paper, given an integer $n \ge 2$, we shall use the model for the free step-2 rank-$n$ Carnot algebra $f_n$ given by

$$ f_n := \Lambda^1 \mathbb{R}^n \oplus \Lambda^2 \mathbb{R}^n $$

equipped with the Lie bracket where the only nontrivial relations are given by

$$ [\theta, \theta'] := \theta \wedge \theta' \quad \text{for } \theta, \theta' \in \Lambda^1 \mathbb{R}^n. $$

The induced group law takes the form

$$ (\theta + \omega) \cdot (\theta' + \omega') := \theta + \theta' + \omega + \omega' + \theta \wedge \theta' $$

for $\theta, \theta' \in \Lambda^1 \mathbb{R}^n$, $\omega, \omega' \in \Lambda^2 \mathbb{R}^n$. For notational convenience, we shall frequently identify $f_n$ with $\Lambda^1 \mathbb{R}^n \times \Lambda^2 \mathbb{R}^n$ writing elements in $f_n$ as $(\theta, \omega)$ where $\theta \in \Lambda^1 \mathbb{R}^n$, $\omega \in \Lambda^2 \mathbb{R}^n$.

Given integers $n \ge 2$, $i \in \{0, \dots, n\}$, and $\eta \in \Lambda^{n-i} \mathbb{R}^n$, we define $\varphi_\eta : f_n \to \Lambda^n \mathbb{R}^n$ as

$$ \varphi_\eta(\theta, \omega) := \begin{cases} \omega^k \wedge \eta & \text{if } i = 2k \text{ is even} \\ \theta \wedge \omega^k \wedge \eta & \text{if } i = 2k + 1 \text{ is odd.} \end{cases} \qquad (1.1) $$

The description of h-affine functions on $f_n$ can then be given in terms of the functions $\varphi_\eta$'s and reads as follows.

**Theorem 1.1** For $n \ge 2$, we have

$$ (i) \text{ Aff}_h(f_n) = \bigoplus_{i=0}^{n} \text{Aff}_h(f_n)_i. $$
Furthermore, given $i \in \{0, \dots, n\}$ and $v \in \Lambda^n \mathbb{R}^n \setminus \{0\}$, we have

(ii) $f \in \text{Aff}_h(f_n)_i$ if and only if there is $\eta \in \Lambda^{n-i} \mathbb{R}^n$, which is unique, such that $fv = \varphi_\eta$.

Therefore, for $i \in \{0, \dots, n\}$, the spaces $\text{Aff}_h(f_n)_i$ and $\Lambda^{n-i} \mathbb{R}^n$ are isomorphic as vector spaces, and hence, so are $\text{Aff}_h(f_n)$ and $\Lambda^* \mathbb{R}^n$. In particular, $\text{Aff}_h(f_n)$ is a finite dimensional vector space with dimension $2^n$.

Let us briefly explain our strategy to prove Theorem 1.1. Let $v \in \Lambda^n \mathbb{R}^n \setminus \{0\}$ be fixed. It is rather easy to verify that if a function $f : f_n \to \mathbb{R}$ is such that $fv = \varphi_\eta$ for some $\eta \in \Lambda^{n-i} \mathbb{R}^n$ with $i \in \{0, \dots, n\}$ then $f \in \text{Aff}_h(f_n)_i$, see Lemma 3.1. The injectivity of the map $\eta \in \Lambda^{n-i} \mathbb{R}^n \mapsto \varphi_\eta$ is also not hard to verify and follows from general facts about exterior algebra, see Corollary 6.5. The main difficulties are thus to get the decomposition given in Theorem 1.1 (i), see Theorem 3.2 and Proposition 3.4 (i), as well as the fact that every function $f \in \text{Aff}_h(f_n)_i$ can be written as $fv = \varphi_v$ for some $v \in \Lambda^{n-i} \mathbb{R}^n$, see Proposition 3.5. This will occupy most of Sect. 3 to which we refer for more details. For the sake of completeness, let us mention the geometric interpretation behind the decomposition in Theorem 1.1 when passing from $f_n$ for $n \ge 3$ to any Lie subalgebra of $f_n$ that is isomorphic to $f_{n-1}$. It can be proved that the zero level set of non-zero $n$-homogeneous h-affine functions on $f_n$, namely, the set $\{(\theta, \omega) \in f_n : \omega^{n/2} = 0\}$ if $n$ is even, $\{(\theta, \omega) \in f_n : \theta \wedge \omega^{(n-1)/2} = 0\}$ if $n$ is odd, coincides with the union of all Lie subalgebras of $f_n$ that are isomorphic to $f_{n-1}$. Therefore, if $f = f_0 + \dots + f_n \in \text{Aff}_h(f_n)$ with $f_i \in \text{Aff}_h(f_n)_i$, one gets that its restriction to any Lie subalgebra isomorphic to $f_{n-1}$ coincides with the restriction to this subalgebra of the sum of the $i$-homogeneous terms $f_0 + \dots + f_{n-1}$ for $i \in \{0, \dots, n-1\}$ that show up in the decomposition of $f$.

Let us now turn to the general case of arbitrary step-2 Carnot algebras. Our starting point is the known fact that every step-2 Carnot algebra $g$ can be written as a quotient of free step-2 Carnot algebras. Namely, by the universal property of free step-2 Carnot algebras, for every $n \ge \text{rank } g$, there is a surjective Carnot morphism $\pi : f_n \to g$, see the discussion in Sect. 2. It turns out that there is a one-to-one correspondence between h-affine functions on $g$ and h-affine functions on $f_n$ that factor through $f_n/\text{Ker } \pi$, see Lemma 2.3 and Corollary 2.4. The description of h-affine functions on $g$ can therefore be deduced from the characterization of those functions $\varphi_\eta$ that factor through $f_n/\text{Ker } \pi$. Namely, we shall verify that for $\eta \in \Lambda^i \mathbb{R}^n$ the function $\varphi_\eta$ factors through $f_n/\text{Ker } \pi$ if and only if $\eta$ annihilates $\text{Ker } \pi$, which means that $\eta \in \text{Anh}^i \text{ Ker } \pi$ where

$$ \text{Anh}^i \text{ Ker } \pi := \{\eta \in \Lambda^i \mathbb{R}^n : \eta \wedge \zeta = 0 \text{ for all } \zeta \in \text{Ker } \pi\} $$

see Lemma 4.1. In the genuinely nonfree setting, such a characterization implies the following decomposition of $\text{Aff}_h(g)$.

**Theorem 1.2** Let $g$ be a step-2 rank-$r$ Carnot algebra. Assume that $g$ is not isomorphic to $f_r$. Then $\text{Aff}_h(g) = \bigoplus_{i=0}^{r-1} \text{Aff}_h(g)_i$.

Note that, in contrast with the free case, one has $\text{Aff}_h(g)_r = \{0\}$ when $g$ is a step-$r$ rank-$r$ Carnot algebra that is not isomorphic to $f_r$. This follows from the fact that
Ker $\pi \neq \{0\}$, and hence $\mathrm{Anh}^0 \ker \pi = \{0\}$, whenever $\pi : \mathfrak{f}_r \to \mathfrak{g}$ is a surjective Carnot morphism. A description of the summands $\mathrm{Aff}_h(\mathfrak{g})_i$ is provided by the following theorem that applies both in the free and in the nonfree cases (note that when $\mathfrak{g} = \mathfrak{f}_r$ and $n = r$, one recovers Theorem 1.1) and where the space of annihilators of $\ker \pi$ in $\Lambda^*\mathbb{R}^n$ is defined by

$$ \mathrm{Anh} \ker \pi := \{ \eta \in \Lambda^*\mathbb{R}^n : \eta \wedge \zeta = 0 \text{ for all } \zeta \in \ker \pi \}. $$

**Theorem 1.3** Let $\mathfrak{g}$ be a step-2 rank-$r$ Carnot algebra, $n \ge r$, and $\pi : \mathfrak{f}_n \to \mathfrak{g}$ be a surjective Carnot morphism. Then the following hold true. For $i \in \{0, \dots, n\}$, $v \in \Lambda^n \mathbb{R}^n \setminus \{0\}$,

(i) for every $\eta \in \mathrm{Anh}^{n-i} \ker \pi$, there is a unique $f \in \mathrm{Aff}_h(\mathfrak{g})_i$ such that $(f \circ \pi)v = \varphi_\eta$;

(ii) for every $f \in \mathrm{Aff}_h(\mathfrak{g})_i$, there is a unique $\eta \in \mathrm{Anh}^{n-i} \ker \pi$ such that $(f \circ \pi)v = \varphi_\eta$;

(iii) via this correspondence, $\mathrm{Aff}_h(\mathfrak{g})_i$ and $\mathrm{Anh}^{n-i} \ker \pi$ are isomorphic as vector spaces.

Consequently,

(iv) $\mathrm{Aff}_h(\mathfrak{g})$ and $\mathrm{Anh} \ker \pi$ are isomorphic as vector spaces.

In particular, $\mathrm{Aff}_h(\mathfrak{g})$ is a finite dimensional vector space.

As a consequence of Theorem 1.3, one gets that h-affine functions on step-2 Carnot algebras are polynomials and hence smooth. Let us stress here that there is no regularity assumption in our definition of h-affine functions. Such functions are indeed only assumed to be affine when restricted to horizontal lines and were not even assumed continuous, nor measurable, beforehand. As a further consequence of their smoothness (one actually only needs local integrability), one can characterize elements in $\mathrm{Aff}_h(\mathfrak{g})$ as those locally integrable functions that are harmonic in the distributional sense with respect to every subLaplacian on $\mathfrak{g}$, see Remark 2.8. Let us mention that horizontally affine distributions have been recently studied in [1] in wider settings where they can be proved to be polynomials. Note, however, that this later notion may be different from a pointwise generalization of our present notion of h-affine functions to more general settings, as explained at the end of Remark 2.8.

Several characterizations of step-2 Carnot algebras $\mathfrak{g}$ where $\mathrm{Aff}_h(\mathfrak{g}) = \mathrm{Aff}(\mathfrak{g})$ can easily be deduced from Theorem 1.3, see Theorem 1.4 below and Sect. 5. It turns out that one of these characterizations can be formulated using a class of Lie algebras known in literature as $\mathcal{I}$-null, see [11]. We recall that a step-2 Carnot algebra $\mathfrak{g} = \mathfrak{g}_1 \oplus \mathfrak{g}_2$ is $\mathcal{I}$-null if every bilinear form $b : \mathfrak{g}_1 \times \mathfrak{g}_2 \to \mathbb{R}$ satisfying $b(x, [x, y]) = 0$ for all $x, y \in \mathfrak{g}_1$ vanishes identically on $\mathfrak{g}_1 \times \mathfrak{g}_2$, see Definition 2.6 and Proposition 2.7.

**Theorem 1.4** Let $\mathfrak{g}$ be a step-2 Carnot algebra. Then the following are equivalent:

(i) $\mathrm{Aff}_h(\mathfrak{g}) = \mathrm{Aff}(\mathfrak{g})$

(ii) $\mathrm{Aff}_h(\mathfrak{g}) = \bigoplus_{i=0}^2 \mathrm{Aff}_h(\mathfrak{g})_i$

(iii) $\bigoplus_{i \ge 3} \mathrm{Aff}_h(\mathfrak{g})_i = \{0\}$, equivalently, $\mathrm{Aff}_h(\mathfrak{g})_3 = \{0\}$
(iv) $\mathfrak{g}$ is $\mathcal{I}$-null

(v) $\bigoplus_{i=3}^n \text{Anh}^{n-i} \text{Ker } \pi = \{0\}$, equivalently, $\text{Anh}^{n-3} \text{Ker } \pi = \{0\}$, for some, equivalently all, $n \ge \max\{3, \text{rank } \mathfrak{g}\}$, $\pi: \mathfrak{f}_n \to \mathfrak{g}$ surjective Carnot morphism.

Note incidentally that it follows from Theorem 1.1 that $\text{Aff}_h(\mathfrak{f}_n) = \text{Aff}(\mathfrak{f}_n)$ if and only if $n=2$. Therefore, the equivalent conditions given in Theorem 1.4 hold true on $\mathfrak{g} = \mathfrak{f}_n$ if and only if $n=2$. Theorem 1.4 can be efficiently applied in several concrete situations which will be discussed in Sect. 5.2 and to which we refer for more details.

Before closing this introduction, we briefly go back to the relationship between h-affine functions and precisely monotone sets, as defined in [5] in the Heisenberg setting. More generally, a subset of a Carnot algebra, identified with a Carnot group, is said to be precisely monotone if the restriction of its characteristic function to each integral curve of every left-invariant horizontal vector field is monotone when seen as a function from $\mathbb{R}$ to $\mathbb{R}$. Equivalently, a precisely monotone set is a h-convex set with h-convex complement, see for instance [15] for more details about h-convex sets. Precisely monotone sets have been classified in the first Heisenberg algebra $\mathfrak{f}_2$, in higher dimensional Heisenberg algebras, and in the direct product $\mathfrak{f}_2 \times \mathbb{R}$, see [5, 12, 14]. In the aforementioned step-2 settings, it turns out that the boundary of a nonempty precisely monotone strict subset is a hyperplane, while in step-3 Carnot algebras the same statement may be false, see [2, 3]. As a consequence of our results, we actually get plenty of examples of Carnot algebras already in the step-2 case where there are precisely monotone subsets whose boundary is not a hyperplane. Indeed, it can easily be seen that sublevel sets of h-affine functions are precisely monotone. Therefore if $\mathfrak{g}$ is a step-2 Carnot algebra that is not $\mathcal{I}$-null and if $f \in \text{Aff}_h(\mathfrak{g}) \setminus \text{Aff}(\mathfrak{g})$ then every sublevel set of $f$ is a precisely monotone set whose boundary is not a hyperplane. We refer to the recent paper [13] for a more detailed introduction to precisely monotone sets as well as for a classification of such sets in the step-2 rank-3 case in terms of sublevel sets of h-affine functions, and for further discussions about higher rank and higher step cases. To conclude these observations, let us mention that measurable precisely monotone sets, and therefore sublevel sets of h-affine functions on step-2 Carnot algebras, can be proved to be local minimizers for the intrinsic perimeter, see [18, Proposition 3.9] and [13, Proposition 2.9].

The rest of this paper is organized as follows. Section 2 contains our conventions and notations about step-2 Carnot algebras and h-affine functions. We also provide easy facts that will be useful for later arguments. In Sect. 3, we focus on the free case and prove Theorem 1.1. Theorems 1.2 and 1.3 are proved in Sect. 4. Section 5.1 is devoted to the proof of Theorem 1.4 and Sect. 5.2 to a discussion of several examples. In the final Sect. 6, we gather notations and facts in linear and exterior algebra.

## 2 Step-2 Carnot Algebras and Horizontally Affine Functions

We recall that a real<fnref n="2" /> and finite dimensional Lie algebra $\mathfrak{g}$ is said to be nilpotent of step 2 if the derived algebra $\mathfrak{g}_2 := [\mathfrak{g}, \mathfrak{g}]$ is nontrivial, i.e., $\mathfrak{g}_2 \ne \{0\}$, and central, i.e.,

<figure><img src="image_2.png" /></figure>

<footnote n="2">² As already mentioned in the introduction, our arguments and results can be verbatim extended to finite dimensional nilpotent Lie algebras of step 2 over an arbitrary field of characteristic zero.</footnote>
$[g, g_2] = \{0\}$. Here, given $U, V \subset g$, we denote by $[U, V]$ the linear subspace of $g$ generated by elements of the form $[u, v]$ with $u \in U, v \in V$. If $g_1$ is a linear subspace of $g$ that is in direct sum with $g_2$ then $[g_1, g_1] = g_2$ and the decomposition $g = g_1 \oplus g_2$ is therefore a stratification of $g$. As a matter of fact, every stratification of a nilpotent Lie algebra of step 2 is of this form.

A step-2 Carnot algebra $g$ is a Lie algebra nilpotent of step 2 equipped with a stratification $g = g_1 \oplus g_2$. The rank of $g$ is defined as $\mathrm{rank} \ g := \dim g_1$. Such a Lie algebra is naturally endowed with the group law<fnref n="3" /> given by

$$x \cdot y := x + y + [x, y]$$

for $x, y \in g$ that makes it a step-2 Carnot group. It is actually well known that any step-2 Carnot group can be realized in this way. We shall therefore view a step-2 Carnot algebra both as a Lie algebra and group.

Throughout this paper, we shall always denote by $g = g_1 \oplus g_2$ a step-2 Carnot algebra. Given $t \in \mathbb{R}, x \in g$, we set $x^t := tx$.

**Definition 2.1** Given $A \subset g$ we say that $f : g \to \mathbb{R}$ is A-affine if for every $x \in g$, $y \in A$, the function $t \in \mathbb{R} \mapsto f(x \cdot y^t)$ is affine.

When $A = g$, one recovers the notion of real-valued affine functions on $g$ seen as a vector space. Indeed, since $g$ is nilpotent of step 2, for $x, y \in g$, $t \in \mathbb{R}$, we have $x \cdot y^t = x + t(y + [x, y])$ and $x + ty = x \cdot (y - [x, y])^t$. Therefore $f : g \to \mathbb{R}$ is $g$-affine if and only if for every $x, y \in g$, $t \in \mathbb{R}$, the function $t \in \mathbb{R} \mapsto f(x + ty)$ is affine, i.e., $f$ is affine, see Proposition 6.1. In particular, real-valued affine functions are A-affine for every $A \subset g$.

In the present paper, we are interested in $g_1$-affine functions, which we shall call horizontally affine, h-affine in short, namely:

**Definition 2.2** (h-affine functions) We say that $f : g \to \mathbb{R}$ is horizontally affine, h-affine in short, if $f$ is $g_1$-affine. In other words, $f$ is h-affine if for every $x \in g$, $y \in g_1$, the function $t \in \mathbb{R} \mapsto f(x \cdot y^t)$ is affine. We denote by $\mathrm{Aff}_h(g)$ the real vector space of h-affine functions on $g$.

We say that $\ell \subset g$ is a horizontal line if there are $x \in g$, $y \in g_1 \setminus \{0\}$ such that $\ell = \{x \cdot y^t : t \in \mathbb{R}\}$. We already noticed that horizontal lines are 1-dimensional affine subspaces of $g$ and therefore h-affine functions can equivalently be defined as functions whose restriction to every horizontal line is affine.

We recall that a Carnot morphism $\pi : g \to g'$ between step-2 Carnot algebras $g = g_1 \oplus g_2$ and $g' = g'_1 \oplus g'_2$ is a homomorphism of graded Lie algebras, which means that $\pi$ is a linear map such that $\pi([x, y]) = [\pi(x), \pi(y)]$ for all $x, y \in g$ and $\pi(g_k) \subset g'_k$ for $k = 1, 2$. Note that a Carnot morphism is both a homomorphism of graded Lie algebras and a group homomorphism.

<footnote n="3">³ Our convention for the group law is nothing but a technical convenience. Any other choice where $[x, y]$ is replaced by $c[x, y]$ for some $c \in \mathbb{R} \setminus \{0\}$ independent of $x$ and $y$ leads to the same results.</footnote>
**Lemma 2.3** Let $\mathfrak{g}, \mathfrak{g}'$ be step-2 Carnot algebras and $\pi : \mathfrak{g} \to \mathfrak{g}'$ be a Carnot morphism. For $f \in \text{Aff}_h(\mathfrak{g}')$, we have $f \circ \pi \in \text{Aff}_h(\mathfrak{g})$. If $\pi$ is surjective then $f \in \text{Aff}_h(\mathfrak{g}')$ if and only if $f \circ \pi \in \text{Aff}_h(\mathfrak{g})$.

**Proof** Carnot morphisms map affinely horizontal lines to either horizontal lines or singletons therefore $f \circ \pi \in \text{Aff}_h(\mathfrak{g})$ when $f \in \text{Aff}_h(\mathfrak{g}')$. If the Carnot morphism $\pi : \mathfrak{g} \to \mathfrak{g}'$ is surjective then every horizontal line in $\mathfrak{g}'$ is the affine image through $\pi$ of a horizontal line in $\mathfrak{g}$ and therefore $f \in \text{Aff}_h(\mathfrak{g}')$ when $f \circ \pi \in \text{Aff}_h(\mathfrak{g})$. $\square$

For $t \in \mathbb{R}^* := \mathbb{R} \setminus \{0\}$, the Carnot dilation $\delta_t : \mathfrak{g} \to \mathfrak{g}$ is defined as the linear map such that $\delta_t(x) = t^k x$ for $x \in \mathfrak{g}_k, k = 1, 2$. The family $(\delta_t)_{t \in \mathbb{R}^*}$ is a one parameter group of Carnot automorphisms. Recall that, given a non-negative integer $i$, we denote by $\text{Aff}_h(\mathfrak{g})_i := \{f \in \text{Aff}_h(\mathfrak{g}) : f \circ \delta_t = t^i f \text{ for all } t \in \mathbb{R}^*\}$, the linear subspace of $\text{Aff}_h(\mathfrak{g})$ of $i$-homogeneous h-affine functions on $\mathfrak{g}$. Since dilations commute with Carnot morphisms, we get from Lemma 2.3 the following corollary.

**Corollary 2.4** Let $\mathfrak{g}, \mathfrak{g}'$ be step-2 Carnot algebras, $\pi : \mathfrak{g} \to \mathfrak{g}'$ be a Carnot morphism, and $i$ be a non-negative integer. For $f \in \text{Aff}_h(\mathfrak{g}')_i$, we have $f \circ \pi \in \text{Aff}_h(\mathfrak{g})_i$. If $\pi$ is surjective then $f \in \text{Aff}_h(\mathfrak{g}')_i$ if and only if $f \circ \pi \in \text{Aff}_h(\mathfrak{g})_i$.

We already noticed that the set $\text{Aff}(\mathfrak{g})$ of real-valued affine functions on $\mathfrak{g}$ is a linear subspace of $\text{Aff}_h(\mathfrak{g})$. More precisely, we have the following inclusion.

**Lemma 2.5** $\text{Aff}(\mathfrak{g})$ is a linear subspace of $\bigoplus_{i=0}^2 \text{Aff}_h(\mathfrak{g})_i$.

**Proof** Let $f \in \text{Aff}(\mathfrak{g})$. There are $f_0 \in \mathbb{R}$ and linear forms $f_k : \mathfrak{g}_k \to \mathbb{R}, k = 1, 2$, such that $f(x+z) = f_0 + f_1(x) + f_2(z)$ for all $x \in \mathfrak{g}_1, z \in \mathfrak{g}_2$. Clearly, constant functions belong to $\text{Aff}_h(\mathfrak{g})_0$ and the functions $x+z \in \mathfrak{g}_1 \oplus \mathfrak{g}_2 \mapsto f_1(x)$ and $x+z \in \mathfrak{g}_1 \oplus \mathfrak{g}_2 \mapsto f_2(z)$ belong to $\text{Aff}_h(\mathfrak{g})_1$ and $\text{Aff}_h(\mathfrak{g})_2$, respectively. $\square$

We say that step-2 Carnot algebras are *isomorphic* if there is a bijective Carnot morphism from one to the other. Note that being h-affine, respectively, affine, are intrinsic properties, in particular $\text{Aff}_h(\mathfrak{g}) = \text{Aff}(\mathfrak{g})$ if and only if $\text{Aff}_h(\mathfrak{g}') = \text{Aff}(\mathfrak{g}')$ for isomorphic step-2 Carnot algebras $\mathfrak{g}, \mathfrak{g}'$. This indeed more explicitly follows from Lemma 2.3 together with the fact that Carnot morphisms are linear maps.

Let us recall that by the universal property of free step-2 Carnot algebras, see Sect. 1 for our conventions about the free step-2 rank-$n$ Carnot algebra $f_n$, given a step-2 rank-$r$ Carnot algebra $\mathfrak{g}$ and given an integer $n \ge r$, there is a surjective Carnot morphism $\pi : f_n \to \mathfrak{g}$, see for instance [17, p.45]. We also recall that for such a Carnot morphism, $\text{Ker} \pi$ is a graded ideal in $f_n$, which means that $\text{Ker} \pi = i_1 \oplus i_2$ where $i_k$ are linear subspaces of $\Lambda^k \mathbb{R}^n, k = 1, 2$, such that $\theta \wedge \theta' \in i_2$ for all $\theta \in \Lambda^1 \mathbb{R}^n, \theta' \in i_1$.

We now recall the definition of $\mathcal{I}$-null Lie algebras that will be used in one of our characterizations of those step-2 Carnot algebras where h-affine functions are affine, see Theorem 1.4.

**Definition 2.6** [11] A Lie algebra $\mathfrak{m}$ is said to be $\mathcal{I}$-null if for every symmetric bilinear invariant form $B : \mathfrak{m} \times \mathfrak{m} \to \mathbb{R}$, we have $B(\mathfrak{m}, [\mathfrak{m}, \mathfrak{m}]) = 0$. Here $B$ is said to be invariant if $B(x, [y, z]) = B([x, y], z)$ for all $x, y, z \in \mathfrak{m}$, or equivalently, if the trilinear form $B(\cdot, [\cdot, \cdot])$ is alternating on $\mathfrak{m} \times \mathfrak{m} \times \mathfrak{m}$.
For step-2 Carnot algebras, the previous definition can be rephrased in the following way, of which we omit the elementary proof.

**Proposition 2.7** A step-2 Carnot algebra $\mathfrak{g} = \mathfrak{g}_1 \oplus \mathfrak{g}_2$ is $\mathcal{I}$-null if and only if every bilinear form $b : \mathfrak{g}_1 \times \mathfrak{g}_2 \to \mathbb{R}$ satisfying $b(x, [x, y]) = 0$ for all $x, y \in \mathfrak{g}_1$ vanishes identically on $\mathfrak{g}_1 \times \mathfrak{g}_2$.

**Remark 2.8** In the present article, we focus on step-2 Carnot algebras or, equivalently, step-2 Carnot groups. Let us mention that the notion of horizontally affine function makes sense in broader generality. One may for instance consider Carnot groups of arbitrary step (see [16], [10] for a primer on the subject) or, more generally, a connected nilpotent Lie group $G$ equipped with a vector subspace $\Delta$ of its Lie algebra $\mathfrak{g}$ that Lie generates $\mathfrak{g}$. Then we say that $f : G \to \mathbb{R}$ is $\Delta$-affine if for every $X \in \Delta$ the restriction of $f$ to each integral curve of $X$ is affine when seen as a function from $\mathbb{R}$ to $\mathbb{R}$. Here an element $X \in \Delta$ is seen as a left-invariant vector field on $G$. When $G$ is a step-2 Carnot group with stratified Lie algebra $\mathfrak{g} = \mathfrak{g}_1 \oplus \mathfrak{g}_2$ and $\Delta = \mathfrak{g}_1$ is the first, usually called horizontal, layer of the stratification of $\mathfrak{g}$, one recovers Definition 2.2, and this latter definition can hence be extended to Carnot groups of arbitrary step in the obvious way. Going back to the aforementioned more general setting and considering $G$ equipped with a Haar measure, let us mention that we have the following characterizations of locally integrable $\Delta$-affine functions. Namely, $f \in L_{\text{loc}}^1(G)$ has a representative that is $\Delta$-affine if and only if one of the following equivalent conditions holds true in the distributional sense:

$$ (A.1) \quad X^2 f = 0 \text{ for every } X \in \Delta $$

$$ (A.2) \quad XYf + YXf = 0 \text{ for every } X, Y \in \Delta $$

$$ (A.3) \quad X_1^2 f + \dots + X_m^2 f = 0 \text{ for every basis } (X_1, \dots, X_m) \text{ of } \Delta. $$

Indeed, if a representative of $f \in L_{\text{loc}}^1(G)$ is $\Delta$-affine then (A.1) holds true as a consequence of the very definitions. Conversely, if $f \in L_{\text{loc}}^1(G)$ satisfies (A.1) then $f$ has a representative that is smooth by Hörmander's hypoellipticity theorem and then it clearly follows from (A.1) that this representative is $\Delta$-affine. The fact that (A.1) is equivalent to (A.2) is a consequence of Hörmander's hypoellipticity theorem together with the identity $(X+Y)^2 f = X^2 f + XYf + YXf + Y^2 f$ for smooth functions $f$. Condition (A.1) obviously implies (A.3). Conversely, if $f \in L_{\text{loc}}^1(G)$ satisfies (A.3) and $X \in \Delta \setminus \{0\}$, one can complete $X$ into a basis $X, X_2, \dots, X_m$ of $\Delta$. Then for every $\varepsilon > 0$ one has $X^2 f + \varepsilon X_2^2 f + \dots + \varepsilon X_m^2 f = 0$ with the left-hand side converging to $X^2 f$ as $\varepsilon \to 0$ and therefore $X^2 f = 0$. See also [1] for other generalizations of condition (A.1) for locally integrable functions.

To conclude this remark, note that in the specific setting considered in this paper, i.e., step-2 Carnot algebras $\mathfrak{g} = \mathfrak{g}_1 \oplus \mathfrak{g}_2$, it follows from Theorem 1.3 that $\mathfrak{g}$-affine functions are smooth and hence locally integrable. Therefore each of the distributional sense conditions (A.1), (A.2), (A.3) with $\Delta = \mathfrak{g}_1$ makes sense for all $\mathfrak{g}$-affine functions and hence characterizes such a class of functions. In the more general setting considered in the present remark, it is, however, not clear to us whether $\Delta$-affinity implies local integrability, and the class of locally integrable $\Delta$-affine functions that can be characterized through each of the equivalent conditions (A.1), (A.2), and (A.3) could therefore be a strict subset of the class of $\Delta$-affine functions.
## 3 Horizontally Affine Functions on Free Step-2 Carnot Algebras

This section is devoted to the proof of Theorem 1.1. The proof will proceed into 4 steps. We first verify in Lemma 3.1 that for $\eta \in \Lambda^{n-i}\mathbb{R}^n$, we have $\varphi_\eta \in \text{Aff}_h(f_n, \Lambda^n\mathbb{R}^n)_i$ where $\varphi_\eta$ is given by (1.1), together with the injectivity of the linear map $\eta \in \Lambda^{n-i}\mathbb{R}^n \mapsto \varphi_\eta \in \text{Aff}_h(f_n, \Lambda^n\mathbb{R}^n)_i$. We shall next prove Theorem 1.1 for $n = 2$, see Theorem 3.2, and deduce properties of h-affine functions on $f_n$ for $n \ge 3$ to be used in the next step, see Proposition 3.3. When $n \ge 3$, we first prove that $\text{Aff}_h(f_n) = \bigoplus_{i=0}^n \text{Aff}_h(f_n)_i$ together with preliminary information about elements in $\text{Aff}_h(f_n)_i$, see Proposition 3.4. We then upgrade these information in Proposition 3.5 to get the description stated in Theorem 1.1.

For notational convenience, we identify in this section $f_n$ with $\Lambda^1\mathbb{R}^n \times \Lambda^2\mathbb{R}^n$ and write elements in $f_n$ as $x = (\theta, \omega)$ with $\theta \in \Lambda^1\mathbb{R}^n$, $\omega \in \Lambda^2\mathbb{R}^n$. In the next lemma, we denote by $\text{Aff}_h(f_n, \Lambda^n\mathbb{R}^n)_i$ the analogue of $\text{Aff}_h(f_n)_i$ for $\Lambda^n\mathbb{R}^n$-valued functions. More explicitly, $f: f_n \to \Lambda^n\mathbb{R}^n$ belongs to $\text{Aff}_h(f_n, \Lambda^n\mathbb{R}^n)_i$ if and only if for every $(\theta, \omega) \in f_n$, $\theta' \in \Lambda^1\mathbb{R}^n$, the function $t \in \mathbb{R} \mapsto f((\theta, \omega) \cdot (t\theta', 0)) \in \Lambda^n\mathbb{R}^n$ is affine, and $f \circ \delta_t = t^i f$ for all $t \in \mathbb{R}^*$.

**Lemma 3.1** For $n \ge 2$, $i \in \{0, \dots, n\}$, and $\eta \in \Lambda^{n-i}\mathbb{R}^n$, we have $\varphi_\eta \in \text{Aff}_h(f_n, \Lambda^n\mathbb{R}^n)_i$ where $\varphi_\eta$ is given by (1.1). Furthermore, the linear map $\eta \in \Lambda^{n-i}\mathbb{R}^n \mapsto \varphi_\eta \in \text{Aff}_h(f_n, \Lambda^n\mathbb{R}^n)_i$ is injective.

**Proof** Let $\eta \in \Lambda^{n-i}\mathbb{R}^n$. Clearly $\varphi_\eta \circ \delta_t = t^i \varphi_\eta$ for all $t \in \mathbb{R}^*$. If $i = 2k$ is even, we have

$$ \varphi_\eta((\theta, \omega) \cdot (t\theta', 0)) = (\omega + t\theta \wedge \theta')^k \wedge \eta = \omega^k \wedge \eta + tk\omega^{k-1} \wedge \theta \wedge \theta' \wedge \eta, $$

if $i = 2k + 1$ is odd,

$$ \varphi_\eta((\theta, \omega) \cdot (t\theta', 0)) = (\theta + t\theta') \wedge (\omega + t\theta \wedge \theta')^k \wedge \eta = \theta \wedge \omega^k \wedge \eta + t\theta' \wedge \omega^k \wedge \eta, $$

for all $(\theta, \omega) \in f_n$, $\theta' \in \Lambda^1\mathbb{R}^n$. Therefore $\varphi_\eta \in \text{Aff}_h(f_n, \Lambda^n\mathbb{R}^n)_i$. For the injectivity of the linear map $\eta \in \Lambda^{n-i}\mathbb{R}^n \mapsto \varphi_\eta \in \text{Aff}_h(f_n, \Lambda^n\mathbb{R}^n)_i$, see Corollary 6.5. $\square$

**Theorem 3.2** We have $\text{Aff}_h(f_2) = \text{Aff}(f_2)$.

**Proof** We recall that a set $\ell \subset f_2$ is said to be a horizontal line if $\ell = \{(\theta, \omega) \cdot (t\theta', 0) : t \in \mathbb{R}\}$ for some $(\theta, \omega) \in f_2$, $\theta' \in \Lambda^1\mathbb{R}^2 \setminus \{0\}$. Define the h-affine hull of a set $A \subset f_2$ as the smallest set $C$ containing $A$ with the property that if a horizontal line $\ell$ meets $C$ in more than one point then $\ell \subset C$. It follows from [5, Lemma 4.10] that there are 4 points in $f_2$ whose h-affine hull is $f_2$. Indeed, given linearly independent $\theta, \theta' \in \Lambda^1\mathbb{R}^2$, the h-affine hull $C$ of $\{(0, 0), (\theta, 0), (\theta', 0), (\theta + \theta', \theta \wedge \theta')\}$ contains a pair of parallel lines with distinct projection in the sense of [5], namely, the horizontal line through $(0, 0)$ and $(\theta', 0)$ and the horizontal line through $(\theta, 0)$ and $(\theta + \theta', \theta \wedge \theta')$, therefore $C = f_2$ by [5, Lemma 4.10]. This implies that $\text{Aff}_h(f_2)$ is a vector space with dimension $\le 4$. Since $\text{Aff}(f_2)$ is a 4-dimensional linear subspace of $\text{Aff}_h(f_2)$, we get that $\text{Aff}_h(f_2) = \text{Aff}(f_2)$, as claimed. $\square$
Note that Theorem 1.1 for $n = 2$ follows from Lemma 2.5, Lemma 3.1 and Theorem 3.2. For $n \ge 3$, we set $\Sigma_n := \bigcup_{\theta, \theta' \in \Lambda^1 \mathbb{R}^n} \text{Lie}(\theta, \theta')$ where $\text{Lie}(\theta, \theta') := \text{span}\{\theta, \theta'\} \times \text{span}\{\theta \wedge \theta'\}$ denotes the Lie subalgebra of $f_n$ generated by $\theta, \theta' \in \Lambda^1 \mathbb{R}^n$. We refer to Definition 2.1 for the definition of $\Sigma_n$-affine functions.

**Proposition 3.3** For $n \ge 3$, $f \in \text{Aff}_h(f_n)$, the following hold true:

$$f \text{ is } \Sigma_n\text{-affine,} \qquad (3.1)$$

$$f_{\omega} \in \text{Aff}(\Lambda^1 \mathbb{R}^n) \text{ for all } \omega \in \Lambda^2 \mathbb{R}^n, \qquad (3.2)$$

where $f_{\omega} : \Lambda^1 \mathbb{R}^n \to \mathbb{R}$ is given by $f_{\omega}(\theta) := f(\theta, \omega)$ and $\text{Aff}(\Lambda^1 \mathbb{R}^n)$ denotes the space of real-valued affine functions on $\Lambda^1 \mathbb{R}^n$.

**Proof** Clearly, composing h-affine functions with left-translations yields h-affine functions. Therefore, to prove that every $f \in \text{Aff}_h(f_n)$ is $\Sigma_n$-affine, we only need to verify that for every $f \in \text{Aff}_h(f_n)$, $\theta_1, \theta_2 \in \Lambda^1 \mathbb{R}^n$, $\theta_1 \wedge \theta_2 \ne 0$, $(\theta, \omega) \in \text{Lie}(\theta_1, \theta_2)$, the function $t \in \mathbb{R} \mapsto f(t\theta, t\omega)$ is affine. Set $\mathfrak{h} := \text{Lie}(\theta_1, \theta_2)$ and denote by $f_{\mathfrak{h}}$ the restriction of $f$ to $\mathfrak{h}$. On the one hand, the structure of step-2 Carnot algebra of $f_n$ induces on $\mathfrak{h}$ a structure of step-2 Carnot algebra that makes it isomorphic to $f_2$. Therefore $\text{Aff}_h(\mathfrak{h}) = \text{Aff}(\mathfrak{h})$ by Theorem 3.2. On the other hand, $f_{\mathfrak{h}} \in \text{Aff}_h(\mathfrak{h})$. Thus $f_{\mathfrak{h}} \in \text{Aff}(\mathfrak{h})$, which implies that for all $(\theta, \omega) \in \mathfrak{h}$, the function $t \in \mathbb{R} \mapsto f(t\theta, t\omega)$ is affine and concludes the proof of (3.1). To prove (3.2), note that for $\omega \in \Lambda^2 \mathbb{R}^n$, $\theta, \theta' \in \Lambda^1 \mathbb{R}^n$, $t \in \mathbb{R}$, we have $(\theta + t\theta', \omega) = (\theta, \omega) \cdot (t\theta', t\theta' \wedge \theta)$. Since $(\theta', \theta' \wedge \theta) \in \Sigma_n$, it follows from Proposition 6.1 that $f_{\omega} \in \text{Aff}(\Lambda^1 \mathbb{R}^n)$ for every $\Sigma_n$-affine function $f$, and hence, in particular for $f \in \text{Aff}_h(f_n)$ by (3.1). $\square$

In addition to the notations given in the appendix, see Sect. 6, we shall use the following ones in the rest of this section. Recall that $(e^1, \dots, e^n)$ denotes a basis of $\Lambda^1 \mathbb{R}^n$. For $\theta = \sum_{j=1}^n \theta_j e^j \in \Lambda^1 \mathbb{R}^n$, we set $\theta_J := \theta_{j_1} \cdots \theta_{j_k}$ for $J = (j_1, \dots, j_k) \in \mathcal{J}_k^n$, see (6.4) for the definition of $\mathcal{J}_k^n$, with the convention $\theta_0 := 1$.

In the following, for $\alpha, \beta \in \mathbb{N}$, we write $\alpha\beta$ to denote the multi-index with 2 indices. We set

$$\mathcal{I} := \{\alpha\beta : \alpha, \beta \in \mathbb{N} \setminus \{0\}, \alpha < \beta\},$$

and we equip $\mathcal{I}$ with the lexicographic order, i.e., we write $\alpha\beta < \alpha'\beta'$ to mean either that $\alpha = \alpha'$ and $\beta < \beta'$ or that $\alpha < \alpha'$. We set $\bar{\mathcal{I}}_0^n := \{\emptyset\}$,

$$\bar{\mathcal{I}}_k^n := \{ (\alpha_1 \beta_1, \dots, \alpha_k \beta_k) \in \mathcal{I}^k : 12 \le \alpha_1 \beta_1 < \dots < \alpha_k \beta_k \le (n-1)n \}$$

for $k \in \{1, \dots, n(n-1)/2\}$, and $\bar{\mathcal{I}}^n := \bigcup_{0 \le k \le n(n-1)/2} \bar{\mathcal{I}}_k^n$. We write $\text{im } \emptyset := \emptyset$ and $\text{im } I := \{\alpha_1 \beta_1, \dots, \alpha_k \beta_k\} \subset \mathcal{I}$ for $I = (\alpha_1 \beta_1, \dots, \alpha_k \beta_k) \in \bar{\mathcal{I}}_k^n$. Given $I, I' \in \bar{\mathcal{I}}^n$, we denote by $I \setminus I' \in \bar{\mathcal{I}}^n$ the unique element in $\bar{\mathcal{I}}^n$ such that $\text{im}(I \setminus I') = \text{im } I \setminus \text{im } I'$ and we write $I' \subset I$ to mean that $\text{im } I' \subset \text{im } I$.
We recall from Sect. 6 that $e^J := e^{j_1} \wedge \cdots \wedge e^{j_k}$ for a multi-index $J = (j_1, \dots, j_k) \in \mathcal{J}_k^n$. For $\omega = \sum_{\alpha\beta \in \bar{\mathcal{I}}_1^n} \omega_{\alpha\beta} e^{\alpha\beta} \in \Lambda^2\mathbb{R}^n$, we set $\omega_\emptyset := 1$ and $\omega_I := \omega_{\alpha_1\beta_1} \cdots \omega_{\alpha_k\beta_k}$ for $I = (\alpha_1\beta_1, \dots, \alpha_k\beta_k) \in \bar{\mathcal{I}}_k^n$.

We write $N(\emptyset) := \emptyset$ and $N(I) := \{\alpha_1, \beta_1, \dots, \alpha_k, \beta_k\} \subset \mathbb{N}$ for $I = (\alpha_1\beta_1, \dots, \alpha_k\beta_k) \in \bar{\mathcal{I}}_k^n$. We set $\mathcal{I}_0^n := \{\emptyset\}$ and

$$ \mathcal{I}_k^n := \{ (\alpha_1\beta_1, \dots, \alpha_k\beta_k) \in \bar{\mathcal{I}}_k^n : \mathrm{N}(\alpha_i\beta_i) \cap \mathrm{N}(\alpha_j\beta_j) = \emptyset \text{ for all } i \neq j \}. $$

for $k \in \{1, \dots, n(n-1)/2\}$. Note that $\bar{\mathcal{I}}_0^n = \mathcal{I}_0^n, \bar{\mathcal{I}}_1^n = \mathcal{I}_1^n$. When $n \ge 3$, we have $\mathcal{I}_k^n \subsetneq \bar{\mathcal{I}}_k^n$ for $2 \le k \le n(n-1)/2$, and $\mathcal{I}_k^n = \emptyset$ for $k > \lfloor n/2 \rfloor$.

**Proposition 3.4** For $n \ge 3$, the following holds true:

(i) $\mathrm{Aff}_h(\{f_n\}) = \bigoplus_{i=0}^n \mathrm{Aff}_h(\{f_n\})_i,$

(ii) for $k \in \{0, \dots, \lfloor n/2 \rfloor\}$, every $f \in \mathrm{Aff}_h(\{f_n\})_{2k}$ can be written as

$$ (\theta, \omega) \mapsto \sum_{I \in \mathcal{I}_k^n} a_I \omega_I $$

for constants $a_I \in \mathbb{R}$,

(iii) for $k \in \{0, \dots, \lfloor(n-1)/2\rfloor\}$, every $f \in \mathrm{Aff}_h(\{f_n\})_{2k+1}$ can be written as

$$ (\theta, \omega) \mapsto \sum_{I \in \mathcal{I}_k^n} b_I(\theta) \omega_I $$

for linear forms $b_I : \Lambda^1\mathbb{R}^n \to \mathbb{R}$.

**Proof** For $i \in \{1, \dots, n\}$, the $\mathrm{Aff}_h(\{f_n\})_i$ are linear subspaces of $\mathrm{Aff}_h(\{f_n\})$ that are in direct sum. Therefore $\bigoplus_{i=0}^n \mathrm{Aff}_h(\{f_n\})_i \subset \mathrm{Aff}_h(\{f_n\})$. Conversely, let $f \in \mathrm{Aff}_h(\{f_n\})$ be given.

We first prove that there are functions $c_I : \Lambda^1\mathbb{R}^n \to \mathbb{R}$, $I \in \bar{\mathcal{I}}^n$, such that

$$ f(\theta, \omega) = \sum_{I \in \bar{\mathcal{I}}^n} c_I(\theta) \omega_I. \qquad (3.3) $$

Let $\theta \in \Lambda^1\mathbb{R}^n$ be given. We know from (3.1) that, for every $\omega \in \Lambda^2\mathbb{R}^n$, $1 \le \alpha < \beta \le n$, the function $t \in \mathbb{R} \mapsto f((\theta, \omega) \cdot (0, te^{\alpha\beta}))$ is affine. Since $f((\theta, \omega) \cdot (0, te^{\alpha\beta})) = f(\theta, \omega + te^{\alpha\beta})$, it follows from elementary properties of multiaffine maps, see Proposition 6.2 applied to $\omega \in \Lambda^2\mathbb{R}^n \mapsto f(\theta, \omega)$, that there are $c_I(\theta) \in \mathbb{R}$, $I \in \bar{\mathcal{I}}^n$, such that (3.3) holds true.

Next, we prove that

$$ c_I \in \mathrm{Aff}(\Lambda^1\mathbb{R}^n) \quad \text{for all } I \in \bar{\mathcal{I}}^n. \qquad (3.4) $$
We have $\overline{\mathcal{I}}^n = \cup_{0 \le k \le n(n-1)/2} \overline{\mathcal{I}}_k^n$ and we prove by induction on $k$ that $c_I \in \mathrm{Aff}(\Lambda^1 \mathbb{R}^n)$ for all $I \in \overline{\mathcal{I}}_k^n$. For $k=0$, we have $\overline{\mathcal{I}}_0^n = \{\emptyset\}$ with $c_\emptyset(\theta) = f(\theta, 0)$ and we apply (3.2) with $\omega = 0$ to get that $c_\emptyset \in \mathrm{Aff}(\Lambda^1 \mathbb{R}^n)$. Given $k \in \{1, \dots, n(n-1)/2\}$, assume that $c_{I'} \in \mathrm{Aff}(\Lambda^1 \mathbb{R}^n)$ for all $I' \in \cup_{0 \le i \le k-1} \overline{\mathcal{I}}_i^n$. For $I = (\alpha_1\beta_1, \dots, \alpha_k\beta_k) \in \overline{\mathcal{I}}_k^n$, we apply (3.2) with $\omega = \sum_{j=1}^k e^{\alpha_j\beta_j}$ to get that

$$c_I + \sum_{\substack{I' \in \cup_{0 \le i \le k-1} \overline{\mathcal{I}}_i^n \\ I' \subset I}} c_{I'} \in \mathrm{Aff}(\Lambda^1 \mathbb{R}^n).$$

By induction hypothesis, we get that $c_I \in \mathrm{Aff}(\Lambda^1 \mathbb{R}^n)$, which concludes the proof of (3.4).

It follows from (3.4) that there are constants $a_I \in \mathbb{R}$ and linear forms $b_I : \Lambda^1 \mathbb{R}^n \to \mathbb{R}$, $I \in \overline{\mathcal{I}}^n$, such that $c_I(\theta) = a_I + b_I(\theta)$ for every $\theta \in \Lambda^1 \mathbb{R}^n$. For $k \in \{0, \dots, n(n-1)/2\}$, we set

$$f_{2k}(\theta, \omega) := \sum_{I \in \overline{\mathcal{I}}_k^n} a_I \omega_I \quad \text{and} \quad f_{2k+1}(\theta, \omega) := \sum_{I \in \overline{\mathcal{I}}_k^n} b_I(\theta) \omega_I,$$

so that $f = \sum_{i=0}^{n(n-1)+1} f_i$. We claim that $f_i \in \mathrm{Aff}_h(f_n)_i$ for all $i \in \{0, \dots, n(n-1)+1\}$. Indeed, let $(\theta, \omega) \in f_n$, $\theta' \in \Lambda^1 \mathbb{R}^n$, $s \in \mathbb{R}$ be given. Since the dilations are Carnot automorphisms, we know from Lemma 2.3 that $f \circ \delta_t \in \mathrm{Aff}_h(f_n)$ for all $t \in \mathbb{R}^*$. Therefore

$$\begin{align*}
\sum_{i=0}^{n(n-1)+1} t^i f_i((\theta, \omega) \cdot (s\theta', 0)) &= (f \circ \delta_t)((\theta, \omega) \cdot (s\theta', 0)) \\
&= (f \circ \delta_t)(\theta, \omega) + s((f \circ \delta_t)((\theta, \omega) \cdot (\theta', 0)) \\
&\quad - (f \circ \delta_t)(\theta, \omega)) \\
&= \sum_{i=0}^{n(n-1)+1} t^i (f_i(\theta, \omega) + s(f_i((\theta, \omega) \cdot (\theta', 0)) \\
&\quad - f_i(\theta, \omega)))
\end{align*}$$

for all $t \in \mathbb{R}^*$, which implies that $f_i((\theta, \omega) \cdot (s\theta', 0)) = f_i(\theta, \omega) + s(f_i((\theta, \omega) \cdot (\theta', 0)) - f_i(\theta, \omega))$ for all $i \in \{0, \dots, n(n-1)+1\}$. Since this holds true for all $(\theta, \omega) \in f_n$, $\theta' \in \Lambda^1 \mathbb{R}^n$, $s \in \mathbb{R}$, we get that $f_i \in \mathrm{Aff}_h(f_n)$. Clearly, we also have $f_i \circ \delta_t = t^i f_i$ for all $t \in \mathbb{R}^*$. Therefore $f_i \in \mathrm{Aff}_h(f_n)_i$ for all $i \in \{0, \dots, n(n-1)+1\}$, as claimed.

For $k \in \{0, \dots, n(n-1)/2\}$, we now claim that

$$a_I = 0 \quad \text{for all } I \in \overline{\mathcal{I}}_k^n \setminus \mathcal{I}_k^n. \qquad (3.5)$$
For $k \in \{0, 1\}$, we have $\overline{\mathcal{I}}_k^n = \mathcal{I}_k^n$ and there is nothing to prove. Let $k \in \{2, \dots, n(n-1)/2\}$ be given. First, note that $I \in \overline{\mathcal{I}}_k^n \setminus \mathcal{I}_k^n$ if and only if there are integers $1 \le \alpha < \beta < \gamma \le n$ such that either $(\alpha\beta, \alpha\gamma) \subset I$, or $(\alpha\gamma, \beta\gamma) \subset I$, or $(\alpha\beta, \beta\gamma) \subset I$. Now, let $1 \le \alpha < \beta < \gamma \le n$ be given. On the one hand, since $f_{2k} \in \text{Aff}_h(f_n)$, we know that, for every $\omega \in \Lambda^2\mathbb{R}^n$, the function $t \in \mathbb{R} \mapsto f_{2k}((e^\alpha, \omega) \cdot (t(e^\beta + e^\gamma), 0)) = f_{2k}(0, \omega + t(e^{\alpha\beta} + e^{\alpha\gamma}))$ is affine. On the other hand, this function is a polynomial for which the coefficient of $t^2$, namely,

$$ \sum_{\substack{I \in \overline{\mathcal{I}}_k^n \\ (\alpha\beta, \alpha\gamma) \subset I}} a_I \omega_{I \setminus (\alpha\beta, \alpha\gamma)} $$

must therefore vanish. Since this holds true for every $\omega \in \Lambda^2\mathbb{R}^n$, it follows that $a_I = 0$ for every $I \in \overline{\mathcal{I}}_k^n$ such that $(\alpha\beta, \alpha\gamma) \subset I$. Considering the function $t \in \mathbb{R} \mapsto f_{2k}(0, \omega + t(e^{\alpha\gamma} + e^{\beta\gamma}))$, respectively, $t \in \mathbb{R} \mapsto f_{2k}(0, \omega + t(e^{\alpha\beta} + e^{\beta\gamma}))$, and arguing in a similar way, we get that $a_I = 0$ for every $I \in \overline{\mathcal{I}}_k^n$ such that $(\alpha\gamma, \beta\gamma) \subset I$, respectively, such that $(\alpha\beta, \beta\gamma) \subset I$, which concludes the proof of (3.5).

For $k \in \{0, \dots, n(n-1)/2\}$, we claim that

$$ b_I(\theta) = 0 \quad \text{for all } \theta \in \Lambda^1\mathbb{R}^n, \ I \in \overline{\mathcal{I}}_k^n \setminus \mathcal{I}_k^n. \qquad (3.6) $$

Indeed, let $k \in \{0, \dots, n(n-1)/2\}$, $\theta \in \Lambda^1\mathbb{R}^n$ be given. Consider the function $g: f_n \to \mathbb{R}$ given by $g(\tau, \omega) := f_{2k+1}(\theta, \omega)$ for $(\tau, \omega) \in f_n$. We have $g((\tau, \omega) \cdot (t\tau', 0)) = f_{2k+1}((\theta, \omega) \cdot (0, t\tau \wedge \tau'))$ for all $(\tau, \omega) \in f_n$, $\tau' \in \Lambda^1\mathbb{R}^n$. Since $f_{2k+1} \in \text{Aff}_h(f_n)$, it follows from (3.1) that $g \in \text{Aff}_h(f_n)$. We then argue as for the proof of (3.5) to get that $b_I(\theta) = 0$ for every $I \in \overline{\mathcal{I}}_k^n \setminus \mathcal{I}_k^n$, which concludes the proof of (3.6).

For $k \in \{\lfloor n/2 \rfloor + 1, \dots, n(n-1)/2\}$, we have $\mathcal{I}_k^n = \emptyset$ and it follows from (3.5) and (3.6) that $f_{2k} = f_{2k+1} = 0$.

We now prove that $f_{n+1} = 0$ whenever $n$ is even. Assume that $n = 2p$ with $p \ge 2$. Let $I = (\alpha_1\beta_1, \dots, \alpha_p\beta_p) \in \mathcal{I}_p^{2p}$ be given. Note that $\text{N}(I) = \{1, \dots, 2p\}$. Therefore, to show that $b_I = 0$, we need to verify that $b_I(e^{\alpha_j}) = b_I(e^{\beta_j}) = 0$ for every $j \in \{1, \dots, p\}$. Let $j \in \{1, \dots, p\}$ be given. Set $\omega_j := \sum_{1 \le i \le p, i \ne j} e^{\alpha_i\beta_i}$. On the one hand, since $f_{n+1} \in \text{Aff}_h(f_n)$, the function $t \in \mathbb{R} \mapsto f_{n+1}((e^{\alpha_j}, \omega_j) \cdot (te^{\beta_j}, 0))$ is affine. On the other hand,

$$ \begin{aligned} f_{n+1}((e^{\alpha_j}, \omega_j) \cdot (te^{\beta_j}, 0)) &= f_{n+1}(e^{\alpha_j} + te^{\beta_j}, te^{\alpha_j\beta_j} + \omega_j) \\ &= tb_I(e^{\alpha_j} + te^{\beta_j}) = tb_I(e^{\alpha_j}) + t^2 b_I(e^{\beta_j}). \end{aligned} $$

Therefore the coefficient of $t^2$ vanishes, i.e., $b_I(e^{\beta_j}) = 0$. To prove that $b_I(e^{\alpha_j}) = 0$, we argue in a similar way considering the function $t \in \mathbb{R} \mapsto f_{n+1}((-e^{\beta_j}, \omega_j) \cdot (te^{\alpha_j}, 0))$.

All together, we have shown that $f = \sum_{i=0}^n f_i$ with $f_i \in \text{Aff}_h(f_n)_i$ that can be written as in (ii) when $i = 2k$ is even, respectively, as in (iii) when $i = 2k+1$ is odd, which concludes the proof of the proposition. $\square$
**Proposition 3.5** For $n \ge 3$, $i \in \{0, \dots, n\}$, $\nu \in \Lambda^n \mathbb{R}^n \setminus \{0\}$, every $f \in \text{Aff}_h(f_n)_i$ can be written as $f\nu = \varphi_\eta$ for some $\eta \in \Lambda^{n-i} \mathbb{R}^n$.

*Proof* Assume with no loss of generality that $\nu = e^1 \wedge \dots \wedge e^n$. We first prove the proposition when $i = 2k$ is even. Let $f \in \text{Aff}_h(f_n)_{2k}$ and let $a_I \in \mathbb{R}$, $I \in \mathcal{I}_k^n$, be given by Proposition 3.4 (ii) so that

$$f(\theta, \omega) = \sum_{I \in \mathcal{I}_k^n} a_I \omega_I.$$

For $k = 0$ we get that $f$ is constant and the required conclusion clearly holds true. Next, let us consider the case $n = 2p$ with $p \ge 2$ and $k = p$. For $\omega \in \Lambda^2 \mathbb{R}^{2p}$, we have

$$\omega^p = p! \sum_{I \in \mathcal{I}_p^{2p}} \sigma(I) \omega_I \nu$$

where, given $I = (\alpha_1 \beta_1, \dots, \alpha_p \beta_p) \in \mathcal{I}_p^{2p}$, $\sigma(I)$ denotes the signature of the permutation of $\{1, \dots, 2p\}$ given by $(1, 2, \dots, 2p) \mapsto (\alpha_1, \beta_1, \dots, \alpha_p, \beta_p)$. Therefore it suffices to prove that

$$\sigma(I)a_I = \sigma(I')a_{I'} \quad \text{for all } I, I' \in \mathcal{I}_p^{2p}. \qquad (3.7)$$

On the one hand, since $f \in \text{Aff}_h(f_{2p})$, we know that for all $(\theta, \omega) \in f_{2p}$, $\theta' \in \Lambda^1 \mathbb{R}^{2p}$, the function

$$t \in \mathbb{R} \mapsto f((\theta, \omega) \cdot (t\theta', 0)) = \sum_{I \in \mathcal{I}_p^{2p}} a_I (\omega + t\theta \wedge \theta')_I$$

is affine. On the other hand, this function is a polynomial for which the coefficient of $t^2$ is given by

$$\sum_{I \in \mathcal{I}_p^{2p}} a_I \sum_{\substack{H, K \in \mathcal{I}_p^{2p} \\ H, K \subset I, H \neq K}} \omega_{I \setminus (H \cup K)} (\theta \wedge \theta')_H (\theta \wedge \theta')_K = \sum_{L \in \mathcal{I}_{p-2}^{2p}} \omega_L \sum_{\substack{I \in \mathcal{I}_p^{2p} \\ I \supset L}} a_I (\theta \wedge \theta')_{I \setminus L}$$

and must therefore vanish. Since this holds true for all $\omega \in \Lambda^2 \mathbb{R}^{2p}$, it follows that for all $L \in \mathcal{I}_{p-2}^{2p}$, $\theta, \theta' \in \Lambda^1 \mathbb{R}^{2p}$,

$$\sum_{\substack{I \in \mathcal{I}_p^{2p} \\ I \supset L}} a_I (\theta \wedge \theta')_{I \setminus L} = 0.$$
Now let $L \in \mathcal{I}_{p-2}^{2p}$ be given and let $1 \le \alpha < \beta < \delta < \gamma \le 2p$ be such that $\{1, \dots, 2p\} \setminus \text{N}(L) = \{\alpha, \beta, \delta, \gamma\}$. Then the previous equality reads as

$$a_{L \cup (\alpha\beta, \delta\gamma)}(\theta \wedge \theta')_{\alpha\beta}(\theta \wedge \theta')_{\delta\gamma} + a_{L \cup (\alpha\delta, \beta\gamma)}(\theta \wedge \theta')_{\alpha\delta}(\theta \wedge \theta')_{\beta\gamma} + a_{L \cup (\alpha\gamma, \beta\delta)}(\theta \wedge \theta')_{\alpha\gamma}(\theta \wedge \theta')_{\beta\delta} = 0$$

for all $\theta, \theta' \in \Lambda^1\mathbb{R}^{2p}$. Looking at the coefficient of $\theta_\alpha\theta'_\beta\theta_\delta\theta'_\gamma$ we get that $a_{L \cup (\alpha\beta, \delta\gamma)} = a_{L \cup (\alpha\gamma, \beta\delta)}$. Looking at the coefficient of $\theta_\alpha\theta'_\delta\theta_\beta\theta'_\gamma$ we get that $a_{L \cup (\alpha\delta, \beta\gamma)} = -a_{L \cup (\alpha\gamma, \beta\delta)}$. Therefore, we have proved that $\sigma(I)a_I = \sigma(I')a_{I'}$ for all $I, I' \in \mathcal{I}_p^{2p}$ such that $I, I' \supset L$ for some $L \in \mathcal{I}_{p-2}^{2p}$. Since one can pass from any $I \in \mathcal{I}_p^{2p}$ to any $I' \in \mathcal{I}_p^{2p}$ by a finite number of such steps, (3.7) follows.

Let us now consider the case $n \ge 3$ and $i = 2k$ is even with $2 \le i \le n - 1$. For $J \in \mathcal{J}_{2k}^n$ set $\mathcal{I}_k^J := \{I \in \mathcal{I}_k^n : \text{N}(I) = \text{im } J\}$ and define $f_J : \mathfrak{f}_n \to \mathbb{R}$ by $f_J(\theta, \omega) := \sum_{I \in \mathcal{I}_k^J} a_I \omega_I$ so that

$$f = \sum_{J \in \mathcal{J}_{2k}^n} f_J.$$

Set $\Lambda^1 J := \text{span}\{e^j : j \in \text{im } J\}$ and $\Lambda^2 J := \text{span}\{e^{jj'} : j, j' \in \text{im } J\}$. We have $f_J((\theta, \omega) \cdot (t\theta', 0)) = f((\theta, \omega) \cdot (t\theta', 0))$ for all $\theta, \theta' \in \Lambda^1 J, \omega \in \Lambda^2 J$. Since $f \in \text{Aff}_h(\mathfrak{f}_n)$, it follows that the restriction of $f_J$ to $\Lambda^1 J \times \Lambda^2 J \cong \mathfrak{f}_{2k}$ belongs to $\text{Aff}_h(\mathfrak{f}_{2k})$. Since $(f_J \circ \delta_t)(\theta, \omega) = t^{2k} f_J(\theta, \omega)$ for all $(\theta, \omega) \in \Lambda^1 J \times \Lambda^2 J$ and all $t \in \mathbb{R}^*$, we get that the restriction of $f_J$ to $\Lambda^1 J \times \Lambda^2 J$ belongs to $\text{Aff}_h(\mathfrak{f}_{2k})_{2k}$ and it follows from the previous case that there is $\eta_J \in \mathbb{R}$ such that $f_J(\theta, \omega) e^J = \eta_J \omega^k$ for all $(\theta, \omega) \in \Lambda^1 J \times \Lambda^2 J$. Since $f_J$ does not depend on $\theta$, this equality holds actually true for all $\theta \in \Lambda^1 \mathbb{R}^n$, $\omega \in \Lambda^2 J$. For $(\theta, \omega) \in \mathfrak{f}_n$, we have $f_J(\theta, \omega) = f_J(\theta, \Pi_J(\omega))$ where $\Pi_J : \Lambda^2 \mathbb{R}^n \to \Lambda^2 J$ denotes the projection map given by $\Pi_J(\omega) := \sum_{\substack{1 \le j < j' \le n \\ j, j' \in \text{im } J}} \omega_{jj'} e^{jj'}$. Therefore, for $(\theta, \omega) \in \mathfrak{f}_n$, we have

$$f(\theta, \omega) v = \sum_{J \in \mathcal{J}_{2k}^n} f_J(\theta, \Pi_J(\omega)) v = \sum_{J \in \mathcal{J}_{2k}^n} \sigma_J \eta_J \Pi_J(\omega)^k \wedge e^{J^c}$$

where $\sigma_J \in \{-1, 1\}$ is such that $v = \sigma_J e^J \wedge e^{J^c}$. Now, note that $(\omega - \Pi_J(\omega)) \wedge e^{J^c} = 0$, therefore $\Pi_J(\omega)^k \wedge e^{J^c} = \omega^k \wedge e^{J^c}$, and the previous equality becomes

$$f(\theta, \omega) v = \sum_{J \in \mathcal{J}_{2k}^n} \sigma_J \eta_J \omega^k \wedge e^{J^c} = \omega^k \wedge \eta$$

where $\eta := \sum_{J \in \mathcal{J}_{2k}^n} \sigma_J \eta_J e^{J^c} \in \Lambda^{n-2k}\mathbb{R}^n$, which concludes the proof of the proposition when $i = 2k$ is even.
We now consider the case where $i = 2k + 1$ is odd. Let $f \in \text{Aff}_h(f_n)_{2k+1}$ and let $b_I : \Lambda^1\mathbb{R}^n \to \mathbb{R}$, $I \in \mathcal{I}_k^n$, be linear forms given by Proposition 3.4 (iii) so that

$$f(\theta, \omega) = \sum_{I \in \mathcal{I}_k^n} b_I(\theta) \omega_I.$$

For $k = 0$ we get that $f(\theta, \omega) = b_\emptyset(\theta)$ and the required conclusion clearly holds true. Thus assume that $k \in \{1, \dots, \lfloor(n-1)/2\rfloor\}$ and let $\theta \in \Lambda^1\mathbb{R}^n$ be given. As in the proof of (3.6), consider the function $g : f_n \to \mathbb{R}$ given by $g(\tau, \omega) := f_{2k+1}(\theta, \omega)$ for $(\tau, \omega) \in f_n$. We have $g \in \text{Aff}_h(f_n)$, see the proof of (3.6), and since $g \circ \delta_t = t^{2k}g$, it follows that $g \in \text{Aff}_h(f_n)_{2k}$. Then we know from the previous cases and Corollary 6.5 that there is a unique $\bar{\eta}(\theta) \in \Lambda^{n-2k}\mathbb{R}^n$ such that $f(\theta, \omega)v = \omega^k \wedge \bar{\eta}(\theta)$ for all $\omega \in \Lambda^2\mathbb{R}^n$. Next, it follows from the linearity of the $b_I$ that the map $\theta \in \Lambda^1\mathbb{R}^n \mapsto \omega^k \wedge \bar{\eta}(\theta)$ is linear for every $\omega \in \Lambda^2\mathbb{R}^n$. Since $\text{span}\{\omega^k : \omega \in \Lambda^2\mathbb{R}^n\} = \Lambda^{2k}\mathbb{R}^n$, see (6.1), we get that $\bar{\eta} : \Lambda^1\mathbb{R}^n \to \Lambda^{n-2k}\mathbb{R}^n$ is linear. We now claim that $\theta \wedge \bar{\eta}(\theta) = 0$ for all $\theta \in \Lambda^1\mathbb{R}^n$. Indeed, on the one hand, we know that the function $t \in \mathbb{R} \mapsto f((\theta', \omega) \cdot (t\theta, 0)) = f(\theta' + t\theta, \omega + t\theta' \wedge \theta)$ is affine for all $(\theta, \omega) \in f_n$, $\theta' \in \Lambda^1\mathbb{R}^n$. On the other hand, we have

$$ \begin{aligned} f(\theta' + t\theta, \omega + t\theta' \wedge \theta) v &= (\omega + t\theta' \wedge \theta)^k \wedge \bar{\eta}(\theta' + t\theta) \\ &= (\omega^k + kt \omega^{k-1} \wedge \theta' \wedge \theta) \wedge (\bar{\eta}(\theta') + t \bar{\eta}(\theta)) \\ &= \omega^k \wedge \bar{\eta}(\theta') + t(\omega^k \wedge \bar{\eta}(\theta) + k \omega^{k-1} \wedge \theta' \wedge \theta \wedge \bar{\eta}(\theta')) \\ &\quad + t^2 k \omega^{k-1} \wedge \theta' \wedge \theta \wedge \bar{\eta}(\theta), \end{aligned} $$

and hence the coefficient of $t^2$ vanishes, i.e., $\omega^{k-1} \wedge \theta' \wedge \theta \wedge \bar{\eta}(\theta) = 0$ for every $\theta, \theta' \in \Lambda^1\mathbb{R}^n$, $\omega \in \Lambda^2\mathbb{R}^n$. Since $\text{span}\{\omega^{k-1} \wedge \theta' : \theta' \in \Lambda^1\mathbb{R}^n, \omega \in \Lambda^2\mathbb{R}^n\} = \Lambda^{2k-1}\mathbb{R}^n$, see (6.2), we get that $\theta \wedge \bar{\eta}(\theta) = 0$ for all $\theta \in \Lambda^1\mathbb{R}^n$, as claimed. Then the required conclusion follows from Proposition 6.6, and this concludes the proof of the proposition. $\square$

## 4 Horizontally Affine Functions on Arbitrary Step-2 Carnot Algebras

In this section, we prove Theorem 1.2, that will be deduced from Theorem 1.1 writing a step-2 rank-$r$ Carnot algebra that is not isomorphic to $f_r$ as a proper quotient of $f_r$, and Theorem 1.3. The main argument for proving both theorems is given in Lemma 4.1 where we characterize those functions in $\text{Aff}_h(f_n)_j$ that factor through $f_n/i$ where $i$ a graded ideal of $f_n$. We refer to (6.5) and (6.6) for the notions of annihilators. For notational convenience, we shall again identify $f_n$ with $\Lambda^1\mathbb{R}^n \times \Lambda^2\mathbb{R}^n$ throughout this section.

**Lemma 4.1** Let $n \ge 2$ and $i$ be a graded ideal of $f_n$. For $j \in \{0, \dots, n\}$, $\eta \in \Lambda^{n-j}\mathbb{R}^n$, the map $\varphi_\eta$ given by (1.1) factors through $f_n/i$ if and only if $\eta \in \text{Anh}^{n-j}i$.
**Proof** Write the graded ideal $\mathfrak{f}_n \cong \Lambda^1\mathbb{R}^n \times \Lambda^2\mathbb{R}^n$ as $i = i_1 \times i_2$ where $i_1, i_2$ are linear subspaces of $\Lambda^1\mathbb{R}^n, \Lambda^2\mathbb{R}^n$ such that $\theta \wedge \theta' \in i_2$ for all $\theta \in \Lambda^1\mathbb{R}^n, \theta' \in i_1$. Recall that $\varphi: \mathfrak{f}_n \to \Lambda^n\mathbb{R}^n$ factors through $\mathfrak{f}_n/i$ if and only if $\varphi(\theta + \tau, \omega + \zeta) = \varphi(\theta, \omega)$ for all $(\theta, \omega) \in \mathfrak{f}_n, (\tau, \zeta) \in i$. If $\eta \in \Lambda^n\mathbb{R}^n$ then $\varphi_\eta$ is constant and therefore clearly factors through $\mathfrak{f}_n/i$. Since $\mathrm{Anh}^n i = \Lambda^n\mathbb{R}^n$, see (6.7), this proves the lemma for $j = 0$. If $\eta \in \Lambda^{n-1}\mathbb{R}^n$ then $\varphi_\eta(\theta, \omega) = \theta \wedge \eta$. Therefore $\varphi_\eta$ factors through $\mathfrak{f}_n/i$ if and only if $\tau \wedge \eta = 0$ for all $\tau \in i_1$, i.e., $\eta \in \mathrm{Anh}^{n-1} i_1 = \mathrm{Anh}^{n-1} i$, where the last equality comes from (6.8), which proves the lemma for $j = 1$. Now let $j \in \{2, \dots, n\}$. For $\eta \in \mathrm{Anh}^{n-j}$ $i$, it easily follows from (1.1) that $\varphi_\eta$ factors through $\mathfrak{f}_n/i$. Conversely, let $\eta \in \Lambda^{n-j}\mathbb{R}^n$ and assume that $\varphi_\eta$ factors through $\mathfrak{f}_n/i$. Then, for all $(\theta, \omega) \in \mathfrak{f}_n, \zeta \in i_2, t \in \mathbb{R}$, we have $\varphi_\eta(\theta, \omega + t\zeta) = \varphi_\eta(\theta, \omega)$, i.e.,

$$ \begin{cases} (\omega + t\zeta)^k \wedge \eta = \omega^k \wedge \eta & \text{if } j = 2k \text{ is even} \\ \theta \wedge (\omega + t\zeta)^k \wedge \eta = \theta \wedge \omega^k \wedge \eta & \text{if } j = 2k + 1 \text{ is odd.} \end{cases} $$

Identifying the coefficient of degree 1 in $t$, we get that for all $\theta \in \Lambda^1\mathbb{R}^n, \omega \in \Lambda^2\mathbb{R}^n, \zeta \in i_2$,

$$ \begin{cases} \omega^{k-1} \wedge \zeta \wedge \eta = 0 & \text{if } j = 2k \text{ is even} \\ \theta \wedge \omega^{k-1} \wedge \zeta \wedge \eta = 0 & \text{if } j = 2k + 1 \text{ is odd.} \end{cases} $$

It then follows from (6.1) when $j$ is even, (6.2) when $j$ is odd, and Lemma 6.4 that $\zeta \wedge \eta \in \mathrm{Anh}^{n-j+2}\Lambda^{j-2}\mathbb{R}^n = \{0\}$ for all $\zeta \in i_2$, i.e., $\eta \in \mathrm{Anh}^{n-j} i_2 = \mathrm{Anh}^{n-j} i$, where the last equality comes from (6.9), and this concludes the proof of the lemma. $\square$

We first prove Theorem 1.2.

**Proof of Theorem 1.2** Let $\mathfrak{g}$ be a step-2 rank-$r$ Carnot algebra that is not isomorphic to $\mathfrak{f}_r$. Clearly, $\bigoplus_{i=0}^{r-1} \mathrm{Aff}_h(\mathfrak{g})_i \subset \mathrm{Aff}_h(\mathfrak{g})$. To prove the converse inclusion, let $\pi: \mathfrak{f}_r \to \mathfrak{g}$ be a surjective Carnot morphism and $\nu \in \Lambda^r\mathbb{R}^r \setminus \{0\}$ be fixed. Recall for further use that $\mathrm{Ker} \pi$ is a nontrivial graded ideal of $\mathfrak{f}_r$. Let $f \in \mathrm{Aff}_h(\mathfrak{g})$. Then $f \circ \pi \in \mathrm{Aff}_h(\mathfrak{f}_n)$ by Lemma 2.3 and it follows from Theorem 1.1 that there are $\eta_i \in \Lambda^{r-i}\mathbb{R}^r, i \in \{0, \dots, r\}$, such that $(f \circ \pi)\nu = \sum_{i=0}^r \varphi_{\eta_i}$. We claim that each $\varphi_{\eta_i}$ factors through $\mathfrak{f}_r/\mathrm{Ker} \pi$. Indeed, since $\pi$ commutes with dilations, we have for all $(\theta, \omega) \in \mathfrak{f}_r, (\tau, \zeta) \in \mathrm{Ker} \pi, t \in \mathbb{R}^*$,

$$ \begin{align*} \sum_{i=0}^{r} t^i \varphi_{\eta_i} (\theta + \tau, \omega + \zeta) &= \sum_{i=0}^{r} (\varphi_{\eta_i} \circ \delta_t)(\theta + \tau, \omega + \zeta) \\ &= (f \circ \pi \circ \delta_t)(\theta + \tau, \omega + \zeta) \nu = (f \circ \delta_t \circ \pi)(\theta + \tau, \omega + \zeta) \nu \\ &= (f \circ \delta_t \circ \pi)(\theta, \omega) \nu = (f \circ \pi \circ \delta_t)(\theta, \omega) \nu \\ &= \sum_{i=0}^{r} (\varphi_{\eta_i} \circ \delta_t)(\theta, \omega) = \sum_{i=0}^{r} t^i \varphi_{\eta_i}(\theta, \omega). \end{align*} $$
This implies that for all $i \in \{0, \dots, r\}$, $\varphi_{\eta_i} (\theta+\tau, \omega+\zeta) = \varphi_{\eta_i} (\theta, \omega)$ for all $(\theta, \omega) \in \mathfrak{f}_r$, $(\tau, \zeta) \in \text{Ker } \pi$, i.e., $\varphi_{\eta_i}$ factors through $\mathfrak{f}_r/\text{Ker } \pi$, as claimed. Since $\pi$ is surjective, it follows that for each $i \in \{0, \dots, r\}$ there is $f_i : \mathfrak{g} \to \mathbb{R}$ such that $(f_i \circ \pi)v = \varphi_{\eta_i}$. Since $\varphi_{\eta_i} \in \text{Aff}_h(\mathfrak{f}_n, \Lambda^n \mathbb{R}^n)_i$, we get from Corollary 2.4 that $f_i \in \text{Aff}_h(\mathfrak{g})_i$ (note indeed that the analogue of Corollary 2.4 holds true for $\Lambda^n \mathbb{R}^n$-valued functions). Let us now verify that $f_r = 0$. Since $\varphi_{\eta_r}$ factors through $\mathfrak{f}_r/\text{Ker } \pi$, we know from Lemma 4.1 that $\eta_r \in \text{Anh}^0 \text{ Ker } \pi$. Since $\mathfrak{g}$ is not isomorphic to $\mathfrak{f}_r$, we have $\text{Ker } \pi \neq \{0\}$ and hence $\text{Anh}^0 \text{ Ker } \pi = \{0\}$. Therefore $\eta_r = 0$ and hence $f_r = 0$. All together we get that $f = \sum_{i=0}^{r-1} f_i \in \bigoplus_{i=0}^{r-1} \text{Aff}_h(\mathfrak{g})_i$ and this concludes the proof of Theorem 1.2. $\square$

We now prove Theorem 1.3

**Proof of Theorem 1.3** Let $\mathfrak{g}$ be a step-2 rank-$r$ Carnot algebra, $n \ge r$, and $\pi : \mathfrak{f}_n \to \mathfrak{g}$ be a surjective Carnot morphism. Let $i \in \{0, \dots, n\}$, $v \in \Lambda^n \mathbb{R}^n \setminus \{0\}$, $\eta \in \text{Anh}^{n-i} \text{ Ker } \pi$. Since $\text{Ker } \pi$ is a graded ideal of $\mathfrak{f}_n$, we know from Lemma 4.1 that $\varphi_\eta$ factors through $\mathfrak{f}_n/\text{Ker } \pi$ and since $\pi$ is surjective we get the existence of a unique function $f : \mathfrak{g} \to \mathbb{R}$ such that $(f \circ \pi)v = \varphi_\eta$. Furthermore, since $\varphi_\eta \in \text{Aff}_h(\mathfrak{f}_n, \Lambda^n \mathbb{R}^n)_i$, we get from Corollary 2.4 that $f \in \text{Aff}_h(\mathfrak{g})_i$, which concludes the proof of Theorem 1.3 (i). Conversely, let $f \in \text{Aff}_h(\mathfrak{f}_n)_i$. Then $f \circ \pi \in \text{Aff}_h(\mathfrak{f}_n)_i$ by Corollary 2.4 and it follows from Theorem 1.1 (ii) that there is a unique $\eta \in \Lambda^{n-i} \mathbb{R}^n$ such that $(f \circ \pi)v = \varphi_\eta$. This equality shows in turn that $\varphi_\eta$ factors through $\mathfrak{f}_n/\text{Ker } \pi$ and hence $\eta \in \text{Anh}^{n-i} \text{ Ker } \pi$ by Lemma 4.1, which concludes the proof Theorem 1.3 (ii). By linearity of the map $\eta \mapsto \varphi_\eta$, we get that the bijective map $\eta \in \text{Anh}^{n-i} \text{ Ker } \pi \mapsto f \in \text{Aff}_h(\mathfrak{g})_i$ where $f$ is given by Theorem 1.3 (i) is linear and therefore is an isomorphism of vector spaces, which concludes the proof of Theorem 1.3 (iii). By Theorem 1.1 (i) and Theorem 1.2, it follows that $\text{Aff}_h(\mathfrak{g})$ and $\bigoplus_{i=0}^n \text{Anh}^{n-i} \text{ Ker } \pi$ are isomorphic as vector spaces. Finally, since $\text{Ker } \pi$ is a graded ideal of $\mathfrak{f}_n$, we get from Corollary 6.9 that $\text{Anh} \text{ Ker } \pi = \bigoplus_{i=0}^n \text{Anh}^{n-i} \text{ Ker } \pi$. Therefore $\text{Aff}_h(\mathfrak{g})$ and $\text{Anh} \text{ Ker } \pi$ are isomorphic as vector spaces, which concludes the proof of Theorem 1.3 (iv). $\square$

**Remark 4.2** If $\mathfrak{g}$ is a step-2 rank-$r$ Carnot algebra that is not isomorphic to $\mathfrak{f}_r$ then $\dim \text{Aff}_h(\mathfrak{g}) \le 2^r - r + 1$. Indeed consider a surjective Carnot morphism $\pi : \mathfrak{f}_r \to \mathfrak{g}$. Then $\text{Ker } \pi$ is a nontrivial graded ideal of $\mathfrak{f}_r$ that is contained in $\Lambda^2 \mathbb{R}^r$. Therefore $\text{Anh}^r \text{ Ker } \pi = \Lambda^r \mathbb{R}^r$ by (6.7), $\text{Anh}^{r-1} \text{ Ker } \pi = \text{Anh}^{r-1}\{0\} = \Lambda^{r-1} \mathbb{R}^r$ where the first equality follows from (6.8), and $\text{Anh}^{r-i} \text{ Ker } \pi \subsetneq \Lambda^{r-i} \mathbb{R}^r$ for $i \in \{2, \dots, r-1\}$. This latter claim indeed follows from the inclusion $\text{Ker } \pi \subset \Lambda^2 \mathbb{R}^r$ together with the fact that $\text{Anh}^2 \Lambda^{r-i} \mathbb{R}^r = \{0\}$ for $i \in \{2, \dots, r-1\}$, see Lemma 6.4. By Theorem 1.3 (iii) we get that $\text{Aff}_h(\mathfrak{g})_i$ and $\Lambda^{r-i} \mathbb{R}^r$ are isomorphic for $i \in \{0, 1\}$ and $\dim \text{Aff}_h(\mathfrak{g})_i \le \dim \Lambda^{r-i} \mathbb{R}^r - 1$ for $i \in \{2, \dots, r-1\}$. Therefore $\dim \text{Aff}_h(\mathfrak{g}) \le 2^r - r + 1$ by Theorem 1.2.

**Remark 4.3** It follows from Theorems 1.1, 1.2, 1.3 (iii), and Lemma 6.11 that if $\mathfrak{g}$ is a step-2 Carnot algebra then $\text{Aff}_h(\mathfrak{g})_i = \{0\}$ for some non-negative integer $i$ if and only if $\bigoplus_{j \ge i} \text{Aff}_h(\mathfrak{g})_j = \{0\}$.

**Remark 4.4** Note that it follows from Theorems 1.1 and 1.3 (iii) that if $n > r \ge 2$ and $\pi : \mathfrak{f}_n \to \mathfrak{f}_r$ is a surjective Carnot morphism then $\text{Anh}^{n-i} \text{ Ker } \pi = \{0\}$ for
i ∈ {r + 1, ..., n}. Similarly, it follows from Theorems 1.2 and 1.3 (iii) that if g is a step-2 rank-r Carnot algebra that is not isomorphic to $f_r$, $n \ge r$, and $\pi : f_n \to g$ is a surjective Carnot morphism then $\mathrm{Anh}^{n-i} \ker \pi = \{0\}$ for $i \in \{r, ..., n\}$.

# 5 Step-2 Carnot Algebras Where Horizontally Affine Functions are Affine

## 5.1 Characterization

This section is devoted to the proof of Theorem 1.4 that characterizes step-2 Carnot algebras where h-affine functions are affine. We begin with an easy consequence of Theorem 1.3.

**Lemma 5.1** Let $g$ be a step-2 Carnot algebra. Then $\bigoplus_{i=0}^{2} \mathrm{Aff}_h(g)_i = \mathrm{Aff}(g)$.

*Proof* We already know from Lemma 2.5 that $\mathrm{Aff}(g) \subset \bigoplus_{i=0}^{2} \mathrm{Aff}_h(g)_i$. Conversely, let $f \in \bigoplus_{i=0}^{2} \mathrm{Aff}_h(g)_i$. Let $r := \mathrm{rank} g$, $\pi : f_r \to g$ be a surjective Carnot morphism, and $\nu \in \Lambda^r \mathbb{R}^r \setminus \{0\}$. By Theorem 1.3 (ii) there are $\eta_i \in \mathrm{Anh}^{n-i} \ker \pi$, $i \in \{0, 1, 2\}$, such that $(f \circ \pi)\nu = \sum_{i=0}^{2} \varphi_{\eta_i}$. Then it clearly follows from the form of $\varphi_{\eta_i}$, see (1.1), together with the fact that $\pi$ is a surjective Carnot morphism that $f \in \mathrm{Aff}(g)$. $\square$

We now turn to the proof of Theorem 1.4.

*Proof of Theorem* 1.4 The equivalence between Theorem 1.4 (i) and (ii) follows from Lemmas 2.5 and 5.1. Next, Theorem 1.4 (ii) clearly implies Theorem 1.4 (iii) since $\mathrm{Aff}_h(g)_i$ are linear subspaces of $\mathrm{Aff}_h(g)$ that are in direct sum, recalling also that $\bigoplus_{i \ge 3} \mathrm{Aff}_h(g)_i = \{0\}$ if and only if $\mathrm{Aff}_h(g)_3 = \{0\}$, see Remark 4.3.

Now, assume that $\mathrm{Aff}_h(g)_3 = \{0\}$. Let $b : g_1 \times g_2 \to \mathbb{R}$ be a bilinear form such that $b(x, [x, x']) = 0$ for all $x, x' \in g_1$. Identifying $g$ with $g_1 \times g_2$, we have for $x, x' \in g_1$, $z \in g_2$, $t \in \mathbb{R}$,

$$ 
\begin{aligned}
b((x, z) \cdot (tx', 0)) &= b(x + tx', z + t[x, x']) \\
&= b(x, z) + tb(x', z) + tb(x, [x, x']) + tb(x', [x, x']) \\
&= b(x, z) + tb(x', z)
\end{aligned}
$$

and $b(\delta_t(x, z)) = b(tx, t^2z) = t^3b(x, z)$. Therefore $b \in \mathrm{Aff}_h(g)_3$ and hence $b = 0$, which proves that $g$ is $\mathcal{I}$-null.

Next, assume that $g$ is $\mathcal{I}$-null. Let $n \ge \max\{3, \mathrm{rank} g\}$ and $\pi : f_n \to g$ be a surjective Carnot morphism and let us verify that $\mathrm{Anh}^{n-3} \ker \pi = \{0\}$. Let $\nu \in \Lambda^n \mathbb{R}^n \setminus \{0\}$ be given. By Theorem 1.3 (i), for $\eta \in \mathrm{Anh}^{n-3} \ker \pi$ there is $f \in \mathrm{Aff}_h(g)_3$ such that $(f \circ \pi)\nu = \varphi_{\eta}$. Identifying $f_n$ with $\Lambda^1 \mathbb{R}^n \times \Lambda^2 \mathbb{R}^n$, we have $\varphi_{\eta}(\theta, \omega) = \theta \wedge \omega \wedge \eta$. Therefore $\varphi_{\eta} : \Lambda^1 \mathbb{R}^n \times \Lambda^2 \mathbb{R}^n \to \Lambda^n \mathbb{R}^n$ is bilinear. Since $\pi$ is a surjective Carnot morphism, it follows that $f : g \cong g_1 \times g_2 \to \mathbb{R}$ is bilinear as well. Furthermore, for $x, x' \in g_1$, let $\theta, \theta' \in \Lambda^1 \mathbb{R}^n$ be such that $x = \pi(\theta)$, $x' = \pi(\theta')$. Then $[x, x'] = \pi(\theta \wedge \theta')$ and hence, identifying $g$ with $g_1 \times g_2$, we have $(x, [x, x']) = \pi(\theta, \theta \wedge \theta')$.
Therefore $f(x, [x, x'])v = \varphi_\eta(\theta, \theta \wedge \theta') = 0$. Since $g$ is $\mathcal{I}$-null, it follows that $f = 0$ and hence $\eta = 0$ by Corollary 6.5. Therefore $\mathrm{Anh}^{n-3}$ Ker $\pi = \{0\}$, as wanted. Recall that this is in turn equivalent to $\bigoplus_{i=3}^n \mathrm{Anh}^{n-i}$ Ker $\pi = \{0\}$ by Lemma 6.11.

To conclude the proof of Theorem 1.4, assume that there are $n \ge \max\{3, \mathrm{rank} \, g\}$ and a surjective Carnot morphism $\pi : f_n \to g$ such that $\bigoplus_{i=3}^n \mathrm{Anh}^{n-i}$ Ker $\pi = \{0\}$. By Theorem 1.3 (iii) we get that $\bigoplus_{i=3}^n \mathrm{Aff}_h(g)_i = \{0\}$ and Theorems 1.1 (i) and 1.2 imply in turn Theorem 1.4 (ii). $\quad \square$

## 5.2 Examples

In this section, we deduce from Theorem 1.4 sufficient conditions implying that h-affine functions are affine and necessary conditions that must be satisfied when this is the case. These conditions may be easier to verify on concrete examples than those given in the characterization obtained in Theorem 1.4. We, however, illustrate with explicit examples to what extent some of these easier conditions cannot be turned into characterizations of step-2 Carnot algebras where h-affine functions are affine. We shall also see from some of these examples that, unlike affine functions, a h-affine function defined on a Lie subalgebra of a step-2 Carnot algebra may not admit a h-affine extension to the whole algebra.

**Proposition 5.2** Let $g$ be a step-2 Carnot algebra and assume there is $x \in g_1$ such that $\mathrm{ad}_x : y \in g_1 \mapsto [x, y] \in g_2$ is surjective. Then $\mathrm{Aff}_h(g) = \mathrm{Aff}(g)$.

*Proof* If $\mathrm{ad}_x$ is surjective for some $x \in g_1$ then so is $\mathrm{ad}_{x'}$ for $x' \in U$ for some open neighborhood $U \subset g_1$ of $x$. If $b : g_1 \times g_2 \to \mathbb{R}$ is a bilinear form such that $b(u, [u, v]) = 0$ for all $u, v \in g_1$ then, by bilinearity of $b$ and surjectivity of $\mathrm{ad}_{x'}$, we get $b(x', z) = 0$ for all $x' \in U, z \in g_2$, and finally $b = 0$, using once again the bilinearity of $b$ together with the fact that $U$ is a nonempty open subset of $g_1$. Therefore $g$ is $\mathcal{I}$-null and hence $\mathrm{Aff}_h(g) = \mathrm{Aff}(g)$ by Theorem 1.4 (i)–(iv). $\quad \square$

**Proposition 5.2** applies in particular to step-2 Carnot algebras of Métivier’s type, i.e., step-2 Carnot algebras where $\mathrm{ad}_x$ is surjective for all $x \in g_1 \setminus \{0\}$.

The condition given in Proposition 5.2 about the surjectivity of $\mathrm{ad}_x$ for some $x \in g_1$ implying that $g$ is $\mathcal{I}$-null should not be confused with the surjectivity of the Lie bracket $[\cdot, \cdot] : g_1 \times g_1 \to g_2$. Indeed, step-2 Carnot algebras of Métivier’s type are examples of $\mathcal{I}$-null Lie algebras where the Lie bracket is surjective, whereas Example 5.3 below gives an example of a $\mathcal{I}$-null step-2 Carnot algebra where the Lie bracket is not surjective. On the other hand, free step-2 Carnot algebras of rank 3 or higher are not $\mathcal{I}$-null whereas the Lie bracket $(\theta, \theta') \in \Lambda^1\mathbb{R}^n \times \Lambda^1\mathbb{R}^n \mapsto \theta \wedge \theta' \in \Lambda^2\mathbb{R}^n$ is surjective if and only if $n = 3$.

**Example 5.3** Let $i$ be the graded ideal of $f_4$ given by $i := \mathrm{span}\{e^{12} + e^{34}\}$ and let $g := f_4/i$. Elementary computations show that $\mathrm{Anh}^1i = \{0\}$. Therefore $\mathrm{Aff}_h(g) = \mathrm{Aff}(g)$ and $g$ is $\mathcal{I}$-null by Theorem 1.4 (i)–(iv)–(v). To see that the Lie bracket is not surjective we identify $g$ with $\Lambda^1\mathbb{R}^4 \oplus g_2$ where $g_2 := \{\omega \in \Lambda^2\mathbb{R}^4 : \omega_{34} = 0\}$. The
only nontrivial bracket relations are given by

$$[\theta, \theta'] = ((\theta_1\theta'_2 - \theta'_1\theta_2) - (\theta_3\theta'_4 - \theta'_3\theta_4)) e^{i2} + \sum_{13 \le ij \le 24} (\theta_i\theta'_j - \theta'_i\theta_j) e^{ij}$$

for $\theta, \theta' \in \Lambda^1\mathbb{R}^4$ and we claim that

$$\mathrm{Im}[\cdot, \cdot] \cap \{\omega \in \mathfrak{g}_2 : \omega_{14} = \omega_{23} = 0\} \subset \{\omega \in \mathfrak{g}_2 : \omega_{12}^2 + 4\omega_{13}\omega_{24} \ge 0\}.$$

Indeed, let $\omega = [\theta, \theta']$ with $\theta, \theta' \in \Lambda^1\mathbb{R}^4$. Set $u_i := (\theta_i, \theta'_i) \in \mathbb{R}^2$ for $i = 1, 2, 3, 4$. We have $\omega_{ij} = \det(u_i, u_j)$ for $13 \le ij \le 24$. If $u_2 = (0, 0)$ or $u_4 = (0, 0)$ then $\omega_{24} = 0$ and we obviously have $\omega_{12}^2 + 4\omega_{13}\omega_{24} = \omega_{12}^2 \ge 0$. Assume now that $u_2 \ne (0, 0)$, $u_4 \ne (0, 0)$, and $\omega_{14} = \omega_{23} = 0$. Then $u_1$ and $u_4$, respectively, $u_2$ and $u_3$, are colinear. Therefore there are $s, t \in \mathbb{R}$ such that $u_1 = su_4$ and $u_3 = tu_2$. Since $\omega_{12} = \det(u_1, u_2) - \det(u_3, u_4)$, we get that $\omega_{12}^2 + 4\omega_{13}\omega_{24} = ((s+t)^2 - 4st)\det(u_2, u_4)^2 = (s-t)^2\det(u_2, u_4)^2 \ge 0$, as claimed.

Given a step-2 Carnot algebra $\mathfrak{g}$, we say that $\mathfrak{g}'$ is a quotient of $\mathfrak{g}$ if $\mathfrak{g}'$ is a step-2 Carnot algebra and there is a surjective Carnot morphism $\pi : \mathfrak{g} \to \mathfrak{g}'$.

**Proposition 5.4** Let $\mathfrak{g}$ be a step-2 Carnot algebra such that $\mathrm{Aff}_h(\mathfrak{g}) = \mathrm{Aff}(\mathfrak{g})$. Then $\mathrm{Aff}_h(\mathfrak{g}') = \mathrm{Aff}(\mathfrak{g}')$ for every quotient $\mathfrak{g}'$ of $\mathfrak{g}$.

*Proof* By [11, Lemma 2.3] every quotient of a $\mathcal{I}$-null Lie algebra is $\mathcal{I}$-null and hence the proposition follows from Theorem 1.4 (i)–(iv). $\square$

Note that it may happen that $\mathrm{Aff}(\mathfrak{g}) \subsetneq \mathrm{Aff}_h(\mathfrak{g})$ while $\mathrm{Aff}_h(\mathfrak{g}') = \mathrm{Aff}(\mathfrak{g}')$ for every proper quotient $\mathfrak{g}'$ of $\mathfrak{g}$, i.e., for every quotient of $\mathfrak{g}$ that is not isomorphic to $\mathfrak{g}$. A simple example is given by the free step-2 rank-3 Carnot algebra $\mathfrak{f}_3$. Indeed, we know from Theorem 1.1 that $\mathrm{Aff}(\mathfrak{f}_3) \subsetneq \mathrm{Aff}_h(\mathfrak{f}_3)$, whereas every proper quotient $\mathfrak{g}'$ of $\mathfrak{f}_3$ is either isomorphic to $\mathfrak{f}_2$ or has rank 3 and is not isomorphic to $\mathfrak{f}_3$, therefore $\mathrm{Aff}_h(\mathfrak{g}') = \mathrm{Aff}(\mathfrak{g}')$ by Theorems 3.2, 1.2, and 1.4 (i)–(ii). See also Example 5.6 for another example that is not isomorphic to $\mathfrak{f}_3$.

Note also that since $\mathrm{Aff}(\mathfrak{f}_3) \subsetneq \mathrm{Aff}_h(\mathfrak{f}_3)$, Proposition 5.4 has the following immediate corollary.

**Corollary 5.5** Let $\mathfrak{g}$ be a step-2 Carnot algebra that has $\mathfrak{f}_3$ as one of its quotients. Then $\mathrm{Aff}(\mathfrak{g}) \subsetneq \mathrm{Aff}_h(\mathfrak{g})$.

It may happen that $\mathrm{Aff}(\mathfrak{g}) \subsetneq \mathrm{Aff}_h(\mathfrak{g})$ while $\mathfrak{g}$ does not have $\mathfrak{f}_3$ as one of its quotients, as shows Example 5.6 where $\mathfrak{g}$ is a step-2 rank-5 Carnot algebra such that $\mathrm{Aff}(\mathfrak{g}) \subsetneq \mathrm{Aff}_h(\mathfrak{g})$ and $\mathrm{Aff}_h(\mathfrak{g}') = \mathrm{Aff}(\mathfrak{g}')$ for every proper quotient $\mathfrak{g}'$ of $\mathfrak{g}$.

**Example 5.6** Let $i$ be the graded ideal of $\mathfrak{f}_5$ given by $i := \mathrm{Anh}^2\{\zeta\}$ where $\zeta := e^{i2} + e^{i45}$ and let $\mathfrak{g} := \mathfrak{f}_5/i$ so that $\mathfrak{g}$ is in particular a step-2 rank-5 Carnot algebra and therefore is not isomorphic to $\mathfrak{f}_3$. We have $\zeta \in \mathrm{Anh}^2i$ and hence $\mathrm{Aff}(\mathfrak{g}) \subsetneq \mathrm{Aff}_h(\mathfrak{g})$ by Theorem 1.4 (i)–(v). We now claim that $\mathrm{Aff}_h(\mathfrak{g}') = \mathrm{Aff}(\mathfrak{g}')$ for every proper quotient $\mathfrak{g}'$ of $\mathfrak{g}$. Indeed, let $\mathfrak{g}'$ be a proper quotient of $\mathfrak{g}$ and let $\pi : \mathfrak{g} \to \mathfrak{g}'$ be a surjective
Carnot morphism. Let $\bar{\pi} : \mathfrak{f}_5 \to \mathfrak{g}$ denote the quotient map so that $\pi \circ \bar{\pi} : \mathfrak{f}_5 \to \mathfrak{g}'$ is a surjective Carnot morphism and let us verify that $\mathrm{Anh}^2 \ker \pi \circ \bar{\pi} = \{0\}$. Let $\eta \in \mathrm{Anh}^2 \ker \pi \circ \bar{\pi}$. We have $\mathrm{Anh}^1\{\zeta\} \oplus \mathrm{Anh}^2\{\zeta\} = \{0\} \oplus \mathrm{Anh}^2\{\zeta\} = \ker \bar{\pi} \subset \ker \pi \circ \bar{\pi} \subset \mathrm{Anh}^1\{\eta\} \oplus \mathrm{Anh}^2\{\eta\}$. Since $\mathrm{Anh}^2\{\zeta\} = \mathrm{span}\{e^{12}-e^{45}, e^{14}, e^{15}, e^{24}, e^{25}\}$, we have $(e^{12}-e^{45}) \wedge \eta = 0$, implying $\eta_{34} = \eta_{35} = \eta_{45} - \eta_{12} = \eta_{13} = \eta_{23} = 0$, and $e^{ij} \wedge \eta = 0$ for $i=1, 2, j=4, 5$, implying $\eta_{ij} = 0$ for $i=1, 2, j=4, 5$. Therefore $\eta \in \mathrm{span}\{\zeta\}$. If $\eta \neq 0$ then $\mathrm{Anh}^1\{\eta\} \oplus \mathrm{Anh}^2\{\eta\} = \mathrm{Anh}^1\{\zeta\} \oplus \mathrm{Anh}^2\{\zeta\}$ which implies in turn $\ker \bar{\pi} = \ker \pi \circ \bar{\pi}$ and therefore $\ker \pi = \{0\}$. This contradicts the fact that $\mathfrak{g}'$ is a proper quotient of $\mathfrak{g}$ and hence $\eta = 0$. Therefore $\mathrm{Anh}^2 \ker \pi \circ \bar{\pi} = \{0\}$ and it follows from Theorem 1.4 (i)–(v) that $\mathrm{Aff}_h(\mathfrak{g}') = \mathrm{Aff}(\mathfrak{g}')$, as claimed.

We recall that the direct product $\mathfrak{g} \times \mathbb{R}^d$ of a step-2 Carnot algebra with an abelian Lie algebra and the direct product $\mathfrak{g} \times \mathfrak{g}'$ of step-2 Carnot algebras inherit naturally of a structure of step-2 Carnot algebra from those of $\mathfrak{g}$ and $\mathfrak{g}'$.

**Proposition 5.7** Let $\mathfrak{g}, \mathfrak{g}'$ be a step-2 Carnot algebras and $d \ge 1$ be an integer. Then the following hold true:

(i) $\mathrm{Aff}_h(\mathfrak{g} \times \mathfrak{g}') = \mathrm{Aff}(\mathfrak{g} \times \mathfrak{g}')$ if and only if $\mathrm{Aff}_h(\mathfrak{g}) = \mathrm{Aff}(\mathfrak{g})$ and $\mathrm{Aff}_h(\mathfrak{g}') = \mathrm{Aff}(\mathfrak{g}')$

(ii) $\mathrm{Aff}_h(\mathfrak{g} \times \mathbb{R}^d) = \mathrm{Aff}(\mathfrak{g} \times \mathbb{R}^d)$ if and only if $\mathrm{Aff}_h(\mathfrak{g}) = \mathrm{Aff}(\mathfrak{g})$.

**Proof** By [11, Lemma 2.3], any finite direct product of $\mathcal{I}$-null Lie algebras is $\mathcal{I}$-null. Therefore it follows from Theorem 1.4 (i)–(iv) that $\mathrm{Aff}_h(\mathfrak{g} \times \mathfrak{g}') = \mathrm{Aff}(\mathfrak{g} \times \mathfrak{g}')$ whenever $\mathrm{Aff}_h(\mathfrak{g}) = \mathrm{Aff}(\mathfrak{g})$ and $\mathrm{Aff}_h(\mathfrak{g}') = \mathrm{Aff}(\mathfrak{g}')$. Similarly, since abelian Lie algebras are $\mathcal{I}$-null (see Definition 2.6), we have $\mathrm{Aff}_h(\mathfrak{g} \times \mathbb{R}^d) = \mathrm{Aff}(\mathfrak{g} \times \mathbb{R}^d)$ whenever $\mathrm{Aff}_h(\mathfrak{g}) = \mathrm{Aff}(\mathfrak{g})$. The converse implications in (i) and (ii) follow from Proposition 5.4 noting that the projection maps from $\mathfrak{g} \times \mathfrak{g}'$ onto either $\mathfrak{g}$ or $\mathfrak{g}'$ and from $\mathfrak{g} \times \mathbb{R}^d$ onto $\mathfrak{g}$ are surjective Carnot morphisms. $\square$

The next proposition is another simple consequence of Theorem 1.4 that gives a sufficient condition ensuring that $h$-affine maps are affine.

**Proposition 5.8** Let $\mathfrak{g}$ be a step-2 Carnot algebra such that $\mathrm{Aff}(\mathfrak{g}) \subsetneq \mathrm{Aff}_h(\mathfrak{g})$. Then there is a Lie subalgebra of $\mathfrak{g}$ isomorphic to $\mathfrak{f}_3$.

**Proof** By Theorem 1.4 (i)–(iv) we know that $\mathfrak{g}$ is not $\mathcal{I}$-null. Then let $b : \mathfrak{g}_1 \times \mathfrak{g}_2 \to \mathbb{R}$ be a non-zero bilinear form such that $b(x, [x, x']) = 0$ for all $x, x' \in \mathfrak{g}_1$. Since $b \neq 0$, there are $x \in \mathfrak{g}_1, z \in \mathfrak{g}_2$ such that $b(x, z) \neq 0$. By bilinearity together with the fact that $[\mathfrak{g}_1, \mathfrak{g}_1] = \mathfrak{g}_2$, it follows that there are $x_1, x_2, x_3 \in \mathfrak{g}_1$ such that $b(x_1, [x_2, x_3]) = 1$. We claim that $[x_1, x_2], [x_1, x_3], [x_2, x_3]$ are linearly independent and therefore the Lie subalgebra of $\mathfrak{g}$ generated by $x_1, x_2, x_3$ is isomorphic to $\mathfrak{f}_3$. Indeed, note that since $b(x, [x, x']) = 0$ for all $x, x' \in \mathfrak{g}_1$, the trilinear form $(x, x', x'') \in \mathfrak{g}_1 \times \mathfrak{g}_1 \times \mathfrak{g}_1 \mapsto b(x, [x', x''])$ is alternating and therefore $b(x_3, [x_1, x_2]) = -b(x_2, [x_1, x_3]) = b(x_1, [x_2, x_3]) = 1$. Now let $s_1, s_2, s_3 \in \mathbb{R}$ be such that $s_3[x_1, x_2] + s_2[x_1, x_3] + s_1[x_2, x_3] = 0$. For $i \in \{1, 2, 3\}$, we have $b(x_i, s_3[x_1, x_2] + s_2[x_1, x_3] + s_1[x_2, x_3]) = s_i b(x_i, [x_k, x_l]) = 0$ where $k < l$ and $\{k, l\} = \{1, 2, 3\} \setminus \{i\}$. Since $b(x_i, [x_k, x_l]) \neq 0$ for such indices $i, k, l$, it follows that $s_1 = s_2 = s_3 = 0$, which concludes the proof of the lemma. $\square$
We stress that *I*-null step-2 Carnot algebras may have Lie subalgebras isomorphic to $f_3$, as shown in the following two examples.

**Example 5.9** [The quaternionic Heisenberg algebra.] Let $i, j, k$ denote the quaternion units satisfying $i^2 = j^2 = k^2 = ijk = -1$ and denote by $\mathcal{H} := \{q_1+iq_2+jq_3+kq_4 : q_i \in \mathbb{R}\}$ the set of quaternions. Given $q = q_1 + iq_2 + jq_3 + kq_4 \in \mathcal{H}$, denote by $\mathrm{Im} \, q := iq_2+jq_3+kq_4$ its imaginary part and $\overline{q} := q_1-iq_2-jq_3-kq_4$ its conjugate. Equip $\mathcal{H} \oplus \mathrm{Im} \, \mathcal{H}$ with the Lie bracket for which the only nontrivial relations are given by $[q, q'] := \mathrm{Im}(\overline{q}q')$ for $q, q' \in \mathcal{H}$ which makes $\mathcal{H} \oplus \mathrm{Im} \, \mathcal{H}$ a step-2 Carnot algebra that is well known to be of Heisenberg type, and therefore of Métivier's type (see for instance [9]). Therefore, we have $\mathrm{Aff}_h(\mathcal{H} \oplus \mathrm{Im} \, \mathcal{H}) = \mathrm{Aff}(\mathcal{H} \oplus \mathrm{Im} \, \mathcal{H})$ and $\mathcal{H} \oplus \mathrm{Im} \, \mathcal{H}$ is *I*-null by Proposition 5.2. We now claim that the Lie subalgebra of $\mathcal{H} \oplus \mathrm{Im} \, \mathcal{H}$ generated by any three linearly independent elements in $\mathcal{H}$ is isomorphic to $f_3$. Indeed, for $q, q' \in \mathcal{H}$, we have $[q, q'] = 0$ if and only if $q$ and $q'$ are colinear. This indeed follows from the fact that for $q \in \mathcal{H} \setminus \{0\}$, the linear map $\mathrm{ad}_q : q' \in \mathcal{H} \mapsto [q, q'] \in \mathrm{Im} \, \mathcal{H}$ is surjective with $q \in \mathrm{Ker} \, \mathrm{ad}_q$, together with the fact that $\dim \mathcal{H} = 4$ and $\dim \mathrm{Im} \, \mathcal{H} = 3$. Then let $q_1, q_2, q_3 \in \mathcal{H}$ be linearly independent and assume by contradiction that $\dim \mathrm{span}\{[q_i, q_j] : i, j \in \{1, 2, 3\}\} \le 2$. Exchanging the role of $q_1, q_2, q_3$ if necessary, there are $s, t \in \mathbb{R}$ such that $[q_2, q_3] = s[q_1, q_2] + t[q_1, q_3]$. Then $[q_2 - tq_1, sq_1 + q_3] = 0$ which implies that $q_2 - tq_1$ and $sq_1 + q_3$ are colinear and contradicts the fact that $q_1, q_2, q_3$ are linearly independent. Therefore $\dim \mathrm{span}\{[q_i, q_j] : i, j \in \{1, 2, 3\}\} = 3$ and the Lie subalgebra generated by $q_1, q_2, q_3$ is isomorphic to $f_3$, as claimed.

**Example 5.10** Let $\mathfrak{g} := f_4/i$ where $i := \mathrm{span}\{e^{12} + e^{34}\}$ be the *I*-null step-2 Carnot algebra given by Example 5.3. We claim that the Lie subalgebra of $\mathfrak{g}$ generated by any three linearly independent elements in $\Lambda^1\mathbb{R}^4$ is isomorphic to $f_3$. Indeed let $\pi : f_4 \to \mathfrak{g}$ denote the quotient map. Let $\theta_1, \theta_2, \theta_3 \in \Lambda^1\mathbb{R}^4$ be linearly independent and let $a, b, c \in \mathbb{R}$ be such that $a\pi(\theta_1 \wedge \theta_2) + b\pi(\theta_1 \wedge \theta_3) + c\pi(\theta_2 \wedge \theta_3) = 0$, i.e., $a\theta_1 \wedge \theta_2 + b\theta_1 \wedge \theta_3 + c\theta_2 \wedge \theta_3 \in \mathrm{Ker} \, \pi$. We have $(a\theta_1 \wedge \theta_2 + b\theta_1 \wedge \theta_3 + c\theta_2 \wedge \theta_3)^2 = 0$ while $\mathrm{Ker} \, \pi = \mathrm{span}\{e^{12} + e^{34}\}$ with $(e^{12} + e^{34})^2 \ne 0$. It follows that $a\theta_1 \wedge \theta_2 + b\theta_1 \wedge \theta_3 + c\theta_2 \wedge \theta_3 = 0$ and hence $a = b = c = 0$. This proves that $\dim \mathrm{span}\{\pi(\theta_i \wedge \theta_j) : i, j \in \{1, 2, 3\}\} = 3$ and therefore the Lie subalgebra of $\mathfrak{g}$ generated by $\theta_1, \theta_2, \theta_3$ is isomorphic to $f_3$, as claimed.

Theorem 1.4 (i)–(iv) together with Proposition 5.8 has the following immediate consequence.

**Proposition 5.11** Let $\mathfrak{g}$ be a step-2 Carnot algebra with $\dim \mathfrak{g}_2 \le 2$. Then $\mathrm{Aff}_h(\mathfrak{g}) = \mathrm{Aff}(\mathfrak{g})$.

If $\mathrm{rank} \, \mathfrak{g} = \dim \mathfrak{g}_2 = 3$ then $\mathfrak{g}$ is isomorphic to $f_3$ and therefore $\mathrm{Aff}(\mathfrak{g}) \subsetneq \mathrm{Aff}_h(\mathfrak{g})$. This fact generalizes to higher rank step-2 Carnot algebras $\mathfrak{g}$ with $\dim \mathfrak{g}_2 = 3$ in the following way.

**Proposition 5.12** Let $\mathfrak{g}$ be a step-2 Carnot algebra with $\dim \mathfrak{g}_2 = 3$. Then $\mathrm{Aff}_h(\mathfrak{g}) = \mathrm{Aff}(\mathfrak{g})$ if and only if $\mathfrak{g}$ is not isomorphic to $f_3 \times \mathbb{R}^d$ for some non-negative integer $d$.
**Proof** If $\mathfrak{g}$ is isomorphic to the direct product $f_3 \times \mathbb{R}^d$ for some non-negative integer $d$ then $\mathfrak{g}$ has $f_3$ as one of its quotients and we know by Corollary 5.5 that $\mathrm{Aff}(\mathfrak{g}) \subsetneq \mathrm{Aff}_h(\mathfrak{g})$. Conversely, assume that $\mathrm{Aff}(\mathfrak{g}) \subsetneq \mathrm{Aff}_h(\mathfrak{g})$. First, if rank $\mathfrak{g} = 3$, since $\dim \mathfrak{g}_2 = 3$, then $\mathfrak{g}$ is isomorphic to $f_3$. Next, assume that $r := \mathrm{rank} \mathfrak{g} \ge 4$. By Proposition 5.8, there are $x_1, x_2, x_3 \in \mathfrak{g}_1$ generating a Lie subalgebra of $\mathfrak{g}$ isomorphic to $f_3$ and there is a bilinear form $b : \mathfrak{g}_1 \times \mathfrak{g}_2 \to \mathbb{R}$ such that $b(x, [x, x']) = 0$ for all $x, x' \in \mathfrak{g}_1$ and $b(x_1, [x_2, x_3]) = 1$. Set $V := \mathrm{span}\{x_1, x_2, x_3\}$. We claim that for every $x \in \mathfrak{g}_1 \setminus V$, there is $x' \in V$ such that $x + x'$ lies in the center of $\mathfrak{g}$, i.e., $[y, x + x'] = 0$ for all $y \in \mathfrak{g}_1$. To prove this claim, let $x \in \mathfrak{g}_1 \setminus V$ be given. Since $\dim \mathfrak{g}_2 = 3 = \dim \mathrm{span}\{[x_i, x_j] : 1 \le i < j \le 3\}$, there are $x_i^j \in \mathbb{R}, i, j \in \{1, 2, 3\}$, such that $[x_j, x] = x_3^j [x_1, x_2] - x_2^j [x_1, x_3] + x_1^j [x_2, x_3]$ for $j \in \{1, 2, 3\}$. Set $x' := x_3^2 x_1 + x_1^3 x_2 + x_2^1 x_3$ and let us verify that $x+x' \in \mathrm{Center}(\mathfrak{g})$. We first verify that $[x_j, x+x'] = 0$ for $j \in \{1, 2, 3\}$. Since $b(x, [x, x']) = 0$ for all $x, x' \in \mathfrak{g}_1$, the bilinear form $(y, y') \in V \times V \mapsto b(y, [y', x])$ is skew-symmetric. For $y = \sum_{1 \le i \le 3} \alpha_i x_i \in V$ and $y' = \sum_{1 \le j \le 3} \beta_j x_j \in V$, we have $b(y, [y', x]) = \sum_{1 \le i, j \le 3} x_i^j \alpha_i \beta_j$. By skew-symmetry, we get $x_i^j = -x_j^i$ for $i, j \in \{1, 2, 3\}$ and it follows that $[x_j, x+x'] = 0$ for $j \in \{1, 2, 3\}$. Now let $y \in \mathfrak{g}_1$ and write $[y, x+x'] = s_3[x_1, x_2] - s_2[x_1, x_3] + s_1[x_2, x_3]$ with $s_i \in \mathbb{R}$. Since the trilinear form $b(\cdot, \cdot, \cdot)$ is alternating, we have $b(x_i, [y, x+x']) = s_i$. On the other hand, $b(x_i, [y, x+x']) = -b(y, [x_i, x+x']) = 0$. Hence $s_i = 0$ for $i \in \{1, 2, 3\}$ and therefore $[y, x+x'] = 0$, as wanted. It now clearly follows from this claim that one can complete $(x_1, x_2, x_3)$ into a basis $(x_1, \dots, x_r)$ of $\mathfrak{g}_1$ in such a way that $x_4, \dots, x_r \in \mathrm{Center}(\mathfrak{g})$, i.e., $\mathfrak{g}$ is isomorphic to $f_3 \times \mathbb{R}^{r-3}$. $\square$

To conclude this section, let us remark that a h-affine function defined on a Lie subalgebra of a step-2 Carnot algebra may not admit a h-affine extension to the whole algebra. Indeed, let $\mathfrak{g}$ be a step-2 Carnot algebra such that $\mathrm{Aff}_h(\mathfrak{g}) = \mathrm{Aff}(\mathfrak{g})$ and such that there is a Lie subalgebra $f$ of $\mathfrak{g}$ isomorphic to $f_3$, see Examples 5.9 and 5.10. Then $\mathrm{Aff}(f) \subsetneq \mathrm{Aff}_h(f)$ and therefore there is $h \in \mathrm{Aff}_h(f) \setminus \mathrm{Aff}(f)$. Assume there is $\bar{h} \in \mathrm{Aff}_h(\mathfrak{g})$ whose restriction to $f$ is $h$. By assumption on $\mathfrak{g}$, we have $\bar{h} \in \mathrm{Aff}(\mathfrak{g})$. Since $f$ is a linear subspace of $\mathfrak{g}$, it follows that the restriction of $\bar{h}$ to $f$ is affine, i.e., $h \in \mathrm{Aff}(f)$, which gives a contradiction. Recall that on the contrary an affine function defined on an affine subspace of a vector space can always be extended to an affine function on the whole space.

# 6 Appendix About Linear and Exterior Algebra

We gather in this appendix some basic facts about linear and exterior algebra not pertaining to h-affine functions that have been used in the previous sections.

We start with a characterization of affine maps between real vector spaces whose elementary proof is left to the reader.

**Proposition 6.1** Let $E, F$ be real vector spaces. A map $f : E \to F$ is affine if and only if for every $x, y \in E$, the map $t \in \mathbb{R} \mapsto f(x + ty)$ is affine.
For the sake of completeness, we state below an elementary property of multiaffine functions that has been used in the proof of Proposition 3.4. The proof can easily be done by induction on the dimension and is left to the reader.

**Proposition 6.2** Let $p \ge 1$ be an integer and $E$ be a $p$-dimensional real vector space. Let $f : E \to \mathbb{R}$ and assume that there is a basis $(e_1, \dots, e_p)$ of $E$ such that the map $t \in \mathbb{R} \mapsto f(v + te_j)$ is affine for every $v \in E$ and $j \in \{1, \dots, p\}$. Then $f$ is a linear combination of the $u_j$, where $J$ ranges over the subsets of $\{1, \dots, p\}$ and $u_J(v) := \prod_{j \in J} v_j$ for $v = \sum_{j=1}^p v_j e_j$ with the convention $u_\emptyset(v) := 1$.

The rest of this appendix is devoted to (basic) facts about exterior algebra that have been used throughout this paper. Although some of them look quite elementary, we were, however, unable to find references in the literature and thus provide proofs for the reader's convenience.

Given integers $n \ge 1$ and $k \ge 1$, we denote by $\Lambda^k \mathbb{R}^n$ the set of alternating $k$-multilinear forms over $\mathbb{R}^n$. For $k = 0$, we set $\Lambda^0 \mathbb{R}^n := \mathbb{R}$. We denote by $\Lambda^* \mathbb{R}^n := \bigoplus_{k \ge 0} \Lambda^k \mathbb{R}^n$ the exterior algebra equipped with exterior product $\wedge$. We recall that $\Lambda^k \mathbb{R}^n = \{0\}$ if $k > n$. For $\zeta \in \Lambda^* \mathbb{R}^n$, we set $\zeta^0 := 1$ and $\zeta^k := \underbrace{\zeta \wedge \cdots \wedge \zeta}_{k \text{ times}}$ for $k \ge 1$.

**Lemma 6.3** For $n \ge 1$, we have in $\Lambda^* \mathbb{R}^n$

$$ \operatorname{span}\{\omega^k : \omega \in \Lambda^2 \mathbb{R}^n\} = \Lambda^{2k} \mathbb{R}^n, \quad (6.1) $$

$$ \operatorname{span}\{\theta \wedge \omega^k : \theta \in \Lambda^1 \mathbb{R}^n, \omega \in \Lambda^2 \mathbb{R}^n\} = \Lambda^{2k+1} \mathbb{R}^n \quad (6.2) $$

for all $k \ge 0$.

**Proof** We only need to consider the nontrivial cases where $n \ge 2$ and $1 \le k \le \lfloor n/2 \rfloor$. Then (6.1) and (6.2) follow from the identity

$$ (\theta_1 \wedge \theta_2 + \cdots + \theta_{2k-1} \wedge \theta_{2k})^k = k! \theta_1 \wedge \cdots \wedge \theta_{2k} \quad (6.3) $$

for all $\theta_1, \dots, \theta_{2k} \in \Lambda^1 \mathbb{R}^n$.

□

Given $n \ge 1$, we set $\mathcal{J}_0^n := \{\emptyset\}$,

$$ \mathcal{J}_k^n := \{(j_1, \dots, j_k) \in \mathbb{N}^k : 1 \le j_1 < \dots < j_k \le n\} \quad (6.4) $$

for $k \in \{1, \dots, n\}$, and $\mathcal{J}^n := \bigcup_{0 \le k \le n} \mathcal{J}_k^n$. We write $\operatorname{im} \emptyset := \emptyset$ and $\operatorname{im} J := \{j_1, \dots, j_k\} \subset \mathbb{N}$ for $J = (j_1, \dots, j_k) \in \mathcal{J}_k^n$. Given $J, J' \in \mathcal{J}^n$, we denote by $J \setminus J'$ the unique element in $\mathcal{J}^n$ such that $\operatorname{im}(J \setminus J') = \operatorname{im} J \setminus \operatorname{im} J'$ and we set $J^c := (1, \dots, n) \setminus J$. We fix a basis $(e_1, \dots, e_n)$ of $\mathbb{R}^n$ and denote by $(e^1, \dots, e^n)$ its dual basis. For $J = (j_1, \dots, j_k) \in \mathcal{J}_k^n$, we set $e^J := e^{j_1} \wedge \cdots \wedge e^{j_k} \in \Lambda^k \mathbb{R}^n$ with the convention $e^\emptyset := 1$.
The space of exterior annihilators of an element in $\Lambda^i\mathbb{R}^n$ of some given order $k$ has been introduced in [7], see also [6, Section 2.2]. More generally, given $n \ge 1$, $k \ge 0$, and $A \subset \Lambda^*\mathbb{R}^n$, we define the annihilator of $A$ in $\Lambda^*\mathbb{R}^n$, respectively, $\Lambda^k\mathbb{R}^n$, as

$$ \mathrm{Anh}A := \{\eta \in \Lambda^*\mathbb{R}^n : \eta \wedge \zeta = 0 \text{ for all } \zeta \in A\}, \quad (6.5) $$

$$ \mathrm{Anh}^k A := \Lambda^k \mathbb{R}^n \cap \mathrm{Anh} A. \quad (6.6) $$

We also set $\Lambda^{\ge k}\mathbb{R}^n := \bigoplus_{i \ge k} \Lambda^i \mathbb{R}^n$.

**Lemma 6.4** For $n \ge 1$, $k \in \{0, \dots, n\}$, we have $\mathrm{Anh}\Lambda^k\mathbb{R}^n = \Lambda^{\ge n-k+1}\mathbb{R}^n$.

*Proof* For $k=0$, we clearly have $\mathrm{Anh}\Lambda^0\mathbb{R}^n = \{0\} = \Lambda^{\ge n+1}\mathbb{R}^n$. Let $n \ge 1$ and $k \in \{1, \dots, n\}$ be given. Clearly $\Lambda^{\ge n-k+1}\mathbb{R}^n \subset \mathrm{Anh}\Lambda^k\mathbb{R}^n$. Since $\mathrm{Anh}\Lambda^k\mathbb{R}^n$ is graded, i.e., $\mathrm{Anh}\Lambda^k\mathbb{R}^n = \bigoplus_{i \ge 0} \mathrm{Anh}^i\Lambda^k\mathbb{R}^n$ (see Lemma 6.8), if equality fails then $\mathrm{Anh}^i\Lambda^k\mathbb{R}^n \ne \{0\}$ for some $i \in \{0, \dots, n-k\}$. Let $\eta \in \mathrm{Anh}^i\Lambda^k\mathbb{R}^n \setminus \{0\}$ and $J = (j_1, \dots, j_i) \in \mathcal{J}_i^n$ be such that $\eta(e_{j_1}, \dots, e_{j_i}) \ne 0$. Then $\eta \wedge e^{J_i} = \eta(e_{j_1}, \dots, e_{j_i}) e^J \wedge e^{J_i} \ne 0$. However, we can write $e^{J_i} = e^{J_1} \wedge e^{J_2}$ for some $J_1 \in \mathcal{J}_k^n, J_2 \in \mathcal{J}_{n-i-k}^n$, and since $\eta \in \mathrm{Anh}\Lambda^k\mathbb{R}^n$, we get $\eta \wedge e^{J_i} = 0$, which gives a contradiction. $\square$

Writing $\mathcal{F}(A, B)$ to denote the set of maps $f: A \to B$ we deduce from Lemmas 6.3 and 6.4 the following corollary.

**Corollary 6.5** For $k \in \{0, \dots, \lfloor n/2 \rfloor\}$, the linear map $\Lambda^{n-2k}\mathbb{R}^n \to \mathcal{F}(\Lambda^2\mathbb{R}^n, \Lambda^n\mathbb{R}^n)$ given by $\eta \mapsto (\omega \mapsto \omega^k \wedge \eta)$ is injective. For $k \in \{0, \dots, \lfloor (n-1)/2 \rfloor\}$, the linear map $\Lambda^{n-2k-1}\mathbb{R}^n \to \mathcal{F}(\Lambda^1\mathbb{R}^n \times \Lambda^2\mathbb{R}^n, \Lambda^n\mathbb{R}^n)$ given by $\eta \mapsto ((\theta, \omega) \mapsto \theta \wedge \omega^k \wedge \eta)$ is injective.

*Proof* By linearity we only need to verify that these maps have trivial kernel. Let $k \in \{0, \dots, \lfloor n/2 \rfloor\}$ and $\eta \in \Lambda^{n-2k}\mathbb{R}^n$ be such that $\omega^k \wedge \eta = 0$ for all $\omega \in \Lambda^2\mathbb{R}^n$. On the one hand, by (6.1) we have $\eta \in \mathrm{Anh}^{n-2k}\Lambda^{2k}\mathbb{R}^n$. On the other hand, by Lemma 6.4, we have $\mathrm{Anh}^{n-2k}\Lambda^{2k}\mathbb{R}^n = \{0\}$. Therefore $\eta = 0$. Similarly, for $k \in \{0, \dots, \lfloor (n-1)/2 \rfloor\}$ and $\eta \in \Lambda^{n-2k-1}\mathbb{R}^n$ such that $\theta \wedge \omega^k \wedge \eta = 0$ for all $(\theta, \omega) \in \Lambda^1\mathbb{R}^n \times \Lambda^2\mathbb{R}^n$, we have by (6.2) and Lemma 6.4 that $\eta \in \mathrm{Anh}^{n-2k-1}\Lambda^{2k+1}\mathbb{R}^n = \{0\}$. $\square$

The next proposition played a key role at the end of the proof of Proposition 3.5.

**Proposition 6.6** For $n \ge 1$ the following holds. Let $k \in \{1, \dots, n\}$ and $\bar{\eta} : \Lambda^1\mathbb{R}^n \to \Lambda^k\mathbb{R}^n$ be linear. Assume that $\theta \wedge \bar{\eta}(\theta) = 0$ for all $\theta \in \Lambda^1\mathbb{R}^n$. Then there is $\eta \in \Lambda^{k-1}\mathbb{R}^n$ such that $\bar{\eta}(\theta) = \theta \wedge \eta$ for all $\theta \in \Lambda^1\mathbb{R}^n$.

*Proof* When $k=n$ every map $\bar{\eta} : \Lambda^1\mathbb{R}^n \to \Lambda^n\mathbb{R}^n$ satisfies the assumption $\theta \wedge \bar{\eta}(\theta) = 0$ for all $\theta \in \Lambda^1\mathbb{R}^n$. If $\bar{\eta} : \Lambda^1\mathbb{R}^n \to \Lambda^n\mathbb{R}^n$ is in addition assumed to be linear and $\eta_j \in \mathbb{R}$ is such that $\bar{\eta}(e^j) = \eta_j e^{(1, \dots, n)}$, then $\bar{\eta}(\theta) = \theta \wedge \eta$ for all $\theta \in \Lambda^1\mathbb{R}^n$ where $\eta := \sum_{j=1}^n \sigma_j \eta_j e^{(1, \dots, n)\setminus(j)}$ and $\sigma_j \in \{-1, 1\}$ is such that $e^{(1, \dots, n)} = \sigma_j e^j \wedge e^{(1, \dots, n)\setminus(j)}$.

Let us now argue by induction on $n$. First, if $n=1$, the conclusion follows from the previous remark. Next, let $n \ge 2$. By the previous remark, we only need to consider the case where $k \in \{1, \dots, n-1\}$. By linearity of $\bar{\eta}$, we only need to
prove that there is $\eta \in \Lambda^{k-1}\mathbb{R}^n$ such that $\bar{\eta}(e^j) = e^j \wedge \eta$ for $j \in \{1, \dots, n\}$. Set $V_j := \{x \in \mathbb{R}^n : e^j(x) = 0\}$ for $j \in \{1, \dots, n\}$.

For $j \in \{1, \dots, n-1\}$, since $e^j \wedge \bar{\eta}(e^j) = 0$, we can write $\bar{\eta}(e^j) = e^j \wedge \eta_j$ for some $\eta_j \in \Lambda^{k-1}V_j$. Next, write $\eta_j = \tau_j \wedge e^n + \zeta_j$ for some $\tau_j \in \Lambda^{k-2}V_n$ and $\zeta_j \in \Lambda^{k-1}V_n$ (when $k=1$, $\tau_j=0$). Define $\bar{\tau} : \Lambda^1 V_n \to \Lambda^{k-1}V_n$ and $\bar{\zeta} : \Lambda^1 V_n \to \Lambda^k V_n$ to be linear and such that $\bar{\tau}(e^j) = e^j \wedge \tau_j$ and $\bar{\zeta}(e^j) = e^j \wedge \zeta_j$ for all $j \in \{1, \dots, n-1\}$. For $\theta \in \Lambda^1 V_n$, we have $\bar{\eta}(\theta) = \bar{\tau}(\theta) \wedge e^n + \bar{\zeta}(\theta)$. Thus $\theta \wedge \bar{\eta}(\theta) = \theta \wedge \bar{\tau}(\theta) \wedge e^n + \theta \wedge \bar{\zeta}(\theta) = 0$ for all $\theta \in \Lambda^1 V_n$ and this implies in turn that $\theta \wedge \bar{\tau}(\theta) = 0$ and $\theta \wedge \bar{\zeta}(\theta) = 0$ for all $\theta \in \Lambda^1 V_n$. By induction, there are $\tau \in \Lambda^{k-2}V_n$ (again $\tau=0$ when $k=1$) and $\zeta \in \Lambda^{k-1}V_n$ such that $\bar{\tau}(\theta) = \theta \wedge \tau$ and $\bar{\zeta}(\theta) = \theta \wedge \zeta$ for all $\theta \in \Lambda^1 V_n$. It follows that $\bar{\eta}(\theta) = \theta \wedge (\tau \wedge e^n + \zeta)$ for all $\theta \in \Lambda^1 V_n$. We set $\eta := \tau \wedge e^n + \zeta \in \Lambda^{k-1}\mathbb{R}^n$. To conclude the proof of the proposition, it remains to verify that $\bar{\eta}(e^n) = e^n \wedge \eta$. Since $1 \le k \le n-1$, this is equivalent to showing that $e^j \wedge \bar{\eta}(e^n) = e^j \wedge e^n \wedge \eta$ for all $j \in \{1, \dots, n\}$, see Lemma 6.4. By assumption, we have $\theta \wedge \bar{\eta}(\theta) = 0$ for all $\theta \in \Lambda^1\mathbb{R}^n$ and therefore $\theta \wedge \bar{\eta}(\theta') + \theta' \wedge \bar{\eta}(\theta) = 0$ for all $\theta, \theta' \in \Lambda^1\mathbb{R}^n$. It follows that $e^j \wedge \bar{\eta}(e^n) = -e^n \wedge \bar{\eta}(e^j) = -e^n \wedge e^j \wedge \eta = e^j \wedge e^n \wedge \eta$ for $j \in \{1, \dots, n-1\}$. Since $e^n \wedge \bar{\eta}(e^n) = 0 = e^n \wedge e^n \wedge \eta$, we finally get $\bar{\eta}(e^n) = e^n \wedge \eta$, and this concludes the proof of the proposition. $\square$

Recall that a graded ideal $\mathfrak{I}$ of $\mathfrak{A}$ can be seen as a linear subspace of $\Lambda^*\mathfrak{A}^n$ of the form $\mathfrak{I} = \mathfrak{I}_1 \oplus \mathfrak{I}_2$ where $\mathfrak{I}_1, \mathfrak{I}_2$ are linear subspaces of, respectively, $\Lambda^1\mathfrak{A}^n, \Lambda^2\mathfrak{A}^n$ such that $\mathfrak{I} \wedge \mathfrak{I}' \in \mathfrak{I}$ for all $\mathfrak{I} \in \Lambda^1\mathfrak{A}^n, \mathfrak{I}' \in \mathfrak{I}$. The structure of annihilators of such subsets of $\Lambda^*\mathfrak{A}^n$, and in particular Corollary 6.9 and Lemma 6.10, played a major role in Sect. 4. Before proving Corollary 6.9 and Lemma 6.10, we first state two elementary lemmas. The easy proof of Lemma 6.7 is left to the reader.

**Lemma 6.7** Let $V, W$ be linear subspaces of $\Lambda^*\mathbb{R}^n$ that are in direct sum. Then $\mathrm{Anh}(V \oplus W) = \mathrm{Anh}V \cap \mathrm{Anh}W$ and $\mathrm{Anh}^k(V \oplus W) = \mathrm{Anh}^kV \cap \mathrm{Anh}^kW$ for all $k \ge 0$.

**Lemma 6.8** Let $n \ge 1$, $j \ge 0$, $A \subset \Lambda^j\mathbb{R}^n$. Then $\mathrm{Anh}A = \bigoplus_{k \ge 0} \mathrm{Anh}^k A$.

*Proof* Clearly, $\bigoplus_{k \ge 0} \mathrm{Anh}^k A \subset \mathrm{Anh}A$. Conversely, let $\eta = \sum_{k=0}^n \eta_k \in \mathrm{Anh}A$ where $\eta_k \in \Lambda^k\mathbb{R}^n$. For $a \in A$, we have $\sum_{k=0}^n \eta_k \wedge a = 0$ with $\eta_k \wedge a \in \Lambda^{k+j}\mathbb{R}^n$ therefore $\eta_k \wedge a = 0$ for all $k \in \{0, \dots, n\}$. Since this holds true for all $a \in A$, we get that $\eta_k \in \mathrm{Anh}^k A$ for all $k \in \{0, \dots, n\}$, and therefore $\eta \in \bigoplus_{k \ge 0} \mathrm{Anh}^k A$. $\square$

**Corollary 6.9** Let $i_1, i_2$ be linear subspaces of, respectively, $\Lambda^1\mathbb{R}^n, \Lambda^2\mathbb{R}^n$. Then $\mathrm{Anh}(i_1 \oplus i_2) = \bigoplus_{k \ge 0} \mathrm{Anh}^k(i_1 \oplus i_2)$.

*Proof* By Lemmas 6.7 and 6.8, we have

$$ \begin{aligned} \mathrm{Anh}(i_1 \oplus i_2) &= \mathrm{Anh}_{i_1} \cap \mathrm{Anh}_{i_2} = (\bigoplus_{k \ge 0} \mathrm{Anh}^k i_1) \cap (\bigoplus_{k \ge 0} \mathrm{Anh}^k i_2) \\ &= \bigoplus_{k \ge 0} \mathrm{Anh}^k i_1 \cap \mathrm{Anh}^k i_2 = \bigoplus_{k \ge 0} \mathrm{Anh}^k (i_1 \oplus i_2). \end{aligned} $$

$\square$
**Lemma 6.10** Let $n \ge 2$, $i_1, i_2$ be linear subspaces of, respectively, $\Lambda^1\mathbb{R}^n$, $\Lambda^2\mathbb{R}^n$ such that $\theta \wedge \theta' \in i_2$ for all $\theta \in \Lambda^1\mathbb{R}^n$, $\theta' \in i_1$. Then

$$ \mathrm{Anh}^n(i_1 \oplus i_2) = \Lambda^n \mathbb{R}^n, \qquad (6.7) $$

$$ \mathrm{Anh}^{n-1}(i_1 \oplus i_2) = \mathrm{Anh}^{n-1}i_1, \qquad (6.8) $$

$$ \mathrm{Anh}^{n-i}(i_1 \oplus i_2) = \mathrm{Anh}^{n-i}i_2 \quad \text{for } i \in \{2, \dots, n\}. \qquad (6.9) $$

**Proof** Clearly, $\mathrm{Anh}^n A = \Lambda^n \mathbb{R}^n$ for all $A \subset \Lambda^{\ge 1} \mathbb{R}^n$ and (6.7) follows. By Lemma 6.7, we have $\mathrm{Anh}^{n-1}(i_1 \oplus i_2) = \mathrm{Anh}^{n-1}i_1 \cap \mathrm{Anh}^{n-1}i_2$. For $A \subset \Lambda^{\ge 2} \mathbb{R}^n$, we have $\mathrm{Anh}^{n-1}A = \Lambda^{n-1}\mathbb{R}^n$ therefore $\mathrm{Anh}^{n-1}i_2 = \Lambda^{n-1}\mathbb{R}^n$ and (6.8) follows. For $i \in \{2, \dots, n\}$, clearly $\mathrm{Anh}^{n-i}(i_1 \oplus i_2) \subset \mathrm{Anh}^{n-i}i_2$. Conversely, let $\eta \in \mathrm{Anh}^{n-i}i_2$ and $\theta \in i_1$. By assumption, $\theta \wedge \theta' \in i_2$ for all $\theta' \in \Lambda^1\mathbb{R}^n$. Therefore $\eta \wedge \theta \wedge \theta' = 0$ for all $\theta' \in \Lambda^1\mathbb{R}^n$, i.e., $\eta \wedge \theta \in \mathrm{Anh}^{n-i+1}\Lambda^1\mathbb{R}^n = \Lambda^{n-i+1}\mathbb{R}^n \cap \Lambda^{\ge n}\mathbb{R}^n$, where the last equality follows from Lemma 6.4. Since $i \in \{2, \dots, n\}$, we have $n-i+1 \le n-1$, therefore $\Lambda^{n-i+1}\mathbb{R}^n \cap \Lambda^{\ge n}\mathbb{R}^n = \{0\}$ and hence $\eta \wedge \theta = 0$. Since this holds true for all $\theta \in i_1$, we get that $\eta \in \mathrm{Anh}^{n-i}i_1 \cap \mathrm{Anh}^{n-i}i_2 = \mathrm{Anh}^{n-i}(i_1 \oplus i_2)$, where the last equality comes from Lemma 6.7 and concludes the proof of (6.9). $\square$

We end this section with an observation that has been useful for our purposes in Remark 4.3 and Sect. 5.

**Lemma 6.11** Let $n \ge 1$, $k \in \{0, \dots, n\}$, $A \subset \Lambda^*\mathbb{R}^n$ be such that $\mathrm{Anh}^k A = \{0\}$. Then $\mathrm{Anh}^j A = \{0\}$ for all $j \in \{0, \dots, k\}$.

**Proof** Let $j \in \{0, \dots, k\}$, $\eta \in \mathrm{Anh}^j A$. For all $\zeta \in \Lambda^{k-j}\mathbb{R}^n$, $a \in A$, we have $\zeta \wedge \eta \wedge a = 0$, i.e., $\zeta \wedge \eta \in \mathrm{Anh}^k A$. Since $\mathrm{Anh}^k A = \{0\}$, it follows that $\eta \in \mathrm{Anh}^j \Lambda^{k-j}\mathbb{R}^n = \Lambda^j \mathbb{R}^n \cap \Lambda^{\ge n-k+j+1}\mathbb{R}^n$, where the last equality follows from Lemma 6.4. Since $n-k \ge 0$, we have $n-k+j+1 \ge j+1$, therefore $\Lambda^j \mathbb{R}^n \cap \Lambda^{\ge n-k+j+1}\mathbb{R}^n = \{0\}$ and hence $\mathrm{Anh}^j A = \{0\}$. $\square$

**Acknowledgements** The authors are grateful to an anonymous reader of a previous version of this paper for valuable comments and remarks that helped them to improve and simplify the exposition.

**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/.

## References

1. Antonelli, G., Le Donne, E.: Polynomial and horizontally polynomial functions on Lie groups. Ann. Mat. Pura Appl. (4) **201**(5), 2063–2100 (2022)
2. Bellettini, C., Le Donne, E.: Regularity of sets with constant horizontal normal in the Engel group. Commun. Anal. Geom. 21(3), 469–507 (2013)

3. Bellettini, C., Le Donne, E.: Sets with constant normal in Carnot groups: properties and examples. Comment. Math. Helv. 96(1), 149–198 (2021)

4. Cheeger, J., Kleiner, B., Naor, A.: Compression bounds for Lipschitz maps from the Heisenberg group to $L_1$. Acta Math. 207(2), 291–373 (2011)

5. Cheeger, J., Kleiner, B.: Metric differentiation, monotonicity and maps to $L^1$. Invent. Math. 182(2), 335–370 (2010)

6. Csató, G., Dacorogna, B., Kneuss, O.: The Pullback Equation for Differential Forms, Progress in Nonlinear Differential Equations and their Applications, vol. 83. Birkhäuser/Springer, New York (2012)

7. Dacorogna, B., Kneuss, O.: Divisibility in Grassmann algebra. Linear Multilinear Algebra 59(11), 1201–1220 (2011)

8. Fässler, K., Orponen, T., Rigot, S.: Semmes surfaces and intrinsic Lipschitz graphs in the Heisenberg group. Trans. Am. Math. Soc. 373(8), 5957–5996 (2020)

9. Kaplan, A.: Fundamental solutions for a class of hypoelliptic PDE generated by composition of quadratic forms. Trans. Am. Math. Soc. 258(1), 147–153 (1980)

10. Le Donne, E.: A primer on Carnot groups: homogenous groups, Carnot-Carathéodory spaces, and regularity of their isometries. Anal. Geom. Metr. Spaces 5(1), 116–137 (2017)

11. Magnin, L.: On $\mathcal{T}$-null Lie algebras. Rev. Un. Mat. Argentina 53(2), 37–58 (2012)

12. Morbidelli, D.: On the inner cone property for convex sets in two-step Carnot groups, with applications to monotone sets. Publ. Mat. 64(2), 391–421 (2020)

13. Morbidelli, D., Rigot, S.: Precisely monotone sets in step-2 rank-3 Carnot algebras. Math. Z. 303(3) (2023), 54

14. Naor, A., Young, R.: Vertical perimeter versus horizontal perimeter. Ann. Math. (2) 188(1), 171–279 (2018)

15. Rickly, M.: First-order regularity of convex functions on Carnot groups. J. Geom. Anal. 16(4), 679–702 (2006)

16. Serra Cassano, F.: Some Topics of Geometric Measure Theory in Carnot Groups, Geometry, Analysis and Dynamics on Sub-Riemannian Manifolds, vol. 1, pp. 1–121. EMS Ser. Lect. Math., Eur. Math. Soc., Zürich (2016)

17. Varopoulos, N.T., Saloff-Coste, L., Coulhon, T.: Analysis and Geometry on Groups, Cambridge Tracts in Mathematics, vol. 100. Cambridge University Press, Cambridge (1992)

18. Young, R.: Area-minimizing ruled graphs and the Bernstein problem in the Heisenberg group. Calc. Var. Partial Differ. Equ. 61(4), 142,32 (2022)

**Publisher's Note** Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.