In this work, we developed a unified theory for both classical and aggregation based AMG. The coarse space in this theory is defined by the sum of locally low frequency spaces. A theorem is proved that if the AMG restriction operator preserves locally minimum eigenspaces, then the approximation property is satisfied. And by additionally estimating the local Poincaré constants, we can get an estimate of the convergence rate of two-level methods. As an application, the two-level uniform convergence of classical AMG and unsmoothed aggregation AMG for finite element discretized Poisson equation on a shape regular mesh is proved using this theory.