        TWISTED GENERATING FUNCTIONS AND NEARBY LAGRANGIANS                     9

Mi′ j ′ . The manifold Σf ′ coincides with Σf and has the same Legendrian
immersion to J 1 M .
   Reﬁnement allows us to often restrict our attention to the following class
of twisted generating functions, which will be particularly convenient to sim-
plify various inductive arguments:
Definition 2.10. A twisted generating function (Mi , ni , fi , qij )i∈I is called
well-ordered if I is finite, the order on I is total and ni ≤ nj when i < j.
Lemma 2.11. Any twisted generating function on a compact manifold M
can be refined and then the order can be changed to yield an equivalent well-
ordered twisted generating function.
Proof. Lemma A.19 shows that we can reﬁne any twisted generating function
to have the order on I total, by compactness we can assume I is ﬁnite. It is
then clear that Mi ∩ Mj = ∅ if ni > nj and i < j; hence we can deﬁne a new
total order ≤′ by: i <′ j if ni < nj or if ni = nj and i < j. This new order
is compatible in the sense that it makes (Mi , qij , fi )i∈I a twisted generating
function. Both orders on I have a common partial order which also makes
it a twisted generating function - hence they are equivalent.                   

   It is classical in the theory of generating functions to stabilize by adding
a ﬁberwise non-degenerate quadratic form. The novelty here is that we use
a 1-cocycle of such quadratic forms to stabilize. In the language of the
Appendix, the directed open cover (Mi )i∈I together with the integers ni and
quadratic forms qij deﬁne a Q-twisted map from M to Z. As we explain in
Appendix A, the set of Q-twisted maps from M to Z up to the appropriate
equivalence relation is in bijection with homotopy classes of maps from M
to a classifying space |B(Z, Q)| (see Proposition A.16). In Subsection 2.2,
we will construct a homotopy equivalence
(2.3)                        |B(Z, Q)| ≃ Λ0 (C∞ ).
Definition 2.12. We say that a Legendrian immersion ϕ × z : L → J 1 M
admits a twisted generating function with twisting classiﬁed by a map h :
M → |B(Z, Q)| if there exists a twisted generating function (Mi , ni , fi , qij )
and a diffeomorphism ψ : L → Σf such that if ◦ ψ = ϕ × z and the Q-twisted
map from M to Z given by (Mi , ni , qij ) is classified by h.
  We may now state the main result of this section which is a slightly more
precise version of Theorem C.
Theorem 2.13. Let M and L be closed manifolds. A Legendrian immersion
ϕ×z : L → J 1 M admits a twisted generating function with twisting classified
by a map h : M → |B(Z, Q)| if and only if gϕ is homotopic to h ◦ π (under
the homotopy equivalence (2.3)).
  The proof of Theorem 2.13 will be given in Subsection 2.3.
