Undefined control sequence error for sum expression in equation

The below sum expression inside the equation throws an undefined control sequence error.

$$\left\|x\left[t\right]-\textbf{1} F(X)\right\|^2 = \sum_{i = 1}^{n} \lambda_i^2t \lvert x \left[ 0 \right] \rvert^2$$


Error:

Undefined control sequence.

|^2 = \sum_{i = 1}^{n} \lambda_i^2t \lvert
x \left[ 0 \right] \rvert^2


My guess is I am doing something wrong with the \lvert or \lambda. Don't know exactly. Any suggestion on how to solve this issue will be very helpful.

-
Welcome to TeX.SE. It is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. – Peter Grill May 21 '12 at 17:36

You need to include \usepackage{amsmath}. The MWE below produces:
\documentclass{article}
$$\left\|x\left[t\right]-\textbf{1} F(X)\right\|^2 = \sum_{i = 1}^{n} \lambda_i^2t \lvert x \left[ 0 \right] \rvert^2$$

Hi Peter, after including amsmath package, that problem is resolved but a new message is coming up "Package amsmath Error: Erroneous nesting of equation structures (amsmath) trying to recover with aligned'." Any idea on why this is happening will be helpful. – Somnath Chakrabarti May 21 '12 at 17:38
@SomnathChakrabarti: Check whether you've inadvertently created nested equation environments. – Mico May 21 '12 at 18:01
As I suggested in the comments, please compose a fully compilable MWE that reproduces the problem including the \documentclass`. – Peter Grill May 21 '12 at 18:01