# A typography challenge from over a hundred years ago

I am a newbie in LaTeX. I am now typesetting the formal proof from Begriffsschrift by Frege, which look like this:

As seen in the picture, I decide to put all the elements of the proof into a 3x3 table. Here is my code:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[a4paper, hmargin=1cm, tmargin=1cm, bmargin=2cm]{geometry}
\usepackage{array, amsmath, amssymb, grundgesetze}

%set up counter

%set up command
\newcommand{\MP}{\noindent\rule{3cm}{0.5pt}}
\newcommand{\ThNum}[1]{\multicolumn{2}{l}{#1}\\}

%set up environment
\newenvironment{Frege}
{\begin{tabular}{lcr}}{\end{tabular}}
\newenvironment{Sub}
{\begin{tabular}{r|l}}{\end{tabular}}
\newenvironment{Begriff}
{\begin{minipage}{\linewidth}}{\end{minipage}}

\begin{document}
\begin{Frege}
\begin{Sub}
\ThNum{1}
$q$ &
\setlength{\GGlinewidth}{10pt}\GGconditional{\GGterm{q}}{\GGterm{p}}\\
$p$ &
\setlength{\GGlinewidth}{10pt}\GGconditional{\GGterm{p}}
{\GGconditional{\GGterm{q}}{\GGterm{p}}}\\
\end{Sub}
&
\begin{Begriff}
\setlength{\GGlinewidth}{10pt}\GGjudge\GGconditional{\GGterm{p}}
{\GGconditional{\GGterm{q}}{\GGterm{p}}}
\end{Begriff}
& \\
12 & \MP &\\
\end{Frege}

\end{document}


I use the macro grundgesetze to present the Frege's notation. I meet four problems:

1. The first line of the minor premise and the number of it doesn't align on the same line. How can I make it is?

2. I put all the substitutions in a table in order to take the advantage of inserting a vertical line easily. But the disadvantage of it is all the content in table are being too small in size. How can I fix it? Or is there any other method to insert a vertical line easily?

3. The cell with the number of major premise suddenly expands and ruins all my arrangement. What's wrong with it? And how can I fix it?

4. I have no idea on how to put the number of conclusion (new theorem) in the exact location in cell. Would you mind give me some suggestion?

P.S. The current outcome after compling: