From: Christoph Fuerst Date: Sun, 2 Apr 2017 18:56:39 +0000 (+0200) Subject: Added reasoning for z X-Git-Url: http://git.risc.jku.at/gitweb/?a=commitdiff_plain;h=ec17721e12a6245911eb991d00b7a56f87b14ad9;p=cfuerst%2Fformal-numbers.git Added reasoning for z --- diff --git a/report/formal.pdf b/report/formal.pdf index a3781aa..8974510 100644 Binary files a/report/formal.pdf and b/report/formal.pdf differ diff --git a/report/formal.tex b/report/formal.tex index de6e576..ab315e5 100644 --- a/report/formal.tex +++ b/report/formal.tex @@ -347,10 +347,10 @@ $y = \pm \sqrt{x}$.\\ Computing the \emph{integer-square-root} amounts to the following: Given a non-negative integer $a\in\mathbb{N}^+$, usually its square root is either an integer or irrational. The integer-square-root is defined as the non-negative integer $x\in\mathbb{N}^+$ that fulfills $x\leq \sqrt{a} a$ and we terminate the algorithm with -$x^2\leq a$ (as it holds in each step of the loop), and we conclude +as claimed. Similar, reasoning for $z'$ we obtain +$$ +z' = 2\cdot x' + 1 \Leftrightarrow z+2 = 2\cdot (x+1) + 1 = (2x + 1) + 2 +\Leftrightarrow z = 2x + 1. +$$ + +After finitely many iterations, we have $y > a$ and we terminate the algorithm with +$x^2\leq a$ (as it holds in each step of the loop), and we conclude $$ y > a \Leftrightarrow (x^2+z) > a \Leftrightarrow x^2+2x+1 > a \Leftrightarrow (x+1)^2 > a, $$ @@ -417,7 +423,7 @@ hence we have shown $x^2\leq a < (x+1)^2$, and taking square roots shows the cla % stepnumber=1, % the step between two line-numbers. If it's 1, each line will be numbered % tabsize=2, % sets default tabsize to 2 spaces % } -% +% % {\tiny \lstinputlisting{../src/primefactors.cpp}} \begin{thebibliography}{9}