How to create a proof tree with LaTeX?

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{equation*}
  S_1 \mathbf{R_5}
  \begin{cases}
    S_2 \mathbf{R_2} 
      \begin{cases}
        S_4 \mathbf{R_1} & \\
        S_5 \mathbf{R_3} & S_6 \mathbf{R_4}
      \end{cases}  \\
    S_3 \mathbf{R_6}
  \end{cases}
\end{equation*}

\end{document}

enter image description here


I suggest to define the command

\infer{conclusion}{premise1\\premise2\\...}

as

\newcommand\infer[2]{#1\left\{\begin{array}{@{}l@{}}#2\end{array}\right.}

Moreover, we use the abbreviation

\newcommand\claim[2]{S_{#1}\;\mathbf{R}_{#2}}

to typeset the proof items.

enter image description here

\documentclass{article}
\newcommand\infer[2]{#1\left\{\begin{array}{@{}l@{}}#2\end{array}\right.}
\newcommand\claim[2]{S_{#1}\;\mathbf{R}_{#2}}
\begin{document}
\[\infer
    {\claim15}% from
    {\infer
       {\claim22}% from
       {\claim41
       \\% and
        \claim53\quad\claim64
       }
    \\% and
     \claim36
    }
\]
\end{document}

\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\DeclareMathOperator{\bfR}{\mathbf{R}}

\begin{document}
  \begin{equation*}
S_1 \bfR_5\begin{cases}
              S_2  \bfR_2 & \begin{cases} 
                        S_4 \bfR_1 & \\
                        & \\
                        S_5 \bfR_3 & \quad S_6 \bfR_4
                \end{cases} \\
              S_3 \bfR_6 &
      \end{cases}
  \end{equation*}
\end{document}

enter image description here