Morita Invariance of Intrinsic Characteristic Classes of Lie Algebroids

Morita Invariance of Intrinsic Characteristic Classes
of Lie Algebroids

Pedro FREJLICH

P. Frejlich

UFRGS, Departamento de Matemática Pura e Aplicada, Porto Alegre, Brasil
<EMAIL_ADDRESS>
Received June 18, 2018, in final form November 08, 2018; Published online
November 15, 2018

In this note, we prove that _intrinsic characteristic classes_ of Lie
algebroids – which in degree one recover the _modular_ class – behave
functorially with respect to arbitrary transverse maps, and in particular are
weak Morita invariants. In the modular case, this result appeared in [Kosmann-
Schwarzbach Y., Laurent-Gengoux C., Weinstein A., Transform. Groups 13 (2008),
727–755], and with a connectivity assumption which we here show to be
unnecessary, it appeared in [Crainic M., Comment. Math. Helv. 78 (2003),
681–721] and [Ginzburg V.L., J. Symplectic Geom. 1 (2001), 121–169].

Lie algebroids; modular class; characteristic classes; Morita equivalence

53D17; 57R20

##  1 Introduction

A Lie algebroid $A$ on a manifold $M$ gives rise to intrinsic characteristic
classes

$\displaystyle\operatorname{char}(A)\in\mathrm{H}^{\mathrm{odd}}(A)$

in Lie algebroid cohomology, which obstruct the existence of a metric $g$ on
the fibres of $\operatorname{Ad}(A):=A\oplus TM$, and a connection
$\nabla\colon TM\curvearrowright A$, whose induced basic connection
$\nabla^{\mathrm{bas}}\colon A\curvearrowright\operatorname{Ad}(A)$,

$\displaystyle\nabla^{\mathrm{bas}}_{a}(b,u)=\big{(}\nabla_{\varrho_{A}b}a+[a,b]_{A},\varrho_{A}\nabla_{u}a+[\varrho_{A}a,u]\big{)},\qquad
a,b\in\Gamma(A),\qquad u\in\mathfrak{X}(M),$

is $g$-metric:

$\displaystyle\mathscr{L}_{a}g(s,s^{\prime})=g\big{(}\nabla^{\mathrm{bas}}_{a}s,s^{\prime}\big{)}+g\big{(}s,\nabla^{\mathrm{bas}}_{a}s^{\prime}\big{)},\qquad
s,s^{\prime}\in\Gamma(\operatorname{Ad}(A)).$

For example, the familiar statement that there exists a Riemannian (i.e., a
torsion-free and metric) connection associated with a Riemannian metric on $M$
implies that, for tangent bundles $A=TM$, these characteristic classes
$\operatorname{char}(A)$ vanish.

In degree one, $\operatorname{char}^{1}(A)$ recovers the _modular class_ of
$A$ [10], the obstruction to the existence of an invariant transverse measure,
first discovered in the context of Poisson manifolds [24, 31] as the ‘Poisson
analogue of the modular automorphism group of a von Neumann algebra’. There is
an extensive literature about this important class (see the survey [21]),
which is arguably the only reasonably well-understood among the intrinsic
ones. It has been generalized to various geometric contexts [3, 16, 19, 20,
22, 23, 28, 29, 30], and plays a fundamental role in many constructions [3, 7,
8, 10, 12, 18, 25, 27, 32].

The purpose of this short note is to show that intrinsic characteristic
classes are invariant under the following version of _weak Morita equivalence_
[13, Section 6.2]: two Lie algebroids $B$ on $N$ and $A$ on $M$ are weak
Morita equivalent if there are submersions
$N\stackrel{{\scriptstyle\phantom{1}\mathbf{s}}}{{\leftarrow}}\Sigma\stackrel{{\scriptstyle\mathbf{t}\phantom{1}}}{{\to}}M$,
and a Lie algebroid isomorphism
$(\Phi,\mathrm{id})\colon\mathbf{s}^{!}(B)\xrightarrow{\raisebox{-1.99997pt}[0.0pt][0.0pt]{\smash{$\sim$}}}\mathbf{t}^{!}(A)$
between the pullbacks of $B$ and $A$ to $\Sigma$. This establishes a
correspondence between cohomology classes in $\mathrm{H}(B)$ and
$\mathrm{H}(A)$, and the claim is that $\operatorname{char}(B)$ and
$\operatorname{char}(A)$ are related. In fact, we prove slightly more:

Intrinsic characteristic classes are functorial with respect to transverse
maps: if $\phi\colon N\to M$ is transverse to a Lie algebroid $A$ on $M$, then
$\operatorname{char}(\phi^{!}(A))=\phi^{*}\operatorname{char}(A)$.

Versions of this result have appeared in the literature in various forms; we
here quote those most pertinent to our setting.

In [14, Theorem 4.2] it was shown, building on previous work [15], that the
modular class is a Morita invariant for locally unimodular Poisson manifolds.
Shortly afterwards, _secondary_ and _intrinsic_ characteristic classes were
introduced (see [4, 5, 6, 11, 26]), and in [5, Corollary 8] it was proved that
the intrinsic characteristic classes of Poisson manifolds of degree $(2q-1)$
are invariant under Morita equivalences whose fibres are at least
homologically $(2q-1)$-connected; it was later extended to weak Morita
equivalences of Lie algebroids under a similar connectivity condition [13,
Example 6.16].

More recently, it was proved in [22, Theorem 3.10] that the modular class is
functorial with respect to arbitrary transverse maps – thus dropping the
connectivity condition – and the authors pose the question in [22, (iii), p.
729] about the behavior of higher intrinsic characteristic classes under
morphisms. It was this question that piqued our interest, and which our Main
Theorem seeks to answer.

Let us conclude these introductory remarks by pointing out that, in light of
the correspondence between 2-term representations up to homotopy and VB-
algebroids (see, e.g., [17]), it would be interesting to revisit the
discussion below in the context of VB-algebroids and groupoids, and to explain
the relationship with the results in [9] – which develops a similar line of
inquiry, and through methods that bear great resemblance to the ones employed
here.111I thank the anonymous referees for bringing this to my attention.

The paper is organized as follows: our conventions are discussed in Section 2,
where we summarize the construction of primary, secondary and intrinsic
characteristic classes of Lie algebroids from [4, 6], referring there to
proofs. In Section 3 we prove our Main Theorem: as we explain there, this
result is a straightforward consequence of the case of pulling back a Lie
algebroid $A$ on $M$ by a submersion $p\colon\Sigma\to M$, and our proof, in
that case, reduces to the construction of appropriate connection and metric on
$\operatorname{Ad}\big{(}p^{!}(A)\big{)}$, so that the adjoint connection of
$p^{!}(A)$ splits as a direct sum of the pullback of the adjoint connection of
$A$ and a metric subconnection.

##  2 Characteristic classes

In this section, we give a summary of the main results and constructions
needed to contextualize our discussion, referring to the appropriate
references for further details.

  1. 1.

For vector bundles $E$ and $D$ on $M$, we denote by
$\Omega^{p}_{\mathrm{nl}}(E;D)$ the space of _nonlinear forms_ of degree $p$
on $E$ with values in $D$ – that is, the linear subspace of
$\mathrm{Hom}(\wedge^{p}\Gamma(E),\Gamma(D))$ consisting of those elements
$\omega$ which decrease support, in the sense that $\omega(e_{1},\dots,e_{p})$
is identically zero around any point around which some $e_{i}\in\Gamma(E)$
vanishes identically. When $D$ is the trivial line bundle, we write
$\Omega^{p}_{\mathrm{nl}}(E)$, and we note that
$\Omega^{p}_{\mathrm{nl}}(E;D)$ is a module over
$\Omega^{p}_{\mathrm{nl}}(E)$. Linear forms
$\omega\in\Omega^{p}(E,D)=\Gamma(\wedge^{p}E^{*}\otimes D)$ are identified
with those elements of $\Omega^{p}_{\mathrm{nl}}(E;D)$ which are
$C^{\infty}(M)$-linear in their entries. There are obvious variations when $D$
is complex or graded; see [1, 4].

  2. 2.

Let $A$ be a Lie algebroid on $M$, and let $D$ be the graded, complex vector
bundle $D_{0}\oplus D_{1}$, equipped with an odd endomorphism

$\displaystyle\partial=\left(\begin{matrix}0&\partial^{1}_{0}\\\
\partial^{0}_{1}&0\end{matrix}\right)\colon\ D\longrightarrow
D,\qquad\partial^{2}=0.$

A _nonlinear connection_ of $A$ on $D$ is a linear map
$\nabla\colon\Gamma(A)\to\operatorname{End}(\Gamma(D))$, such that, for all
$a\in\Gamma(A)$,

    1. a)

$\nabla$ is a local operator;

    2. b)

$\nabla_{a}$ preserves parity;

    3. c)

$\nabla_{a}$ commutes with $\partial$;

    4. d)

$\nabla_{a}$ satisfies $\nabla_{a}fs=f\nabla_{a}s+(\mathscr{L}_{a}f)s$ for all
$f\in C^{\infty}(M)$, $s\in\Gamma(D)$.

  3. 3.

A nonlinear connection of $A$ on $D$ induces:

     * •

a derivation of degree one
$\mathrm{d}_{\nabla}\colon\Omega_{\mathrm{nl}}(A;D)\to\Omega_{\mathrm{nl}}(A;D)$,
$\mathrm{d}_{\nabla}\eta(a_{0},\dots,a_{p})$ being given by the usual formula

$\displaystyle\\!\sum_{i=0}^{p}\\!(-1)^{i}\nabla_{a_{i}}\eta(a_{0},\dots,\widehat{a_{i}},\dots,a_{p})+\\!\sum_{i<j}\\!(-1)^{i+j}\eta([a_{i},a_{j}],a_{0},\dots,\widehat{a_{i}},\dots,\widehat{a_{j}},\dots,a_{p});\\!$

     * •

a _dual_ nonlinear connection $\nabla^{\vee}$ of $A$ on $D^{*}$, defined by
the condition that

$\displaystyle\mathscr{L}_{a}\langle\theta,s\rangle=\langle\nabla^{\vee}_{a}\theta,s\rangle+\langle\theta,\nabla_{a}s\rangle,\qquad
a\in\Gamma(A),\qquad s\in\Gamma(D),\quad\theta\in\Gamma(D^{*}),$

     * •

a nonlinear connection of $A$ on $\operatorname{End}(D)$, given by
$\nabla_{a}T=[\nabla_{a},T]$, whose induced derivation
$\mathrm{d}_{\nabla}\colon\Omega_{\mathrm{nl}}(A;\operatorname{End}(D))\to\Omega_{\mathrm{nl}}(A;\operatorname{End}(D))$
is given by the graded commutator $[\nabla,\cdot]$.

  4. 4.

A _Hermitian metric_ $h$ on $D$, regarded as a complex-antilinear map $D\to
D^{*}$, conjugates a nonlinear connection $\nabla$ of $A$ on $D$ to an _$h$
-dual_ nonlinear connection $\nabla^{h}$ of $A$ on $D$, given by
$\nabla^{h}_{a}:=h^{-1}\circ\nabla^{\vee}_{a}\circ h$. If $\nabla=\nabla^{h}$,
we say that $h$ is _invariant_ under $\nabla$, or that $\nabla$ is _$h$
-metric_. Note that every Hermitian metric $h$ is invariant under some
nonlinear connection; e.g.,
$\nabla_{m}:=\frac{1}{2}\big{(}\nabla+\nabla^{h}\big{)}$.

  5. 5.

A nonlinear _subconnection_ of a nonlinear connection $\nabla$ of $A$ on $D$
is the restriction $\nabla^{\prime}=\nabla|_{D^{\prime}}$ of $\nabla$ to an
invariant subbundle $D^{\prime}$, i.e., one for which
$\nabla_{a}\Gamma(D^{\prime})\subset\Gamma(D^{\prime})$ for all
$a\in\Gamma(A)$. If that is the case, there is an induced _quotient_ nonlinear
connection $\nabla/D^{\prime}$ of $A$ on $D/D^{\prime}$,
$(\nabla/D^{\prime})_{a}[s]=[\nabla_{a}s]$. When $D=D^{\prime}\oplus
D^{\prime\prime}$ where $\nabla^{\prime\prime}:=\nabla|_{D^{\prime\prime}}$ is
another subconnection, we say that $\nabla$ splits as a direct sum, and write
$\nabla=\nabla^{\prime}\oplus\nabla^{\prime\prime}$.

  6. 6.

For a nonlinear connection $\nabla$ of $A$ on $D$,
$\mathrm{d}_{\nabla}^{2}=R_{\nabla}\wedge$, where $R_{\nabla}$ denotes the
_curvature_ of $\nabla$,

$\displaystyle
R_{\nabla}\in\Omega^{2}_{\mathrm{nl}}(A;\operatorname{End}(D)),\qquad
R_{\nabla}(a,b)=[\nabla_{a},\nabla_{b}]-\nabla_{[a,b]},\qquad
a,b\in\Gamma(A),$

and it is always the case that $\mathrm{d}_{\nabla}R_{\nabla}=0$. If
$R_{\nabla}=0$, we call $\nabla$ a _nonlinear representation_. Because the
supertrace
$\operatorname{Tr}_{s}(T)=\operatorname{Tr}(T_{00})-\operatorname{Tr}(T_{11})$
induces a linear map intertwining derivations,

$\displaystyle\operatorname{Tr}_{s}\colon\
\Omega_{\mathrm{nl}}(A;\operatorname{End}(D))\longrightarrow\Omega_{\mathrm{nl}}(A;\mathbb{C}),\qquad\mathrm{d}_{A}\operatorname{Tr}_{s}=\operatorname{Tr}_{s}\mathrm{d}_{\nabla},$

it follows in general that
$\operatorname{Tr}_{s}\big{(}R_{\nabla}^{q}\big{)}\in\Omega^{2q}_{\mathrm{nl}}(A;\mathbb{C})$
are $\mathrm{d}_{A}$-closed for every integer $q$; see [4].

  7. 7.

If $(\Phi,\phi)\colon B\to A$ is a morphism of Lie algebroids, and $\nabla$ is
a nonlinear connection of $A$ on $D$, there is an induced _pullback nonlinear
connection_ $(\Phi,\phi)^{!}\nabla$ of $B$ on $\phi^{*}(D)$,

$\displaystyle(\Phi,\phi)^{!}\nabla_{a}\phi^{\dagger}(s):=\phi^{\dagger}(\nabla_{\Phi(a)}s),\qquad
a\in\Gamma(\phi^{!}(A)),\qquad s\in\Gamma(D),$

in which case $(\Phi,\phi)\colon(\Phi,\phi)^{!}\nabla\to\nabla$ defines a
_pullback morphism_ of nonlinear connections, in the sense that the induced
linear map

$\displaystyle(\Phi,\phi)^{*}\colon\
\Omega_{\mathrm{nl}}(A;D)\to\Omega_{\mathrm{nl}}(B;\phi^{*}(D))$

intertwines the derivations $\mathrm{d}_{\nabla}$ and
$\mathrm{d}_{(\Phi,\phi)^{!}\nabla}$.222As explained in [22], it is best to
think that a connection $\nabla\colon A\curvearrowright D$ induces the
derivation $\mathrm{d}_{\nabla^{\vee}}$, simply because the map of modules
induced by a pair of vector bundle maps $\Phi\colon B\to A$ and $\Psi\colon
D_{B}\to D_{A}$ covering the same smooth map $\phi\colon N\to M$ is
$(\Phi,\Psi,\phi)^{*}\colon\Omega(A;D_{A}^{*})\to\Omega(B;D_{B}^{*})$. A
_morphism_ from a connection $\nabla_{B}\colon B\curvearrowright D_{B}$ to a
connection $\nabla_{A}\colon A\curvearrowright D_{A}$ is then a such triple
$(\Phi,\Psi,\phi)$ for which $(\Phi,\Psi,\phi)^{*}$ intertwines the
derivations $\mathrm{d}_{\nabla^{\vee}_{A}}$ and
$\mathrm{d}_{\nabla^{\vee}_{B}}$. When $\Psi$ is fibrewise an isomorphism – as
in the case of a pullback morphism – we may dualize the construction above to
a map of modules $\Omega(A;D_{A})\to\Omega(B;D_{B})$ intertwining the
derivations $\mathrm{d}_{\nabla_{A}}$ and $\mathrm{d}_{\nabla_{B}}$. If
$\phi\colon N\to M$ is a smooth map transverse to a Lie algebroid $A$ on $M$,
i.e.,

$\displaystyle\phi_{*}(T_{x}N)+\varrho_{A}(A_{\phi(x)})=T_{\phi(x)}M,\qquad
x\in N,$

then there is a _pullback Lie algebroid_ $\phi^{!}(A):=TN\times_{TM}A$ on $N$,
and an induced _pullback morphism_ of Lie algebroids
$\big{(}\widetilde{\phi},\phi\big{)}\colon\phi^{!}(A)\to A$. In this case, we
will write simply $\phi^{!}\nabla$ and $\phi^{*}$ instead of
$\big{(}\widetilde{\phi},\phi\big{)}^{!}\nabla$ and
$\big{(}\widetilde{\phi},\phi\big{)}^{*}$.

  8. 8.

A nonlinear connection is a _connection_ tout court if

$\displaystyle\nabla_{fa}s=f\nabla_{a}s,\qquad f\in C^{\infty}(M),\qquad
a\in\Gamma(A),\qquad s\in\Gamma(D),$

that is, if it is $C^{\infty}(M)$-linear in the $\Gamma(A)$-entry, in which
case we write $\nabla\colon A\curvearrowright D$. Two nonlinear connections
$\nabla^{0}$, $\nabla^{1}$ are _equivalent_ provided that there exists
$\theta\in\Omega_{\mathrm{nl}}^{1}(A;\operatorname{End}(D))$, such that

$\displaystyle\nabla^{1}_{a}-\nabla^{0}_{a}=[\theta(a),\partial],\qquad
a\in\Gamma(A),$

in which case
$\operatorname{Tr}_{s}\big{(}R_{\nabla_{0}}^{q}\big{)}=\operatorname{Tr}_{s}\big{(}R_{\nabla_{1}}^{q}\big{)}$
for all $q$ (see [6]). A nonlinear connection $\nabla$ of $A$ on $D$ will be
called a _connection up to homotopy_ if it is equivalent to a connection; in
this case, we will write $\nabla\colon A\
\raisebox{0.0pt}{\scalebox{1.0}[-1.0]{$\curvearrowright$}}\ D$. Both
connections and connections up to homotopy are preserved by all operations on
nonlinear connections described in items 3–7. Note that, for a connection up
to homotopy $\nabla$, $\operatorname{Tr}_{s}\big{(}R_{\nabla}^{q}\big{)}$ are
linear forms,
$\operatorname{Tr}_{s}\big{(}R_{\nabla}^{q}\big{)}\in\Omega^{2q}(A)$. A
_representation up to homotopy_ 333For the convenience of the reader, we chose
to maintain the term _representation up to homotopy_ as it appears in [4, 6],
in spite of the fact that terminology has come to mean something else [1]. is
a connection up to homotopy for which $R_{\nabla}$ vanishes identically, in
which case $\mathrm{d}_{\nabla}$ turns $\Omega^{\bullet}_{\mathrm{nl}}(A;D)$
into a cochain complex.

In the remainder of this section, we recall the discussion in [6], referring
there to proofs and further details.

There is a rule $\mathrm{cs}$ which assigns to all non-negative integers
$p,q\geqslant 0$ and connections up to homotopy
$\nabla_{0},\dots,\nabla_{p}\colon A\
\raisebox{0.0pt}{\scalebox{1.0}[-1.0]{$\curvearrowright$}}\ D$, a cochain

$\displaystyle\mathrm{cs}^{q}(\nabla_{0},\dots,\nabla_{p})\in\Omega^{2q-p}(A;\mathbb{C})$

with the property that, for every permutation $\sigma$ and Hermitian metric
$h$ on $D$:

  1. $\mathrm{CS}1)$

$\mathrm{cs}^{q}(\nabla)=\operatorname{Tr}_{s}\big{(}R_{\nabla}^{q}\big{)}$,

  2. $\mathrm{CS}2)$

$\mathrm{cs}^{q}(\nabla_{\sigma(0)},\dots,\nabla_{\sigma(p)})=(-1)^{\sigma}\mathrm{cs}^{q}(\nabla_{0},\dots,\nabla_{p})$,

  3. $\mathrm{CS}3)$

$\mathrm{d}_{A}\mathrm{cs}^{q}(\nabla_{0},\dots,\nabla_{p})=\sum\limits_{i=0}^{p}(-1)^{i}\mathrm{cs}^{q}\big{(}\nabla_{0},\dots,\widehat{\nabla_{i}},\dots,\nabla_{p}\big{)}$,

  4. $\mathrm{CS}4)$

$\mathrm{cs}^{q}\big{(}\nabla_{0}^{h},\dots,\nabla_{p}^{h}\big{)}=(-1)^{q}\overline{\mathrm{cs}^{q}(\nabla_{0},\dots,\nabla_{p})}$.

Such cochains are given explicitly by

$\displaystyle\mathrm{cs}^{q}(\nabla_{0},\dots,\nabla_{p}):=\begin{cases}\operatorname{Tr}_{s}\big{(}R_{\nabla_{0}}^{q}\big{)}&\text{if}\
p=0,\vspace{1mm}\\\
(-1)^{\lfloor{\frac{p+1}{2}}\rfloor}\mathop{}\mkern-3.0mu\mathchoice{\hbox
to0.0pt{$\displaystyle\vbox{\hbox
to7.84584pt{\hss$\textstyle{-}$\hss}}$\hss}}{\hbox
to0.0pt{$\textstyle\vbox{\hbox
to7.84584pt{\hss$\scriptstyle{-}$\hss}}$\hss}}{\hbox
to0.0pt{$\scriptstyle\vbox{\hbox
to6.17917pt{\hss$\scriptscriptstyle{-}$\hss}}$\hss}}{\hbox
to0.0pt{$\scriptscriptstyle\vbox{\hbox
to6.17917pt{\hss$\scriptscriptstyle{-}$\hss}}$\hss}}\mkern-3.0mu\int_{\varDelta^{p}}\operatorname{Tr}_{s}\big{(}R_{\nabla^{\mathrm{aff}}}^{q}\big{)}&\text{if}\
p>0,\end{cases}$

where $\lfloor{t}\rfloor$ the greatest integer no greater than $t$ and:

  * •

$\mathop{}\mkern-3.0mu\mathchoice{\hbox to0.0pt{$\displaystyle\vbox{\hbox
to7.84584pt{\hss$\textstyle{-}$\hss}}$\hss}}{\hbox
to0.0pt{$\textstyle\vbox{\hbox
to7.84584pt{\hss$\scriptstyle{-}$\hss}}$\hss}}{\hbox
to0.0pt{$\scriptstyle\vbox{\hbox
to6.17917pt{\hss$\scriptscriptstyle{-}$\hss}}$\hss}}{\hbox
to0.0pt{$\scriptscriptstyle\vbox{\hbox
to6.17917pt{\hss$\scriptscriptstyle{-}$\hss}}$\hss}}\mkern-3.0mu\int_{\varDelta^{p}}\colon\Omega^{\bullet}\big{(}\\!\operatorname{pr}^{!}(A);\mathbb{C}\big{)}\\!\to\\!\Omega^{\bullet-p}(A;\mathbb{C})$
denotes the linear map of _fibre integration_ 444To construct
$\mathop{}\mkern-3.0mu\mathchoice{\hbox to0.0pt{$\displaystyle\vbox{\hbox
to7.84584pt{\hss$\textstyle{-}$\hss}}$\hss}}{\hbox
to0.0pt{$\textstyle\vbox{\hbox
to7.84584pt{\hss$\scriptstyle{-}$\hss}}$\hss}}{\hbox
to0.0pt{$\scriptstyle\vbox{\hbox
to6.17917pt{\hss$\scriptscriptstyle{-}$\hss}}$\hss}}{\hbox
to0.0pt{$\scriptscriptstyle\vbox{\hbox
to6.17917pt{\hss$\scriptscriptstyle{-}$\hss}}$\hss}}\mkern-3.0mu\int_{\varDelta^{p}}$,
fix a splitting
$\sigma\colon\operatorname{pr}^{*}(A)\to\operatorname{pr}^{!}(A)$ to
$\widetilde{\operatorname{pr}}$, and denote by
$\mathrm{q}\colon\Omega\big{(}\operatorname{pr}^{!}A\big{)}\to\Omega(V)$ the
homomorphism induced by the inclusion of $V=\ker\operatorname{pr}_{*}\subset
T(M\times\varDelta^{p})$. Then for
$\omega\in\Omega^{p+q}\big{(}\operatorname{pr}^{!}(A)\big{)}$ and sections
$a_{1},\dots,a_{q}\in\Gamma(A)$, define
$\mathop{}\mkern-3.0mu\mathchoice{\hbox to0.0pt{$\displaystyle\vbox{\hbox
to7.84584pt{\hss$\textstyle{-}$\hss}}$\hss}}{\hbox
to0.0pt{$\textstyle\vbox{\hbox
to7.84584pt{\hss$\scriptstyle{-}$\hss}}$\hss}}{\hbox
to0.0pt{$\scriptstyle\vbox{\hbox
to6.17917pt{\hss$\scriptscriptstyle{-}$\hss}}$\hss}}{\hbox
to0.0pt{$\scriptscriptstyle\vbox{\hbox
to6.17917pt{\hss$\scriptscriptstyle{-}$\hss}}$\hss}}\mkern-3.0mu\int_{\varDelta^{p}}\omega$
so that the identity below is satisfied:
$\displaystyle\iota_{a_{q}}\cdots\iota_{a_{1}}\mathop{}\mkern-3.0mu\mathchoice{\hbox
to0.0pt{$\displaystyle\vbox{\hbox
to7.84584pt{\hss$\textstyle{-}$\hss}}$\hss}}{\hbox
to0.0pt{$\textstyle\vbox{\hbox
to7.84584pt{\hss$\scriptstyle{-}$\hss}}$\hss}}{\hbox
to0.0pt{$\scriptstyle\vbox{\hbox
to6.17917pt{\hss$\scriptscriptstyle{-}$\hss}}$\hss}}{\hbox
to0.0pt{$\scriptscriptstyle\vbox{\hbox
to6.17917pt{\hss$\scriptscriptstyle{-}$\hss}}$\hss}}\mkern-3.0mu\int_{\varDelta^{p}}\omega:=\int_{\varDelta^{p}}\mathrm{q}(\iota_{\sigma(a_{q})}\cdots\iota_{\sigma(a_{1})}\omega).$
associated to the canonical projection from the product of $M$ with the
standard $p$-simplex $\operatorname{pr}\colon M\times\varDelta^{p}\\!\to\\!M$;

  * •

$\nabla^{\mathrm{aff}}\colon\operatorname{pr}^{!}(A)\
\raisebox{0.0pt}{\scalebox{1.0}[-1.0]{$\curvearrowright$}}\
\operatorname{pr}^{*}(D)$ denotes the connection up to homotopy
$\nabla^{\mathrm{aff}}=\sum\limits_{i=0}^{p}t_{i}\operatorname{pr}^{!}(\nabla_{i})$.

Given a connection up to homotopy $\nabla\colon A\
\raisebox{0.0pt}{\scalebox{1.0}[-1.0]{$\curvearrowright$}}\ D$, define

$\displaystyle\mathrm{cs}(\nabla)=\operatorname{Tr}_{s}(\exp(iR_{\nabla}))=\sum\frac{i^{q}}{q!}\mathrm{cs}^{q}(\nabla)\in\Omega(A;\mathbb{C}).$

######  Proposition 2.1 (primary characteristic classes).

  1. $a)$

For a connection up to homotopy, we have $\mathrm{d}_{A}\mathrm{cs}(\nabla)=0$
and
$\mathrm{cs}(\nabla_{0}\oplus\nabla_{1})=\mathrm{cs}(\nabla_{0})+\mathrm{cs}(\nabla_{1})$;

  2. $b)$

for all Lie algebroid morphisms $(\Phi,\phi)\colon B\to A$ and connection up
to homotopy $\nabla\colon A\
\raisebox{0.0pt}{\scalebox{1.0}[-1.0]{$\curvearrowright$}}\ D$, we have
$\mathrm{cs}((\Phi,\phi)^{!}(\nabla))=(\Phi,\phi)^{*}\mathrm{cs}(\nabla)$;

  3. $c)$

the cohomology class $[\mathrm{cs}(\nabla)]$ does not depend on the choice of
connection up to homotopy $\nabla$;

  4. $d)$

$[\mathrm{cs}(\nabla)]\\!\in\\!\mathrm{H}^{2\bullet}(A)$ is a real cohomology
class lying in the image of the map
$(\varrho_{A},\mathrm{id})^{*}\colon\mathrm{H}(M)\\!\to\\!\mathrm{H}(A)$
induced by the anchor of $A$;

  5. $e)$

$[\mathrm{cs}(\nabla)]\in\mathrm{H}^{4\bullet}(A)$ if $\nabla$ is a real555We
consider real vector bundles $D$ as complex ones via complexification
$D\otimes_{\mathbb{R}}\mathbb{C}$, and we observe that a real nonlinear
connection $\nabla$ of $A$ on $D$ induces a complex nonlinear connection
$\nabla_{\mathbb{C}}$ of $A$ on $D\otimes_{\mathbb{R}}\mathbb{C}$, and that a
metric $g$ on $D$ induces a Hermitian metric $g_{\mathbb{C}}$ on the
complexification $D\otimes_{\mathbb{R}}\mathbb{C}$, in such a way that
$(\nabla^{g})_{\mathbb{C}}=(\nabla_{\mathbb{C}})^{g_{\mathbb{C}}}$. connection
up to homotopy.

We call the Chern character of $D$ the element
$\mathrm{ch}(D)\in\mathrm{H}(A)$ represented by $\mathrm{cs}(\nabla)$, for
some connection up to homotopy $\nabla\colon A\
\raisebox{0.0pt}{\scalebox{1.0}[-1.0]{$\curvearrowright$}}\ D$. We regard it
as a primary characteristic class, obstructing the existence of a
representation up to homotopy of $A$ on $D$. The vanishing of
$\mathrm{cs}(\nabla)$ allows one to define secondary characteristic classes
$\mathfrak{u}(\nabla)\in\mathrm{H}^{\mathrm{odd}}(A)$, which obstruct the
existence of an invariant metric. For a connection up to homotopy
$\nabla\colon A\ \raisebox{0.0pt}{\scalebox{1.0}[-1.0]{$\curvearrowright$}}\
D$ and a Hermitian metric $h$ on $D$, define

$\displaystyle\mathrm{u}(\nabla,h):=\sum
i^{q+1}\mathrm{cs}^{q}\big{(}\nabla,\nabla^{h}\big{)}\in\Omega^{\mathrm{odd}}(A;\mathbb{C}).$

######  Proposition 2.2 (secondary characteristic classes).

  1. $a)$

The cochains $\mathrm{u}(\nabla,h)$ are real;

  2. $b)$

for all Lie algebroid morphism $(\Phi,\phi)\colon B\to A$, connection up to
homotopy $\nabla\colon A\
\raisebox{0.0pt}{\scalebox{1.0}[-1.0]{$\curvearrowright$}}\ D$ and Hermitian
metric $h$, we have
$\mathrm{u}((\Phi,\phi)^{!}(\nabla),\phi^{*}(h))=(\Phi,\phi)^{*}\mathrm{u}(\nabla,h)$;

  3. $c)$

If $\mathrm{cs}(\nabla)=0$, then $\mathrm{d}_{A}\mathrm{u}(\nabla,h)=0$, in
which case:

    1. $i)$

$\mathfrak{u}(\nabla):=[\mathrm{u}(\nabla,h)]\in\mathrm{H}^{\mathrm{odd}}(A)$
is independent of $h$;

    2. $ii)$

$\mathfrak{u}(\nabla)\in\mathrm{H}^{4\bullet+1}(A)$ if $\nabla$ is a real
connection up to homotopy.

######  Main Example.

Let the _adjoint bundle_ $\operatorname{Ad}(A)$ of a Lie algebroid $A$ on $M$
be $A$ in even parity, and $TM$ in odd parity, equipped with
$\partial(a,u)=(0,\varrho_{A}(a))$. Then $\nabla^{\mathrm{ad}}$ given by

$\displaystyle\nabla^{\mathrm{ad}}_{a}(b,u):=([a,b]_{A},[\varrho_{A}a,u])$

defines a representation up to homotopy. This can be seen as follows: every
linear connection $\nabla\colon TM\curvearrowright A$ induces a linear basic
connection $\nabla^{\mathrm{bas}}\colon
A\curvearrowright\operatorname{Ad}(A)$,

$\displaystyle\nabla^{\mathrm{bas}}_{a}(b,u):=\big{(}\nabla_{\varrho_{A}b}a+[a,b]_{A},\varrho_{A}\nabla_{u}a+[\varrho_{A}a,u]\big{)};$

and the nonlinear representation $\nabla^{\mathrm{ad}}$ is equivalent to
$\nabla^{\mathrm{bas}}$

$\displaystyle\nabla^{\mathrm{ad}}=\nabla^{\mathrm{bas}}+[\theta_{\nabla},\partial],\qquad\theta_{\nabla}(a)(b,u):=(\nabla_{u}a,0).$

$\nabla^{\mathrm{ad}}$ can be alternatively defined as the unique
representation up to homotopy which under the canonical Lie algebroid map
$(\operatorname{pr},\mathrm{id})\colon J_{1}(A)\to A$ pulls back to the
canonical representation

$\displaystyle\nabla^{j_{1}}\colon\
J_{1}(A)\curvearrowright\operatorname{Ad}(A),\qquad\nabla^{j_{1}}_{j_{1}a}(b,u)=\nabla^{\mathrm{ad}}_{a}(b,u).$

######  Definition.

The intrinsic characteristic classes
$\operatorname{char}^{q}(A)\in\mathrm{H}^{2q-1}(A)$ of the Lie algebroid $A$
are the secondary characteristic classes
$\mathfrak{u}^{q}(\nabla^{\mathrm{ad}})$ of the adjoint representation up to
homotopy $\nabla^{\mathrm{ad}}$.

Note that it follows from the discussion in the Main Example, and item b) of
Proposition 2.2, that $\operatorname{char}(A)$ can be alternatively defined as
the unique element $\mathrm{H}^{\mathrm{odd}}(A)$ which pulls back under the
Lie algebroid map $(\operatorname{pr},\mathrm{id})\colon J_{1}(A)\to A$ to the
secondary characteristic class $\mathfrak{u}(\nabla^{j_{1}})$ of the canonical
representation of $J_{1}(A)$ on $\operatorname{Ad}(A)$.

The _modular class_ $\mathrm{mod}(A)$ of $A$ coincides with $2\pi\
\operatorname{char}^{1}(A)\in\mathrm{H}^{1}(A)$.

Intrinsic characteristic classes are not a complete obstruction to the
existence of a metric which is invariant under a basic connection. This is in
contrast to the case of the modular class, whose vanishing implies the
existence of an invariant measure. As an example, let $\mathfrak{g}$ be the
3-dimensional Lie algebra given by

$\displaystyle[e_{1},e_{2}]=0,\qquad[e_{1},e_{3}]=ae_{1}+be_{2},\qquad[e_{2},e_{3}]=ce_{1}+de_{2},\qquad
Q=\left(\begin{matrix}a&b\\\
c&d\end{matrix}\right)\in\mathrm{GL}_{2}(\mathbb{R}),$

which we regard as a Lie algebroid over a point. By dimensional reasons, we
have

$\displaystyle\operatorname{char}(\mathfrak{g})=0\quad\Longleftrightarrow\quad\mathrm{mod}(\mathfrak{g})=0\quad\Longleftrightarrow\quad\operatorname{Tr}Q=0.$

On the other hand, the only basic connection is
$\nabla^{\mathrm{bas}}_{x}y=[x,y]$, and $\operatorname{Ad}(\mathfrak{g})$
admits a (positive-definite) $\mathrm{ad}$-invariant metric iff $\mathfrak{g}$
is abelian.

##  3 Proof of the Main Theorem

While primary and secondary characteristic classes are functorial with respect
to pullbacks essentially by inspection of the construction, for intrinsic
characteristic classes the situation is slightly more intricate because the
adjoint representation up to homotopy of a pullback is not itself a pullback
representation up to homotopy. The following special case will turn out to be
key:

######  Proposition 3.1.

Intrinsic characteristic classes are functorial with respect to surjective
submersions.

The proof of the Main Theorem requires the following direct consequence of
Proposition 3.1:

######  Proposition 3.2.

Intrinsic characteristic classes are functorial with respect to transverse,
closed embeddings.

######  Proof 3.3.

Let $i\colon X\hookrightarrow M$ be a closed embedding transverse to $A$, and
$p\colon NX:=TM|_{X}/TX\to X$ the normal bundle to $X$. By the normal form
theorem in [2], we can find an open subset $U\subset NX$, and an isomorphism
of Lie algebroids $(\Phi,\phi)\colon
p^{!}i^{!}(A)\xrightarrow{\raisebox{-1.99997pt}[0.0pt][0.0pt]{\smash{$\sim$}}}A|_{\phi(U)}$,
such that the following triangle of morphisms of Lie algebroids commutes

$\textstyle{p^{!}i^{!}(A)\ignorespaces\ignorespaces\ignorespaces\ignorespaces}$$\scriptstyle{(\Phi,\phi)}$$\scriptstyle{\simeq}$$\textstyle{A|_{\phi(U)}}$$\textstyle{i^{!}(A),\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces}$$\scriptstyle{(\widetilde{z},z)}$$\scriptstyle{(\widetilde{i},i)}$

where $\big{(}\widetilde{i},i\big{)}$ is the pullback morphism of Lie
algebroids induced by the inclusion $i\colon X\hookrightarrow M$, and
$(\widetilde{z},z)$ is the pullback morphism of Lie induced by the zero
section $z\colon X\hookrightarrow U$. Because $(\Phi,\phi)$ is an isomorphism,
we have that
$\operatorname{char}\big{(}p^{!}i^{!}(A)\big{)}=(\Phi,\phi)^{*}\operatorname{char}(A)$,
and this implies

$\displaystyle
i^{*}\operatorname{char}(A)=z^{*}\operatorname{char}\big{(}p^{!}i^{!}(A)\big{)}=(pz)^{*}\operatorname{char}\big{(}i^{!}(A)\big{)}=\operatorname{char}\big{(}i^{!}(A)\big{)},$

where in the middle equality we used Proposition 3.1.

######  Proof 3.4 (Proof of the Main Theorem).

Let $\phi\colon N\to M$ be a smooth map, and $A$ a Lie algebroid on $M$.
Factor $\phi$ as $\operatorname{pr}_{2}i$, where

$\displaystyle
N\stackrel{{\scriptstyle\operatorname{pr}_{1}}}{{\longleftarrow}}N\times
M\stackrel{{\scriptstyle\operatorname{pr}_{2}}}{{\longrightarrow}}M$

denote the canonical projections, and where

$\displaystyle i\colon\ N\longrightarrow N\times M,\qquad i(x):=(x,\phi(x))$

is the embedding of $N$ as the graph of $\phi$. Because
$\operatorname{pr}_{2}$ is a surjective submersion, $\phi$ is transverse to
$A$ exactly when $i$ is transverse to $\operatorname{pr}_{2}^{!}(A)$. Hence

$\displaystyle\phi^{*}\operatorname{char}(A)=i^{*}\operatorname{pr}_{2}^{*}\operatorname{char}(A)=i^{*}\operatorname{char}\big{(}\operatorname{pr}_{2}^{!}A\big{)}=\operatorname{char}\big{(}i^{!}\operatorname{pr}_{2}^{!}A\big{)}=\operatorname{char}\big{(}\phi^{!}A\big{)},$

where in the second equality we used Proposition 3.1, and in the third,
Proposition 3.2.

So everything boils down to

######  Proof 3.5 (Proof of Proposition 3.1).

Let $p\colon\Sigma\to M$ be a surjective submersion, and $A$ a Lie algebroid
on $M$. Our goal is to show that

$\displaystyle\operatorname{char}\big{(}p^{!}(A)\big{)}=p^{*}(\operatorname{char}(A)),$

and by item b) of Proposition 2.2, it suffices to show that

$\displaystyle\operatorname{char}\big{(}p^{!}(A)\big{)}=\mathfrak{u}\big{(}p^{!}\big{(}\nabla^{\mathrm{bas}}\big{)}\big{)},$

where $\nabla^{\mathrm{bas}}$ is the basic connection associated (in the sense
of the Main Example) with some linear connection $\nabla\colon
TM\curvearrowright A$.

To do so, it is enough to give a recipe which to a connection $\nabla\colon
TM\curvearrowright A$ and metrics $g_{A}$ on $A$ and $g_{M}$ on $TM$, assigns
a connection $\overline{\nabla}\colon T\Sigma\curvearrowright p^{!}(A)$, and
metrics $g_{p^{!}(A)}$ on $p^{!}(A)$ and $g_{\Sigma}$ on $T\Sigma$, such that

$\displaystyle\mathrm{cs}\big{(}\overline{\nabla}^{\mathrm{bas}},\overline{\nabla}^{\mathrm{bas},\overline{g}}\big{)}=p^{*}\mathrm{cs}\big{(}\nabla^{\mathrm{bas}},\nabla^{\mathrm{bas},g}\big{)},$
(3.1)

where $g=(g_{A},g_{M})$ and $\overline{g}=(g_{p^{!}(A)},g_{\Sigma})$. Our
recipe for $\big{(}\overline{\nabla},g_{p^{!}(A)},g_{\Sigma}\big{)}$ will
depend on choices of a metric $g_{V}$ on the vertical bundle $V=\ker p_{*}$,
and an Ehresmann connection $H\subset T\Sigma$ for $p$, all of which we fix
once and for all. Denote by $h\colon p^{*}(TM)\to T\Sigma$ the horizontal lift
associated with $H$ and by $\mathbb{V}$ the subbundle $V\oplus
V\subset\operatorname{Ad}\big{(}p^{!}(A)\big{)}$.

Consider the exact sequence of vector bundles over $\Sigma$:

$\displaystyle
0\longrightarrow\mathbb{V}\longrightarrow\operatorname{Ad}\big{(}p^{!}(A)\big{)}\stackrel{{\scriptstyle\widetilde{p}}}{{\longrightarrow}}p^{*}\operatorname{Ad}(A)\longrightarrow
0$

and define

$\displaystyle\mathrm{hor}\colon\
p^{*}(A)\xrightarrow{\raisebox{-1.99997pt}[0.0pt][0.0pt]{\smash{$\sim$}}}C\subset
p^{!}(A),\qquad\mathrm{hor}(a):=(h(\varrho_{A}a),a)\in T\Sigma\times_{TM}A.$

This induces a linear splitting $(\mathrm{hor},h)\colon
p^{*}\operatorname{Ad}(A)\to\operatorname{Ad}\big{(}p^{!}(A)\big{)}$ to the
exact sequence above, and we define metrics $g_{\Sigma}$ on $T\Sigma$ and
$g_{p^{!}A}$ on $p^{!}(A)$ so that

$\displaystyle(V,g_{V})\oplus\big{(}p^{*}(TM),p^{*}g_{M}\big{)}\longrightarrow(T\Sigma,g_{\Sigma}),\qquad$
$\displaystyle\big{(}v,p^{\dagger}(u)\big{)}\mapsto v+h(u),$
$\displaystyle(V,g_{V})\oplus\big{(}p^{*}(A),p^{*}g_{A}\big{)}\longrightarrow\big{(}p^{!}A,g_{p^{!}A}\big{)},\qquad$
$\displaystyle\big{(}v,p^{\dagger}(a)\big{)}\mapsto v+\mathrm{hor}(a)$

be isometries.

The metric $\overline{g}=(g_{p^{!}(A)},g_{\Sigma})$ on
$\operatorname{Ad}\big{(}p^{!}(A)\big{)}$ is the one in the output of our
recipe. The construction of $\overline{\nabla}$ which satisfies (3.1), on the
other hand, is subtler, and proceeds in steps.

Step one. First consider the Riemannian connection $\nabla^{\mathrm{R}}\colon
T\Sigma\curvearrowright T\Sigma$ of $g_{\Sigma}$, which satisfies

$\displaystyle\nabla^{\mathrm{R},\mathrm{bas}}=\nabla^{\mathrm{R}}=\nabla^{\mathrm{R},g_{\Sigma}}.$

Step two. Let the horizontal and vertical projections corresponding to
$g_{\Sigma}$ be denoted by $\mathrm{P}_{H},\mathrm{P}_{V}\colon T\Sigma\to
T\Sigma$, and define a new connection

$\displaystyle\nabla^{\Sigma}\colon\ T\Sigma\curvearrowright
T\Sigma,\qquad\nabla^{\Sigma}_{u}v:=\mathrm{P}_{H}\nabla^{\mathrm{R}}_{u}\mathrm{P}_{H}(v)+\mathrm{P}_{V}\nabla^{\mathrm{R}}_{u}\mathrm{P}_{V}(v).$

Note that $V,H\subset T\Sigma$ are subconnections by construction. We claim
that $\nabla^{\Sigma}$ is $g_{\Sigma}$-metric,
$\nabla^{\Sigma}=\nabla^{\Sigma,g_{\Sigma}}$. Indeed, note that by definition
of $\nabla^{\Sigma}$, we have

$\displaystyle
g_{\Sigma}\big{(}\nabla^{\Sigma}_{u}v,w\big{)}=g_{\Sigma}\big{(}\nabla^{\mathrm{R}}_{u}\mathrm{P}_{H}v,\mathrm{P}_{H}w\big{)}+g_{\Sigma}\big{(}\nabla^{\mathrm{R}}_{u}\mathrm{P}_{V}v,\mathrm{P}_{V}w\big{)}$

and because $g_{\Sigma}(V,H)=0$ and $\nabla^{\mathrm{R}}$ is
$g_{\Sigma}$-metric,

$\displaystyle
g_{\Sigma}\big{(}\nabla^{\Sigma}_{u}v,w\big{)}+g_{\Sigma}\big{(}v,\nabla^{\Sigma}_{u}w\big{)}=\mathscr{L}_{u}g_{\Sigma}(\mathrm{P}_{H}v,\mathrm{P}_{H}w)+\mathscr{L}_{u}g_{\Sigma}(\mathrm{P}_{V}v,\mathrm{P}_{V}w)=\mathscr{L}_{u}g_{\Sigma}(v,w).$

Step three. There exist unique $C^{\infty}(\Sigma)$-linear maps

$\displaystyle\mathcal{D}\colon\
\Gamma(H)\to\operatorname{End}(\Gamma(V)),\qquad\mathcal{E}\colon\
\Gamma(H)\longrightarrow\operatorname{End}(\Gamma(C)),$

satisfying the Leibniz rule

$\displaystyle\mathcal{D}_{w}(fv)=f\mathcal{D}_{w}(v)+(\mathscr{L}_{w}f)v,\qquad\mathcal{E}_{w}(f\alpha)=f\mathcal{E}_{w}(\alpha)+(\mathscr{L}_{w}f)\alpha,$

for all $f\in C^{\infty}(\Sigma)$, $v\in\Gamma(V)$, $w\in\Gamma(H)$ and
$\alpha\in\Gamma(C)$, and such that

$\displaystyle\mathcal{D}_{h(u)}v=[h(u),v],\qquad\mathcal{E}_{h(u)}\mathrm{hor}(a)=\mathrm{hor}(\nabla_{u}a),$

for all $u\in\mathfrak{X}(M)$ and $a\in\Gamma(A)$. Concretely, we identify
$\Gamma(H)$ with $C^{\infty}(\Sigma)\otimes_{C^{\infty}(M)}\mathfrak{X}(M)$
and $\Gamma(C)$ with $C^{\infty}(\Sigma)\otimes_{C^{\infty}(M)}\Gamma(A)$.
Then $\mathcal{D}$ is just obtained by extension of scalars
$\mathcal{D}_{\lambda h(u)}:=\lambda\mathcal{D}_{h(u)}$. In turn, for each
fixed $u\in\mathfrak{X}(M)$, the linear map

$\displaystyle\mathcal{E}_{h(u)}\colon\
\Gamma(A)\longrightarrow\Gamma(C),\qquad\mathcal{E}_{h(u)}(a)=\mathrm{hor}(\nabla_{u}a)$

extends to an endomorphism of $\Gamma(C)$ via $\mathcal{E}_{h(u)}(\mu\otimes
a):=\mu\mathcal{E}_{h(u)}(a)+(\mathscr{L}_{h(u)}\mu)\mathrm{hor}(a)$, and
$\mathcal{E}$ is obtained by extension of scalars: $\mathcal{E}_{\lambda
h(u)}:=\lambda\mathcal{E}_{h(u)}$.

Step four. Let now $\overline{\nabla}\colon T\Sigma\curvearrowright p^{!}(A)$
be the connection which satisfies

$\displaystyle a)\ \
\overline{\nabla}_{v}v^{\prime}:=\nabla^{\Sigma,\mathrm{bas}}_{v}v^{\prime},\qquad$
$\displaystyle b)\ \
\overline{\nabla}_{w}v^{\prime}:=\mathcal{D}_{w}(v^{\prime}),$ $\displaystyle
c)\ \
\overline{\nabla}_{v}\alpha:=\nabla^{\Sigma,\mathrm{bas}}_{v}\varrho_{p^{!}(A)}\alpha,\qquad$
$\displaystyle d)\ \
\overline{\nabla}_{w}\alpha:=\mathcal{E}_{w}\alpha+c(w,\varrho_{p^{!}(A)}\alpha)$

for all $v,v^{\prime}\in\Gamma(V)$, $w\in\Gamma(H)$ and $\alpha\in\Gamma(C)$,
and where $c$ denotes the extension of

$\displaystyle\mathfrak{X}(M)\times\mathfrak{X}(M)\longrightarrow\Gamma(V),\qquad(u,u^{\prime})\mapsto[h(u),h(u^{\prime})]-h[u,u^{\prime}]$

to a form $c\in\Gamma(\wedge^{2}p^{*}(T^{*}M)\otimes V)$. This concludes our
recipe

$\displaystyle(\nabla,g_{A},g_{M})\mapsto\big{(}\overline{\nabla},g_{p^{!}(A)},g_{\Sigma}\big{)}$

and all there is left to do is to check that (3.1) is satisfied.

We begin by computing the basic connection
$\overline{\nabla}^{\mathrm{bas}}\colon
p^{!}(A)\curvearrowright\operatorname{Ad}\big{(}p^{!}(A)\big{)}$:

$\displaystyle a)\ \
\overline{\nabla}^{\mathrm{bas}}_{v}v^{\prime}=\nabla^{\Sigma}_{v}v^{\prime},\qquad$
$\displaystyle b)\ \
\overline{\nabla}^{\mathrm{bas}}_{\mathrm{hor}(a)}v^{\prime}=\nabla^{\Sigma}_{h(\varrho_{A}a)}v^{\prime},$
$\displaystyle c)\ \
\overline{\nabla}^{\mathrm{bas}}_{v}\mathrm{hor}(b)=0,\qquad$ $\displaystyle
d)\ \ \overline{\nabla}^{\mathrm{bas}}_{v}h(u)=0,$ $\displaystyle e)\ \
\overline{\nabla}^{\mathrm{bas}}_{\mathrm{hor}(a)}\mathrm{hor}(b)=\mathrm{hor}\big{(}\nabla^{\mathrm{bas}}_{a}b\big{)},\qquad$
$\displaystyle f)\ \
\overline{\nabla}^{\mathrm{bas}}_{\mathrm{hor}(a)}h(u)=h\big{(}\nabla^{\mathrm{bas}}_{a}u\big{)},$

where $v,v^{\prime}\in\Gamma(V)$, $u\in\mathfrak{X}(M)$ and $a,b\in\Gamma(A)$.
In particular, it follows from a) and b) that

$\displaystyle\overline{\nabla}^{\mathrm{bas}}_{\alpha}\Gamma(\mathbb{V})\subset\Gamma(\mathbb{V}),\qquad\alpha\in\Gamma\big{(}p^{!}(A)\big{)},$
(3.2)

whereas from c)–f) it follows that

$\displaystyle\overline{\nabla}^{\mathrm{bas}}_{\alpha}\Gamma(p^{*}\operatorname{Ad}(A))\subset\Gamma(p^{*}\operatorname{Ad}(A)),\qquad\alpha\in\Gamma\big{(}p^{!}(A)\big{)}.$
(3.3)

Because $\mathbb{V}$ and $p^{*}\operatorname{Ad}(A)$ are
$\overline{g}$-orthogonal, it follows from (3.2), (3.3) and the definition of
$\overline{g}$-dual connection that

$\displaystyle\overline{\nabla}^{\mathrm{bas},\overline{g}}_{\alpha}\Gamma(\mathbb{V})\subset\Gamma(\mathbb{V}),\qquad\overline{\nabla}^{\mathrm{bas},\overline{g}}_{\alpha}\Gamma(p^{*}\operatorname{Ad}(A))\subset\Gamma(p^{*}\operatorname{Ad}(A)),\qquad\alpha\in\Gamma\big{(}p^{!}(A)\big{)}.$
(3.4)

The explicit description a)–f) of $\overline{\nabla}^{\mathrm{bas}}$ also
implies that $\overline{\nabla}^{\mathrm{bas}}$ restricts to a subconnection
$\nabla^{\mathbb{V}}:=\overline{\nabla}^{\mathrm{bas}}|_{\mathbb{V}}\colon
p^{!}(A)\curvearrowright\mathbb{V}$, which is $\overline{g}$-metric:

$\displaystyle\nabla^{\mathbb{V}}=\overline{\nabla}^{\mathrm{bas}}|_{\mathbb{V}}=\overline{\nabla}^{\mathrm{bas},\overline{g}}|_{\mathbb{V}},$
(3.5)

and that for $\alpha,\beta\in\Gamma\big{(}p^{!}(A)\big{)}$, $a,b\in\Gamma(A)$,
$w\in\mathfrak{X}(\Sigma)$ and $u\in\mathfrak{X}(M)$,

$\displaystyle\alpha\sim_{p}a,\qquad\beta\sim_{p}b,\qquad
w\sim_{p}u\quad\Longrightarrow\quad\overline{\nabla}^{\mathrm{bas}}_{\alpha}(\beta,w)\sim_{p}\nabla^{\mathrm{bas}}_{a}(b,u).$
(3.6)

We conclude from equations (3.2), (3.3), (3.5) and (3.6) that

$\displaystyle\overline{\nabla}^{\mathrm{bas}}=\nabla^{\mathbb{V}}\oplus
p^{!}\big{(}\nabla^{\mathrm{bas}}\big{)}.$ (3.7)

Because
$p^{*}g(b,b^{\prime})=\overline{g}(\mathrm{hor}(b),\mathrm{hor}(b^{\prime}))$
and $\overline{\nabla}^{\mathrm{bas}}_{v}\mathrm{hor}(b)=0$, it follows that

$\displaystyle\overline{\nabla}^{\mathrm{bas},\overline{g}}_{v}\mathrm{hor}(b)=0,\qquad
v\in\Gamma(V),\qquad b\in\Gamma(A),$

and because
$\overline{\nabla}^{\mathrm{bas}}_{\mathrm{hor}(a)}\mathrm{hor}(b)=\mathrm{hor}\big{(}\nabla^{\mathrm{bas}}_{a}b\big{)}$,
it follows that

$\displaystyle\overline{\nabla}^{\mathrm{bas},\overline{g}}_{\mathrm{hor}(a)}\mathrm{hor}(b)=\mathrm{hor}\big{(}\nabla^{\mathrm{bas},g}_{a}b\big{)},$

whence

$\displaystyle\alpha\sim_{p}a,\qquad\beta\sim_{p}b,\qquad
w\sim_{p}u\quad\Longrightarrow\quad\overline{\nabla}^{\mathrm{bas},\overline{g}}_{\alpha}(\beta,w)\sim_{p}\nabla^{\mathrm{bas},g}_{a}(b,u).$
(3.8)

Equations (3.4), (3.5) and (3.8) hence imply that

$\displaystyle\overline{\nabla}^{\mathrm{bas},\overline{g}}=\nabla^{\mathbb{V}}\oplus
p^{!}\big{(}\nabla^{\mathrm{bas},g}\big{)}.$ (3.9)

Now form the affine connections

$\displaystyle\nabla^{\mathrm{aff}}\colon\ A\times
T\varDelta^{1}\curvearrowright\operatorname{Ad}(A)\times\varDelta^{1},\qquad$
$\displaystyle\nabla^{\mathrm{aff}}=t_{0}\nabla^{\mathrm{bas}}+t_{1}\nabla^{\mathrm{bas},g},$
$\displaystyle\overline{\nabla}^{\mathrm{aff}}\colon\ p^{!}(A)\times
T\varDelta^{1}\curvearrowright\operatorname{Ad}\big{(}p^{!}(A)\big{)}\times\varDelta^{1},\qquad$
$\displaystyle\overline{\nabla}^{\mathrm{aff}}=t_{0}\overline{\nabla}^{\mathrm{bas}}+t_{1}\overline{\nabla}^{\mathrm{bas},\overline{g}}$

used respectively to compute
$\mathrm{cs}\big{(}\nabla^{\mathrm{bas}}\\!{,}\nabla^{\mathrm{bas},g}\big{)}$
and
$\mathrm{cs}\big{(}\overline{\nabla}^{\mathrm{bas}}\\!{,}\overline{\nabla}^{\mathrm{bas},\overline{g}}\big{)}$.
Then equations (3.7) and (3.9) imply that

$\displaystyle\overline{\nabla}^{\mathrm{aff}}=\operatorname{pr}^{!}\big{(}\nabla^{\mathbb{V}}\big{)}\oplus(p,\mathrm{id}_{\varDelta^{1}})^{!}\big{(}\nabla^{\mathrm{aff}}\big{)},$

whence

$\displaystyle\operatorname{Tr}_{s}\big{(}R_{\overline{\nabla}^{\mathrm{aff}}}^{q}\big{)}=\operatorname{pr}^{*}\operatorname{Tr}_{s}\big{(}R_{\nabla^{\mathbb{V}}}^{q}\big{)}+\big{(}p,\mathrm{id}_{\varDelta^{1}}\big{)}^{*}\operatorname{Tr}_{s}\big{(}R_{\nabla^{\mathrm{aff}}}^{q}\big{)}$

and so

$\displaystyle\mathrm{cs}^{q}\big{(}\overline{\nabla}^{\mathrm{bas}},\overline{\nabla}^{\mathrm{bas},\overline{g}}\big{)}=-\mathop{}\mkern-3.0mu\mathchoice{\hbox
to0.0pt{$\displaystyle\vbox{\hbox
to7.83334pt{\hss$\textstyle{-}$\hss}}$\hss}}{\hbox
to0.0pt{$\textstyle\vbox{\hbox
to7.83334pt{\hss$\scriptstyle{-}$\hss}}$\hss}}{\hbox
to0.0pt{$\scriptstyle\vbox{\hbox
to6.16667pt{\hss$\scriptscriptstyle{-}$\hss}}$\hss}}{\hbox
to0.0pt{$\scriptscriptstyle\vbox{\hbox
to6.16667pt{\hss$\scriptscriptstyle{-}$\hss}}$\hss}}\mkern-3.0mu\int_{\varDelta^{1}}\operatorname{Tr}_{s}\big{(}R_{\overline{\nabla}^{\mathrm{aff}}}^{q}\big{)}=-\mathop{}\mkern-3.0mu\mathchoice{\hbox
to0.0pt{$\displaystyle\vbox{\hbox
to7.83334pt{\hss$\textstyle{-}$\hss}}$\hss}}{\hbox
to0.0pt{$\textstyle\vbox{\hbox
to7.83334pt{\hss$\scriptstyle{-}$\hss}}$\hss}}{\hbox
to0.0pt{$\scriptstyle\vbox{\hbox
to6.16667pt{\hss$\scriptscriptstyle{-}$\hss}}$\hss}}{\hbox
to0.0pt{$\scriptscriptstyle\vbox{\hbox
to6.16667pt{\hss$\scriptscriptstyle{-}$\hss}}$\hss}}\mkern-3.0mu\int_{\varDelta^{1}}\big{(}p,\mathrm{id}_{\varDelta^{1}}\big{)}^{*}\operatorname{Tr}_{s}\big{(}R_{\nabla^{\mathrm{aff}}}^{q}\big{)}$
$\displaystyle\hphantom{\mathrm{cs}^{q}\big{(}\overline{\nabla}^{\mathrm{bas}},\overline{\nabla}^{\mathrm{bas},\overline{g}}\big{)}}{}=-p^{*}\mathop{}\mkern-3.0mu\mathchoice{\hbox
to0.0pt{$\displaystyle\vbox{\hbox
to7.83334pt{\hss$\textstyle{-}$\hss}}$\hss}}{\hbox
to0.0pt{$\textstyle\vbox{\hbox
to7.83334pt{\hss$\scriptstyle{-}$\hss}}$\hss}}{\hbox
to0.0pt{$\scriptstyle\vbox{\hbox
to6.16667pt{\hss$\scriptscriptstyle{-}$\hss}}$\hss}}{\hbox
to0.0pt{$\scriptscriptstyle\vbox{\hbox
to6.16667pt{\hss$\scriptscriptstyle{-}$\hss}}$\hss}}\mkern-3.0mu\int_{\varDelta^{1}}\operatorname{Tr}_{s}\big{(}R_{\nabla^{\mathrm{aff}}}^{q}\big{)}=p^{*}\mathrm{cs}\big{(}\nabla^{\mathrm{bas}},\nabla^{\mathrm{bas},g}\big{)}.$

This shows that (3.1) holds true, and concludes the proof that
$\operatorname{char}\big{(}p^{!}(A)\big{)}=p^{*}\operatorname{char}(A)$.

### Acknowledgements

Work partially supported by the Nederlandse Organisatie voor Wetenschappelijk
Onderzoek (Vrije Competitie grant “Flexibility and Rigidity of Geometric
Structures” 612.001.101) and by IMPA (CAPES-FORTAL project). I would like to
thank Ioan Mărcuţ, Ori Yudilevich, Rui Loja Fernandes, Olivier Brahic and
David Martínez-Torres. I am also grateful to the anonymous referees for their
many useful comments.

## References

  * [1] Abad C.A., Crainic M., Representations up to homotopy of Lie algebroids, J. Reine Angew. Math. 663 (2012), 91–126, arXiv:0911.2859.
  * [2] Bursztyn H., Lima H., Meinrenken E., Splitting theorems for Poisson and related structures, J. Reine Angew. Math., to appear, arXiv:1605.05386.
  * [3] Caseiro R., Fernandes R.L., The modular class of a Poisson map, Ann. Inst. Fourier (Grenoble) 63 (2013), 1285–1329, arXiv:1103.4305.
  * [4] Crainic M., Chern characters via nonlinear connections, math.DG/0009229.
  * [5] Crainic M., Differentiable and algebroid cohomology, van Est isomorphisms, and characteristic classes, Comment. Math. Helv. 78 (2003), 681–721, math.DG/0008064.
  * [6] Crainic M., Fernandes R.L., Secondary characteristic classes of Lie algebroids, in Quantum Field Theory and Noncommutative Geometry, Lecture Notes in Phys., Vol. 662, Springer, Berlin, 2005, 157–176.
  * [7] Crainic M., Fernandes R.L., Martínez Torres D., Poisson manifolds of compact types (PMCT 1), J. Reine Angew. Math., to appear, arXiv:1510.07108.
  * [8] Damianou P.A., Fernandes R.L., Integrable hierarchies and the modular class, Ann. Inst. Fourier (Grenoble) 58 (2008), 107–137, math.DG/0607784.
  * [9] del Hoyo M., Ortiz C., Morita equivalences of vector bundles, Int. Math. Res. Not., to appear, arXiv:1612.09289.
  * [10] Evens S., Lu J.-H., Weinstein A., Transverse measures, the modular class and a cohomology pairing for Lie algebroids, Quart. J. Math. Oxford 50 (1999), 417–436, dg-ga/9610008.
  * [11] Fernandes R.L., Lie algebroids, holonomy and characteristic classes, Adv. Math. 170 (2002), 119–179, math.DG/0007132.
  * [12] Frejlich P., Mărcuţ I., The homology class of a Poisson transversal, Int. Math. Res. Not., to appear, arXiv:1704.04724.
  * [13] Ginzburg V.L., Grothendieck groups of Poisson vector bundles, J. Symplectic Geom. 1 (2001), 121–169, math.DG/0009124.
  * [14] Ginzburg V.L., Golubev A., Holonomy on Poisson manifolds and the modular class, Israel J. Math. 122 (2001), 221–242, math.DG/9812153.
  * [15] Ginzburg V.L., Lu J.-H., Poisson cohomology of Morita-equivalent Poisson manifolds, Int. Math. Res. Not. 1992 (1992), 199–205.
  * [16] Grabowski J., Modular classes of skew algebroid relations, Transform. Groups 17 (2012), 989–1010, arXiv:1108.2366.
  * [17] Gracia-Saz A., Mehta R.A., Lie algebroid structures on double vector bundles and representation theory of Lie algebroids, Adv. Math. 223 (2010), 1236–1275, arXiv:0810.0066.
  * [18] Guillemin V., Miranda E., Pires A.R., Codimension one symplectic foliations and regular Poisson structures, Bull. Braz. Math. Soc. (N.S.) 42 (2011), 607–623, arXiv:1009.1175.
  * [19] Huebschmann J., Duality for Lie–Rinehart algebras and the modular class, J. Reine Angew. Math. 510 (1999), 103–159, dg-ga/9702008.
  * [20] Kosmann-Schwarzbach Y., Modular vector fields and Batalin–Vilkovisky algebras, in Poisson Geometry (Warsaw, 1998), Banach Center Publ., Vol. 51, Polish Acad. Sci. Inst. Math., Warsaw, 2000, 109–129.
  * [21] Kosmann-Schwarzbach Y., Poisson manifolds, Lie algebroids, modular classes: a survey, SIGMA 4 (2008), 005, 30 pages, arXiv:0710.3098.
  * [22] Kosmann-Schwarzbach Y., Laurent-Gengoux C., Weinstein A., Modular classes of Lie algebroid morphisms, Transform. Groups 13 (2008), 727–755, arXiv:0712.3021.
  * [23] Kosmann-Schwarzbach Y., Weinstein A., Relative modular classes of Lie algebroids, C. R. Math. Acad. Sci. Paris 341 (2005), 509–514, math.DG/0508515.
  * [24] Koszul J.-L., Crochet de Schouten–Nijenhuis et cohomologie, Astérisque (1985), 257–271.
  * [25] Kubarski J., Fibre integral in regular Lie algebroids, in New Developments in Differential Geometry (Budapest 1996), Kluwer Acad. Publ., Dordrecht, 1999, 173–202.
  * [26] Kubarski J., The Weil algebra and the secondary characteristic homomorphism of regular Lie algebroids, in Lie Algebroids and Related Topics in Differential Geometry (Warsaw, 2000), Banach Center Publ., Vol. 54, Polish Acad. Sci. Inst. Math., Warsaw, 2001, 135–173.
  * [27] Kubarski J., Mishchenko A., Nondegenerate cohomology pairing for transitive Lie algebroids, characterization, Cent. Eur. J. Math. 2 (2004), 663–707.
  * [28] Mehta R.A., Lie algebroid modules and representations up to homotopy, Indag. Math. (N.S.) 25 (2014), 1122–1134, arXiv:1107.1539.
  * [29] Stiénon M., Xu P., Modular classes of Loday algebroids, C. R. Math. Acad. Sci. Paris 346 (2008), 193–198, arXiv:0803.2047.
  * [30] Vaisman I., Characteristic classes of Lie algebroid morphisms, Differential Geom. Appl. 28 (2010), 635–647, arXiv:0812.4658.
  * [31] Weinstein A., The modular automorphism group of a Poisson manifold, J. Geom. Phys. 23 (1997), 379–394.
  * [32] Xu P., Gerstenhaber algebras and BV-algebras in Poisson geometry, Comm. Math. Phys. 200 (1999), 545–560, dg-ga/9703001.


5pt

# TR2MTL: LLM based framework for Metric Temporal Logic Formalization of
Traffic Rules

Kumar Manas, Stefan Zwicklbauer and Adrian Paschke K. Manas is with the Freie
Universität Berlin, Germany and Continental Automotive Technologies GmbH,
Germany<EMAIL_ADDRESS>
S. Zwicklbauer is with the Continental Automotive Technologies GmbH, Germany.
A. Paschke is with the Freie Universität Berlin, Germany and Fraunhofer FOKUS
Berlin, Germany.
This work is partially funded by the German Federal Ministry for Economic
Affairs and Energy within the project “KI Wissen”.

###### Abstract

Traffic rules formalization is crucial for verifying the compliance and safety
of autonomous vehicles (AVs). However, manual translation of natural language
traffic rules as formal specification requires domain knowledge and logic
expertise, which limits its adaptation. This paper introduces TR2MTL, a
framework that employs large language models (LLMs) to automatically translate
traffic rules (TR) into metric temporal logic (MTL). It is envisioned as a
human-in-loop system for AV rule formalization. It utilizes a chain-of-thought
in-context learning approach to guide the LLM in step-by-step translation and
generating valid and grammatically correct MTL formulas. It can be extended to
various forms of temporal logic and rules. We evaluated the framework on a
challenging dataset of traffic rules we created from various sources and
compared it against LLMs using different in-context learning methods. Results
show that TR2MTL is domain-agnostic, achieving high accuracy and
generalization capability even with a small dataset. Moreover, the method
effectively predicts formulas with varying degrees of logical and semantic
structure in unstructured traffic rules.

0.82(0.09,0.93) ©2024 IEEE. Personal use of this material is permitted.
Permission from IEEE must be obtained for all other uses, in any current or
future media, including reprinting/republishing this material for advertising
or promotional purposes, creating new collective works, for resale or
redistribution to servers or lists, or reuse of any copyrighted component of
this work in other works.

Accepted for publication in Proceedings of the IEEE Intelligent Vehicles
Symposium (IV), Jeju Island - Korea, 2-5 June 2024.

##  I INTRODUCTION

Safety and liability concerns make traffic rule compliance important for the
automated vehicles (AV) industry. Countries-specific traffic rulebooks such as
German Road Traffic Regulation (StVO)111https://www.gesetze-im-
internet.de/stvo_2013/ and general driving guides such as Vienna Convention on
Road Traffic (VCoRT)222https://unece.org/DAM/trans/conventn/crt1968e.pdf
govern the rights and obligation of road users. However, traffic rules are
often written in natural language, which can be vague, inconsistent, or
context-dependent. This makes it hard for AVs to interpret and follow traffic
rules in different situations and locations. For example, the meaning of safe
distance while driving can vary depending on the driver’s preference.

A possible solution is to use formal logic, such as metric temporal logic
(MTL), to represent traffic rules precisely and unambiguously. MTL can capture
the temporal aspects of traffic rules [1] and enable various applications,
such as verification, planning, monitoring, or prediction. MTL is a
propositional bounded-operator logic that extends propositional logic with the
temporal operator. This makes it especially suitable for safety and
verification tasks [2] due to its ability to consider time constraints on
quantitative temporal operators, unlike linear temporal logic. In the planning
module, formalized traffic rules can restrict AV maneuvers as per rules and
contribute to rule-compliant behavior. MTL formalization of rules is not
straightforward. It requires domain knowledge and expertise in both natural
language and formal logic. It also involves complex reasoning and translation
processes that could be more intuitive for humans. Moreover, it takes time and
effort to manually formalize rules and specifications from different sources
and domains. Therefore, an automated translator that translates natural
language traffic rules into MTL specifications is desirable.

Legal traffic rules to MTL can be considered a translation or semantic parsing
task. We transform the semantic parsing as a “translation” problem. However,
training such a semantic parser is difficult due to the large annotated
dataset requirement of natural language traffic rules and temporal logic
pairs, which is expensive to obtain due to the involvement of logic experts.
Unlike the conventional “in-context learning” [3] approach which relies on
prompting and language understanding of large language models (LLMs) to
minimize the need for large datasets, our method addresses the limitations of
prompting. Classical prompting [3] has performed poorly on complex reasoning
tasks [4], which is crucial for MTL formalization task.

Figure 1: TR2MTL architecture for translating traffic rules into MTL. We use a
pre-trained LLM to translate traffic rules into MTL formulas. We pass the
traffic rules to the LLM and parse its output with an MTL parser to get the
final translation. We guide the LLM with MTL templates and prompts (examples
of traffic rules and their MTL translations). Prompts (see Fig. 2, 3) are
designed to fit the traffic rule formalization task.

We propose TR2MTL, a framework that translates natural language traffic rules
into MTL, as shown in Fig. 1. The translation module shown here leverages an
LLM with a few examples of traffic rules and their corresponding MTL formulas,
which are shown as “few-shot prompts”. The LLM also uses an MTL formula
template (details in Fig. 3) to guide the translation process. The MTL output
of the LLM is then filtered and parsed to generate the final MTL formula. Few-
shot prompts shown here use a chain-of-thought (CoT) prompting [4] variant,
which divides the translation problem into subtasks, each requiring the LLM to
generate an output that solves the current subtask and provides the context
for the next one. Such a variant of prompting enables the model to have a more
robust reasoning capability. This framework can serve as a valuable assistant,
significantly reducing the effort required for rule formalization. It also
offers the advantage of enabling users to select the appropriate answer or
edit the automatically generated translation from the model rather than
starting from scratch to create a new logical rule.

We evaluate TR2MTL using various state-of-the-art and open-source LLMs as the
backbone model on a challenging evaluation dataset of traffic rules from StVO
and VCoRT. We achieved promising translation results even with relatively
complex traffic rules having ambiguous and unstructured syntax and wordings.
We also demonstrate the applicability of TR2MTL to various forms of temporal
logic and other intelligent vehicle domains for generalization purposes. We
provide our dataset of traffic rules and MTL pairs as a valuable resource for
further research and development in traffic rule formalization and
verification for autonomous vehicles. We envision it as a human-in-the-loop
framework that facilitates the rapid formalization of rules and specifications
for verification and testing purposes. We can summarize our main contribution
as follows:

  * •

We propose TR2MTL, a novel human-in-loop framework that leverages LLMs and an
in-context learning approach to automate the translation of natural language
traffic rules into MTL formulas without the need for large annotated datasets.

  * •

We present a dataset for evaluating the quality of LLM-generated MTL traffic
rules. Our dataset consists of unstructured traffic rules, which have varying
linguistic complexity and ambiguity, in contrast to curated datasets [5],
which are based on pre-processed rules with clear semantics and belong to the
non-AV domain.

  * •

We demonstrate that our framework can easily adapt to new traffic rules,
different logic formalization, and other domains with minimal data
requirements.

Sec. II and III cover related work and theoretical backgrounds, respectively.
Backbone language model choices and dataset are discussed in Sec. IV, followed
by the results and discussion in Sec. V.

##  II Related Work

Selected traffic rules from VCoRT and StVO are manually formalized for
intersection [6], interstate [7], safe distance [8], uncontrolled
intersections [9], and overtaking situation [10]. Motion planning algorithms
also leverage traffic rules, usually in an implicit manner, for rule
compliance.

There are multiple ways to formalize traffic rules. Traffic rules are
formalized in first-order logic [9]. Zhao _et al._ [11] used ontology, and
[12] used propositional logic as a representation choice for traffic rules.
However, these representations do not directly use temporal aspects, but
workarounds such as implicitly hiding time aspects in the predicate or atomic
propositions are used. MTL [6], [7] for a discrete time interval, signal
temporal logic (STL) [13], [14] for a continuous time interval of temporal
operators, linear temporal logic [15] and Co-safe linear temporal logic
(scLTL) [16] are different choices among the temporal logic. MTL is more
appropriate for us, as it provides native support for temporal information and
is decidable for finite trace length [2]. Among these options, LTL and scLTL
are unsuitable for modeling the temporal operator’s duration. MTL and STL are
good choices for modeling rules with temporal aspects, but here we focused on
the MTL. However, our approach can be easily extended for STL. In this work,
we kept focus on MTL due to our end goal of assisting the trajectory
verification system in consideration, but our approach can be easily extended
to STL. Furthermore, MTL is more suitable for verifying discrete signals,
unlike STL, which works better with continuous signals [6, 7].

Formalized rules can be utilized in trajectory monitoring [6], [7], trajectory
planning [17], [18], and calculating reachable sets of autonomous vehicles
based on rules. We develop an automated framework to formalize traffic rules,
which can benefit various use cases such as trajectory monitoring, planning,
and reachability analysis for AVs. This differs from previous work that relied
on manually defined criteria, which were not flexible enough.

LLMs have become a powerful tool for translation, mathematical problem-
solving, and reasoning tasks and are used for reasoning and planning for
autonomous agents [19], [20], [21]. nl2ltl [22] is developed to translate text
to the LTL formula based on the restricted template of the formula with
limited capabilities. [23] fine-tuned the LLM for text-to-LTL and FOL
conversion with their dataset, whereas [24] trained model for STL formula
generation from textual specification and lang2ltl [25] used the in-context
learning to obtain the LTL specification for robotics but their methods lack
the step-by-step reasoning required for complex rules such as in traffic
rules. In contrast, our approach uses in-context learning with CoT prompting
instead of classical prompting. This enables us to introduce in-depth
reasoning capability for automated MTL formalization of traffic rules.
Additionally, the previous work did not work with legal traffic rules as
specifications, where texts are unstructured, a lot of world knowledge is
assumed, and fine-tuning the model or training from scratch is difficult
without sufficient datasets. Previous works have a major focus on LTL, and
first-order logic [23] [19], having no time constraints over temporal
operators or heavily processed.

##  III Method

###  III-A Metric Temporal Logic Representation

We briefly overview the operators in MTL following Thati and Roşu [1]. The MTL
grammar we use in this paper can express MTL specifications as:

$\varphi::=p\mid\neg
p\mid\varphi_{1}\wedge\varphi_{2}\mid\varphi_{1}\vee\varphi_{2}$

Where $p\in P$ is a set of possible atomic propositions; $\varphi$ is the task
specification, and $\varphi_{1}$ and $\varphi_{2}$ are MTL formulae. We can
have multiple formulas ( $\varphi_{1}$…..$\varphi_{n}$). We also use the
following temporal operators that involve time intervals.

$\varphi::=\text{G}_{t}(\varphi)\mid\varphi_{1}\text{U}_{t}\varphi_{2}\mid\text{X}_{t}(\varphi)\mid\text{F}_{t}(\varphi)\mid\text{P}_{t}(\varphi)$

where $G$, $U$, $X$, $F$, and $P$ are temporal operators, and the subscript
$t$ denotes an interval $[\text{t}_{1},\text{t}_{2}]$ representing time
duration when these operators are active. If an interval for an operator is
not provided, it refers to the end of the trace, which we presume is finite.
Formulas can also be written using the logical connectives negation ($\neg$),
and ($\wedge$), or ($\vee$), and implication ($\Rightarrow$). The future
globally operator $G$ ensures that $\varphi$ exists within a time period for
all future states. $U$ indicates that $\varphi_{1}$ holds until $\varphi_{2}$
becomes true inside the time interval $t$. Operator $X$ indicates that
$\varphi$ is valid for the next state within the time span defined by $t$ and
$F$ indicates that $\varphi$ holds within a time interval for some future
state, whereas the past operator, $P$, specifies that $\varphi$ holds within a
time interval for some past or previous state.

###  III-B LLM and Chain-of-Thought Reasoning

LLM is a statistical model that can comprehend context, infer meaning, and
generate coherent responses for diverse sets of tasks. We restrict ourselves
to the transformer-based architecture of LLM due to their state-of-the-art
performance [3] in NLP tasks. The transformer architecture uses attention
mechanism [26] to capture the relationship among word corpus and tokens (words
or sub-parts of words) in text, allowing LLM to capture a given word’s context
and semantics. LLMs were trained on a large corpus of data available on the
internet, so they have ingested world knowledge. “In-context learning or
prompting” is a method where the model learns from examples or prompts of a
specific task. Prompts consist of task instruction and input-output pairs, as
an example. This type of learning is also called few-shot learning. If there
is only task instruction without any examples, then it zero-shot learning. In
this work, we used two-shot learning, which means we have two examples apart
from the instruction provided to the language model. Fig. 2 shows our
classical prompt for two-shot learning. We begin Fig. 2 with instructions to
the model followed by the two examples of the natural language traffic rule
and its MTL formula. The model can then translate new traffic rules based on
the learning from these two prompts at inference time, even if new rules and
operators are not in the prompt example. This is because LLMs have obtained
some knowledge about logic during pre-training [3] along with knowledge of
natural language utterance.

Figure 2: Prompt without reasoning and step-by-step thinking for in-context
learning. Two-shot learning prompts or two traffic rules examples are shown.
MTL output is directly provided without additional hints. Only Natural
language text is provided during the test phase, and the model should generate
the MTL formula. Annotations are for illustration (not part of the actual
prompts). Figure 3: Prompt with reasoning and step-by-step thinking for in-
context learning. Prompts used in our experiments, each having two input-
thought process-output triplets or two-shot learning (a total of 2 such
diverse example pairs were used). The step-by-step thought process breaks the
rules into subrules and generates formulas. Later, they are combined to form
the complete MTL rules. Prompts are made of such examples, but only textual
rules are provided during testing, and the model generates step thinking and
the final MTL formula similar to the two prompts example. We omit the details
of the thought process for the second prompt, but it can be written similarly
to the first prompt.

Unlike fine-tuning the LLM, which can be slow and costly, creating the prompts
described in [3] and illustrated in Fig. 2 for in-context learning is a good
alternative. However, their performance is not optimal for the task that
requires reasoning. Inspired by [4], we introduce CoT prompting with step-by-
step thinking, where apart from input-output pairs as in classical prompting,
the thought process is introduced, and the new prompt is the triplet of
{input, thought-process, output}. However, our methods differ from the work of
[4] in introducing step-by-step thinking suited for the traffic rule domain in
our few-shot prompt creation. In their foundational work [4] and later work
focused more on the mathematical reasoning problem, and their CoT reflected
the mathematical reasoning. Unlike mathematical language, formal logic
involves more open-ended problems that need to follow the syntax and grammar
of natural language. Therefore, creating formal language requires mathematical
reasoning and linguistic grammar knowledge. Moreover, formal language has more
explicit and strict syntax rules. By applying a step-by-step approach to
formal language in the CoT process, we can break down a complex traffic rule
problem into multiple subtasks of temporal logic creation. Considering the
traffic rules, which sometimes span more than one sentence and sometimes do
not have a clear structure, breaking the problem into sub-parts or subtasks
through step-by-step thinking introduces more reasoning capacity to the model.
Our new few-shot prompts have restrictions imposed over the selection of
temporal and logical operators through the template definition (Fig. 3), which
aligns the pre-trained LLMs based on our specific formal logic language
requirement. More about the improvement introduced by our variant of CoT can
be found in the results section V.

The CoT and step-by-step thinking few shot examples used in our in-context
learning are shown in Fig. 3. For better readability, we used annotations and
highlighted different components of our approach. As shown in Fig. 3, first,
instruction is provided to the model to translate text to MTL, followed by the
template of our logical language choice (MTL in this case). This template also
limits our logic formula based on the logical structure provided to the model.
Then, finally, two triplets (more can be added) of {input, step-by-step
thought process, output} are provided as few-shot prompts. Compared to prompts
without chain-of-thought in Fig. 2, we have additional step-by-step thought
process in Fig. 3. Visualizing it reveals that in the thought process, we
introduce breaking problems into subtasks and solving the subtask; then, we
combine them to derive the output for the complete task. It is like solving a
mathematical reasoning problem, where breaking a complex problem into subparts
makes things easier. In this paper, CoT refers to the chain-of-thought with
step-by-step thinking unless otherwise specified. In summary, our model learns
to generate MTL translation based on the input rule by decomposing problems
and deriving the final MTL translation. This reasoning capability helps the
model to perform well with the varied sentence and rule structures. Here,
reasoning refers to reasoning over the text and understanding implicit and
explicit traffic regulations behind specific rules. With the world knowledge
of LLMs, we can make additional assumptions to understand rules and their
dependency on any other implicit knowledge.

##  IV Evaluation

We evaluate our framework on the dataset created for the domain of the traffic
rule. Two kinds of in-context learning prompts- classical prompting without
CoT and prompting with CoT—were used in our experiments across several LLM
models.

###  IV-A Dataset Structure: Textual Traffic Rule and MTL

We aim to formalize traffic rules from unstructured text using MTL. However,
we face a challenge in finding a suitable dataset to evaluate our approach.
For two reasons, existing datasets and evaluation metrics and evaluation
metrics [19]-[23] are not adequate for our purposes. First, to our knowledge,
no legal traffic rules have been incorporated as a reference for training or
testing their models. Second, they focus on LTL data, which is different from
MTL. There are well-curated datasets for robotics and drone motion planning
[5] based on LTL data. Moreover, existing datasets (even non-traffic rule
datasets) have simplified and structured rules that do not require complex
reasoning or inference as in traffic rule formalization. [6] and [7] offered a
comprehensive codification of MTL traffic laws for intersection and interstate
driving. These works are the most relevant to our requirements, and we use
them as a baseline for our dataset creation. Their MTL rules are not directly
applicable to us, as they are derived from multiple traffic rules of a
particular subtype and depend on the legal analysis of various rule sources
(StVO, VCoRT) and court decisions for specific traffic scenarios. This rule
representation is helpful for the manual approach as their approach tends to
capture as many traffic situations in less number of rules. However, they are
unsuitable for LLM-based unstructured traffic rules to MTL translation.
Datasets created for other domains (robotics and drones) are good examples of
rules that can be adapted and used for manual and automated models. In
addition, these MTL rules are incompatible with learning-based models such as
LLMs, and methods are hard to extend to new rule sets. So, we created a new
dataset of traffic rules and MTL pairs that can work with LLMs. We kept the
original format and language of the legal traffic rules text with minimal
preprocessing or simplification. We also incorporate a few important traffic
rules from earlier works on AV planning and forecasting [18],[27]. However,
the dataset does not cover some less representative or exceptional driving
scenarios in great detail.

A dataset of 50 traffic rules and MTL pairs was generated based on the
methodology explained in [28] and MTL syntax described in Sec. III-A. As in
[28], we leveraged the parsed tree structure to develop the MTL formula,
allowing us to find reusable predicates that can be used for multiple
formulas. Our dataset handles both general driving rules and rules with
exceptions where the current rules are not valid due to new situations on the
road, such as emergency vehicles’ right of way. Legal text traffic rules were
derived from VCoRT (for general driving rules) and the StVO (for country-
specific rules, Germany in this case). Some preprocessing is given to the
rules to give the phrases concrete meaning and remove the rules’ ambiguity. As
per StVO §(3)(1), a vehicle may only drive at a speed that allows for constant
control. In formal logic and automated systems, ambiguous phrases like under
control require definition. We preprocess such phrases with more concrete
terms, such as speed less than $max\\_speed\\_limit$, to avoid multiple user-
dependent interpretations.

TABLE I: OVERVIEW OF TRAFFIC RULES AND MTL PAIRS DATASET Natural Language Traffic Rule |  MTL Representation
---|---
The ego vehicle passes a stop line if the stop line is in front of the ego vehicle and is not in front of it at the next time step. [6] |  $\begin{aligned} &{cross(ego,stop\\_line)}\\\ &\quad\Rightarrow({in\\_front(stop\\_line,ego)}\land X(\lnot{in\\_front(stop\\_line,ego)}))\end{aligned}$
At roundabouts and junction, if there is a pedestrian crossing the street or a cyclist on the left of the ego vehicle, then the ego vehicle must give way to the pedestrian or cyclist, unless there is a traffic sign number 205 indicating otherwise. |  $\begin{aligned} &G((at\\_roundabout(ego)\lor at\\_crossroad(ego))\\\ &\land(at\\_pedestrain\\_crossing(pedestrian)\lor left\\_of(bicycle,ego))\\\ &\land\neg at\\_traffic\\_sign(ego,205)\\\ &\quad\Rightarrow yield(ego,(pedestrian\lor bicycle)))\end{aligned}$
Ego vehicle will not exceed the speed limit of the lane it is driving on and will not exceed the maximum velocity allowed for its vehicle type and ego will not exceed the speed limit such that it can no longer react to traffic regulations and restrictions. |  $\begin{aligned} &G({keep\\_lane\\_speed\\_limit(ego)}\\\ &\quad\land{keep\\_vehicle\\_type\\_limit(ego)}\\\ &\quad\land{keep\\_braking\\_speed\\_limit(ego)})\end{aligned}$

Some rules refer to other rules in the legal text, so we preprocessed them to
make them clearer and more complete by merging the fragments across the legal
text. We minimally preprocessed the rules to preserve their complexity so that
the model can handle unstructured natural language rules. We paid special
attention to capturing the complex linguistic semantics of the unstructured
natural language text. This enabled us to cover rules with unclear
implications, rules with conditions that were fulfilled in the past and have
ramifications in the present, long or multiple sentences with complex pronouns
and verb structures, and rules where it was not clear whether the conditions
were connected by logical “OR” or logical “AND”.

Our datasets also uses predicates and arguments from commonroad [29] and
lanelet [30]. We assume the sensor detects objects correctly, and a high-
definition map provides information about road infrastructure. TR2MTL can be
adapted to other dataset structures by providing a list of available
predicates and arguments based on the information of the other datasets. Our
goal is to provide a framework and a dataset for automatically translating
traffic rules into MTL through LLM and to evaluate how well TR2MTL can encode
both temporal operators and their timing constraints.

Table I shows our dataset’s natural language traffic rules and their
corresponding MTL. As evident from the data sample in Table I, traffic rules
exhibit a distinct linguistic structure that sets them apart from other
temporal logic datasets. These rules tend to be longer and more complex. For
instance, consider sample rule 2 in Table I: “At roundabouts and crossroads,
if there is a pedestrian crossing the street or a cyclist on the left of the
ego vehicle, then the ego vehicle must give way to the pedestrian or cyclist,
unless there is a traffic sign number 205 indicating otherwise.” Upon closer
examination, we observe that despite the mention of both roundabouts and
crossroads in the rule, from a logical perspective, it implies a “logical OR”
condition. It means that even if only one of the conditions (roundabouts or
crossroads) is detected through driving sensors or map data, the rule should
still be applicable. This shows the complexity that TR2MTL will face while
formalizing traffic rules. Our formalized dataset and steps to reproduce
traffic rules and MTL pairs can be accessed333Evaluation dataset and model
prompts can be accessed
here:https://github.com/kumarmanas/traffic_law_formalization. We will continue
adding new traffic rules to support the growing community of researchers
working at the intersection of NLP, LLMs, and rule compliance for developing
safe and intelligent AVs. We acknowledge that in its current form, our dataset
is more suitable for evaluation rather than for fine-tuning the model due to
its small size. Nevertheless, it is a good resource for in-context learning
models and trained model evaluation for AV and MTL domain.

###  IV-B Evaluation Setup

In our work, we performed two sets of in-context learning experiments: one
involving CoT prompting and the other without such prompting. However, unless
otherwise specified, we discuss experiments involving CoT prompting due to the
better result. As shown in Fig. 1, we parse the language model-generated
output with MTL parser py-metric-temporal-
logic444https://github.com/mvcisback/py-metric-temporal-logic. This post-
process allows us to generate a better candidate MTL formula. Additionally,
the template provided for the prompts (see Fig. 3) restricts the grammar of
the generated MTL formula. We can swap out the MTL parser and filter module
for a new logic parser module, say for parser of LTL or STL language.

###  IV-C Model Selection

We introduce our selected LLMs, which are used as a backbone for this work. As
explained in the introduction, we selected the “in-context learning” approach.
In-context learning via prompting, as introduced in Sec. III-B, is an
alternate way to use the language model to learn new tasks given only a few
examples. We give LLM a prompt consisting of a list of input-output pairs that
demonstrate the task. Five different language models are used as LLM backbone
in TR2MTL: GPT-4555 gpt-4-0314 and gpt-3.5-turbo-0613 models are used for
GPT-4 and GPT-3.5-turbo, respectively., GPT-3.5-turbo5, StarCoder [31],
Falcon-7b [32] and Bloomz [33]. We selected models based on three criteria:
state-of-the-art performance in multiple domains, task relevance, model
accessibility, and open-source availability. Not all models met all these
criteria. GPT-4 and GPT-3.5-turbo were accessible state-of-the-art models when
writing this paper but not open-source. On the other hand, StarCoder,
Falcon-7b, and Bloomz models are open-source with publicly accessible API.
Bloomz and Falcon-7b are optimized to follow human instructions for various
tasks. Whereas the StarCoder performs very well for the coding tasks, even
with smaller model sizes [31]. We evaluated the code generation model to
evaluate if it can be extended to formal logic.

####  IV-C1 Reducing inconsistencies in TR2MTL Output

LLMs are statistical models that may generate inconsistent output for the same
task. We can not eliminate this problem, so to limit its impact, we used a
temperature value of $0.25$ and $P=1$ so that in multiple runs, it generates
more consistent output. Temperature can range from $0$ to $2$, and lower
values produce more consistent and deterministic output (needed for safety
systems) but less creativity. We chose $0.25$ as it gave us the best result.
Templates (shown in Fig. 3) and a list of allowed predicates also helped us
reduce inconsistencies, but not entirely. For example, the MTL formula for a
rule about overtaking had inconsistent predicate generation without the
template in the prompt. The ideal MTL formula for one of the overtaking rules
is $G(overtake(ego,other)\rightarrow P_{[0,t]}turn\\_signal(ego))$, but TR2MTL
sometimes generated overtake and sometimes overtaking. We reduced this kind of
problem by providing a list of predicates.

##  V Results and Analysis

Table II shows that our framework performs better on our traffic rules dataset
by using CoT, which leverages contextualized temporal operators. We compare
different LLM backbones and find that GPT-3.5-turbo with CoT has the highest
accuracy. Remarkably, this result is obtained with only two prompts,
demonstrating the effectiveness of our approach, and more prompts could lead
to even higher accuracy [4]. We use nl2ltl as a baseline, which converts
natural language to LTL formulas without time constraints. We simplified the
MTL formula to an LTL formula for this evaluation by omitting the exact time
information of the temporal operators. However, nl2ltl does not support CoT,
which is essential for our framework. We consider a translation incorrect if
it has any of these errors: missing or wrong temporal operator, wrong
predicate, wrong argument order, wrong logical connective, or MTL grammar
violation. We consider a translation correct if it uses the correct predicates
and has the same meaning as the ground truth translation, even if the MTL
formalization is different. We treat $yield(ego,other)\vee
right\\_of(other,ego)$ and $right\\_of(other,ego)\vee yield(ego,other)$ as the
same translation since they have the same logic. Likewise,
$right\\_of(ego,other)$ and $left\\_of(other,ego)$ are also equivalent. To
scale the accuracy calculation for larger datasets, we can use either a model
checking tool or a semantic accuracy metric as in [23]. To ensure the
standardization of our evaluation, we implemented a robust validation process.
This involved running the TR2MTL model five times for each input and selecting
the translation that was chosen by majority vote. This approach helped to
mitigate any potential inconsistencies in the model’s output. Additionally, we
manually inspected the translations to verify their accuracy and extended them
to ensure that the generated formulas were parsable by MTL parsers.

TABLE II: Translation Accuracy of models for MTL translation of traffic rules. Model is evaluated for two types of in-context learning: with and without CoT. Bold values represent the top models for each experiment. Model Architecture | With CoT | Without CoT
---|---|---
TR2MTL (with GPT-45) |  72.91% |  43.75%
TR2MTL with GPT-3.5-turbo5) | 66.66% | 39.58%
TR2MTL (with StarCoder [31]) | 50.00% | 12.50%
TR2MTL (with Falcon-7b [32]) | 37.50% | 12.50%
TR2MTL (with Bloomz [33]) | 22.91% | 10.41%
nl2ltl[22] | - | 29.16%

Our dataset is designed to be challenging using longer sentence instances and
semantic complexity as explained in IV-A. Analyzing incorrect translations
among all models revealed that most have longer sentence instances, sometimes
exceeding language model capability. This failure is more apparent in non-GPT
model variants, where longer sentence translation either provides erroneous
translation or the model can not produce translation at all. In traffic rules
such as At roundabouts and crossroads, if there is a pedestrian crossing the
street or a cyclist on the left of the ego vehicle, then the ego vehicle must
give way to the pedestrian or cyclist, unless there is a traffic sign number
205 indicating otherwise, we also have a complex semantic structure. There is
much logic to unpack for the model. GPT-4 and GPT-3 based models generate
better quality translations compared to the other models. One possible reason
behind this good performance is the vast background world knowledge available
to the model. For this traffic rule, only GPT variants of the model can infer
that we need logical OR instead of logical AND for the part of rule “at
roundabouts and crossroads…”, as based on general knowledge, we tend to know
such distinction. We also observed that the code generation model, StarCoder,
did not perform well where additional background information was required. To
express traffic rules in formal logic from natural language, one needs to know
about the world and driving knowledge, reasoning logically, and using world
knowledge to support the implicit rules. So, state-of-the-art non-code LLMs
are better equipped to handle than code generation models in the absence of
fine-tuning data.

We performed an error analysis of MTL formalization, and Fig. 4 shows the
error distribution with respective error types for our best-performing GPT-4
model with the CoT reasoning method. All translations were per MTL grammar,
indicated by $0$% mistake for “unknown-template”. This can be attributed to
the template provided in the prompts and parser module. After analyzing all
the model’s results, we found that most errors belong to incorrect logical
connectives (including incorrect implication operator) followed by incorrect
predicate. An instance of an incorrect translation is when the allowed
predicate is fused with its argument. For instance, instead of
$in\\_front(ego,stop)$ TR2MTL represents it as $stop\\_in\\_front(ego)$. In
addition, our model provides step-by-step output with a dictionary having a
collection of traffic rule components (usually as smaller fragments of text
rule) and their corresponding propositions. This makes the result more
explainable and easy for the end user to use or edit as editing is easier for
the end user than creating a new rule.

Figure 4: Distribution of mistakes made by the framework.

CoT is restricted by the number of tokens or length of prompts that the model
can process, which might hinder the user’s ability to write long or more
prompt examples. This prevents us from adding more context to CoT. We can
improve the accuracy of TR2MTL by using a semantic parser as a pre-processing
module to transform traffic rules into a more controlled language (e.g.,
logical English) format needed for formal logic.

###  V-A Generalization Capability

We used a few shot prompts with just two examples, which poses the question of
the generalization capability of TR2MTL for different logic structures,
temporal operators, and out-of-distribution tasks. Table II indicates that our
framework can generalize it to unseen MTL operators (e.g., X, F..) in the
prompts but provided in templates. It can also handle sentence structure and
complexity not seen in two prompts. It can also generalize to new entities.
For example, we use ego and other as two types of arguments in our prompts.
However, the model can differentiate between vehicles in front of the ego and
those behind the ego. However, we observed that code-generation models without
CoT are more susceptible to memorization problems than noncode-generation
models. We tested our framework on six marine traffic rules from [34] and
achieved $50$% accuracy. This shows that our framework can handle different
types of rules for the domain of other intelligent vehicles.

To demonstrate our approach’s robustness on a larger sample, we evaluated the
drone planning dataset [5], which contains 810 pairs of natural language
instructions and LTL formulas. Our goal was to demonstrate the effectiveness
and extensibility of our approach to other logics (such as LTL) and domains.
Table III shows that our CoT method achieved reasonably good accuracy with
just 7 example pairs, compared to the state-of-the-art fine-tuned model [35].
The fine-tuned model typically has higher accuracy, as it benefits from more
data than in-context learning. This indicates the potential of our approach
for other domains that rely on rules to perform their tasks.

TABLE III: Evaluation of the accuracy of translating planning instructions to LTL for the drone planning dataset. Blue color indicates prompting-based model and brown indicates fine-tuned model. Model backbone | Acccuracy
---|---
TR2MTL (with GPT-45) | 57.91%
TR2MTL (with GPT-3.5-turbo5) | 51.43%
TR2MTL (with StarCoder [31]) | 42.59%
BART-FT-RAW [35] | 69.36%

###  V-B Prompt Selection and Translation Accuracy

Prompt selection is crucial for translation in the low-data domain. Prompts
should cover a diverse range of traffic rules and MTL structures rather than
linguistic variations, as LLMs are more proficient in natural language than
formal logic. We observed that TR2MTL struggles with MTL formulas that have
different logical structures from the prompts. For example, if the prompts
have the structure $G(A\lor B)\lor C$, TR2MTL performs poorly on formulas with
the structure $G(A\vee B)\land C$. We also need to consider the diversity of
arity in the prompts, as TR2MTL fails to generate formulas with more than one
argument for a predicate if the prompts only have one argument. The reason is
that we have limited data for prompting, so we need to sample prompts based on
the final task and the LLM’s capabilities. We can create prompts that target
the LLM’s weaknesses and improve its performance.

###  V-C Trajectory Monitoring Using MTL Rules

We used formalized rules for trajectory monitoring. Our framework can be
extended to STL, which also uses timing constraints over temporal operators.
To demonstrate our approach, we generated rule-compliant and non-compliant
trajectories using CommonRoad. We verified them against the specifications
using a runtime Python monitor and an MTL parser as in [34] and [28]. The only
modification required from TR2MTL is to write some additional functions to map
the high-level predicates to the CommonRoad format for the final trajectory
evaluation. Future work can focus on automating this mapping process.

##  VI Conclusion and Future Work

An automated human-in-loop framework for legal traffic rule formalization
using a language model is presented. Due to our CoT prompting, our approach
can quickly adapt to new rulebooks in the AV domain or other intelligent
vehicle specification formalization tasks. Formal specifications are essential
for AVs to comply with legal requirements, and our approach simplifies this
process and makes output more understandable. Our method was applied to
traffic rules requiring reasoning over text, and we observed that the language
model could leverage its knowledge to produce safe and lawful specifications
to a certain extent. Still, further enhancement is needed as verification is a
safety-critical domain. Currently, our framework is more of a human-in-loop
system. Furthermore, our method can create different types of formal rules
(STL, LTL, etc.) by changing the prompts and parsers, and it can aid traffic
management and manual coding tasks. We can also improve the performance of our
method by adding more context to CoT [36] or more prompts [4]. In future work,
we plan to apply and ground the generated formulas to the sensor data of AVs
and evaluate end-to-end rule-to-trajectory verification. We aim to add more
traffic rules to the dataset to fine-tune the language model and improve its
performance.

## References

  * [1] P. Thati and G. Roşu, “Monitoring Algorithms for Metric Temporal Logic Specifications,” _Electronic Notes in Theoretical Computer Science_ , pp. 145–162, Jan. 2005.
  * [2] R. Alur and T. A. Henzinger, “Logics and models of real time: A survey,” in _Real-Time: Theory in Practice_. Springer Berlin Heidelberg, 1992, pp. 74–106.
  * [3] T. Brown _et al._ , “Language models are few-shot learners,” _Advances in neural information processing systems_ , vol. 33, pp. 1877–1901, 2020.
  * [4] J. Wei _et al._ , “Chain-of-thought prompting elicits reasoning in large language models,” _Advances in neural information processing systems_ , vol. 35, pp. 24 824–24 837, 2022.
  * [5] Y. Oh, R. Patel, T. Nguyen, B. Huang, E. Pavlick, and S. Tellex, “Planning with state abstractions for non-markovian task specifications,” _Robotics science and systems_ , 2019.
  * [6] S. Maierhofer, P. Moosbrugger, and M. Althoff, “Formalization of intersection traffic rules in temporal logic,” in _2022 IEEE Intelligent Vehicles Symposium (IV)_ , 2022, pp. 1135–1144.
  * [7] S. Maierhofer, A.-K. Rettinger, E. C. Mayer, and M. Althoff, “Formalization of interstate traffic rules in temporal logic,” in _2020 IEEE Intelligent Vehicles Symposium (IV)_ , 2020, pp. 752–759.
  * [8] A. Rizaldi, F. Immler, and M. Althoff, “A formally verified checker of the safe distance traffic rules for autonomous vehicles,” in _Proceedings of the 8th International Symposium on NASA Formal Methods_ , 2016.
  * [9] A. Karimi and P. S. Duggirala, “Formalizing traffic rules for uncontrolled intersections,” in _2020 ACM/IEEE 11th International Conference on Cyber-Physical Systems (ICCPS)_. IEEE, 2020, pp. 41–50.
  * [10] A. Rizaldi _et al._ , “Formalising and monitoring traffic rules for autonomous vehicles in isabelle/hol,” in _integrated Formal Methods (iFM 2017)_ , vol. 10510, 2017, pp. 50–66.
  * [11] L. Zhao, R. Ichise, Y. Sasaki, Z. Liu, and T. Yoshikawa, “Fast decision making using ontology-based knowledge base,” in _2016 IEEE Intelligent Vehicles Symposium (IV)_ , 2016, pp. 173–178.
  * [12] Q. Zhang _et al._ , “A systematic framework to identify violations of scenario-dependent driving rules in autonomous vehicle software,” _Proc. ACM Meas. Anal. Comput. Syst._ , vol. 5, no. 2, jun 2021.
  * [13] M. Hekmatnejad _et al._ , “Encoding and monitoring responsibility sensitive safety rules for automated vehicles in signal temporal logic,” in _Proceedings of the 17th ACM-IEEE International Conference on Formal Methods and Models for System Design_ , 2019.
  * [14] N. Aréchiga, “Specifying safety of autonomous vehicles in signal temporal logic,” in _2019 IEEE Intelligent Vehicles Symposium (IV)_ , 2019.
  * [15] K. Esterle, V. Aravantinos, and A. Knoll, “From specifications to behavior: Maneuver verification in a semantic state space,” in _2019 IEEE Intelligent Vehicles Symposium (IV)_ , 2019, pp. 2140–2147.
  * [16] X. Ren, X. Yin, and S. Li, “Synthesis of controllers for co-safe linear temporal logic specifications using reinforcement learning,” in _2021 40th Chinese Control Conference (CCC)_ , 2021, pp. 2304–2309.
  * [17] J. Karlsson and J. Tumova, “Intention-aware motion planning with road rules,” in _2020 IEEE 16th International Conference on Automation Science and Engineering (CASE)_ , 2020, pp. 526–532.
  * [18] J. Lin _et al._ , “Road traffic law adaptive decision-making for self-driving vehicles,” in _2022 IEEE 25th International Conference on Intelligent Transportation Systems (ITSC)_ , 2022, pp. 2034–2041.
  * [19] W. Huang, P. Abbeel, D. Pathak, and I. Mordatch, “Language models as zero-shot planners: Extracting actionable knowledge for embodied agents,” _arXiv preprint arXiv:2201.07207_ , 2022.
  * [20] S. Yao, J. Zhao, D. Yu, N. Du, I. Shafran, K. Narasimhan, and Y. Cao, “ReAct: Synergizing reasoning and acting in language models,” in _International Conference on Learning Representations (ICLR)_ , 2023.
  * [21] K. Manas and A. Paschke, “Semantic role assisted natural language rule formalization for intelligent vehicle,” in _International Joint Conference on Rules and Reasoning_. Springer, 2023, pp. 175–189.
  * [22] F. Fuggitti and T. Chakraborti, “NL2LTL – a python package for converting natural language (NL) instructions to linear temporal logic (LTL) formulas,” in _AAAI_ , 2023, system Demonstration.
  * [23] C. Hahn _et al._ , “Formal specifications from natural language,” _ArXiv_ , vol. abs/2206.01962, 2022.
  * [24] J. He, E. Bartocci, D. Ničković, H. Isakovic, and R. Grosu, “DeepSTL - from english requirements to signal temporal logic,” in _IEEE/ACM 44th International Conference on Software Engineering_ , 2022.
  * [25] J. X. Liu _et al._ , “Lang2LTL: Translating natural language commands to temporal specification with large language models,” in _CoRL Workshop on Language and Robot Learning_ , 2022.
  * [26] A. Vaswani _et al._ , “Attention is all you need,” in _Proceedings of the 31st International Conference on Neural Information Processing Systems_ , ser. NIPS’17, 2017, p. 6000–6010.
  * [27] X. Li _et al._ , “Differentiable logic layer for rule guided trajectory prediction,” in _Proceedings of the 2020 Conference on Robot Learning_ , vol. 155, 2021, pp. 2178–2194.
  * [28] K. Manas and A. Paschke, “Legal compliance checking of autonomous driving with formalized traffic rule exceptions,” in _Proceedings of the Workshops co-located with 39th International Conference on Logic Programming (ICLP)_ , 2023.
  * [29] S. Maierhofer, M. Klischat, and M. Althoff, “Commonroad scenario designer: An open-source toolbox for map conversion and scenario creation for autonomous vehicles,” in _2021 IEEE International Intelligent Transportation Systems Conference (ITSC)_ , 2021, pp. 3176–3182.
  * [30] F. Poggenhans _et al._ , “Lanelet2: A high-definition map framework for the future of automated driving,” in _2018 21st International Conference on Intelligent Transportation Systems (ITSC)_ , 2018.
  * [31] R. Li _et al._ , “Starcoder: may the source be with you!” _ArXiv_ , vol. abs/2305.06161, 2023.
  * [32] “Falcon-7b,” https://huggingface.co/tiiuae/falcon-7b, 2023, [Online; accessed 4-August-2023].
  * [33] N. Muennighoff _et al._ , “Crosslingual generalization through multitask finetuning,” _Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics_ , 2023.
  * [34] H. Krasowski and M. Althoff, “Temporal logic formalization of marine traffic rules,” in _2021 IEEE Intelligent Vehicles Symposium (IV)_ , 2021.
  * [35] J. Pan, G. Chou, and D. Berenson, “Data-efficient learning of natural language to linear temporal logic translators for robot task specification,” in _2023 IEEE International Conference on Robotics and Automation (ICRA)_ , 2023, pp. 11 554–11 561.
  * [36] N. Ratner _et al._ , “Parallel context windows for large language models,” in _Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Long Papers)_ , 2023, pp. 6383–6402.