need the following well-known theorem that can be found, e.g., in [@Kato I.6.34].

Let $E$ be a Hilbert space and $P,Q$ orthogonal projections in $E$. If

$$\|(I_E-P)Q\|<1\,\,\text{and  } \|(I_E-Q)P\|<1,$$ then

$$\|(I_E-P)Q\|=\|(I_E-Q)P\|=\|P-Q\|.$$

Now, as $(I_{2n}-\hat{P}_{\lambda})\hat{P}_{\lambda_0}=(I_{2n}-\hat{P}_{\lambda_0})\hat{P}_{\lambda}=0$ for $\lambda=\lambda_0$, we have for all $\lambda$ in a neighbourhood of $\lambda_0$

$$\|(I_{2n}-\hat{P}_{\lambda})\hat{P}_{\lambda_0}\|=\|(I_{2n}-\hat{P}_{\lambda_0})\hat{P}_{\lambda}\|=\|\hat{P}_{\lambda}-\hat{P}_{\lambda_0}\|$$ and likewise $$\|(I_{2n}-\tilde{P}_{\lambda})\tilde{P}_{\lambda_0}\|=\|(I_{2n}-\tilde{P}_{\lambda_0})\tilde{P}_{\lambda}\|=\|\tilde{P}_\lambda-\tilde{P}_{\lambda_0}\|.$$ Consequently, we obtain from , and for all $\lambda$ sufficiently close to $\lambda_0$

$$\begin{aligned}
d_G(\mathcal{A}_\lambda,\mathcal{A}_{\lambda_0})&=\max\{\delta(\operatorname{graph}(\mathcal{A}_\lambda),\operatorname{graph}(\mathcal{A}_{\lambda_0})),\delta(\operatorname{graph}(\mathcal{A}_{\lambda_0}),\operatorname{graph}(\mathcal{A}_{\lambda}))\}\\
&\leq 2\alpha(\|\hat{P}_\lambda-\hat{P}_{\lambda_0}\|+\|\tilde{P}_\lambda-\tilde{P}_{\lambda_0}\|),\end{aligned}$$

which shows that $\mathcal{A}=\{\mathcal{A}_\lambda\}_{\lambda\in X}$ is indeed continuous in $\mathcal{CF}(E)$. Hence Proposition \[prop-continuity\] is shown.

The Spectral Flow Formula
-------------------------

We now prove the spectral flow formula in Theorem \[main\] in two steps.

Step 1: Theorem \[main\] for admissible paths {#step-1-theorem-main-for-admissible-paths .unnumbered}
---------------------------------------------

We begin this first step of our proof with the following elementary observation.

\[lemma-connected\] The set of all transversal pairs in $\Lambda(n)$, i.e.

$$\begin{aligned}
\label{set}
\{(L_1,L_2)\in\Lambda(n)\times\Lambda(n):\, L_1\cap L_2=\{0\}\}\subset\Lambda(n)\times\Lambda(n),\end{aligned}$$

is path-connected.

Let us first recall the well-known fact that $\Lambda_0(L_0)$ is contractible, and hence path-connected, for any $L_0\in\Lambda(n)$ (see [@PiccioneBook Rem. 2.5.3]). Now let $(L_1,L_2)$ and $(L_3,L_4)$ be two transversal pairs. As in the construction of the Maslov index in Section \[section-Maslov\], $L'_1=e^{\Theta J}L_1$ is transversal to $L_2$ and $L_4$ for any sufficiently small $\Theta>0$. In particular, we obtain a path 