# How to add partial horizontal lines in horizontally aligned math environments

I'm having trouble writing a proof of a theorem in LaTeX, where I need to sum a set of inequalities and continue the proof with this sum.

The problem I have is that I'd like to introduce this step visually like in the following picture:

but I can't get that horizontal line. In this picture, I added it by editing the LaTeX output using an image editor.

I'm using the align* environment provided by amsmath.

Is there any way for me to do what I want using a horizontally aligned math environment (like align*)?

The answer of egreg has the tiny drawback, that the values for \tleq has to be found manually. This answer fills the gap.

Package amsmath processes its equations twice. In the first run, the widths are measured. The switch \ifmeasure@ is true during this measuring phase. In the second run the equations are actually typeset. Depending on the measured widths of the first run amsmath is now able to move the equation number if necessary, for example.

Also environment alignat* stores the widths of the cells and calculates the maximal widths of the columns.

After the measuring phase the widths of the columns are available in macro \maxcolumn@width. The values are prefixed with \or for easy use with \ifcase, e.g.:

\or 23.1945pt \or 25.221pt \or 10.00002pt \or 12.77773pt \or 54.77959pt \or 62.81717pt \or 74.90263pt \or 0.0pt \or 0.0pt

Count register \column@ holds the current column number.

The following example defines the macro \tline that uses these data to draw a line with the width of the current column. In right aligned columns it is placed after the cell contents, in left aligned columns \tline should start the cell.

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\newcommand*{\tline}{%
\ifmeasuring@
% first measuring run
\else
% second run
% \typeout{\meaning\maxcolumn@widths}% debug info
\ifodd\column@
\expandafter\rlap
\else
\expandafter\llap
\fi
{%
\vrule height-1ex depth \dimexpr1ex+.4pt\relax width
\ifcase\numexpr\column@+1\expandafter\relax
\maxcolumn@widths
\fi
}%
\fi
}
\makeatother

\begin{document}

\begin{alignat*}{4}
a^1 x^\star &\leq b_1 &\quad& \Rightarrow & \delta_1 a^1 x^\star &\leq
\delta_1 b_1 \\
a^2 x^\star &\leq b_2 &&      \Rightarrow & \delta_2 a^2 x^\star &\leq

\end{document}

The interface provided above is very similar to that of amsmath's align using a <LHS> &<rel> <RHS> interface.

For more adjustments vertically, I would suggest using struts \rule{0pt}{<height>} and play around with the value of <height>. For example, inserting \rule{0pt}{1.2\normalbaselineskip} inside the \sum-line provides a decent padding: