  We present the mathematical considerations which determine all gauge
invariant actions and anomaly candidates in gauge theories of standard type
such as ordinary or gravitational Yang Mills theories. Starting from elementary
concepts of field theory the discussion tries to be explicit and complete, only
the cohomology of simple Lie algebras it quoted from the literature.
