  Eigenvalue interlacing is a useful tool in linear algebra and spectral
analysis. In its simplest form, the interlacing inequality states that a
rank-one positive perturbation shifts each eigenvalue up, but not further than
the next unperturbed eigenvalue. For different types of perturbations, this
idea is known as Weyl interlacing, Cauchy interlacing, Dirichlet--Neumann
bracketing and so on.
  We prove a sharp version of the interlacing inequalities for
``finite-dimensional perturbations in boundary conditions'', expressed as
bounds on the spectral shift between two self-adjoint extensions of a fixed
symmetric operator with finite and equal defect numbers. The bounds are given
in terms of the Duistermaat index, a topological invariant describing the
relative position of three Lagrangian planes in a symplectic space. Two of the
Lagrangian planes describe the self-adjoint extensions being compared, while
the third corresponds to the Friedrichs extension, which acts as a reference
point.
  Along the way several auxiliary results are established, including one-sided
continuity properties of the Duistermaat triple index, smoothness of the
(abstract) Cauchy data space without unique continuation-type assumptions, and
a formula for the Morse index of an extension of a non-negative symmetric
operator.
