0

Can I ask how to get the following code to compile correctly.

\documentclass[12pt]{amsart}
\usepackage{mathtools}

\begin{document}

\begin{align}
    \phantom{$\implies$}
    &\begin{aligned}
     \mathllap{ } &= $\vdash \Box_{N} (\forall k \phi(k))$\\
     \end{aligned}\\
    &\begin{aligned}
     \mathllap{$\implies$} &= $\vdash \forall k \Box_{C+2N+\mathrm{log}_{2} \hspace{0.1 cm} k} \phi(k)$\\
     \mathllap{$\implies$) &= $\vdash \forall k \Box_{\mathcal{O}\mathrm{log}_{2} \hspace{0.1 cm} k} \phi(k)$\\
     \end{aligned}
\end{align}

\end{document}
1
  • What is the reasoning behind the \phantom and the \mathllap's? They seem irrelevant
    – daleif
    Jan 10, 2023 at 12:21

3 Answers 3

1

align is typeset in math mode, so using $ inside it is wrong (and also in the argument to \mathllap.

There are strange equals signs that I guess are due to a misunderstanding. In align, & denotes a point of alignment (the separation for columns, actually), which is often followed by =, but not necessarily.

I present three realizations, each without \implies. In the third one, the main block is centered due to \mathllap, but it doesn't seem really important (just compare the outputs). I recommend \Rightarrow, which is less prominent.

Final notes: \log is the right command to use, not \mathrm{log}; I also added parentheses around the argument to \mathcal{O}; using \, after \forall <variable> is likely better.

\documentclass[12pt]{amsart}
\usepackage{mathtools}

\begin{document}

\begin{align}
&\vdash \Box_{N} (\forall k \, \phi(k)) \\
\Longrightarrow{}
&\vdash \forall k \, \Box_{C+2N+\log_{2}k} \phi(k) \\
\Longrightarrow{}
&\vdash \forall k \, \Box_{\mathcal{O}(\log_{2} k)} \phi(k) 
\end{align}

\begin{align}
&\vdash \Box_{N} (\forall k \, \phi(k)) \\
\Rightarrow{}
&\vdash \forall k \, \Box_{C+2N+\log_{2}k} \phi(k) \\
\Rightarrow{}
&\vdash \forall k \, \Box_{\mathcal{O}(\log_{2} k)} \phi(k) 
\end{align}

\begin{align}
&\vdash \Box_{N} (\forall k \, \phi(k)) \\
\mathllap{\Rightarrow{}}
&\vdash \forall k \, \Box_{C+2N+\log_{2}k} \phi(k) \\
\mathllap{\Rightarrow{}}
&\vdash \forall k \, \Box_{\mathcal{O}(\log_{2} k)} \phi(k) 
\end{align}

\end{document}

enter image description here

2

I've just cleared the errors only, not checking the output, hence the output should be as you wish:

\documentclass[12pt]{amsart}
\usepackage{mathtools}

\begin{document}

\begin{align}
    \phantom{\implies}
    &\begin{aligned}
    \mathllap{ } &= \vdash \Box_{N} (\forall k \phi(k))
     \end{aligned}\\
    &\begin{aligned}
     \mathllap{\implies} &= \vdash \forall k \Box_{C+2N+\log_{2} k} \phi(k)\\
     \mathllap{\implies} &= \vdash \forall k \Box_{\mathcal{O}\log_{2}  k} \phi(k)
     \end{aligned}
\end{align}

\end{document}
3
  • 2
    Might be an idea to fix \mathrm{log} as well and there is no need for the last \\
    – daleif
    Jan 10, 2023 at 12:19
  • 1
    @daleif Have updated, thanks, if any further change needs, please feel free to modify
    – MadyYuvi
    Jan 10, 2023 at 12:39
  • 1
    I removed the \hspace as \log gives proper spacing.
    – daleif
    Jan 10, 2023 at 12:57
1

I'm not sure if this is your desired output, but it seems you are misusing the align environment.

enter image description here

\documentclass[12pt]{amsart}

\begin{document}

\begin{align}
 &= \vdash \Box_{N} (\forall k \phi(k))\\
\implies &= \vdash \forall k \Box_{C+2N+\log_{2} k} \phi(k)\\
\implies &= \vdash \forall k \Box_{\mathcal{O}\log_{2} k} \phi(k)
\end{align}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .