# Shorten scope line in LPLFitch proof

So I'm trying to typeset Fitch-style proofs. The systems I'm using doesn't require there to be any line after the end of a subproof. LPLFitch seems to assume something like that, though, since it always adds a line beneath the subproof -- extending the main vertical scope bar.

The MWE:

\documentclass[border=1cm]{standalone}
\usepackage{lplfitch}
\usepackage{amsmath}
\begin{document}

\fitchprf{
\pline[1.]{\exists x \forall y Rxy}[Pr.]\\
\pline[2.]{\forall x (\exists y Ryx \rightarrow Rxx)}[Pr.]\\
\pline[3.]{\text{SHOW: } \forall x Rxx}[UD]}{
\subproof{\pline[4.]{\text{SHOW: } Raa}[DD]}{
\pline[5.]{\forall y Rby}[1, $\exists$O]\\
\pline[6.]{Rba}[5, $\forall$O]\\
\pline[7.]{\exists y Rya \rightarrow Raa}[2, $\forall$O]\\
\pline[8.]{\exists y Rya}[6, $\exists$I]\\
\pline[9.]{Raa}[7,8, $\rightarrow$O]
}
}
\end{document}


which produces the following:

How can I shorten the outer vertical scope line to end at line 9, rather than extend one line further?

## Update:

Hacked together solution converted to answer.

• Are you saying that the rule for introducing the universal quantifier doesn't actually require it be introduced explicitly? That seems like a very confusing system for students: usually you tell them that they must get back to only having the single scope line in order to complete the proof. And the lines to justify the introduction of the universal quantifier, for example, get explicitly listed, just as the justifications for other lines do. (I've only ever seen this kind of system used in teaching, which is why I'm assuming that's the applicable context.) I realise this is off-topic.
– cfr
Aug 30 '16 at 22:25
• @cfr Yea, I'm also not too crazy about this style of Fitch-like natural deduction proofs. It derives from Kalish and Montague's approach in their Logic: Techniques of Formal Reasoning (though that's not the book I'm using). No choice in book, unfortunately. Aug 30 '16 at 22:49
• @cfr The way this sort of system works is that the SHOW lines are the conclusions of the various subproofs. Once you close out a proof you're meant to strike out the "SHOW" on the line that heads the (sub)proof. A crossed-out "SHOW" means that the formula on that line can be freely used in further inferences (since any assumptions that formula depended on have been discharged). Aug 30 '16 at 22:51
• @cfr I didn't represent this here, but each "SHOW" should be crossed out since the proofs they head have completed. Having every "SHOW" crossed out is the equivalent of "[getting] back to only having the single scope line" in this sort of system. I think that's kind of a wash, though I do share your preference for the more orthodox Fitch-style proofs. Aug 30 '16 at 22:52
• Thanks for the explanation ;). I think it is clearer with the boxed proofs of K&M, though. Adding the bit about crossing-out the show helps a lot, though. It just looked very unfinished. I didn't mean an indirect proof. I just meant there as no explicit (visible) indicator that the SHOW had ever actually happened. The reader seemed to need to examine the proof to see if the author had done that, whereas I'd expect the author to claim it explicitly. But crossing-out the SHOW obviously is explicit, so it makes more sense. (Sorry - this isn't getting your question answered!)
– cfr
Aug 31 '16 at 0:20

I've been able to hack together a solution to this particular case with the following:

\documentclass[border=1cm]{standalone}
\usepackage{lplfitch}
\usepackage{amsmath}

\newcommand*{\fitchprfalt}[2]{%
\hspace*{.35em}%
\begin{tabular}[t]{|p{0pt}@{}p{\fitchprfwidth}@{\hspace*{\fitchsep}}l}
\multicolumn{3}{@{}l@{}}{\ }\\[-2.35ex] #1\\
\ \\[-2.5ex] \cline{1-1}\\[-2ex]
#2 \\ \multicolumn{3}{@{}l@{}} \ \\[-5.5ex]
\end{tabular}
}
\newcommand*{\subproofalt}[2]{&\fitchprfalt{#1}{#2}\\}

\begin{document}

\fitchprf{
\pline[1.]{\exists x \forall y Rxy}[Pr.]\\
\pline[2.]{\forall x (\exists y Ryx \rightarrow Rxx)}[Pr.]\\
\pline[3.]{\text{SHOW: } \forall x Rxx}[UD]}{
\subproofalt{\pline[4.]{\text{SHOW: } Raa}[DD]}{
\pline[5.]{\forall y Rby}[1, $\exists$O]\\
\pline[6.]{Rba}[5, $\forall$O]\\
\pline[7.]{\exists y Rya \rightarrow Raa}[2, $\forall$O]\\
\pline[8.]{\exists y Rya}[6, $\exists$I]\\
\pline[9.]{Raa}[7,8, $\rightarrow$O]
}
}
\end{document}


Which resulted in:

Much better! (Although the outer line still looks just the tiniest bit longer to me, but that might just be me seeing things.)

Essentially, what I did was redefine the subproof command so that it removed more space. I changed this line:

#2 \\ \multicolumn{3}{@{}l@{}} \ \\[-5.5ex]


The original value at the end was -2.5ex.

The hack is surprisingly robust, I haven't had to tweak it for individual proofs yet. I don't quite understand why "-5.5ex" was the magic number, though.