Correcting Two Deletions and Insertions in Racetrack Memory

Abstract: Racetrack memory is a non-volatile memory engineered to provide both high density and low latency, that is subject to synchronization or shift errors. This paper describes a fast coding solution, in which delimiter bits assist in identifying the type of shift error, and easily implementable graph-based codes are used to correct the error, once identified. A code that is able to detect and correct double shift errors is described in detail.

\subsection{An Algorithm to Detect and Correct Errors}

\subsection{Single Track}

On a single track, we encode the data bits into an {\it extended codeword} of length $m$ which consists of a Varshamov-Tenengolts code (defined below) of length $n = m-6$ followed by six helper bits that we refer to as delimiter bits.

\begin{definition}
The Varshamov-Tenengolts code $VT\left( n \right)$ is the set of all binary strings $\left( c_1, c_2, \ldots, c_n \right)$ satisfying
\begin{align}
\label{eq:VTCondition}
\sum_{i=1}^n{ic_i} \overset{\mathbf{mod}~n+1}\equiv 0,
\end{align}
where the sum is evaluated as an ordinary rational integer\footnote{Technically speaking, our definition is a specific instance of VT codes. In general, VT codes satisfy $\sum_{i=1}^n{ic_i} \overset{\mathbf{mod}~n+1}\equiv a$, and we used $a=0$.}.
\end{definition}

\begin{remark}
VT codes were introduced in~\cite{VTCodes} to correct errors on a Z-channel. It follows from (\ref{eq:VTCondition}) that these codes are nonlinear over the binary field.
\end{remark}

\noindent {\bf Encoding:} It is possible to construct $VT\left( n \right)$ codes for any $n$, but to maximize the speed of encoding and decoding we choose $n = 2^\ell$ and $k = n-\ell-1$, because when $n+1 = 2^\ell + 1$ the necessary modular arithmetic can be executed more efficiently (see~\cite{piestrak1994design}). The encoding algorithm is described below.
\vspace{-2mm}
\begin{framed}
\begin{enumerate}[leftmargin=0.3cm]
\item Start with a zero-vector $\mathbf{c}$ of length $n = 2^\ell$.

\item Set positions that are not powers of two to data bits (there are $k = n-\ell-1$ such positions).

\item Set $s$ to be the minimum value that needs to be added to the checksum $\sum_{i=1}^n{ic_i}$ to make it equal to $0$ modulo $n+1$.

\item Set the $\ell+1$ positions that are powers of two to the binary expansion (of length $\ell+1$) of $s$. Start from $c_1$ and set it to the least significant bit of the binary expansion of $s$, and move all the way to $c_n$ and set it to the most significant bit of the binary expansion of $s$.
\end{enumerate}
\end{framed}
\vspace{-2mm}
It is straightforward to verify that the resulting codeword satisfies (\ref{eq:VTCondition}). We know that in step $3$ we have $0 \leq s \leq n$. Since $n = 2^\ell$, the binary expansion of $s$ is at most $\ell+1$ bits long.

After encoding the $k$ data bits into a codeword $\mathbf{c}$ of size $n$, we append six delimiter bits to create the \textit{extended codeword} of length $m = n + 6$ that we write to the memory. The six delimiter bits are fixed and equal to $\mathbf{110000}$.

In the remainder of this section, we show that the extended codeword introduced above can correct a single shift error and detect up to two shift errors every $m+3$ shifts. Then, we show how we can correct two shift errors. We present our argument in five steps. In steps~1 and~2, we show that VT codes are capable of correcting a single shift error. Step~3 shows how we can detect up to two shift errors and takes into account the fact that the memory controller is always going to provide the desired number of bits, regardless of whether an error occurs. Step~4 show how to correct a single shift error using our extended codeword. Finally, step~5 incorporates spatial diversity to correct two shift errors.

\vspace{1mm}
\noindent{{\bf Step~1: VT codes are single-deletion-error correcting codes.}} Consider two binary strings $\mathbf{x} = x_1,x_2,\ldots,x_{n}$ and $\mathbf{y} = y_1,y_2,\ldots,y_{n}$. Let $D_{-1}\left( \mathbf{x} \right)$ and $D_{-1}\left( \mathbf{y} \right)$ denote the set of all the binary strings of length $n-1$ that result from a single deletion in $\mathbf{x}$ and $\mathbf{y}$ respectively. If we wish to use these two strings to store different values in a single-deletion channel, we need
\begin{align}
\label{Eq:CodeRequirement}
D_{-1}\left( \mathbf{x} \right) \cap D_{-1}\left( \mathbf{y} \right) = \emptyset.
\end{align}

The following lemma shows that VT codes are single-deletion-error correcting codes.

\begin{lemma}[\cite{levenshtein1966binary,levenshtein1965binary}]
\label{Lemma:VTGraphBased}
Any two binary strings $\mathbf{x}, \mathbf{y} \in VT\left( n \right)$, satisfy (\ref{Eq:CodeRequirement}).
\end{lemma}

For completeness, we present the proof of Lemma~\ref{Lemma:VTGraphBased} in Appendix~\ref{Appendix:AlgoDescription}.

\vspace{1mm}
\noindent{{\bf Step~2:  VT codes are single-insertion-error correcting codes.}} Note that a single-insertion-error correcting code is a single-repetition-error correcting code as well. Similar to what we described above, let $D_{+1}\left( \mathbf{x} \right)$ denote the set of all the binary strings of length $n+1$ that result from a single insertion in $\mathbf{x}$. We have the following result that shows the Varshamov-Tenengolts codes can be used for single-insertion-error-correction as well as single-deletion-error-correction.
\begin{lemma}
\label{Lemma:DeletionandInsertion}
If for two binary strings of length $n$ condition (\ref{Eq:CodeRequirement}) is satisfied, then we have
\begin{align}
\label{Eq:InsertionConstraint}
D_{+1}\left( \mathbf{x} \right) \cap D_{+1}\left( \mathbf{y} \right) = \emptyset.
\end{align}
In other words, a single-deletion-error correcting code is a single-insertion-error correcting code.
\end{lemma}
\begin{proof}
Suppose two binary strings $\mathbf{x}$ and $\mathbf{y}$ of length $n$ satisfy (\ref{Eq:CodeRequirement}) but not (\ref{Eq:InsertionConstraint}). Suppose inserting $x^\prime$ in position $i$ of $\mathbf{x}$ and $y^\prime$ in position $j$ of $\mathbf{y}$ results in the same sequence of length $n+1$. Without loss of generality, we assume $i \leq j$. This implies that deleting $x_{j-1}$ and $y_{i}$ from $\mathbf{x}$ and $\mathbf{y}$ respectively, would result in the same sequence of length $n-1$. This contradicts (\ref{Eq:CodeRequirement}), thus proving the lemma.
\end{proof}

\vspace{1mm}
\noindent{{\bf Step~3: Our extended codeword can detect up to two shift errors.}} In this step, we show that using the six delimiter bits and the checksum condition of (\ref{eq:VTCondition}), we can detect up to two shift errors. Consider $m$ consecutive magnetic domains in racetrack memory. If no error happens, we need $m-1$ shifts to access and read the $m$ bits stored in these $m$ domains. We summarize the resulting observations in positions $m-5,m-4,\ldots,m$ for all possible error combinations in Table~\ref{Table:Syndrom}. In Appendix~\ref{Appendix:Table}, we explain how Table~\ref{Table:Syndrom} is obtained.

\begin{figure}[t]
\centering
\includegraphics[height = 6cm]{FiguresPDF/OuterCode-Diversity.pdf}
\caption{Using an outer code on top of the code presented in Section~\ref{Section:Practical} allows us to correct two shift errors.\label{Fig:OuterCode}}
\vspace{-4mm}
\end{figure}

The most interesting case is when a combination of a deletion error and a repetition error takes place prior to the delimiter bits. In this case, we observe the delimiter bits as the error-free case, \emph{i.e.} $110000$. To detect such errors, we have the following result for VT codes.
\begin{lemma}
\label{Lemma:combination}
For any two binary strings  $\mathbf{x}, \mathbf{y} \in VT\left( n \right)$, $\mathbf{y}$ cannot be obtained from $\mathbf{x}$ by a deletion followed by an insertion (or by an insertion followed by a deletion).
\end{lemma}

\begin{proof}
Suppose $\mathbf{x}^\prime \in D_{-1}\left( \mathbf{x} \right)$ and $\mathbf{y}^\prime \in D_{-1}\left( \mathbf{y} \right)$. If $\mathbf{y}$ can be obtained from $\mathbf{x}$ by a deletion followed by an insertion, then
\begin{align}
D_{+1}\left( \mathbf{x}^\prime \right) \cap D_{+1}\left( \mathbf{y}^\prime \right) \neq \emptyset.
\end{align}
In other words, $\mathbf{x}^\prime$ and $\mathbf{x}^\prime$ do not satisfy (\ref{Eq:InsertionConstraint}) which in turn implies that $\mathbf{x}$ and $\mathbf{y}$ do not satisfy (\ref{Eq:CodeRequirement}). However, this contradicts Lemma~\ref{Lemma:VTGraphBased}. This contradiction proves the result. A similar argument can be used when an insertion is followed by a deletion.
\end{proof}
Lemma~\ref{Lemma:combination} immediately results in the following observation.
\begin{corollary}
A combination of a deletion error and an insertion error on $\mathbf{x} \in VT\left( n \right)$ either results in $\mathbf{x}$ or in $\mathbf{y} \notin VT\left( n \right)$ (an invalid codeword).
\end{corollary}

The shaded row in Table~\ref{Table:Syndrom} corresponds to a combination of a deletion error and an insertion error that resulted in an invalid codeword.

\noindent{{\bf Step~4: Our extended codeword can correct a single shift error and decode the data.}} First, we need to understand how to recover data in the error-free case.

\noindent {\bf Error-free decoding:} If no error is detected using the delimiter bits and the checksum, the $k = n-\ell-1$ data bits are simply retrieved from the positions in $\mathbf{c}$ that are not powers of two, \emph{i.e.} positions $3,5,6,7,9,$ etc. So the only remaining task is to correct a shift error when it happens.

\vspace{1mm}
\noindent {\bf Correcting a deletion error:} Deletion errors can be corrected using the elegant algorithm proposed by Levenshtein~\cite{levenshtein1966binary,levenshtein1965binary}. This algorithm is presented below, and we refer the reader to~\cite{Sloane} for a mathematical analysis.
\begin{framed}
\begin{enumerate}[leftmargin=0.3cm]
\item Suppose a codeword $\mathbf{c} = \left( c_1, c_2, \ldots, c_n \right)$ from $VT\left( n \right)$ is stored in racetrack memory, and we detect a single deletion, and we observe $\mathbf{c}^\prime =  \left( c^\prime_1, c^\prime_2, \ldots, c^\prime_{n-1} \right)$.

\item Set $\omega$ to be the Hamming weight (number of $1$'s) of $\mathbf{c}^\prime$.

\item Calculate the checksum $\sum_{i=1}^{n-1}ic^\prime_i$ and set $s$ to be the minimum amount that needs to be added to the checksum in order to make it $0~\textbf{mod}~n+1$.

\item If $s \leq \omega$, we restore the codeword by adding a $0$ immediately to the left of the rightmost $s$ $1$'s. Otherwise, we restore the codeword by adding a $1$ immediately to the right of the leftmost $\left( s-\omega-1 \right)$ $0$'s.
\end{enumerate}
\end{framed}

Using this algorithm, we reconstruct the correct codeword and recover the dataword as discussed for the error free case. Note that while the decoding algorithm corrects the codeword, it does not reveal where the deletion occurred.

\vspace{1mm}
\noindent {\bf Correcting an insertion error:} From Lemma~\ref{Lemma:DeletionandInsertion}, we know that VT codes can correct an insertion. The corresponding Insertion Correction Algorithm is a modified version of the Deletion Correction Algorithm presented above and is omitted here due to space limitations.

\vspace{1mm}
\noindent{{\bf Step~5: The outer code corrects two shift errors.}} Suppose we detect two shift errors and the data is erased as in Table~\ref{Table:Syndrom}. We can use an outer code to recover data in this case as illustrated in Fig.~\ref{Fig:OuterCode} where the outer code is a simple single parity code. We note that per track we can correct single shift errors and detect up to two shift errors.

\subsection{Racetrack Background}

Racetrack memory stores data in $r$ parallel tape-like tracks. Each data bit is stored in a magnetic domain and neighboring domains are separated by a domain wall as depicted in Fig.~\ref{Fig:Racetrack}. All read/write ports and the physical substrate are fixed in position, and as current is passed through the track, the domains pass by magnetic read/write ports positioned near the wire.
\begin{figure}[t]
\centering
\includegraphics[height = 3.5cm]{FiguresPDF/Racetrack.pdf}
\caption{A single track with one read/write port. One bit is stored per domain and two neighboring domains are separated by a domain wall.\label{Fig:Racetrack}}
\end{figure}

Racetrack memory suffers from deletion and repetition errors. Bits are stored on a track and are accessed by injecting a current to shift them and place them under the read/write port. A \emph{shift} is therefore the injection of the current in order to place the next bit under the read/write port. If the injected current is larger than expected, then we might skip one or multiple magnetic domains resulting in {\it deletion errors}. On the other hand, if the injected current is smaller than expected, the port's position might not change and we might read the same bit twice. We refer to this error as a {\it repetition error}. We refer to deletion and repetition errors as ``shift errors.''

In deletion channels as studied in information theory, the size of the output is equal to the size of the input minus the number of deletions. However, in racetrack memory, the memory controller is always going to provide the desired number of bits, say $n$, regardless of whether an error occurs, so that an error determines which $n$ bits are provided. This is an important characteristic of racetrack memory, and a consequence is that we first need to determine whether an error has occurred.

There is a difference between a {\it repetition} and an {\it insertion}. An insertion means introducing a new bit in a string regardless of the value of its preceding bits. However, a repetition requires the new bit to be equal to the bit right before it. Thus, a repetition error is an instance of an insertion error.

Our goal is to devise a practical code that would allow reliable data recovery in the presence of shift errors in racetrack memory, and for that we need to define the error model.

\subsection{Error Model}
\label{Section:ErrorModel}

We make the following assumptions:
\begin{enumerate}

\item In each track and in every $m+3$ shifts (shift is defined above), at most {\bf two} shift errors may occur.

\item When reading $r$ parallel tracks, in every $m+3$ shifts (per track), at most one track may have two shift errors.

\end{enumerate}

As we see later, if the second assumption is violated, then we can detect the errors but we will only be able to correctly decode the data on the tracks that have a single shift error. A more restrictive model for deletion and insertion channels with segmented errors was used in~\cite{liu2010codes} in which only one shift error could happen per segment (a segment is a fixed number of input bits). Moreover in~\cite{liu2010codes}, authors assume either deletion errors or insertion errors but not a mixture of the two may occur in the channel; we impose no such constraint.

\section{Introduction}
\label{Section:Introduction}

\input{Introduction.tex}

\section{Racetrack Memory}
\label{Section:Racetrack}

\input{Problem.tex}

\section{Main Result}
\label{Section:Main}

\input{Main.tex}

\section{Proof of Theorem~\ref{THM:Main}: Practical Codes for Racetrack Memory}
\label{Section:Practical}

\input{Practical.tex}

\appendices

\section{Proof of Lemma~\ref{Lemma:VTGraphBased}}
\label{Appendix:AlgoDescription}

\input{AlgoDescription.tex}

\section{Derivation of Table~\ref{Table:Syndrom}}
\label{Appendix:Table}

\input{Table.tex}

\bibliographystyle{ieeetr}

\subsection{An Algorithm to Detect and Correct Errors}

\subsection{Single Track}

On a single track, we encode the data bits into an {\it extended codeword} of length $m$ which consists of a Varshamov-Tenengolts code (defined below) of length $n = m-6$ followed by six helper bits that we refer to as delimiter bits.

\begin{definition}
The Varshamov-Tenengolts code $VT\left( n \right)$ is the set of all binary strings $\left( c_1, c_2, \ldots, c_n \right)$ satisfying
\begin{align}
\label{eq:VTCondition}
\sum_{i=1}^n{ic_i} \overset{\mathbf{mod}~n+1}\equiv 0,
\end{align}
where the sum is evaluated as an ordinary rational integer\footnote{Technically speaking, our definition is a specific instance of VT codes. In general, VT codes satisfy $\sum_{i=1}^n{ic_i} \overset{\mathbf{mod}~n+1}\equiv a$, and we used $a=0$.}.
\end{definition}

\begin{remark}
VT codes were introduced in~\cite{VTCodes} to correct errors on a Z-channel. It follows from (\ref{eq:VTCondition}) that these codes are nonlinear over the binary field.
\end{remark}

\noindent {\bf Encoding:} It is possible to construct $VT\left( n \right)$ codes for any $n$, but to maximize the speed of encoding and decoding we choose $n = 2^\ell$ and $k = n-\ell-1$, because when $n+1 = 2^\ell + 1$ the necessary modular arithmetic can be executed more efficiently (see~\cite{piestrak1994design}). The encoding algorithm is described below.
\vspace{-2mm}
\begin{framed}
\begin{enumerate}[leftmargin=0.3cm]
\item Start with a zero-vector $\mathbf{c}$ of length $n = 2^\ell$.

\item Set positions that are not powers of two to data bits (there are $k = n-\ell-1$ such positions).

\item Set $s$ to be the minimum value that needs to be added to the checksum $\sum_{i=1}^n{ic_i}$ to make it equal to $0$ modulo $n+1$.

\item Set the $\ell+1$ positions that are powers of two to the binary expansion (of length $\ell+1$) of $s$. Start from $c_1$ and set it to the least significant bit of the binary expansion of $s$, and move all the way to $c_n$ and set it to the most significant bit of the binary expansion of $s$.
\end{enumerate}
\end{framed}
\vspace{-2mm}
It is straightforward to verify that the resulting codeword satisfies (\ref{eq:VTCondition}). We know that in step $3$ we have $0 \leq s \leq n$. Since $n = 2^\ell$, the binary expansion of $s$ is at most $\ell+1$ bits long.

After encoding the $k$ data bits into a codeword $\mathbf{c}$ of size $n$, we append six delimiter bits to create the \textit{extended codeword} of length $m = n + 6$ that we write to the memory. The six delimiter bits are fixed and equal to $\mathbf{110000}$.

In the remainder of this section, we show that the extended codeword introduced above can correct a single shift error and detect up to two shift errors every $m+3$ shifts. Then, we show how we can correct two shift errors. We present our argument in five steps. In steps~1 and~2, we show that VT codes are capable of correcting a single shift error. Step~3 shows how we can detect up to two shift errors and takes into account the fact that the memory controller is always going to provide the desired number of bits, regardless of whether an error occurs. Step~4 show how to correct a single shift error using our extended codeword. Finally, step~5 incorporates spatial diversity to correct two shift errors.

\vspace{1mm}
\noindent{{\bf Step~1: VT codes are single-deletion-error correcting codes.}} Consider two binary strings $\mathbf{x} = x_1,x_2,\ldots,x_{n}$ and $\mathbf{y} = y_1,y_2,\ldots,y_{n}$. Let $D_{-1}\left( \mathbf{x} \right)$ and $D_{-1}\left( \mathbf{y} \right)$ denote the set of all the binary strings of length $n-1$ that result from a single deletion in $\mathbf{x}$ and $\mathbf{y}$ respectively. If we wish to use these two strings to store different values in a single-deletion channel, we need
\begin{align}
\label{Eq:CodeRequirement}
D_{-1}\left( \mathbf{x} \right) \cap D_{-1}\left( \mathbf{y} \right) = \emptyset.
\end{align}

The following lemma shows that VT codes are single-deletion-error correcting codes.

\begin{lemma}[\cite{levenshtein1966binary,levenshtein1965binary}]
\label{Lemma:VTGraphBased}
Any two binary strings $\mathbf{x}, \mathbf{y} \in VT\left( n \right)$, satisfy (\ref{Eq:CodeRequirement}).
\end{lemma}

For completeness, we present the proof of Lemma~\ref{Lemma:VTGraphBased} in Appendix~\ref{Appendix:AlgoDescription}.

\vspace{1mm}
\noindent{{\bf Step~2:  VT codes are single-insertion-error correcting codes.}} Note that a single-insertion-error correcting code is a single-repetition-error correcting code as well. Similar to what we described above, let $D_{+1}\left( \mathbf{x} \right)$ denote the set of all the binary strings of length $n+1$ that result from a single insertion in $\mathbf{x}$. We have the following result that shows the Varshamov-Tenengolts codes can be used for single-insertion-error-correction as well as single-deletion-error-correction.
\begin{lemma}
\label{Lemma:DeletionandInsertion}
If for two binary strings of length $n$ condition (\ref{Eq:CodeRequirement}) is satisfied, then we have
\begin{align}
\label{Eq:InsertionConstraint}
D_{+1}\left( \mathbf{x} \right) \cap D_{+1}\left( \mathbf{y} \right) = \emptyset.
\end{align}
In other words, a single-deletion-error correcting code is a single-insertion-error correcting code.
\end{lemma}
\begin{proof}
Suppose two binary strings $\mathbf{x}$ and $\mathbf{y}$ of length $n$ satisfy (\ref{Eq:CodeRequirement}) but not (\ref{Eq:InsertionConstraint}). Suppose inserting $x^\prime$ in position $i$ of $\mathbf{x}$ and $y^\prime$ in position $j$ of $\mathbf{y}$ results in the same sequence of length $n+1$. Without loss of generality, we assume $i \leq j$. This implies that deleting $x_{j-1}$ and $y_{i}$ from $\mathbf{x}$ and $\mathbf{y}$ respectively, would result in the same sequence of length $n-1$. This contradicts (\ref{Eq:CodeRequirement}), thus proving the lemma.
\end{proof}

\vspace{1mm}
\noindent{{\bf Step~3: Our extended codeword can detect up to two shift errors.}} In this step, we show that using the six delimiter bits and the checksum condition of (\ref{eq:VTCondition}), we can detect up to two shift errors. Consider $m$ consecutive magnetic domains in racetrack memory. If no error happens, we need $m-1$ shifts to access and read the $m$ bits stored in these $m$ domains. We summarize the resulting observations in positions $m-5,m-4,\ldots,m$ for all possible error combinations in Table~\ref{Table:Syndrom}. In Appendix~\ref{Appendix:Table}, we explain how Table~\ref{Table:Syndrom} is obtained.

\begin{figure}[t]
\centering
\includegraphics[height = 6cm]{FiguresPDF/OuterCode-Diversity.pdf}
\caption{Using an outer code on top of the code presented in Section~\ref{Section:Practical} allows us to correct two shift errors.\label{Fig:OuterCode}}
\vspace{-4mm}
\end{figure}

The most interesting case is when a combination of a deletion error and a repetition error takes place prior to the delimiter bits. In this case, we observe the delimiter bits as the error-free case, \emph{i.e.} $110000$. To detect such errors, we have the following result for VT codes.
\begin{lemma}
\label{Lemma:combination}
For any two binary strings  $\mathbf{x}, \mathbf{y} \in VT\left( n \right)$, $\mathbf{y}$ cannot be obtained from $\mathbf{x}$ by a deletion followed by an insertion (or by an insertion followed by a deletion).
\end{lemma}

\begin{proof}
Suppose $\mathbf{x}^\prime \in D_{-1}\left( \mathbf{x} \right)$ and $\mathbf{y}^\prime \in D_{-1}\left( \mathbf{y} \right)$. If $\mathbf{y}$ can be obtained from $\mathbf{x}$ by a deletion followed by an insertion, then
\begin{align}
D_{+1}\left( \mathbf{x}^\prime \right) \cap D_{+1}\left( \mathbf{y}^\prime \right) \neq \emptyset.
\end{align}
In other words, $\mathbf{x}^\prime$ and $\mathbf{x}^\prime$ do not satisfy (\ref{Eq:InsertionConstraint}) which in turn implies that $\mathbf{x}$ and $\mathbf{y}$ do not satisfy (\ref{Eq:CodeRequirement}). However, this contradicts Lemma~\ref{Lemma:VTGraphBased}. This contradiction proves the result. A similar argument can be used when an insertion is followed by a deletion.
\end{proof}
Lemma~\ref{Lemma:combination} immediately results in the following observation.
\begin{corollary}
A combination of a deletion error and an insertion error on $\mathbf{x} \in VT\left( n \right)$ either results in $\mathbf{x}$ or in $\mathbf{y} \notin VT\left( n \right)$ (an invalid codeword).
\end{corollary}

The shaded row in Table~\ref{Table:Syndrom} corresponds to a combination of a deletion error and an insertion error that resulted in an invalid codeword.

\noindent{{\bf Step~4: Our extended codeword can correct a single shift error and decode the data.}} First, we need to understand how to recover data in the error-free case.

\noindent {\bf Error-free decoding:} If no error is detected using the delimiter bits and the checksum, the $k = n-\ell-1$ data bits are simply retrieved from the positions in $\mathbf{c}$ that are not powers of two, \emph{i.e.} positions $3,5,6,7,9,$ etc. So the only remaining task is to correct a shift error when it happens.

\vspace{1mm}
\noindent {\bf Correcting a deletion error:} Deletion errors can be corrected using the elegant algorithm proposed by Levenshtein~\cite{levenshtein1966binary,levenshtein1965binary}. This algorithm is presented below, and we refer the reader to~\cite{Sloane} for a mathematical analysis.
\begin{framed}
\begin{enumerate}[leftmargin=0.3cm]
\item Suppose a codeword $\mathbf{c} = \left( c_1, c_2, \ldots, c_n \right)$ from $VT\left( n \right)$ is stored in racetrack memory, and we detect a single deletion, and we observe $\mathbf{c}^\prime =  \left( c^\prime_1, c^\prime_2, \ldots, c^\prime_{n-1} \right)$.

\item Set $\omega$ to be the Hamming weight (number of $1$'s) of $\mathbf{c}^\prime$.

\item Calculate the checksum $\sum_{i=1}^{n-1}ic^\prime_i$ and set $s$ to be the minimum amount that needs to be added to the checksum in order to make it $0~\textbf{mod}~n+1$.

\item If $s \leq \omega$, we restore the codeword by adding a $0$ immediately to the left of the rightmost $s$ $1$'s. Otherwise, we restore the codeword by adding a $1$ immediately to the right of the leftmost $\left( s-\omega-1 \right)$ $0$'s.
\end{enumerate}
\end{framed}

Using this algorithm, we reconstruct the correct codeword and recover the dataword as discussed for the error free case. Note that while the decoding algorithm corrects the codeword, it does not reveal where the deletion occurred.

\vspace{1mm}
\noindent {\bf Correcting an insertion error:} From Lemma~\ref{Lemma:DeletionandInsertion}, we know that VT codes can correct an insertion. The corresponding Insertion Correction Algorithm is a modified version of the Deletion Correction Algorithm presented above and is omitted here due to space limitations.

\vspace{1mm}
\noindent{{\bf Step~5: The outer code corrects two shift errors.}} Suppose we detect two shift errors and the data is erased as in Table~\ref{Table:Syndrom}. We can use an outer code to recover data in this case as illustrated in Fig.~\ref{Fig:OuterCode} where the outer code is a simple single parity code. We note that per track we can correct single shift errors and detect up to two shift errors.

\subsection{Racetrack Background}

Racetrack memory stores data in $r$ parallel tape-like tracks. Each data bit is stored in a magnetic domain and neighboring domains are separated by a domain wall as depicted in Fig.~\ref{Fig:Racetrack}. All read/write ports and the physical substrate are fixed in position, and as current is passed through the track, the domains pass by magnetic read/write ports positioned near the wire.
\begin{figure}[t]
\centering
\includegraphics[height = 3.5cm]{FiguresPDF/Racetrack.pdf}
\caption{A single track with one read/write port. One bit is stored per domain and two neighboring domains are separated by a domain wall.\label{Fig:Racetrack}}
\end{figure}

Racetrack memory suffers from deletion and repetition errors. Bits are stored on a track and are accessed by injecting a current to shift them and place them under the read/write port. A \emph{shift} is therefore the injection of the current in order to place the next bit under the read/write port. If the injected current is larger than expected, then we might skip one or multiple magnetic domains resulting in {\it deletion errors}. On the other hand, if the injected current is smaller than expected, the port's position might not change and we might read the same bit twice. We refer to this error as a {\it repetition error}. We refer to deletion and repetition errors as ``shift errors.''

In deletion channels as studied in information theory, the size of the output is equal to the size of the input minus the number of deletions. However, in racetrack memory, the memory controller is always going to provide the desired number of bits, say $n$, regardless of whether an error occurs, so that an error determines which $n$ bits are provided. This is an important characteristic of racetrack memory, and a consequence is that we first need to determine whether an error has occurred.

There is a difference between a {\it repetition} and an {\it insertion}. An insertion means introducing a new bit in a string regardless of the value of its preceding bits. However, a repetition requires the new bit to be equal to the bit right before it. Thus, a repetition error is an instance of an insertion error.

Our goal is to devise a practical code that would allow reliable data recovery in the presence of shift errors in racetrack memory, and for that we need to define the error model.

\subsection{Error Model}
\label{Section:ErrorModel}

We make the following assumptions:
\begin{enumerate}

\item In each track and in every $m+3$ shifts (shift is defined above), at most {\bf two} shift errors may occur.

\item When reading $r$ parallel tracks, in every $m+3$ shifts (per track), at most one track may have two shift errors.

\end{enumerate}

As we see later, if the second assumption is violated, then we can detect the errors but we will only be able to correctly decode the data on the tracks that have a single shift error. A more restrictive model for deletion and insertion channels with segmented errors was used in~\cite{liu2010codes} in which only one shift error could happen per segment (a segment is a fixed number of input bits). Moreover in~\cite{liu2010codes}, authors assume either deletion errors or insertion errors but not a mixture of the two may occur in the channel; we impose no such constraint.

\section{Introduction}
\label{Section:Introduction}

\input{Introduction.tex}

\section{Racetrack Memory}
\label{Section:Racetrack}

\input{Problem.tex}

\section{Main Result}
\label{Section:Main}

\input{Main.tex}

\section{Proof of Theorem~\ref{THM:Main}: Practical Codes for Racetrack Memory}
\label{Section:Practical}

\input{Practical.tex}

\appendices

\section{Proof of Lemma~\ref{Lemma:VTGraphBased}}
\label{Appendix:AlgoDescription}

\input{AlgoDescription.tex}

\section{Derivation of Table~\ref{Table:Syndrom}}
\label{Appendix:Table}

\input{Table.tex}

\bibliographystyle{ieeetr}


Addendum to Vertex adjacencies in the set covering polyhedron

Abstract: We study the relationship between the vertices of an up-monotone polyhedron $R$ and those of the polytope $P$ obtained by truncating $R$ with the unit hypercube. When $R$ has binary vertices, we characterize the vertices of $P$ in terms of the vertices of $R$, show their integrality, and prove that the 1-skeleton of $R$ is an induced subgraph of the 1-skeleton of $P$. We conclude by applying our findings to settle a claim in the original paper.

\section{Introduction}
\label{sec:intro}

In \cite{AKT} we studied vertex adjacency in the (unbounded version of the) set covering polyhedron associated with a binary matrix $A$:
\begin{equation}\label{equ:qast}
   \Q(A) = \conv(\{x\in\mathbb Z^n\mid Ax\ge\mathbf{1}, x\ge\mathbf{0}\}),
\end{equation}
where $\mathbf{0}$ and $\mathbf{1}$ denote vectors of appropriate dimension with all zeros and all ones components respectively, and $\conv(X)$ denotes the convex hull of the set $X\subset\mathbb R^n$. This polyhedron is the dominant of the set covering polytope associated with $A$:
\begin{equation}\label{equ:qastb}
   \overline{\Q(A)} = \conv(\{x\in\mathbb Z^n\mid Ax\ge\mathbf{1},\mathbf{1} \ge x \ge \mathbf{0}\}),
\end{equation}
that is, $\Q(A) = \overline{\Q(A)} +\{x\in \mathbb R^n\mid x \ge \mathbf{0}\}$ where $+$ denotes the Minkowski sum of subsets of $\mathbb R^n$.

Immediately after stating Theorem~2.1 in \cite{AKT}, we made the following claim:

\begin{claim}\label{laclaim}
It can be proved that for any binary matrix $A$ two vertices of $\Q(A)$ are adjacent if and only if they are adjacent in $\overline{\Q(A)}$.
\end{claim}

Although this result may seem quite natural, we would like to observe that it is no longer true if we replace $Q\ch(A)$ by its linear relaxation,
\begin{equation}\label{equ:qa}
   Q(A) = \{x\in\mathbb R^n \mid Ax\ge\mathbf{1}, x\ge\mathbf{0}\},
\end{equation}
and $\overline{\Q(A)}$ by the corresponding bounded version,
\begin{equation}\label{equ:qab}
   \overline{Q(A)} = Q(A)\cap[0,1]^n.
\end{equation}
This may be seen by considering the circulant matrix
\begin{equation}\label{equ:matA}
   A  =
      \begin{bmatrix}
      1 & 1 & 0 \\
      0 & 1 & 1 \\
      1 & 0 & 1
      \end{bmatrix}.
\end{equation}
In this case, the vertices of $\overline{Q(A)}$ are
\[ (1,1,0),\ (0,1,1),\ (1,0,1),\ (1, 1, 1),\ (1/2,1/2,1/2), \]
and $\xi = (1, 1, 0)$ and $\eta = (0, 1, 1)$ are adjacent in $\overline{Q(A)}$ but not in $Q(A)$.
Furthermore,
as is readily verified,
in this example $\xi$ and $\eta$ are adjacent in $Q\ch(A)$,
which means that in general $Q(A)$ does not have the \emph{Trubin property} with respect to $Q\ch(A)$.%
   \footnote{Let us recall that a polyhedron $R$ has the Trubin property with respect to a polyhedron $P$ contained in $R$ if the $1$-skeleton of $P$ is an induced subgraph of the $1$-skeleton of $R$, see~\cite{Trubin}.}

This is rather surprising since in the special case in which $A$ has precisely two ones per row, i.e., the case in which $A$ is the edge-node incidence matrix of a graph $G$, $\overline{Q(A)}$
has the Trubin property with respect to $\overline{\Q(A)}$.%
	\footnote{Since the linear relaxation $\FRAC(G)$ of the stable set polytope $\STAB(G)$ has the Trubin property with respect to $\STAB(G)$ (see~\cite{Padberg}), and the function $x \to \mathbf{1} - x$ affinely maps $\overline{Q(A)}$ to $\FRAC(G)$.}

One of the aims of this paper is to prove the validity of \tref{Claim}{laclaim}. Along the road we will establish relationships between the vertices of an up-monotone polyhedron $R$ and those of a polyhedron $Q\subseteq R$ such that the vertices of $R$ belong to $Q$. The results here do not depend on those in~\cite{AKT}, and we think they are interesting by themselves.

This addendum is organized as follows. In \tref{Section}{sec:basicos} we introduce some notation and present basic results concerning vertices and their adjacency in an up-monotone polyhedron. \tref{Section}{sec:bound} is the core of the paper, where we study the effect of cutting with the unit hypercube an up-monotone polyhedron having only binary vertices, first characterizing the vertices of the new polytope (\tref{Corollary}{coro:bin1}) and proving their integrality (\tref{Corollary}{coro:bin2}), and then studying the adjacency of the vertices of the larger polyhedron in the new polytope (\tref{Theorem}{thm:adj}). We conclude by relating our findings to the original article~\cite{AKT} in \tref{Section}{sec:original}.

\section{Some properties of vertices in up-monotone polyhedra}
\label{sec:basicos}

In this section we introduce notation which perhaps is not quite established in the literature, and state a few basic results that are either simple to prove or well-known, and so we will omit most of the proofs.

Let us start with the notation, part of which we have already used.

The set $\{1,\dots,n\}$ is denoted by $\II$, the family of subsets of $\II$ by $\parts$, the $i$-th vector of the canonical base of $\mathbb R^n$ by $\mathbf{e}_i$, and the scalar product in $\mathbb R^n$ by a dot: $x\cdot y = \sum_{i = 1}^n x_i y_i$.

For $x$ and $y$ in $\mathbb R^n$,
$[x,y] = \conv( \{x, y\})$ represents the (closed) segment joining them,
and we write $x\ge y$ (resp.\ $x > y$) if $x_i\ge y_i$ (resp.\ $x_i > y_i$) for all $i \in \II$ (notice that $x\gneqq y$, i.e., $x\ge y$ and $x\ne y$, does not imply $x > y$).

Given a polyhedron $S$, the set of its vertices is denoted by $\vs(S)$.

Throughout the paper we will assume that
$R\subset \{x\in\mathbb R^n \mid x\ge\mathbf{0}\}$ is a non-empty polyhedron
which is \emph{up-monotone},%
   \footnote{Or \emph{upper comprehensive} in the nomenclature
   of some authors.}
that is, it satisfies any of the following equivalent conditions:
\begin{itemize}
\item
$x\in R$ and $y\ge x$ imply $y\in R$,

\item
$x\in R$ if and only if $x = y + \mu$ with $y\in\conv(\vs(R))$ and $\mu\ge\mathbf{0}$.
\end{itemize}

Our first result relates vertices and minimality in $R$.

\begin{lem}\label{lem:1}
Assuming $\xi$ and $\eta$ are distinct vertices of $R$ and $x\in R$, we have:

\begin{enuma}
\item\label{lem:1:a}
If $x\le \xi$ then $x = \xi$.

\item\label{lem:1:b}
If $x\in[\xi,\eta]$ and $\mu\ge\mathbf{0}$ is such $x + \mu\in[\xi,\eta]$, then $\mu = \mathbf{0}$.
\end{enuma}
\end{lem}

The following proposition is fundamental to our work.

\begin{propo}\label{propo:adj}
If $\vs(R) = \{\xi = \zeta^1, \eta = \zeta^2,\dots,\zeta^r\}$,
then the following are equivalent:
\begin{enuma}
\item\label{propo:adj:a}
$\xi$ and $\eta$ are adjacent in $R$, that is, there exist $c\in\mathbb R^n$ and $b\in\mathbb R$ such that
$c \cdot x \ge b$
for all $x\in R$,
with equality if and only if $x\in [\xi,\eta]$.

\item\label{propo:adj:b}
There exist $c\in\mathbb R^n$ and $b\in\mathbb R$ such that $c > \mathbf{0}$ and
\begin{equation}\label{equ:adj:b}
   c \cdot x \ge b  \text{ for all $x\in\conv(\vs(R))$, with equality if and only if $x\in [\xi,\eta]$.}
\end{equation}

\item\label{propo:adj:c}
If $x + \mu\in[\xi,\eta]$, where $\mu\ge\mathbf{0}$ and $x$ is a convex combination of the form $\sum_{k=1}^r \lambda_k \zeta^k$, then
$\lambda_k = 0$ for $k = 3,\dots,r$ (so $x\in[\xi,\eta]$ and $\mu = \mathbf{0}$).
\end{enuma}
\end{propo}

\begin{proof}
It is easy to show that~\refp{propo:adj:a} implies~\refp{propo:adj:b} and that~\refp{propo:adj:b} implies~\refp{propo:adj:c}. Thus, we next show only that~\refp{propo:adj:c} implies~\refp{propo:adj:a}. We do this by contradiction, so assume \refp{propo:adj:c} holds but $\xi$ and $\eta$ are not adjacent in $R$. Then, the minimal face of $R$ containing $\xi$ and $\eta$ has dimension at least 2. It follows that there exist two points $y',y''\in R$ and $\lambda \in \mathbb R$ such that $0 < \lambda < 1$, $\lambda y' + (1 - \lambda)\,y''\in[\xi,\eta]$ and neither $y'$ nor $y''$ belong to $[\xi,\eta]$. Since $R$ is up-monotone, we can find $x'$ and $x''$ in $\conv(\vs(R))$ and $\mu',\mu''\ge\mathbf{0}$ such that $y' = x' + \mu'$ and $y'' = x'' + \mu''$. Writing $x = \lambda x' + (1 - \lambda)\,x''$ and $\mu = \lambda \mu' + (1 - \lambda)\,\mu''$, we have $x\in\conv(\vs(R))$, $\mu\ge\mathbf{0}$, and $x+\mu = \lambda y' + (1 - \lambda)\,y'' \in [\xi,\eta]$,  so by~\refp{propo:adj:c} we conclude that $\mu = \mathbf{0} = \mu' = \mu''$, that is, $y'=x'$ and  $y''=x''$. Since $x'$ and $x''$ are in $\conv(\vs(R))$, it follows that
\[
   y'=x'= \sum_{k=1}^r \tau'_k \zeta^k,
   \quad
   y''=x'' = \sum_{k=1}^r \tau''_k \zeta^k,
   \quad
   x = \sum_{k=1}^r
      \big(\lambda \tau'_k + (1 - \lambda)\,\tau''_k\big) \zeta^k,
\]
and again by~\refp{propo:adj:c}
we must have
\[
   \lambda \tau'_k + (1 - \lambda)\,\tau''_k = 0
   \quad\text{for $k\ne 1,2$,}
\]
i.e., $\tau'_k = \tau''_k = 0$ for $k\ne 1,2$.
Hence, $y'$ and $y''$
are convex combinations of $\xi$ and $\eta$, that is, they are in $[\xi,\eta]$, contradicting the way they have been chosen above.
\end{proof}

\section{Bounding with the unit hypercube}
\label{sec:bound}

We now turn our attention to
studying the relationship between the vertices of the up-monotone polyhedron $R$ and those of $R\cap[0,1]^n$.

We omit the proof of the following simple result relating the vertices of two polyhedra in a somewhat more general setting.

\begin{lem}\label{lem:3}
Let $S$ and $T$ be polyhedra such that $S\subset T$.
We have:
\begin{enuma}
\item\label{lem:3:1}
If $\xi\in\vs(T)\cap S$ then $\xi\in\vs(S)$.

\item\label{lem:3:2}
If $\xi$ and $\eta$ are distinct points in $\vs(T)\cap S$ which are adjacent in $T$, then they are also adjacent in $S$.
\end{enuma}
\end{lem}

In the remainder of this section, we will assume that
$R$ is an up-monotone polyhedron satisfying
\begin{subequations}\label{equs:hipo}
\begin{equation}
  \label{equ:vsr}
  \vs(R)\subset[0,1]^n,
\end{equation}
and
$P$ is defined by
\begin{equation}
   \label{equ:p}
   P = R\cap[0,1]^n,
\end{equation}
\end{subequations}
so that $\vs(R)\subset P$.

We will find it convenient to consider the function $\varphi: \parts\times \mathbb R^n \to \mathbb R^n$ defined component-wise by
\begin{equation}\label{equ:phi}
   \phix_i = \begin{cases}
      1 & \text{if $i\in I$,} \\
      x_i & \text{otherwise,}
      \end{cases}
\end{equation}
that is, a projection for each $I\in\parts$.
Notice that $\phix = x$ if $I$ is empty,
and that if $x\in P = R\cap[0,1]^n$ then $x\le\phix$ and $\phix\in P$ because $R$ is up-monotone.

The next result says that any vertex of $P$ can be obtained by ``lifting'' a vertex of $R$ via $\varphi$.

\begin{thm}\label{thm:lift}
If $\varphi$ is defined by~\eqref{equ:phi}, then
\begin{equation}\label{eq:lift}
\vs(P) \subset \{\phix[\zeta] \mid I\in \parts, \zeta\in\vs(R)\}.
\end{equation}
\end{thm}

\begin{proof}
Observe that $P = R\cap \{x\in\mathbb R^n \mid x\le\mathbf{1}\}$ because we have assumed $R\subset \{x\in\mathbb R^n \mid x\ge\mathbf{0}\}$. Then, to prove the theorem it is enough to show that any polyhedron in the sequence: $P_0=R$ and $P_k = P_{k-1} \cap \{x\in\mathbb R^n \mid x_k\le 1\}$ for $k\in \II$, satisfies~\eqref{eq:lift}. We do this by induction. Since $\phix = x$ if $I$ is empty, it is obvious that $P_0$ satisfies~\eqref{eq:lift}. So assume now that $P_{k-1}$ satisfies~\eqref{eq:lift}. Note that the vertices of $P_{k}$ which are not vertices of $P_{k-1}$ coincide with the intersections consisting of a single point of the hyperplane $\{x\in\mathbb R^n \mid  x_{k} = 1\}$ with the relative interior of edges of $P_{k-1}$. Besides, observe that the relative interior of no bounded edge of $P_{k-1}$ can intersect $\{x\in\mathbb R^n \mid  x_{k} = 1\}$ in a single point because that would imply $\xi_k> 1$ for some vertex $\xi$ of $P_{k-1}$, contradicting that $V(P_{k-1})\subset [0,1]^n$ (which follows from the fact that $P_{k-1}$ satisfies~\eqref{eq:lift} and $R$ satisfies~\eqref{equ:vsr}). Thus, any vertex of $P_{k}$ which is not a vertex of $P_{k-1}$ is given by the intersection of the relative interior of an unbounded edge of $P_{k-1}$ with $\{x\in\mathbb R^n \mid  x_{k} = 1\}$. Since $R$ is up-monotone, any unbounded edge of $P_{k-1}$ is of the form $\{\xi + \gamma \mathbf{e}_h \mid \gamma \ge 0\}$, where $\xi$ is a vertex of $P_{k-1}$ and $h\in\{k,\ldots ,n\}$. This completes the proof, because when the intersection of $\{\xi + \gamma \mathbf{e}_h \mid \gamma \ge 0\}$ with $\{x\in\mathbb R^n \mid  x_{k} = 1\}$ is not empty (i.e., when $h= k$), it consists of a point which can be obtained replacing the $h$-th component of $\xi$ by a one.\qedhere
\end{proof}

The following is an immediate consequence of \tref{Theorem}{thm:lift}.

\begin{coro}\label{coro:ricardo:1}
Suppose
$R$ and $P$ verify~\eqref{equs:hipo} and
$S$ is a polyhedron verifying $\vs(R)\subset S\subset R$ and
\[ \phix[\zeta]\in S \text{ for all $I\in\parts$ and $\zeta\in\vs(R)$.} \]
Then $\vs(P)\subset S$, that is, $P = R\cap[0,1]^n \subset S$.
\end{coro}

So far we have not assumed the integrality of the vertices of $R$, and, for instance, \tref{Theorem}{thm:lift} may be applied to
$R = Q(A)$ (defined in~\eqref{equ:qa})
and $P = \overline{Q(A)}$ (defined in~\eqref{equ:qab}).

Before studying the case $\vs(R)\subset\mathbb B^n$, where $\mathbb B = \{0,1\}$ denotes the set of binary numbers,  let us state without proof some simple properties relating $\varphi$, binary points and vertices of $R$ and $P = R\cap[0,1]^n$.

\begin{lem}\label{lem:vsp}
In the following we assume $I\in \parts$.
\begin{enuma}
\item\label{lem:vsp:a}
If $x\in \mathbb B^n$ then $\phix\in\mathbb B^n$.

\item\label{lem:vsp:b}
If $x\in P\cap\mathbb B^n$ then $x\in\vs(P)$.

\item\label{lem:vsp:c}
If $x\in R\cap\mathbb B^n$ then $\phix\in\vs(P)$.

\end{enuma}
\end{lem}

The following result characterizes the vertices of $P$ when the vertices of $R$ are binary.

\begin{coro}\label{coro:bin1}
If $\vs(R)\subset\mathbb B^n$,
$P = R\cap[0,1]^n$,
and $\varphi$ is defined by~\eqref{equ:phi}, then
\[ \vs(P) = \{\phix[\zeta] \mid I\in \parts, \zeta\in\vs(R)\}. \]
\end{coro}

\begin{proof}
One inclusion is given by \trrefp{Lemma}{lem:vsp}{lem:vsp:c},
and the other one by \tref{Theorem}{thm:lift}.\qedhere
\end{proof}

Using \tref{Lemma}{lem:vsp}, it is easy to see now that all vertices of $R\cap[0,1]^n$ are binary.

\begin{coro}\label{coro:bin2}
If $\vs(R)\subset\mathbb B^n$ and $P = R\cap [0,1]^n$, then $\vs(P)\subset\mathbb B^n$.
\end{coro}

We come now to the main result of this work.

\begin{thm}\label{thm:adj}
Assume $\vs(R)\subset\mathbb B^n$,
$P = R\cap[0,1]^n$,
and $\xi$ and $\eta$ are distinct vertices of $R$

Then, $\xi$ and $\eta$ are adjacent in $P$ if and only if they are adjacent in $R$.
\end{thm}

\begin{proof}
Since $\vs(R)\subset R \cap \mathbb B^n\subset  R\cap [0,1]^n = P\subset R$, one implication is given by \trrefp{Lemma}{lem:3}{lem:3:2}.

For the other, if $\xi$ and $\eta$ are adjacent in $P$ there exist $c\in\mathbb R^n$ and $b\in\mathbb R$ such that
\begin{equation}\label{equ:adj}
   c\cdot x \ge b
   \text{ for all $x\in P$,
      with equality if and only if $x\in[\xi,\eta]$.}
\end{equation}

If $c > \mathbf{0}$ the result follows by \trrefp{Proposition}{propo:adj}{propo:adj:b} because $\conv(\vs(R)) \subset P$.
So let us assume that the set
\begin{equation}\label{equ:I}
   I = \{i\in \II \mid c_i\le 0\}
\end{equation}
is not empty. In this case, to prove that $\xi$ and $\eta$ are adjacent in $R$, we show that \trrefp{Proposition}{propo:adj}{propo:adj:c} is satisfied. Then, setting
\[
\vs(R) = \{\xi = \zeta^1, \eta = \zeta^2,\dots,\zeta^r\} ,
\]
let a convex combination of the vertices of $R$ of the form
\begin{equation}\label{equ:x}
z = \sum_{k=1}^r \lambda_k \zeta^k
\end{equation}
and $\mu\ge\mathbf{0}$ be such that
\begin{equation}\label{equ:xmu}
   z + \mu\in[\xi,\eta].
\end{equation}

Notice that for any $x\in[\xi,\eta] \subset P$, since $\phix\in P$ for such $x$ and $c_i \le 0$ for $i\in I$, by~\eqref{equ:adj} we have
\[
  b = c\cdot x
   = \sum_{i\notin I} c_i x_i + \sum_{i\in I} c_i x_i
   \ge \sum_{i\notin I} c_i x_i + \sum_{i\in I} c_i
   = c\cdot \phix
   \ge b,
\]
and so $c\cdot \phix =b$. It follows that $\phix\in[\xi,\eta]$ by~\eqref{equ:adj}, and then that $x = \phix$ by~\trrefp{Lemma}{lem:1}{lem:1:b}. In particular, we conclude that
\begin{equation}\label{equ:seg}
   x_i = 1 \text{ for all $x\in[\xi,\eta]$ and all $i\in I$.}
\end{equation}

Letting
\begin{equation}\label{equ:y}
   y = \sum_{k=1}^r \lambda_k \phix[\zeta^k],
\end{equation}
and defining $\tau$ component-wise by
\begin{equation}\label{equ:tau}
   \tau_i = \begin{cases}
      0 & \text{if $i\in I$,} \\
      \mu_i & \text{otherwise},
      \end{cases}
\end{equation}
by checking the components and using~\eqref{equ:seg} and~\eqref{equ:xmu},
we see that $y + \tau = z + \mu$.
Moreover, as $\tau_i = 0$ for $i\in I$ and $c_i > 0$ for $i\notin I$, by~\eqref{equ:adj} we obtain
\[
b = c\cdot (z + \mu) = c\cdot (y + \tau) \ge c\cdot y \ge b,
\]
and therefore $\tau_i = 0$ for $i\notin I$, that is, $\tau = \mathbf{0}$. Thus, we have $y = z + \mu \in[\xi,\eta]$.

By \trrefp{Lemma}{lem:vsp}{lem:vsp:c}, $\phix[\zeta^k]\in\vs(P)$ for all $k$, and since $y\in[\xi,\eta]$, \eqref{equ:y} and the adjacency of $\xi$ and $\eta$ in $P$ imply now that for each $k = 1,\dots,r$, either $\phix[\zeta^k]\in\{\xi,\eta\}$ or $\lambda_k = 0$. Using \trrefp{Lemma}{lem:1}{lem:1:a} and the fact that $\zeta^k \le \phix[\zeta^k]$, we see that $\phix[\zeta^k]\in\{\xi,\eta\}$ implies $\zeta^k\in\{\xi,\eta\}$. Thus, in~\eqref{equ:x} we must have either $\zeta^k\in\{\xi,\eta\}$ or $\lambda_k = 0$, that is,  \trrefp{Proposition}{propo:adj}{propo:adj:c} is satisfied.\qedhere
\end{proof}

\begin{coro}\label{coro:ricardo:2}
Suppose
$\vs(R)\subset\mathbb B^n$,
$S$ is a polyhedron such that $\vs(R)\subset S\subset R$ and
$\phix[\zeta]\in S$ for all $I\in\parts$ and $\zeta\in\vs(R)$,
and $\xi$ and $\eta$ are distinct vertices of $R$ (and hence of $S$ by \trrefp{Lemma}{lem:3}{lem:3:1}).

Then $\xi$ and $\eta$ are adjacent in $S$ if and only if they are adjacent in $R$.
\end{coro}

\begin{proof}
Let us start by assuming that $\xi$ and $\eta$ are adjacent in $S$.
By \tref{Corollary}{coro:ricardo:1},
$P = R\cap[0,1]^n\subset S$,
and adjacency in $S$ implies adjacency in $P$ by \trrefp{Lemma}{lem:3}{lem:3:2} because
$\{\xi,\eta\}\subset \vs(S)\cap P$ and $P\subset S$.
So, by \tref{Theorem}{thm:adj}, $\xi$ and $\eta$ are adjacent in $R$.

On the other hand, if $\xi$ and $\eta$ are adjacent in $R$,
their adjacency in $S$ follows again from \trrefp{Lemma}{lem:3}{lem:3:2}, as $\vs(R)\subset S\subset R$.\qedhere
\end{proof}

The conclusion of relevance in
\tref{Theorem}{thm:adj}
is that vertices in the up-monotone polyhedron $R$ which are adjacent in $P = R\cap[0,1]^n$ are also adjacent in $R$, provided that $\vs(R)\subset\mathbb B^n$. As we have seen in the \hyperref[sec:intro]{Introduction}, we cannot discard this hypothesis: if $A$ is given by~\eqref{equ:matA}, then $R = Q(A)$ has just one fractional vertex, and the vertices $(1,1,0)$ and $(0,1,1)$ are adjacent in $P = \overline{Q(A)}$ but not in $R$.

\section{The claim in the original article}
\label{sec:original}

The polyhedron
\[ R = \Q(A) = \conv(\{x\in\mathbb Z^n\mid Ax\ge\mathbf{1}, x\ge\mathbf{0}\}), \]
is up-monotone and $\vs(R)\subset \mathbb B^n$, and it is simple to see that
\[ S = \overline{\Q(A)} = \conv(\{x\in\mathbb Z^n\mid Ax\ge\mathbf{1},\mathbf{1} \ge x \ge \mathbf{0}\}) \]
satisfies the hypothesis in \tref{Corollary}{coro:ricardo:2}, proving \tref{Claim}{laclaim}.

Notice that
\tref{Corollary}{coro:ricardo:1}
implies $\Q(A) \cap [0,1]^n\subset \overline{\Q(A)}$.
On the other hand,
clearly $\{x\in\mathbb Z^n\mid Ax\ge\mathbf{1},\mathbf{1} \ge x \ge \mathbf{0}\}$
is contained in both $\Q(A)$ and $[0,1]^n$, so
\[ \overline{\Q(A)} = \Q(A) \cap [0,1]^n, \]
and actually \tref{Theorem}{thm:adj} may be applied directly.

\section*{Acknowledgements}
\label{sec:acknowledge}

The authors are very grateful to the anonymous reviewer for his comments and suggestions on a previous version of this paper. This work was partially supported by grant PIP 112-201101-01026 from Consejo Nacional de Investigaciones Cient\'ificas y T\'ecnicas (CONICET), Argentina.