Four-dimensional pp-wave Lie groups and harmonic curvature Thanks: Data Availability Statement : The data that support the findings of this study are available from the corresponding author upon reasonable request. Thanks: Funding Statement : Supported by projects PID2022-138988NB-I00 (AEI/FEDER, Spain) and ED431C 2023/31 (Xunta de Galicia, Spain). E. García-Río, R. Rodríguez-Gigirey, R. Vázquez-Lorenzo Abstract . We determine all four-dimensional Lie groups which have harmonic curvature. As a consequence, a description of four-dimensional pp-wave Lie groups is obtained. 1. Introduction A pseudo-Riemannian manifold (M,g) has harmonic Weyl curvature tensor if its Weyl tensor is divergence-free, i.e., \operatorname{div}W=0 , or equivalently the Cotton tensor vanishes. Since Einstein metrics have harmonic Weyl tensor, the condition \operatorname{div}W=0 has been extensively investigated in order to extend geometric properties of Einstein metrics to more general contexts. Trivially any pseudo-Riemannian manifold with parallel Ricci tensor has harmonic Weyl tensor, as well as locally conformally flat manifolds. It follows from [ 12 , 24 ] that the converse is also true in the four-dimensional homogeneous Riemannian setting. Moreover, harmonicity of the Weyl tensor is equivalent to harmonicity of the curvature tensor, \operatorname{div}R=0 , if the scalar curvature is constant. Plane fronted waves with parallel propagation rays (pp-waves) are a special class of Lorentzian manifolds which provides the simplest mathematical family of exact solutions of Einstein’s field equations. Plane waves are a particular class of pp-waves which includes gravitational plane waves as vacuum ones. Since their introduction by Brinkmann in [ 6 ] , pp-waves have appeared many times as solutions in problems motivated by either physical or purely geometrical questions. From the point of view of their curvature, pp-waves are the simplest non-flat Lorentzian manifolds since both the Ricci operator and the Weyl curvature operator are two-step nilpotent. Furthermore, while plane waves have harmonic Weyl tensor, pp-waves are not Cotton-flat in the generic situation. Due to the special geometrical significance of pp-waves, our first purpose in this work is to describe all non-flat left-invariant pp-wave metrics on four-dimensional Lie groups in Theorem 1.1 . With this description at hand, we finally determine all non-trivial four-dimensional Lie groups with harmonic curvature. A remarkable consequence of Theorem 1.2 is the existence of a single family of four-dimensional Lorentzian Lie groups with harmonic curvature whose Ricci tensor is not parallel and which are neither locally conformally flat nor plane waves. 1.1. pp-wave and plane wave Lorentzian manifolds A Lorentzian manifold (M,g) admitting a parallel degenerate line field \mathcal{U} is said to be a pp-wave if the parallel line field is locally generated by a parallel null vector field U and (M,g) is transversally flat, i.e., R(X,Y)=0 for all X,Y\in\mathcal{U}^{\perp} . Any such Lorentzian four-manifold admits local coordinates (x^{+},x^{-},x^{1},x^{2}) so that g=2dx^{+}\circ dx^{-}+H(x^{+},x^{1},x^{2})dx^{+}\circ dx^{+}+dx^{1}\circ dx^{1}+dx^{2}\circ dx^{2}\,, where the degenerate parallel line field is generated by U=\partial_{x^{-}} . The Ricci tensor of a pp-wave is of rank-one with \rho({\partial x^{+}},{\partial x^{+}})=-\frac{1}{2}\Delta_{x}H , where \Delta_{x}=\partial^{2}_{x^{1}x^{1}}+\partial^{2}_{x^{2}x^{2}} is the space Laplacian. Hence the metric is Einstein (indeed Ricci-flat) if and only if the space Laplacian of H vanishes. As a general fact a four-dimensional pp-wave has harmonic curvature if and only if the defining function H satisfies \Delta_{x}H=\varphi(x^{+}) for some function \varphi(x^{+}) (see, for example [ 21 ] ). A pp-wave (M,g,\mathcal{U}) is a plane wave if the covariant derivative of the curvature tensor satisfies \nabla_{X}R\penalty\ =\penalty\ 0 for all X\in\mathcal{U}^{\perp} . In this case the local coordinates above can be specialized so that the function H is quadratic on the space coordinates and, moreover, one may assume H(x^{+},x^{1},x^{2})=a_{ij}(x^{+})x^{i}x^{j} , from where it immediately follows that plane waves have harmonic curvature. It is clear that any locally symmetric pp-wave is a plane wave. Moreover pp-waves reduce to plane waves under some geometrical conditions as, for instance, in the locally conformally flat situation. 1.2. Homogeneous setting Homogeneous pp-waves have been broadly investigated (see, for example, [ 15 ] and references therein). They reduce to plane waves in many cases, although the existence of pp-waves is allowed for instance in the reducible case. This is partially due to the three-dimensional situation. 1.2.1. Three-dimensional homogeneous pp-waves Locally homogeneous pp-waves in dimension three have been described in [ 13 ] . In local coordinates (x^{+},x^{-},x) they are given by g=2dx^{+}\circ dx^{-}+H(x^{+},x)dx^{+}\circ dx^{+}+dx\circ dx , where the function H(x^{+},x) corresponds to one of the following: (\mathcal{N}_{b}) : H(x^{+},x)=-2b^{-2}e^{bx} , where b\neq 0 , or (\mathcal{P}_{c}) : H(x^{+},x)=-\alpha(x^{+})x^{2} , where \alpha^{\prime}=c\alpha^{3/2} , c\neq 0 and \alpha>0 , or (\mathcal{CW}) : H(x^{+},x)=-2x^{2} . Metrics in classes (\mathcal{P}_{c}) and (\mathcal{CW}) are plane waves, the latter corresponding to the three-dimensional Cahen-Wallach symmetric space. In contrast, metrics (\mathcal{N}_{b}) are pp -waves but not plane waves. All these metrics are realized as left-invariant metrics on three-dimensional Lie groups. Indeed, a straightforward calculation shows that a non-flat three-dimensional Lorentzian Lie group is a pp-wave if and only if it is isomorphically homothetic to the left-invariant metric determined by one of the following Lorentzian Lie algebras (where we follow the notation in [ 3 ] ): (1) The Lie algebra \mathfrak{e}(1,1) with a Lorentzian metric described by [u_{1},u_{3}]=\lambda u_{1}+u_{2} , [u_{2},u_{3}]=-\lambda u_{2} , for any \lambda\in\mathbb{R} , \lambda\neq 0 . (2) The Lie algebra \mathfrak{e}(1,1) with a Lorentzian metric described by [u_{1},u_{2}]=u_{1} , [u_{2},u_{3}]=u_{3} . (3) The Lie algebra \mathfrak{r}_{3,\lambda} and Lorentzian metric described by [u_{1},u_{2}]=u_{2} , [u_{1},u_{3}]=\gamma u_{2}+\lambda u_{3} , for any \gamma,\lambda\in\mathbb{R} with \lambda(\lambda^{2}-1)\neq 0 . (4) The Lie algebra \mathfrak{r}_{3,0}=\mathfrak{aff}(\mathbb{R})\times\mathbb{R} with a Lorentzian metric described by [u_{1},u_{3}]=\gamma u_{2}+u_{3} , for any \gamma\in\mathbb{R} , where \{u_{i}\} is a pseudo-orthonormal basis with \langle u_{1},u_{2}\rangle=\langle u_{3},u_{3}\rangle=1 . Left-invariant metrics in class (1) are pp-waves corresponding to the local models (\mathcal{N}_{b}) , while those in (2) and (3) are non-symmetric plane waves locally modeled in (\mathcal{P}_{c}) . Finally left-invariant metrics in class (4) are Cahen-Wallach symmetric spaces corresponding to the model (\mathcal{CW}) . Since the connected and simply connected Lie group E(1,1) admits cocompact subgroups (see [ 5 ] ), one has that the pp-wave structure (1) descends to the quotient solvmanifold, thus providing compact homogeneous pp-waves which are not plane waves. 1.2.2. Four-dimensional homogeneous plane waves A complete description of four-dimensional homogeneous pp-waves is not yet available, although the plane wave case is well understood. Homogeneous plane waves in dimension four are described in terms of a 2\times 2 skew-symmetric matrix F and a 2\times 2 symmetric matrix A_{0} so that the defining function H(x^{+},x^{1},x^{2}) takes the form H=\vec{x}^{T}\,A(x^{+})\,\vec{x} , where \vec{x}=(x^{1},x^{2}) and the matrix A(x^{+}) is given by (see [ 4 ] ) (i)\,\,A(x^{+})=e^{x^{+}\,F}A_{0}e^{-x^{+}\,F},\quad\text{or}\quad(ii)\,\,A(x^{+})=\frac{1}{(x^{+})^{2}}e^{\log(x^{+})F}A_{0}e^{-\log(x^{+})F}\,. Moreover, the plane wave metric is Ricci-flat if and only if A_{0} is trace-free and locally conformally flat if A_{0} is a multiple of the identity. Note that four-dimensional homogeneous plane waves of types (i) and (ii) are different representatives of the same conformal class, since for any homogeneous plane wave g=2dx^{+}\circ dx^{-}+H(x^{+},\vec{x})dx^{+}\circ dx^{+}+\sum_{i}dx^{i}\circ dx^{i} of type (ii) with H(x^{+},\vec{x})=\vec{x}^{T}\,A(x^{+})\,\vec{x} determined by a symmetric matrix A_{0} , the change of variables x^{+}\mapsto e^{x^{+}} , x^{-}\mapsto x^{-}-\frac{1}{4}\sum(x^{i})^{2} , x^{i}\mapsto e^{\frac{1}{2}x^{+}}x^{i} , transforms the metric into a conformal one of the form \widetilde{g}=e^{x^{+}}\left(2dx^{+}\circ dx^{-}+\widetilde{H}(x^{+},\vec{x})dx^{+}\circ dx^{+}+\sum_{i}dx^{i}\circ dx^{i}\right) where \widetilde{H}(x^{+},\vec{x})=\vec{x}^{T}\,\widetilde{A}(x^{+})\,\vec{x} corresponds to a type (i) plane wave determined by a symmetric matrix \widetilde{A}_{0}=A_{0}-\frac{1}{4}\operatorname{id} (see [ 17 ] ). A straightforward calculation shows that four-dimensional homogeneous plane waves in class (i) have parallel Ricci tensor, while metrics in class (ii) have parallel Ricci tensor if and only if they are Ricci-flat. Furthermore, non-flat locally symmetric plane waves correspond to metrics in class (i) determined by a matrix A(x^{+}) with constant coefficients. Note that while non-symmetric three-dimensional homogeneous plane waves are of type (ii), it follows from the subsequent analysis that there are also plenty of non-symmetric left-invariant plane waves of type (i) in dimension four. 1.3. Harmonic Weyl tensor The Schouten tensor of an n -dimensional pseudo-Riemannian manifold (M,g) , given by S=\rho-\frac{\tau}{2(n-1)}g , determines the Cotton tensor defined by C(X,Y,Z)=(\nabla_{X}S)(Y,Z)-(\nabla_{Y}S)(X,Z) . The Cotton tensor is conformally invariant in dimension three, characterizing locally conformally flat three-dimensional manifolds as those with C=0 . In higher dimensions it is not conformally invariant but C=-\frac{n-2}{n-3}\operatorname{div}W , thus showing that the Cotton tensor vanishes if and only if the Weyl tensor is harmonic. Hence locally conformally flat manifolds, as well as those with parallel Ricci tensor have harmonic Weyl tensor. The curvature tensor is harmonic if and only if the Ricci tensor is Codazzi, i.e., (\nabla_{X}\rho)(Y,Z)-(\nabla_{Y}\rho)(X,Z)=0 , thus showing that harmonicity of the Weyl tensor and the curvature tensor are equivalent if the scalar curvature is constant (see [ 16 ] ). Lorentzian Lie groups with harmonic curvature have already been considered in [ 1 ] , where the Authors focus on some possibilities for the Jordan normal forms of the Ricci operator, without considering all the possible cases as shown in the following examples. 1.3.1. Cotton-flat three-dimensional homogeneous manifolds Locally conformally flat homogeneous three-dimensional manifolds with diagonalizable Ricci operator are locally symmetric. Three-dimensional locally conformally flat homogeneous manifolds which are neither locally symmetric nor plane waves are locally isomorphically homothetic to the Lorentzian Lie groups determined by (see [ 18 ] ): (1) The Lie algebra \mathfrak{sl}(2,\mathbb{R}) with a Lorentzian metric described by [e_{1},e_{2}]=e_{3}-\sqrt{3}e_{2},\quad[e_{1},e_{3}]=e_{2}+\sqrt{3}e_{3},\quad[e_{2},e_{3}]=2e_{1}, (2) the Lie algebra \mathfrak{r}_{3,3} with a Lorentzian metric described by [e_{1},e_{2}]=(\tfrac{1}{2}+\varepsilon\gamma)e_{2}+\gamma e_{3},\quad[e_{1},e_{3}]=(\varepsilon-\gamma)e_{2}+(\tfrac{3}{2}-\varepsilon\gamma)e_{3},\quad\varepsilon^{2}=1, for any \gamma\in\mathbb{R} , \gamma\neq\frac{\varepsilon}{2} , where \{e_{i}\} is an orthonormal basis with e_{3} timelike. The Ricci operator of any left-invariant metric (1) has real and complex eigenvalues \{-8,4(1\pm\sqrt{3}\sqrt{-1})\} , while the Ricci operator of metrics (2) has a single eigenvalue -2 , which is a double root of the minimal polynomial. Left-invariant metrics determined by (1) have also been considered in [ 1 , Proposition 4.1] . However the case (2), having a single Ricci eigenvalue, does not correspond to any of the situations investigated in [ 1 ] . Any three-dimensional locally conformally flat manifold (N,h) trivally extends to a four-dimensional Cotton-flat product (N\times\mathbb{R},h\oplus\pm dt^{2}) which is not necessarily locally conformally flat. Hence, we say that a four-dimensional Cotton-flat Lorentzian manifold is non-trivial if and only if the Ricci tensor is not parallel and the manifold is not locally conformally flat, nor a product, nor a plane wave. 1.4. Summary of results The purpose of this work is twofold. Firstly we determine all non-flat four-dimensional left-invariant metrics on Lie groups which are pp-waves. Secondly we analyze the harmonicity of the Weyl tensor, obtaining a full description of four-dimensional Lorentzian Lie groups with harmonic curvature. Our first result shows that pp-wave Lorentzian Lie groups correspond to plane waves or to the Lie group E(1,1)\times\mathbb{R} with the product metric of the three-dimensional homogeneous pp-wave discussed in Section 1.2.1 and the real line. This result is summarized in the following Theorem 1.1 . A four-dimensional non-flat left-invariant pp-wave Lie group is isomorphically homothetic to one of the following: (1) [u_{1},u_{4}]=\gamma_{1}u_{1}+u_{2}-\gamma_{3}u_{3} , [u_{2},u_{4}]=-\gamma_{1}u_{2} , [u_{3},u_{4}]=\gamma_{3}u_{2} , \gamma_{1}\neq 0 . (2) [u_{2},u_{4}]=-(\gamma_{2}-1)u_{3} , [u_{3},u_{4}]=(\gamma_{2}+1)u_{1} . (3) [v_{1},v_{4}]=\gamma_{1}v_{1}-\gamma_{2}v_{2}+\gamma_{3}v_{3} , [v_{2},v_{4}]=\gamma_{2}v_{1}+\gamma_{4}v_{2}+\gamma_{5}v_{3} , [v_{3},v_{4}]=\gamma_{8}v_{3} . (4) [v_{1},v_{2}]=v_{3} , [v_{1},v_{4}]=\gamma_{1}v_{1}-\gamma_{2}v_{2}+\gamma_{3}v_{3} , [v_{2},v_{4}]=\gamma_{2}v_{1}+\gamma_{4}v_{2}+\gamma_{5}v_{3} , [v_{3},v_{4}]=(\gamma_{1}+\gamma_{4})v_{3} . (5) [v_{1},v_{3}]=v_{2} , [v_{2},v_{3}]=-v_{1} , [v_{1},v_{4}]=\gamma_{1}v_{1}+\gamma_{2}v_{2} , [v_{2},v_{4}]=-\gamma_{2}v_{1}+\gamma_{1}v_{2} , \gamma_{1}\neq 0 . Moreover, left-invariant metrics in cases (2) , (3), (4) and (5) are plane waves. Here \{u_{i}\} and \{v_{i}\} are pseudo-orthonormal bases, with \langle u_{1},u_{2}\rangle=\langle u_{3},u_{3}\rangle=\langle u_{4},u_{4}\rangle=1 and \langle v_{1},v_{1}\rangle=\langle v_{2},v_{2}\rangle=\langle v_{3},v_{4}\rangle=1 , respectively. Left-invariant metrics in Theorem 1.1 –(1) are the only left-invariant pp-waves which are not plane waves. The underlying Lie algebra is the product \mathfrak{e}(1,1)\times\mathbb{R} and the metric is isometric to the Riemannian direct extension of the three-dimensional homogeneous pp-wave in E(1,1) discussed in Section 1.2.1 (see Remark 2.3 ). All Lie algebras in Theorem 1.1 are solvable. Moreover the Lie algebra in case (5) is \mathfrak{aff}(\mathbb{C}) , while Lie algebras in case (2) are \mathfrak{h}_{3}\times\mathbb{R} (resp., \mathfrak{n}_{4} ) if \gamma_{2}=\pm 1 (resp., \gamma_{2}\neq\pm 1 ). Left-invariant metrics corresponding to cases (3) and (4) are realized on all semi-direct extensions of the Abelian and the Heisenberg algebras except the Lie algebra \mathfrak{r}_{4,1,1} and \mathbb{R}^{4} , where any left-invariant metric is of constant sectional curvature (see [ 23 ] ). Any left-invariant Lorentz metric on the four-dimensional Abelian Lie group \mathbb{R}^{4} is flat, as well as any left-invariant Lorentz metric with nilpotent Ricci operator on a Lie group of type \mathfrak{S} corresponding to the Lie algebra \mathfrak{r}_{4,1,1} (see [ 23 ] ). Besides those cases, only the product affine group corresponding to the Lie algebra \mathfrak{aff}(\mathbb{R})\times\mathfrak{aff}(\mathbb{R}) does not admit any pp-wave left-invariant metric (see Section 4 ). Hence one has that Any non-Abelian four-dimensional Lie group admits non-flat left-invariant Lorentzian metrics which are plane waves, with the exception of the Lie groups associated to the Lie algebras \mathfrak{r}_{4,1,1} and \mathfrak{aff}(\mathbb{R})\times\mathfrak{aff}(\mathbb{R}) . In sharp contrast with plane waves, the existence of non-trivial Lorentzian Lie groups with harmonic curvature is a very restrictive condition. In addition to products with a three-dimensional locally conformally flat factor, plane waves, locally conformally flat cases and metrics with parallel Ricci tensor (see [ 2 , 8 , 9 , 10 ] ), four-dimensional Lorentzian Lie groups with harmonic curvature reduce to a family of examples with underlying Lie algebra \mathfrak{r}_{4,\mu,-\mu} with \mu=\frac{1}{4}(1\pm\sqrt{5}) as follows. Theorem 1.2 . A non-trivial four-dimensional Lorentzian Lie group with harmonic curvature is isomorphically homothetic to [u_{1},u_{4}]=-\tfrac{1}{4}\eta_{2}(1+\varepsilon_{1}\sqrt{5})u_{1}+\varepsilon_{2}u_{2},\quad[u_{2},u_{4}]=\tfrac{1}{4}\eta_{2}(1+\varepsilon_{1}\sqrt{5})u_{2},\quad[u_{3},u_{4}]=\eta_{2}u_{3}, where \eta_{2}\neq 0 , \varepsilon_{1}^{2}=\varepsilon_{2}^{2}=1 , and \{u_{i}\} is a pseudo-orthonormal basis with \langle u_{1},u_{2}\rangle=\langle u_{3},u_{3}\rangle=\langle u_{4},u_{4}\rangle=1 . The Ricci operator of any metric in Theorem 1.2 has eigenvalues \{0,0,-\eta_{2}^{2},-\eta_{2}^{2}\} , the eigenvalue 0 being a double root of the minimal polynomial. Due to the Jordan normal form of the Ricci operator, the metric above corresponds to the situation in [ 1 , Theorem 5.1] . As a consecuence of Theorem 1.1 and Theorem 1.2 , one has that A four-dimensional pp-wave Lie group is a plane wave if and only if the curvature is harmonic. 1.5. Structure of the paper Connected and simply connected non-solvable Lie groups in dimension four reduce to SU(2)\times\mathbb{R} and \widetilde{SL}(2,\mathbb{R})\times\mathbb{R} . In the solvable case, they are isomorphic to semi-direct extensions of the three-dimensional unimodular Lie groups (see, for example, [ 3 ] ), thus corresponding to \mathbb{R}^{3}\rtimes\mathbb{R} , \mathcal{H}^{3}\rtimes\mathbb{R} , E(1,1)\rtimes\mathbb{R} and \widetilde{E}(2)\rtimes\mathbb{R} , where \mathbb{R}^{3} is the Abelian Lie group, \mathcal{H}^{3} is the Heisenberg group, and E(1,1) (resp., \widetilde{E}(2) ) is the Poincaré (resp., Euclidean) Lie group. In order to discuss left-invariant metrics, we work at the Lie algebra level considering the different possibilities for Lorentzian metrics \langle\cdot,\cdot\rangle on Lie algebras \mathfrak{g}=\mathfrak{k}\oplus\mathbb{R} . Since any pp-wave has two-step nilpotent Ricci operator and has Petrov type N, we analyze these properties for all left-invariant Lorentz metrics on four-dimensional Lie groups. We then study the Cotton tensor towards a description of Lorentzian Lie groups with harmonic curvature. The analysis splits into three general situations depending on whether the restriction of \langle\cdot,\cdot\rangle to the unimodular ideal \mathfrak{k} is Riemannian, Lorentzian or degenerate. The discussion of Lorentzian metrics restricting to Riemannian metrics on \mathfrak{k} follows from the work of Milnor [ 22 ] , while the case when the restriction to \mathfrak{k} is Lorentzian is based on the work of Rahmani [ 25 ] . If \langle\cdot,\cdot\rangle\mid_{\mathfrak{k}\times\mathfrak{k}} is degenerate, then we consider the different possibilities on the dimension of the derived algebra \mathfrak{k}^{\prime}=[\mathfrak{k},\mathfrak{k}] , inspired by the discussion in [ 7 ] (see also [ 14 ] ). Left-invariant Lorentzian metrics on \mathbb{R}^{3}\rtimes\mathbb{R} are considered in Section 2 . In Section 3 we analyze left-invariant metrics on \mathcal{H}^{3}\rtimes\mathbb{R} . Semi-direct extensions of the Euclidean and Poincaré Lie groups are considered in Section 4 , and the non-solvable case corresponding to SU(2)\times\mathbb{R} and \widetilde{SL}(2,\mathbb{R})\times\mathbb{R} is treated in Section 5 . Finally we emphasize that for any of the Lorentzian left-invariant metrics the properties \operatorname{Ric}^{2}=0 or \operatorname{div}W=0 amounts to solve some systems of polynomial equations in the structure constants. Since the solutions of a system of polynomial equations depend on the ideal generated by the polynomials rather than on the polynomials themselves, we make use of the theory of Gröbner bases (see, for example, [ 11 ] ) to find simple polynomials in the corresponding ideals. As a technical fact, all the Gröbner bases calculations in this paper have been done with Mathematica 12 , and computed using the lexicographical order with respect to the variables, which we specify in each case. We provide a complementary file with the calculations of the Gröbner bases, which is available at https://doi.org/10.5281/zenodo.18548828 . Observe that although \operatorname{Ric}^{2}=0 implies the vanishing of the scalar curvature \tau , the polynomial corresponding to \tau=0 does not necessarily belongs to the ideal generated by the polynomials determined by the two-step nilpotency of the Ricci operator. Hence we explicitly use this polynomial determined by \tau in the computation of the Gröbner bases when studying the property \operatorname{Ric}^{2}=0 . 2. Semi-direct extensions of the Abelian Lie group We consider separately the cases when the restriction of the metric to the three-dimensional Abelian ideal \mathbb{R}^{3} is Riemannian (Section 2.1 ), Lorentzian (Section 2.2 ) or degenerate (Section 2.3 ). The proof of the following theorem follows from the analysis below. Theorem 2.1 . A four-dimensional non-flat semi-direct extension of the Abelian Lie group which is a pp-wave is isomorphically homothetic to one of the following: (1) [u_{1},u_{4}]=\gamma_{1}u_{1}+u_{2}-\gamma_{3}u_{3} , [u_{2},u_{4}]=-\gamma_{1}u_{2} , [u_{3},u_{4}]=\gamma_{3}u_{2} , \gamma_{1}\neq 0 . (2) [u_{2},u_{4}]=-(\gamma_{2}-1)u_{3} , [u_{3},u_{4}]=(\gamma_{2}+1)u_{1} . (3) [v_{1},v_{4}]=\gamma_{1}v_{1}-\gamma_{2}v_{2}+\gamma_{3}v_{3} , [v_{2},v_{4}]=\gamma_{2}v_{1}+\gamma_{4}v_{2}+\gamma_{5}v_{3} , [v_{3},v_{4}]=\gamma_{8}v_{3} , where \{u_{i}\} and \{v_{i}\} are pseudo-orthonormal bases, with \langle u_{1},u_{2}\rangle=\langle u_{3},u_{3}\rangle=\langle u_{4},u_{4}\rangle=1 and \langle v_{1},v_{1}\rangle=\langle v_{2},v_{2}\rangle=\langle v_{3},v_{4}\rangle=1 , respectively. Moreover, any non-trivial Cotton-flat semi-direct extension of the Abelian group is isomorphically homothetic to [u_{1},u_{4}]=-\tfrac{1}{4}\eta_{2}(1+\varepsilon_{1}\sqrt{5})u_{1}+\varepsilon_{2}u_{2},\quad[u_{2},u_{4}]=\tfrac{1}{4}\eta_{2}(1+\varepsilon_{1}\sqrt{5})u_{2},\quad[u_{3},u_{4}]=\eta_{2}u_{3}, where \eta_{2}\neq 0 , \varepsilon_{1}^{2}=\varepsilon_{2}^{2}=1 , and \{u_{i}\} is a pseudo-orthonormal basis as above. Remark 2.2 . (i) Left-invariant metrics in case (1) above, which are not plane waves, are never either Einstein nor locally conformally flat. (ii) Left-invariant metrics in Theorem 2.1 –(2) are Einstein if and only if \gamma_{2}=0 , and they are locally conformally flat if and only if \gamma_{2}=1 . Moreover, since the Ricci tensor is parallel, they are plane waves of type (i) whenever \gamma_{2}\neq 0 . (iii) For left-invariant metrics in case (3) the Einstein condition is satisfied if and only if \gamma_{1}^{2}+\gamma_{4}^{2}-(\gamma_{1}+\gamma_{4})\gamma_{8}=0 . Moreover, these metrics are locally conformally flat if and only if either \gamma_{1}=\gamma_{4} or \gamma_{1}\neq\gamma_{4} , \gamma_{2}=0 and \gamma_{8}=\gamma_{1}+\gamma_{4} . The Ricci tensor is parallel if and only if the metric is Einstein or \gamma_{8}=0 . Hence, in the non-Einstein case, the plane waves are of type (i) if \gamma_{8}=0 , and of type (ii) otherwise. Remark 2.3 . A straightforward calculation shows that \xi=\frac{\gamma_{3}}{\gamma_{1}}u_{2}+u_{3} determines a left-invariant unit spacelike parallel vector field on the Lie group corresponding to Theorem 2.1 –(1). Moreover, considering the new basis \bar{u}_{1}=u_{1}-\frac{\gamma_{3}^{2}}{2\gamma_{1}^{2}}u_{2}-\frac{\gamma_{3}}{\gamma_{1}}u_{3} , \bar{u}_{2}=u_{2} , \bar{u}_{3}=u_{4} , \bar{u}_{4}=\xi , the inner product is preserved and the Lie bracket transforms as [\bar{u}_{1},\bar{u}_{3}]=\gamma_{1}\bar{u}_{1}+\bar{u}_{2} and [\bar{u}_{2},\bar{u}_{3}]=-\gamma_{1}\bar{u}_{2} . This shows that the underlying Lie group is the product E(1,1)\times\mathbb{R} and the Lorentzian metric is the product of the metric corresponding to (1) in Section 1.2.1 and the real line \mathbb{R}\xi . For a given basis \{x_{i}\} of a Lie algebra \mathfrak{g} , let \Lambda^{2}\mathfrak{g} be the space of bivectors with basis \left\{x_{1}\wedge x_{2},x_{1}\wedge x_{3},x_{1}\wedge x_{4},x_{2}\wedge x_{3},x_{2}\wedge x_{4},x_{3}\wedge x_{4}\right\} . We consider the induced inner product given by \langle\!\langle x_{i}\wedge x_{j},x_{k}\wedge x_{\ell}\rangle\!\rangle=\langle x_{i},x_{k}\rangle\langle x_{j},x_{\ell}\rangle-\langle x_{i},x_{\ell}\rangle\langle x_{j},x_{k}\rangle so that the curvature tensor acts on the space of bivectors as \langle\!\langle\mathcal{R}(x_{i}\wedge x_{j}),x_{k}\wedge x_{\ell}\rangle\!\rangle=R(x_{i},x_{j},x_{k},x_{\ell}) . Then it follows that the only non-zero component of \mathcal{R} is given by \langle\!\langle\mathcal{R}(u_{1}\wedge u_{4}),u_{1}\wedge u_{4}\rangle\!\rangle=-2\gamma_{1} , from where \mathcal{R}(u_{1}\wedge u_{4})=-2\gamma_{1}u_{2}\wedge u_{4} . 2.1. Semi-direct extensions with Riemannian Lie group \boldsymbol{\mathbb{R}}^{\bm{3}} Let \mathfrak{g}=\mathbb{R}^{3}\rtimes\mathbb{R} be a semi-direct extension of the Abelian Lie algebra \mathbb{R}^{3} . If \langle\cdot,\cdot\rangle is a Lorentzian inner product on \mathfrak{g} whose restriction to \mathbb{R}^{3} is of Riemannian signature then there exists an orthonormal basis \{e_{1},e_{2},e_{3},e_{4}\} of \mathfrak{g} , with e_{4} timelike, so that the structure of the metric Lie algebra is given by (1) \begin{array}[]{l}[e_{1},e_{4}]=\eta_{1}e_{1}-\gamma_{1}e_{2}-\gamma_{2}e_{3},\qquad[e_{2},e_{4}]=\gamma_{1}e_{1}+\eta_{2}e_{2}-\gamma_{3}e_{3},\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[e_{3},e_{4}]=\gamma_{2}e_{1}+\gamma_{3}e_{2}+\eta_{3}e_{3},\end{array} for certain \eta_{i},\gamma_{i}\in\mathbb{R} . In this case a direct calculation shows that \begin{array}[]{ll}\operatorname{Ric}_{1}^{\,\,1}=(\eta_{1}+\eta_{2}+\eta_{3})\eta_{1},&\operatorname{Ric}_{1}^{\,\,2}=\operatorname{Ric}_{2}^{\,\,1}=\gamma_{1}(\eta_{1}-\eta_{2}),\par\par\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr\operatorname{Ric}_{2}^{\,\,2}=(\eta_{1}+\eta_{2}+\eta_{3})\eta_{2},&\operatorname{Ric}_{1}^{\,\,3}=\operatorname{Ric}_{3}^{\,\,1}=\gamma_{2}(\eta_{1}-\eta_{3}),\par\par\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr\operatorname{Ric}_{3}^{\,\,3}=(\eta_{1}+\eta_{2}+\eta_{3})\eta_{3},\par&\operatorname{Ric}_{2}^{\,\,3}=\operatorname{Ric}_{3}^{\,\,2}=\gamma_{3}(\eta_{2}-\eta_{3}),\par\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr\operatorname{Ric}_{4}^{\,\,4}=\eta_{1}^{2}+\eta_{2}^{2}+\eta_{3}^{2},&\end{array} and therefore the scalar curvature is given by \tau=2(\eta_{1}^{2}+\eta_{2}^{2}+\eta_{3}^{2}+\eta_{1}\eta_{2}+\eta_{1}\eta_{3}+\eta_{2}\eta_{3}) . Note that \tau vanishes if and only if \eta_{1}=\eta_{2}=\eta_{3}=0 , in which case the space is flat. Remark 2.4 . Since the scalar curvature of any left-invariant metric is constant, the Cotton tensor is equivalently given by C(X,Y,Z)=(\nabla_{X}\rho)(Y,Z)-(\nabla_{Y}\rho)(X,Z) . We denote by C_{ijk}=C(e_{i},e_{j},e_{k}) the components of the Cotton tensor on the basis of left-invariant vector fields determined by \{e_{i}\} . Next we show that any left-invariant metric described by ( 1 ) is Cotton-flat if and only if it is Einstein or locally symmetric. We start calculating the following three-components of the Cotton tensor: C_{124}=-\gamma_{1}(\eta_{1}-\eta_{2})^{2},\quad C_{134}=-\gamma_{2}(\eta_{1}-\eta_{3})^{2},\quad C_{234}=-\gamma_{3}(\eta_{2}-\eta_{3})^{2}. Note that the isometry (e_{1},e_{2},e_{3},e_{4})\mapsto(e_{1},e_{3},e_{2},e_{4}) gives the correspondence (\eta_{1},\eta_{2},\eta_{3},\gamma_{1},\gamma_{2},\gamma_{3})\sim(\eta_{1},\eta_{3},\eta_{2},\gamma_{2},\gamma_{1},-\gamma_{3}) , while (e_{1},e_{2},e_{3},e_{4})\mapsto(e_{3},e_{2},e_{1},e_{4}) shows that (\eta_{1},\eta_{2},\eta_{3},\gamma_{1},\gamma_{2},\gamma_{3})\sim(\eta_{3},\eta_{2},\eta_{1},-\gamma_{3},-\gamma_{2},-\gamma_{1}) . Using these isometries and excluding the Einstein case ( \eta_{1}=\eta_{2}=\eta_{3} ), the vanishing of the components above leads to analyze the case \eta_{1}=\eta_{2}\neq\eta_{3} , \gamma_{2}=\gamma_{3}=0 , and the case \eta_{1}\neq\eta_{2}\neq\eta_{3} , \eta_{1}\neq\eta_{3} , \gamma_{1}=\gamma_{2}=\gamma_{3}=0 . If \eta_{1}=\eta_{2}\neq\eta_{3} and \gamma_{2}=\gamma_{3}=0 , we get C_{141}=\eta_{1}\eta_{3}(\eta_{3}-\eta_{1}) . Thus, either \eta_{1} or \eta_{3} vanishes and the space is locally symmetric. Now, if all the \eta_{i} ’s are different and \gamma_{1}=\gamma_{2}=\gamma_{3}=0 , then the Cotton tensor is determined by C_{141}=\eta_{1}\left(\eta_{2}^{2}+\eta_{3}^{2}-\eta_{1}(\eta_{2}+\eta_{3})\right),\quad C_{242}=\eta_{2}\left(\eta_{1}^{2}+\eta_{3}^{2}-\eta_{2}(\eta_{1}+\eta_{3})\right), from where we get \eta_{1}C_{242}-\eta_{2}C_{141}=\eta_{1}\eta_{2}(\eta_{1}+\eta_{2}+\eta_{3})(\eta_{1}-\eta_{2}) . Since the \eta_{i} ’s are different one easily checks that C_{141}=C_{242}=0 does not hold if any of the first three factors \eta_{1} , \eta_{2} or \eta_{1}+\eta_{2}+\eta_{3} vanishes. Hence there are no non-trivial Cotton-flat left-invariant metrics given by ( 1 ). 2.2. Semi-direct extensions with Lorentzian Lie group \boldsymbol{\mathbb{R}}^{\bm{3}} Let \mathfrak{g}=\mathbb{R}^{3}\rtimes\mathbb{R} be a semi-direct extension of the Abelian Lie algebra \mathbb{R}^{3} . If the restriction to \mathbb{R}^{3} of a Lorentzian inner product \langle\cdot,\cdot\rangle on \mathfrak{g} is of Lorentzian signature then we must consider the possible Jordan normal forms of the self-adjoint part of the derivation which determines the semi-direct extension. Next we analyze them separately. 2.2.1. The self-adjoint part of the derivation is diagonalizable In this case there exists an orthonormal basis \{e_{1},e_{2},e_{3},e_{4}\} , with e_{3} timelike, so that left-invariant metrics are described by (2) \begin{array}[]{l}[e_{1},e_{4}]=\eta_{1}e_{1}-\gamma_{1}e_{2}+\gamma_{2}e_{3},\qquad[e_{2},e_{4}]=\gamma_{1}e_{1}+\eta_{2}e_{2}+\gamma_{3}e_{3},\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[e_{3},e_{4}]=\gamma_{2}e_{1}+\gamma_{3}e_{2}+\eta_{3}e_{3},\end{array} for certain \eta_{i},\gamma_{i}\in\mathbb{R} . We proceed as in the previous case. The Ricci operator is determined by \begin{array}[]{ll}\operatorname{Ric}_{1}^{\,\,1}=-(\eta_{1}+\eta_{2}+\eta_{3})\eta_{1},&\operatorname{Ric}_{1}^{\,\,2}=\phantom{-}\operatorname{Ric}_{2}^{\,\,1}=-\gamma_{1}(\eta_{1}-\eta_{2}),\par\par\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr\operatorname{Ric}_{2}^{\,\,2}=-(\eta_{1}+\eta_{2}+\eta_{3})\eta_{2},&\operatorname{Ric}_{1}^{\,\,3}=-\operatorname{Ric}_{3}^{\,\,1}=\phantom{-}\gamma_{2}(\eta_{1}-\eta_{3}),\par\par\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr\operatorname{Ric}_{3}^{\,\,3}=-(\eta_{1}+\eta_{2}+\eta_{3})\eta_{3},&\operatorname{Ric}_{3}^{\,\,2}=-\operatorname{Ric}_{2}^{\,\,3}=-\gamma_{3}(\eta_{2}-\eta_{3}),\par\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr\operatorname{Ric}_{4}^{\,\,4}=-(\eta_{1}^{2}+\eta_{2}^{2}+\eta_{3}^{2}),&\end{array} so that the scalar curvature \tau=-2(\eta_{1}^{2}+\eta_{2}^{2}+\eta_{3}^{2}+\eta_{1}\eta_{2}+\eta_{1}\eta_{3}+\eta_{2}\eta_{3}) vanishes if and only if \eta_{1}=\eta_{2}=\eta_{3}=0 , in which case the space is flat. Remark 2.5 . Although in this case we only have a basic isometry, (e_{1},e_{2},e_{3},e_{4})\mapsto(e_{2},e_{1},e_{3},e_{4}) , which shows that (\eta_{1},\eta_{2},\eta_{3},\gamma_{1},\gamma_{2},\gamma_{3})\sim(\eta_{2},\eta_{1},\eta_{3},-\gamma_{1},\gamma_{3},\gamma_{2}) , the Cotton-flat condition can be handled exactly as in Remark 2.4 . Indeed, considering that isometry and the vanishing of the components C_{124}=\gamma_{1}(\eta_{1}-\eta_{2})^{2},\quad C_{134}=\gamma_{2}(\eta_{1}-\eta_{3})^{2},\quad C_{234}=\gamma_{3}(\eta_{2}-\eta_{3})^{2}, we are led to three possibilities: the case \eta_{1}=\eta_{2}\neq\eta_{3} , \gamma_{2}=\gamma_{3}=0 , the case \eta_{1}=\eta_{3}\neq\eta_{2} , \gamma_{1}=\gamma_{3}=0 , and the case \eta_{1}\neq\eta_{2}\neq\eta_{3} , \eta_{1}\neq\eta_{3} , \gamma_{1}=\gamma_{2}=\gamma_{3}=0 (excluding the Einstein situation \eta_{1}=\eta_{2}=\eta_{3} ). We proceed exactly as in Remark 2.4 to show that any Cotton-flat metric determined by ( 2 ) is trivial. 2.2.2. The self-adjoint part of the derivation has complex eigenvalues There exists an orthonormal basis \{e_{1},e_{2},e_{3},e_{4}\} of \mathfrak{g}=\mathbb{R}^{3}\rtimes\mathbb{R} , with e_{3} timelike, so that the corresponding left-invariant metrics are described by (3) \begin{array}[]{l}[e_{1},e_{4}]=\eta e_{1}-\gamma_{1}e_{2}+\gamma_{2}e_{3},\qquad\quad[e_{2},e_{4}]=\gamma_{1}e_{1}+\delta e_{2}+(\gamma_{3}-\nu)e_{3},\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[e_{3},e_{4}]=\gamma_{2}e_{1}+(\gamma_{3}+\nu)e_{2}+\delta e_{3},\end{array} for certain \eta,\delta,\gamma_{i}\in\mathbb{R} and \nu\neq 0 . A straightforward calculation shows that the Ricci operator is determined by \begin{array}[]{ll}\operatorname{Ric}_{1}^{\,\,1}=-(\eta+2\delta)\eta,&\operatorname{Ric}_{1}^{\,\,2}=\phantom{-}\operatorname{Ric}_{2}^{\,\,1}=\gamma_{1}(\delta-\eta)-\gamma_{2}\nu,\par\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr\operatorname{Ric}_{2}^{\,\,2}=-\delta\eta-2\delta^{2}-2\gamma_{3}\nu,&\operatorname{Ric}_{1}^{\,\,3}=-\operatorname{Ric}_{3}^{\,\,1}=\gamma_{2}(\eta-\delta)-\gamma_{1}\nu,\par\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr\operatorname{Ric}_{3}^{\,\,3}=-\delta\eta-2\delta^{2}+2\gamma_{3}\nu,&\operatorname{Ric}_{2}^{\,\,3}=-\operatorname{Ric}_{3}^{\,\,2}=(\eta+2\delta)\nu,\par\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr\operatorname{Ric}_{4}^{\,\,4}=2\nu^{2}-\eta^{2}-2\delta^{2},&\end{array} so that \operatorname{Ric}_{4}^{\,\,4} is an eigenvalue. Hence \operatorname{Ric}_{4}^{\,\,4} must vanish, so \nu^{2}=\frac{1}{2}(\eta^{2}+2\delta^{2}) . In this setting the scalar curvature \tau=-(\eta+2\delta)^{2} and therefore \eta=-2\delta . At this point we consider the \operatorname{Ric}^{2} operator, which must vanish. Taking into account that \eta=-2\delta , we compute \left(\operatorname{Ric}^{2}\right)_{2}^{\,\,2}-\left(\operatorname{Ric}^{2}\right)_{3}^{\,\,3}=(\gamma_{1}^{2}+\gamma_{2}^{2})(9\delta^{2}+\nu^{2}) . Since \nu\neq 0 , it follows that \gamma_{1}=\gamma_{2}=0 and a long but straightforward calculation shows that the Weyl tensor acting on the space of bivectors, \mathcal{W}:\Lambda^{2}\rightarrow\Lambda^{2} , satisfies \langle\!\langle\mathcal{W}^{2}(e_{1}\wedge e_{4}),e_{1}\wedge e_{4}\rangle\!\rangle=\tfrac{4}{9}(3\delta^{2}+\nu^{2})^{2}\neq 0. Thus, we conclude that there is no left-invariant pp-wave metric in this case. Remark 2.6 . Any Cotton-flat left-invariant metric ( 3 ) is necessarily Einstein. To show it, we start calculating C_{234}=-4\gamma_{3}\nu^{2} , from where \gamma_{3}=0 . Now, C_{124}=\gamma_{1}\left((\delta-\eta)^{2}-\nu^{2}\right)-2\gamma_{2}(\delta-\eta)\nu,\,\,\,C_{134}=\gamma_{2}\left((\delta-\eta)^{2}-\nu^{2}\right)+2\gamma_{1}(\delta-\eta)\nu, imply \gamma_{1}C_{134}-\gamma_{2}C_{124}=2(\gamma_{1}^{2}+\gamma_{2}^{2})(\delta-\eta)\nu , so that either \delta=\eta or \gamma_{1}=\gamma_{2}=0 . Moreover, if \delta=\eta then C_{124}=-\gamma_{1}\nu^{2} and C_{134}=-\gamma_{2}\nu^{2} . Therefore, in any case, \gamma_{1}=\gamma_{2}=0 and under this assumption a straightforward calculation shows that the Cotton tensor is determined by C_{243}=(2\delta^{2}-\eta^{2}+2\delta\eta+2\nu^{2})\nu,\quad C_{343}=-(\delta^{2}-\delta\eta-\nu^{2})\eta. Finally, one easily checks that the vanishing of these components leads to \eta=-2\delta=-\frac{2\nu}{\sqrt{3}}\varepsilon , with \varepsilon^{2}=1 , and the corresponding left-invariant metric is Einstein. 2.2.3. The self-adjoint part of the derivation has a double root of the minimal polynomial There exists a pseudo-orthonormal basis \{u_{1},u_{2},u_{3},u_{4}\} , with \langle u_{1},u_{2}\rangle=\langle u_{3},u_{3}\rangle=\langle u_{4},u_{4}\rangle=1 , so that the corresponding left-invariant metrics are described by (4) \begin{array}[]{l}[u_{1},u_{4}]=(\eta_{1}+\gamma_{1})u_{1}+\varepsilon u_{2}-\gamma_{3}u_{3},\,\,\,\,\,[u_{2},u_{4}]=(\eta_{1}-\gamma_{1})u_{2}-\gamma_{2}u_{3},\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[u_{3},u_{4}]=\gamma_{2}u_{1}+\gamma_{3}u_{2}+\eta_{2}u_{3},\end{array} where \eta_{i},\gamma_{i}\in\mathbb{R} and \varepsilon^{2}=1 . A straightforward calculation shows that the Ricci operator is determined by \begin{array}[]{ll}\operatorname{Ric}_{1}^{\,\,1}=\operatorname{Ric}_{2}^{\,\,2}=-(2\eta_{1}+\eta_{2})\eta_{1},&\operatorname{Ric}_{1}^{\,\,2}=-\varepsilon(2\eta_{1}+\eta_{2}+2\gamma_{1}),\par\par\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr\operatorname{Ric}_{3}^{\,\,3}=-(2\eta_{1}+\eta_{2})\eta_{2},&\operatorname{Ric}_{1}^{\,\,3}=\operatorname{Ric}_{3}^{\,\,2}=-\gamma_{3}(\eta_{1}-\eta_{2})-\varepsilon\gamma_{2},\par\par\par\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr\operatorname{Ric}_{4}^{\,\,4}=-2\eta_{1}^{2}-\eta_{2}^{2},&\operatorname{Ric}_{2}^{\,\,3}=\operatorname{Ric}_{3}^{\,\,1}=-\gamma_{2}(\eta_{1}-\eta_{2}).\par\end{array} Therefore, the scalar curvature \tau=-2(3\eta_{1}^{2}+\eta_{2}^{2}+2\eta_{1}\eta_{2}) , so that necessarily \eta_{1}=\eta_{2}=0 . Now the only non-zero component of \operatorname{Ric}^{2} is \left(\operatorname{Ric}^{2}\right)_{1}^{\,\,2}=\gamma_{2}^{2} . Hence, \gamma_{2}=0 and the left-invariant metric is given by (5) [u_{1},u_{4}]=\gamma_{1}u_{1}+\varepsilon u_{2}-\gamma_{3}u_{3},\quad[u_{2},u_{4}]=-\gamma_{1}u_{2},\quad[u_{3},u_{4}]=\gamma_{3}u_{2}. Note that the isomorphic isometry u_{4}\mapsto-u_{4} interchanges the sign of \varepsilon , \gamma_{1} and \gamma_{3} . Thus, without loss of generality, we may assume \varepsilon=1 . Besides, a straightforward calculation shows that the metric is flat if and only if \gamma_{1}=0 . In the non-flat case, since \nabla_{u_{i}}u_{2}=0 for i=1,2,3 and \nabla_{u_{4}}u_{2}=\gamma_{1}u_{2} , it follows that u_{2} determines a left-invariant recurrent null vector field. Moreover, a direct calculation shows that the curvature tensor satisfies R(x,y)=0 for all x,y\in u_{2}^{\perp}=\operatorname{span}\{u_{2},u_{3},u_{4}\} . However, the covariant derivative (\nabla_{u_{4}}R)(u_{1},u_{4},u_{1})=-4\gamma_{1}^{2}u_{4}\neq 0 . Hence, we conclude that the underlying structure for left-invariant metrics determined by Equation ( 5 ) is a pp-wave but not a plane wave (cf. [ 20 ] ), corresponding to case (1) in Theorem 2.1 . Remark 2.7 . Considering the components of the Cotton tensor of any metric ( 4 ), C_{234}=\gamma_{2}(\eta_{1}-\eta_{2})^{2},\quad C_{142}=-\varepsilon\gamma_{2}^{2}-(2\gamma_{2}\gamma_{3}-\eta_{1}\eta_{2})(\eta_{1}-\eta_{2}), if the Cotton tensor vanishes, then it follows that \gamma_{2}=0 and \eta_{1}\eta_{2}(\eta_{1}-\eta_{2})=0 . Then one has C_{134}=\gamma_{3}(\eta_{1}-\eta_{2})^{2} , so that we are led to three possibilities: the case \eta_{1}=\eta_{2} , the case \gamma_{3}=\eta_{2}=0\neq\eta_{1} , and the case \gamma_{3}=\eta_{1}=0\neq\eta_{2} . If \eta_{1}=\eta_{2} , the Cotton tensor is determined by C_{141}=\varepsilon(2\gamma_{1}+3\eta_{1})(2\gamma_{1}+\eta_{1}) and the space is Einstein for 2\gamma_{1}+3\eta_{1}=0 and locally conformally flat if 2\gamma_{1}+\eta_{1}=0 . If \gamma_{3}=\eta_{2}=0\neq\eta_{1} , the Cotton tensor is given by C_{141}=2\varepsilon(\gamma_{1}+\eta_{1})(2\gamma_{1}+\eta_{1}) . For \gamma_{1}+\eta_{1}=0 the metric is locally symmetric. Otherwise, if 2\gamma_{1}+\eta_{1}=0 , the left-invariant metric corresponds to a product Lie algebra \mathfrak{k}\times\mathbb{R} , with \mathfrak{k}=\operatorname{span}\{u_{1},u_{2},u_{4}\} , and a direct calculation shows that \nabla_{u_{i}}u_{3}=0 , i=1,\dots,4 . Hence, u_{3} generates a left-invariant spacelike parallel vector field and the Lorentzian Lie group splits as a Lorentzian product Lie group which corresponds to the Lie algebra \mathfrak{r}_{3,3}\times\mathbb{R} with the metric on the three-dimensional factor given by (2) in Section 1.3.1 . Finally, we analyze the case \gamma_{3}=\eta_{1}=0\neq\eta_{2} . In this last case, the Cotton tensor is determined by C_{141}=\varepsilon(4\gamma_{1}^{2}-\eta_{2}^{2}+2\gamma_{1}\eta_{2}) . Taking \gamma_{1}=-\frac{1}{4}(1\pm\sqrt{5})\eta_{2}\neq 0 , a straightforward calculation shows that the left-invariant metric, given by [u_{1},u_{4}]=\gamma_{1}u_{1}+\varepsilon u_{2},\quad[u_{2},u_{4}]=-\gamma_{1}u_{2},\quad[u_{3},u_{4}]=\eta_{2}u_{3}, is non-trivial Cotton-flat, corresponding to the Lorentzian Lie group in Theorem 1.2 . A direct calculation shows that the left-invariant vector field U_{2} determined by u_{2} is null and recurrent, which shows that the underlying structure is a Brinkmann wave which is not transversally flat on the non-unimodular Lie algebra \mathfrak{r}_{4,\mu,-\mu} with \mu=\frac{1}{4}(1\pm\sqrt{5}) . Moreover, the Ricci operator has eigenvalues 0 and -\eta_{2}^{2} , the former being a double root of the minimal polynomial. The Weyl curvature operator \mathcal{W}:\Lambda^{2}\rightarrow\Lambda^{2} has eigenvalues -\frac{1}{3}\eta_{2}^{2} with multiplicity two and \frac{1}{6}\eta_{2}^{2} with multiplicity four, the latter one being a double root of the minimal polynomial. Hence of Petrov Type II. 2.2.4. The self-adjoint part of the derivation has a triple root There exists a pseudo-orthonormal basis \{u_{1},u_{2},u_{3},u_{4}\} of \mathbb{R}^{3}\rtimes\mathbb{R} , with \langle u_{1},u_{2}\rangle=\langle u_{3},u_{3}\rangle=\langle u_{4},u_{4}\rangle=1 , so that the left-invariant metrics are given by (6) \begin{array}[]{l}[u_{1},u_{4}]=(\eta+\gamma_{1})u_{1}-\gamma_{3}u_{3},\quad[u_{2},u_{4}]=(\eta-\gamma_{1})u_{2}-(\gamma_{2}-1)u_{3},\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[u_{3},u_{4}]=(\gamma_{2}+1)u_{1}+\gamma_{3}u_{2}+\eta u_{3},\end{array} where \eta,\gamma_{i}\in\mathbb{R} . In this case the Ricci operator is determined by \begin{array}[]{ll}\operatorname{Ric}_{1}^{\,\,1}=\operatorname{Ric}_{2}^{\,\,2}=-3\eta^{2}+\gamma_{3},&\operatorname{Ric}_{2}^{\,\,1}=2\gamma_{2},\par\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr\operatorname{Ric}_{3}^{\,\,3}=-3\eta^{2}-2\gamma_{3},&\operatorname{Ric}_{3}^{\,\,1}=\operatorname{Ric}_{2}^{\,\,3}=-3\eta+\gamma_{1},\par\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr\operatorname{Ric}_{4}^{\,\,4}=-3\eta^{2},\par\end{array} so that \tau=-12\eta^{2} which leads to \eta=0 . Now a direct calculation shows that \operatorname{Ric}^{2}=0 if and only if \gamma_{1}=\gamma_{3}=0 , and the corresponding left-invariant metric is given by (7) [u_{2},u_{4}]=-(\gamma_{2}-1)u_{3},\quad[u_{3},u_{4}]=(\gamma_{2}+1)u_{1}. A straightforward calculation shows that u_{1} determines a left-invariant parallel null vector field and, moreover, the curvature tensor satisfies R(x,y)=0 for all x,y\in u_{1}^{\perp}=\operatorname{span}\{u_{1},u_{3},u_{4}\} , while the covariant derivatives \nabla_{x}R=0 for all x\in u_{1}^{\perp} . Hence it follows from [ 20 ] that the underlying structure of left-invariant metrics ( 7 ) is a plane wave corresponding to Theorem 2.1 –(2). Remark 2.8 . The vanishing of the Cotton tensor of any left-invariant metric given by ( 6 ) is determined by the vanishing of C_{143}=-3\gamma_{3}^{2},\,C_{242}=\gamma_{1}(6\gamma_{2}-1)-(8\gamma_{2}-3)\eta,\,C_{243}=(\gamma_{1}-3\eta)(\gamma_{1}-\eta)-(5\gamma_{2}-2)\gamma_{3}. Hence one has three possibilities: the case \gamma_{1}=\gamma_{3}=\eta=0 , the case \gamma_{1}=3\eta\neq 0 , \gamma_{2}=\gamma_{3}=0 , and the case \gamma_{1}=\eta\neq 0 , \gamma_{2}=1 , \gamma_{3}=0 . Note that the first case corresponds to the plane waves given by ( 7 ). Moreover, the metric is Einstein in the second case and locally conformally flat in the third one. 2.3. Semi-direct extensions with degenerate Lie group \boldsymbol{\mathbb{R}}^{\bm{3}} In this case we consider a four-dimensional Lie algebra \mathfrak{g}=\mathbb{R}^{3}\rtimes\mathbb{R} with a Lorentzian inner product \langle\cdot,\cdot\rangle which restricts to a degenerate inner product on the subalgebra \mathbb{R}^{3} . There exists a pseudo-orthonormal basis \{u_{1},u_{2},u_{3},u_{4}\} of \mathfrak{g} , with \langle u_{1},u_{1}\rangle=\langle u_{2},u_{2}\rangle=\langle u_{3},u_{4}\rangle=1 , possibly after rotating the vectors u_{1} and u_{2} , so that (8) \begin{array}[]{l}[u_{1},u_{4}]=\gamma_{1}u_{1}-\gamma_{2}u_{2}+\gamma_{3}u_{3},\qquad[u_{2},u_{4}]=\gamma_{2}u_{1}+\gamma_{4}u_{2}+\gamma_{5}u_{3},\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[u_{3},u_{4}]=\gamma_{6}u_{1}+\gamma_{7}u_{2}+\gamma_{8}u_{3},\end{array} for certain \gamma_{i}\in\mathbb{R} . We start computing the Ricci operator, determined by \begin{array}[]{ll}\operatorname{Ric}_{1}^{\,\,1}=-\frac{\gamma_{6}^{2}}{2},\quad\operatorname{Ric}_{2}^{\,\,2}=-\frac{\gamma_{7}^{2}}{2},&\operatorname{Ric}_{1}^{\,\,3}=\operatorname{Ric}_{4}^{\,\,1}=\frac{1}{2}(2\gamma_{1}\gamma_{6}-\gamma_{2}\gamma_{7}+\gamma_{4}\gamma_{6}),\par\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr\operatorname{Ric}_{3}^{\,\,3}=\operatorname{Ric}_{4}^{\,\,4}=\frac{1}{2}(\gamma_{6}^{2}+\gamma_{7}^{2}),\par\par&\operatorname{Ric}_{2}^{\,\,3}=\operatorname{Ric}_{4}^{\,\,2}=\frac{1}{2}(\gamma_{1}\gamma_{7}+\gamma_{2}\gamma_{6}+2\gamma_{4}\gamma_{7}),\par\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr\operatorname{Ric}_{1}^{\,\,2}=\operatorname{Ric}_{2}^{\,\,1}=-\frac{\gamma_{6}\gamma_{7}}{2},&\operatorname{Ric}_{4}^{\,\,3}=-\gamma_{1}^{2}-\gamma_{4}^{2}+\gamma_{1}\gamma_{8}-\gamma_{3}\gamma_{6}+\gamma_{4}\gamma_{8}-\gamma_{5}\gamma_{7},\par\par\par\par\end{array} from where we get \tau=\frac{1}{2}(\gamma_{6}^{2}+\gamma_{7}^{2}) . Hence, necessarily \gamma_{6}=\gamma_{7}=0 , which ensures that \operatorname{Ric}^{2}=0 , and the associated left-invariant metric corresponds to (9) [u_{1},u_{4}]=\gamma_{1}u_{1}-\gamma_{2}u_{2}+\gamma_{3}u_{3},\quad[u_{2},u_{4}]=\gamma_{2}u_{1}+\gamma_{4}u_{2}+\gamma_{5}u_{3},\quad[u_{3},u_{4}]=\gamma_{8}u_{3}. Now a straightforward calculation shows that u_{3} determines a left-invariant recurrent null vector field since \nabla_{u_{i}}u_{3}=0 for i=1,2,3 and \nabla_{u_{4}}u_{3}=-\gamma_{8}u_{3} . Moreover, the curvature tensor satisfies R(x,y)=0 for all x,y\in u_{3}^{\perp}=\operatorname{span}\{u_{3},u_{1},u_{2}\} , while the covariant derivative satisfies \nabla_{x}R=0 for all x\in u_{3}^{\perp} . Hence, we conclude that the underlying structure of left-invariant metrics determined by Equation ( 9 ) is a plane wave (cf. [ 20 ] ), corresponding to case (3) in Theorem 2.1 . Remark 2.9 . The components C_{134}=-\tfrac{1}{2}(\gamma_{6}^{2}+\gamma_{7}^{2})\gamma_{6} and C_{234}=-\tfrac{1}{2}(\gamma_{6}^{2}+\gamma_{7}^{2})\gamma_{7} of the Cotton tensor of any metric ( 8 ) imply \gamma_{6}=\gamma_{7}=0 . Hence the Weyl tensor is harmonic if and only if the underlying structure is a plane wave given by ( 9 ). 3. Semi-direct extensions of the Heisenberg Lie group \mathcal{H}^{3} Semi-direct extensions of the Heisenberg algebra include the nilpotent Lie algebras \mathfrak{h}_{3}\times\mathbb{R} and \mathfrak{n}_{4} , which are also semi-direct extensions of the Abelian Lie algebra. Since these two cases have already been considered in the discussion of the previous section, we focus on semi-direct extensions of the Heisenberg group which are not almost Abelian (see [ 19 ] for a description of left-invariant metrics on the product Lie group \mathcal{H}^{3}\times\mathbb{R} ). We proceed as in the case of the Abelian Lie group, considering separately the cases when the induced metric on \mathcal{H}^{3} is positive definite, Lorentzian or degenerate. In this case, the use of Gröbner bases facilitates obtaining the following result, which is derived from the analysis we carry out below. Theorem 3.1 . A four-dimensional non-flat semi-direct extension of the Heisenberg Lie group which is a pp-wave not realized on \mathbb{R}^{3}\rtimes\mathbb{R} is isomorphically homothetic to a plane wave \begin{array}[]{ll}[v_{1},v_{2}]=v_{3},&[v_{1},v_{4}]=\gamma_{1}v_{1}-\gamma_{2}v_{2}+\gamma_{3}v_{3},\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[v_{2},v_{4}]=\gamma_{2}v_{1}+\gamma_{4}v_{2}+\gamma_{5}v_{3},&[v_{3},v_{4}]=(\gamma_{1}+\gamma_{4})v_{3},\end{array} where \{v_{i}\} is a pseudo-orthonormal basis with \langle v_{1},v_{1}\rangle=\langle v_{2},v_{2}\rangle=\langle v_{3},v_{4}\rangle=1 . Moreover, any Cotton-flat semi-direct extension of the Heisenberg group which is not realized on \mathbb{R}^{3}\rtimes\mathbb{R} is locally conformally flat or a plane wave as above. Remark 3.2 . Left-invariant metrics given in the above theorem are Einstein if and only if 4\gamma_{1}\gamma_{4}+1=0 , and they are locally conformally flat if and only if (\gamma_{1}-\gamma_{4})(2\gamma_{2}-1)=0 . Moreover, the Ricci tensor is parallel if and only if the metric is Einstein or \gamma_{1}+\gamma_{4}=0 . In the non-Einstein case one has therefore that plane waves in Theorem 3.1 are of type (i) if \gamma_{1}+\gamma_{4}=0 , and of type (ii) otherwise. Considering the new basis \bar{v}_{1}=v_{1} , \bar{v}_{2}=v_{2} , \bar{v}_{3}=v_{3} , \bar{v}_{4}=\gamma_{5}v_{1}-\gamma_{3}v_{2}+v_{4} , the Lie bracket transforms into [\bar{v}_{1},\bar{v}_{2}]=\bar{v}_{3},\,\,[\bar{v}_{1},\bar{v}_{4}]=\gamma_{1}\bar{v}_{1}-\gamma_{2}\bar{v}_{2},\,\,[\bar{v}_{2},\bar{v}_{4}]=\gamma_{2}\bar{v}_{1}+\gamma_{4}\bar{v}_{2},\,\,[\bar{v}_{3},\bar{v}_{4}]=(\gamma_{1}+\gamma_{4})\bar{v}_{3}, and a direct calculation shows that, when evaluating on the basis \{\bar{v}_{i}\} , \ad_{\bar{v}_{4}}=\left(\begin{array}[]{cc}A&0\\ 0&\operatorname{tr}A\end{array}\right),\quad\text{where}\,\,A=\left(\begin{array}[]{cc}-\gamma_{1}&-\gamma_{2}\\ \gamma_{2}&-\gamma_{4}\end{array}\right).\qquad\qquad Hence, the Lie algebra corresponds to \mathfrak{h}_{3}\times\mathbb{R} or \mathfrak{n}_{4} if and only if \gamma_{4}=-\gamma_{1} and \gamma_{1}^{2}=\gamma_{2}^{2} (cf. [ 3 ] ). Indeed, setting \gamma_{2}=\varepsilon\gamma_{1} , with \varepsilon^{2}=1 , and considering the basis \widetilde{v}_{1}=-\gamma_{5}v_{1}+\gamma_{3}v_{2}-v_{4},\quad\widetilde{v}_{2}=v_{3},\quad\widetilde{v}_{3}=\varepsilon v_{1}-v_{2},\quad\widetilde{v}_{4}=v_{1}, the Lie brackets transform into [\widetilde{v}_{1},\widetilde{v}_{4}]=\varepsilon\gamma_{1}\widetilde{v}_{3} and [\widetilde{v}_{3},\widetilde{v}_{4}]=\widetilde{v}_{2} . Therefore, we conclude that only if \gamma_{4}=-\gamma_{1} and \gamma_{1}^{2}=\gamma_{2}^{2} the semi-direct extensions in Theorem 3.1 are almost Abelian and therefore covered by Theorem 2.1 . 3.1. Semi-direct extensions with Riemannian normal subgroup {{\bm{\mathcal{H}^{3}$}}} Inthissectionweconsiderleft - invariantLorentzianmetricswhichareobtainedasextensionsofthethree - dimensionalRiemannianHeisenbergLiegroup H ^3 .OnemaydescribeallsuchLorentzextensionsconsideringanorthonormalbasis { e_1,e_2,e_3,e_4} ,with e_4 timelike,wheretheLiebracketsbecome\begin{equation}\begin{array}[]{ll}[e_{1},e_{2}]=\lambda_{3}e_{3},&[e_{1},e_{4}]=\gamma_{1}e_{1}-\gamma_{2}e_{2}+\gamma_{3}e_{3},\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[e_{2},e_{4}]=\gamma_{2}e_{1}+\gamma_{4}e_{2}+\gamma_{5}e_{3},&[e_{3},e_{4}]=(\gamma_{1}+\gamma_{4})e_{3},\end{array}\end{equation}where λ _3≠0 and γ _i∈ R .\par\par\vskip 6.0pt plus 2.0pt minus 2.0pt\par\par\par Westartconsideringanauxiliaryvariable λ ’_3 toindicatethat λ _3≠0 bymeansof λ _3 λ ’_3-1 .Inthepolynomialring R [ λ ’_3, γ _3, γ _5, γ _2, γ _1, γ _4, λ _3] wecomputeaGröbnerbasisfortheideal I = ⟨( Ric ^2)_j^  i ∪{ τ , λ _3 λ ’_3-1 } ⟩ andget 19 polynomials,amongwhichwefind g _1 = γ _2^2 , g _2 =(4 γ _4^2+ λ _3^2)(16 γ _4^2+ λ _3^2) γ _4^2 and g _3 = ( γ _1+2 γ _4)(2 γ _1+ γ _4) .Hence,since λ _3≠0 ,necessarily γ _1= γ _2= γ _4=0 andthepossibleleft-invariantpp-wavemetricscorrespondto\begin{equation}[e_{1},e_{2}]=\lambda_{3}e_{3},\quad[e_{1},e_{4}]=\gamma_{3}e_{3},\quad[e_{2},e_{4}]=\gamma_{5}e_{3}.\end{equation}Nowthechangeofbasis ¯ e _1 = - γ 5 λ 3 e_1+ γ 3 λ 3 e_2-e_4 ,\,\, ¯ e _2= λ _3 e_3 ,\,\, ¯ e _3 = - e_2 ,\,\, ¯ e _4 = e_1 ,\,\,transformstheLiebracketinto [ ¯ e _3, ¯ e _4] = ¯ e _2 .Thereforeweconcludethatleft-invariantmetrics\eqref{eq: H3 gR pp-waves}arealsorealizedon R ^3⋊ R .\par\par\par\begin{remark}\rm Any left-invariant metric \eqref{H3-riemannian} with harmonic curvature is also realized on $\mathbb{R}^{3}\rtimes\mathbb{R}$. Indeed, working in the same polynomial ring as above, the computation of a Gröbner basis for the ideal $\mathcal{I}=\langle C_{ijk}\cup\{\lambda_{3}\lambda^{\prime}_{3}-1\}\rangle$ leads to $9$ polynomials, three of them being $\mathbf{g}_{1}=\gamma_{2}(4\gamma_{4}^{2}+\lambda_{3}^{2})$, $\mathbf{g}_{2}=\gamma_{4}(4\gamma_{4}^{2}+\lambda_{3}^{2})$ and $\mathbf{g}_{3}=\gamma_{1}-\gamma_{4}$, which imply $\gamma_{1}=\gamma_{2}=\gamma_{4}=0$ as above. \end{remark}\par\par\par\par\par\par\par\par\par\par\par\par\par\par\par\par\par\par\par\par\par\par\par\par\par\par\par\par\par\par\par\par\par\par 3.2. Semi-direct extensions with Lorentzian normal subgroup {{\bm{\mathcal{H}^{3}$}}} ItwasshownbyRahmani [ 25 ] thattherearethreenon - homotheticclassesofleft - invariantLorentzmetricson H ^3 correspondingtostructureoperatoroftypesIaandII.Ifthestructureoperator L isdiagonalizable,onedistinguishesthetwocasescorrespondingto ker L beingpositivedefiniteorofLorentziansignature.IfthestructureoperatorisoftypeII,thenitisnecessarilynilpotent.Weshallnowanalyzethesethreecasesseparately.\par\par\par\par 3.2.1. The structure operator is diagonalizable of rank one with positive definite kernel In this case there exists an orthonormal basis \{e_{1},e_{2},e_{3},e_{4}\} of \mathfrak{g}=\mathfrak{h}_{3}\rtimes\mathbb{R} , with e_{3} timelike, so that (12) \begin{array}[]{ll}[e_{1},e_{2}]=-\lambda_{3}e_{3},&[e_{1},e_{4}]=\gamma_{1}e_{1}-\gamma_{2}e_{2}+\gamma_{3}e_{3},\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[e_{2},e_{4}]=\gamma_{2}e_{1}+\gamma_{4}e_{2}+\gamma_{5}e_{3},&[e_{3},e_{4}]=(\gamma_{1}+\gamma_{4})e_{3},\end{array} where \lambda_{3}\neq 0 and \gamma_{i}\in\mathbb{R} . We take an auxiliary variable \lambda^{\prime}_{3} to indicate that \lambda_{3}\neq 0 by means of the polynomial \lambda_{3}\lambda^{\prime}_{3}-1 and compute a Gröbner basis for the ideal \mathcal{I}=\langle\left(\operatorname{Ric}^{2}\right)_{j}^{\,\,i}\cup\{\tau,\lambda_{3}\lambda^{\prime}_{3}-1\}\rangle in the polynomial ring \mathbb{R}[\lambda^{\prime}_{3},\gamma_{1},\gamma_{2},\gamma_{3},\gamma_{5},\gamma_{4},\lambda_{3}] . As a consequence we obtain 20 polynomials, two of them being \mathbf{g}_{1}=(4\gamma_{4}^{2}+\lambda_{3}^{2})(16\gamma_{4}^{2}+\lambda_{3}^{2})\gamma_{4}^{2} and \mathbf{g}_{2}=\gamma_{3}^{2}+\gamma_{5}^{2}+\lambda_{3}^{2}+10\gamma_{1}\gamma_{4} . Hence \gamma_{4}=0 , which leads to \mathbf{g}_{2}\neq 0 since \lambda_{3}\neq 0 . Therefore there is no left-invariant pp-wave metric in this case. Remark 3.4 . Observe that no left-invariant metric ( 12 ) has harmonic curvature. Indeed, a direct calculation gives C_{123}=\left((\gamma_{1}+\gamma_{4})^{2}+\gamma_{3}^{2}+\gamma_{5}^{2}+\lambda_{3}^{2}\right)\lambda_{3} , which is non-zero. 3.2.2. The structure operator is diagonalizable of rank one and with Lorentzian kernel In this setting, it is possible to choose an orthonormal basis \{e_{1},e_{2},e_{3},e_{4}\} of \mathfrak{g}=\mathfrak{h}_{3}\rtimes\mathbb{R} , with e_{3} timelike, so that the left-invariant metrics are described by (13) \begin{array}[]{ll}[e_{1},e_{3}]=-\lambda_{2}e_{2},&[e_{1},e_{4}]=\gamma_{1}e_{1}+\gamma_{2}e_{2}+\gamma_{3}e_{3},\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[e_{2},e_{4}]=\gamma_{4}e_{2},&[e_{3},e_{4}]=\gamma_{5}e_{1}+\gamma_{6}e_{2}-(\gamma_{1}-\gamma_{4})e_{3},\end{array} where \lambda_{2}\neq 0 and \gamma_{i}\in\mathbb{R} . We proceed as in the previous cases. Let \lambda_{2}^{\prime} be an auxiliary variable so that the polynomial \lambda_{2}\lambda_{2}^{\prime}-1 reflects the non-vanishing of \lambda_{2} . We consider the ideal \mathcal{I}=\langle\left(\operatorname{Ric}^{2}\right)_{j}^{\,\,i}\cup\{\tau,\lambda_{2}\lambda^{\prime}_{2}-1\}\rangle in the polynomial ring \mathbb{R}[\lambda_{2}^{\prime},\gamma_{2},\gamma_{6},\gamma_{1},\gamma_{3},\gamma_{4},\gamma_{5},\lambda_{2}] . Computing a Gröbner basis we get a set of 48 polynomials containing \begin{array}[]{l}\mathbf{g_{1}}=(16\gamma_{4}^{2}+\lambda_{2}^{2})\gamma_{4}^{3},\quad\mathbf{g_{2}}=(16\gamma_{4}^{2}+\lambda_{2}^{2})\gamma_{5}^{3},\quad\mathbf{g_{3}}=(\gamma_{3}+\gamma_{5})(\gamma_{3}^{2}+\gamma_{5}^{2}-\gamma_{3}\gamma_{5}),\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr\mathbf{g_{4}}=20\gamma_{1}^{2}-7\gamma_{3}^{2}-40\gamma_{4}^{2}-7\gamma_{5}^{2}-20\gamma_{1}\gamma_{4}+6\gamma_{3}\gamma_{5}.\end{array} Since \lambda_{2}\neq 0 it follows that \gamma_{1}=\gamma_{3}=\gamma_{4}=\gamma_{5}=0 and the possible left-invariant pp-wave metrics are given by (14) [e_{1},e_{3}]=-\lambda_{2}e_{2},\quad[e_{1},e_{4}]=\gamma_{2}e_{2},\quad[e_{3},e_{4}]=\gamma_{6}e_{2}. Note that the change of basis \bar{e}_{1}=-\tfrac{\gamma_{6}}{\lambda_{2}}e_{1}+\tfrac{\gamma_{2}}{\lambda_{2}}e_{3}+e_{4} , \bar{e}_{2}=\lambda_{2}e_{2} , \bar{e}_{3}=e_{1} , \bar{e}_{4}=-e_{3} , transforms the Lie bracket into [\bar{e}_{3},\bar{e}_{4}]=\bar{e}_{2} . Therefore we conclude that left-invariant metrics given by Equation ( 14 ) are also realized on \mathbb{R}^{3}\rtimes\mathbb{R} . Remark 3.5 . Any Cotton-flat left-invariant metric ( 13 ) is also realized on \mathbb{R}^{3}\rtimes\mathbb{R} . Indeed, working in the same polynomial ring as above we compute a Gröbner basis for the ideal \mathcal{I}=\langle C_{ijk}\cup\{\lambda_{2}\lambda^{\prime}_{2}-1\}\rangle and get 19 polynomials, among which we find \mathbf{g}_{1}=\gamma_{3}(\gamma_{4}^{2}+\lambda_{2}^{2}) , \mathbf{g}_{2}=\gamma_{4}(\gamma_{4}^{2}+\lambda_{2}^{2}) , \mathbf{g}_{3}=\gamma_{5}(\gamma_{4}^{2}+\lambda_{2}^{2}) and \mathbf{g}_{4}=4\gamma_{1}^{2}-\gamma_{4}^{2}-2\gamma_{3}(\gamma_{3}-\gamma_{5}) . Hence, \gamma_{1}=\gamma_{3}=\gamma_{4}=\gamma_{5}=0 as above. 3.2.3. The structure operator is 2-step nilpotent In this case there exists a pseudo-orthonormal basis \{u_{1},u_{2},u_{3},u_{4}\} of \mathfrak{g}=\mathfrak{h}_{3}\rtimes\mathbb{R} , with \langle u_{1},u_{2}\rangle=\langle u_{3},u_{3}\rangle=\langle u_{4},u_{4}\rangle=1 , so that (15) \begin{array}[]{ll}[u_{1},u_{3}]=-\varepsilon u_{2},&[u_{1},u_{4}]=\gamma_{1}u_{1}+\gamma_{2}u_{2}+\gamma_{3}u_{3},\par\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[u_{2},u_{4}]=\gamma_{4}u_{2},&[u_{3},u_{4}]=\gamma_{5}u_{1}+\gamma_{6}u_{2}-(\gamma_{1}-\gamma_{4})u_{3},\end{array} with \varepsilon^{2}=1 and \gamma_{i}\in\mathbb{R} . We consider the polynomial ring \mathbb{R}[\varepsilon,\gamma_{2},\gamma_{3},\gamma_{6},\gamma_{1},\gamma_{4},\gamma_{5}] . For the ideal \mathcal{I} generated by \left(\operatorname{Ric}^{2}\right)_{j}^{\,\,i}\cup\{\tau,\varepsilon^{2}-1\} the computation of a Gröbner basis provides 52 polynomials, among which we find \mathbf{g_{1}}=\gamma_{1}^{5} , \mathbf{g_{2}}=\gamma_{4}^{4} and \mathbf{g_{3}}=\gamma_{5}^{3} . Hence \gamma_{1}=\gamma_{4}=\gamma_{5}=0 so that the possible left-invariant pp-wave metrics are given by (16) [u_{1},u_{3}]=-\varepsilon u_{2},\quad[u_{1},u_{4}]=\gamma_{2}u_{2}+\gamma_{3}u_{3},\quad[u_{3},u_{4}]=\gamma_{6}u_{2}. If \gamma_{3}\neq 0 then the change of basis \bar{u}_{1}=-\varepsilon\gamma_{6}u_{1}+\varepsilon\gamma_{2}u_{3}+u_{4} , \bar{u}_{2}=-\varepsilon u_{2} , \bar{u}_{3}=\gamma_{3}u_{3} , \bar{u}_{4}=-u_{1} , transforms the Lie bracket into [\bar{u}_{1},\bar{u}_{4}]=\bar{u}_{3} , [\bar{u}_{3},\bar{u}_{4}]=\gamma_{3}\bar{u}_{2} , while if \gamma_{3}=0 we consider \bar{u}_{1}=-\varepsilon\gamma_{6}u_{1}+\varepsilon\gamma_{2}u_{3}+u_{4} , \bar{u}_{2}=\varepsilon u_{2} , \bar{u}_{3}=u_{1} , \bar{u}_{4}=-u_{3} , and the Lie bracket transforms into [\bar{u}_{3},\bar{u}_{4}]=\bar{u}_{2} . Therefore left-invariant metrics given by Equation ( 16 ) are also realized on \mathbb{R}^{3}\rtimes\mathbb{R} . Remark 3.6 . Next we show that left-invariant metrics ( 15 ) with harmonic curvature which are not realized on \mathbb{R}^{3}\rtimes\mathbb{R} are necessarily locally conformally flat. Since C_{123}=\frac{3\varepsilon}{4}\gamma_{5}^{2} and C_{131}=-\frac{\varepsilon}{4}\left(4(3\gamma_{1}-\gamma_{4})\gamma_{4}-\gamma_{5}(\gamma_{3}+7\gamma_{6})\right) , it follows that \gamma_{5}=0 and either \gamma_{4}=0 or \gamma_{4}=3\gamma_{1}\neq 0 . If \gamma_{5}=\gamma_{4}=0 then C_{142}=-\frac{3}{4}\gamma_{1}^{3} , so that \gamma_{1}=0 and the metric is also realized on \mathbb{R}^{3}\rtimes\mathbb{R} . Finally, if \gamma_{5}=0 and \gamma_{4}=3\gamma_{1}\neq 0 , then C_{143}=\frac{5}{2}\gamma_{1}^{2}(\gamma_{3}+\gamma_{6}) implies \gamma_{6}=-\gamma_{3} and the space is locally conformally flat. 3.3. Semi-direct extensions with degenerate normal subgroup \bm{\mathcal{H}^{3}} Let \mathfrak{g}=\mathfrak{h}_{3}\rtimes\mathbb{R} be a four-dimensional Lie algebra with a Lorentzian inner product \langle\cdot,\cdot\rangle which restricts to a degenerate inner product on \mathfrak{h}_{3} . We consider the two-distinct situations when the restriction of the metric to the derived subalgebra \mathfrak{h}^{\prime}_{3} is degenerate or spacelike. 3.3.1. \bm{{\mathfrak{h}_{3}^{\prime}=\operatorname{\bf span}\{v\}}} is a null subspace In this case setting u_{3}=v we can take a pseudo-orthonormal basis \{u_{1},u_{2},u_{3},u_{4}\} of \mathfrak{g}=\mathfrak{h}_{3}\rtimes\mathbb{R} , with \langle u_{1},u_{1}\rangle=\langle u_{2},u_{2}\rangle=\langle u_{3},u_{4}\rangle=1 , so that (17) \begin{array}[]{ll}[u_{1},u_{2}]=\lambda_{1}u_{3},&[u_{1},u_{4}]=\gamma_{1}u_{1}-\gamma_{2}u_{2}+\gamma_{3}u_{3},\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[u_{2},u_{4}]=\gamma_{2}u_{1}+\gamma_{4}u_{2}+\gamma_{5}u_{3},&[u_{3},u_{4}]=(\gamma_{1}+\gamma_{4})u_{3},\end{array} where \lambda_{1}\neq 0 and \gamma_{i}\in\mathbb{R} . A direct calculation shows that, with no additional assumptions, the only non-zero component of the Ricci tensor is given by \rho(u_{4},u_{4})=\frac{1}{2}(4\gamma_{1}\gamma_{4}+\lambda_{1}^{2}) , which proves that the Ricci operator is isotropic. Moreover, \nabla_{u_{i}}u_{3}=0 for i=1,2,3 and \nabla_{u_{4}}u_{3}=-(\gamma_{1}+\gamma_{4})u_{3} , so that u_{3} determines a null recurrent left-invariant vector field. Furthermore, a straightforward calculation shows that R(x,y)=0 and \nabla_{x}R=0 for all x,y\in u_{3}^{\perp}=\operatorname{span}\{u_{3},u_{1},u_{2}\} . Hence left-invariant metrics determined by ( 17 ) are plane waves (see [ 20 ] ). Finally, since \lambda_{1}\neq 0 , we may take \lambda_{1}=1 working in the homothetic class of the initial metric, corresponding to the metrics given in Theorem 3.1 . 3.3.2. \bm{{\mathfrak{h}_{3}^{\prime}=\operatorname{span}\{v\}}} is a spacelike subspace We set u_{1}=\frac{v}{\|v\|} and consider a pseudo-orthonormal basis \{u_{1},u_{2},u_{3},u_{4}\} of \mathfrak{g}=\mathfrak{h}_{3}\rtimes\mathbb{R} , with \langle u_{1},u_{1}\rangle=\langle u_{2},u_{2}\rangle=\langle u_{3},u_{4}\rangle=1 , so that (18) \begin{array}[]{l}[u_{1},u_{4}]=\gamma_{1}u_{1},\quad[u_{2},u_{3}]=\lambda_{3}u_{1},\quad[u_{2},u_{4}]=\gamma_{2}u_{1}+\gamma_{3}u_{2}+\gamma_{4}u_{3},\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[u_{3},u_{4}]=\gamma_{5}u_{1}+\gamma_{6}u_{2}+(\gamma_{1}-\gamma_{3})u_{3},\end{array} where \lambda_{3}\neq 0 and \gamma_{i}\in\mathbb{R} . We start considering an auxiliary variable \lambda^{\prime}_{3} to indicate that \lambda_{3}\neq 0 by means of \lambda_{3}\lambda^{\prime}_{3}-1 , and the ideal \mathcal{I}=\langle\left(\operatorname{Ric}^{2}\right)_{j}^{\,\,i}\cup\{\tau,\lambda_{3}\lambda^{\prime}_{3}-1\}\rangle in the polynomial ring \mathbb{R}[\lambda_{3}^{\prime},\lambda_{3},\gamma_{2},\gamma_{5},\gamma_{6},\gamma_{4},\gamma_{3},\gamma_{1}] . Computing a Gröbner basis for this ideal we get 27 polynomials, four of them being \mathbf{g_{1}}=\gamma_{1}^{3} , \mathbf{g_{2}}=2\gamma_{3}^{2}-3\gamma_{1}^{2}+2\gamma_{1}\gamma_{3} , \mathbf{g_{3}}=\gamma_{4}^{3} and \mathbf{g_{4}}=\gamma_{6}^{2} . Hence \gamma_{1}=\gamma_{3}=\gamma_{4}=\gamma_{6}=0 and the possible left-invariant pp-wave metrics are given by (19) [u_{2},u_{3}]=\lambda_{3}u_{1},\quad[u_{2},u_{4}]=\gamma_{2}u_{1},\quad[u_{3},u_{4}]=\gamma_{5}u_{1}. Now the change of basis \bar{u}_{1}=\tfrac{\gamma_{5}}{\lambda_{3}}u_{2}-\tfrac{\gamma_{2}}{\lambda_{3}}u_{3}+u_{4} , \bar{u}_{2}=\lambda_{3}u_{1} , \bar{u}_{3}=u_{3} , \bar{u}_{4}=-u_{2} , transforms the Lie bracket into [\bar{u}_{3},\bar{u}_{4}]=\bar{u}_{2} . Therefore we conclude that left-invariant metrics given by Equation ( 19 ) are also realized on \mathbb{R}^{3}\rtimes\mathbb{R} . Remark 3.7 . Any Cotton-flat left-invariant metric ( 18 ) is also realized on \mathbb{R}^{3}\rtimes\mathbb{R} . Indeed, considering the same polynomial ring as above and computing a Gröbner basis for \mathcal{I}=\langle C_{ijk}\cup\{\lambda_{3}\lambda^{\prime}_{3}-1\}\rangle , one obtains 7 polynomials including \mathbf{g}_{1}=\gamma_{1} , \mathbf{g}_{2}=\gamma_{3} , \mathbf{g}_{3}=\gamma_{4} and \mathbf{g}_{4}=\gamma_{6} . Hence, \gamma_{1}=\gamma_{3}=\gamma_{4}=\gamma_{6}=0 as above. 4. Semi-direct extensions of the Euclidean and Poincaré Lie groups If a semi-direct extension of the Euclidean or Poincaré Lie groups is unimodular then the results in [ 3 ] imply that it reduces to a direct product E(1,1)\times\mathbb{R} or \widetilde{E}(2)\times\mathbb{R} , and thus it is is isomorphic to a semi-direct extension \mathbb{R}^{3}\rtimes\mathbb{R} of the Abelian Lie group covered by the analysis in Section 2 . Taking this fact into account, the use of Gröbner bases becomes in this case a fundamental tool to prove the following result, which is obtained as a consequence of the subsequent analysis. Theorem 4.1 . A four-dimensional semi-direct extension of the Euclidean or the Poincaré Lie groups which is a non-unimodular pp-wave is isomorphically homothetic to a left-invariant plane wave metric on \operatorname{Aff}(\mathbb{C}) determined by \begin{array}[]{lll}[v_{1},v_{3}]=v_{2},&[v_{2},v_{3}]=-v_{1},\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[v_{1},v_{4}]=\gamma_{1}v_{1}+\gamma_{2}v_{2},&[v_{2},v_{4}]=-\gamma_{2}v_{1}+\gamma_{1}v_{2},\qquad\gamma_{1}\neq 0,\end{array} where \{v_{i}\} is a pseudo-orthonormal basis with \langle v_{1},v_{1}\rangle=\langle v_{2},v_{2}\rangle=\langle v_{3},v_{4}\rangle=1 . Moreover non-unimodular semi-direct extensions of the Euclidean or Poincaré Lie groups have harmonic curvature if and only if they are locally symmetric. Remark 4.2 . Non-unimodular extensions of the Euclidean and Poincaré Lie groups are isomorphic to the affine groups determined by the Lie algebras \mathfrak{aff}(\mathbb{C}) and \mathfrak{aff}(\mathbb{R})\times\mathfrak{aff}(\mathbb{R}) , respectively. Hence it also follows from the previous theorem that there are no left-invariant pp-wave metrics on \mathfrak{aff}(\mathbb{R})\times\mathfrak{aff}(\mathbb{R}) . Left-invariant metrics given in Theorem 4.1 are locally conformally flat and locally symmetric but never Einstein. Hence they are plane waves of type (i). 4.1. Extensions of the Riemannian Euclidean and Poincaré Lie groups Let G=G_{3}\rtimes\mathbb{R} with G_{3}=E(1,1) or G_{3}=\widetilde{E}(2) so that the restriction of the metric to G_{3} is positive definite. In this case there exists an orthonormal basis \{e_{1},e_{2},e_{3},e_{4}\} of the Lie algebra \mathfrak{g}=\mathfrak{g}_{3}\rtimes\mathbb{R} , with e_{4} timelike, so that (20) \begin{array}[]{lll}[e_{1},e_{3}]\!=\!-\lambda_{2}e_{2},&[e_{2},e_{3}]\!=\!\lambda_{1}e_{1},&\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr{[e_{1},e_{4}]}\!=\!\gamma_{1}e_{1}+\gamma_{2}\lambda_{2}e_{2},&{[e_{2},e_{4}]}\!=\!-\gamma_{2}\lambda_{1}e_{1}+\gamma_{1}e_{2},&[e_{3},e_{4}]\!=\!\gamma_{3}e_{1}+\gamma_{4}e_{2},\end{array} where \lambda_{1}\lambda_{2}\neq 0 and \gamma_{i}\in\mathbb{R} . A direct calculation shows that the Lie algebra is unimodular if and only if \gamma_{1}=0 . In the non-unimodular case we introduce an auxiliary variable \gamma^{\prime}_{1} and use the polynomial \gamma_{1}\gamma^{\prime}_{1}-1 to indicate that \gamma_{1}\neq 0 . Considering the polynomial ring \mathbb{R}[\gamma_{2},\gamma_{3},\gamma_{4},\lambda_{1},\lambda_{2},\gamma^{\prime}_{1},\gamma_{1}] and the ideal \mathcal{I}=\langle\left(\operatorname{Ric}^{2}\right)_{j}^{\,\,i}\cup\{\tau,\gamma_{1}\gamma^{\prime}_{1}-1\}\rangle we compute a Gröbner basis and obtain 9 polynomials, one of them being \mathbf{g}=(\gamma_{1}^{2}+\lambda_{2}^{2})(9\gamma_{1}^{2}+\lambda_{2}^{2})(64\gamma_{1}^{4}+48\gamma_{1}^{2}\lambda_{2}^{2}+\lambda_{2}^{4}). Clearly \mathbf{g}\neq 0 , so that we conclude the non-existence of left-invariant pp-wave metrics in the non-unimodular setting. Remark 4.3 . In order to analyze the Cotton-flat condition, we restrict to the non-unimodular case and consider the same polynomial ring as above, computing a Gröbner basis for the ideal \mathcal{I}=\langle C_{ijk}\cup\{\gamma_{1}\gamma^{\prime}_{1}-1\}\rangle . One gets 5 polynomials, among which we have \mathbf{g}_{1}=\gamma_{3} , \mathbf{g}_{2}=\gamma_{4} , \mathbf{g}_{3}=\lambda_{1}^{2}-\lambda_{2}^{2} and \mathbf{g}_{4}=-(\lambda_{1}-\lambda_{2})(\gamma_{1}^{2}-(\gamma_{2}^{2}-1)\lambda_{2}^{2}) . Hence, \gamma_{3}=\gamma_{4}=0 and either \lambda_{1}=\lambda_{2} or \lambda_{1}=-\lambda_{2} , \gamma_{1}^{2}-(\gamma_{2}^{2}-1)\lambda_{2}^{2}=0 . Finally, a direct calculation shows that in any of these cases the left-invariant metric ( 20 ) is locally symmetric. 4.2. Extensions of the Lorentzian Euclidean and Poincaré Lie groups We consider the different possibilities for the Jordan normal form of the structure operator L . 4.2.1. Diagonalizable structure operator with spacelike \bm{\ker L} In this case the left-invariant metrics are described in an orthonormal basis \{e_{1},e_{2},e_{3},e_{4}\} , with e_{3} timelike, by (21) \begin{array}[]{lll}[e_{1},e_{2}]\!=\!-\lambda_{3}e_{3},&[e_{1},e_{3}]\!=\!-\lambda_{2}e_{2},&\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr{[e_{1},e_{4}]}\!=\!\gamma_{1}e_{2}+\gamma_{2}e_{3},&[e_{2},e_{4}]\!=\!\gamma_{3}e_{2}+\gamma_{4}\lambda_{3}e_{3},&[e_{3},e_{4}]\!=\!\gamma_{4}\lambda_{2}e_{2}+\gamma_{3}e_{3},\end{array} where \lambda_{2}\lambda_{3}\neq 0 and \gamma_{i}\in\mathbb{R} . The Lie algebra is unimodular if and only if \gamma_{3}=0 . As in the previous case we consider the non-unimodular setting and introduce an auxiliary variable \gamma^{\prime}_{3} to indicate that \gamma_{3}\neq 0 by means of the polynomial \gamma_{3}\gamma^{\prime}_{3}-1 . Let \mathcal{I} be the ideal generated by \left(\operatorname{Ric}^{2}\right)_{j}^{\,\,i}\cup\{\tau,\gamma_{3}\gamma^{\prime}_{3}-1\} in the polynomial ring \mathbb{R}[\gamma_{1},\gamma_{2},\gamma_{4},\lambda_{2},\lambda_{3},\gamma^{\prime}_{3},\gamma_{3}] . The computation of a Gröbner basis for this ideal yields 11 polynomials, one of them being \mathbf{g}=(\gamma_{3}^{2}+\lambda_{3}^{2})(9\gamma_{3}^{2}+\lambda_{3}^{2})(64\gamma_{3}^{4}+48\gamma_{3}^{2}\lambda_{3}^{2}+\lambda_{3}^{4}) . Since \lambda_{3}\neq 0 we have \mathbf{g}\neq 0 and we conclude the non-existence of left-invariant pp-wave metrics in the non-unimodular case. Remark 4.4 . Any non-unimodular Cotton-flat left-invariant metric ( 21 ) is locally symmetric. Indeed, considering the ideal \mathcal{I}=\langle C_{ijk}\cup\{\gamma_{3}\gamma^{\prime}_{3}-1\}\rangle in the same polynomial ring as above, we compute a Gröbner basis to obtain a set of 5 polynomials containing \mathbf{g}_{1}=\gamma_{1} , \mathbf{g}_{2}=\gamma_{2} and \mathbf{g}_{3}=(\lambda_{2}-\lambda_{3})(\gamma_{3}^{2}+(\gamma_{4}^{2}+1)\lambda_{3}^{2}) . Thus, \gamma_{1}=\gamma_{2}=0 and \lambda_{2}=\lambda_{3} , from where it follows that the metric is locally symmetric. 4.2.2. Diagonalizable structure operator with timelike \bm{\ker L} The corresponding left-invariant metrics are described in an orthonormal basis \{e_{1},e_{2},e_{3},e_{4}\} , with e_{3} timelike, by (22) \begin{array}[]{lll}[e_{1},e_{3}]\!=\!-\lambda_{2}e_{2},&[e_{2},e_{3}]\!=\!\lambda_{1}e_{1},&\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr{[e_{1},e_{4}]}\!=\!\gamma_{1}e_{1}+\gamma_{2}\lambda_{2}e_{2},&[e_{2},e_{4}]\!=\!-\gamma_{2}\lambda_{1}e_{1}+\gamma_{1}e_{2},&[e_{3},e_{4}]\!=\!\gamma_{3}e_{1}+\gamma_{4}e_{2},\end{array} where \lambda_{1}\lambda_{2}\neq 0 and \gamma_{i}\in\mathbb{R} . One easily checks that the Lie algebra is unimodular if and only if \gamma_{1}=0 . Assuming \gamma_{1}\neq 0 and adding an auxiliary variable \gamma_{1}^{\prime} to use the polynomial \gamma_{1}\gamma^{\prime}_{1}-1 , we consider the polynomial ring \mathbb{R}[\gamma_{2},\gamma_{3},\gamma_{4},\lambda_{1},\lambda_{2},\gamma^{\prime}_{1},\gamma_{1}] . We compute a Gröbner basis for the ideal \mathcal{I}=\langle\left(\operatorname{Ric}^{2}\right)_{j}^{\,\,i}\cup\{\tau,\gamma_{1}\gamma^{\prime}_{1}-1\}\rangle and get a set of 9 polynomials, among which we find \mathbf{g}=(\gamma_{1}^{2}+\lambda_{2}^{2})(9\gamma_{1}^{2}+\lambda_{2}^{2})(64\gamma_{1}^{4}+48\gamma_{1}^{2}\lambda_{2}^{2}+\lambda_{2}^{4}) . Since \lambda_{2}\neq 0 it follows that \mathbf{g}\neq 0 , and therefore we conclude the non-existence of left-invariant pp-wave metrics in the non-unimodular setting. Remark 4.5 . We proceed exactly as in Remark 4.3 to get that, in the non-unimodular case, any Cotton-flat left-invariant metric ( 22 ) is locally symmetric. 4.2.3. Structure operator \bm{L} with a complex eigenvalue The left-invariant metrics are determined by (23) \begin{array}[]{l}[e_{1},e_{2}]\!=\!-\beta e_{2}-\alpha e_{3},\qquad[e_{1},e_{3}]\!=\!-\alpha e_{2}+\beta e_{3},\qquad[e_{1},e_{4}]\!=\!\gamma_{1}e_{2}+\gamma_{2}e_{3},\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[e_{2},e_{4}]\!=\!2\gamma_{3}\beta e_{2}+(\gamma_{3}-\gamma_{4})\alpha e_{3},\quad[e_{3},e_{4}]\!=\!(\gamma_{3}-\gamma_{4})\alpha e_{2}+2\gamma_{4}\beta e_{3},\end{array} where \beta\neq 0 , \alpha,\gamma_{i}\in\mathbb{R} and \{e_{1},e_{2},e_{3},e_{4}\} is an orthonormal basis with e_{3} timelike. In this case the computation of a Gröbner basis for the ideal \mathcal{I}=\langle\left(\operatorname{Ric}^{2}\right)_{j}^{\,\,i}\cup\{\tau\}\rangle in the polynomial ring \mathbb{R}[\alpha,\gamma_{2},\gamma_{3},\gamma_{4},\gamma_{1},\beta] provides a set of 74 elements containing the polynomial \mathbf{g}=\left((8\gamma_{4}^{2}+2)\beta^{2}+\gamma_{1}^{2}\right)^{2}\left((\beta^{2}+2\gamma_{1}^{2})\beta^{2}+2\gamma_{1}^{4}\right)(8\beta^{2}+\gamma_{1}^{2})\beta . Note that \mathbf{g} does not vanish since \beta\neq 0 . Hence we conclude that left-invariant metrics in this case are never pp-waves. Remark 4.6 . Any Cotton-flat left-invariant metric ( 23 ) is locally symmetric. Indeed, considering the component C_{144}=-\frac{3}{4}(\gamma_{1}^{2}+\gamma_{2}^{2})\beta , one has that \gamma_{1}=\gamma_{2}=0 . Now, C_{231}=4\left((\gamma_{3}-\gamma_{4})^{2}+1\right)\alpha\beta^{2} , and therefore \alpha=0 . With these conditions a direct calculation shows that the vanishing of the Cotton tensor is determined by the component C_{122}=-2(4\gamma_{3}\gamma_{4}-1)\beta^{3} . Hence, 4\gamma_{3}\gamma_{4}=1 and one easily checks that the corresponding metric is locally symmetric. 4.2.4. Structure operator of type II with degenerate kernel In this case the left-invariant metrics are described, in terms of a pseudo-orthonormal basis \{u_{1},u_{2},u_{3},u_{4}\} of the Lie algebra with \langle u_{1},u_{2}\rangle=\langle u_{3},u_{3}\rangle=\langle u_{4},u_{4}\rangle=1 , by the Lie brackets (24) \begin{array}[]{lll}[u_{1},u_{2}]\!=\!\lambda_{2}u_{3},&[u_{1},u_{3}]\!=\!{-\varepsilon}u_{2},&\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[u_{1},u_{4}]\!=\!\gamma_{1}u_{2}+\gamma_{2}u_{3},&[u_{2},u_{4}]\!=\!\gamma_{3}u_{2}+\gamma_{4}\lambda_{2}u_{3},&[u_{3},u_{4}]\!=\!\gamma_{3}u_{3}-\varepsilon\gamma_{4}u_{2},\end{array} where \lambda_{2}\neq 0 , \varepsilon=\pm 1 and \gamma_{i}\in\mathbb{R} . Let \mathcal{I} be the ideal generated by \left(\operatorname{Ric}^{2}\right)_{j}^{\,\,i}\cup\{\tau,\varepsilon^{2}-1\} in the polynomial ring \mathbb{R}[\gamma_{1},\gamma_{2},\gamma_{3},\gamma_{4},\varepsilon,\lambda_{2}] . We compute a Gröbner basis for this ideal and get 38 polynomials, one of them being \mathbf{g}=\lambda_{2}^{5}\neq 0 . Hence, as in the previous case, left-invariant metrics in this case are never pp-waves. Remark 4.7 . To analyze the vanishing of the Cotton tensor we calculate the components C_{344}=-\frac{1}{4}\varepsilon\gamma_{4}^{2}\lambda_{2}^{2} and C_{132}=\frac{1}{2}(\gamma_{3}^{2}+\lambda_{2}^{2}-2\gamma_{2}\gamma_{4}\lambda_{2})\lambda_{2} . Hence, \gamma_{4}=0 and C_{132}=\frac{1}{2}(\gamma_{3}^{2}+\lambda_{2}^{2})\lambda_{2} does not vanish since \lambda_{2}\neq 0 , thus showing that no left-invariant metric ( 24 ) may have harmonic curvature. 4.2.5. Structure operator of type II with spacelike kernel The left-invariant metrics are described by (25) \begin{array}[]{lll}[u_{1},u_{3}]\!=\!-\lambda_{1}u_{1}\!-\!\varepsilon u_{2},&\![u_{2},u_{3}]\!=\!\lambda_{1}u_{2},\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[u_{1},u_{4}]\!=\!\gamma_{1}u_{1}\!+\!\gamma_{2}u_{2},&\![u_{2},u_{4}]\!=\!(\gamma_{1}\!-\!2\varepsilon\gamma_{2}\lambda_{1})u_{2},&\![u_{3},u_{4}]\!=\!\gamma_{3}u_{1}\!+\!\gamma_{4}u_{2},\end{array} where \lambda_{1}\neq 0 , \varepsilon=\pm 1 , \gamma_{i}\in\mathbb{R} and \{u_{1},u_{2},u_{3},u_{4}\} is a pseudo-orthonormal basis of the Lie algebra with \langle u_{1},u_{2}\rangle=\langle u_{3},u_{3}\rangle=\langle u_{4},u_{4}\rangle=1 . A direct calculation shows that the Lie algebra is unimodular if and only if \varepsilon\gamma_{2}\lambda_{1}-\gamma_{1}=0 . We consider the non-unimodular case and introduce an auxiliary variable \varphi to indicate that \varepsilon\gamma_{2}\lambda_{1}-\gamma_{1}\neq 0 using the polynomial (\varepsilon\gamma_{2}\lambda_{1}-\gamma_{1})\varphi-1 . In the polynomial ring \mathbb{R}[\varphi,\varepsilon,\lambda_{1},\gamma_{1},\gamma_{2},\gamma_{3},\gamma_{4}] we compute a Gröbner basis for the ideal \mathcal{I}=\langle\left(\operatorname{Ric}^{2}\right)_{j}^{\,\,i}\cup\{\tau,(\varepsilon\gamma_{2}\lambda_{1}-\gamma_{1})\varphi-1\}\rangle and observe that it reduces to \{1\} . Thus we conclude the non-existence of left-invariant pp-wave metrics in the non-unimodular case. Remark 4.8 . Left-invariant metrics ( 25 ) are never Cotton-flat. Indeed, vanishing of C_{232}=-\frac{5}{4}\gamma_{3}^{2}\lambda_{1} implies \gamma_{3}=0 , and then C_{134}=\frac{1}{2}\gamma_{4}(\gamma_{1}^{2}-\varepsilon\gamma_{1}\gamma_{2}\lambda_{1}-\lambda_{1}^{2}) , while C_{341}=\frac{1}{2}\gamma_{4}(2\gamma_{1}^{2}-\varepsilon\gamma_{1}\gamma_{2}\lambda_{1}+\lambda_{1}^{2}) . Hence, C_{134}-C_{341}=-\frac{1}{2}\gamma_{4}(\gamma_{1}^{2}+2\lambda_{1}^{2}) , so that \gamma_{4}=0 . Finally, using \gamma_{3}=\gamma_{4}=0 we calculate C_{131}=-2\varepsilon\left(\gamma_{1}^{2}+(\gamma_{2}^{2}+2)\lambda_{1}^{2}\right) , which does not vanish. 4.2.6. Structure operator of type III In this case the left-invariant metrics are described by (26) \begin{array}[]{lll}[u_{1},u_{2}]=u_{1},&[u_{2},u_{3}]=u_{3},\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[u_{1},u_{4}]=\gamma_{1}u_{1},&[u_{2},u_{4}]=\gamma_{2}u_{1}+\gamma_{3}u_{3},&[u_{3},u_{4}]=\gamma_{4}u_{3},\end{array} where \gamma_{i}\in\mathbb{R} and \{u_{1},u_{2},u_{3},u_{4}\} is a pseudo-orthonormal basis of the Lie algebra with \langle u_{1},u_{2}\rangle=\langle u_{3},u_{3}\rangle=\langle u_{4},u_{4}\rangle=1 . One easily checks that the Lie algebra is unimodular if and only if \gamma_{1}+\gamma_{4}=0 . In the non-unimodular case, let \varphi be an auxiliary variable which reflects the fact that \gamma_{1}+\gamma_{4}\neq 0 by means of the polynomial (\gamma_{1}+\gamma_{4})\varphi-1 . We work in the polynomial ring \mathbb{R}[\varphi,\gamma_{1},\gamma_{2},\gamma_{3},\gamma_{4}] . As in the previous case, the computation of a Gröbner basis for the ideal \mathcal{I} generated by \left(\operatorname{Ric}^{2}\right)_{j}^{\,\,i}\cup\{\tau,(\gamma_{1}+\gamma_{4})\varphi-1\} reduces to \{1\} . Therefore, the is no left-invariant pp-wave metric in the non-unimodular setting. Remark 4.9 . In the non-unimodular case any Cotton-flat left-invariant metric ( 26 ) is locally symmetric. To show it, we work in the same polynomial ring as above and compute a Gröbner basis for the ideal \mathcal{I}=\langle C_{ijk}\cup\{(\gamma_{1}+\gamma_{4})\varphi-1\}\rangle . Thus, we get 4 polynomials, three of them being \mathbf{g}_{1}=\gamma_{3} , \mathbf{g}_{2}=(\gamma_{2}\gamma_{4}+1)(\gamma_{2}\gamma_{4}+2) and \mathbf{g}_{3}=\gamma_{1}+2(\gamma_{2}\gamma_{4}+1)\gamma_{4} . Hence, \gamma_{3}=0 and either \gamma_{1}=0 , \gamma_{2}\gamma_{4}=-1 or \gamma_{1}=2\gamma_{4} and \gamma_{2}\gamma_{4}=-2 . Finally, a direct calculation shows that, in any case, the underlying metric is locally symmetric. 4.3. Extensions of degenerate Euclidean and Poincaré Lie groups Let G=G_{3}\rtimes\mathbb{R} with G_{3}=E(1,1) or G_{3}=\widetilde{E}(2) . Since the restriction of the metric to \mathfrak{g}_{3} is degenerate of signature (++0) , we consider separately the cases when the induced metric on the derived algebra \mathfrak{g}_{3}^{\prime}=[\mathfrak{g}_{3},\mathfrak{g}_{3}] is Riemannian in Section 4.3.1 , while the case when the restriction of the metric to \mathfrak{g}^{\prime}_{3} is degenerate in considered in Section 4.3.2 . 4.3.1. The induced metric on the derived algebra \bm{\mathfrak{g}^{\prime}_{3}} is positive definite There exists a pseudo-orthonormal basis \{u_{1},u_{2},u_{3},u_{4}\} of the Lie algebra \mathfrak{g}=\mathfrak{g}_{3}\rtimes\mathbb{R} with \langle u_{1},u_{1}\rangle=\langle u_{2},u_{2}\rangle=\langle u_{3},u_{4}\rangle=1 so that \mathfrak{g}_{3}=\operatorname{span}\{u_{1},u_{2},u_{3}\} and the derived algebra \mathfrak{g}^{\prime}_{3}=\operatorname{span}\{u_{1},u_{2}\} . In this situation, using that \mathfrak{g}_{3} is unimodular and the derived algebra \mathfrak{g}^{\prime}_{3} is Abelian, the Jacobi identity leads to two-distinct situations which we consider as follows. Case 1 There exists a pseudo-orthonormal basis \{u_{1},u_{2},u_{3},u_{4}\} of the Lie algebra with \langle u_{1},u_{1}\rangle=\langle u_{2},u_{2}\rangle=\langle u_{3},u_{4}\rangle=1 so that (27) \begin{array}[]{lll}[u_{1},u_{3}]=\lambda_{1}u_{2},&\![u_{2},u_{3}]=-\lambda_{1}u_{1},\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[u_{1},u_{4}]=\gamma_{1}u_{1}+\gamma_{2}u_{2},&\![u_{2},u_{4}]=-\gamma_{2}u_{1}+\gamma_{1}u_{2},&\![u_{3},u_{4}]=\gamma_{3}u_{1}+\gamma_{4}u_{2},\end{array} where \lambda_{1}\neq 0 and \gamma_{i}\in\mathbb{R} . A direct calculation shows that the Lie algebra \mathfrak{g}=\mathfrak{g}_{3}\rtimes\mathbb{R} is unimodular if and only if \gamma_{1}=0 . Next we analyze the non-unimodular case, i.e., \gamma_{1}\neq 0 . A straightforward calculation shows that the Ricci operator satisfies \begin{array}[]{lll}\operatorname{Ric}_{1}^{\,\,1}=-\frac{1}{2}\gamma_{3}^{2},&\operatorname{Ric}_{1}^{\,\,3}=\operatorname{Ric}_{4}^{\,\,1}=\frac{1}{2}(3\gamma_{1}\gamma_{3}+\gamma_{2}\gamma_{4}),&\operatorname{Ric}_{1}^{\,\,4}=\operatorname{Ric}_{3}^{\,\,1}=-\frac{1}{2}\gamma_{4}\lambda_{1},\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr\operatorname{Ric}_{2}^{\,\,2}=-\frac{1}{2}\gamma_{4}^{2},&\operatorname{Ric}_{2}^{\,\,3}=\operatorname{Ric}_{4}^{\,\,2}=\frac{1}{2}(3\gamma_{1}\gamma_{4}-\gamma_{2}\gamma_{3}),&\operatorname{Ric}_{2}^{\,\,4}=\operatorname{Ric}_{3}^{\,\,2}=\frac{1}{2}\gamma_{3}\lambda_{1},\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr\operatorname{Ric}_{4}^{\,\,3}=-2\gamma_{1}^{2},&\operatorname{Ric}_{3}^{\,\,3}=\operatorname{Ric}_{4}^{\,\,4}=\frac{1}{2}(\gamma_{3}^{2}+\gamma_{4}^{2}),&\operatorname{Ric}_{1}^{\,\,2}=\operatorname{Ric}_{2}^{\,\,1}=-\frac{1}{2}\gamma_{3}\gamma_{4}.\end{array} Hence, one easily checks that \operatorname{Ric}^{2}=0 if and only if \gamma_{3}=\gamma_{4}=0 , in which case the corresponding left-invariant metric is given by (28) \begin{array}[]{lll}[u_{1},u_{3}]=\lambda_{1}u_{2},&[u_{2},u_{3}]=-\lambda_{1}u_{1},\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[u_{1},u_{4}]=\gamma_{1}u_{1}+\gamma_{2}u_{2},&[u_{2},u_{4}]=-\gamma_{2}u_{1}+\gamma_{1}u_{2}.\end{array} Now a straightforward calculation shows that u_{3} determines a left-invariant null parallel vector field. Moreover, R(x,y)=0 and \nabla_{x}R=0 for all x,y\in u_{3}^{\perp}=\operatorname{span}\{u_{3},u_{1},u_{2}\} . Therefore, left-invariant metrics given by Equation ( 28 ) are plane waves (see [ 20 ] ). Note that in the non-unimodular case ( \gamma_{1}\neq 0 ) these metrics are realized on the Lie group corresponding to \mathfrak{aff}(\mathbb{C}) . Moreover, since \lambda_{1}\neq 0 , we may take \lambda_{1}=1 working in the homothetic class of the initial metric, obtaining the metrics given in Theorem 4.1 . A straightforward calculation shows that left-invariant metrics determined by ( 28 ) are locally symmetric and locally conformally flat. Remark 4.10 . In the non-unimodular case the only Cotton-flat left-invariant metrics ( 27 ) correspond to the plane waves given by ( 28 ), since C_{123}=\frac{1}{4}(\gamma_{3}^{2}+\gamma_{4}^{2})\lambda_{1}=0 implies \gamma_{3}=\gamma_{4}=0 . Case 2 There exists a pseudo-orthonormal basis \{u_{1},u_{2},u_{3},u_{4}\} of the Lie algebra, with \langle u_{1},u_{1}\rangle=\langle u_{2},u_{2}\rangle=\langle u_{3},u_{4}\rangle=1 , so that (29) \begin{array}[]{l}[u_{1},u_{3}]\!=\!\lambda_{1}u_{1}+\lambda_{2}u_{2},\quad[u_{2},u_{3}]\!=\!-\lambda_{2}u_{1}-\lambda_{1}u_{2},\quad[u_{3},u_{4}]\!=\!\gamma_{3}u_{1}+\gamma_{4}u_{2},\par\par\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[u_{1},u_{4}]\!=\!\gamma_{1}u_{1}+\frac{(\gamma_{1}-\gamma_{2})\lambda_{2}}{2\lambda_{1}}u_{2},\quad[u_{2},u_{4}]\!=\!-\frac{(\gamma_{1}-\gamma_{2})\lambda_{2}}{2\lambda_{1}}u_{1}+\gamma_{2}u_{2},\end{array} where \lambda_{1}\neq 0 , \lambda_{1}^{2}-\lambda_{2}^{2}\neq 0 and \gamma_{i}\in\mathbb{R} . One easily checks that, in this case, the Lie algebra is unimodular if and only if \gamma_{1}+\gamma_{2}=0 . In the non-unimodular case we introduce an auxiliary variable \varphi and use the polynomial (\gamma_{1}+\gamma_{2})\varphi-1 . In the polynomial ring \mathbb{R}[\varphi,\gamma_{1},\gamma_{2},\gamma_{3},\gamma_{4},\lambda_{1},\lambda_{2}] we consider \mathcal{I}=\langle\lambda_{1}^{2}\left(\operatorname{Ric}^{2}\right)_{j}^{\,\,i}\cup\{\tau,(\gamma_{1}+\gamma_{2})\varphi-1\}\rangle , where we have taken \lambda_{1}^{2}\left(\operatorname{Ric}^{2}\right)_{j}^{\,\,i} to remove the variables in the denominators. Computing a Gröbner basis for this ideal we get a set of 91 elements containing the polynomial \mathbf{g}=\lambda_{1}^{5} . Since \lambda_{1}\neq 0 we conclude the non-existence of left-invariant pp-wave metrics in the non-unimodular case. Remark 4.11 . Non-unimodular left-invariant metrics ( 29 ) are Cotton-flat if and only if they are locally symmetric. Indeed, considering the same polynomial ring as above and computing a Gröbner basis for the ideal \mathcal{I}=\langle\lambda_{1}^{2}C_{ijk}\cup\{(\gamma_{1}+\gamma_{2})\varphi-1\}\rangle we obtain 46 polynomials, among which we have \mathbf{g}_{1}=\lambda_{1}^{3}\lambda_{2} , \mathbf{g}_{2}=(\gamma_{1}-\gamma_{2})\lambda_{1}^{4} , \mathbf{g}_{3}=\gamma_{3}\lambda_{1}^{3} and \mathbf{g}_{4}=\gamma_{4}\lambda_{1}^{3} . Since \lambda_{1}\neq 0 it follows that \lambda_{2}=\gamma_{3}=\gamma_{4}=0 and \gamma_{1}=\gamma_{2}\neq 0 , and a direct calculation shows that the space is locally symmetric. 4.3.2. The induced metric on the derived algebra \bm{\mathfrak{g}^{\prime}_{3}} is degenerate There exists a pseudo-orthonormal basis \{u_{1},u_{2},u_{3},u_{4}\} of the Lie algebra \mathfrak{g}=\mathfrak{g}_{3}\rtimes\mathbb{R} with \langle u_{1},u_{1}\rangle=\langle u_{2},u_{2}\rangle=\langle u_{3},u_{4}\rangle=1 so that \mathfrak{g}_{3}=\operatorname{span}\{u_{1},u_{2},u_{3}\} and the derived algebra \mathfrak{g}^{\prime}_{3}=\operatorname{span}\{u_{1},u_{3}\} . In this situation, using that \mathfrak{g}_{3} is unimodular and \mathfrak{g}^{\prime}_{3} is Abelian, the Jacobi identity leads to two-different situations which we consider as follows. Case 1 There exists a pseudo-orthonormal basis \{u_{1},u_{2},u_{3},u_{4}\} of the Lie algebra, with \langle u_{1},u_{1}\rangle=\langle u_{2},u_{2}\rangle=\langle u_{3},u_{4}\rangle=1 , so that the left-invariant metrics are determined by (30) \begin{array}[]{lll}[u_{1},u_{2}]\!=\!\lambda_{1}u_{3},&[u_{2},u_{3}]\!=\!\lambda_{2}u_{1},\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[u_{1},u_{4}]\!=\!\gamma_{1}u_{1}\!+\!\gamma_{2}u_{3},&[u_{2},u_{4}]\!=\!\gamma_{3}u_{1}\!+\!\gamma_{4}u_{3},&[u_{3},u_{4}]\!=\!-\frac{\gamma_{2}\lambda_{2}}{\lambda_{1}}u_{1}\!+\!\gamma_{1}u_{3},\end{array} where \lambda_{1}\lambda_{2}\neq 0 and \gamma_{i}\in\mathbb{R} . We work in the polynomial ring \mathbb{R}[\gamma_{1},\gamma_{2},\gamma_{3},\gamma_{4},\lambda_{1},\lambda_{2}] . Computing a Gröbner basis for the ideal \mathcal{I} generated by \lambda_{1}^{4}\left(\operatorname{Ric}^{2}\right)_{j}^{\,\,i}\cup\{\lambda_{1}^{2}\tau\} (where we have multiplied by the powers of \lambda_{1} to remove the variables in denominators) we get 24 polynomials, one of them being \mathbf{g}=\lambda_{1}^{5}\lambda_{2}^{3} . Since \lambda_{1}\lambda_{2}\neq 0 , we conclude that left-invariant metrics in this case are never pp-waves. Remark 4.12 . Left-invariant metrics ( 30 ) are never Cotton-flat. Indeed, considering the components of the Cotton tensor C_{132}=\tfrac{(\lambda_{1}^{3}-4\gamma_{3}\lambda_{1}^{2}+2\gamma_{2}^{2}\lambda_{2})\lambda_{2}^{2}}{4\lambda_{1}^{2}},\quad C_{231}=\tfrac{(\lambda_{1}^{3}-8\gamma_{3}\lambda_{1}^{2}+4\gamma_{2}^{2}\lambda_{2})\lambda_{2}^{2}}{4\lambda_{1}^{2}}, one has 2C_{132}-C_{231}=\frac{1}{4}\lambda_{1}\lambda_{2}^{2} , which never vanishes since \lambda_{1}\lambda_{2}\neq 0 . Case 2 There exists a pseudo-orthonormal basis \{u_{1},u_{2},u_{3},u_{4}\} of the Lie algebra, with \langle u_{1},u_{1}\rangle=\langle u_{2},u_{2}\rangle=\langle u_{3},u_{4}\rangle=1 , so that (31) \begin{array}[]{l}[u_{1},u_{2}]=\lambda_{1}u_{1}+\lambda_{2}u_{3},\quad[u_{2},u_{3}]=\lambda_{3}u_{1}+\lambda_{1}u_{3},\quad[u_{2},u_{4}]=\gamma_{2}u_{1}+\gamma_{3}u_{3},\par\par\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[u_{1},u_{4}]=\gamma_{1}u_{1}+\frac{(\gamma_{1}-\gamma_{4})\lambda_{2}}{2\lambda_{1}}u_{3},\quad[u_{3},u_{4}]=-\frac{(\gamma_{1}-\gamma_{4})\lambda_{3}}{2\lambda_{1}}u_{1}+\gamma_{4}u_{3},\end{array} where \lambda_{1}\neq 0 , \lambda_{1}^{2}-\lambda_{2}\lambda_{3}\neq 0 and \gamma_{i}\in\mathbb{R} . We take an auxiliary variable \lambda^{\prime}_{1} to indicate that \lambda_{1}\neq 0 by means of \lambda_{1}\lambda^{\prime}_{1}-1 . We consider the ideal \mathcal{I}=\langle\lambda_{1}^{4}\left(\operatorname{Ric}^{2}\right)_{j}^{\,\,i}\cup\{\lambda_{1}^{2}\tau,\lambda_{1}\lambda^{\prime}_{1}-1\}\rangle in the polynomial ring \mathbb{R}[\gamma_{1},\gamma_{2},\gamma_{3},\gamma_{4},\lambda^{\prime}_{1},\lambda_{1},\lambda_{2},\lambda_{3}] (where as in the previous cases we have multiplied by the powers of \lambda_{1} to remove the variables in denominators) and compute a Gröbner basis for this ideal. Thus we get 8 polynomials, among which we find \mathbf{g}=\lambda_{1}^{2}-\lambda_{2}\lambda_{3} . Since \lambda_{1}^{2}-\lambda_{2}\lambda_{3}\neq 0 , we conclude that left-invariant metrics in this case are never pp-waves. Remark 4.13 . Left-invariant metrics ( 31 ) are never Cotton-flat. To show it, we consider the ideal \mathcal{I}=\langle\lambda_{1}^{3}C_{ijk}\cup\{\lambda_{1}\lambda^{\prime}_{1}-1\}\rangle in the same polynomial ring as above and compute a Gröbner basis, obtaining 6 polynomials among which one has \mathbf{g}=\lambda_{1}^{2}-\lambda_{2}\lambda_{3} , which does not vanish. 5. Direct extensions of the non-solvable Lie groups We proceed as in the previous sections considering all the possible left-invariant Lorentzian metrics on the non-solvable four-dimensional Lie groups \widetilde{SL}(2,\mathbb{R})\times\mathbb{R} and SU(2)\times\mathbb{R} . The different cases corresponding to a Riemannian, Lorentzian or degenerate metric on \widetilde{SL}(2,\mathbb{R}) or SU(2) are considered separately in Sections 5.1 , 5.2 and 5.3 , respectively. As a consequence of the analysis below we show that left-invariant metrics in this setting are neither pp-waves nor non-trivial Cotton-flat. Even more, Gröbner bases are again a fundamental tool to obtain the following result: Theorem 5.1 . There is no left-invariant Lorentz metric on \widetilde{SL}(2,\mathbb{R})\times\mathbb{R} or SU(2)\times\mathbb{R} with two-step nilpotent Ricci operator. Moreover, a left-invariant Lorentz metric on \widetilde{SL}(2,\mathbb{R})\times\mathbb{R} or SU(2)\times\mathbb{R} has harmonic curvature if and only if it is locally conformally flat or a product metric on \widetilde{SL}(2,\mathbb{R})\times\mathbb{R} determined by a locally conformally flat metric on \widetilde{SL}(2,\mathbb{R}) . 5.1. Direct extensions with Riemannian Lie groups \bm{\widetilde{SL}(2,}\boldsymbol{\mathbb{R}}\bm{)} or \bm{SU(2)} Let G=G_{3}\times\mathbb{R} with G_{3}=\widetilde{SL}(2,\mathbb{R}) or G_{3}=SU(2) so that the restriction of the metric to G_{3} is positive definite. Hence, there exists an orthonormal basis \{e_{1},e_{2},e_{3},e_{4}\} of the Lie algebra, with e_{4} timelike, so that (32) \begin{array}[]{l}[e_{1},e_{2}]=\lambda_{3}e_{3},\qquad[e_{1},e_{3}]=-\lambda_{2}e_{2},\qquad[e_{2},e_{3}]=\lambda_{1}e_{1},\par\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[e_{1},e_{4}]=\gamma_{1}\lambda_{2}e_{2}+\gamma_{2}\lambda_{3}e_{3},\qquad[e_{2},e_{4}]=-\gamma_{1}\lambda_{1}e_{1}+\gamma_{3}\lambda_{3}e_{3},\par\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[e_{3},e_{4}]=-\gamma_{2}\lambda_{1}e_{1}-\gamma_{3}\lambda_{2}e_{2},\end{array} where \lambda_{1}\lambda_{2}\lambda_{3}\neq 0 and \gamma_{i}\in\mathbb{R} . Let \mathcal{I}=\langle\left(\operatorname{Ric}^{2}\right)_{j}^{\,\,i}\cup\{\tau\} \rangle\subset\mathbb{R}[\gamma_{1},\gamma_{2},\gamma_{3},\lambda_{1},\lambda_{2},\lambda_{3}] . Computing a Gröbner basis for this ideal we get 212 polynomials, one of them being \mathbf{g}=\lambda_{1}^{3}\lambda_{2}^{3}\lambda_{3}^{3} . Since \lambda_{1}\lambda_{2}\lambda_{3}\neq 0 we conclude that \operatorname{Ric}^{2}\neq 0 and therefore there is no left-invariant pp-wave metric in this case. Remark 5.2 . To analyze the vanishing of the Cotton tensor for a left-invariant metric ( 32 ), we use an auxiliary variable \varphi to indicate that \lambda_{1} , \lambda_{2} and \lambda_{3} are non-zero by means of the polynomial \lambda_{1}\lambda_{2}\lambda_{3}\varphi-1 . Now, we consider the ideal \mathcal{I}=\langle C_{ijk}\cup\{\lambda_{1}\lambda_{2}\lambda_{3}\varphi-1\}\rangle in the polynomial ring \mathbb{R}[\varphi,\gamma_{1},\gamma_{2},\gamma_{3},\lambda_{1},\lambda_{2},\lambda_{3}] and compute a Gröbner basis, obtaining 12 polynomials, two of them being \mathbf{g}_{1}=(\lambda_{2}-\lambda_{3})(\lambda_{2}^{2}+\lambda_{3}^{2}+\lambda_{2}\lambda_{3}) and \mathbf{g}_{2}=\lambda_{1}\lambda_{2}-\lambda_{3}^{2} . Hence, \lambda_{1}=\lambda_{2}=\lambda_{3} , from where it follows that the metric is locally conformally flat locally isometric to \mathbb{S}^{3}\times\mathbb{R} . 5.2. Direct extensions with Lorentzian Lie groups \bm{\widetilde{SL}(2,}\boldsymbol{\mathbb{R}}\bm{)} or \bm{SU(2)} We consider the different possibilities for the Jordan normal form of the structure operator. 5.2.1. Diagonalizable structure operator There exists an orthonormal basis \{e_{1},e_{2},e_{3},e_{4}\} of the Lie algebra, with e_{3} timelike, so that (33) \begin{array}[]{l}[e_{1},e_{2}]=-\lambda_{3}e_{3},\qquad[e_{1},e_{3}]=-\lambda_{2}e_{2},\qquad[e_{2},e_{3}]=\lambda_{1}e_{1},\par\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[e_{1},e_{4}]=\gamma_{1}\lambda_{2}e_{2}+\gamma_{2}\lambda_{3}e_{3},\qquad[e_{2},e_{4}]=-\gamma_{1}\lambda_{1}e_{1}+\gamma_{3}\lambda_{3}e_{3},\par\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[e_{3},e_{4}]=\gamma_{2}\lambda_{1}e_{1}+\gamma_{3}\lambda_{2}e_{2},\end{array} where \lambda_{1}\lambda_{2}\lambda_{3}\neq 0 and \gamma_{i}\in\mathbb{R} . We proceed exactly as in the previous case and conclude that \operatorname{Ric}^{2}\neq 0 . Therefore there is no left-invariant pp-wave metric in this case. Remark 5.3 . We proceed exactly as in Remark 5.2 to get that any Cotton-flat left-invariant metric ( 33 ) must be locally conformally flat and locally isometric to \mathbb{S}^{3}_{1}\times\mathbb{R} . 5.2.2. Structure operator \bm{L} with a complex eigenvalue In this case there exists an orthonormal basis \{e_{1},e_{2},e_{3},e_{4}\} of the Lie algebra, with e_{3} timelike, such that the Lie algebra structure is given by \begin{array}[]{l}[e_{1},e_{2}]=-\beta e_{2}-\alpha e_{3},\quad\qquad\qquad\,\,\,\,[e_{1},e_{3}]=-\alpha e_{2}+\beta e_{3},\quad[e_{2},e_{3}]=\lambda e_{1},\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[e_{1},e_{4}]=(\alpha^{2}+\beta^{2})(\gamma_{1}e_{2}+\gamma_{2}e_{3}),\quad[e_{2},e_{4}]=-(\gamma_{1}\alpha-\gamma_{2}\beta)\lambda e_{1}+\gamma_{3}\beta e_{2}+\gamma_{3}\alpha e_{3},\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[e_{3},e_{4}]=(\gamma_{2}\alpha+\gamma_{1}\beta)\lambda e_{1}+\gamma_{3}\alpha e_{2}-\gamma_{3}\beta e_{3},\end{array} where \beta\lambda\neq 0 and \alpha,\gamma_{i}\in\mathbb{R} . In this case the three-dimensional unimodular Lie algebra corresponds to \mathfrak{sl}(2,\mathbb{R}) . In the polynomial ring \mathbb{R}[\lambda,\alpha,\beta,\gamma_{1},\gamma_{2},\gamma_{3}] we consider the ideal \mathcal{I} generated by \left(\operatorname{Ric}^{2}\right)_{j}^{\,\,i}\cup\{\tau\} . Computing a Gröbner basis for this ideal we obtain a set of 108 elements containing the polynomial \mathbf{g}=(\gamma_{3}^{2}+1)^{3}(\alpha^{2}+\beta^{2})\beta^{3} , which does not vanish since \beta\neq 0 . Hence we conclude that \operatorname{Ric}^{2}\neq 0 and therefore left-invariant metrics in this case are never pp-waves. Remark 5.4 . Left-invariant Cotton-flat metrics on \widetilde{SL}(2,\mathbb{R})\times\mathbb{R} whose structure operator has a complex eigenvalue reduce to the product metric, where the metric on \widetilde{SL}(2,\mathbb{R}) is the locally conformally flat one described in Section 1.3.1 . Indeed, considering the same polynomial ring as above and computing a Gröbner basis for the ideal \mathcal{I}=\langle C_{ijk}\rangle , one obtains 44 polynomials, among which we find \mathbf{g}_{1}=(\gamma_{1}^{2}+\gamma_{2}^{2})(\gamma_{3}^{2}+1)\beta^{5} and \mathbf{g}_{2}=\gamma_{3}(\gamma_{3}^{2}+1)^{2}\beta^{5} . Hence, \gamma_{1}=\gamma_{2}=\gamma_{3} and the left-invariant metric is the product one, from where it follows that \widetilde{SL}(2,\mathbb{R})\times\mathbb{R} is Cotton-flat if and only if so is \widetilde{SL}(2,\mathbb{R}) with the induced Lorentzian metric, which corresponds to the metric (1) in Section 1.3.1 . 5.2.3. Structure operator of type II In this case the left-invariant metrics are described by (34) \begin{array}[]{l}[u_{1},u_{2}]=\lambda_{2}u_{3},\qquad[u_{1},u_{3}]=-\lambda_{1}u_{1}-\varepsilon u_{2},\qquad[u_{2},u_{3}]=\lambda_{1}u_{2},\par\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[u_{1},u_{4}]=\gamma_{1}\lambda_{1}u_{1}+\varepsilon\gamma_{1}u_{2}+\gamma_{2}\lambda_{2}u_{3},\quad[u_{2},u_{4}]=-\gamma_{1}\lambda_{1}u_{2}+\gamma_{3}\lambda_{2}u_{3},\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[u_{3},u_{4}]=-\gamma_{3}\lambda_{1}u_{1}-(\gamma_{2}\lambda_{1}+\varepsilon\gamma_{3})u_{2},\end{array} where \varepsilon^{2}=1 , \lambda_{1}\lambda_{2}\neq 0 , \gamma_{i}\in\mathbb{R} and \{u_{1},u_{2},u_{3},u_{4}\} is a pseudo-orthonormal basis of the Lie algebra with \langle u_{1},u_{2}\rangle=\langle u_{3},u_{3}\rangle=\langle u_{4},u_{4}\rangle=1 . Computing a Gröbner basis for the ideal \mathcal{I}=\langle\left(\operatorname{Ric}^{2}\right)_{j}^{\,\,i}\cup\{\tau,\varepsilon^{2}-1\}\rangle in the polynomial ring \mathbb{R}[\varepsilon,\gamma_{1},\gamma_{2},\gamma_{3},\lambda_{1},\lambda_{2}] we get 41 polynomials, one of them being \mathbf{g}=\lambda_{2}^{5} . Since \mathbf{g}\neq 0 , it follows that \operatorname{Ric}^{2}\neq 0 and therefore there is no left-invariant pp-wave metric in this setting. Remark 5.5 . Left-invariant metrics ( 34 ) are never Cotton-flat. Indeed, working in the same polynomial ring as above, we compute a Gröbner basis for the ideal \mathcal{I}=\langle C_{ijk}\cup\{\varepsilon^{2}-1\}\rangle to get 27 polynomials, one of them being \mathbf{g}=\lambda_{2}^{4} , which does not vanish. 5.2.4. Structure operator of type III There exists a pseudo-orthonormal basis \{u_{1},u_{2},u_{3},u_{4}\} of the Lie algebra, with \langle u_{1},u_{2}\rangle=\langle u_{3},u_{3}\rangle=\langle u_{4},u_{4}\rangle=1 , such that the corresponding Lie brackets are determined by \begin{array}[]{l}[u_{1},u_{2}]=u_{1}+\lambda u_{3},\qquad\qquad[u_{1},u_{3}]=-\lambda u_{1},\qquad[u_{2},u_{3}]=\lambda u_{2}+u_{3},\par\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[u_{1},u_{4}]=\gamma_{1}\lambda u_{1}+\gamma_{2}\lambda^{2}u_{3},\quad[u_{2},u_{4}]=\gamma_{3}u_{1}-(\gamma_{1}-\gamma_{2})\lambda u_{2}-(\gamma_{1}-\gamma_{2}-\gamma_{3}\lambda)u_{3},\par\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr[u_{3},u_{4}]=-\gamma_{3}\lambda u_{1}-\gamma_{2}\lambda^{2}u_{2}-\gamma_{2}\lambda u_{3},\end{array} where \lambda\neq 0 and \gamma_{i}\in\mathbb{R} . A direct calculation shows that \operatorname{Ric}_{1}^{\,\,1}=\operatorname{Ric}_{2}^{\,\,2}=\tfrac{-1}{2}(\gamma_{2}^{2}-\gamma_{1}\gamma_{2}+1)\lambda^{2},\,\,\,\operatorname{Ric}_{3}^{\,\,3}=\tfrac{1}{2}(2\gamma_{2}^{2}-2\gamma_{1}\gamma_{2}-1)\lambda^{2},\,\,\,\operatorname{Ric}_{4}^{\,\,4}=\tfrac{-3}{2}\gamma_{2}^{2}\lambda^{2}, so that the scalar curvature \tau=-\frac{3}{2}(\gamma_{2}^{2}+1)\lambda^{2} does not vanish. Hence the Ricci operator cannot be nilpotent and left-invariant metrics in this case are never pp-waves. Remark 5.6 . Considering the components of the Cotton tensor C_{121}=-\tfrac{9}{4}\gamma_{2}^{2}\lambda^{4},\quad C_{122}=\tfrac{3}{4}\left(\gamma_{1}^{2}+2-\gamma_{2}(2\gamma_{2}+5\gamma_{3}\lambda)\right)\lambda^{2}, one has that \gamma_{2}=0 and thus C_{122}=\frac{3}{4}(\gamma_{1}^{2}+2)\lambda^{2} , which does not vanish. Hence there is no Cotton-flat left-invariant metrics with structure operator of type III. 5.3. Direct extensions with degenerate Lie groups \bm{\widetilde{SL}(2,}\boldsymbol{\mathbb{R}}\bm{)} or \bm{SU(2)} Next we assume that the restriction of the left-invariant metric to \widetilde{SL}(2,\mathbb{R}) or SU(2) is degenerate. Let u be such that \operatorname{span}\{u\} is degenerate. We consider separately the cases of \ad_{u} having two purely imaginary complex eigenvalues, two non-zero real opposite eigenvalues, or being three-step nilpotent. 5.3.1. \bm{{\ad_{u}}} has complex eigenvalues There exists a basis \{v_{1},v_{2},v_{3},v_{4}\} of the Lie algebra, with \langle v_{1},v_{1}\rangle=\langle v_{2},v_{2}\rangle=\langle v_{3},v_{4}\rangle=1 , \langle v_{1},v_{2}\rangle=\kappa with \kappa^{2}<1 , such that the Lie brackets are given by (up to an isomorphic homothety) (35) \begin{array}[]{lll}\![v_{1},v_{2}]=v_{3},&\!\![v_{1},v_{3}]=\beta\lambda^{2}v_{2},&\!\![v_{1},v_{4}]=\gamma_{1}\lambda^{2}v_{2}+\gamma_{2}v_{3},\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr\![v_{2},v_{3}]=-\beta v_{1},&\!\![v_{2},v_{4}]=-\gamma_{1}v_{1}+\gamma_{3}v_{3},&\!\![v_{3},v_{4}]=\gamma_{2}\beta v_{1}+\gamma_{3}\beta\lambda^{2}v_{2},\end{array} where \beta\lambda\neq 0 and \gamma_{i}\in\mathbb{R} . We introduce auxiliary variables \lambda^{\prime} , \beta^{\prime} and \varphi to express that \lambda , \beta and \kappa^{2}-1 are non-zero by means of the polynomials \lambda\lambda^{\prime}-1 , \beta\beta^{\prime}-1 and (\kappa^{2}-1)\varphi-1 . Let \mathcal{I}=\langle(\kappa^{2}-1)^{2}\left(\operatorname{Ric}^{2}\right)_{j}^{\,\,i}\cup\{(\kappa^{2}-1)\beta^{-1}\tau,\lambda\lambda^{\prime}-1,\beta\beta^{\prime}-1,(\kappa^{2}-1)\varphi-1\}\rangle in the polynomial ring \mathbb{R}[\lambda,\kappa,\gamma_{1},\gamma_{2},\gamma_{3},\beta,\lambda^{\prime},\beta^{\prime},\varphi] , where we have multiplied by the powers of \kappa^{2}-1 to remove the variables in denominators. Computing a Gröbner basis for this ideal it reduces to \{1\} . Therefore \operatorname{Ric}^{2}\neq 0 , which shows that this case does not support any left-invariant pp-wave metric. Remark 5.7 . Left-invariant metrics ( 35 ) are never Cotton-flat. Indeed, it follows from the components C_{133}=-\frac{1}{4}\beta^{3}\lambda^{2}(\lambda^{2}+1)\gamma_{2} and C_{233}=-\frac{1}{4}\beta^{3}\lambda^{2}(\lambda^{2}+1)\gamma_{3} that \gamma_{2}=\gamma_{3}=0 . Then, one has the component C_{124}=\frac{\beta(\lambda^{2}+1)\left(\left(8\kappa^{2}\lambda^{2}+2(\lambda^{2}-1)^{2}\right)\gamma_{1}^{2}+1\right)}{2(\kappa^{2}-1)} , which does not vanish. 5.3.2. \bm{{\ad_{u}}} has non-zero real eigenvalues There exists a basis \{v_{1},v_{2},v_{3},v_{4}\} of the Lie algebra, with \langle v_{1},v_{1}\rangle=\langle v_{2},v_{2}\rangle=\langle v_{3},v_{4}\rangle=1 , \langle v_{1},v_{2}\rangle=\kappa with \kappa^{2}<1 , so that (36) \begin{array}[]{lll}\![v_{1},v_{2}]=v_{3},&\![v_{1},v_{3}]=\lambda v_{1},&\![v_{1},v_{4}]=\gamma_{1}v_{1}+\gamma_{2}v_{3},\par\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr\![v_{2},v_{3}]=-\lambda v_{2},&\![v_{2},v_{4}]=-\gamma_{1}v_{2}+\gamma_{3}v_{3},&\![v_{3},v_{4}]=\gamma_{3}\lambda v_{1}+\gamma_{2}\lambda v_{2},\end{array} where \lambda\neq 0 and \gamma_{i}\in\mathbb{R} . We proceed as in the previous case, multiplying by the powers of \kappa^{2}-1 to remove the variables in denominators, when we consider \mathcal{I}=\langle(\kappa^{2}-1)^{2}\left(\operatorname{Ric}^{2}\right)_{j}^{\,\,i}\cup\{(\kappa^{2}-1)\tau\}\rangle in the polynomial ring \mathbb{R}[\gamma_{1},\gamma_{2},\gamma_{3},\kappa,\lambda] . Computing a Gröbner basis for this ideal we get 3 polynomials, one of them being \mathbf{g}=\lambda^{2} . Since \lambda\neq 0 we have that \operatorname{Ric}^{2}\neq 0 , which shows the non-existence of left-invariant pp-wave metrics in this case. Remark 5.8 . Left-invariant metrics ( 36 ) have harmonic curvature if and only it they are locally conformally flat. Indeed, considering the same polynomial ring as above and computing a Gröbner basis for the ideal \mathcal{I}=\langle(\kappa^{2}-1)C_{ijk}\rangle one gets 11 polynomials, among which we find \mathbf{g}_{1}=\gamma_{1}\lambda^{2} , \mathbf{g}_{2}=\gamma_{2}\lambda^{2} , \mathbf{g}_{3}=\gamma_{3}\lambda^{2} and \mathbf{g}_{4}=\kappa\lambda^{2} . Since \lambda\neq 0 , it follows that \gamma_{1}=\gamma_{2}=\gamma_{3}=\kappa=0 and a direct calculation shows that the left-invariant metric is locally conformally flat but not locally symmetric. 5.3.3. \bm{{\ad_{u}}} is three-step nilpotent The left-invariant metrics are determined, with respect to a basis \{v_{1},v_{2},v_{3},v_{4}\} of the Lie algebra with \langle v_{1},v_{1}\rangle=\langle v_{2},v_{2}\rangle=\langle v_{3},v_{4}\rangle=1 and \langle v_{1},v_{2}\rangle=\kappa with \kappa^{2}<1 , by the Lie brackets \begin{array}[]{lll}\![v_{1},v_{2}]=\alpha v_{1}+\beta v_{3},&\!\![v_{1},v_{3}]=-v_{2},&\!\![v_{1},v_{4}]=\gamma_{1}v_{1}+\gamma_{2}v_{2}+\frac{\beta\gamma_{1}}{\alpha}v_{3},\\ \vskip 6.0pt plus 2.0pt minus 2.0pt\cr\![v_{2},v_{3}]=\alpha v_{3},&\!\![v_{3},v_{4}]=\gamma_{3}v_{2}-\gamma_{1}v_{3},&\!\![v_{2},v_{4}]=-\alpha\gamma_{3}v_{1}-(\alpha\gamma_{2}+\beta\gamma_{3})v_{3},\end{array} where \alpha\neq 0 , \kappa^{2}\neq 1 and \beta,\gamma_{i}\in\mathbb{R} . We consider \mathcal{I}=\langle(\kappa^{2}-1)^{2}\alpha^{2}\left(\operatorname{Ric}^{2}\right)_{j}^{\,\,i}\cup\{(\kappa^{2}-1)\tau\}\rangle\subset\mathbb{R}[\beta,\gamma_{1},\gamma_{2},\gamma_{3},\alpha,\kappa] , where once again we have multiplied by the powers of \alpha and \kappa^{2}-1 to remove the variables in denominators. Computing a Gröbner basis for this ideal we obtain 10 polynomials, among which we find \mathbf{g}=(\kappa^{2}-1)\alpha^{5} . Since \alpha\neq 0 and \kappa^{2}\neq 1 , it follows that \operatorname{Ric}^{2}\neq 0 and we conclude that there is no left-invariant pp-wave metric in this case. Remark 5.9 . A direct calculation shows that C_{233}=\frac{\alpha}{4(1-\kappa^{2})}\neq 0 , which shows that there is no Cotton-flat left-invariant metric in this case.