Here is a proof in Latex, which renders like so:
I'm fairly pleased with the result, but I wish there were a way to turn the (1)
and (2)
into right-aligned elements instead of having to be manually written in.
Here is the source code for reference:
\begin{proof}[Proof.]
Assumption ($\neg S$): $\sqrt{2}$ is rational.
\begin{align*}
\sqrt{2} &= \frac{a}{b} \text{ $a, b$ in reduced form, $a, b \in \Z$, gcd($a, b$) = 1} \\
2 &= \frac{a^{2}}{b^{2}} \\
2b^{2} &= a^{2}
\end{align*}
(1) Since $a^{2} = 2b^{2}$, can say $a^{2}$ is even. With that, $a = 2k$ for $k in \Z$. Then:
\begin{align*}
2b^{2} &= (2k)^{2} \\
2b^{2} &= 4k^{2} \\
b^{2} &= 2k^{2}
\end{align*}
(2) Similarly, since $b^{2} = 2k^{2}$, can say that $b^{2}$ (and $b$) is even.
Given (1) and (2), that both $a, b$ are even, then gcd($a, b$) $\geq$ 2.
\mathcom{Contradiction: gcd($a, b$) $\neq$ 1 when gcd($a, b$) $\geq$ 2.}
$\neg S$ ($\sqrt{2}$ is rational) is clearly false; because of this, $S$ must be true.
\[\therefore \sqrt{2} \text{ is irrational.}\]
\end{proof}
A possible idea I had was to use \gather
environments to define those statements and wrap the meddling align*
s within them, but as I had assumed, the spacing did not turn out very well, though I was able to get my line numbers to work.
Source code for the possible workaround:
\begin{gather}
\text{Statement} \\
\begin{align*}
2b^{2} &= (2k)^{2} \\
2b^{2} &= 4k^{2} \\
b^{2} &= 2k^{2}
\end{align*} \\
\text{Another statement}
\end{gather}
I then read up a little more and found out about aligned
, so I replied align*
with aligned
. It fixed the spacing from align*
but created a new issue - the aligned
block was numbered, but I don't want it to be numbered.
Is there a way to work around the meddling align*
environments so that it doesn't space according to the gather
environments and have it so that it doesn't end up being added in as another numbered statement as with aligned
? Thanks!
\mathcom
defined?\mathcom
is defined as{{\centering\small{{'textinput'\par}}}
where 'textinput' is where the text goes.gcd($a, b$) $\geq$ 2
, please consider inputting$\gcd(a, b) \geq 2$
.