# On a Communication Complexity problem in Combinatorial Number Theory

Bence Bakos  Bence Bakos, ELTE TTK, Eötvös University, Institute of
Mathematics, H-1117 Pázmány st. 1/c, Budapest, Hungary
<EMAIL_ADDRESS>,  Norbert Hegyvári  Norbert Hegyvári, ELTE TTK,
Eötvös University, Institute of Mathematics, H-1117 Pázmány st. 1/c, Budapest,
Hungary and Alfréd Rényi Institute of Mathematics, H-1364 Budapest, P.O.Box
127<EMAIL_ADDRESS>and  Máté Pálfy  Máté Pálfy, ELTE TTK, Eötvös
University, Institute of Mathematics, H-1117 Pázmány st. 1/c, Budapest,
Hungary<EMAIL_ADDRESS>
###### Abstract.

The original knapsack problem is well known to be NP-complete. In a
multidimensional version one have to decide whether a $p\in\mathbb{N}^{k}$ is
in a sumset-sum of a set $X\subseteq\mathbb{N}^{k}$ or not. In this paper we
are going to investigate a communication complexity problem related to this.
Throughout our examination we are also going to prove some results about the
special case of the multidimensional knapsack problem, when the set $X$ is in
the form $X=A_{1}\times\dots\times A_{k}\subseteq\mathbb{N}^{k}$, where
$A_{i}$ are so called regular sets.

AMS 2010 Primary 11B30, 11B39, Secondary 11B75

Keywords: Subset sums, communication complexity, matching in bipartite graph

##  1\. Introduction

In the last decades there were several interplay between computer sciences and
additive combinatorics. One of the most interesting examples is a connection
between some notions in computer sciences and the Gowers norm (see e.g. [8],
[9]). Another interesting example is an additive communication complexity
problem which was supported by an example of Behrend on the maximal density of
a set without a three-term arithmetic progression (see e.g. [7]) and additive
problem related to decision question (see [6]).

In our paper we investigate a communication complexity problem which is
related to a field in combinatorial number theory; namely to the topic of
subset-sums (see e.g. [5] and for restricted set addition e.g. [4]).

The original form of the knapsack or subset-sum problem is to determine, given
positive integers $a_{1},a_{2},\dots,a_{n}$ and an integer $m$, whether there
is a subset of the set $\\{a_{j}\\}$ that sums up to $m$. It is well known as
an NP-complete problem. Certainly this question can be extend to higher
dimension too. For any $X\subseteq\mathbb{N}^{k}$ let

(1) $FS(X)\mathrel{\mathop{\mathchar
58\relax}}=\\{\sum_{i=1}^{\infty}\varepsilon_{i}x_{i}\mathrel{\mathop{\mathchar
58\relax}}\ x_{i}\in X,\ \varepsilon_{i}\in\\{0,1\\},\
\sum_{i=1}^{\infty}\varepsilon_{i}<\infty\\}$

and we have to decide for $p\in\mathbb{N}$ whether $p\in FS(X)$ or not.

The structure of $FS(X)$ in higher dimension was investigated in $[1],[2]$ and
$[3]$ when the sets $A_{i}$ are powers of integers.

Surprisingly if we have $X=A_{1}\times A_{2}\times\dots\times
A_{k}\subseteq\mathbb{N}^{k}$, where for any $i=1,2,\dots,k$,
$FS(A_{i})=\mathbb{N}$ then $FS(X)$ does not cover necessary the whole
$\mathbb{N}^{k}$. For example if
$X=\\{2^{k}\\}_{k=0}^{\infty}\times\\{2^{m}\\}_{m=0}^{\infty}$ then
$(15,1)\not\in FS(X)$, while $(15,1+256)\in FS(X)$.

Our communication complexity problem can be described as follows: there are
$k$ players, each having a sequence $A_{i}$ with following properties: for
every $i=1,2,\dots,k$

$(i)\ 1\in A_{i};\quad(ii)\ A_{i}\setminus\\{1\\}\subseteq
A_{i}+A_{i};\quad(iii)\ a_{j+1}>\varrho a_{j}$

for some $\varrho\in(1,2]\ j\in\mathbb{N};\ a_{j}\in A_{i}$.

For sets $A,B\subset\mathbb{N}$ the sum is defined by
$A+B\mathrel{\mathop{\mathchar 58\relax}}=\\{a\pm b\mathrel{\mathop{\mathchar
58\relax}}a\in A;\ b\in B\\}$, and throughout the paper $\log_{2}N$ will
denote the logarithm in base 2.

The set $Y\subseteq\mathbb{N}$ is said to be complete if $FS(Y)=\mathbb{N}$.
For any $z\in\mathbb{N}^{r}$ and $X\subseteq\mathbb{N}^{r}$ let us denote by
$r(z)$ the representations of $z$ from $X$, i.e.
$r(z)\mathrel{\mathop{\mathchar
58\relax}}=r_{X}(z)=\\{(\varepsilon=\\{\varepsilon_{i}\\}_{i=1}^{\infty})\mathrel{\mathop{\mathchar
58\relax}}z=\sum_{i=1}^{\infty}\varepsilon_{i}x_{i},\ x_{i}\in X,\
\sum_{i=1}^{\infty}\varepsilon_{i}<\infty\\}$. Note that in this form it is
allowed to use an element of $X$ more than once. So just because $r_{X}(z)$ is
non-empty, it does not mean that $z\in FS(X)$.

We are going to look at shortest representations of $n\in\mathbb{N}$ for
different sets. For this we will use the notation
$rank_{Y}(p)\mathrel{\mathop{\mathchar 58\relax}}=\min_{\varepsilon\in
r_{Y}(p)}(\sum_{i}\varepsilon_{i})$, i.e. the length of the shortest
representation of $p$ from the set Y. If the set Y is obvious from the
context, then we leave the Y from the index and simply write $rank(p)$. Denote
by $mult_{Y}(p,\varepsilon)$ the maximal multiplicity of an element in the
representation $\varepsilon$ from $r_{Y}(p)$. For example if
$p=a_{1}+a_{2}+a_{2}+a_{3}+a_{3}+a_{3}$
($\varepsilon_{1}=1,\varepsilon_{2}=2,\varepsilon_{3}=3$) then
$mult_{A}(p,\varepsilon)=3$ (sometimes we will leave the $A$ from the index,
just like in the case of the rank). A sequence $A$ is said to be regular if
all numbers $n$ have a shortest representation which has multiplicity equal to
1. Formally for all $n\in N$ when we assume that $rank_{A}(n)=k$ then $\
min_{\varepsilon\in r^{k}_{A}(n)}(mult_{A}(n,\varepsilon))=1$, where
$r^{k}_{A}(n)=\\{(\varepsilon\in r_{A}(n)|\sum_{i}\varepsilon_{i}=k\\}$.

Denote $[n]\mathrel{\mathop{\mathchar 58\relax}}=\\{1,2,\dots n\\}$ and let
$B_{r}(N)$ be the set
$B_{r}(N)=\\{(x_{1},x_{2},\dots,x_{r})\in\mathbb{N}^{r}\mathrel{\mathop{\mathchar
58\relax}}\ 1\leq x_{i}\leq N;\ i=1,2,\dots,r\\}$. When $r=2$ we write shortly
$B(N)$.

In the next Lemma we will show that sequences which fulfill conditions (i) and
(ii) are complete.

######  Lemma 1.1.

Let $Y\subseteq\mathbb{N}$ and assume that $1\in Y$ and
$Y\setminus\\{1\\}\subseteq Y+Y$. Then $Y$ is complete. Moreover if
$Y=\\{1=y_{1}<y_{2}<\dots\\}$ then for every $i=1,2,\dots$ we have $y_{i}\leq
2^{i-1}$.

###### Proof of Lemma 1.1.

Write $Y=\\{1=y_{1}<y_{2}<\dots<y_{n}<\dots\\}$. Since $Y\subseteq Y+Y$ we
have that $1,2\in FS(Y)$ and for every $n>1$, $y_{n}=y_{i}+y_{j}$. Clearly
$i,j\leq n-1$, so we have that $y_{n}=y_{i}+y_{j}\leq 2y_{n-1}$.

From this point the proof is well-known; for the sake of completeness we
include the rest of the argument. We claim that for every $k\in\mathbb{N}$:
$[2a_{k}-1]\subseteq FS(Y)$, and each element of $[2a_{k}-1]$ is in the form
$\\{\sum\limits_{i=1}^{k}\varepsilon_{i}a_{i}\mid\varepsilon\in\\{0,1\\}\\}$ .
It is true for $k=1$ and assume it is true for $k\geq 2$. Since $a_{k+1}\leq
2a_{k}$, hence all positive integers are in $FS(Y)$ up to
$a_{k+1}+(2a_{k}-1)\geq 2a_{k+1}-1$. So obviously $[2a_{k+1}-1]\subseteq
FS(Y)$.

∎

Note that many ’classical’ sequences which fulfill conditions above (e.g. the
sequence of two powers, the Fibonacci sequence) are also regular.

######  Lemma 1.2.

The sequences of two powers and the Fibonacci numbers ($F_{1}=1,\
F_{2}=2,\dots$) are regular and fulfills conditions (i)-(iii).

###### Proof.

That the sequences of two powers and the Fibonacci numbers fulfills conditions
(i)-(iii) is clear.

The regularity assumption for the shortest representation obviously holds for
$\\{2^{k}\\}_{k=0}^{\infty}$, since the unique one is such a representation.

We show that it also holds for the Fibonacci numbers. Assume, that a shortest
representation of $n=\sum_{k=1}^{n}F_{i_{k}}$ contains $F_{i_{s}}$ twice. If
$F_{i_{s}}=1$ then by replacing $2F_{i_{s}}$ with $F_{2}=2$ we get a shorter
representation which is not possible. If $F_{i_{s}}=2$, then we replace
$2F_{i_{s}}$ with $F_{1}+F_{3}$. Otherwise we have that
$F_{i_{s}}+F_{i_{s}}=F_{i_{s}-2}+F_{i_{s}+1}$. We continue this process
(replacing duplications the way described above), until there is no
duplication. Since we can only have one $F_{1}$ in the current representation
at any time (otherwise we could get a shorter one) the case when $F_{2}$ is
duplicated will occur at most once. So with at most one exception the sum of
the indexes decreases by one at every step of the process. So eventually it
will stop and in the end we always acquire a representation with
$mult_{A}(\varepsilon,n)=1$ which is not longer than the one we started with.
∎

######  Remark.

Let us note that there are sequences which ensure conditions $(i)-(ii)$ but
they are not regular.

Let $A=\\{1,2,3,5,6,12,\dots\\}$. This sequence fulfils conditions $(i)$ and
$(ii)$. Here $10=2+3+5\in FS(A)$ (an it is the shortest representation with
multiplicity=1), but $10=5+5$ is another (shorter) representation.

Now we turn onto the communication problem. In the next theorem we will use
number-in-hand multiparty communication model, i.e. there are $k$ players
$P_{1},P_{2},\dots P_{k}$ and a $k$-argument functions
$F\mathrel{\mathop{\mathchar 58\relax}}(\\{0,1\\}^{n})^{k}\mapsto\\{0,1\\}$.
For every $i\in[k]$ $P_{i}$ gets an $n$-bit input. In the communication
process we will use blackboard model where every message sent by a player is
written down on a blackboard which is visible for all players.

The communication complexity of this model, denoted by $CC^{(k)}(F)$, is the
least number of bits needed to be communicated to compute $F$ correctly.

Assume that we have $k$ players and we assign a regular sequence $A_{i}$ to
each of them. For a given point
$p=(p_{1},p_{2},\dots,p_{k})\in\mathbb{N}^{k};\ p_{i}\leq N;\
(i=1,2,\dots,k)$, the $i^{th}$ players knows (just) $p_{i}$ and his previously
given set $A_{i}$. Let $X\mathrel{\mathop{\mathchar
58\relax}}=A_{1}\times\dots\times A_{k}$. With minimal communications they
have to decide whether $p\in FS(X)$ or not. Denote by $F$ the function which
describes this.

We will prove in Section 2 that:

######  Theorem 1.3.

Let $X=A_{1}\times A_{2}\times\dots\times A_{k}\subseteq\mathbb{N}^{k}$, where
for every $i=1,2,\dots k$ $A_{i}$ is regular and $(i)$, $(ii)$ and $(iii)$
hold. Then

$CC^{(k)}(F)<k\log_{2}\Big{(}\frac{\log_{2}N}{\log_{2}\varrho}\Big{)}+k.$

In the rest of the paper we will investigate additive structure of special $X$
sets. The next proposition we show that except a region with zero density all
lattice points are in $FS(\\{2^{m}\\}\times\\{2^{k}\\})_{m,k\in\mathbb{N}}$.
We say that $E\mathrel{\mathop{\mathchar
58\relax}}=\\{(a,b)\in\mathbb{N}^{2}\mathrel{\mathop{\mathchar 58\relax}}\
b\leq\log_{2}a\\}\cup\\{(a,b)\in\mathbb{N}^{2}\mathrel{\mathop{\mathchar
58\relax}}\ a\leq\log_{2}b\\}$ is the exceptional set. We prove the following
two propositions in Section 3:

######  Proposition 1.4.

Let $X=\\{2^{m}\\}\times\\{2^{k}\\}_{m,k\in\mathbb{N}}$ and let $E$ be the
exceptional set. Then

1\. $(\mathbb{N}^{2}\setminus E)\subseteq FS(X)$.

Furthermore

2\. For every $D\in\mathbb{N}$ there exists a square
$S_{D}\mathrel{\mathop{\mathchar
58\relax}}=\\{(s_{1},s_{2})\mathrel{\mathop{\mathchar 58\relax}}\ x_{0}\leq
s_{1}\leq x_{0}+D;y_{0}\leq s_{2}\leq x_{0}+D\ \\}\subseteq E$ (for some
$x_{0},y_{0}\in\mathbb{N}$) such that $FS(X)\cap S_{D}=\emptyset$.

Nevertheless the set $E$ is not ”empty”. It contains ”many” lattice points
from $FS(X)$:

######  Proposition 1.5.

For every $M\in\mathbb{N}$ there exists a square
$S_{M}\mathrel{\mathop{\mathchar
58\relax}}=\\{(t_{1},t_{2})\mathrel{\mathop{\mathchar 58\relax}}\ z_{0}\leq
t_{1}\leq z_{0}+M;w_{0}\leq t_{2}\leq w_{0}+M\ \\}\subseteq E$ (for some
$z_{0},w_{0}\in\mathbb{N}$) such that

$|FS(X)\cap S_{M}|\geq\frac{1}{4}M\log_{2}M.$

##  2\. Proof of Theorem 1.3

First we prove this simple but crucial lemma:

######  Lemma 2.1.

Assume that $A_{1},A_{2}\subseteq\mathbb{N}$ are complete and regular
sequences, and assume that $(p_{1},p_{2})\in FS(A_{1})\times FS(A_{2})$ for
some positive integers $p_{1}\geq p_{2}$. Then $(p_{1},p_{2})\in
FS(A_{1}\times A_{2})$ if and only if $p_{2}\geq rank(p_{1})$ and $p_{1}\geq
rank(p_{2})$.

###### Proof of Lemma 2.1.

First note that one of $p_{2}\geq rank(p_{1})$ and $p_{1}\geq rank(p_{2})$ is
always satfified, because, for example, if $rank(p_{1})\geq rank(p_{2})$ then
$p_{1}\geq rank(p_{1})\geq rank(p_{2})$. So from now on, without the loss of
generality, we assume $rank(p_{1})\geq rank(p_{2})$.

($\Leftarrow$): Let the representation of $p_{1}$ in $FS(A_{1})$ and $p_{2}$
in $FS(A_{2})$ be $p_{1}=x_{t_{1}}+x_{t_{2}}+\dots+x_{t_{r}}$ and
$p_{2}=y_{i_{1}}+y_{i_{2}}+\dots+y_{i_{k}}$ respectively. Since every
$y_{i_{j}}\in A_{2}\setminus\\{1\\}\subseteq A_{2}+A_{2}$, we can split
$y_{i_{j}}$ to the sum of two earlier element. Going on this process step by
step we increase the number of terms by 1. This process can be continued until
all terms in the sum are 1. Since $p_{2}\geq rank(p_{1})$, there will be a
step, where the number of (multi)terms is equal to $rank(p_{1})$, i.e.
$p_{2}=y_{j_{1}}+y_{j_{2}}+\dots+y_{j_{s}}$, $y_{j_{1}}\leq
y_{j_{2}}\leq\dots\leq y_{j_{s}}$ and where $s=rank(p_{1})$. Now the points
$(x_{t_{i}},y_{j_{i}})$, $1\leq i\leq s$ are pairwise different, hence

$(p_{1},p_{2})=\sum_{i=1}^{s}(x_{t_{i}},y_{j_{i}})\in FS(A_{1}\times A_{2})$

as we stated.

($\Rightarrow$) Assume that $p_{2}<rank(p_{1})$. We know that every
representation of $p_{2}$ is not longer than $p_{2}$ and every representation
of $p_{1}$ is not shorter than $rank(p_{1})$. This means, that there are no
representations of $p_{1}$ and $p_{2}$, where the elemenst of the two sums
could be paired. Thus $(p_{1},p_{2})\notin FS(A_{1}\times A_{2})$.

∎

The protocol and the Calculation of $CC^{(k)}(F)$:

###### Proof of Theorem 1.3..

The point $p=(p_{1},p_{2},\dots,p_{k})\in\mathbb{N}^{k};\ p_{i}\leq N;\
(i=1,2,\dots,k)$ is given. Recall that $P_{i}$ knows only $p_{i}$. Now $P_{i}$
can write $p_{i}$ in a shortest representation from $A_{i}$ as
$p_{i}=a_{i_{1}}+a_{i_{2}}+\dots+a_{i_{t_{i}}}\in FS(A_{i})$. Recall that
since all $A_{1},A_{2},\dots,A_{k}$ are regular hence they can do it in a way
that for every $i$ these representations have
$mult_{A_{i}}(p_{i},\varepsilon)=1$. Then $P_{i}$ sends $rank(p_{i})$ to the
list (to the blackboard).

All player $P_{i}$ rearranges the list $\\{rank(p_{i})\\}_{i=1}^{k}$, and
finds the maximal $\max_{i}rank(p_{i})$. Then player $P_{i}$ sends the bit $1$
if $p_{i}\geq\max_{i}rank(p_{i})$ and $0$ otherwise. Clearly if the blackboard
does not contain $0$ then the point $p=(p_{1},p_{2},\dots,p_{k})$ lies in
$FS(X)$ (the same argument can be applied as in the proof of Lemma 2.1.).

Now we have to show that otherwise $p$ is not representable.

Indeed, if there is a $0$ in the blackboard then there are two players $P_{i}$
and $P_{j}$ where the length of all representation of $p_{j}$ is longer than
$p_{i}$. By Lemma 2.1 taking the projection to the plane $i,j$ of our sets $X$
we get that the point $(p_{i},p_{j})$ is not representable.

Calculation of $CC^{(k)}(F)$: We give an upper bound to $CC^{(k)}(F)$. There
are $k$ players, so it is enough to bound length of individual message of any
player.

Represent $p_{j}$ as $p_{j}=a_{i_{1}}+a_{i_{2}}+\dots+a_{i_{t_{j}}}$. Now by
$(iii)$ $a_{i_{t_{j}}}\geq\varrho^{i_{t_{j}}}$ and since $a_{i_{t_{j}}}\leq
p_{j}\leq N$ we get $t_{j}\leq
i_{t_{j}}\leq\frac{\log_{2}N}{\log_{2}\varrho}$. So the binary length of the
message is at most $\log_{2}\Big{(}\frac{\log_{2}N}{\log_{2}\varrho}\Big{)}$.
Finally the total number of bits is at most

$k\log_{2}\Big{(}\frac{\log_{2}N}{\log_{2}\varrho}\Big{)}+k.$

∎

##  3\. On the additive structure of
$FS(\\{2^{m}\\}\times\\{2^{k}\\})_{m,k\in\mathbb{N}}$

We devote this section to prove Proposition 1.4. and Proposition 1.5.

###### Proof of Proposition 1.4.

1\. Since the set $X$ is reflected to the line $y=x$ so we will show that all
$(a,b)\in\mathbb{N}^{2}\setminus E$, $b\leq a$ lies in $FS(X)$. Denote by
$s(a)$ and $s(b)$ the number of terms in the dyadic expansion of $a$ and $b$
respectively. If $s(b)>s(a)$ then $s(b)<b\leq a$ and by Lemma 2.1 we are done.

Assume that $s(b)<s(a)$. Clearly $s(a)\leq\log_{2}a\leq b$, so we can use
Lemma 2.1 again to finish the proof.

2\. First let us note that the shortest binary representation (including
repetition as well) is the unique one (indeed if there are two equal terms,
say $2^{i}-2^{i}$ then one can replace it by $2^{i+1}$ shortening the number
of terms).

Let $D\in\mathbb{N}$ and for the square $S_{D}$ we define first the bottom-
left corner $(x_{0},y_{0})$ of $S_{D}$. Let $y_{0}\mathrel{\mathop{\mathchar
58\relax}}=1$ and $x_{0}\mathrel{\mathop{\mathchar
58\relax}}=\sum_{i=D+1}^{2D}2^{i}$. Now by Lemma 2.1 we have that
$(x_{0}+k,j)\notin FS(X)$ for every $1\leq k,j\leq D$ (because
$rank(x_{0}+k)>D\geq j$), as we stated. ∎

###### Proof of Proposition 1.5.

Let us choose $R$ such that $2^{R}\leq M<2^{R+1}$ holds. We simply define the
square to be:

$S_{M}\mathrel{\mathop{\mathchar
58\relax}}=\\{(t_{1},t_{2})\in\mathbb{N}^{2}\mathrel{\mathop{\mathchar
58\relax}}\ 2^{2^{R+1}}\leq t_{1}\leq 2^{2^{R+1}}+M;0\leq t_{2}\leq M\\}$

It is easy to see that $S_{M}\subset E$. We will only deal with the following
subrectangle of $S_{M}$, because it will have still ”enough” elements from
$FS(X)$:

$S_{2^{R}-1,2^{R}}\mathrel{\mathop{\mathchar
58\relax}}=\\{(t_{1},t_{2})\in\mathbb{N}^{2}\mathrel{\mathop{\mathchar
58\relax}}\ 2^{2^{R+1}}\leq t_{1}\leq 2^{2^{R+1}}+2^{R}-1;0\leq t_{2}\leq
2^{R}\\}$

Take any element from $FS(X)$ which is a sum of horizontal elements, i.e.
$(n,m)=(2^{i_{1}},2^{f})+(2^{i_{2}},2^{f})+\dots+(2^{i_{k}},2^{f})$, here
$k=s(n)$ and denote this set by $Z$, more formally
$Z\mathrel{\mathop{\mathchar
58\relax}}=\\{(n,s(n)2^{f})\mathrel{\mathop{\mathchar
58\relax}}f\in\mathbb{N}\\}$. We will show that $Z\cap S_{2^{R}-1,2^{R}}$
still has a lot of elements. By the choice of $S_{2^{R}-1}$ we have that for
every element $(n,m)\in S_{2^{R}-1,2^{R}}$: $s(n)\in\\{1,\dots R+1\\}$,
moreover, we have that for a fixed $k\in\\{1,\dots R+1\\}$:

$\mid\\{n\mathrel{\mathop{\mathchar 58\relax}}2^{2^{R+1}}\leq n\leq
2^{2^{R+1}}+2^{R}-1\text{ and }s(n)=k\\}\mid=\binom{R}{k-1}.$

So if we return to the set $Z$, to ensure that an $(n,m)=(n,s(n)2^{f})\in Z$
is in $S_{2^{R}-1,2^{R}}$ we need that $s(n)2^{f}\leq 2^{R}$. So $f$ should be
the element of the following set: $\\{0,1,\dots,\lfloor
R-\log_{2}s(n)\rfloor\\}$. Hence we get that the number of intersections
between the sets $Z$ and $S_{2^{R}-1,2^{R}}$ is at least:

$\sum\limits_{k=1}^{R+1}\binom{R}{k-1}(\lfloor
R-\log_{2}k\rfloor+1)\geq\sum\limits_{k=0}^{R}\binom{R}{k}(R-\log_{2}(k+1))$

Now if we use that $\frac{R}{2}\geq\log_{2}(R+1)$, if $R\geq 6$, we can
continue the estimation:

$\sum\limits_{k=0}^{R}\binom{R}{k}(R-\log_{2}(R+1))\geq\sum\limits_{k=0}^{R}\binom{R}{k}\frac{R}{2}=2^{R}\frac{2R}{4}\geq\frac{M}{2}\frac{\log_{2}M}{2}.$

∎

##  4\. On non-regular case

Let $X=A_{1}\times A_{2}\subseteq\mathbb{N}^{2}$. As we have seen there are
sequences, where the rank of an element of $FS(A_{i})$ ($i=1,2$) is not the
length of the shortest representation. It is not obvious that which conditions
ensure that a given point $(p_{1},p_{2})$ is an element of $FS(X)$ or not.
Clearly it is necessary to have (multi)partitions of
$p_{1}=y_{t_{1}}+y_{t_{2}}+\dots+y_{t_{r}}$ and
$p_{2}=y_{i_{1}}+y_{i_{2}}+\dots+y_{i_{k}}$ for which $r=k$. But it is not
sufficient.

Let $A_{1}=A_{2}=\\{1,2,3,6,12,13,26,52,\dots,2^{t}13,\dots\\}$ and consider
$(3,50)\in\mathbb{N}^{2}$. We have $3=1+1+1=1+2$ furthermore $50=26+12+12$,
and it is easy to check that the number of terms in any other representation
of $50$ is at least four, i.e. there is no pairwise different matching of the
elements although there is a representation where the number of terms are the
same. So $(3,50)\not\in FS(X)$.

Nevertheless if $X=A_{1}\times A_{2}$, where $A_{1}$ and $A_{2}$ fulfill
conditions $(i),(ii)$ and $(iii)$, we will show an additional condition which
is enough.

######  Proposition 4.1.

Let $A_{1}$ and $A_{2}$ fulfill conditions $(i),(ii)$ and $(iii)$ and let
$X=A_{1}\times A_{2}$. Let $p_{1},p_{2}\in\mathbb{N}$ with
$rank_{A_{1}}(p_{1})=rank(p_{1})$ and $rank_{A_{2}}(p_{2})=rank(p_{2})$ (for
simplicity), and let $\varepsilon_{1}$ and $\varepsilon_{2}$ be shortest
representations of $p_{1}$ and $p_{2}$. Let $K\mathrel{\mathop{\mathchar
58\relax}}=\max\\{mult(p_{1},\varepsilon_{1}),mult(p_{2},\varepsilon_{2}),|rank(p_{1})-rank(p_{2})|\\}$
and $L\mathrel{\mathop{\mathchar
58\relax}}=\min\\{rank(p_{1}),rank(p_{2})\\}$. If there are $\varepsilon_{1}$
and $\varepsilon_{2}$ for $p_{1}$ and $p_{2}$ such that, $K\leq\sqrt{L}/2$,
then $(p_{1},p_{2})\in FS(X)$.

###### Proof.

We start the proof with an important lemma which gives a sufficiently
condition for the pairwise different matching of the co-ordinates:

######  Lemma 4.2 ([1, Proposition 1]).

Let $X_{1},\dots,X_{s}$ be disjoint finite sets and $Y_{1},\dots,Y_{t}$ be
disjoint finite sets too. Let

$U=\bigcup_{i=1}^{s}X_{i},\quad V=\bigcup_{j=1}^{t}Y_{j},$

with $|U|=|V|$ and suppose that $1\leq|X_{i}|\leq\sqrt{|U|}$ for $i=1,2,\dots
s$ and $1\leq|Y_{j}|\leq\sqrt{|V|}$ for $j=1,2,\dots t$. Then there exists a
bipartite graph $G(X,Y)$ fulfilling the following conditions:

  * (a)

there are no two edges $(x_{1},y_{1});(x_{2},y_{2})$ for which $x_{1},x_{2}\in
X_{i};\ y_{1},y_{2}\in Y_{j}$ for some $i$ and $j$;

  * (b)

$G(X,Y)$ is a matching.

We have $mult(p_{i},\varepsilon_{i})\leq K$ and
$K\leq\frac{\sqrt{rank(p_{i})}}{2}$ (for $i=1,2$), because of the definitions
of $K$ and $L$. Hence the number of distinct terms in the shortest
representations are at least $2\sqrt{rank(p_{i})}$, $i=1,2$. Assume now
w.l.o.g. that

(2) $0\leq rank(p_{1})-rank(p_{2})\leq K\leq\frac{\sqrt{rank(p_{2})}}{2}.$

Hence by the splitting process (used previously in Lemma 2.1. and Theorem
1.3.) there is a (multi)partitions of $p_{2}$ in the form
$p_{2}=n_{1}y^{\prime}_{1}+n_{2}y^{\prime}_{2}+\dots n_{r}y^{\prime}_{r}$ with
$\sum_{j}n_{j}=rank(p_{1})$. By (2) this process exists, furthermore the
maximal number of repetition of element in the representation of $p_{2}$ is at
most $\sqrt{rank(p_{2})}$.

Now in the representation of
$p_{1}=k_{1}x_{1}+\dots+k_{i}x_{i}+\dots+k_{t}x_{t}$ identify $k_{i}x_{i}$ to
a set $X_{i}$ with cardinality $k_{i}$ ($i=1,2,\dots,t$) and in the
representation
$p_{2}=n_{1}y^{\prime}_{1}+n_{2}y^{\prime}_{2}+\dots+n_{r}y^{\prime}_{r}$
identify $n_{j}y^{\prime}_{j}$ to a set $Y_{j}$ with cardinality $n_{j}$
($j=1,2,\dots,r$).

Finally let us use Lemma 4.2 which ensures that
$(p_{1},p_{2})=\sum_{j=1}^{rank(p_{1})}(x_{s_{j}},y^{\prime}_{t_{j}})$, where
the $(x_{s_{j}},y^{\prime}_{t_{j}})$ pairs form a pairing according to the
lemma. So $(p_{1},p_{2})\in FS(A_{1}\times A_{2})$.

∎

##  5\. Concluding remarks

Recall that the general knapsack problem is known to be NP-complete and sounds
as follows: for a given sequence
$A=\\{a_{1},a_{2},\dots,a_{n}\\}\subset\mathbb{N}$ decide that the equation
$s=\sum_{i=1}^{n}\varepsilon_{i}a_{i};\ \varepsilon_{i}\in\\{0,1\\}$,
$i=1,2,\dots,n$ is solvable or not in
$\varepsilon_{1},\varepsilon_{2},\dots,\varepsilon_{n}$.

The density of a knapsack problem is defined as: $d\mathrel{\mathop{\mathchar
58\relax}}=\frac{n}{\log_{2}(\max a_{i})}$. When $d<1$ then there is a
possible encryption process. When $d>1$ there is no an effective approach to
attack the knapsack problem. The main tool is the so called basis reduction
method.

Now we will show a way to reduce this problem, decide whether a given point
$(p_{1},p_{2})$ is an element of $FS(A_{1}\times A_{2})$ or not, to a
classical knapsack problem.

Let $(p_{1},p_{2})\in\mathbb{N}^{2}$ and assume that $1\leq p_{1},p_{2}\leq
M$. Let $B_{1}\mathrel{\mathop{\mathchar 58\relax}}=\\{x_{1}<x_{2}<\dots
x_{k}\\}\subset A_{1}$ and $B_{2}\mathrel{\mathop{\mathchar
58\relax}}=\\{y_{1}<y_{2}<\dots y_{m}\\}\subset A_{m}$, where
$k=\max\\{T\mathrel{\mathop{\mathchar 58\relax}}x_{1}+x_{2}+\dots+x_{T}\leq
M\\}$ and $m=\max\\{R\mathrel{\mathop{\mathchar
58\relax}}y_{1}+y_{2}+\dots+y_{R}\leq M\\}$.

Let now $Z\mathrel{\mathop{\mathchar
58\relax}}=\\{z=Mx_{i}+y_{j}\mathrel{\mathop{\mathchar 58\relax}}1\leq i\leq
k;\ 1\leq j\leq m\\}\subset\mathbb{N}$. Observe that $(p_{1},p_{2})\in
FS(A_{1}\times A_{2})$ if and only if $Mp_{1}+p_{2}\in FS(Z))$.

Acknowledgement. The second named author is supported by grant K-129335. The
first and third named authors are supported by the European Union, co-ﬁnanced
by the European Social Fund (EFOP-3.6.3-VEKOP-16-2017-00002).

## References

  * [1] Chen, YG ; Fang, JH ; Hegyvári, N Erdős-Birch type question in $\mathbb{N}^{r}$ J. of Number Theory 187 pp. 233-249. , 17 p. (2018)
  * [2] Hegyvári, N. Complete sequences in $\mathbb{N}^{2}$ European Journal of Combinatorics (17) (1996) 741-749.
  * [3] Hegyvári, N Subset sums in $\mathbb{N}^{2}$ Combinatorics Probability and Computing (5) (1996) 393-402.
  * [4] Hennecart, F. On the restricted order of asymptotic bases of order two. (2005) Ramanujan J. 9 123–130.
  * [5] N.B. Nathanson, Additive Number Theory Springer-Verlag New York 1996
  * [6] A. Plagne, On threshold properties of k-SAT: An additive viewpoint, European Journal of Combinatorics 27 (2006) 1186-1198
  * [7] A. Rao, A. Yehudayoff, Communication Complexity, available at https://homes.cs.washington.edu/ anuprao/pubs/book.pdf
  * [8] A. Samorodnitsky, L. Trevisan, Gowers Uniformity, Influence of Variables, and PCPs, STOC’06., arXiv:math/0510264v1 [math.CO]
  * [9] L. Trevisan, Earliest Connections of Additive Combinatorics and Computer Science, available in https://lucatrevisan.wordpress.com/2009/04/17/earliest-connections-of-additive-combinatorics-and-computer-science/


# Resolving Legalese: A Multilingual Exploration of Negation Scope Resolution
in Legal Documents

Ramona Christen1∗ Anastassia Shaitarova2 Matthias Stürmer1,3 Joel
Niklaus1,3,4∗

1University of Bern 2University of Zurich
3Bern University of Applied Sciences 4Stanford University

###### Abstract

Resolving the scope of a negation within a sentence is a challenging NLP task.
The complexity of legal texts and the lack of annotated in-domain negation
corpora pose challenges for state-of-the-art (SotA) models when performing
negation scope resolution on multilingual legal data. Our experiments
demonstrate that models pre-trained without legal data underperform in the
task of negation scope resolution. Our experiments, using language models
exclusively fine-tuned on domains like literary texts and medical data, yield
inferior results compared to the outcomes documented in prior cross-domain
experiments. We release a new set of annotated court decisions in German,
French, and Italian and use it to improve negation scope resolution in both
zero-shot and multilingual settings. We achieve token-level F1-scores of up to
86.7% in our zero-shot cross-lingual experiments, where the models are trained
on two languages of our legal datasets and evaluated on the third. Our
multilingual experiments, where the models were trained on all available
negation data and evaluated on our legal datasets, resulted in F1-scores of up
to 91.1%.

Keywords: Negation Scope Resolution, Legal Data, Multilingual, Transformers

languageresource

BERT

    Bidirectional Encoder Representation from Transformers
MLM

    Masked Language Modeling
NSP

    Next Sentence Prediction
LM

    language model
SotA

    state-of-the-art
FSCS

    Federal Supreme Court of Switzerland

Resolving Legalese: A Multilingual Exploration of Negation Scope Resolution in
Legal Documents

Ramona
Christen1∗$,AnastassiaShaitarova$^2$,MatthiasStürmer$^1,3$,JoelNiklaus$^1,3,4*
---
1University of Bern, 2University of Zurich, 3Bern University of Applied
Sciences, 4Stanford University
<EMAIL_ADDRESS><EMAIL_ADDRESS>{joel.niklaus,
<EMAIL_ADDRESS>

Abstract content

## 1\. Introduction

Negation scope resolution is an important research problem in the field of
Natural Language Processing (NLP). It describes the detection of words that
are affected by a negation cue (e.g. no or not) in a sentence, which is
important for understanding its true meaning. Although this task is far from
trivial, deep learning approaches have shown promising results
(khandelwal_negbert_2020; shaitarova_cross-lingual_2020;
shaitarova_negation_2021).

Figure 1: Results over main experiments from select models. For all results
see Appendix B.

As with many NLP tasks, the largest amount of annotated data is available in
English.111Mie2016Language analyzed all ACL conference proceedings from 2004,
2008, 2012, and 2016 and found that between 58% and 69% of papers only
evaluated in English. Multilingual datasets are less common and often not
easily accessible. For example, on the huggingface hub, hosting most important
open-source datasets, 4559 datasets are tagged as English. The next most
common language is Chinese with 10 times fewer datasets for a total of
469.222Numbers extracted from https://huggingface.co/ datasets on 13.08.2023.
In addition, much of the work conducted in the area of negation scope
resolution has been done in the medical domain in order to automatically
process clinical reports and discharge summaries szarvas2008bioscope. Other
datasets consist of literary texts morante2012sherlock or more informal data
such as online reviews konstantinova2012sfu. The legal domain differs from all
of the above in that it is often very complex (i.e., legalese) and uses highly
specific vocabulary and knowledge that is not common outside the legal domain
friedrich2021complexitylaw; ruhl2017complexitylaw2. This poses a challenge to
any model tackling tasks in the legal domain. While a large amount of legal
data is publicly available and has been annotated for various tasks
multieurlexLegaldata; rasiah_scale_2023; niklaus_swiss-judgment-
prediction_2021; niklaus_lextreme_2023; brugger_multilegalsbd_2023;
niklaus_multilegalpile_2023; chalkidis_lexglue_2022, _inter alia_ , to the
best of our knowledge there exists no legal negation corpus.

We annotate four new datasets containing legal judgments from Swiss and German
courts in German, French and Italian for negation cues and scopes. We find
that these legal documents contain on average longer sentences as well as
longer annotated negation scopes, compared to existing datasets. Our
experiments show that the legal domain poses a significant challenge to models
attempting negation scope resolution. The results achieved by models pre-
trained in different domains and evaluated on legal data are lower than those
seen in other cross-corpus experiments (khandelwal_negbert_2020;
shaitarova_negation_2021). Using our newly annotated datasets, we can improve
these results. We conduct experiments where the models are fine-tuned on two
languages of the legal data and evaluated on the third. In these zero-shot
cross-lingual experiments, our models achieve higher F1-scores than the models
pre-trained only on different domains. By training on all available data, we
are able to further improve these results, achieving F1-scores around 90% for
our multilingual experiments. Our results provide an interesting insight into
how even smaller datasets can make a valuable contribution to improving the
performance of language models on a specific downstream task such as negation
scope resolution.

### Contributions

The contributions of this paper are three-fold:

  * •

We annotate new datasets of legal documents for negation in German, French,
and Italian each containing around 1000 sentences.

  * •

We train and evaluate models on the task of negation scope resolution on the
newly annotated datasets to provide a reference point and achieve token-level
F1-scores in the mid eighties for cross-lingual zero-shot experiments and up
to 91% in multilingual experiments.

  * •

We publicly release the annotation guidelines, the data, the models and the
experimentation code as resources and for reproducibility.333The annotation
guidelines as well as the code to fine-tune our models can be found on GitHub:
https://github.com/RamonaChristen/Multilingual_Negation_
Scope_Resolution_on_Legal_Data. Our best model
(https://huggingface.co/rcds/neg-xlm-roberta-base) and dataset
(https://huggingface.co/rcds/MulitLegalNeg) are published on huggingface.

## 2\. Related Work

Different approaches have been used to address the issue of negation detection
and negation scope resolution. Early research focused mainly on rule-based
approaches. NegEx, a simple regular expression algorithm developed by
chapman2001, was successfully able to identify negations in the medical
domain. morante2008 first took a machine learning approach to negation scope
resolution. They used two memory-based classifiers, one to identify the
negation cue in a sentence, and one to identify the scope of the negation. On
the negation scope resolution task, they achieved an F1-score of 81% on the
BioScope corpus szarvas2008bioscope. These results were later surpassed by
fancellu2017neural, achieving an F1-score of 92% by using neural networks for
scope detection. khandelwal_negbert_2020 achieved the best results on the
BioScope corpus, as well as on two other publicly available negation corpora,
the SFU Review Corpus konstantinova2012sfu and the ConanDoyle-neg corpus
morante2012sherlock. Their NegBERT model uses Bidirectional Encoder
Representation from Transformers (BERT) devlin2018bert and applies a transfer
learning approach for negation detection and scope resolution.

Only a limited amount of work has been conducted on negation scope resolution
across different languages. fancellu2018multilingual developed a cross-lingual
system, trained on English data and tested on a Chinese corpus. By employing
cross-lingual universal dependencies in English they were able to achieve an
F1-score of 72% on the Chinese data. shaitarova_cross-lingual_2020
investigated cross-lingual zero-shot negation scope resolution between
English, Spanish, and French. They built on NegBERT but used the multilingual
BERT (mBERT) model. shaitarova_negation_2021 built on this using NegBERT with
mBERT and XLM-RLarge conneau_unsupervised_2020, and were able to achieve a
token-level F1-score of 87% on zero-shot transfer from Spanish to Russian.

The sparse amount of cross-lingual research can be explained by the lack of
annotated data in languages other than English. There are few corpora
annotated with negations in German and Italian jimenez2020corpora. The only
German corpus annotated for negation and speculation contains medical data and
clinical notes cotikGermanCorpus. However, the corpus is not publicly
available and no annotation guidelines have been published. For Italian,
altunaItalian presented a framework for the annotation of negations and
applied it to a corpus of news articles and tweets, parts of which are
publicly available. In French, dallouxFrench annotated a medical corpus,
available on request. To our knowledge, no legal corpus annotated with
negations currently exists.

## 3\. Data

### 3.1. Legal Data

We use court decisions in our legal datasets, also often referred to as
judgments. The judgments form German courts were collected from _Bayern.Recht_
444https://www.gesetze-bayern.de/ and include a variety of legal domains and
structures (gerDataset). The Swiss court decisions in French, Italian, and
German (CH) were collected from the Federal Supreme Court of Switzerland
(FSCS). The FSCS is the highest legal authority in Switzerland and oversees
federal criminal, administrative, patent, and cantonal courts.

Judgments published by the FSCS usually consist of four sections: 1) The
introduction gives information about the date, chamber, involved judge(s) and
parties, and the topic of the court decision. 2) The facts outline the
important case information. 3) The considerations form the basis for the final
ruling by providing relevant case law and other cited rulings. 4) The rulings
gives the final decision made by the court.

### 3.2. Datasets

We annotated four new datasets in three languages for negation cues and
scopes, and standardized the existing French and English datasets to make them
more accessible. Our datasets consist of publicly available legal judgments
from Swiss and German courts. Since negation scope resolution is a sentence-
level task, we first split the data into sentences using sentence boundary
annotations. The French (fr) and Italian (it) datasets consist of a subset of
Swiss court decisions from the Swiss-Judgment-Prediction (SJP) dataset
(niklausJudgmentCorpus) and the Multi-Legal-Pile niklaus_multilegalpile_2023
which were annotated for sentence spans by brugger_multilegalsbd_2023. The
main German data (de (DE)) is a subset of judgments from German courts
collected by gerDataset. Only judgments were included in our dataset because
they include a variety of sources and legal areas, they also have a higher
density of negation cues compared to other legal texts. To validate that the
negation scope prediction also works on German court data from Switzerland, we
curated a small dataset of German-Swiss court decisions (de (CH)) that is also
a subset of the SJP corpus. We separated each dataset into a train (70%), test
(20%), and validation (10%) split.

To ensure that sufficient negation data is available in each dataset, a
negation score was assigned to each document based on a simple word search for
the most common negation words in each language. The documents with the
highest negation scores were then selected to be annotated. Table 1 shows the
amount of data and the distribution of negations for the newly created
datasets in comparison to the existing datasets in English and French. Our
datasets contain a slightly higher ratio of negated sentences compared to the
other datasets. This can be attributed to the nature of legal data and our
pre-selection procedure. Because we annotated only a subset of an existing
corpus we were able to exclude documents without or only few negations while
other corpora like ConanDoyle-neg and SFU annotated complete existing datasets
or stories.

| Dataset | Total | Negated | %neg
---|---|---|---|---
legal | fr | 1059 | 382 | 36.07
it | 1001 | 418 | 41.76
de (DE) | 1098 | 454 | 41.35
de (CH) | 208 | 112 | 53.85
external | SFU | 17672 | 3528 | 19.96
BioScope | 14700 | 2095 | 14.25
ConanDoyle-neg | 5714 | 1421 | 24.87
Dalloux | 11032 | 1817 | 16.47

Table 1: Total number of sentences, and number and percentage of sentences
containing at least one negation.

Annotations were done by native-language human annotators using the tool
Prodigy. All annotators are university students but not part of a legal study
program. The annotations were cross-checked by one annotator, who has a
linguistic background, with the help of an online translator to ensure that
they adhere to the annotation guidelines and are consistent across all three
languages. The annotation guidelines are based on existing guidelines for the
English datasets, and have been extended to cover all three languages included
in our data, as well as the characteristics of the legal domain. Key
guidelines are summarized below.

#### Negation Cues

Cues were not annotated as part of the negation scope following the annotation
guidelines for the ConanDoyle-neg corpus morante2011annotation. We excluded
affixal cues555Affixal cues are cues within a word such as impossible in our
annotations and kept all annotations to the word as the level of the minimal
syntactic unit.

#### Multiple negations

Annotators were instructed to annotate one negation per sentence. Sentences
with multiple negations were duplicated before annotation based on the most
common negation cues. To ensure that the same cue was not annotated twice,
duplicates were displayed next to each other in the annotation tool to allow
annotators to see which clues had yet to be annotated.

#### Maxiumum scope strategy

As with BioScope, we used a maximum scope strategy. This means that the scope
extends to the largest possible unit. If a negated clause has subordinate
clauses providing additional information to the clause, the scope extends over
the negated clause and all of its subordinate clauses, as illustrated in
example 1. This sentence structure is very common in our set of legal data. In
all following examples we mark the cue in bold and underline the scope. We
provide an English translation for clarity.

  1. 1

Vorliegend ginge es nicht darum, dass ein Arbeitgeber über Fristen oder
Pflichten nicht aufgeklärt habe, somit eine blosse Untätigkeit des
Arbeitgebers […]

  2. EN:

In the present case, it was not a matter of an employer not having provided
information about deadlines or obligations, thus a mere inactivity on the part
of the employer […].

#### Case citations

Our dataset contains two main types of citations: inline citations and
parenthesized citations. Inline citations, as in example 2 were annotated as
part of the scope, while parenthesized citations, as in example 3, were
excluded from the negation scope.

  1. 2

Da der Kläger kein ähnlicher leitender Angestellter i.S.d 14 Abs. 2Satz 2
KSchG ist […]

  2. EN:

Since the plaintiff is not a similar executive employee in the sense of 14
Abs. 2Satz 2 KSchG […]

  3. 3

Seit dem 06.02.2017 ist der Kläger im Handelsregister nicht mehr als
Geschäftsführer eingetragen (vgl. Auszug aus dem Handelsregister in Anlage K9,
Bl 75 ff. d.A).

  4. EN:

Since 06.02.2017 the plaintiff is no longer registered in the commercial
register as managing director (see extract from the commercial register in
annex K9, Bl 75 ff. d.A)

#### Punctuation

Punctuation marks, such as periods or exclamation points, were excluded from
the scope, unless the scope spans multiple clauses separated by commas.

Table 2 shows the average number of tokens in a sentence for all datasets, as
well as the average length of the annotated scopes as a ratio between
annotated and not annotated tokens. On average, the sentences in our legal
datasets are slightly longer than in other datasets. Furthermore, the mean
length of the annotated scopes in our data is higher than in all other
datasets. For de (DE), more than 50% of tokens were annotated as scope, which
is around twice as much as with the biomedical, literary, and review corpora.
This is due to the legal domain’s sentence structure and our annotation
guidelines, which include the subject in the scope. Additionally, nested
sentences with multiple subordinate clauses are common in our dataset. This,
combined with our maximum scope strategy, leads to longer scopes compared to
other datasets.

| Dataset | Sentence | Scope
---|---|---|---
legal | fr | 48.52 | 37.96%
it | 40.84 | 30.17%
de (DE) | 31.14 | 50.18%
de (CH) | 27.65 | 36.03%
external | SFU | 24.46 | 21.87%
BioScope | 28.49 | 25.91%
ConanDoyle-neg | 22.11 | 32.37%
Dalloux | 25.96 | 19.82%

Table 2: The average number of tokens per sentence. Scopes are shown as a
percentage of negated tokens.

## 4\. Experimental setup

We performed experiments to assess negation scope resolution model performance
on our multilingual legal data. We integrated the NegBERT architecture
khandelwal_negbert_2020, successful in this task on prior datasets, with
various pre-trained multilingual LMs outlined in Table 3. We ran each
experiment five times with different random seeds and report the mean token-
level F1-score averaged over random seeds, together with the standard
deviation. All experiments were conducted with the same hyperparameters for
all models, optimized with a search over learning rate (5e-7, 1e-6, 3e-6,
1e-5, 3e-5, 5e-5) and batch size (4, 8, 16, 32, 64, and 128). We optimized the
hyperparameters for mBERT and XLM-R and concluded that the best results can be
achieved with an initial learning rate of 1e-5 and a batch size of 16. To
avoid overfitting, we used early stopping with patience set to 8 as a
compromise between the patience of 6 used in the original NegBERT experiments
(khandelwal_negbert_2020) and 9 used in the multilingual experiments of
shaitarova_negation_2021. We extended the maximum input length to 252 tokens
for our data. Experiments ran on an NVIDIA A100 GPU via Google Colab, totaling
around 105 hours of training time.

Model | Source | InLen | Params | Vocab | NumTokens | Corpus | Langs
---|---|---|---|---|---|---|---
DistilmBERT | sanh_distilbert_2020 | 512 | 134M | 120K | n/a | Wikipedia | 104
mBERT | devlin2018bert | 512 | 177K | 120K | n/a | Wikipedia | 104
XLM-RBase/Large | conneau_unsupervised_2020 | 512 | 278M/560M | 250K | 6’291B | 2.5TB CC100 | 100
Glot500-m | glot500 | 512 | 395M | 401K | 94B | glot500-c | 511
Legal-Swiss-RBase/Large | rasiah_scale_2023 | 512 | 184M/435M | 128K | 262B/131B | CH Rulings/Legislation | 3
Legal-XLM-RBase/Large | niklaus_multilegalpile_2023 | 512 | 184M/435M | 128K | 262B/131B | CH Rulings/Legislation | 3

Table 3: Model stats. InLen: max input length during pre-training. Params:
total parameter count. NumTokens: Batch size $\times$ Steps $\times$ InLen

Firstly, we evaluated ChatGPT in zero- and few-shot experiments to interpret
the results of a non-fine-tuned model in the negation scope resolution task.
For all subsequent experiments, we used the NegBERT architecture. In the first
NegBERT experiment, models were fine-tuned on all existing French and English
datasets and evaluated on our new legal datasets, representing a Zero-shot
cross-domain transfer. For a second series of zero-shot experiments, we
attempted a Zero-shot cross-lingual transfer within our legal datasets. In
each cross-lingual experiment, models were trained on two dataset languages
and evaluated on the third. We also executed Multilingual experiments using
our datasets and all available data.

## 5\. Results

#### ChatGPT

We evaluated the performance of ChatGPT-3.5 brown_language_2020, one of the
leading LMs, in the task of negation scope resolution on our legal datasets.
Other researchers have found that ChatGPT performs well on simple annotation
tasks such as text classification gilardi2023chatgpt. To analyze ChatGPT’s
understanding of negation scopes, we conducted a small test over the chat
interface (See Appendix A) which showed that it was able to correctly identify
the negation scope of a simple German sentence. For the same request with an
example sentence from our legal dataset, ChatGPT was not able to accurately
identify the negation scope. To evaluate the performance on the whole dataset,
we used the ChatGPT API with ‘gpt-3.5-turbo-16k’ to accommodate longer inputs.
We set the temperature to 0 to reduce randomness and receive a coherent output
in json format. Similar to the experiments with the NegBERT architecture, we
gave the sentence as well as the negation cues as input and prompted ChatGPT
to return the sentence annotated for negation scopes. In a zero-shot
experiment, we did not give any annotated examples and only provided a short
definition of negation scopes. The results show that ChatGPT’s performance on
our datasets is subpar (Table 4). In an effort to increase the performance, we
conducted some few-shot experiments where 1, 5 or 10 examples of annotated
sentences were provided with the prompt, but it did not lead to improvement.
The results of the 1-shot experiments averaged lower than the 0-shot
experiments. Overall the standard deviation is very high which can be
explained by the fact that a random set of annotated examples was selected for
each of the five experiment runs. Overall we can conclude, that ChatGPT is
currently not suited to solve negation scope resolution in the legal domain
without fine-tuning.

Test Dataset | 0-shot | 1-shot | 5-shot | 10-shot |  Mean F1
---|---|---|---|---|---
by Dataset |  |  |  |  |
fr | $13.00_{\pm 2.1}$ | $16.63_{\pm 10.3}$ | $14.90_{\pm 7.5}$ | $22.53_{\pm 10.7}$ | $16.77_{\pm 8.5}$
it | $25.11_{\pm 1.5}$ | $18.22_{\pm 6.5}$ | $31.07_{\pm 7.1}$ | $26.10_{\pm 3.8}$ | $25.12_{\pm 6.7}$
de (DE) | $16.47_{\pm 2.6}$ | $22.45_{\pm 9.1}$ | $17.34_{\pm 2.7}$ | $24.48_{\pm 10.7}$ | $20.18_{\pm 7.5}$
de (CH) | $32.91_{\pm 7.9}$ | $21.20_{\pm 5.8}$ | $36.89_{\pm 18.6}$ | $19.83_{\pm 10.3}$ | $27.71_{\pm 13.1}$
Mean F1 by experiment | $21.87_{\pm 8.9}$ | $19.62_{\pm 7.8}$ | $25.05_{\pm 13.6}$ | $23.23_{\pm 8.9}$ |

Table 4: Results for zero- and few-shot experiments conducted over the ChatGPT
API.

#### Zero-shot cross-domain transfer

The results for our zero-shot cross-domain transfer experiments are presented
in Table 5. The best results over all datasets were achieved by the Legal-XLM-
RLarge model, scoring an F1-score of 71.6%. Overall, the LMs pre-trained on
legal data demonstrated a 4-percentage point advantage, with a mean F1 of
68.3% averaged over all four legal models, compared to the other models pre-
trained on different domains. Furthermore, we notice that the standard
deviation for the experiments conducted with the LMs pre-trained on legal data
is higher compared to the other models. A possible explanation is that pre-
training on legal data improved negation predictions in some areas but
adversely affected others, likely due to bias in the legal models, thereby
increasing standard deviations across experiments. Generally, cross-domain
transfer to the legal domain is less successful than other zero-shot
experiments across languages and domains (i.e., shaitarova_cross-lingual_2020;
khandelwal_negbert_2020). This suggests that transferring from non-legal to
legal domains is challenging.

Model Test Dataset | fr | it | de (DE) | de (CH) |  Mean F1
---|---|---|---|---|---
by Model |  |  |  |  |
DistilmBERT | $61.43_{\pm 1.9}$ | $63.40_{\pm 2.6}$ | $63.50_{\pm 4.3}$ | $58.78_{\pm 4.5}$ | $61.78_{\pm 3.8}$
mBERT | $66.39_{\pm 2.1}$ | $68.49_{\pm 0.8}$ | $64.17_{\pm 3.1}$ | $54.31_{\pm 4.8}$ | $63.34_{\pm 6.2}$
XLM-RBase | $66.80_{\pm 1.9}$ | $71.40_{\pm 0.8}$ | $67.29_{\pm 3.7}$ | $62.44_{\pm 2.9}$ | $66.98_{\pm 4.0}$
XLM-RLarge | $72.30_{\pm 2.0}$ | $70.30_{\pm 0.9}$ | $73.81_{\pm 4.2}$ | $\textbf{63.72}_{\pm 4.6}$ | $70.03_{\pm 5.0}$
Glot500-m | $63.78_{\pm 0.8}$ | $65.54_{\pm 1.1}$ | $61.38_{\pm 4.0}$ | $54.51_{\pm 2.5}$ | $61.30_{\pm 4.9}$
Legal-Swiss-RBase | $69.48_{\pm 2.3}$ | $68.64_{\pm 1.0}$ | $71.81_{\pm 3.8}$ | $54.26_{\pm 4.9}$ | $66.05_{\pm 7.7}$
Legal-Swiss-RLarge | $\textbf{74.66}_{\pm 2.4}$ | $72.68_{\pm 1.5}$ | $\textbf{76.5}_{\pm 1.6}$ | $51.75_{\pm 6.6}$ | $68.89_{\pm 10.8}$
Legal-XLM-RBase | $71.50_{\pm 3.1}$ | $71.48_{\pm 2.2}$ | $71.35_{\pm 5.4}$ | $51.93_{\pm 3.5}$ | $66.57_{\pm 9.3}$
Legal-XLM-RLarge | $74.52_{\pm 2.1}$ | $\textbf{74.48}_{\pm 3.3}$ | $76.06_{\pm 3.3}$ | $61.30_{\pm 8.9}$ | $\textbf{71.59}_{\pm 7.7}$
ChatGPT | $13.00_{\pm 2.1}$ | $25.11_{\pm 1.5}$ | $16.47_{\pm 2.6}$ | $32.91_{\pm 7.9}$ | $21.87_{\pm 8.9}$
Mean F1 by Dataset | $68.99_{\pm 4.9}$ | $\textbf{69.60}_{\pm 3.7}$ | $69.54_{\pm 6.4}$ | $57.00_{\pm 6.4}$ | $66.28_{\pm 7.6}$

Table 5: Cross-domain zero-shot results from existing datasets to our new
legal datasets. All models except for ChatGPT were pre-trained on all external
datasets, ChatGPT did not receive any training data. The bottom right entry
shows the average across all datasets and models except ChatGPT.

#### Zero-shot cross-lingual transfer

Table 6 presents the results of our zero-shot cross-lingual experiments
conducted with only our legal data. Although these datasets are considerably
smaller than the existing English and French datasets, we were able to
increase the F1-score by an average of 15.6% across all models and datasets.
The legal models still performed well in these experiments, but they no longer
showed an advantage over the other LMs. XLM-RBase achieved the best results.
All models, except for DistilmBERT, performed significantly better than in the
previous experiment across all datasets. DistilmBERT performed worse on the
German datasets than in the previous experiment. One explanation for this
might be that DistilmBERT is the only cased model used in our experiments.
While cased models usually outperform uncased models, this does not seem to
apply to cross-lingual experiments. Similar results were found by
uncasedLearningTransfer, who conducted cross-lingual reading comprehension
experiments from English to Czech and found that the uncased models
outperformed the cased models in these experiments. They theorized that the
overlap of sub-words is larger between English and Czech for uncased models
because they disregard diacritical marks, which are common in Czech. A similar
argument could be made for the cross-lingual transfer between Italian, French,
and German because German includes a lot of casing information while Italian
and French do not.

Model Test Dataset | fr | it | de (DE) | de (CH) |  Mean F1
---|---|---|---|---|---
by Model |  |  |  |  |
DistilmBERT | $79.56_{\pm 1.0}$ | $74.94_{\pm 1.7}$ | $58.74_{\pm 9.6}$ | $52.59_{\pm 11.3}$ | $66.46_{\pm 13.3}$
mBERT | $87.22_{\pm 1.6}$ | $81.94_{\pm 1.3}$ | $81.39_{\pm 3.6}$ | $70.78_{\pm 6.7}$ | $80.33_{\pm 7.1}$
XLM-RBase | $88.70_{\pm 0.8}$ | $\textbf{86.43}_{\pm 2.2}$ | $88.00_{\pm 1.9}$ | $\textbf{83.71}_{\pm 4.8}$ | $\textbf{86.71}_{\pm 3.3}$
XLM-RLarge | $\textbf{90.55}_{\pm 0.9}$ | $84.93_{\pm 1.7}$ | $\textbf{91.36}_{\pm 0.8}$ | $76.65_{\pm 4.5}$ | $85.87_{\pm 6.4}$
Glot500-m | $86.77_{\pm 2.3}$ | $83.41_{\pm 1.3}$ | $90.10_{\pm 2.0}$ | $77.73_{\pm 4.6}$ | $84.50_{\pm 5.4}$
Legal-Swiss-RBase | $87.42_{\pm 1.2}$ | $84.54_{\pm 1.6}$ | $88.24_{\pm 1.0}$ | $70.95_{\pm 3.6}$ | $82.79_{\pm 7.4}$
Legal-Swiss-RLarge | $84.63_{\pm 1.0}$ | $83.88_{\pm 1.9}$ | $88.47_{\pm 3.9}$ | $70.33_{\pm 6.0}$ | $81.83_{\pm 7.8}$
Legal-XLM-RBase | $86.40_{\pm 2.1}$ | $83.28_{\pm 1.4}$ | $89.56_{\pm 2.5}$ | $74.52_{\pm 8.0}$ | $83.44_{\pm 7.0}$
Legal-XLM-RLarge | $85.51_{\pm 1.7}$ | $85.76_{\pm 0.3}$ | $89.58_{\pm 1.8}$ | $80.16_{\pm 4.0}$ | $85.25_{\pm 4.1}$
Mean F1 by dataset | $\textbf{86.31}_{\pm 3.2}$ | $83.23_{\pm 3.5}$ | $85.05_{\pm 10.4}$ | $73.05_{\pm 10.3}$ | $81.91_{\pm 9.3}$

Table 6: Multilingual zero-shot experiments within our legal datasets. Each
column represents a different set of test and train data where the test data
includes all legal datasets in languages that are not the language of the test
dataset i.e. models evaluated on fr were trained with it and de (DE,CH).

#### Multilingual experiments

The best results for negation scope resolution on our legal datasets were
achieved by training our models on the entirety of the available data (Table
7). This multilingual approach achieved an average F1-score of 90% across all
models and datasets and outperformed all of the previous setups. This
indicates that a relatively small amount of training data in the domain and
language of the test dataset can significantly improve the performance of a
LM. It is also notable that there seems to be no substantial difference in the
performance of the different LMs in this experiment, with a standard deviation
of only $\pm$ 3.6 over all models and datasets. Although DistilmBERT obtained
the lowest scores in this experiment, its performance is not significantly
inferior to that of the mBERT model. This could be attributed to the fact that
the training data also included German examples which might have mitigated the
advantage of the uncased models with regard to shared vocabulary. We also
conducted multilingual experiments only using our new datasets which achieved
very similar results with an overall F1-score of $89.1_{\pm 4}$ (see Appendix
C).

Model Test Dataset | fr | it | de (DE) | de (CH) |  Mean F1
---|---|---|---|---|---
by Model |  |  |  |  |
DistilmBERT | $87.54_{\pm 0.6}$ | $82.90_{\pm 1.3}$ | $94.63_{\pm 0.5}$ | $90.77_{\pm 1.2}$ | $88.96_{\pm 4.5}$
mBERT | $89.98_{\pm 2.1}$ | $83.72_{\pm 1.0}$ | $95.21_{\pm 0.5}$ | $87.83_{\pm 1.0}$ | $89.10_{\pm 4.4}$
XLM-RBase | $\textbf{91.31}_{\pm 1.2}$ | $88.81_{\pm 1.1}$ | $94.74_{\pm 0.7}$ | $89.39_{\pm 1.8}$ | $\textbf{91.06}_{\pm 2.6}$
XLM-RLarge | $90.77_{\pm 1.8}$ | $87.44_{\pm 0.5}$ | $93.40_{\pm 1.1}$ | $90.20_{\pm 3.9}$ | $90.45_{\pm 3.0}$
Glot500-m | $89.65_{\pm 1.0}$ | $85.54_{\pm 2.3}$ | $94.94_{\pm 0.7}$ | $\textbf{91.00}_{\pm 2.7}$ | $90.28_{\pm 3.8}$
Legal-Swiss-RBase | $89.08_{\pm 1.6}$ | $87.40_{\pm 1.9}$ | $94.60_{\pm 1.0}$ | $87.02_{\pm 1.5}$ | $89.52_{\pm 3.4}$
Legal-Swiss-RLarge | $89.07_{\pm 1.4}$ | $86.72_{\pm 1.5}$ | $\textbf{95.94}_{\pm 0.2}$ | $89.39_{\pm 0.9}$ | $90.28_{\pm 3.7}$
Legal-XLM-RBase | $90.71_{\pm 0.5}$ | $86.67_{\pm 0.5}$ | $95.41_{\pm 0.7}$ | $86.17_{\pm 2.4}$ | $89.74_{\pm 4.0}$
Legal-XLM-RLarge | $90.75_{\pm 1.4}$ | $\textbf{89.46}_{\pm 0.8}$ | $93.87_{\pm 0.8}$ | $89.18_{\pm 1.0}$ | $90.82_{\pm 2.1}$
Mean F1 by Dataset | $89.87_{\pm 1.2}$ | $86.52_{\pm 2.4}$ | $\textbf{94.74}_{\pm 1.0}$ | $88.99_{\pm 2.4}$ | $90.03_{\pm 3.6}$

Table 7: Results from multilingual experiments over all available data.

### 5.1. Error analysis

We investigated the length of the predicted negation scopes as well as random
samples of the predictions on the French and German test data to identify some
common error cases.

#### Predicted scope length

As expected, our cross-domain zero-shot experiments without legal training
data achieved the lowest F1-scores overall. This can mostly be attributed to
the differences in annotation for each dataset, as well as the different
domains. Although the external corpora included French data, this did not
improve the performance on the French dataset compared to the other legal
datasets. A possible reason is that the subject was not annotated as part of
the scope in the Dalloux dataset opposed to the French legal dataset.

Figure 2: Actual scope length and scope length predicted by Legal-XLM-RLarge
for each experiment. X marks the scope length of the train data.

Analyzing the predicted scope length compared to the actual scope length
reveals one main issue with the zero-shot transfer from the external datasets
of different domains to our legal datasets. Figure 2 shows the analysis of the
predicted scopes by the Legal-XLM-RLarge model. In our cross-domain zero-shot
experiment, the predicted scope length is significantly shorter than the
actual annotated scope length. This is clarified by Table 2, revealing the
external datasets have a shorter annotated scope length (24%) compared to our
legal datasets (38.6%). Sample predictions confirm that the model often omits
the subject from the annotated scope.

  * Annotation

: Es sei festzustellen, dass der Rückerstattungsanspruch nicht verjährt sei.

  * EN:

It should be noted that the claim for restitution is not forfeited.

  * Prediction

: Es sei festzustellen , dass der Rückerstattungsanspruch nicht verjährt sei.

  * EN:

It should be noted that the claim for restitution is not forfeited.

As soon as some legal data is added to our training sets, the predicted scope
length as well as the F1-score increases. An inspection of the predictions
made by the legal and multilingual models shows that the additional training
data helps to predict the subject as part of the scope. One exception where
the subject was not annotated in the prediction is for subjects represented by
an initial instead of a pronoun or a full name, which is common in legal
documents for anonymization reasons. We suspect that in these cases the models
were not able to identify the initial as the subject because these kinds of
subjects might be more uncommon outside of the legal domain.

  * Annotation:

E._ ne disposait d’aucune autonomie budgétaire;

  * EN:

E._ had no budgetary autonomy

  * Prediction:

E. _ ne disposait d’aucune autonomie budgétaire;

  * EN:

E._ had no budgetary autonomy

#### Non-continuous scopes

Another error case is sentences where the scope is not continuous because it
is interrupted by an interjection or contrasting statement. These kinds of
sentences are more complex than the average sentence and not very common in
the training data. A larger amount of training data containing similar
sentence structures could improve accuracy.

  * Annotation:

Eine ordentliche Kündigung ist während der vereinbarten Laufzeit beiderseits
nur zum Vertragsende und nicht zu einem früheren Zeitpunkt zulässig.

  * EN

An ordinary termination during the agreed term is only permissible on both
sides at the end of the contract and not at an earlier time

  * Prediction:

Eine ordentliche Kündigung ist während der vereinbarten Laufzeit beiderseits
nur zum Vertragsende und nicht zu einem früheren Zeitpunkt zulässig.

  * EN

An ordinary termination during the agreed term is only permissible on both
sides at the end of the contract and not at an earlier time

## 6\. Conclusions and Future Work

### 6.1. Conclusion

We released new legal datasets in German, French and Italian, annotated for
negation cues and scopes and showed that the legal domain does pose a
challenge for models in negation scope resolution. Cross-domain zero-shot
experiments showed that models without legal training data do not perform as
well on multilingual legal datasets as they do on other domains. The task is
also too complex for ChatGPT, which was not able to reach F1-scores above 37%.
Using our new datasets we fine-tuned different models on the legal domain,
significantly improving the results and showing that even relatively small
amounts of training data in a specific domain and language can improve the
performance of multilingual LMs for negation scope resolution.

### 6.2. Future Work

Negation scope resolution models in the legal domain could benefit from more
training data to increase the accuracy of predictions of more complex sentence
structures such as non-continuous scopes. More diverse data from different
legal fields could further improve the performance of negation scope models in
the legal domain.

With our new datasets we were able to show that existing systems performing
well on datasets across different domains are not necessarily able to perform
as well on legal data. This should motivate future work to focus on this
complex domain and evaluate the performance of existing systems in diverse NLP
tasks.

## Limitations

Due to resource constraints, our datasets are relatively small compared to
other publicly available corpora. A larger set of legal data accross a diverse
set of sources, annotated with negations could further improve the performance
of LMs for negation scope resolution in this field. We also did not
investigate the potential of cross-lingual cue detection since this is the
more trivial part of negation research and can easily be replaced by a list of
negation cues for each language.

## Ethics Statement

The goal of our work was to improve the performance of negation scope
resolution systems in the legal domain. These improved systems could be used
to support legal professionals in processing and analysing legal texts. These
systems should only be used as an assistance to human experts with
considerations to their limitations and possible biases. To the best of our
knowledge there is currently no real world application of a negation scope
resolution system in the legal domain.

The legal data that we annotated and used to train our models is all publicly
available and has all been anonymized. It should therefore not include any
sensitive information.

##  Appendix A ChatGPT negation scope example

User: In the following German sentence give me a list of all words that are
part of a negation scope. Negation scope describes all words affected by a
negation in a sentence. Format the output as json. Sentence: Ich weiss nicht
was eine Kartoffel ist.

ChatGPT: Certainly, here’s the JSON output for the words that are part of the
negation scope in the provided German sentence:

Figure 3: ChatGPT annotation of a simple sentence.

User: In the following German sentence give me a list of all words that are
part of a negation scope. Negation scope describes all words affected by a
negation in a sentence. Format the output as json. Sentence: Die Gewährung der
tariflichen Leistungen, somit auch die Versorgungszusage, die laut
Tarifvertrag für Auszubildende nicht gelte, hätte überhaupt nur dann Sinn
gemacht, wenn die Versorgungszusage entgegen des Geltungsbereichs des
Tarifvertrages auch dem Auszubildenden erteilt hätte werden sollen.

ChatGPT: Certainly, here’s the JSON output for the words that are part of the
negation scope in the provided German sentence:

Figure 4: ChatGPT annotation of a more complex legal sentence.

##  Appendix B Mean results over all models, datasets and experiments

Model Test Dataset |  Zero-shot |  |  |  |
---|---|---|---|---|---
cross-domain |  Zero-shot |  |  |  |
cross-lingual |  Multilingual - |  |  |  |
legal data |  Multilingual - |  |  |  |
all data |  Mean F1 |  |  |  |
by model |  |  |  |  |
DistilmBERT | $61.78_{\pm 3.77}$ | $66.46_{\pm 13.33}$ | $0.87_{\pm 0.05}$ | $88.96_{\pm 4.51}$ | $72.40_{\pm 14.54}$
mBERT | $63.34_{\pm 6.24}$ | $80.33_{\pm 7.10}$ | $0.89_{\pm 0.04}$ | $89.19_{\pm 4.41}$ | $77.62_{\pm 12.33}$
XLM-RBase | $66.98_{\pm 4.02}$ | $86.71_{\pm 3.25}$ | $0.90_{\pm 0.03}$ | $91.06_{\pm 2.63}$ | $81.59_{\pm 11.07}$
XLM-RLarge | $70.03_{\pm 4.98}$ | $85.87_{\pm 6.44}$ | $0.90_{\pm 0.04}$ | $90.45_{\pm 3.00}$ | $82.12_{\pm 10.10}$
Glot500-m | $61.30_{\pm 4.85}$ | $84.50_{\pm 5.36}$ | $0.89_{\pm 0.04}$ | $90.28_{\pm 3.84}$ | $78.70_{\pm 13.46}$
Legal-Swiss-RBase | $66.05_{\pm 7.72}$ | $82.79_{\pm 7.41}$ | $0.88_{\pm 0.05}$ | $89.52_{\pm 3.41}$ | $79.45_{\pm 11.82}$
Legal-Swiss-RLarge | $68.89_{\pm 10.80}$ | $81.83_{\pm 7.81}$ | $0.90_{\pm 0.03}$ | $90.28_{\pm 3.66}$ | $80.33_{\pm 11.84}$
Legal-XLM-RBase | $66.57_{\pm 9.33}$ | $83.44_{\pm 7.01}$ | $0.90_{\pm 0.04}$ | $89.74_{\pm 3.99}$ | $79.92_{\pm 12.10}$
Legal-XLM-RLarge | $71.59_{\pm 7.73}$ | $85.25_{\pm 4.07}$ | $0.89_{\pm 0.04}$ | $90.82_{\pm 2.12}$ | $82.55_{\pm 9.61}$
Mean F1 by experiment | $66.28_{\pm 7.64}$ | $81.91_{\pm 9.26}$ | $0.89_{\pm 0.04}$ | $90.03_{\pm 3.57}$ |

Table 8: Mean Results over all models and experiments

##  Appendix C Multilingual results legal data

Model Test Dataset | fr | it | de (DE) | de (CH) |  Mean F1
---|---|---|---|---|---
by Model |  |  |  |  |
DistilmBERT | $86.06_{\pm 0.76}$ | $81.82_{\pm 0.79}$ | $93.98_{\pm 0.82}$ | $87.40_{\pm 2.36}$ | $87.32_{\pm 4.65}$
mBERT | $90.16_{\pm 1.33}$ | $84.56_{\pm 1.63}$ | $94.95_{\pm 0.80}$ | $86.81_{\pm 2.06}$ | $89.12_{\pm 4.25}$
XLM-R-Base | $90.26_{\pm 0.96}$ | $88.05_{\pm 1.81}$ | $94.12_{\pm 0.59}$ | $87.21_{\pm 2.66}$ | $89.91_{\pm 3.16}$
XLM-R-Large | $90.23_{\pm 1.40}$ | $86.93_{\pm 0.73}$ | $94.56_{\pm 0.85}$ | $86.44_{\pm 3.56}$ | $89.54_{\pm 3.80}$
Glot500-m | $88.81_{\pm 1.47}$ | $85.62_{\pm 1.12}$ | $94.23_{\pm 1.40}$ | $88.13_{\pm 2.60}$ | $89.20_{\pm 3.59}$
Legal-Swiss-R-Base | $87.98_{\pm 1.46}$ | $89.53_{\pm 0.54}$ | $93.15_{\pm 0.44}$ | $81.82_{\pm 3.88}$ | $88.12_{\pm 4.62}$
Legal-Swiss-R-Large | $88.35_{\pm 0.88}$ | $88.20_{\pm 1.13}$ | $95.30_{\pm 0.37}$ | $89.39_{\pm 1.37}$ | $90.31_{\pm 3.13}$
Legal-XLM-R-Base | $88.89_{\pm 1.58}$ | $88.41_{\pm 1.84}$ | $95.56_{\pm 0.88}$ | $85.27_{\pm 3.83}$ | $89.53_{\pm 4.39}$
Legal-XLM-R-Large | $88.86_{\pm 0.95}$ | $87.98_{\pm 0.64}$ | $94.46_{\pm 0.69}$ | $85.30_{\pm 3.12}$ | $89.15_{\pm 3.76}$
Mean F1 by dataset | $88.84_{\pm 1.70}$ | $86.79_{\pm 2.55}$ | $94.48_{\pm 1.01}$ | $86.42_{\pm 3.36}$ | $89.13_{\pm 3.97}$

Table 9: Results of multilingual experiments using only our legal datasets.

  *[SotA]: state-of-the-art
  *[BERT]: Bidirectional Encoder Representation from Transformers
  *[FSCS]: Federal Supreme Court of Switzerland
  *[LMs]: language model
  *[LM]: language model


* [124] Cohen-Tannoudji, C., Dupont-Roc, J. and Grynberg, G. Photons & Atoms: Introduction to Quantum Electrodynamics. Weinheim: WILEY-VCH Verlag GmbH & Co. KGaA, 2004.
  * [125] Griffiths, D. J. Introduction to Electrodynamics. Third edition. Upper Saddle River, New Jersey: Prentice Hall, 1981.
  * [126] Goldstein, H. Classical Mechanics. Reading, Massachusetts, USA: Addison-Wesley Publishing Company, Inc, 1959.
  * [127] Weinberg, S. Foundations. The Quantum Theory of Fields, Vol 1. Cambridge: Cambridge University Press, 2005.
  * [128] Miloni, P. W. The Quantum Vacuum: An Introduction to Quantum Electrodynamics. London: Academic Press Ltd, 1994.
  * [129] Sakurai, J. J. Advanced Quantum Mechanics. New York: Addison-Wesley, 1978.
  * [130] Loudon, R. The quantum Theory of Light. Third edition. Oxford: Oxford University Press, 2000.
  * [131] Bennett, R., Barlow, T. M. and Beige, A. A physically-motivated quantisation of the electromagnetic field. Eur. J. Phys. 2016, 37 (1): 014001.
  * [132] Planck, M. On the law of the energy distributio in the normal spectrum. Ann. Phys. 1901, 4, 553.
  * [133] Einstein, A. The quantum theory of radiation. Phys. Z. 1917, 18, 121.
  * [134] Lancaster, T. and Blundell, S. J. Quantum field theory for the gifted amateur. First edition. Oxford: Oxford University Press, 2014.
  * [135] Shore, B. W. Our changing view of photons: a tutorial memoir. Oxford: Oxford University Press, 2020.
  * [136] Żukowski, M., Zeilinger, A. and Horne, M. A. Realizable higher-dimensional two-particle entanglement via multiport beam splitters. Phys. Rev. A. 1997, 55, 2564.
  * [137] Lim, Y. L. and Beige, A. Generalized Hong-Ou-Mandel experiments with bosons and fermions. New. J. Phys. 2005, 7, 155.
  * [138] Kok, P., Munro, W. J., Nemoto, K., Ralph, T. C., Dowling, J. P. and Milburn, G. J. Linearoptical quantum computing with photonic qubits. Rev. Mod. Phys. 2007, 79.
  * [139] Brańczyk, A. M. Hong-Ou-Mandel interference. arXiv:1711.00080[quant-ph], 2017.
  * [140] Glauber, R. J. Photon correlations. Phys. Rev. Lett. 1963, 10 (3).
  * [141] Ornigotti, M., Conti, C. and Szameit, A. Quantum X waves with orbital angular momentum in nonlinear dispersive media. J. Opt. 2018, 20: 065201.
  * [142] Hernandez-Figueroa, H. E., Zamboni-Rached, M. and Recami, E. Localized Waves. Hoboken: John Wiley & Sons Inc, 2008.
  * [143] Aiello, A. Field theory of monochromatic optical beams: I. Classical fields. J. Opt. 2019, 22: 014001.
  * [144] Aiello, A. Field theory of monochromatic beams: II. Classical and quantum paraxial beams. J. Opt. 2019, 22: 014002.
  * [145] Cramer, J. G. The transactional interpretation of quantum mechanics. Rev. Mod. Phys. 1986, 58 (3), pp.647-687.
  * [146] Hawton, M. Maxwell quantum mechanics. Phys. Rev. A. 2019, 100: 012122.
  * [147] Nasr, M. B., Carrasco, S., Saleh, B. E. A., Sergienko, M. V. Teich, M. C., Torres, J. P., Torner, L., Hum, D. S. and Fejer, M. M. Ultrabroadband Biphotons Generated via Quasi-Phase-matched Optical Parametric Down-Conversion. Phys. Rev. Lett. 2008, 100: 183601.
  * [148] Okano, M., Okamoto, R., Tanaka, A., Subashchandram, S. and Takeuchi, S. Generation of broadband spontaneous parametric fluorescence using multiple bulk nonlinear crystals. Optical Express. 2012, 20 (13). pp.13977-13987.
  * [149] Javid, U. A., Ling, J., Staffa, J., Li, M., He, Y. and Lin, Q. Ultrabroadband Entangled Photons on a nanophotonic Chip. Phys. Rev. Lett. 2021, 127: 183601.
  * [150] Okano, M., Lim, H. H., Okamoto, R., Nishizawa, N., Kurimuro, S. and Takeuchi, S. $0.54\mu$m resolution two-photon interference with dispersion cancellation for quantum optical coherence tomography. Sci. Rep. 2015, 5: 18042.
  * [151] Hawton, M. and Melde, T. Photon number density operator $i\hat{\mathbf{E}}\cdot\hat{\mathbf{A}}$. Phys. Rev. A. 1995, 51 (5).
  * [152] Bohr, N. and Rosenfeld, L. Fields and charge measurement in quantum electrodynamics. Phys. Rev. 1950, 78 (6).
  * [153] Barcellona, P., Bennett, R., and Buhmann, S. Y. Manipulating the Coulomb interaction: a Green’s function perspective. J. Phys. Commun. 2018, 2: 035027.
  * [154] Philbin, T. G. Canonical quantization of macroscopic electromagnetism. New J. Phys. 2010, 12: 123008.
  * [155] Howell, K. B. Principles of Fourier Analysis. Boca Raton, Florida: Chapman & Hall/CRC, 2001.
  * [156] Cirac, J. I., Zoller, P., Kimble, H. J. and Mabuchi, H. Quantum state transfer and entanglement distribution among distant modes in a quantum network. Phys. Rev. Lett. 1997, 78, 3221.
  * [157] Kuhn, A. Hennrich, M. and Rempe, G. Deterministic single-photon source for distributed quantum networking. Phys. Rev. Lett. 2002, 89: 067901.
  * [158] Moehring, D. L., Maunz, P., Olmschenk, S., Younge, K. C., Matsukevich, D. N., Duan, L.-M. and Monroe, C. Entanglement of single-atom quantum bits at a distance. Nature. 2007, 449, pp.68-71.
  * [159] Stephenson, L. J., Nadlinger, D. P., Nichol, B. C., An, S., Drmota, P., Ballance, T. G., Thirumalai, K., Goodwin, J. F., Lucas, D. M. and Ballance, C. J. High-Rate, High-Fidelity Entanglement of Qubits Across an Elementary Quantum Network. Phys. Rev. Lett. 2020, 124: 110501.
  * [160] Brody, D. C. Biorthogonal quantum mechanics. J. Phys. A Math. Theor. 2013, 47 (3): 035305.
  * [161] Allcock, G. R. Time of arrival in quantum mechanics I. Formal considerations. Ann. Phys. 1969, 53, pp.253-285.
  * [162] Allcock, G. R. Time of arrival in quantum mechanics II. The individual measurement. Ann. Phys. 1969, 53, pp.286-310.
  * [163] Allcock, G. R. The time of arrival in quantum mechanics III: The measurement ensemble. Ann. Phys. 1969, 53 (2). pp.311-348.
  * [164] Dickinson, R., Forshaw, J. and Millington, P. Negative-frequency modes in quantum field theory. Journal of Physics Conference Series. 2015, 631 (1).
  * [165] Rubino, E., McLenagham, J., Kehr, S. C., Belgiomo, F., Townsend, D., Rohr, S., Kuklewicz, C. E., Leonhardt, U. König, F. and Faccio, D. Negative-Frequency Resonant Radiation. Phys. Rev. Lett. 2012, 180: 253901.
  * [166] Bostelmann, H. and Cadamuro, D. Negative energy densities in integrable quantum field theories at one-particle level. Phys. Rev. D. 2016, 93: 065001.
  * [167] Conforti, M., Marini, A., Tran, T. X., Faccio, D. and Biancalana, F. Interaction between optical fields and their conjugates in non-linear media. Optical Express. 2013, 2 (25) pp.31239-21252.
  * [168] Hawton, M. Photon quantum mechanics in real Hilbert space. Phys Rev. A. 2021, 104: 052211.
  * [169] Babaei, H. and Mostafazadeh, A. Quantum mechanics of a photon. . Math. Phys. 2017, 58: 082502.
  * [170] Leonhardt, U. Essential Quantum Optics. Cambridge: Cambridge university press, 2010.
  * [171] Stokes, A., Kurcz, A. Spiller, T. P. and Beige, A. Extending the validity range of quantum optical master equations. Phys. Rev. A. 2012, 85: 053805.
  * [172] Helstrom, C. W. Detection theory and quantum mechanics. Information and control. 1967, 10. pp.254-291.
  * [173] Hodgson, D., Burgess, C., Altaie, M. B., Beige, A. and Purdy, R. An intuitive picture of the Casimir effect. arXiv:2203.14385, 2022.
  * [174] Penrose, R. Gravitational collapse: The role of General Relativity. Riv. Nuovo. Cim. 1969, 1. pp.252-276.
  * [175] Braidotti, M. C., Prizia, R., Maitland, C., Marino, F., Prain, A., Starshynov, I., Westerberg, N., Wright, E. M. and Faccio, D. Measurement of Penrose superradiance in a photon superfluid. Phys. Rev. Lett. 2022, 128: 013901.
  * [176] Hawking, S. W. Particle creation by black holes. Commun. Math. Phys. 1975, 43, pp.199-220.
  * [177] Unruh, W. G. Notes on black-hole evaporation. Phys. Rev. D. 1976, 14 (870).
  * [178] Casimir, H. B. G. On the attraction between two perfectly condicting plates. Proc. Kon. Nederland. Akad. Wetensch. 1948, B51. pp.793-395.
  * [179] Lifshitz, E. M. The theory of molecular attractive forces between solids. Sov. Phys. 1956, 2. pp.73-83.
  * [180] Lambrecht, A. and Reynaud, S. Casimir force between metallic mirrors. Eur. Phys. J. D. 2000, 8. pp.309-318.
  * [181] Emig, T., Graham, N., Jaffe, R. L. and Kardar, M. Casimir forces between arbitrary compact objects. Phys. Rev. Lett. 2007, 99: 170403.
  * [182] Golestanian, R. Casimir-Lifshitz interaction between dielectrics of arbitrary geometry: A dielectric contrast perturbation theory. Phys. Rev. A. 2009, 80: 012519.
  * [183] Dalvit, D. Milonni, P., Roberts, D. and da Rosa, F. Casimir Physics. 834. Heidelberg: Springer Berlin, 2011.
  * [184] Bennett, R. Born-Series approach to the calculation of Casimir forces. Phys. Rev. A. 2014, 89:062512.
  * [185] Lamoreaux, S. K. Demonstration of the Casimir force in the 0.6 to 6 $\mu$m range. Phys. Rev. Lett. 1997, 78 (1).
  * [186] Mohideen, U. and Roy, A. Precision measurement of the Casimir force from 0.1 to 0.9 $\mu$m. Phys. Rev. Lett. 1998, 81, 4549.
  * [187] Ederth, T. Template-stripped gold surfaces with 0.4 nm rms roughness suitable for force measurements: Applications to the Casimir force in the 20-100 nm range. Phys. Rev. A. 2000, 62: 062104.
  * [188] Chan, H. B., Aksyuk, V. A., Kleiman, R. N., Bishop, D. J. and Capasso, F. Quantum mechanical actuation of microelectromechanical systems by the Casimir force. Science. 2001, 291, 5510.
  * [189] Bressi, G., Carugno, G. Onofrio, R. and Ruoso, G. Measurement of the Casimir force between parallel metallic surfaces. Phys. Rev. Lett. 2002, 88: 041804.
  * [190] Decca, R. S., López, D., Fischbach, E. and Krause, D. E. Measurement of the Casimir force between dissimilar metals. Phys. Rev. Lett. 2003, 91: 050402.
  * [191] Kimball, A. M. Casimir energies and pressures for $\delta$-function potentials. J. Phys. A: Math. Gen. 2004, 37, 6391.
  * [192] Buhmann, S. Y. Normal mode quantum electrodynamics: the quantum vacuum and its consequences. In: Simpson, W. M. R. and Leonhardt, U. eds. Forces of the quantum vacuum: an introduction to Casimir physics. Singapore: World Scientific Publishing Co. Pte. Ltd, 2015, pp.7-59.
  * [193] Shahmoon, E. Van der Waals and Casimir-Polder dispersion forces. In: Simpson, W. M. R. and Leonhardt, U. eds. Forces of the quantum vacuum: an introduction to Casimir physics. Singapore: World Scientific Publishing Co. Pte. Ltd, 2015, pp.61-106.
  * [194] Barlow, T. M., Bennett, R. and Beige, A. A master equation for a two-sided optical cavity. J. Mod. Opt. 2015, 65, S11.
  * [195] Baumberg, J. J., Aizpurua, J., Mikkelsen, M. H. and Smith, D. R. Extreme nanophotonics from ultrathin metallic gaps. Nat. Mater. 2019, 18, 668.
  * [196] Álvarez, J.-R., IJspeert, M., Barber, O., Yuen, B., Barrett, T. D., Stuart, D., Dilky, J., Holleczek, A. and Kihn, A. How to administer an antidote to Schrödinger’s cat. J. Phys. B: At. Mol. Opt. Phys. 2022, 55: 054001.
  * [197] Farkas, A. and Nicolaevici, N. An elementary quantum mechanics calculation for the Casimir effect in one dimension. arXiv:physics/9912017, 1999.
  * [198] Bordag, M., Mohideen, U. and Mostepaneko, V. M. New developments in the Casimir effect. Phys. Rep. 2001, 353, 1.
  * [199] Bordag, M., Klimchitskaya, G. L., Mohideen, U. and Mostepanenko, V. M. Advances in the Casimir effect. Oxford: Oxford University Press, 2009.
  * [200] Wald, R. M. On particle creation by black holes. Commun. Math. Phys. 1975, 45. pp.9-35.
  * [201] Pendry, J. B. Time Reversal and Negative Refraction. Science. 2008, 322(5898), pp.71-73.
  * [202] Smith, D. R., Pendry, J. B. and Wiltshire, M. C. K. Metamaterials and Negative Refractive Index. Science. 2004, 305(5685), pp.788-792.
  * [203] Vezzoli, S., Bruno, V., DeVault, C., Rger, T., Shalaev, V. M., Boltasseva, A., Ferrera, M., Clerici, M., Dubietis, A. and Faccio, D. Optical Time Reversal from Time-Dependent Epsilon-Near-Zero Media. Phys. Rev. Lett. 2018, 120: 043902.
  * [204] Harutyunyan, H., Beams, R. and Novotny, L. Controllable optical negative refraction and phase conjugation in graphite thin films. Nat. Phys. 2013, 9, pp.423-425.
  * [205] Kyoseva, A., Beige, A. and Kwek, L. C. Coherent cavity networks with complete connectivity. New J. Phys. 2012, 14: 023023.
  * [206] Hawton, M. Photon counting by inertial and accelerated detectors. Phys. Rev. A. 2013, 87: 042116.
  * [207] Leonhardt, U. The case for Casimir cosmology. Philosophical Transactions of The Royal Society A Mathematical, Physical and Engineering Sciences. 2020, 378, 2177.
  * [208] Leonhardt, U. Casimir Cosmology. Int. J. Mod. Phys. A. 2022, 37 (19).
  * [209] Bauer, M. The problem of time in quantum mechanics. Eur. J. Phys. 2017, 38: 035402.
  * [210] Delgado, V. and Muga, J. G. Arrival time in quantum mechanics. Phys. Rev. A. 1997, 56 (5).
  * [211] Valdés-Hernández, A., Maglione, C. G., Majtey, A. P. and Plastino, A. R. Entanglement and the ticking of the clock. Rev. Bras. Ens. Fis. 2021, 42.
  * [212] Toller, M. Localization of events in space-time. Phys. Rev. A. 1999, 59 (2).
  * [213] Grot, N., Rovelli, C. and Tate, R. S. Time of arrival in quantum mechanics. Phys. Rev. A. 1996, 54 (6).
  * [214] Leon, J. and Maccone, L. The Pauli objection. Found. Phys. 2017, 47. pp. 1597-1608.
  * [215] Altaie, M. B., Hodgson, D. and Beige, A. Time and Quantum Clocks: a review of recent developments. Frontiers in Physics. 2022, 10: 897305.
  * [216] Page, D. N. Clock time and entropy. In: Halliwell, J. J. Perez-Mercader, J. and Zurek, W. H. eds. Physical Origins of Time Asymmetry. Cambridge: Cambridge University Press, 1994.

###  Appendix A Derivation of $\Omega(\mathbf{k})$

Consider the pure boost that takes us from an initial reference frame
$\mathcal{O}$ into a new reference frame $\mathcal{O}^{\prime}$ moving in a
straight line at a speed $v$ relative to the original frame. This
transformation is imposed by the unitary operator $U(\Lambda)$ where $\Lambda$
deonotes the transformation. If we define a Cartesian coordinate system such
that the reference frame $\mathcal{O}^{\prime}$ is moving in the positive $x$
direction with respect to the frame $\mathcal{O}$, the electric and magnetic
fields will undergo a transformation that is given by, for example, Eq.
(12.108) of Ref. [125]. Under this transformation the orientation of the field
vectors transforms in a way that ensures the new field observables are
divergence-less. One can check this using the field transformations in Ref.
[125], the usual Lorentz transformations for the space and time coordinates,
and Maxwell’s equations (2.8)-(2.11). The transformation also preserves
helicity. A detailed description of the transformation can be found in Section
5.9 of Ref. [127]. We shall ignore any transformation of the polarisation
states here as it is not relevant to determining the overall normalisation of
the field.

Under the Lorentz boost an initial wave vector $\mathbf{k}$ will be
transformed into the new wave vector $\mathbf{p}$. As we cannot boost into a
frame in which light travels in the opposite direction to its original
trajectory, the parameter $s$ can always be chosen such that it remains
constant under a boost. When we boost from the $\mathcal{O}$ frame to the
$\mathcal{O}^{\prime}$ frame the fields also undergo a Doppler-shift by a
factor of $|\mathbf{k}|/|\mathbf{p}|$. By transforming the field observables
given in Eq. (5.4.1) under the unitary operation $U(\Lambda)$, one finds that

$\displaystyle\mathbf{E}^{\prime}(\mathbf{r}^{\prime})$ $\displaystyle=$
$\displaystyle\int_{\mathbb{R}^{3}}\frac{\text{d}^{3}\mathbf{k}}{(2\pi)^{3/2}}\;c\,\Omega(\mathbf{k})\,e^{is\mathbf{k}\cdot\mathbf{r}^{\prime}}U(\Lambda)\widetilde{a}_{s\lambda}(\mathbf{k})U^{\dagger}(\Lambda)\,\boldsymbol{e}_{s\lambda}(\mathbf{k})$
(A.1) $\displaystyle=$
$\displaystyle\int_{\mathbb{R}^{3}}\frac{\text{d}^{3}\mathbf{k}}{(2\pi)^{3/2}}\;c\,\Omega(\mathbf{k})\,e^{is\mathbf{k}\cdot\mathbf{r}^{\prime}}\sqrt{\frac{|\mathbf{p}|}{|\mathbf{k}|}}\,\widetilde{a}_{s\lambda}(\mathbf{p})\,\boldsymbol{e}^{\prime}_{s\lambda}(\mathbf{p})$
$\displaystyle=$
$\displaystyle\int_{\mathbb{R}^{3}}\frac{\text{d}^{3}\mathbf{p}}{(2\pi)^{3/2}}\;\frac{|\mathbf{k}|}{|\mathbf{p}|}\,c\,\Omega(\mathbf{k})\,e^{is\mathbf{p}\cdot\mathbf{r}}\sqrt{\frac{|\mathbf{p}|}{|\mathbf{k}|}}\,\widetilde{a}_{s\lambda}(\mathbf{p})\,\boldsymbol{e}^{\prime}_{s\lambda}(\mathbf{p})$
$\displaystyle=$
$\displaystyle\int_{\mathbb{R}^{3}}\frac{\text{d}^{3}\mathbf{p}}{(2\pi)^{3/2}}\;\frac{|\mathbf{k}|}{|\mathbf{p}|}\,c\,\Omega(\mathbf{p})\,e^{is\mathbf{p}\cdot\mathbf{r}}\,\widetilde{a}_{s\lambda}(\mathbf{p})\,\boldsymbol{e}^{\prime}_{s\lambda}(\mathbf{p}).$

In the above we made use of the relation
$\mathbf{k}\cdot\mathbf{r}^{\prime}=\mathbf{p}\cdot\mathbf{r}$. The additional
factor of $|\mathbf{k}|/|\mathbf{p}|$ in the last line is the blue-shift
factor. By equating the last two lines of the above calculation one finds that

$\frac{\Omega(\mathbf{k})}{\Omega(\mathbf{p})}=\sqrt{\frac{|\mathbf{k}|}{|\mathbf{p}|}}$
(A.2)

which is in agreement with Eq. (5.51). In one dimension the argument follows
analogously which leads us to Eq. (4.50).

###  Appendix B Divergence of the field expectation values

Consider again the regularised wave function given in Eq. (5.19). In the
following we shall define a set of Cartesian coordinates $x_{i}$ for
$i\in\\{1,2,3\\}$. Furthermore, the derivative $\partial_{i}$ shall be used as
shorthand for the partial derivative with respect to the coordinate $x_{i}$.
The divergence of the regularised wave function is then given by

$\displaystyle\mathbf{\nabla}\cdot\int_{\mathbb{R}^{3}}\text{d}^{3}\mathbf{r}^{\prime}\;\boldsymbol{\mathcal{R}}_{\mathbf{s}\lambda}(\mathbf{r}-\mathbf{r}^{\prime})\,\psi_{\mathbf{s}\lambda}(\mathbf{r}^{\prime})$
$\displaystyle=$
$\displaystyle\sum_{i=1}^{3}\int_{\mathbb{R}^{3}}\text{d}^{3}\mathbf{r}^{\prime}\;\partial_{i}\,\mathcal{R}^{i}_{\mathbf{s}\lambda}(\mathbf{r}-\mathbf{r}^{\prime})\,\psi_{\mathbf{s}\lambda}(\mathbf{r}^{\prime})$
(B.1) $\displaystyle=$
$\displaystyle-\sum_{i=1}^{3}\int_{\mathbb{R}^{3}}\text{d}^{3}\mathbf{r}^{\prime}\;\left[\partial^{\prime}_{i}\,\mathcal{R}^{i}(\mathbf{r}-\mathbf{r}^{\prime})\right]\psi_{\mathbf{s}\lambda}(\mathbf{r}^{\prime})$
$\displaystyle=$
$\displaystyle\sum_{i=1}^{3}\int_{\mathbb{R}^{3}}\text{d}^{3}\mathbf{r}^{\prime}\;\mathcal{R}^{i}_{\mathbf{s}\lambda}(\mathbf{r}-\mathbf{r}^{\prime})\,\partial^{\prime}_{i}\,\psi_{\mathbf{s}\lambda}(\mathbf{r}^{\prime})$
$\displaystyle=$
$\displaystyle\int_{\mathbb{R}^{3}}\text{d}^{3}\mathbf{r}^{\prime}\;\boldsymbol{\mathcal{R}}_{\mathbf{s}\lambda}(\mathbf{r}-\mathbf{r}^{\prime})\cdot\mathbf{\nabla}^{\prime}\psi_{\mathbf{s}\lambda}(\mathbf{r}^{\prime}).$

In the above, the third line follows from the second by integration by parts.
We have assumed in this step that our wave function vanishes at large
distances. One finds, therefore, that the regularised wave function is
divergence-less only when the gradient of the wave function is orthogonal to
$\boldsymbol{\mathcal{R}}_{\mathbf{s}\lambda}$. A similar calculation will
show that the divergence of the vector field

$\boldsymbol{\mathcal{R}}_{\mathbf{s}\lambda}[\psi_{\mathbf{s}\lambda}](\mathbf{r})\times\mathbf{s}$
(B.2)

vanishes only when the gradient of the wave function is orthogonal to
$\boldsymbol{\mathcal{R}}_{\mathbf{s}\lambda}\times\mathbf{s}$. Using the
expressions for the field expectation values in Eq. (5.2.4), one can see that
Gauss’s laws for electric and magnetic fields are satisfied when the above
conditions holds. This proves our statement in Section 5.2.4.

###  Appendix C Derivation of Eq. (7.18)

This appendix derives Eq. (7.18) from Eq. (7.17) by making a series of
substitutions. Taking as our starting point the second line of Eq. (7.17), we
first make the substitution $x_{2}\mapsto-x_{2}$. The resulting expression is
given by

$\displaystyle H_{\text{ZPE}}^{\text{II}}$ $\displaystyle=$
$\displaystyle\frac{\hbar
c}{4\pi}\sum_{n,m=-\infty}^{\infty}\int_{-D/2}^{D/2}\text{d}x_{1}\int_{-D/2}^{D/2}\text{d}x_{2}\;$
(C.1)
$\displaystyle\left|(x_{1}-x_{2}+(2n-1)D)(x_{1}-x_{2}+(2m-1)D)\right|^{-3/2}.$

In this next step we shall first separate the $x_{1}$ integral into two
halves. One of these integrals shall run between $-D/2$ and $0$, covering the
negative values of $x_{1}$, and the other shall cover the remaining positive
values between $0$ and $D/2$. The resulting integral is expressed

$\displaystyle H_{\text{ZPE}}^{\text{II}}$ $\displaystyle=$
$\displaystyle\frac{\hbar
c}{4\pi}\sum_{n,m=-\infty}^{\infty}\left[\int_{-D/2}^{0}\text{d}x_{1}+\int_{0}^{D/2}\text{d}x_{1}\right]\int_{-D/2}^{D/2}\text{d}x_{2}\;$
(C.2)
$\displaystyle\left|(x_{1}-x_{2}+(2n-1)D)(x_{1}-x_{2}+(2m-1)D)\right|^{-3/2}.$

We shall next make a separate substitution for each of these two integrals.
For the integral over negative values of $x_{1}$ we shall make the
substitution $x_{1}\mapsto x_{1}-D$. For the integral over the positive values
of $x_{1}$ we shall make the substitution $x_{1}\mapsto x_{1}+D$. The first
integral then takes the form

$\displaystyle H_{\text{ZPE}}^{\text{II}}$ $\displaystyle=$
$\displaystyle\frac{\hbar
c}{4\pi}\sum_{n,m=-\infty}^{\infty}\int_{D/2}^{D}\text{d}x_{1}\int_{-D/2}^{D/2}\text{d}x_{2}\;$
(C.3)
$\displaystyle\left|(x_{1}-x_{2}+(2n-2)D)(x_{1}-x_{2}+(2m-2)D)\right|^{-3/2}.$

The second integral becomes

$\displaystyle H_{\text{ZPE}}^{\text{II}}$ $\displaystyle=$
$\displaystyle\frac{\hbar
c}{4\pi}\sum_{n,m=-\infty}^{\infty}\int_{-D}^{-D/2}\text{d}x_{1}\int_{-D/2}^{D/2}\text{d}x_{2}\;$
(C.4) $\displaystyle\left|(x_{1}-x_{2}+2nD)(x_{1}-x_{2}+2mD)\right|^{-3/2}.$

As one final step, we make the substitution $n\mapsto n+1$ and $m\mapsto m+1$
in Eq. (C.3). This substitution does not change the limits of either sum. The
integrands in both Eqs. (C.3) and (C.4) are then equal both to each other and
the integrand in the third line of Eq. (7.17). Putting both lines of Eq.
(7.17) together we have three integrals with the same integrand: the third
line of Eq. (7.17), Eq. (C.3) and Eq. (C.4). In each of these three integrals
the limits of $x_{2}$ are identical so can be factorised out of this sum. The
integrals over $x_{1}$ contribute to different sections of the real line. Eq.
(C.4) integrates over the region between $-D$ and $-D/2$, the third line of
Eq. (7.17) over the region between $-D/2$ and $D/2$, and Eq. (C.3) over the
region $D/2$ to $D$. Altogether the integral over $x_{1}$ covers the region
$[-D,D]$. Eq. (7.17) is therefore equal to Eq. (7.18).