# How to create list for representing logical proofs

I am trying to create a list like the following in latex to express logical proofs. As you can see, the numbering is peculiar as the subnumbering is one ahead of the previous. For example, if after three, a sublist is created, it starts with the number 4.x instead of 3. In addition, I need this list to work when it is part of another larger enumerable list (i.e. this is for problem 8, but I need counting to start at 1 for the proof itself. Thank you and let me know if you need clarification

You could just use nested tabular and new counters. To simplify things, you may define environments for those. They can auto insert the counters.

\documentclass{article}
\usepackage{array}
\newcounter{logpnumi}
\newcounter{logpnumii}
\newenvironment{LogProof}{\begingroup\sffamily
\setcounter{logpnumi}{0}%
\begin{tabular}{>{\stepcounter{logpnumi}\number\value{logpnumi}.}rll}}{\end{tabular}
\endgroup}
\newenvironment{SubTable}{\begin{tabular}[t]{@{}>{%
\ifnum\value{logpnumii}<1
\else
\the\numexpr\value{logpnumi}+1\relax.\number\value{logpnumii}
\fi
\stepcounter{logpnumii}
}lll}}
{\end{tabular}\setcounter{logpnumii}{0}}
\begin{document}
\begin{LogProof}
& $\lnot s\to r$ & Given\\
& $(r\lor p)\to q$ & Given\\
& \begin{SubTable}
$r\to q$ \\
& $\lnot s$ & Assumption\\
& $r$ & MP4.1
\end{SubTable} & $\land$ Elim:2\\
& \begin{SubTable}
$\lnot s\to q$ \\
& $s$ & Assumption\\
& $s\to(p\land q)$ & Given
\end{SubTable} & Direct proof rule\\
& $s\to q$ & [Direct proof rule]\\
\end{LogProof}
\end{document}

You can redefine the enumii numbering as an expression which takes an increment of the previous enumi number. Note that the argument of \numexpr should be ended with \relax. THis will be gobbled by \numexpr to ensure that it doesn't scan further ahead for more numbers.

\documentclass{article}

\renewcommand{\labelenumii}{\theenumii}
\renewcommand*\theenumii{\the\numexpr(\value{enumi}+1)\relax.\arabic{enumii}}

\begin{document}
\begin{enumerate}
\item First
\begin{enumerate}
\item Second
\item Third
\end{enumerate}
\item Fourth
\item Fifth
\end{enumerate}
\end{document}