  Many important theorems in combinatorics, such as Szemer\'edi's theorem on
arithmetic progressions and the Erd\H{o}s-Stone Theorem in extremal graph
theory, can be phrased as statements about independent sets in uniform
hypergraphs. In recent years, an important trend in the area has been to extend
such classical results to the so-called sparse random setting. This line of
research culminated recently in the breakthroughs of Conlon and Gowers and of
Schacht, who developed general tools for solving problems of this type.
  In this paper, we provide a third, completely different approach to proving
extremal and structural results in sparse random sets. We give a structural
characterization of the independent sets in a large class of uniform
hypergraphs by showing that every independent set is almost contained in one of
a small number of relatively sparse sets. We then derive many interesting
results as fairly straightforward consequences of this abstract theorem. In
particular, we prove the well-known conjecture of Kohayakawa, \L uczak and
R\"odl, a probabilistic embedding lemma for sparse graphs. We also give
alternative proofs of many of the results of Conlon and Gowers and Schacht, and
obtain their natural counting versions, which in some cases are considerably
stronger. We moreover prove a sparse version of the Erd\H{o}s-Frankl-R\"odl
Theorem on the number of H-free graphs and extend a result of R\"odl and
Ruci\'nski on Ramsey properties in sparse random graphs to the general,
non-symmetric setting.
  We remark that similar results have been discovered independently by Saxton
and Thomason, and that, in parallel to this work, Conlon, Gowers, Samotij and
Schacht have proved a sparse analogue of the counting lemma for subgraphs of
the random graph G(n,p), which may be viewed as a version of the K\L R
conjecture that is stronger in some ways and weaker in others.
