Near-Optimal Representation Learning for Hierarchical Reinforcement Learning