       TWISTED GENERATING FUNCTIONS AND NEARBY LAGRANGIANS                    5

always 2-torsion (in fact, the main result is sharper, and involves the ac-
tion of the Hopf map). This provides the first general result constraining
the diffeomorphism type of Lagrangians, beyond their simple homotopy type,
and relies essentially on the notion of twisted generating function introduced
below. Recently, Porcelli and Smith announced an alternative proof of a sim-
ilar result using homotopical refinements of Floer homology. However, their
approach still uses the results in this paper as a starting point.
Acknowledgements. The second and third authors would like to thank Em-
manuel Giroux for teaching them his proof of Bott periodicity and for his
stimulating interest in this work. The ﬁrst and fourth authors would like to
thank Tobias Ekholm for insightful discussion on the subject.
   We would also like to thank Trygve Poppe Oldervoll for pointing out an
omission in a previous version of the proof of Lemma 2.23.
   The ﬁrst author was supported by the Simons Foundation through its
“Homological Mirror Symmetry” Collaboration grant SIMONS 385571, and
by NSF grants DMS-1609148, and DMS-1564172.
   The second and third authors are partially supported by the ANR project
MICROLOCAL (ANR-15CE40-0007-01).
   The fourth author was supported by the VR project “2018-04237” titled
“Lagrangian submanifolds, Algebraic K-theory and Quantum Physics”.

    2. A twisted generalization of a theorem of Giroux and
                              Latour
2.1. Twisted generating functions. Let M and L be manifolds and ϕ ×
z : L → J 1 M = T ∗ M ×R a Legendrian immersion. We denote the projection
from the cotangent bundle to the base by πM : T ∗ M → M and its compo-
sition with the immersion of L by π = πM ◦ ϕ : L → M . In the symplectic
vector bundle E = ϕ∗ (T T ∗ M ) over L, there are two Lagrangian subbundles:
     • the vertical subbundle V = ker dπM ,
     • the tangent bundle of L, denoted G for Gauss section.
They can equivalently be considered as sections of the Lagrangian Grass-
mannian bundle Λ0 (E) → L associated to E (the subscript 0 in Λ0 is just
here for coherence with later notations).
Definition 2.1. A generating function over a manifold M is a triple (n, U, f )
where n ∈ N, U is an open set in M ×Rn and f : U → R is a smooth function
such that the fiberwise derivative (x, v) ∈ U 7→ ∂f               n ∗
                                                    ∂v (x, v) ∈ (R ) vanishes
transversely.
   The submanifold Σf = {(x, v) ∈ U, ∂f ∂v (x, v) = 0}, called the singular set
of f , then has a natural Legendrian immersion if : Σf → J 1 M given by
(x, v) 7→ (x, ∂f
              ∂x (x, v), f (x, v)).
   We say that a Legendrian immersion ϕ × z : L → J 1 M admits a gener-
ating function if there exists a generating function (n, U, f ) over M and a
