The Poincaré problem in L^p-Sobolev spaces. I: Codimension one degeneracy