  Homotopy type theory is a version of Martin-L\"of type theory taking
advantage of its homotopical models. In particular, we can use and construct
objects of homotopy theory and reason about them using higher inductive types.
In this article, we construct the real projective spaces, key players in
homotopy theory, as certain higher inductive types in homotopy type theory. The
classical definition of RP(n), as the quotient space identifying antipodal
points of the n-sphere, does not translate directly to homotopy type theory.
Instead, we define RP(n) by induction on n simultaneously with its tautological
bundle of 2-element sets. As the base case, we take RP(-1) to be the empty
type. In the inductive step, we take RP(n+1) to be the mapping cone of the
projection map of the tautological bundle of RP(n), and we use its universal
property and the univalence axiom to define the tautological bundle on RP(n+1).
  By showing that the total space of the tautological bundle of RP(n) is the
n-sphere, we retrieve the classical description of RP(n+1) as RP(n) with an
(n+1)-cell attached to it. The infinite dimensional real projective space,
defined as the sequential colimit of the RP(n) with the canonical inclusion
maps, is equivalent to the Eilenberg-MacLane space K(Z/2Z,1), which here arises
as the subtype of the universe consisting of 2-element types. Indeed, the
infinite dimensional projective space classifies the 0-sphere bundles, which
one can think of as synthetic line bundles.
  These constructions in homotopy type theory further illustrate the utility of
homotopy type theory, including the interplay of type theoretic and homotopy
theoretic ideas.
