Do we need compactness hypothesis in Lemma 6.2 in Lee's “Introduction to Smooth Manifolds”?

The following lemma is from Lee's "Introduction to Smooth Manifolds."

Lemma 6.2. Suppose $$A\subseteq\mathbb R^n$$ is a compact subset whose intersection with $$\{c\}\times\mathbb R^{n-1}$$ has $$(n-1)$$-dimensional measure zero for every $$c\in\mathbb R$$. Then $$A$$ has $$n$$-dimensional measure zero.

Do we need to hypothesize that $$A$$ is compact? I think the author included the compactness hypothesis so that the elementary proof (no measure theory) in the book will work. But if I prove the lemma using Tonelli's theorem, I think $$A$$ does not need to be compact:

Let $$\chi_A$$ be the characteristic function of $$A$$. We have to prove that $$\int\chi_Adm^n=0$$. By Tonelli's theorem, $$\int\chi_Adm^n=\int\left(\int(\chi_A)_cdm^{n-1}\right)dm(c)$$, where $$(\chi_A)_c(x_2,\ldots,x_n)=(c,x_2,\ldots,x_n)$$. Since we are given that $$\{c\}\times\mathbb R^{n-1}$$ has $$(n-1)$$-dimensional Lebesgue measure zero, it follows that $$\int(\chi_A)_cdm^{n-1}=0$$ for all $$c\in\mathbb R$$. Thus $$\int\chi_Adm^n=\int 0dm(c)=0$$.

Am I right, or did I miss something?

• Compactness is not needed. – daw Nov 30 '20 at 6:26