<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://lem12.uksw.edu.pl/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pl">
		<id>https://lem12.uksw.edu.pl/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=AndrzejSalwicki</id>
		<title>Lem - Wkład użytkownika [pl]</title>
		<link rel="self" type="application/atom+xml" href="https://lem12.uksw.edu.pl/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=AndrzejSalwicki"/>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Specjalna:Wk%C5%82ad/AndrzejSalwicki"/>
		<updated>2026-04-04T01:40:35Z</updated>
		<subtitle>Wkład użytkownika</subtitle>
		<generator>MediaWiki 1.23.8</generator>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2026-04-02T08:16:39Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że [http://arxiv.org/abs/2310.13035 dowód] hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
Oto wersja złożona do druku [https://lem12.uksw.edu.pl/images/6/69/CollatzConjecturebecomesTheorem2026-03-15.pdf]&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
I odrzucona. &amp;lt;br /&amp;gt;&lt;br /&gt;
Artykuł złożono '''15 marca 2026'''.&amp;lt;br /&amp;gt;&lt;br /&gt;
Redaktor naczeelny wyznaczył redaktora odpowiedzialnego za zasiegniecie opinii i podjęcie decyzji 16 marca o godzinie 20:52.&amp;lt;br /&amp;gt;&lt;br /&gt;
Redaktor odpowiedzialny podjął decyzję '''17 marca 2026 o godzinie 12:17'''.&amp;lt;br /&amp;gt;&lt;br /&gt;
Oto cała recenzja i decyzja&amp;lt;br /&amp;gt;&lt;br /&gt;
''Unfortunately, we cannot accept it for publication.  The paper belongs to computer science and not mathematics. So the proper venue for its publication should be a computer science journal. It seems to me that the bare argument for the Collatz conjecture presented in your paper is not very complicated (this does not mean that I verified it). Why not extract it, omitting the programming jargon? Then it would be more accessible to mathematicians.''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture&lt;br /&gt;
''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' &lt;br /&gt;
is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;   &amp;lt;br /&amp;gt;&lt;br /&gt;
  or by another, equivalent formula with iteration quantifier instead of  '''while''' &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
There is no finite, traditional proof the following  theorem . &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic.&amp;lt;br /&amp;gt; &lt;br /&gt;
 end of Abstract 01/10/2025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Have a look==&lt;br /&gt;
&amp;lt;math&amp;gt;			\begin{figure}	&lt;br /&gt;
						\resizebox{\textwidth}{!}{ &lt;br /&gt;
							{\footnotesize  \begin{tikzcd}[ampersand replacement=\&amp;amp;,scale =0.15, column sep=normal,row sep=0.7cm,arrows=&amp;lt;-]&lt;br /&gt;
									%	 	 [arrows=&amp;lt;-]&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {		$ \frac{W_{41}}{&amp;gt;51} $};    \&amp;amp; \color{red}27  \&amp;amp;\cdots \\	\&amp;amp;  	\dots           \\&lt;br /&gt;
									%  		\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_{40}}{26} $};    &amp;amp;   &amp;amp;\cdots \\		\dots &amp;amp; \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_9}{26} $};    \&amp;amp; 121 \&amp;amp; 89  \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_8}{26} $};    \&amp;amp; 33 \&amp;amp; 91    \&amp;amp; 67 \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_7}{26} $};    \&amp;amp; 25 \&amp;amp; 49 \&amp;amp;\color{red}51    \&amp;amp; 101 \&amp;amp;197 \&amp;amp;205\&amp;amp;\cdots \\&lt;br /&gt;
									%								\dots \\	&lt;br /&gt;
									\node[circle,fill=brown!15,align=center,text=black]  {$ \frac{W_6}{24} $}; \&amp;amp; \color{red}9\&amp;amp; 19  \&amp;amp;37 \&amp;amp; 77  \&amp;amp;325   \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_5}{8} $}; \&amp;amp; 7\arrow[u]\arrow[urr] \&amp;amp;\color{red}15   \&amp;amp;29\arrow[ul]\arrow[ur] \&amp;amp; 61\arrow[ur]    \&amp;amp; \cdots \\		&lt;br /&gt;
									\node[circle,fill=blue!30,align=center,text=black]  {$ \frac{W_4}{6} $}; \&amp;amp; 11\arrow[u]\arrow[urr] \&amp;amp; 23\arrow[u]\arrow[urr]  \&amp;amp;\color{red}45 \&amp;amp;\color{red}93  \&amp;amp; 181  \&amp;amp; 373 \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=yellow!30,align=center,text=black]  {$ \frac{W_3}{6} $}; \&amp;amp;17\arrow[urr] \arrow[u]\arrow[urrrr] \&amp;amp; 35\arrow[u] \arrow[urr] \arrow[urrrr] \&amp;amp;  \color{red}69  \&amp;amp;  \color{red}75  \&amp;amp;  \color{red}141\&amp;amp; &lt;br /&gt;
									151  \&amp;amp;277 \&amp;amp; 301 \&amp;amp;\cdots \\&lt;br /&gt;
									\node[circle,fill=gray!30,align=center,text=black]  {$ \frac{W_2}{6} $ }; \&amp;amp;\color{red}3 \&amp;amp; 13\arrow[ul]\arrow[ur]\arrow[urrrrr]\&amp;amp; 53\arrow[ul] \arrow[urr]\&amp;amp; 113\arrow[u] \arrow[urrrr]\&amp;amp; \color{red}213 \&amp;amp; 227\arrow[u] \&amp;amp; \color{red}453  \&amp;amp; 853 \&amp;amp;\color{red}909 \&amp;amp; \cdots 	 \\&lt;br /&gt;
									\node  [circle,fill=red!30,align=center,text=black]  {$ \frac{W_1}{2} $ }; \&amp;amp; 5\arrow[u]\arrow[ur]\arrow[urr]\arrow[urrrr]\&amp;amp;\color{red}21 \&amp;amp; 85\arrow[ur]\arrow[urrrr,near end] \&amp;amp; 341\arrow[urr] \arrow[urrrrr] \&amp;amp; \color{red}1365   \&amp;amp; 5461 \&amp;amp;\cdots \\	   &lt;br /&gt;
									\node  [circle,fill=green,align=center,text=black]  {$ \frac{W_0}{2} $ }; \&amp;amp; \&amp;amp; \&amp;amp; 1\arrow[ull] \arrow[ul]\arrow[u]\arrow[ur] \arrow[urr] \arrow[urrr]    \\&lt;br /&gt;
									%	%\end{scriptsize}  &lt;br /&gt;
							\end{tikzcd}   }&lt;br /&gt;
						} &lt;br /&gt;
						\caption{F \textsc{Ilustracja} fragment grafu $\mathcal{F} $} \label{grafF}&lt;br /&gt;
					\end{figure}  &lt;br /&gt;
	&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2026-04-02T08:12:58Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że [http://arxiv.org/abs/2310.13035 dowód] hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
Oto wersja złożona do druku [https://lem12.uksw.edu.pl/images/6/69/CollatzConjecturebecomesTheorem2026-03-15.pdf]&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
I odrzucona. &amp;lt;br /&amp;gt;&lt;br /&gt;
Artykuł złożono '''15 marca 2026'''.&amp;lt;br /&amp;gt;&lt;br /&gt;
Redaktor naczeelny wyznaczył redaktora odpowiedzialnego za zasiegniecie opinii i podjęcie decyzji 16 marca o godzinie 20:52.&amp;lt;br /&amp;gt;&lt;br /&gt;
Redaktor odpowiedzialny podjął decyzję '''17 marca 2026 o godzinie 12:17'''.&amp;lt;br /&amp;gt;&lt;br /&gt;
Oto cała recenzja i decyzja&amp;lt;br /&amp;gt;&lt;br /&gt;
''Unfortunately, we cannot accept it for publication.  The paper belongs to computer science and not mathematics. So the proper venue for its publication should be a computer science journal. It seems to me that the bare argument for the Collatz conjecture presented in your paper is not very complicated (this does not mean that I verified it). Why not extract it, omitting the programming jargon? Then it would be more accessible to mathematicians.''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture&lt;br /&gt;
''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' &lt;br /&gt;
is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;   &amp;lt;br /&amp;gt;&lt;br /&gt;
  or by another, equivalent formula &amp;lt;br /&amp;gt;&lt;br /&gt;
  &amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						\{m:=n \div 2^{\kappa(n)} \} \bigcp \left\lbrace \begin{array}{l}&lt;br /&gt;
						\mathbf{if}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{then}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{fi} 	\end{array}\right\rbrace 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic.&amp;lt;br /&amp;gt; &lt;br /&gt;
 end of Abstract 01/10/2025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Have a look==&lt;br /&gt;
&amp;lt;math&amp;gt;			\begin{figure}	&lt;br /&gt;
						\resizebox{\textwidth}{!}{ &lt;br /&gt;
							{\footnotesize  \begin{tikzcd}[ampersand replacement=\&amp;amp;,scale =0.15, column sep=normal,row sep=0.7cm,arrows=&amp;lt;-]&lt;br /&gt;
									%	 	 [arrows=&amp;lt;-]&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {		$ \frac{W_{41}}{&amp;gt;51} $};    \&amp;amp; \color{red}27  \&amp;amp;\cdots \\	\&amp;amp;  	\dots           \\&lt;br /&gt;
									%  		\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_{40}}{26} $};    &amp;amp;   &amp;amp;\cdots \\		\dots &amp;amp; \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_9}{26} $};    \&amp;amp; 121 \&amp;amp; 89  \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_8}{26} $};    \&amp;amp; 33 \&amp;amp; 91    \&amp;amp; 67 \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_7}{26} $};    \&amp;amp; 25 \&amp;amp; 49 \&amp;amp;\color{red}51    \&amp;amp; 101 \&amp;amp;197 \&amp;amp;205\&amp;amp;\cdots \\&lt;br /&gt;
									%								\dots \\	&lt;br /&gt;
									\node[circle,fill=brown!15,align=center,text=black]  {$ \frac{W_6}{24} $}; \&amp;amp; \color{red}9\&amp;amp; 19  \&amp;amp;37 \&amp;amp; 77  \&amp;amp;325   \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_5}{8} $}; \&amp;amp; 7\arrow[u]\arrow[urr] \&amp;amp;\color{red}15   \&amp;amp;29\arrow[ul]\arrow[ur] \&amp;amp; 61\arrow[ur]    \&amp;amp; \cdots \\		&lt;br /&gt;
									\node[circle,fill=blue!30,align=center,text=black]  {$ \frac{W_4}{6} $}; \&amp;amp; 11\arrow[u]\arrow[urr] \&amp;amp; 23\arrow[u]\arrow[urr]  \&amp;amp;\color{red}45 \&amp;amp;\color{red}93  \&amp;amp; 181  \&amp;amp; 373 \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=yellow!30,align=center,text=black]  {$ \frac{W_3}{6} $}; \&amp;amp;17\arrow[urr] \arrow[u]\arrow[urrrr] \&amp;amp; 35\arrow[u] \arrow[urr] \arrow[urrrr] \&amp;amp;  \color{red}69  \&amp;amp;  \color{red}75  \&amp;amp;  \color{red}141\&amp;amp; &lt;br /&gt;
									151  \&amp;amp;277 \&amp;amp; 301 \&amp;amp;\cdots \\&lt;br /&gt;
									\node[circle,fill=gray!30,align=center,text=black]  {$ \frac{W_2}{6} $ }; \&amp;amp;\color{red}3 \&amp;amp; 13\arrow[ul]\arrow[ur]\arrow[urrrrr]\&amp;amp; 53\arrow[ul] \arrow[urr]\&amp;amp; 113\arrow[u] \arrow[urrrr]\&amp;amp; \color{red}213 \&amp;amp; 227\arrow[u] \&amp;amp; \color{red}453  \&amp;amp; 853 \&amp;amp;\color{red}909 \&amp;amp; \cdots 	 \\&lt;br /&gt;
									\node  [circle,fill=red!30,align=center,text=black]  {$ \frac{W_1}{2} $ }; \&amp;amp; 5\arrow[u]\arrow[ur]\arrow[urr]\arrow[urrrr]\&amp;amp;\color{red}21 \&amp;amp; 85\arrow[ur]\arrow[urrrr,near end] \&amp;amp; 341\arrow[urr] \arrow[urrrrr] \&amp;amp; \color{red}1365   \&amp;amp; 5461 \&amp;amp;\cdots \\	   &lt;br /&gt;
									\node  [circle,fill=green,align=center,text=black]  {$ \frac{W_0}{2} $ }; \&amp;amp; \&amp;amp; \&amp;amp; 1\arrow[ull] \arrow[ul]\arrow[u]\arrow[ur] \arrow[urr] \arrow[urrr]    \\&lt;br /&gt;
									%	%\end{scriptsize}  &lt;br /&gt;
							\end{tikzcd}   }&lt;br /&gt;
						} &lt;br /&gt;
						\caption{F \textsc{Ilustracja} fragment grafu $\mathcal{F} $} \label{grafF}&lt;br /&gt;
					\end{figure}  &lt;br /&gt;
	&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2026-04-02T08:07:08Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że [http://arxiv.org/abs/2310.13035 dowód] hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
Oto wersja złożona do druku [https://lem12.uksw.edu.pl/images/6/69/CollatzConjecturebecomesTheorem2026-03-15.pdf]&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
I odrzucona. &amp;lt;br /&amp;gt;&lt;br /&gt;
Artykuł złożono '''15 marca 2026'''.&amp;lt;br /&amp;gt;&lt;br /&gt;
Redaktor naczeelny wyznaczył redaktora odpowiedzialnego za zasiegniecie opinii i podjęcie decyzji 16 marca o godzinie 20:52.&amp;lt;br /&amp;gt;&lt;br /&gt;
Redaktor odpowiedzialny podjął decyzję '''17 marca 2026 o godzinie 12:17'''.&amp;lt;br /&amp;gt;&lt;br /&gt;
Oto cała recenzja i decyzja&amp;lt;br /&amp;gt;&lt;br /&gt;
''Unfortunately, we cannot accept it for publication.  The paper belongs to computer science and not mathematics. So the proper venue for its publication should be a computer science journal. It seems to me that the bare argument for the Collatz conjecture presented in your paper is not very complicated (this does not mean that I verified it). Why not extract it, omitting the programming jargon? Then it would be more accessible to mathematicians.''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture&lt;br /&gt;
''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' &lt;br /&gt;
is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;   &amp;lt;br /&amp;gt;&lt;br /&gt;
  or by another, equivalent formula &amp;lt;br /&amp;gt;&lt;br /&gt;
  &amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						\{ m:=n \div 2^{\kappa(n)}  \} \bigcup \left\lbrace \begin{array}{l}&lt;br /&gt;
						\mathbf{if}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{then}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{fi} 	\end{array}\right\rbrace		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic.&amp;lt;br /&amp;gt; &lt;br /&gt;
 end of Abstract 01/10/2025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Have a look==&lt;br /&gt;
&amp;lt;math&amp;gt;			\begin{figure}	&lt;br /&gt;
						\resizebox{\textwidth}{!}{ &lt;br /&gt;
							{\footnotesize  \begin{tikzcd}[ampersand replacement=\&amp;amp;,scale =0.15, column sep=normal,row sep=0.7cm,arrows=&amp;lt;-]&lt;br /&gt;
									%	 	 [arrows=&amp;lt;-]&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {		$ \frac{W_{41}}{&amp;gt;51} $};    \&amp;amp; \color{red}27  \&amp;amp;\cdots \\	\&amp;amp;  	\dots           \\&lt;br /&gt;
									%  		\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_{40}}{26} $};    &amp;amp;   &amp;amp;\cdots \\		\dots &amp;amp; \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_9}{26} $};    \&amp;amp; 121 \&amp;amp; 89  \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_8}{26} $};    \&amp;amp; 33 \&amp;amp; 91    \&amp;amp; 67 \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_7}{26} $};    \&amp;amp; 25 \&amp;amp; 49 \&amp;amp;\color{red}51    \&amp;amp; 101 \&amp;amp;197 \&amp;amp;205\&amp;amp;\cdots \\&lt;br /&gt;
									%								\dots \\	&lt;br /&gt;
									\node[circle,fill=brown!15,align=center,text=black]  {$ \frac{W_6}{24} $}; \&amp;amp; \color{red}9\&amp;amp; 19  \&amp;amp;37 \&amp;amp; 77  \&amp;amp;325   \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_5}{8} $}; \&amp;amp; 7\arrow[u]\arrow[urr] \&amp;amp;\color{red}15   \&amp;amp;29\arrow[ul]\arrow[ur] \&amp;amp; 61\arrow[ur]    \&amp;amp; \cdots \\		&lt;br /&gt;
									\node[circle,fill=blue!30,align=center,text=black]  {$ \frac{W_4}{6} $}; \&amp;amp; 11\arrow[u]\arrow[urr] \&amp;amp; 23\arrow[u]\arrow[urr]  \&amp;amp;\color{red}45 \&amp;amp;\color{red}93  \&amp;amp; 181  \&amp;amp; 373 \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=yellow!30,align=center,text=black]  {$ \frac{W_3}{6} $}; \&amp;amp;17\arrow[urr] \arrow[u]\arrow[urrrr] \&amp;amp; 35\arrow[u] \arrow[urr] \arrow[urrrr] \&amp;amp;  \color{red}69  \&amp;amp;  \color{red}75  \&amp;amp;  \color{red}141\&amp;amp; &lt;br /&gt;
									151  \&amp;amp;277 \&amp;amp; 301 \&amp;amp;\cdots \\&lt;br /&gt;
									\node[circle,fill=gray!30,align=center,text=black]  {$ \frac{W_2}{6} $ }; \&amp;amp;\color{red}3 \&amp;amp; 13\arrow[ul]\arrow[ur]\arrow[urrrrr]\&amp;amp; 53\arrow[ul] \arrow[urr]\&amp;amp; 113\arrow[u] \arrow[urrrr]\&amp;amp; \color{red}213 \&amp;amp; 227\arrow[u] \&amp;amp; \color{red}453  \&amp;amp; 853 \&amp;amp;\color{red}909 \&amp;amp; \cdots 	 \\&lt;br /&gt;
									\node  [circle,fill=red!30,align=center,text=black]  {$ \frac{W_1}{2} $ }; \&amp;amp; 5\arrow[u]\arrow[ur]\arrow[urr]\arrow[urrrr]\&amp;amp;\color{red}21 \&amp;amp; 85\arrow[ur]\arrow[urrrr,near end] \&amp;amp; 341\arrow[urr] \arrow[urrrrr] \&amp;amp; \color{red}1365   \&amp;amp; 5461 \&amp;amp;\cdots \\	   &lt;br /&gt;
									\node  [circle,fill=green,align=center,text=black]  {$ \frac{W_0}{2} $ }; \&amp;amp; \&amp;amp; \&amp;amp; 1\arrow[ull] \arrow[ul]\arrow[u]\arrow[ur] \arrow[urr] \arrow[urrr]    \\&lt;br /&gt;
									%	%\end{scriptsize}  &lt;br /&gt;
							\end{tikzcd}   }&lt;br /&gt;
						} &lt;br /&gt;
						\caption{F \textsc{Ilustracja} fragment grafu $\mathcal{F} $} \label{grafF}&lt;br /&gt;
					\end{figure}  &lt;br /&gt;
	&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2026-04-02T08:05:09Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że [http://arxiv.org/abs/2310.13035 dowód] hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
Oto wersja złożona do druku [https://lem12.uksw.edu.pl/images/6/69/CollatzConjecturebecomesTheorem2026-03-15.pdf]&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
I odrzucona. &amp;lt;br /&amp;gt;&lt;br /&gt;
Artykuł złożono '''15 marca 2026'''.&amp;lt;br /&amp;gt;&lt;br /&gt;
Redaktor naczeelny wyznaczył redaktora odpowiedzialnego za zasiegniecie opinii i podjęcie decyzji 16 marca o godzinie 20:52.&amp;lt;br /&amp;gt;&lt;br /&gt;
Redaktor odpowiedzialny podjął decyzję '''17 marca 2026 o godzinie 12:17'''.&amp;lt;br /&amp;gt;&lt;br /&gt;
Oto cała recenzja i decyzja&amp;lt;br /&amp;gt;&lt;br /&gt;
''Unfortunately, we cannot accept it for publication.  The paper belongs to computer science and not mathematics. So the proper venue for its publication should be a computer science journal. It seems to me that the bare argument for the Collatz conjecture presented in your paper is not very complicated (this does not mean that I verified it). Why not extract it, omitting the programming jargon? Then it would be more accessible to mathematicians.''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture&lt;br /&gt;
''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' &lt;br /&gt;
is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;   &amp;lt;br /&amp;gt;&lt;br /&gt;
  or by another, equivalent formula &amp;lt;br /&amp;gt;&lt;br /&gt;
  &amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbracket \begin{array}{l}&lt;br /&gt;
						\{ m:=n \div 2^{\kappa(n)}  \} \bigcup \left\lbrace \begin{array}{l}&lt;br /&gt;
						\mathbf{if}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{then}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{fi} 	\end{array}\right\rbracket		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic.&amp;lt;br /&amp;gt; &lt;br /&gt;
 end of Abstract 01/10/2025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Have a look==&lt;br /&gt;
&amp;lt;math&amp;gt;			\begin{figure}	&lt;br /&gt;
						\resizebox{\textwidth}{!}{ &lt;br /&gt;
							{\footnotesize  \begin{tikzcd}[ampersand replacement=\&amp;amp;,scale =0.15, column sep=normal,row sep=0.7cm,arrows=&amp;lt;-]&lt;br /&gt;
									%	 	 [arrows=&amp;lt;-]&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {		$ \frac{W_{41}}{&amp;gt;51} $};    \&amp;amp; \color{red}27  \&amp;amp;\cdots \\	\&amp;amp;  	\dots           \\&lt;br /&gt;
									%  		\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_{40}}{26} $};    &amp;amp;   &amp;amp;\cdots \\		\dots &amp;amp; \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_9}{26} $};    \&amp;amp; 121 \&amp;amp; 89  \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_8}{26} $};    \&amp;amp; 33 \&amp;amp; 91    \&amp;amp; 67 \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_7}{26} $};    \&amp;amp; 25 \&amp;amp; 49 \&amp;amp;\color{red}51    \&amp;amp; 101 \&amp;amp;197 \&amp;amp;205\&amp;amp;\cdots \\&lt;br /&gt;
									%								\dots \\	&lt;br /&gt;
									\node[circle,fill=brown!15,align=center,text=black]  {$ \frac{W_6}{24} $}; \&amp;amp; \color{red}9\&amp;amp; 19  \&amp;amp;37 \&amp;amp; 77  \&amp;amp;325   \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_5}{8} $}; \&amp;amp; 7\arrow[u]\arrow[urr] \&amp;amp;\color{red}15   \&amp;amp;29\arrow[ul]\arrow[ur] \&amp;amp; 61\arrow[ur]    \&amp;amp; \cdots \\		&lt;br /&gt;
									\node[circle,fill=blue!30,align=center,text=black]  {$ \frac{W_4}{6} $}; \&amp;amp; 11\arrow[u]\arrow[urr] \&amp;amp; 23\arrow[u]\arrow[urr]  \&amp;amp;\color{red}45 \&amp;amp;\color{red}93  \&amp;amp; 181  \&amp;amp; 373 \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=yellow!30,align=center,text=black]  {$ \frac{W_3}{6} $}; \&amp;amp;17\arrow[urr] \arrow[u]\arrow[urrrr] \&amp;amp; 35\arrow[u] \arrow[urr] \arrow[urrrr] \&amp;amp;  \color{red}69  \&amp;amp;  \color{red}75  \&amp;amp;  \color{red}141\&amp;amp; &lt;br /&gt;
									151  \&amp;amp;277 \&amp;amp; 301 \&amp;amp;\cdots \\&lt;br /&gt;
									\node[circle,fill=gray!30,align=center,text=black]  {$ \frac{W_2}{6} $ }; \&amp;amp;\color{red}3 \&amp;amp; 13\arrow[ul]\arrow[ur]\arrow[urrrrr]\&amp;amp; 53\arrow[ul] \arrow[urr]\&amp;amp; 113\arrow[u] \arrow[urrrr]\&amp;amp; \color{red}213 \&amp;amp; 227\arrow[u] \&amp;amp; \color{red}453  \&amp;amp; 853 \&amp;amp;\color{red}909 \&amp;amp; \cdots 	 \\&lt;br /&gt;
									\node  [circle,fill=red!30,align=center,text=black]  {$ \frac{W_1}{2} $ }; \&amp;amp; 5\arrow[u]\arrow[ur]\arrow[urr]\arrow[urrrr]\&amp;amp;\color{red}21 \&amp;amp; 85\arrow[ur]\arrow[urrrr,near end] \&amp;amp; 341\arrow[urr] \arrow[urrrrr] \&amp;amp; \color{red}1365   \&amp;amp; 5461 \&amp;amp;\cdots \\	   &lt;br /&gt;
									\node  [circle,fill=green,align=center,text=black]  {$ \frac{W_0}{2} $ }; \&amp;amp; \&amp;amp; \&amp;amp; 1\arrow[ull] \arrow[ul]\arrow[u]\arrow[ur] \arrow[urr] \arrow[urrr]    \\&lt;br /&gt;
									%	%\end{scriptsize}  &lt;br /&gt;
							\end{tikzcd}   }&lt;br /&gt;
						} &lt;br /&gt;
						\caption{F \textsc{Ilustracja} fragment grafu $\mathcal{F} $} \label{grafF}&lt;br /&gt;
					\end{figure}  &lt;br /&gt;
	&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2026-04-02T08:01:38Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że [http://arxiv.org/abs/2310.13035 dowód] hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
Oto wersja złożona do druku [https://lem12.uksw.edu.pl/images/6/69/CollatzConjecturebecomesTheorem2026-03-15.pdf]&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
I odrzucona. &amp;lt;br /&amp;gt;&lt;br /&gt;
Artykuł złożono '''15 marca 2026'''.&amp;lt;br /&amp;gt;&lt;br /&gt;
Redaktor naczeelny wyznaczył redaktora odpowiedzialnego za zasiegniecie opinii i podjęcie decyzji 16 marca o godzinie 20:52.&amp;lt;br /&amp;gt;&lt;br /&gt;
Redaktor odpowiedzialny podjął decyzję '''17 marca 2026 o godzinie 12:17'''.&amp;lt;br /&amp;gt;&lt;br /&gt;
Oto cała recenzja i decyzja&amp;lt;br /&amp;gt;&lt;br /&gt;
''Unfortunately, we cannot accept it for publication.  The paper belongs to computer science and not mathematics. So the proper venue for its publication should be a computer science journal. It seems to me that the bare argument for the Collatz conjecture presented in your paper is not very complicated (this does not mean that I verified it). Why not extract it, omitting the programming jargon? Then it would be more accessible to mathematicians.''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture&lt;br /&gt;
''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' &lt;br /&gt;
is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;   &amp;lt;br /&amp;gt;&lt;br /&gt;
  or by another, equivalent formula &amp;lt;br /&amp;gt;&lt;br /&gt;
  &amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left( \begin{array}{l}&lt;br /&gt;
						\{ m:=n \div 2^{\kappa(n)}  \} \bigcup \left\lbrace \begin{array}{l}&lt;br /&gt;
						\mathbf{if}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{then}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{fi} 	\end{array}\right) 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic.&amp;lt;br /&amp;gt; &lt;br /&gt;
 end of Abstract 01/10/2025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Have a look==&lt;br /&gt;
&amp;lt;math&amp;gt;			\begin{figure}	&lt;br /&gt;
						\resizebox{\textwidth}{!}{ &lt;br /&gt;
							{\footnotesize  \begin{tikzcd}[ampersand replacement=\&amp;amp;,scale =0.15, column sep=normal,row sep=0.7cm,arrows=&amp;lt;-]&lt;br /&gt;
									%	 	 [arrows=&amp;lt;-]&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {		$ \frac{W_{41}}{&amp;gt;51} $};    \&amp;amp; \color{red}27  \&amp;amp;\cdots \\	\&amp;amp;  	\dots           \\&lt;br /&gt;
									%  		\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_{40}}{26} $};    &amp;amp;   &amp;amp;\cdots \\		\dots &amp;amp; \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_9}{26} $};    \&amp;amp; 121 \&amp;amp; 89  \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_8}{26} $};    \&amp;amp; 33 \&amp;amp; 91    \&amp;amp; 67 \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_7}{26} $};    \&amp;amp; 25 \&amp;amp; 49 \&amp;amp;\color{red}51    \&amp;amp; 101 \&amp;amp;197 \&amp;amp;205\&amp;amp;\cdots \\&lt;br /&gt;
									%								\dots \\	&lt;br /&gt;
									\node[circle,fill=brown!15,align=center,text=black]  {$ \frac{W_6}{24} $}; \&amp;amp; \color{red}9\&amp;amp; 19  \&amp;amp;37 \&amp;amp; 77  \&amp;amp;325   \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_5}{8} $}; \&amp;amp; 7\arrow[u]\arrow[urr] \&amp;amp;\color{red}15   \&amp;amp;29\arrow[ul]\arrow[ur] \&amp;amp; 61\arrow[ur]    \&amp;amp; \cdots \\		&lt;br /&gt;
									\node[circle,fill=blue!30,align=center,text=black]  {$ \frac{W_4}{6} $}; \&amp;amp; 11\arrow[u]\arrow[urr] \&amp;amp; 23\arrow[u]\arrow[urr]  \&amp;amp;\color{red}45 \&amp;amp;\color{red}93  \&amp;amp; 181  \&amp;amp; 373 \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=yellow!30,align=center,text=black]  {$ \frac{W_3}{6} $}; \&amp;amp;17\arrow[urr] \arrow[u]\arrow[urrrr] \&amp;amp; 35\arrow[u] \arrow[urr] \arrow[urrrr] \&amp;amp;  \color{red}69  \&amp;amp;  \color{red}75  \&amp;amp;  \color{red}141\&amp;amp; &lt;br /&gt;
									151  \&amp;amp;277 \&amp;amp; 301 \&amp;amp;\cdots \\&lt;br /&gt;
									\node[circle,fill=gray!30,align=center,text=black]  {$ \frac{W_2}{6} $ }; \&amp;amp;\color{red}3 \&amp;amp; 13\arrow[ul]\arrow[ur]\arrow[urrrrr]\&amp;amp; 53\arrow[ul] \arrow[urr]\&amp;amp; 113\arrow[u] \arrow[urrrr]\&amp;amp; \color{red}213 \&amp;amp; 227\arrow[u] \&amp;amp; \color{red}453  \&amp;amp; 853 \&amp;amp;\color{red}909 \&amp;amp; \cdots 	 \\&lt;br /&gt;
									\node  [circle,fill=red!30,align=center,text=black]  {$ \frac{W_1}{2} $ }; \&amp;amp; 5\arrow[u]\arrow[ur]\arrow[urr]\arrow[urrrr]\&amp;amp;\color{red}21 \&amp;amp; 85\arrow[ur]\arrow[urrrr,near end] \&amp;amp; 341\arrow[urr] \arrow[urrrrr] \&amp;amp; \color{red}1365   \&amp;amp; 5461 \&amp;amp;\cdots \\	   &lt;br /&gt;
									\node  [circle,fill=green,align=center,text=black]  {$ \frac{W_0}{2} $ }; \&amp;amp; \&amp;amp; \&amp;amp; 1\arrow[ull] \arrow[ul]\arrow[u]\arrow[ur] \arrow[urr] \arrow[urrr]    \\&lt;br /&gt;
									%	%\end{scriptsize}  &lt;br /&gt;
							\end{tikzcd}   }&lt;br /&gt;
						} &lt;br /&gt;
						\caption{F \textsc{Ilustracja} fragment grafu $\mathcal{F} $} \label{grafF}&lt;br /&gt;
					\end{figure}  &lt;br /&gt;
	&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2026-04-02T07:57:54Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że [http://arxiv.org/abs/2310.13035 dowód] hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
Oto wersja złożona do druku [https://lem12.uksw.edu.pl/images/6/69/CollatzConjecturebecomesTheorem2026-03-15.pdf]&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
I odrzucona. &amp;lt;br /&amp;gt;&lt;br /&gt;
Artykuł złożono '''15 marca 2026'''.&amp;lt;br /&amp;gt;&lt;br /&gt;
Redaktor naczeelny wyznaczył redaktora odpowiedzialnego za zasiegniecie opinii i podjęcie decyzji 16 marca o godzinie 20:52.&amp;lt;br /&amp;gt;&lt;br /&gt;
Redaktor odpowiedzialny podjął decyzję '''17 marca 2026 o godzinie 12:17'''.&amp;lt;br /&amp;gt;&lt;br /&gt;
Oto cała recenzja i decyzja&amp;lt;br /&amp;gt;&lt;br /&gt;
''Unfortunately, we cannot accept it for publication.  The paper belongs to computer science and not mathematics. So the proper venue for its publication should be a computer science journal. It seems to me that the bare argument for the Collatz conjecture presented in your paper is not very complicated (this does not mean that I verified it). Why not extract it, omitting the programming jargon? Then it would be more accessible to mathematicians.''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture&lt;br /&gt;
''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' &lt;br /&gt;
is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;   or &amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						\{ m:=n \div 2^{\kappa(n)}  \} \bigcup \left\lbrace \begin{array}{l}&lt;br /&gt;
						\mathbf{if}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{then}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{fi} 	\end{array}\right\rbrace 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic.&amp;lt;br /&amp;gt; &lt;br /&gt;
 end of Abstract 01/10/2025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Have a look==&lt;br /&gt;
&amp;lt;math&amp;gt;			\begin{figure}	&lt;br /&gt;
						\resizebox{\textwidth}{!}{ &lt;br /&gt;
							{\footnotesize  \begin{tikzcd}[ampersand replacement=\&amp;amp;,scale =0.15, column sep=normal,row sep=0.7cm,arrows=&amp;lt;-]&lt;br /&gt;
									%	 	 [arrows=&amp;lt;-]&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {		$ \frac{W_{41}}{&amp;gt;51} $};    \&amp;amp; \color{red}27  \&amp;amp;\cdots \\	\&amp;amp;  	\dots           \\&lt;br /&gt;
									%  		\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_{40}}{26} $};    &amp;amp;   &amp;amp;\cdots \\		\dots &amp;amp; \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_9}{26} $};    \&amp;amp; 121 \&amp;amp; 89  \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_8}{26} $};    \&amp;amp; 33 \&amp;amp; 91    \&amp;amp; 67 \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_7}{26} $};    \&amp;amp; 25 \&amp;amp; 49 \&amp;amp;\color{red}51    \&amp;amp; 101 \&amp;amp;197 \&amp;amp;205\&amp;amp;\cdots \\&lt;br /&gt;
									%								\dots \\	&lt;br /&gt;
									\node[circle,fill=brown!15,align=center,text=black]  {$ \frac{W_6}{24} $}; \&amp;amp; \color{red}9\&amp;amp; 19  \&amp;amp;37 \&amp;amp; 77  \&amp;amp;325   \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_5}{8} $}; \&amp;amp; 7\arrow[u]\arrow[urr] \&amp;amp;\color{red}15   \&amp;amp;29\arrow[ul]\arrow[ur] \&amp;amp; 61\arrow[ur]    \&amp;amp; \cdots \\		&lt;br /&gt;
									\node[circle,fill=blue!30,align=center,text=black]  {$ \frac{W_4}{6} $}; \&amp;amp; 11\arrow[u]\arrow[urr] \&amp;amp; 23\arrow[u]\arrow[urr]  \&amp;amp;\color{red}45 \&amp;amp;\color{red}93  \&amp;amp; 181  \&amp;amp; 373 \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=yellow!30,align=center,text=black]  {$ \frac{W_3}{6} $}; \&amp;amp;17\arrow[urr] \arrow[u]\arrow[urrrr] \&amp;amp; 35\arrow[u] \arrow[urr] \arrow[urrrr] \&amp;amp;  \color{red}69  \&amp;amp;  \color{red}75  \&amp;amp;  \color{red}141\&amp;amp; &lt;br /&gt;
									151  \&amp;amp;277 \&amp;amp; 301 \&amp;amp;\cdots \\&lt;br /&gt;
									\node[circle,fill=gray!30,align=center,text=black]  {$ \frac{W_2}{6} $ }; \&amp;amp;\color{red}3 \&amp;amp; 13\arrow[ul]\arrow[ur]\arrow[urrrrr]\&amp;amp; 53\arrow[ul] \arrow[urr]\&amp;amp; 113\arrow[u] \arrow[urrrr]\&amp;amp; \color{red}213 \&amp;amp; 227\arrow[u] \&amp;amp; \color{red}453  \&amp;amp; 853 \&amp;amp;\color{red}909 \&amp;amp; \cdots 	 \\&lt;br /&gt;
									\node  [circle,fill=red!30,align=center,text=black]  {$ \frac{W_1}{2} $ }; \&amp;amp; 5\arrow[u]\arrow[ur]\arrow[urr]\arrow[urrrr]\&amp;amp;\color{red}21 \&amp;amp; 85\arrow[ur]\arrow[urrrr,near end] \&amp;amp; 341\arrow[urr] \arrow[urrrrr] \&amp;amp; \color{red}1365   \&amp;amp; 5461 \&amp;amp;\cdots \\	   &lt;br /&gt;
									\node  [circle,fill=green,align=center,text=black]  {$ \frac{W_0}{2} $ }; \&amp;amp; \&amp;amp; \&amp;amp; 1\arrow[ull] \arrow[ul]\arrow[u]\arrow[ur] \arrow[urr] \arrow[urrr]    \\&lt;br /&gt;
									%	%\end{scriptsize}  &lt;br /&gt;
							\end{tikzcd}   }&lt;br /&gt;
						} &lt;br /&gt;
						\caption{F \textsc{Ilustracja} fragment grafu $\mathcal{F} $} \label{grafF}&lt;br /&gt;
					\end{figure}  &lt;br /&gt;
	&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2026-04-02T07:52:35Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że [http://arxiv.org/abs/2310.13035 dowód] hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
Oto wersja złożona do druku [https://lem12.uksw.edu.pl/images/6/69/CollatzConjecturebecomesTheorem2026-03-15.pdf]&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
I odrzucona. &amp;lt;br /&amp;gt;&lt;br /&gt;
Artykuł złożono '''15 marca 2026'''.&amp;lt;br /&amp;gt;&lt;br /&gt;
Redaktor naczeelny wyznaczył redaktora odpowiedzialnego za zasiegniecie opinii i podjęcie decyzji 16 marca o godzinie 20:52.&amp;lt;br /&amp;gt;&lt;br /&gt;
Redaktor odpowiedzialny podjął decyzję '''17 marca 2026 o godzinie 12:17'''.&amp;lt;br /&amp;gt;&lt;br /&gt;
Oto cała recenzja i decyzja&amp;lt;br /&amp;gt;&lt;br /&gt;
''Unfortunately, we cannot accept it for publication.  The paper belongs to computer science and not mathematics. So the proper venue for its publication should be a computer science journal. It seems to me that the bare argument for the Collatz conjecture presented in your paper is not very complicated (this does not mean that I verified it). Why not extract it, omitting the programming jargon? Then it would be more accessible to mathematicians.''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture&lt;br /&gt;
''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' &lt;br /&gt;
is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;   or &amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						\{ m:=n \div 2^{\kappa(n)}  \} \bigcup &lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic.&amp;lt;br /&amp;gt; &lt;br /&gt;
 end of Abstract 01/10/2025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Have a look==&lt;br /&gt;
&amp;lt;math&amp;gt;			\begin{figure}	&lt;br /&gt;
						\resizebox{\textwidth}{!}{ &lt;br /&gt;
							{\footnotesize  \begin{tikzcd}[ampersand replacement=\&amp;amp;,scale =0.15, column sep=normal,row sep=0.7cm,arrows=&amp;lt;-]&lt;br /&gt;
									%	 	 [arrows=&amp;lt;-]&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {		$ \frac{W_{41}}{&amp;gt;51} $};    \&amp;amp; \color{red}27  \&amp;amp;\cdots \\	\&amp;amp;  	\dots           \\&lt;br /&gt;
									%  		\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_{40}}{26} $};    &amp;amp;   &amp;amp;\cdots \\		\dots &amp;amp; \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_9}{26} $};    \&amp;amp; 121 \&amp;amp; 89  \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_8}{26} $};    \&amp;amp; 33 \&amp;amp; 91    \&amp;amp; 67 \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_7}{26} $};    \&amp;amp; 25 \&amp;amp; 49 \&amp;amp;\color{red}51    \&amp;amp; 101 \&amp;amp;197 \&amp;amp;205\&amp;amp;\cdots \\&lt;br /&gt;
									%								\dots \\	&lt;br /&gt;
									\node[circle,fill=brown!15,align=center,text=black]  {$ \frac{W_6}{24} $}; \&amp;amp; \color{red}9\&amp;amp; 19  \&amp;amp;37 \&amp;amp; 77  \&amp;amp;325   \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_5}{8} $}; \&amp;amp; 7\arrow[u]\arrow[urr] \&amp;amp;\color{red}15   \&amp;amp;29\arrow[ul]\arrow[ur] \&amp;amp; 61\arrow[ur]    \&amp;amp; \cdots \\		&lt;br /&gt;
									\node[circle,fill=blue!30,align=center,text=black]  {$ \frac{W_4}{6} $}; \&amp;amp; 11\arrow[u]\arrow[urr] \&amp;amp; 23\arrow[u]\arrow[urr]  \&amp;amp;\color{red}45 \&amp;amp;\color{red}93  \&amp;amp; 181  \&amp;amp; 373 \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=yellow!30,align=center,text=black]  {$ \frac{W_3}{6} $}; \&amp;amp;17\arrow[urr] \arrow[u]\arrow[urrrr] \&amp;amp; 35\arrow[u] \arrow[urr] \arrow[urrrr] \&amp;amp;  \color{red}69  \&amp;amp;  \color{red}75  \&amp;amp;  \color{red}141\&amp;amp; &lt;br /&gt;
									151  \&amp;amp;277 \&amp;amp; 301 \&amp;amp;\cdots \\&lt;br /&gt;
									\node[circle,fill=gray!30,align=center,text=black]  {$ \frac{W_2}{6} $ }; \&amp;amp;\color{red}3 \&amp;amp; 13\arrow[ul]\arrow[ur]\arrow[urrrrr]\&amp;amp; 53\arrow[ul] \arrow[urr]\&amp;amp; 113\arrow[u] \arrow[urrrr]\&amp;amp; \color{red}213 \&amp;amp; 227\arrow[u] \&amp;amp; \color{red}453  \&amp;amp; 853 \&amp;amp;\color{red}909 \&amp;amp; \cdots 	 \\&lt;br /&gt;
									\node  [circle,fill=red!30,align=center,text=black]  {$ \frac{W_1}{2} $ }; \&amp;amp; 5\arrow[u]\arrow[ur]\arrow[urr]\arrow[urrrr]\&amp;amp;\color{red}21 \&amp;amp; 85\arrow[ur]\arrow[urrrr,near end] \&amp;amp; 341\arrow[urr] \arrow[urrrrr] \&amp;amp; \color{red}1365   \&amp;amp; 5461 \&amp;amp;\cdots \\	   &lt;br /&gt;
									\node  [circle,fill=green,align=center,text=black]  {$ \frac{W_0}{2} $ }; \&amp;amp; \&amp;amp; \&amp;amp; 1\arrow[ull] \arrow[ul]\arrow[u]\arrow[ur] \arrow[urr] \arrow[urrr]    \\&lt;br /&gt;
									%	%\end{scriptsize}  &lt;br /&gt;
							\end{tikzcd}   }&lt;br /&gt;
						} &lt;br /&gt;
						\caption{F \textsc{Ilustracja} fragment grafu $\mathcal{F} $} \label{grafF}&lt;br /&gt;
					\end{figure}  &lt;br /&gt;
	&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2026-03-30T15:44:56Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że [http://arxiv.org/abs/2310.13035 dowód] hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
Oto wersja złożona do druku [https://lem12.uksw.edu.pl/images/6/69/CollatzConjecturebecomesTheorem2026-03-15.pdf]&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
I odrzucona. &amp;lt;br /&amp;gt;&lt;br /&gt;
Artykuł złożono '''15 marca 2026'''.&amp;lt;br /&amp;gt;&lt;br /&gt;
Redaktor naczeelny wyznaczył redaktora odpowiedzialnego za zasiegniecie opinii i podjęcie decyzji 16 marca o godzinie 20:52.&amp;lt;br /&amp;gt;&lt;br /&gt;
Redaktor odpowiedzialny podjął decyzję '''17 marca 2026 o godzinie 12:17'''.&amp;lt;br /&amp;gt;&lt;br /&gt;
Oto cała recenzja i decyzja&amp;lt;br /&amp;gt;&lt;br /&gt;
''Unfortunately, we cannot accept it for publication.  The paper belongs to computer science and not mathematics. So the proper venue for its publication should be a computer science journal. It seems to me that the bare argument for the Collatz conjecture presented in your paper is not very complicated (this does not mean that I verified it). Why not extract it, omitting the programming jargon? Then it would be more accessible to mathematicians.''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture&lt;br /&gt;
''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' &lt;br /&gt;
is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic.&amp;lt;br /&amp;gt; &lt;br /&gt;
 end of Abstract 01/10/2025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Have a look==&lt;br /&gt;
&amp;lt;math&amp;gt;			\begin{figure}	&lt;br /&gt;
						\resizebox{\textwidth}{!}{ &lt;br /&gt;
							{\footnotesize  \begin{tikzcd}[ampersand replacement=\&amp;amp;,scale =0.15, column sep=normal,row sep=0.7cm,arrows=&amp;lt;-]&lt;br /&gt;
									%	 	 [arrows=&amp;lt;-]&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {		$ \frac{W_{41}}{&amp;gt;51} $};    \&amp;amp; \color{red}27  \&amp;amp;\cdots \\	\&amp;amp;  	\dots           \\&lt;br /&gt;
									%  		\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_{40}}{26} $};    &amp;amp;   &amp;amp;\cdots \\		\dots &amp;amp; \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_9}{26} $};    \&amp;amp; 121 \&amp;amp; 89  \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_8}{26} $};    \&amp;amp; 33 \&amp;amp; 91    \&amp;amp; 67 \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_7}{26} $};    \&amp;amp; 25 \&amp;amp; 49 \&amp;amp;\color{red}51    \&amp;amp; 101 \&amp;amp;197 \&amp;amp;205\&amp;amp;\cdots \\&lt;br /&gt;
									%								\dots \\	&lt;br /&gt;
									\node[circle,fill=brown!15,align=center,text=black]  {$ \frac{W_6}{24} $}; \&amp;amp; \color{red}9\&amp;amp; 19  \&amp;amp;37 \&amp;amp; 77  \&amp;amp;325   \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_5}{8} $}; \&amp;amp; 7\arrow[u]\arrow[urr] \&amp;amp;\color{red}15   \&amp;amp;29\arrow[ul]\arrow[ur] \&amp;amp; 61\arrow[ur]    \&amp;amp; \cdots \\		&lt;br /&gt;
									\node[circle,fill=blue!30,align=center,text=black]  {$ \frac{W_4}{6} $}; \&amp;amp; 11\arrow[u]\arrow[urr] \&amp;amp; 23\arrow[u]\arrow[urr]  \&amp;amp;\color{red}45 \&amp;amp;\color{red}93  \&amp;amp; 181  \&amp;amp; 373 \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=yellow!30,align=center,text=black]  {$ \frac{W_3}{6} $}; \&amp;amp;17\arrow[urr] \arrow[u]\arrow[urrrr] \&amp;amp; 35\arrow[u] \arrow[urr] \arrow[urrrr] \&amp;amp;  \color{red}69  \&amp;amp;  \color{red}75  \&amp;amp;  \color{red}141\&amp;amp; &lt;br /&gt;
									151  \&amp;amp;277 \&amp;amp; 301 \&amp;amp;\cdots \\&lt;br /&gt;
									\node[circle,fill=gray!30,align=center,text=black]  {$ \frac{W_2}{6} $ }; \&amp;amp;\color{red}3 \&amp;amp; 13\arrow[ul]\arrow[ur]\arrow[urrrrr]\&amp;amp; 53\arrow[ul] \arrow[urr]\&amp;amp; 113\arrow[u] \arrow[urrrr]\&amp;amp; \color{red}213 \&amp;amp; 227\arrow[u] \&amp;amp; \color{red}453  \&amp;amp; 853 \&amp;amp;\color{red}909 \&amp;amp; \cdots 	 \\&lt;br /&gt;
									\node  [circle,fill=red!30,align=center,text=black]  {$ \frac{W_1}{2} $ }; \&amp;amp; 5\arrow[u]\arrow[ur]\arrow[urr]\arrow[urrrr]\&amp;amp;\color{red}21 \&amp;amp; 85\arrow[ur]\arrow[urrrr,near end] \&amp;amp; 341\arrow[urr] \arrow[urrrrr] \&amp;amp; \color{red}1365   \&amp;amp; 5461 \&amp;amp;\cdots \\	   &lt;br /&gt;
									\node  [circle,fill=green,align=center,text=black]  {$ \frac{W_0}{2} $ }; \&amp;amp; \&amp;amp; \&amp;amp; 1\arrow[ull] \arrow[ul]\arrow[u]\arrow[ur] \arrow[urr] \arrow[urrr]    \\&lt;br /&gt;
									%	%\end{scriptsize}  &lt;br /&gt;
							\end{tikzcd}   }&lt;br /&gt;
						} &lt;br /&gt;
						\caption{F \textsc{Ilustracja} fragment grafu $\mathcal{F} $} \label{grafF}&lt;br /&gt;
					\end{figure}  &lt;br /&gt;
	&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2026-03-30T15:42:40Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że [http://arxiv.org/abs/2310.13035 dowód] hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
Oto wersja złożona do druku [https://lem12.uksw.edu.pl/images/6/69/CollatzConjecturebecomesTheorem2026-03-15.pdf]&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
I odrzucona. &amp;lt;br /&amp;gt;&lt;br /&gt;
Artykuł złożono 15 marca 2026.&amp;lt;br /&amp;gt;&lt;br /&gt;
Redaktor naczeelny wyznaczył redaktora odpowiedzialnego za zasiegniecie opinii i podjęcie decyzji 16 marca o godzinie 20:52.&amp;lt;br /&amp;gt;&lt;br /&gt;
Redaktor odpowiedzialny podjął decyzję 17 marca 2026 o godzinie 12:17.&amp;lt;br /&amp;gt;&lt;br /&gt;
Oto cała recenzja i decyzja&amp;lt;br /&amp;gt;&lt;br /&gt;
''Unfortunately, we cannot accept it for publication.  The paper belongs to computer science and not mathematics.&lt;br /&gt;
 So the proper venue for its publication should be a computer science journal. It seems to me that the bare argument for the Collatz conjecture presented in your paper is not very complicated (this does not mean that I verified it). Why not extract it, omitting the programming jargon? Then it would be more accessible to mathematicians.''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture&lt;br /&gt;
''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' &lt;br /&gt;
is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic.&amp;lt;br /&amp;gt; &lt;br /&gt;
 end of Abstract 01/10/2025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Have a look==&lt;br /&gt;
&amp;lt;math&amp;gt;			\begin{figure}	&lt;br /&gt;
						\resizebox{\textwidth}{!}{ &lt;br /&gt;
							{\footnotesize  \begin{tikzcd}[ampersand replacement=\&amp;amp;,scale =0.15, column sep=normal,row sep=0.7cm,arrows=&amp;lt;-]&lt;br /&gt;
									%	 	 [arrows=&amp;lt;-]&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {		$ \frac{W_{41}}{&amp;gt;51} $};    \&amp;amp; \color{red}27  \&amp;amp;\cdots \\	\&amp;amp;  	\dots           \\&lt;br /&gt;
									%  		\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_{40}}{26} $};    &amp;amp;   &amp;amp;\cdots \\		\dots &amp;amp; \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_9}{26} $};    \&amp;amp; 121 \&amp;amp; 89  \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_8}{26} $};    \&amp;amp; 33 \&amp;amp; 91    \&amp;amp; 67 \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_7}{26} $};    \&amp;amp; 25 \&amp;amp; 49 \&amp;amp;\color{red}51    \&amp;amp; 101 \&amp;amp;197 \&amp;amp;205\&amp;amp;\cdots \\&lt;br /&gt;
									%								\dots \\	&lt;br /&gt;
									\node[circle,fill=brown!15,align=center,text=black]  {$ \frac{W_6}{24} $}; \&amp;amp; \color{red}9\&amp;amp; 19  \&amp;amp;37 \&amp;amp; 77  \&amp;amp;325   \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_5}{8} $}; \&amp;amp; 7\arrow[u]\arrow[urr] \&amp;amp;\color{red}15   \&amp;amp;29\arrow[ul]\arrow[ur] \&amp;amp; 61\arrow[ur]    \&amp;amp; \cdots \\		&lt;br /&gt;
									\node[circle,fill=blue!30,align=center,text=black]  {$ \frac{W_4}{6} $}; \&amp;amp; 11\arrow[u]\arrow[urr] \&amp;amp; 23\arrow[u]\arrow[urr]  \&amp;amp;\color{red}45 \&amp;amp;\color{red}93  \&amp;amp; 181  \&amp;amp; 373 \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=yellow!30,align=center,text=black]  {$ \frac{W_3}{6} $}; \&amp;amp;17\arrow[urr] \arrow[u]\arrow[urrrr] \&amp;amp; 35\arrow[u] \arrow[urr] \arrow[urrrr] \&amp;amp;  \color{red}69  \&amp;amp;  \color{red}75  \&amp;amp;  \color{red}141\&amp;amp; &lt;br /&gt;
									151  \&amp;amp;277 \&amp;amp; 301 \&amp;amp;\cdots \\&lt;br /&gt;
									\node[circle,fill=gray!30,align=center,text=black]  {$ \frac{W_2}{6} $ }; \&amp;amp;\color{red}3 \&amp;amp; 13\arrow[ul]\arrow[ur]\arrow[urrrrr]\&amp;amp; 53\arrow[ul] \arrow[urr]\&amp;amp; 113\arrow[u] \arrow[urrrr]\&amp;amp; \color{red}213 \&amp;amp; 227\arrow[u] \&amp;amp; \color{red}453  \&amp;amp; 853 \&amp;amp;\color{red}909 \&amp;amp; \cdots 	 \\&lt;br /&gt;
									\node  [circle,fill=red!30,align=center,text=black]  {$ \frac{W_1}{2} $ }; \&amp;amp; 5\arrow[u]\arrow[ur]\arrow[urr]\arrow[urrrr]\&amp;amp;\color{red}21 \&amp;amp; 85\arrow[ur]\arrow[urrrr,near end] \&amp;amp; 341\arrow[urr] \arrow[urrrrr] \&amp;amp; \color{red}1365   \&amp;amp; 5461 \&amp;amp;\cdots \\	   &lt;br /&gt;
									\node  [circle,fill=green,align=center,text=black]  {$ \frac{W_0}{2} $ }; \&amp;amp; \&amp;amp; \&amp;amp; 1\arrow[ull] \arrow[ul]\arrow[u]\arrow[ur] \arrow[urr] \arrow[urrr]    \\&lt;br /&gt;
									%	%\end{scriptsize}  &lt;br /&gt;
							\end{tikzcd}   }&lt;br /&gt;
						} &lt;br /&gt;
						\caption{F \textsc{Ilustracja} fragment grafu $\mathcal{F} $} \label{grafF}&lt;br /&gt;
					\end{figure}  &lt;br /&gt;
	&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2026-03-30T15:41:10Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że [http://arxiv.org/abs/2310.13035 dowód] hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
Oto wersja złożona do druku [https://lem12.uksw.edu.pl/images/6/69/CollatzConjecturebecomesTheorem2026-03-15.pdf]&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
I odrzucona. &amp;lt;br /&amp;gt;&lt;br /&gt;
Artykuł złożono 15 marca 2026.&amp;lt;br /&amp;gt;&lt;br /&gt;
Redaktor naczeelny wyznaczył redaktora odpowiedzialnego za zasiegniecie opinii i podjęcie decyzji 16 marca o godzinie 20:52.&amp;lt;br /&amp;gt;&lt;br /&gt;
Redaktor odpowiedzialny podjął decyzję 17 marca 2026 o godzinie 12:17.&amp;lt;br /&amp;gt;&lt;br /&gt;
Oto cała recenzja i decyzja&amp;lt;br /&amp;gt;&lt;br /&gt;
''Unfortunately, we cannot accept it for publication.&lt;br /&gt;
  The paper belongs to computer science and not mathematics.&lt;br /&gt;
 So the proper venue for its publication should be a computer science journal.&lt;br /&gt;
It seems to me that the bare argument for the Collatz conjecture presented in your paper is not very complicated (this does not mean that I verified it). Why not extract it, omitting the programming jargon? Then it would be more accessible to mathematicians.''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture&lt;br /&gt;
''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' &lt;br /&gt;
is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic.&amp;lt;br /&amp;gt; &lt;br /&gt;
 end of Abstract 01/10/2025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Have a look==&lt;br /&gt;
&amp;lt;math&amp;gt;			\begin{figure}	&lt;br /&gt;
						\resizebox{\textwidth}{!}{ &lt;br /&gt;
							{\footnotesize  \begin{tikzcd}[ampersand replacement=\&amp;amp;,scale =0.15, column sep=normal,row sep=0.7cm,arrows=&amp;lt;-]&lt;br /&gt;
									%	 	 [arrows=&amp;lt;-]&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {		$ \frac{W_{41}}{&amp;gt;51} $};    \&amp;amp; \color{red}27  \&amp;amp;\cdots \\	\&amp;amp;  	\dots           \\&lt;br /&gt;
									%  		\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_{40}}{26} $};    &amp;amp;   &amp;amp;\cdots \\		\dots &amp;amp; \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_9}{26} $};    \&amp;amp; 121 \&amp;amp; 89  \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_8}{26} $};    \&amp;amp; 33 \&amp;amp; 91    \&amp;amp; 67 \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_7}{26} $};    \&amp;amp; 25 \&amp;amp; 49 \&amp;amp;\color{red}51    \&amp;amp; 101 \&amp;amp;197 \&amp;amp;205\&amp;amp;\cdots \\&lt;br /&gt;
									%								\dots \\	&lt;br /&gt;
									\node[circle,fill=brown!15,align=center,text=black]  {$ \frac{W_6}{24} $}; \&amp;amp; \color{red}9\&amp;amp; 19  \&amp;amp;37 \&amp;amp; 77  \&amp;amp;325   \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_5}{8} $}; \&amp;amp; 7\arrow[u]\arrow[urr] \&amp;amp;\color{red}15   \&amp;amp;29\arrow[ul]\arrow[ur] \&amp;amp; 61\arrow[ur]    \&amp;amp; \cdots \\		&lt;br /&gt;
									\node[circle,fill=blue!30,align=center,text=black]  {$ \frac{W_4}{6} $}; \&amp;amp; 11\arrow[u]\arrow[urr] \&amp;amp; 23\arrow[u]\arrow[urr]  \&amp;amp;\color{red}45 \&amp;amp;\color{red}93  \&amp;amp; 181  \&amp;amp; 373 \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=yellow!30,align=center,text=black]  {$ \frac{W_3}{6} $}; \&amp;amp;17\arrow[urr] \arrow[u]\arrow[urrrr] \&amp;amp; 35\arrow[u] \arrow[urr] \arrow[urrrr] \&amp;amp;  \color{red}69  \&amp;amp;  \color{red}75  \&amp;amp;  \color{red}141\&amp;amp; &lt;br /&gt;
									151  \&amp;amp;277 \&amp;amp; 301 \&amp;amp;\cdots \\&lt;br /&gt;
									\node[circle,fill=gray!30,align=center,text=black]  {$ \frac{W_2}{6} $ }; \&amp;amp;\color{red}3 \&amp;amp; 13\arrow[ul]\arrow[ur]\arrow[urrrrr]\&amp;amp; 53\arrow[ul] \arrow[urr]\&amp;amp; 113\arrow[u] \arrow[urrrr]\&amp;amp; \color{red}213 \&amp;amp; 227\arrow[u] \&amp;amp; \color{red}453  \&amp;amp; 853 \&amp;amp;\color{red}909 \&amp;amp; \cdots 	 \\&lt;br /&gt;
									\node  [circle,fill=red!30,align=center,text=black]  {$ \frac{W_1}{2} $ }; \&amp;amp; 5\arrow[u]\arrow[ur]\arrow[urr]\arrow[urrrr]\&amp;amp;\color{red}21 \&amp;amp; 85\arrow[ur]\arrow[urrrr,near end] \&amp;amp; 341\arrow[urr] \arrow[urrrrr] \&amp;amp; \color{red}1365   \&amp;amp; 5461 \&amp;amp;\cdots \\	   &lt;br /&gt;
									\node  [circle,fill=green,align=center,text=black]  {$ \frac{W_0}{2} $ }; \&amp;amp; \&amp;amp; \&amp;amp; 1\arrow[ull] \arrow[ul]\arrow[u]\arrow[ur] \arrow[urr] \arrow[urrr]    \\&lt;br /&gt;
									%	%\end{scriptsize}  &lt;br /&gt;
							\end{tikzcd}   }&lt;br /&gt;
						} &lt;br /&gt;
						\caption{F \textsc{Ilustracja} fragment grafu $\mathcal{F} $} \label{grafF}&lt;br /&gt;
					\end{figure}  &lt;br /&gt;
	&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2026-03-30T15:39:41Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że [http://arxiv.org/abs/2310.13035 dowód] hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
Oto wersja złożona do druku [https://lem12.uksw.edu.pl/images/6/69/CollatzConjecturebecomesTheorem2026-03-15.pdf]&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
I odrzucona. &amp;lt;br /&amp;gt;&lt;br /&gt;
Artykuł złożono 15 marca 2026.&amp;lt;br /&amp;gt;&lt;br /&gt;
Redaktor naczeelny wyznaczył redaktora odpowiedzialnego za zasiegniecie opinii i podjęcie decyzji 16 marca o godzinie 20:52.&amp;lt;br /&amp;gt;&lt;br /&gt;
Redaktor odpowiedzialny podjął decyzję 17 marca 2026 o godzinie 12:17.&amp;lt;br /&amp;gt;&lt;br /&gt;
Oto cała recenzja i decyzja&amp;lt;br /&amp;gt;&lt;br /&gt;
''Unfortunately, we cannot accept it for publication.&amp;lt;br /&amp;gt;&lt;br /&gt;
  The paper belongs to computer science and not mathematics.&amp;lt;br /&amp;gt;&lt;br /&gt;
 So the proper venue for its publication should be a computer science journal.&amp;lt;br /&amp;gt;&lt;br /&gt;
It seems to me that the bare argument for the Collatz conjecture presented in your paper is not very complicated (this does not mean that I verified it). Why not extract it, omitting the programming jargon? Then it would be more accessible to mathematicians.''&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture&lt;br /&gt;
''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' &lt;br /&gt;
is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic.&amp;lt;br /&amp;gt; &lt;br /&gt;
 end of Abstract 01/10/2025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Have a look==&lt;br /&gt;
&amp;lt;math&amp;gt;			\begin{figure}	&lt;br /&gt;
						\resizebox{\textwidth}{!}{ &lt;br /&gt;
							{\footnotesize  \begin{tikzcd}[ampersand replacement=\&amp;amp;,scale =0.15, column sep=normal,row sep=0.7cm,arrows=&amp;lt;-]&lt;br /&gt;
									%	 	 [arrows=&amp;lt;-]&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {		$ \frac{W_{41}}{&amp;gt;51} $};    \&amp;amp; \color{red}27  \&amp;amp;\cdots \\	\&amp;amp;  	\dots           \\&lt;br /&gt;
									%  		\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_{40}}{26} $};    &amp;amp;   &amp;amp;\cdots \\		\dots &amp;amp; \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_9}{26} $};    \&amp;amp; 121 \&amp;amp; 89  \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_8}{26} $};    \&amp;amp; 33 \&amp;amp; 91    \&amp;amp; 67 \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_7}{26} $};    \&amp;amp; 25 \&amp;amp; 49 \&amp;amp;\color{red}51    \&amp;amp; 101 \&amp;amp;197 \&amp;amp;205\&amp;amp;\cdots \\&lt;br /&gt;
									%								\dots \\	&lt;br /&gt;
									\node[circle,fill=brown!15,align=center,text=black]  {$ \frac{W_6}{24} $}; \&amp;amp; \color{red}9\&amp;amp; 19  \&amp;amp;37 \&amp;amp; 77  \&amp;amp;325   \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_5}{8} $}; \&amp;amp; 7\arrow[u]\arrow[urr] \&amp;amp;\color{red}15   \&amp;amp;29\arrow[ul]\arrow[ur] \&amp;amp; 61\arrow[ur]    \&amp;amp; \cdots \\		&lt;br /&gt;
									\node[circle,fill=blue!30,align=center,text=black]  {$ \frac{W_4}{6} $}; \&amp;amp; 11\arrow[u]\arrow[urr] \&amp;amp; 23\arrow[u]\arrow[urr]  \&amp;amp;\color{red}45 \&amp;amp;\color{red}93  \&amp;amp; 181  \&amp;amp; 373 \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=yellow!30,align=center,text=black]  {$ \frac{W_3}{6} $}; \&amp;amp;17\arrow[urr] \arrow[u]\arrow[urrrr] \&amp;amp; 35\arrow[u] \arrow[urr] \arrow[urrrr] \&amp;amp;  \color{red}69  \&amp;amp;  \color{red}75  \&amp;amp;  \color{red}141\&amp;amp; &lt;br /&gt;
									151  \&amp;amp;277 \&amp;amp; 301 \&amp;amp;\cdots \\&lt;br /&gt;
									\node[circle,fill=gray!30,align=center,text=black]  {$ \frac{W_2}{6} $ }; \&amp;amp;\color{red}3 \&amp;amp; 13\arrow[ul]\arrow[ur]\arrow[urrrrr]\&amp;amp; 53\arrow[ul] \arrow[urr]\&amp;amp; 113\arrow[u] \arrow[urrrr]\&amp;amp; \color{red}213 \&amp;amp; 227\arrow[u] \&amp;amp; \color{red}453  \&amp;amp; 853 \&amp;amp;\color{red}909 \&amp;amp; \cdots 	 \\&lt;br /&gt;
									\node  [circle,fill=red!30,align=center,text=black]  {$ \frac{W_1}{2} $ }; \&amp;amp; 5\arrow[u]\arrow[ur]\arrow[urr]\arrow[urrrr]\&amp;amp;\color{red}21 \&amp;amp; 85\arrow[ur]\arrow[urrrr,near end] \&amp;amp; 341\arrow[urr] \arrow[urrrrr] \&amp;amp; \color{red}1365   \&amp;amp; 5461 \&amp;amp;\cdots \\	   &lt;br /&gt;
									\node  [circle,fill=green,align=center,text=black]  {$ \frac{W_0}{2} $ }; \&amp;amp; \&amp;amp; \&amp;amp; 1\arrow[ull] \arrow[ul]\arrow[u]\arrow[ur] \arrow[urr] \arrow[urrr]    \\&lt;br /&gt;
									%	%\end{scriptsize}  &lt;br /&gt;
							\end{tikzcd}   }&lt;br /&gt;
						} &lt;br /&gt;
						\caption{F \textsc{Ilustracja} fragment grafu $\mathcal{F} $} \label{grafF}&lt;br /&gt;
					\end{figure}  &lt;br /&gt;
	&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2026-03-30T15:37:57Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że [http://arxiv.org/abs/2310.13035 dowód] hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
Oto wersja złożona do druku [https://lem12.uksw.edu.pl/images/6/69/CollatzConjecturebecomesTheorem2026-03-15.pdf]&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
I odrzucona. &amp;lt;br /&amp;gt;&lt;br /&gt;
Artykuł złożono 15 marca 2026.&amp;lt;br /&amp;gt;&lt;br /&gt;
Redaktor naczeelny wyznaczył redaktora odpowiedzialnego za zasiegniecie opinii i podjęcie decyzji 16 marca o godzinie 20:52.&amp;lt;br /&amp;gt;&lt;br /&gt;
Redaktor odpowiedzialny podjął decyzję 17 marca 2026 o godzinie 12:17.&amp;lt;br /&amp;gt;&lt;br /&gt;
Oto cała recenzja i decyzja&amp;lt;br /&amp;gt;&lt;br /&gt;
Unfortunately, we cannot accept it for publication.&amp;lt;br /&amp;gt;&lt;br /&gt;
  The paper belongs to computer science and not mathematics.&amp;lt;br /&amp;gt;&lt;br /&gt;
 So the proper venue for its publication should be a computer science journal.&amp;lt;br /&amp;gt;&lt;br /&gt;
It seems to me that the bare argument for the Collatz conjecture presented in your paper is not very complicated (this does not mean that I verified it). Why not extract it, omitting the programming jargon? Then it would be more accessible to mathematicians.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture&lt;br /&gt;
''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' &lt;br /&gt;
is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic.&amp;lt;br /&amp;gt; &lt;br /&gt;
 end of Abstract 01/10/2025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Have a look==&lt;br /&gt;
&amp;lt;math&amp;gt;			\begin{figure}	&lt;br /&gt;
						\resizebox{\textwidth}{!}{ &lt;br /&gt;
							{\footnotesize  \begin{tikzcd}[ampersand replacement=\&amp;amp;,scale =0.15, column sep=normal,row sep=0.7cm,arrows=&amp;lt;-]&lt;br /&gt;
									%	 	 [arrows=&amp;lt;-]&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {		$ \frac{W_{41}}{&amp;gt;51} $};    \&amp;amp; \color{red}27  \&amp;amp;\cdots \\	\&amp;amp;  	\dots           \\&lt;br /&gt;
									%  		\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_{40}}{26} $};    &amp;amp;   &amp;amp;\cdots \\		\dots &amp;amp; \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_9}{26} $};    \&amp;amp; 121 \&amp;amp; 89  \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_8}{26} $};    \&amp;amp; 33 \&amp;amp; 91    \&amp;amp; 67 \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_7}{26} $};    \&amp;amp; 25 \&amp;amp; 49 \&amp;amp;\color{red}51    \&amp;amp; 101 \&amp;amp;197 \&amp;amp;205\&amp;amp;\cdots \\&lt;br /&gt;
									%								\dots \\	&lt;br /&gt;
									\node[circle,fill=brown!15,align=center,text=black]  {$ \frac{W_6}{24} $}; \&amp;amp; \color{red}9\&amp;amp; 19  \&amp;amp;37 \&amp;amp; 77  \&amp;amp;325   \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_5}{8} $}; \&amp;amp; 7\arrow[u]\arrow[urr] \&amp;amp;\color{red}15   \&amp;amp;29\arrow[ul]\arrow[ur] \&amp;amp; 61\arrow[ur]    \&amp;amp; \cdots \\		&lt;br /&gt;
									\node[circle,fill=blue!30,align=center,text=black]  {$ \frac{W_4}{6} $}; \&amp;amp; 11\arrow[u]\arrow[urr] \&amp;amp; 23\arrow[u]\arrow[urr]  \&amp;amp;\color{red}45 \&amp;amp;\color{red}93  \&amp;amp; 181  \&amp;amp; 373 \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=yellow!30,align=center,text=black]  {$ \frac{W_3}{6} $}; \&amp;amp;17\arrow[urr] \arrow[u]\arrow[urrrr] \&amp;amp; 35\arrow[u] \arrow[urr] \arrow[urrrr] \&amp;amp;  \color{red}69  \&amp;amp;  \color{red}75  \&amp;amp;  \color{red}141\&amp;amp; &lt;br /&gt;
									151  \&amp;amp;277 \&amp;amp; 301 \&amp;amp;\cdots \\&lt;br /&gt;
									\node[circle,fill=gray!30,align=center,text=black]  {$ \frac{W_2}{6} $ }; \&amp;amp;\color{red}3 \&amp;amp; 13\arrow[ul]\arrow[ur]\arrow[urrrrr]\&amp;amp; 53\arrow[ul] \arrow[urr]\&amp;amp; 113\arrow[u] \arrow[urrrr]\&amp;amp; \color{red}213 \&amp;amp; 227\arrow[u] \&amp;amp; \color{red}453  \&amp;amp; 853 \&amp;amp;\color{red}909 \&amp;amp; \cdots 	 \\&lt;br /&gt;
									\node  [circle,fill=red!30,align=center,text=black]  {$ \frac{W_1}{2} $ }; \&amp;amp; 5\arrow[u]\arrow[ur]\arrow[urr]\arrow[urrrr]\&amp;amp;\color{red}21 \&amp;amp; 85\arrow[ur]\arrow[urrrr,near end] \&amp;amp; 341\arrow[urr] \arrow[urrrrr] \&amp;amp; \color{red}1365   \&amp;amp; 5461 \&amp;amp;\cdots \\	   &lt;br /&gt;
									\node  [circle,fill=green,align=center,text=black]  {$ \frac{W_0}{2} $ }; \&amp;amp; \&amp;amp; \&amp;amp; 1\arrow[ull] \arrow[ul]\arrow[u]\arrow[ur] \arrow[urr] \arrow[urrr]    \\&lt;br /&gt;
									%	%\end{scriptsize}  &lt;br /&gt;
							\end{tikzcd}   }&lt;br /&gt;
						} &lt;br /&gt;
						\caption{F \textsc{Ilustracja} fragment grafu $\mathcal{F} $} \label{grafF}&lt;br /&gt;
					\end{figure}  &lt;br /&gt;
	&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2026-03-30T15:32:18Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że [http://arxiv.org/abs/2310.13035 dowód] hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
Oto wersja złożona do druku [https://lem12.uksw.edu.pl/images/6/69/CollatzConjecturebecomesTheorem2026-03-15.pdf]&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
I odrzucona. &amp;lt;br /&amp;gt;&lt;br /&gt;
Artykuł złożono 15 marca 2026.&amp;lt;br /&amp;gt;&lt;br /&gt;
Redaktor naczeelny wyznaczył redaktora odpowiedzialnego za zasiegniecie opinii i podjęcie decyzji 16 marca o godzinie 20:52.&amp;lt;br /&amp;gt;&lt;br /&gt;
Redaktor odpowiedzialny podjął decyzję 17 marca 2026 o godzinie 12:17.&amp;lt;br /&amp;gt;&lt;br /&gt;
Oto cała recenzja i decyzja&amp;lt;br /&amp;gt;&lt;br /&gt;
----------------&amp;lt;br /&amp;gt;&lt;br /&gt;
Unfortunately, we cannot accept it for publication.&amp;lt;br /&amp;gt;&lt;br /&gt;
  The paper belongs to computer science and not mathematics.&amp;lt;br /&amp;gt;&lt;br /&gt;
 So the proper venue for its publication should be a computer science journal.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It seems to me that the bare argument for the Collatz conjecture presented in your paper is not very complicated (this does not mean that I verified it). Why not extract it, omitting the programming jargon? Then it would be more accessible to mathematicians.&amp;lt;br /&amp;gt;&lt;br /&gt;
--------------------------------&amp;lt;br /&amp;gt;&lt;br /&gt;
Nieźle?&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture&lt;br /&gt;
''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' &lt;br /&gt;
is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic.&amp;lt;br /&amp;gt; &lt;br /&gt;
 end of Abstract 01/10/2025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Have a look==&lt;br /&gt;
&amp;lt;math&amp;gt;			\begin{figure}	&lt;br /&gt;
						\resizebox{\textwidth}{!}{ &lt;br /&gt;
							{\footnotesize  \begin{tikzcd}[ampersand replacement=\&amp;amp;,scale =0.15, column sep=normal,row sep=0.7cm,arrows=&amp;lt;-]&lt;br /&gt;
									%	 	 [arrows=&amp;lt;-]&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {		$ \frac{W_{41}}{&amp;gt;51} $};    \&amp;amp; \color{red}27  \&amp;amp;\cdots \\	\&amp;amp;  	\dots           \\&lt;br /&gt;
									%  		\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_{40}}{26} $};    &amp;amp;   &amp;amp;\cdots \\		\dots &amp;amp; \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_9}{26} $};    \&amp;amp; 121 \&amp;amp; 89  \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_8}{26} $};    \&amp;amp; 33 \&amp;amp; 91    \&amp;amp; 67 \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_7}{26} $};    \&amp;amp; 25 \&amp;amp; 49 \&amp;amp;\color{red}51    \&amp;amp; 101 \&amp;amp;197 \&amp;amp;205\&amp;amp;\cdots \\&lt;br /&gt;
									%								\dots \\	&lt;br /&gt;
									\node[circle,fill=brown!15,align=center,text=black]  {$ \frac{W_6}{24} $}; \&amp;amp; \color{red}9\&amp;amp; 19  \&amp;amp;37 \&amp;amp; 77  \&amp;amp;325   \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_5}{8} $}; \&amp;amp; 7\arrow[u]\arrow[urr] \&amp;amp;\color{red}15   \&amp;amp;29\arrow[ul]\arrow[ur] \&amp;amp; 61\arrow[ur]    \&amp;amp; \cdots \\		&lt;br /&gt;
									\node[circle,fill=blue!30,align=center,text=black]  {$ \frac{W_4}{6} $}; \&amp;amp; 11\arrow[u]\arrow[urr] \&amp;amp; 23\arrow[u]\arrow[urr]  \&amp;amp;\color{red}45 \&amp;amp;\color{red}93  \&amp;amp; 181  \&amp;amp; 373 \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=yellow!30,align=center,text=black]  {$ \frac{W_3}{6} $}; \&amp;amp;17\arrow[urr] \arrow[u]\arrow[urrrr] \&amp;amp; 35\arrow[u] \arrow[urr] \arrow[urrrr] \&amp;amp;  \color{red}69  \&amp;amp;  \color{red}75  \&amp;amp;  \color{red}141\&amp;amp; &lt;br /&gt;
									151  \&amp;amp;277 \&amp;amp; 301 \&amp;amp;\cdots \\&lt;br /&gt;
									\node[circle,fill=gray!30,align=center,text=black]  {$ \frac{W_2}{6} $ }; \&amp;amp;\color{red}3 \&amp;amp; 13\arrow[ul]\arrow[ur]\arrow[urrrrr]\&amp;amp; 53\arrow[ul] \arrow[urr]\&amp;amp; 113\arrow[u] \arrow[urrrr]\&amp;amp; \color{red}213 \&amp;amp; 227\arrow[u] \&amp;amp; \color{red}453  \&amp;amp; 853 \&amp;amp;\color{red}909 \&amp;amp; \cdots 	 \\&lt;br /&gt;
									\node  [circle,fill=red!30,align=center,text=black]  {$ \frac{W_1}{2} $ }; \&amp;amp; 5\arrow[u]\arrow[ur]\arrow[urr]\arrow[urrrr]\&amp;amp;\color{red}21 \&amp;amp; 85\arrow[ur]\arrow[urrrr,near end] \&amp;amp; 341\arrow[urr] \arrow[urrrrr] \&amp;amp; \color{red}1365   \&amp;amp; 5461 \&amp;amp;\cdots \\	   &lt;br /&gt;
									\node  [circle,fill=green,align=center,text=black]  {$ \frac{W_0}{2} $ }; \&amp;amp; \&amp;amp; \&amp;amp; 1\arrow[ull] \arrow[ul]\arrow[u]\arrow[ur] \arrow[urr] \arrow[urrr]    \\&lt;br /&gt;
									%	%\end{scriptsize}  &lt;br /&gt;
							\end{tikzcd}   }&lt;br /&gt;
						} &lt;br /&gt;
						\caption{F \textsc{Ilustracja} fragment grafu $\mathcal{F} $} \label{grafF}&lt;br /&gt;
					\end{figure}  &lt;br /&gt;
	&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2026-03-30T15:26:57Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że [http://arxiv.org/abs/2310.13035 dowód] hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
Oto wersja złożona do druku [https://lem12.uksw.edu.pl/images/6/69/CollatzConjecturebecomesTheorem2026-03-15.pdf]&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
I odrzucona. &amp;lt;br /&amp;gt;&lt;br /&gt;
Artykuł złożono 15 marca 2026.&amp;lt;br /&amp;gt;&lt;br /&gt;
Redaktor naczeelny wyznaczył redaktora odpowiedzialnego za zasiegniecie opinii i podjęcie decyzji 16 marca o godzinie 20:52.&amp;lt;br /&amp;gt;&lt;br /&gt;
Redaktor odpowiedzialny podjął decyzję 17 marca 2026 o godzinie 12:17.&amp;lt;br /&amp;gt;&lt;br /&gt;
Oto cała recenzja i decyzja&amp;lt;br /&amp;gt;&lt;br /&gt;
----------------&amp;lt;br /&amp;gt;&lt;br /&gt;
Unfortunately, we cannot accept it for publication.&amp;lt;br /&amp;gt;&lt;br /&gt;
  The paper belongs to computer science and not mathematics.&amp;lt;br /&amp;gt;&lt;br /&gt;
 So the proper venue for its publication should be a computer science journal.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It seems to me that the bare argument for the Collatz conjecture presented in your paper is not very complicated (this does not mean that I verified it). Why not extract it, omitting the programming jargon? Then it would be more accessible to mathematicians.&amp;lt;br /&amp;gt;&lt;br /&gt;
--------------------------------&amp;lt;br /&amp;gt;&lt;br /&gt;
Nieźle?&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture&lt;br /&gt;
''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' &lt;br /&gt;
is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic.&amp;lt;br /&amp;gt; &lt;br /&gt;
 end of Abstract 01/10/2025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Have a look==&lt;br /&gt;
&amp;lt;math&amp;gt;			\begin{figure}	&lt;br /&gt;
						\resizebox{\textwidth}{!}{ &lt;br /&gt;
							{\footnotesize  \begin{tikzcd}[ampersand replacement=\&amp;amp;,scale =0.15, column sep=normal,row sep=0.7cm,arrows=&amp;lt;-]&lt;br /&gt;
									%	 	 [arrows=&amp;lt;-]&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {		$ \frac{W_{41}}{&amp;gt;51} $};    \&amp;amp; \color{red}27  \&amp;amp;\cdots \\	\&amp;amp;  	\dots           \\&lt;br /&gt;
									%  		\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_{40}}{26} $};    &amp;amp;   &amp;amp;\cdots \\		\dots &amp;amp; \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_9}{26} $};    \&amp;amp; 121 \&amp;amp; 89  \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_8}{26} $};    \&amp;amp; 33 \&amp;amp; 91    \&amp;amp; 67 \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_7}{26} $};    \&amp;amp; 25 \&amp;amp; 49 \&amp;amp;\color{red}51    \&amp;amp; 101 \&amp;amp;197 \&amp;amp;205\&amp;amp;\cdots \\&lt;br /&gt;
									%								\dots \\	&lt;br /&gt;
									\node[circle,fill=brown!15,align=center,text=black]  {$ \frac{W_6}{24} $}; \&amp;amp; \color{red}9\&amp;amp; 19  \&amp;amp;37 \&amp;amp; 77  \&amp;amp;325   \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_5}{8} $}; \&amp;amp; 7\arrow[u]\arrow[urr] \&amp;amp;\color{red}15   \&amp;amp;29\arrow[ul]\arrow[ur] \&amp;amp; 61\arrow[ur]    \&amp;amp; \cdots \\		&lt;br /&gt;
									\node[circle,fill=blue!30,align=center,text=black]  {$ \frac{W_4}{6} $}; \&amp;amp; 11\arrow[u]\arrow[urr] \&amp;amp; 23\arrow[u]\arrow[urr]  \&amp;amp;\color{red}45 \&amp;amp;\color{red}93  \&amp;amp; 181  \&amp;amp; 373 \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=yellow!30,align=center,text=black]  {$ \frac{W_3}{6} $}; \&amp;amp;17\arrow[urr] \arrow[u]\arrow[urrrr] \&amp;amp; 35\arrow[u] \arrow[urr] \arrow[urrrr] \&amp;amp;  \color{red}69  \&amp;amp;  \color{red}75  \&amp;amp;  \color{red}141\&amp;amp; &lt;br /&gt;
									151  \&amp;amp;277 \&amp;amp; 301 \&amp;amp;\cdots \\&lt;br /&gt;
									\node[circle,fill=gray!30,align=center,text=black]  {$ \frac{W_2}{6} $ }; \&amp;amp;\color{red}3 \&amp;amp; 13\arrow[ul]\arrow[ur]\arrow[urrrrr]\&amp;amp; 53\arrow[ul] \arrow[urr]\&amp;amp; 113\arrow[u] \arrow[urrrr]\&amp;amp; \color{red}213 \&amp;amp; 227\arrow[u] \&amp;amp; \color{red}453  \&amp;amp; 853 \&amp;amp;\color{red}909 \&amp;amp; \cdots 	 \\&lt;br /&gt;
									\node  [circle,fill=red!30,align=center,text=black]  {$ \frac{W_1}{2} $ }; \&amp;amp; 5\arrow[u]\arrow[ur]\arrow[urr]\arrow[urrrr]\&amp;amp;\color{red}21 \&amp;amp; 85\arrow[ur]\arrow[urrrr,near end] \&amp;amp; 341\arrow[urr] \arrow[urrrrr] \&amp;amp; \color{red}1365   \&amp;amp; 5461 \&amp;amp;\cdots \\	   &lt;br /&gt;
									\node  [circle,fill=green,align=center,text=black]  {$ \frac{W_0}{2} $ }; \&amp;amp; \&amp;amp; \&amp;amp; 1\arrow[ull] \arrow[ul]\arrow[u]\arrow[ur] \arrow[urr] \arrow[urrr]    \\&lt;br /&gt;
									%	%\end{scriptsize}  &lt;br /&gt;
							\end{tikzcd}   }&lt;br /&gt;
						} &lt;br /&gt;
						\caption{F \textsc{Ilustracja} fragment grafu $\mathcal{F} $} \label{grafF}&lt;br /&gt;
					\end{figure}  &lt;br /&gt;
	&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2026-03-15T18:26:20Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że [http://arxiv.org/abs/2310.13035 dowód] hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
Oto wersja złożona do druku [https://lem12.uksw.edu.pl/images/6/69/CollatzConjecturebecomesTheorem2026-03-15.pdf]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture&lt;br /&gt;
''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' &lt;br /&gt;
is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic.&amp;lt;br /&amp;gt; &lt;br /&gt;
 end of Abstract 01/10/2025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Have a look==&lt;br /&gt;
&amp;lt;math&amp;gt;			\begin{figure}	&lt;br /&gt;
						\resizebox{\textwidth}{!}{ &lt;br /&gt;
							{\footnotesize  \begin{tikzcd}[ampersand replacement=\&amp;amp;,scale =0.15, column sep=normal,row sep=0.7cm,arrows=&amp;lt;-]&lt;br /&gt;
									%	 	 [arrows=&amp;lt;-]&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {		$ \frac{W_{41}}{&amp;gt;51} $};    \&amp;amp; \color{red}27  \&amp;amp;\cdots \\	\&amp;amp;  	\dots           \\&lt;br /&gt;
									%  		\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_{40}}{26} $};    &amp;amp;   &amp;amp;\cdots \\		\dots &amp;amp; \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_9}{26} $};    \&amp;amp; 121 \&amp;amp; 89  \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_8}{26} $};    \&amp;amp; 33 \&amp;amp; 91    \&amp;amp; 67 \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_7}{26} $};    \&amp;amp; 25 \&amp;amp; 49 \&amp;amp;\color{red}51    \&amp;amp; 101 \&amp;amp;197 \&amp;amp;205\&amp;amp;\cdots \\&lt;br /&gt;
									%								\dots \\	&lt;br /&gt;
									\node[circle,fill=brown!15,align=center,text=black]  {$ \frac{W_6}{24} $}; \&amp;amp; \color{red}9\&amp;amp; 19  \&amp;amp;37 \&amp;amp; 77  \&amp;amp;325   \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_5}{8} $}; \&amp;amp; 7\arrow[u]\arrow[urr] \&amp;amp;\color{red}15   \&amp;amp;29\arrow[ul]\arrow[ur] \&amp;amp; 61\arrow[ur]    \&amp;amp; \cdots \\		&lt;br /&gt;
									\node[circle,fill=blue!30,align=center,text=black]  {$ \frac{W_4}{6} $}; \&amp;amp; 11\arrow[u]\arrow[urr] \&amp;amp; 23\arrow[u]\arrow[urr]  \&amp;amp;\color{red}45 \&amp;amp;\color{red}93  \&amp;amp; 181  \&amp;amp; 373 \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=yellow!30,align=center,text=black]  {$ \frac{W_3}{6} $}; \&amp;amp;17\arrow[urr] \arrow[u]\arrow[urrrr] \&amp;amp; 35\arrow[u] \arrow[urr] \arrow[urrrr] \&amp;amp;  \color{red}69  \&amp;amp;  \color{red}75  \&amp;amp;  \color{red}141\&amp;amp; &lt;br /&gt;
									151  \&amp;amp;277 \&amp;amp; 301 \&amp;amp;\cdots \\&lt;br /&gt;
									\node[circle,fill=gray!30,align=center,text=black]  {$ \frac{W_2}{6} $ }; \&amp;amp;\color{red}3 \&amp;amp; 13\arrow[ul]\arrow[ur]\arrow[urrrrr]\&amp;amp; 53\arrow[ul] \arrow[urr]\&amp;amp; 113\arrow[u] \arrow[urrrr]\&amp;amp; \color{red}213 \&amp;amp; 227\arrow[u] \&amp;amp; \color{red}453  \&amp;amp; 853 \&amp;amp;\color{red}909 \&amp;amp; \cdots 	 \\&lt;br /&gt;
									\node  [circle,fill=red!30,align=center,text=black]  {$ \frac{W_1}{2} $ }; \&amp;amp; 5\arrow[u]\arrow[ur]\arrow[urr]\arrow[urrrr]\&amp;amp;\color{red}21 \&amp;amp; 85\arrow[ur]\arrow[urrrr,near end] \&amp;amp; 341\arrow[urr] \arrow[urrrrr] \&amp;amp; \color{red}1365   \&amp;amp; 5461 \&amp;amp;\cdots \\	   &lt;br /&gt;
									\node  [circle,fill=green,align=center,text=black]  {$ \frac{W_0}{2} $ }; \&amp;amp; \&amp;amp; \&amp;amp; 1\arrow[ull] \arrow[ul]\arrow[u]\arrow[ur] \arrow[urr] \arrow[urrr]    \\&lt;br /&gt;
									%	%\end{scriptsize}  &lt;br /&gt;
							\end{tikzcd}   }&lt;br /&gt;
						} &lt;br /&gt;
						\caption{F \textsc{Ilustracja} fragment grafu $\mathcal{F} $} \label{grafF}&lt;br /&gt;
					\end{figure}  &lt;br /&gt;
	&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2026-03-15T18:23:28Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że [http://arxiv.org/abs/2310.13035 dowód] hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
Oto wersja złożona do druku [https://lem12.uksw.edu.pl/images/6/69/CollatzConjecturebecomesTheorem2026-03-15.pdf]&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture&lt;br /&gt;
''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' &lt;br /&gt;
is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic.&amp;lt;br /&amp;gt; &lt;br /&gt;
 end of Abstract 01/10/2025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Have a look==&lt;br /&gt;
&amp;lt;math&amp;gt;			\begin{figure}	&lt;br /&gt;
						\resizebox{\textwidth}{!}{ &lt;br /&gt;
							{\footnotesize  \begin{tikzcd}[ampersand replacement=\&amp;amp;,scale =0.15, column sep=normal,row sep=0.7cm,arrows=&amp;lt;-]&lt;br /&gt;
									%	 	 [arrows=&amp;lt;-]&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {		$ \frac{W_{41}}{&amp;gt;51} $};    \&amp;amp; \color{red}27  \&amp;amp;\cdots \\	\&amp;amp;  	\dots           \\&lt;br /&gt;
									%  		\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_{40}}{26} $};    &amp;amp;   &amp;amp;\cdots \\		\dots &amp;amp; \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_9}{26} $};    \&amp;amp; 121 \&amp;amp; 89  \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_8}{26} $};    \&amp;amp; 33 \&amp;amp; 91    \&amp;amp; 67 \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_7}{26} $};    \&amp;amp; 25 \&amp;amp; 49 \&amp;amp;\color{red}51    \&amp;amp; 101 \&amp;amp;197 \&amp;amp;205\&amp;amp;\cdots \\&lt;br /&gt;
									%								\dots \\	&lt;br /&gt;
									\node[circle,fill=brown!15,align=center,text=black]  {$ \frac{W_6}{24} $}; \&amp;amp; \color{red}9\&amp;amp; 19  \&amp;amp;37 \&amp;amp; 77  \&amp;amp;325   \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_5}{8} $}; \&amp;amp; 7\arrow[u]\arrow[urr] \&amp;amp;\color{red}15   \&amp;amp;29\arrow[ul]\arrow[ur] \&amp;amp; 61\arrow[ur]    \&amp;amp; \cdots \\		&lt;br /&gt;
									\node[circle,fill=blue!30,align=center,text=black]  {$ \frac{W_4}{6} $}; \&amp;amp; 11\arrow[u]\arrow[urr] \&amp;amp; 23\arrow[u]\arrow[urr]  \&amp;amp;\color{red}45 \&amp;amp;\color{red}93  \&amp;amp; 181  \&amp;amp; 373 \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=yellow!30,align=center,text=black]  {$ \frac{W_3}{6} $}; \&amp;amp;17\arrow[urr] \arrow[u]\arrow[urrrr] \&amp;amp; 35\arrow[u] \arrow[urr] \arrow[urrrr] \&amp;amp;  \color{red}69  \&amp;amp;  \color{red}75  \&amp;amp;  \color{red}141\&amp;amp; &lt;br /&gt;
									151  \&amp;amp;277 \&amp;amp; 301 \&amp;amp;\cdots \\&lt;br /&gt;
									\node[circle,fill=gray!30,align=center,text=black]  {$ \frac{W_2}{6} $ }; \&amp;amp;\color{red}3 \&amp;amp; 13\arrow[ul]\arrow[ur]\arrow[urrrrr]\&amp;amp; 53\arrow[ul] \arrow[urr]\&amp;amp; 113\arrow[u] \arrow[urrrr]\&amp;amp; \color{red}213 \&amp;amp; 227\arrow[u] \&amp;amp; \color{red}453  \&amp;amp; 853 \&amp;amp;\color{red}909 \&amp;amp; \cdots 	 \\&lt;br /&gt;
									\node  [circle,fill=red!30,align=center,text=black]  {$ \frac{W_1}{2} $ }; \&amp;amp; 5\arrow[u]\arrow[ur]\arrow[urr]\arrow[urrrr]\&amp;amp;\color{red}21 \&amp;amp; 85\arrow[ur]\arrow[urrrr,near end] \&amp;amp; 341\arrow[urr] \arrow[urrrrr] \&amp;amp; \color{red}1365   \&amp;amp; 5461 \&amp;amp;\cdots \\	   &lt;br /&gt;
									\node  [circle,fill=green,align=center,text=black]  {$ \frac{W_0}{2} $ }; \&amp;amp; \&amp;amp; \&amp;amp; 1\arrow[ull] \arrow[ul]\arrow[u]\arrow[ur] \arrow[urr] \arrow[urrr]    \\&lt;br /&gt;
									%	%\end{scriptsize}  &lt;br /&gt;
							\end{tikzcd}   }&lt;br /&gt;
						} &lt;br /&gt;
						\caption{F \textsc{Ilustracja} fragment grafu $\mathcal{F} $} \label{grafF}&lt;br /&gt;
					\end{figure}  &lt;br /&gt;
	&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Plik:CollatzConjecturebecomesTheorem2026-03-15.pdf</id>
		<title>Plik:CollatzConjecturebecomesTheorem2026-03-15.pdf</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Plik:CollatzConjecturebecomesTheorem2026-03-15.pdf"/>
				<updated>2026-03-15T18:20:52Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2026-03-03T06:51:54Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że [http://arxiv.org/abs/2310.13035 dowód] hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture&lt;br /&gt;
''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' &lt;br /&gt;
is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic.&amp;lt;br /&amp;gt; &lt;br /&gt;
 end of Abstract 01/10/2025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Have a look==&lt;br /&gt;
&amp;lt;math&amp;gt;			\begin{figure}	&lt;br /&gt;
						\resizebox{\textwidth}{!}{ &lt;br /&gt;
							{\footnotesize  \begin{tikzcd}[ampersand replacement=\&amp;amp;,scale =0.15, column sep=normal,row sep=0.7cm,arrows=&amp;lt;-]&lt;br /&gt;
									%	 	 [arrows=&amp;lt;-]&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {		$ \frac{W_{41}}{&amp;gt;51} $};    \&amp;amp; \color{red}27  \&amp;amp;\cdots \\	\&amp;amp;  	\dots           \\&lt;br /&gt;
									%  		\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_{40}}{26} $};    &amp;amp;   &amp;amp;\cdots \\		\dots &amp;amp; \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_9}{26} $};    \&amp;amp; 121 \&amp;amp; 89  \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_8}{26} $};    \&amp;amp; 33 \&amp;amp; 91    \&amp;amp; 67 \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_7}{26} $};    \&amp;amp; 25 \&amp;amp; 49 \&amp;amp;\color{red}51    \&amp;amp; 101 \&amp;amp;197 \&amp;amp;205\&amp;amp;\cdots \\&lt;br /&gt;
									%								\dots \\	&lt;br /&gt;
									\node[circle,fill=brown!15,align=center,text=black]  {$ \frac{W_6}{24} $}; \&amp;amp; \color{red}9\&amp;amp; 19  \&amp;amp;37 \&amp;amp; 77  \&amp;amp;325   \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_5}{8} $}; \&amp;amp; 7\arrow[u]\arrow[urr] \&amp;amp;\color{red}15   \&amp;amp;29\arrow[ul]\arrow[ur] \&amp;amp; 61\arrow[ur]    \&amp;amp; \cdots \\		&lt;br /&gt;
									\node[circle,fill=blue!30,align=center,text=black]  {$ \frac{W_4}{6} $}; \&amp;amp; 11\arrow[u]\arrow[urr] \&amp;amp; 23\arrow[u]\arrow[urr]  \&amp;amp;\color{red}45 \&amp;amp;\color{red}93  \&amp;amp; 181  \&amp;amp; 373 \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=yellow!30,align=center,text=black]  {$ \frac{W_3}{6} $}; \&amp;amp;17\arrow[urr] \arrow[u]\arrow[urrrr] \&amp;amp; 35\arrow[u] \arrow[urr] \arrow[urrrr] \&amp;amp;  \color{red}69  \&amp;amp;  \color{red}75  \&amp;amp;  \color{red}141\&amp;amp; &lt;br /&gt;
									151  \&amp;amp;277 \&amp;amp; 301 \&amp;amp;\cdots \\&lt;br /&gt;
									\node[circle,fill=gray!30,align=center,text=black]  {$ \frac{W_2}{6} $ }; \&amp;amp;\color{red}3 \&amp;amp; 13\arrow[ul]\arrow[ur]\arrow[urrrrr]\&amp;amp; 53\arrow[ul] \arrow[urr]\&amp;amp; 113\arrow[u] \arrow[urrrr]\&amp;amp; \color{red}213 \&amp;amp; 227\arrow[u] \&amp;amp; \color{red}453  \&amp;amp; 853 \&amp;amp;\color{red}909 \&amp;amp; \cdots 	 \\&lt;br /&gt;
									\node  [circle,fill=red!30,align=center,text=black]  {$ \frac{W_1}{2} $ }; \&amp;amp; 5\arrow[u]\arrow[ur]\arrow[urr]\arrow[urrrr]\&amp;amp;\color{red}21 \&amp;amp; 85\arrow[ur]\arrow[urrrr,near end] \&amp;amp; 341\arrow[urr] \arrow[urrrrr] \&amp;amp; \color{red}1365   \&amp;amp; 5461 \&amp;amp;\cdots \\	   &lt;br /&gt;
									\node  [circle,fill=green,align=center,text=black]  {$ \frac{W_0}{2} $ }; \&amp;amp; \&amp;amp; \&amp;amp; 1\arrow[ull] \arrow[ul]\arrow[u]\arrow[ur] \arrow[urr] \arrow[urrr]    \\&lt;br /&gt;
									%	%\end{scriptsize}  &lt;br /&gt;
							\end{tikzcd}   }&lt;br /&gt;
						} &lt;br /&gt;
						\caption{F \textsc{Ilustracja} fragment grafu $\mathcal{F} $} \label{grafF}&lt;br /&gt;
					\end{figure}  &lt;br /&gt;
	&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Main_page</id>
		<title>Main page</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Main_page"/>
				<updated>2026-02-27T12:09:49Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;p style=&amp;quot;text-align: left;&amp;quot;&amp;gt; [[Plik:Flag of Poland.svg.png]][[ Strona główna]] &lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; [[Plik:ukrainian_language.png|22px]]&lt;br /&gt;
[[Головна сторінка]] &amp;lt;/p&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don't be afraid of the calculus of programs, because it has a colossal future ahead of it!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Collatz conjecture  [https://lem12.uksw.edu.pl/images/0/02/CollatzConjecturebecomesTheorem2026Jan29.pdf has a proof]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These pages are about four research programs that are intertwined each other. Two of projects have quite a history:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|♥ ''Algorithmic Logic'' - also &amp;lt;big&amp;gt;program calculus&amp;lt;/big&amp;gt;. Its aim is to study the laws of reasoning about programs,&amp;lt;br /&amp;gt;&lt;br /&gt;
♥ '''[[Media:LeafletAlgorithmicLogic.pdf| Leaflet on Algorithmic Logic]]'''&lt;br /&gt;
&lt;br /&gt;
[[Algorithmic Logic]]&lt;br /&gt;
|♥ Loglan'82- it is an object programming language that offers solutions of many problems of importance;&amp;lt;br /&amp;gt;&lt;br /&gt;
• Problem of safe and efficient dealocation of not used objects. • Problem of static semantics of modules of classes that can be nested and extended. • An original protocol of communicating objects of processes. (''alien call'' protocols). &lt;br /&gt;
designed more than 30 years ago.&amp;lt;br /&amp;gt;&lt;br /&gt;
♥ [[Loglan'82 project]]&amp;lt;br /&amp;gt;&lt;br /&gt;
[[Media:LeafletLoglan.pdf|♥ have a look at a leaflet Loglan ]]&lt;br /&gt;
|-&lt;br /&gt;
|♥ LEM - a project that is aimed at a new programming language and environment, The language LEM is to apply the results of Loglan'82 project and to adapt  the achievements of object programming languages of younger generations such as Java, C++, C#, Python, etc.&lt;br /&gt;
LEM may turn out to be useful in the works of another larger project ''SpecVer''&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[LEM]]&lt;br /&gt;
|♥ SpecVer - the project . &lt;br /&gt;
SpecVer project is to bring an environment for software engineers and mathematicians. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[SpecVer in english]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2026-02-27T12:06:05Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że [https://lem12.uksw.edu.pl/images/0/02/CollatzConjecturebecomesTheorem2026Jan29.pdf dowód] hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture&lt;br /&gt;
''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' &lt;br /&gt;
is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic.&amp;lt;br /&amp;gt; &lt;br /&gt;
 end of Abstract 01/10/2025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Have a look==&lt;br /&gt;
&amp;lt;math&amp;gt;			\begin{figure}	&lt;br /&gt;
						\resizebox{\textwidth}{!}{ &lt;br /&gt;
							{\footnotesize  \begin{tikzcd}[ampersand replacement=\&amp;amp;,scale =0.15, column sep=normal,row sep=0.7cm,arrows=&amp;lt;-]&lt;br /&gt;
									%	 	 [arrows=&amp;lt;-]&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {		$ \frac{W_{41}}{&amp;gt;51} $};    \&amp;amp; \color{red}27  \&amp;amp;\cdots \\	\&amp;amp;  	\dots           \\&lt;br /&gt;
									%  		\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_{40}}{26} $};    &amp;amp;   &amp;amp;\cdots \\		\dots &amp;amp; \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_9}{26} $};    \&amp;amp; 121 \&amp;amp; 89  \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_8}{26} $};    \&amp;amp; 33 \&amp;amp; 91    \&amp;amp; 67 \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_7}{26} $};    \&amp;amp; 25 \&amp;amp; 49 \&amp;amp;\color{red}51    \&amp;amp; 101 \&amp;amp;197 \&amp;amp;205\&amp;amp;\cdots \\&lt;br /&gt;
									%								\dots \\	&lt;br /&gt;
									\node[circle,fill=brown!15,align=center,text=black]  {$ \frac{W_6}{24} $}; \&amp;amp; \color{red}9\&amp;amp; 19  \&amp;amp;37 \&amp;amp; 77  \&amp;amp;325   \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_5}{8} $}; \&amp;amp; 7\arrow[u]\arrow[urr] \&amp;amp;\color{red}15   \&amp;amp;29\arrow[ul]\arrow[ur] \&amp;amp; 61\arrow[ur]    \&amp;amp; \cdots \\		&lt;br /&gt;
									\node[circle,fill=blue!30,align=center,text=black]  {$ \frac{W_4}{6} $}; \&amp;amp; 11\arrow[u]\arrow[urr] \&amp;amp; 23\arrow[u]\arrow[urr]  \&amp;amp;\color{red}45 \&amp;amp;\color{red}93  \&amp;amp; 181  \&amp;amp; 373 \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=yellow!30,align=center,text=black]  {$ \frac{W_3}{6} $}; \&amp;amp;17\arrow[urr] \arrow[u]\arrow[urrrr] \&amp;amp; 35\arrow[u] \arrow[urr] \arrow[urrrr] \&amp;amp;  \color{red}69  \&amp;amp;  \color{red}75  \&amp;amp;  \color{red}141\&amp;amp; &lt;br /&gt;
									151  \&amp;amp;277 \&amp;amp; 301 \&amp;amp;\cdots \\&lt;br /&gt;
									\node[circle,fill=gray!30,align=center,text=black]  {$ \frac{W_2}{6} $ }; \&amp;amp;\color{red}3 \&amp;amp; 13\arrow[ul]\arrow[ur]\arrow[urrrrr]\&amp;amp; 53\arrow[ul] \arrow[urr]\&amp;amp; 113\arrow[u] \arrow[urrrr]\&amp;amp; \color{red}213 \&amp;amp; 227\arrow[u] \&amp;amp; \color{red}453  \&amp;amp; 853 \&amp;amp;\color{red}909 \&amp;amp; \cdots 	 \\&lt;br /&gt;
									\node  [circle,fill=red!30,align=center,text=black]  {$ \frac{W_1}{2} $ }; \&amp;amp; 5\arrow[u]\arrow[ur]\arrow[urr]\arrow[urrrr]\&amp;amp;\color{red}21 \&amp;amp; 85\arrow[ur]\arrow[urrrr,near end] \&amp;amp; 341\arrow[urr] \arrow[urrrrr] \&amp;amp; \color{red}1365   \&amp;amp; 5461 \&amp;amp;\cdots \\	   &lt;br /&gt;
									\node  [circle,fill=green,align=center,text=black]  {$ \frac{W_0}{2} $ }; \&amp;amp; \&amp;amp; \&amp;amp; 1\arrow[ull] \arrow[ul]\arrow[u]\arrow[ur] \arrow[urr] \arrow[urrr]    \\&lt;br /&gt;
									%	%\end{scriptsize}  &lt;br /&gt;
							\end{tikzcd}   }&lt;br /&gt;
						} &lt;br /&gt;
						\caption{F \textsc{Ilustracja} fragment grafu $\mathcal{F} $} \label{grafF}&lt;br /&gt;
					\end{figure}  &lt;br /&gt;
	&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Plik:CollatzConjecturebecomesTheorem2026Jan29.pdf</id>
		<title>Plik:CollatzConjecturebecomesTheorem2026Jan29.pdf</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Plik:CollatzConjecturebecomesTheorem2026Jan29.pdf"/>
				<updated>2026-02-27T12:01:59Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: AndrzejSalwicki przesłano nową wersję pliku „Plik:CollatzConjecturebecomesTheorem2026Jan29.pdf“&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Logika_Algorytmiczna</id>
		<title>Logika Algorytmiczna</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Logika_Algorytmiczna"/>
				<updated>2026-02-25T12:40:11Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;p style=&amp;quot;text-align: right;&amp;quot;&amp;gt;&amp;lt;small&amp;gt;''Felix qui potuit rerum cognoscere causas'' &amp;lt;/small&amp;gt; &amp;lt;/p&amp;gt;&lt;br /&gt;
=Próba zmian&lt;br /&gt;
= Wprowadzenie =&lt;br /&gt;
Zmiana kontrolna Środa 21 maja 2025 g. 19:25&lt;br /&gt;
Logika algorytmiczna AL jest  ''rachunkiem logicznym''.  Nie jest to byle jaki system logiczny. Stworzony został przez nas  jako narzedzie pomocne i niezbędne w pracy nad oprogramowaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
Rachunek programów tj. logika algorytmiczna:&lt;br /&gt;
* uzupełnia język o programy,&lt;br /&gt;
* program jest wyrażeniem zbudowanym z programów atomowych - instrukcji przypisania przy pomocy kilku operatorów programotwócztch: while, if, złożenie,&lt;br /&gt;
* program może poprzedzać formułę i takie wyrażenie jest także formułą,&lt;br /&gt;
&lt;br /&gt;
Rachunek programów AL umożliwia:&lt;br /&gt;
# Wyrażenie własności programu przez odpowiednio napisaną formułę języka systemu AL [[Wyrażalność semantycznych własności programów]]&lt;br /&gt;
# Przeprowadzanie dowodów formuł wyrażających ważne semantyczne własności programów, [[Przykłady dowodów]]. &lt;br /&gt;
# Podanie aksjomatów dla wielu struktur danych.  Aksjomaty takie wykluczają struktury niechciane, czy wręcz struktury patologiczne.[[Aksjomaty struktur]]&lt;br /&gt;
# Specyfikację oprogramowania, [[SpecVer]]&lt;br /&gt;
# Weryfikację oprogramowania względem ustalonej specyfikacji.&lt;br /&gt;
# Aksjomatyczny opis semantyki danego języka programowania.[[Aksjomatyczna definicja języka programowania]]&lt;br /&gt;
# i wiele innych rzeczy.&lt;br /&gt;
[[Plik:4logiki.jpg|thumb|center |750px| Rys. 1  Cztery systemy logiczne ]]&lt;br /&gt;
Powyższy rysunek 1 ilustruje relacje zachodzące pomiędzy tymi czterema rachunkami logicznymi. Strzałki wskazują na zachodzenie następującej relacji &amp;lt;math&amp;gt;\mathcal{L}\rightarrow\mathcal{L}'&amp;lt;/math&amp;gt; pomiędzy dwoma rachunkami logicznymi &amp;lt;math&amp;gt;\mathcal{L}&amp;lt;/math&amp;gt; i &amp;lt;math&amp;gt;\mathcal{L}'&amp;lt;/math&amp;gt;: ''Każda tautologia'' &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; ''rachunku'' &amp;lt;math&amp;gt;\mathcal{L}&amp;lt;/math&amp;gt; ''staje się tautologią rachunku ''&amp;lt;math&amp;gt;\mathcal{L}&amp;lt;/math&amp;gt;' ''po zastąpieniu atomów formuły'' &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; ''przez formuły rachunku'' &amp;lt;math&amp;gt;\mathcal{L}&amp;lt;/math&amp;gt;. Nieco więcej informacji uzyskamy porównując zbiory wyrażeń poprawnie zbudowanych &amp;lt;math&amp;gt;\mathcal{WFF} &amp;lt;/math&amp;gt;.  &amp;lt;br /&amp;gt;&lt;br /&gt;
Języki tych rachunków logicznych różnią się. Każdy język jest parą &amp;lt;alfabet, zbiór wyrażen poprawnie zbudowanych&amp;gt;. Zwróćmy uwagę na to, że za każdym razem struktura zbioru wyrażeń poprawnie zbudowanych &amp;lt;math&amp;gt;\mathcal{WFF} &amp;lt;/math&amp;gt; (''ang''. well formed formulas) jest inna. &amp;lt;br /&amp;gt;&lt;br /&gt;
Oznaczenia przyjete na rysunku: &amp;lt;math&amp;gt;\mathcal{L}&amp;lt;/math&amp;gt; - język, &amp;lt;math&amp;gt;\mathcal{A}&amp;lt;/math&amp;gt; - alfabet, &amp;lt;math&amp;gt;\mathcal{T}&amp;lt;/math&amp;gt; - zbiór termów (wyrażeń arytmetycznych, obiektowych,...), &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; - zbiór formuł, &amp;lt;math&amp;gt;\mathcal{P}&amp;lt;/math&amp;gt; - zbiór programów.&lt;br /&gt;
[[Plik:AxiomPL.jpg|thumb|750px| Rys. 2  Aksjomaty rachunku zdań ]]&lt;br /&gt;
[[Plik:axiomsFOL-AL.jpg|thumb |750px|  Rys. 3  Aksjomaty rachunku predykatów(Ax12 i Ax13) i rachunku programów ]]&lt;br /&gt;
[[Plik:inferenceRules.jpg| thumb  |750px| Rys. 4 Reguły wnioskowania ]]&lt;br /&gt;
Zbiór formuł logiki algorytmicznej zawiera w sobie wszystkie formuły pierwszego rzędu i ponadto, jest zamknięty ze względu na poprzedzanie formuły programem. Jeśli &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; jest formułą i &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; jest programem to wyrazenie postaci &amp;lt;math&amp;gt;K\alpha&amp;lt;/math&amp;gt; jest formułą logiki algorytmicznej, krócej, formułą algorytmiczna.&amp;lt;br /&amp;gt;&lt;br /&gt;
Jak takiej formule &amp;lt;math&amp;gt;K\alpha&amp;lt;/math&amp;gt; przypisać wartość logiczną prawda lub fałsz?&lt;br /&gt;
[[Plik:Kalfa.jpg |thumb|left|300px|Rys. 5  Wyznaczanie wartośći formuły &amp;lt;math&amp;gt;K\alpha&amp;lt;/math&amp;gt; ]]&lt;br /&gt;
Rysunek 5 powinien wszystko wyjaśnić.Pozostaje jednak przypadek gdy obliczenie programu K nie daje wyniku, z powodu zapętlenia się programu lub innego błędu. Oczywiście nie możemy wtedy twierdzić, że ''dla danych v, obliczenie programu K kończy się pomyślnie i wyniki spełniają warunek &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;''. A więc w tym przypadku wartościa formuły &amp;lt;math&amp;gt;K\alpha&amp;lt;/math&amp;gt; jest fałsz.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
O logice algorytmicznej możemy też powiedzieć, że jest [[rachunek programów|''rachunkiem programów'']].   Język logiki algorytmicznej zawiera programy i formuły algorytmiczne. '''Ważne''' jest to, że ''każda semantyczna własność programów np. poprawność, równowazność, kończenie obliczeń lub przeciwnie zapętlanie, ... może być wyrażona przez odpowiednią formułę''. Pozwala to zamienić zadanie wykazania, że pewien program  &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; posiada pewną własnośc semantyczną &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; na zadanie udowodnić formułę &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; należąca do języka logiki algorytmicznej. &amp;lt;br /&amp;gt;'''Przykład''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Własność: ''Dla każdych danych &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;, jeśli  program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; rozpoczyna obliczenia z danymi spełniającymi warunek &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; to jego obliczenie zakończy się (nie będzie zapętlenia, ani przerwania obliczeń) i jego wyniki spełniają warunek &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;'', jest wyrażana formułą &amp;lt;math&amp;gt;\alpha \rightarrow K\beta&amp;lt;/math&amp;gt;. Nie musimy więc podejmować trudu testowania czy dla kazdych danych obliczenie programu K będzie skończone i ... &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Formuły tworzą algebrę z działaniami: konkatenacji, alternatywy, negacji i implikacji oraz z działaniami nieskończonymi tj. kwantyfikatorami, ponadto programy są modalnościami. Programy też tworzą algebrę: działaniami tej algebry są iteracja, rozgałęzienie i złożenie programów. Mamy więc do czynienia ze splotem dwu algebr. Możemy go nazwać rachunkiem programów.  Zadaniem logiki algorytmicznej jest poszukiwanie ''praw rachunku programów''. &lt;br /&gt;
&lt;br /&gt;
Celem jest zebranie praw i reguł wnioskowania, które umożliwią analizę algorytmów i wydawanie opinii o ich własnościach semantycznych, bez wykonywania obliczeń, na podstawie samego tekstu algorytmu i aksjomatów struktury danych w jakiej dany program ma byc interpretowany.&lt;br /&gt;
&lt;br /&gt;
'''Przykład'''&lt;br /&gt;
Rozpatrzmy prosty program&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;small&amp;gt;    (* Dane:  x&amp;gt;0  i  y&amp;gt;0  liczby naturalne *)&lt;br /&gt;
    '''Deklaracje:'''  typ(x, y, n, m, r, q, max)='''N''' &amp;amp;  typ(n_mniejsze)=Boolean &lt;br /&gt;
    &lt;br /&gt;
    n:=x; m:=y;&lt;br /&gt;
    '''while''' n ≠ m '''do'''&lt;br /&gt;
       '''''Oznaczenie''''' niech l=max(n,m)&lt;br /&gt;
       r:=0; &lt;br /&gt;
       '''while''' r ≠n '''and''' r ≠m '''do'''  r:=r+1  '''od'''; &lt;br /&gt;
       '''if''' r=n '''then''' n_miejsze:=true; max:=m '''else''' n_mniejsze:=false; max:=n '''fi'''; &lt;br /&gt;
       '''''Stwierdzenie''''' (n&amp;lt;m &amp;amp; m=max(n,m) lub m&amp;lt;n &amp;amp; n=max(n,m))&lt;br /&gt;
       q:=0; &lt;br /&gt;
       '''while''' r≠max  '''do'''  r:= r+1; q:=q+1  '''od'''; &lt;br /&gt;
       '''''Stwierdzenie''''' q = |m-n| &amp;amp; (1 ≤ q &amp;lt; max(n,m))&amp;amp; r=max(n,m)&lt;br /&gt;
       '''if''' n_mniejsze '''then''' m:=q '''else''' n := q '''fi''' &lt;br /&gt;
       '''''Stwierdzenie''''' max(n,m) &amp;lt;  l&lt;br /&gt;
   '''od''' ( wynik = n) &lt;br /&gt;
(* Wynik:  nwd(x,y)   *)&amp;lt;/small&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Co robi ten program? Czy to jest pytanie dobrze postawione?&lt;br /&gt;
Czy obliczenie tego programu jest skończone dla każdych danych &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; i &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt;?&lt;br /&gt;
Czym są te dane? Jakie znaczenie mają operacje - i + oraz stała 1? Jakie znaczenie ma predykat &amp;lt;?&lt;br /&gt;
&lt;br /&gt;
Wiele osób powie,że przecież to proste. Powyższy program oblicza największy wspólny dzielnik liczb naturalnych &amp;lt;math&amp;gt;xP&amp;lt;/math&amp;gt; i &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt;. No tak, ale skąd wiesz, że środowisko w którym wykonujesz ten program nie jest podejrzane? Na kolejnej stronie możesz zobaczyć klasę która implementuje operacje dodawania liczb naturalnych i relację równości w niestandardowy sposób. Powyższy program w otoczeniu tej klasy zachowuje się niestandardowo. Po pierwsze, obliczenia tego programu sa nieskończone dla pewnych danych. Powiesz mi, ta klasa nie spełnia aksjomatów liczb naturalnych? Otóż '''spełnia'''. Jakie więc aksjomaty należy wziąć pod uwagę i o co mamy pytać?   &lt;br /&gt;
&lt;br /&gt;
Zanim zaczniesz analizować działanie programu powinieneś zdać sobie sprawę z kilku rzeczy:&lt;br /&gt;
# Program zachowuje się różnie w różnych otoczeniach. Czym jest otoczenie? To zależy, może to być pierwotny typ danych np. integer w wielu językach programowania lub struktura danych opisana za pomocą pewnej klasy.&lt;br /&gt;
# Podczas analizy powinniśmy rozpatrywać program &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; w parze z jego otoczeniem &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;. Podczas analizy nie wystarczy nam nazwa otoczenia, ani sygnatura nazywana przez programistów interfejsem (ang, ''interface'').&lt;br /&gt;
# W procesie analizy musimy korzystać z własności otoczenia np. z przemienności i łączności dodawania.&lt;br /&gt;
# Musimy też sobie zadawać sprawę, że wielu podstawowych własności nie da się wyrazić formułami pierwszego rzędu.&lt;br /&gt;
# '''Własności algorytmiczne naszych programów wynikają z własności algorytmicznych otoczenia.'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zechciej przejść na stronę [[Euklides]] by poznać nasze argumenty.&lt;br /&gt;
&lt;br /&gt;
== Program logiki algorytmicznej ==&lt;br /&gt;
Zadaniem logiki algorytmicznej jest dostarczenie narzędzi do analizowania semantycznych własności programów takich jak: własność stopu, poprawność programu, etc.&lt;br /&gt;
W języku logiki algorytmicznej znajdujemy trzy zbiory: zbiór formuł, zbiór wyrażeń (zbiór termów) i zbiór programów (zbiór algorytmów).&lt;br /&gt;
'''Uwaga''' W języku logiki zdaniowej (rachunku zdań) rozważany jest jeden tylko zbiór wyrażeń poprawnie zbudowanych, jest to zbiór formuł (zdaniowych). Formuły stanowią najmniejszy zbiór napisów zawierający zbiór zmiennych zdaniowych i zamknięty ze względu na operatory logiczne.&lt;br /&gt;
W jeżyku logiki pierwszego rzędu zb→ór wyrażen poprawnie zbudowanych jest suma dwu rozłącznych zbiorów: zbioru termów(inaczej zbiór wyrażen nazwowych) i zbioru formuł. W rachunku programów (czyli logice algorytmicznej) w naturalny sposób pojaia się zbiór algorytmów. '''koniec uwagi''' &lt;br /&gt;
Znaczeniem programu &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; jest funkcja ze zbioru &amp;lt;math&amp;gt;W&amp;lt;/math&amp;gt; wartościowań zmiennych w ten sam zbiór. Zazwyczaj funkcję tę określa się przy pomocy pojęcia [[obliczenia programu]].&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Zastosowania ==&lt;br /&gt;
Stosując logikę algorytmiczną czyli rachunek programów potrafimy odpowiedziec twierdząco na nastepujące pytania:&lt;br /&gt;
# Czy można podać aksjomaty i reguły wnioskowania, które opiszą semantykę operacyjną języka programowania?&lt;br /&gt;
# Czy (i jakie) własności struktur danych (systemów algebraicznych) są wyrażalne w języku logiki algorytmicznej?&lt;br /&gt;
# Czy (i jakie) własności programów są wyrażalne formułami algorytmicznymi?&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ad 2. W matematyce rozważa się wiele własności ważnych struktur algebraicznych, których nie można wyrazić w języku pierwszego rzędu. Większość z nich może być wyrażona przy pomocy formuł algorytmicznych &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* bycie liczbą naturalną,&lt;br /&gt;
* aksjomat Archimedesa&lt;br /&gt;
* aksjomat ciał charakterystyki zero&lt;br /&gt;
* aksjomat grup torsyjnych&lt;br /&gt;
* aksjomat grup cyklicznych&lt;br /&gt;
i in.&amp;lt;br /&amp;gt;&lt;br /&gt;
Dla informatyków niezwykle ważny jest fakt, że niemal wszystkie napotykane w programach struktury danych mogą być scharakteryzowane przy pomocy formuł algorytmicznych&lt;br /&gt;
* s jest stosem (skończonym)&lt;br /&gt;
* q jest kolejką FIFO skończoną&lt;br /&gt;
* s jest drzewem binarnym&lt;br /&gt;
* d jest drzewem binarnych poszukiwań&lt;br /&gt;
* q jest kolejką priorytetową&lt;br /&gt;
* d jest strukturą słownika (ang. dictionary)&lt;br /&gt;
* k jest kopcem&lt;br /&gt;
itd.&lt;br /&gt;
== Inne logiki programów ==&lt;br /&gt;
Możesz się zapytać jak się ma rachunek programów (tj. logika algorytmiczna) do innych logik programów : np. rachunek Floyda, logika Hoare'a, rachunek najsłabszego warunku wstępnego Dijkstry, logiki dynamicznaj, etc.?&lt;br /&gt;
&lt;br /&gt;
[[calculus of Floyd|rachunek  Floyda]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[logic of Hoare|logika Hoare'a]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
calculus of weakest precondition of Dijkstra&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[dynamic logic]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Uwagi historyczne ==&lt;br /&gt;
Algorytmy pojawiły sie kilka tysięcy lat temu. W Babilonie, Egipcie i Grecji.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
W czasach nowożytnych studia nad algorytmami podjęli Goedel, Turing, Church, Markov, Kołmogorov i wielu innych. Szkoda, że Tarski nie rozszerzył swych badań nad semantyką na funkcje obliczalne. Szkoda, że studia funkcji obliczalnych skupiły się na samych funkcjach, zaniedbując aspekt językowy. Prawie nie zajmowano się językiem służcym do definiowania funkcji rekurencyjnych. Alonzo Curch był chyba wyjatkiem? D. Kleene był blisko - jego definicja operatora minimum ograniczonego to przeciez petla FOR, a operacja minimum efektywnego to pętla WHILE. Warto pamietac twierdzenie S. Kleene z r. 1942 o tym, że zbiór funkcji obliczalnych jesli jest zamknięty ze względu na superpozycję i minimum efektywne  ( i zawiera kilka funkcji poczatkowych) to definiowanie funkcji obliczalnych przez rekursję prostą może być zastąpione przez operację minimum efektywnego.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Po drugiej wojnie światowej gdy pojawiły się komputery (zwane wtedy maszynami matematycznymi), ich programy zapisywano w kodzie maszynowym lub (później) w assemblerze. Trudno było dostrzec struktury i prawidłowości. W maszynie von Neumanna wszystko jest ciągiem bitów - liczbą. Ale pamiętam odczyt Antoniego Mazurkiewicza (ok 1960 r.) i jego dowód poprawności algorytmu z jedną pętla. Algorytm miał obliczyć sumę liczb zapisanych w tablicy. Kod maszyny XYZ-1 był bardzo ubogi. Program wymagał pobrania instrukcji &amp;quot;''weź kolejną komórkę pamięci do Akumulatora''&amp;quot; do rejestru Akumulator, zwiększenia adresu i zapisaniu tak zmienionej instrukcji w pamięci rozkazów na swoim pierwotnym miejscu. Program był więc ciągiem słów binarnych - każde słowo można jednak interpretować dwoiście, jako liczbę lub jako instrukcję. Nie ma w tym żadnej widocznej struktury.&amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Prekursorzy logiki algorytmicznej&amp;lt;br /&amp;gt;&lt;br /&gt;
Janov - jego praca poprzedza zdaniową logikę dynamiczną. Przedmiotem analizy są schematy programów (zapisywane w bardzo specjalny sposób) i relacja równoważności schematów. Dzisiaj powiedzielibyśmy, że schemat programu jest grafem skończonym. Wierzchołkom grafu przyporządkowano albo zmienną programowa albo formułę zdaniowa. Praca Janova jest nie tylko trudno dostępna, ale przede wszystkim mało czytelna. W książce A.P. Ershova można znaleźć przystępną ekspozycję teorii Janova.&amp;lt;br /&amp;gt;&lt;br /&gt;
Engeler(1967) - zauważył, że własność stopu programu można wyrazić jako formułę logiki &amp;lt;math&amp;gt;L_{\omega1\,\omega} &amp;lt;/math&amp;gt;, a dokładniej jako nieskończoną alternatywę formuł otwartych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Warto też wspomnieć o pracach Glushkova dotyczących systemów algebr algorytmicznych i książkę Helmuta Thielego. &amp;lt;br /&amp;gt;&lt;br /&gt;
''Rasiowa'' - w książce ''Mathematics of metamathematics''(1963) str. 218 sformułowała podstawową własność instrukcji przypisania. Niech &amp;lt;math&amp;gt; s &amp;lt;/math&amp;gt; oznacza jakieś odwzorowanie &amp;lt;math&amp;gt; s\colon V \to T &amp;lt;/math&amp;gt; gdzie &amp;lt;math&amp;gt; V &amp;lt;/math&amp;gt; jest zbiorem zmiennych indywiduowych, a &amp;lt;math&amp;gt; T &amp;lt;/math&amp;gt; jest zbiorem termów. Odwzorowanie &amp;lt;math&amp;gt; s &amp;lt;/math&amp;gt; nazywa się podstawieniem. Jeśli &amp;lt;math&amp;gt; \tau &amp;lt;/math&amp;gt; oznacza jakiś term to &amp;lt;math&amp;gt; s\,\tau &amp;lt;/math&amp;gt; oznacza wyrażenie powstające z termu &amp;lt;math&amp;gt; \tau &amp;lt;/math&amp;gt; przez równoczesne zastąpienie wszystkich wystąpień zmiennych indywiduowych &amp;lt;math&amp;gt; \tau &amp;lt;/math&amp;gt; przez odpowiednie wartości odwzorowania &amp;lt;math&amp;gt; s &amp;lt;/math&amp;gt;. Oznaczmy term &amp;lt;math&amp;gt; \tau &amp;lt;/math&amp;gt; przez &amp;lt;math&amp;gt; \tau(x_1,\dots,x_n)&amp;lt;/math&amp;gt; podkreślając, że zmienne &amp;lt;math&amp;gt; x_1,\dots,x_n &amp;lt;/math&amp;gt; to są wszystkie zmienne występujące w termie &amp;lt;math&amp;gt; \tau &amp;lt;/math&amp;gt;. Wynik równoczesnego podstawienia za zmienne &amp;lt;math&amp;gt; x_1,\dots,x_n &amp;lt;/math&amp;gt; występujące w termie &amp;lt;math&amp;gt; \tau &amp;lt;/math&amp;gt;, termów &amp;lt;math&amp;gt; s(x_1),\dots,s(x_n) &amp;lt;/math&amp;gt;   &amp;lt;br /&amp;gt; oznaczmy &amp;lt;math&amp;gt; s\tau &amp;lt;/math&amp;gt;. Mamy więc równość &amp;lt;math&amp;gt; s\tau(x_1,\dots,x_n)= \tau(s(x_1),\dots,s(x_n)) &amp;lt;/math&amp;gt;. Można bez trudu udowodnić, że wynik jest tez termem. &lt;br /&gt;
Przypomnijmy teraz ten element definicji pojęcia spełniania (Tarski): dla ustalonej interpretacji symboli funkcyjnych &amp;lt;math&amp;gt; R &amp;lt;/math&amp;gt; i ustalonego wartościowania zmiennych &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt;, term &amp;lt;math&amp;gt; \tau  &amp;lt;/math&amp;gt; wyznacza funkcję ze zbioru wartościowań w zbiór wartoścowań.&lt;br /&gt;
Teraz możemy sformułować &amp;lt;br /&amp;gt;&lt;br /&gt;
Niech &amp;lt;math&amp;gt; R &amp;lt;/math&amp;gt; będzie dowolnie ustaloną interpretacją symboli funkcyjnych, niech &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; będzie dowolnym wartościowaniem zmiennych. Dla każdego podstawienia &amp;lt;math&amp;gt; s &amp;lt;/math&amp;gt; i każdego termu &amp;lt;math&amp;gt; \tau &amp;lt;/math&amp;gt; zachodzi równość &lt;br /&gt;
&amp;lt;math&amp;gt; s\tau_R(v)=\tau_R(s_R(v))  &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Zauważmy, że w czasie pisania ksiązki ''Mathematics of metamathematics''(przed r. 1963) ani Rasiowa ani Sikorski nie mieli pojęcia o programowaniu. A jednak, gdy zapisać podstawienie &amp;lt;math&amp;gt; s &amp;lt;/math&amp;gt; w trochę innej formie &amp;lt;math&amp;gt; \{x_1:=\tau_1 \&amp;amp; \dots \&amp;amp; x_n:=\tau_n \} &amp;lt;/math&amp;gt; i zrozumieć, że wartościowanie zmiennych to to samo co stan pamięci, a interpretacja &amp;lt;math&amp;gt; R &amp;lt;/math&amp;gt; to po prostu jednostka arytmetyczna komputera, to wszystko trafia na swoje miejsce.&lt;br /&gt;
&lt;br /&gt;
== Bibliografia ==&lt;br /&gt;
Książki&lt;br /&gt;
&lt;br /&gt;
# [AlgoLog] [[Media:Algorithmic_Logic.pdf | {{cytuj książkę |odn=tak| nazwisko = Mirkowska| imię = Grażyna | nazwisko2 = Salwicki | imię2 = Andrzej | tytuł = Algorithmic Logic | wydawca = PWN | miejsce = Warszawa | data = 1987 | strony = 345}}]] &lt;br /&gt;
# [LogProg1] [[Media:LogikaAlgorytmiczna_1z2.pdf | {{cytuj książkę | odn=tak |imię2=Andrzej | nazwisko2=Salwicki | imię=Grażyna | nazwisko=Mirkowska| tytuł=Logika Algorytmiczna dla Programistów|wydawca=WNT | miejsce=Warszawa| data=1992|strony=294 }}]] cz.1&amp;lt;br /&amp;gt;&lt;br /&gt;
[[book Algorithmic Logic  ]]&lt;br /&gt;
# [LogProg2] [[Media:LogikaAlgorytmiczna_2z2.pdf | {{cytuj książkę | odn=tak |imię2=Andrzej | nazwisko2=Salwicki | imię=Grażyna | nazwisko=Mirkowska| tytuł=Logika Algorytmiczna dla Programistów|wydawca=WNT | miejsce=Warszawa| data=1992|strony=294 }}]] cz.2&lt;br /&gt;
#[AL4software] [[Media:AlgoLogic.pdf| {{cytuj książkę | odn=tak |imię2=Andrzej | nazwisko2=Salwicki | imię=Grażyna | nazwisko=Mirkowska| tytuł=Algorithmic Logic for Software Construction and Verification|wydawca=Dąbrowa Research | miejsce=Dąbrowa Leśna| data=2014|strony=154 }}]]&lt;br /&gt;
# [CentrumBanachAL] [[ Media:bcp211.pdf  |{{Cytuj książkę |odn=tak| nazwisko = Banachowski | imię = Lech | tytuł = An introduction to Algorithmic Logic - Metamathematical Investigations of Theory of Programs | wydawca = PWN | miejsce = Warszawa | data = 1977 | seria = Banach Center Publications | strony = 7-99 | isbn = 123 | nazwisko2 = Kreczmar | imię2 = Antoni | nazwisko3 = Mirkowska | imię3 = Grażyna | nazwisko4 = Rasiowa | imię4 = Helena | nazwisko5 = Salwicki | imię5 = Andrzej | tom = 2 | tytuł tomu = Banach Center Publications  }}]]&lt;br /&gt;
# [HRAL]  {{Cytuj książkę | odn=tak | nazwisko= Rasiowa | imię=Helena | tytuł= Algorithmic Logic - Notes from Seminar  in Simon Fraser University | data=1975 | seria= Reports of Institute of Computer Science PAS | tom=281 | miejsce=Warsaw }}&lt;br /&gt;
# [AB]  {{Cytuj książkę | odn=tak | nazwisko= Biela | imię=Andrzej | tytuł= Algorithmic structural completeness and a retrieval system for proving theorems in algorithmic theories  | data=2000 | wydawca=Wydawnictwo Uniwersytetu Śląskiego | tom=1901 | miejsce=Katowice | strony=122 | url=http://lem12.uksw.edu.pl/images/4/40/A-Biela.pdf }}&lt;br /&gt;
Artykuły (wybór)&lt;br /&gt;
# [GMP] [[Media:GMP1970.pdf | {{cytuj pismo | odn=tak | nazwisko = Góraj | imię = Anna | nazwisko2= Mirkowska | imię2 = Grazyna | nazwisko3 = Paluszkiewicz | imię3 = Anna| tytuł = On the notion of description of program | czasopismo = Bull. Acad. Polon. Sci. Ser. Math. Astr. Phys.| rok= 1970 |strony = 499 - 505 }}]]   &lt;br /&gt;
# [GM1971] {{cytuj pismo | odn=tak |nazwisko= Mirkowska | imię= Grażyna | tytuł = On Formalized Systems of Algorithmic Logic | czasopismo= Bull. Polish Academy Sciences, Ser. Math. Phys. |rok =1971 |tom = 19 | strony=421-428 |url=http://lem12.uksw.edu.pl/images/6/6f/On_Formalized-Mirk.pdf}}  &lt;br /&gt;
# [GM1] [[Media:MirkowskaI-1-17.pdf| {{cytuj pismo | odn=tak | nazwisko= Mirkowska | imię = Grazyna |  tytuł = Algorithmic logic and its applications in the theory of programs I | czasopismo = Fundamenta Informaticae| rok= 1977 |strony = 1-17 }} ]]&lt;br /&gt;
# [GM2] [[Media:Mirkowska-II-147-165.pdf| {{cytuj pismo | odn=tak | nazwisko= Mirkowska | imię = Grazyna |  tytuł = Algorithmic logic and its applications in the theory of programs II | czasopismo = Fundamenta Informaticae| rok= 1977 |strony = 147-165 }} ]]&lt;br /&gt;
# [AS1] [[Media:FormalizedAlgorithmicLanguages.pdf | {{cytuj pismo | odn=tak | nazwisko= Salwicki | imię = Andrzej |  tytuł = Formalized Algorithmic Languages | czasopismo = Bull. Acad. Polon. Sci. Ser. Math. Astr. Phys.| rok= 1970 |tom=18 |strony = 227-232 }} ]]&lt;br /&gt;
# [AS3] [[Media:CalculuswIterationQuantifiers.pdf | {{cytuj pismo | odn=tak | nazwisko= Salwicki | imię = Andrzej |  tytuł = On the predicate calculi with iteration quantifiers | czasopismo = Bull. Acad. Polon. Sci. Ser. Math. Astr. Phys.| rok= 1970 |tom=18 |strony = 279-285 }} ]]&lt;br /&gt;
# [LB1] [[Media:BanI-93-119.pdf| {{cytuj pismo | odn=tak | nazwisko= Banachowski | imię = Lech |  tytuł = Investigations of Properties of Programs by means of Extended Algorithmic Logic I | czasopismo = Fundamenta Informaticae| rok= 1977 |strony = 93-119 }} ]]&lt;br /&gt;
# [LB2] [[Media:Banachowski-II-167-193.pdf| {{cytuj pismo | odn=tak | nazwisko= Banachowski | imię = Lech |  tytuł = Investigations of Properties of Programs by means of Extended Algorithmic Logic II | czasopismo = Fundamenta Informaticae| rok= 1977 |strony = 167-193 }} ]]&lt;br /&gt;
# [LB3] [[Media:BanachowskiDataStruct.pdf| {{cytuj pismo | odn=tak | nazwisko= Banachowski | imię = Lech |  tytuł = An Axiomatic Approach to the Theory of Data Structures | czasopismo = Bull. Acad. Polon. Sci. Ser. Math. Astr. Phys. | rok= 1975 |strony = 315-323 }} ]]&lt;br /&gt;
# [AK1] [[Media:Kreczmar-Program-Fields.pdf| {{Cytuj pismo |odn=a | imię=Antoni | nazwisko=Kreczmar |tytuł=Programmability in Fields |czasopismo=Fundamenta Informaticae |strony=195-230 |rok=1977}}]]&lt;br /&gt;
# [AK2] [[Media:Kreczmar-Efficiency-problems.pdf| {{Cytuj pismo |odn=b | imię=Antoni | nazwisko=Kreczmar |tytuł=Effectivity problems of Algorithmic Logic |czasopismo=Fundamenta Informaticae |strony=19-32 |rok=1977}}]]&lt;br /&gt;
# [MSS2009] [[Media:Verifying-a-class.pdf  |{{cytuj pismo| odn=tak| nazwisko=Mirkowska| imię=Grażyna| nazwisko2=Salwicki| imię2=Andrzej| nazwisko3=Świda| imię3=Oskar| tytuł=Verifying a Class: combining Testing and Proving|czasopismo=Fundamenta Informaticae| strony= 305-324 |rok= 2009 }}]]&lt;br /&gt;
# [AS2017] [[Media:On-Euclids-algorithm-2018.pdf | {{Cytuj pismo| odn=nie| nazwisko=Salwicki| imię=Andrzej| tytuł=A new proof of Euclid's algorithm | czasopismo= }}]]&lt;br /&gt;
# [WD1] [[ Media:WDnonprog.pdf |  {{Cytuj pismo | odn=nie| nazwisko= Dańko | imię=Wiktor | tytuł=Nonprogrammable function defined by a procedure }} ]]&lt;br /&gt;
&lt;br /&gt;
==Protokół rozbieżności==&lt;br /&gt;
Następujący tekst został złożony do druku&lt;br /&gt;
[[Media:On-Euclids-algorithm-2018.pdf | {{Cytuj pismo| odn=nie| nazwisko=Salwicki| imię=Andrzej| tytuł=A new proof of Euclid's algorithm | czasopismo= }}]] &amp;lt;br /&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
Pierwsza recenzja była rzeczowa, pomocna i jej sugestie zostały, z podziękowaniem, wykorzystane http://lem12.uksw.edu.pl/images/8/8c/1pierwszaRec.pdf. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Drugi recenzent przedstawił następującą opinię http://lem12.uksw.edu.pl/images/0/0b/Second-report-08.pdf. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Na to autor odpowiedział prosząc o referencje do zapowiadanych twierdzeń lub o przedstawienie dowodu. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Oto protokół rozbieżności:&lt;br /&gt;
http://lem12.uksw.edu.pl/images/9/9a/DiscrepancyReport.pdf&lt;br /&gt;
&lt;br /&gt;
==Pytania otwarte==&lt;br /&gt;
* Rozpatrzmy teorię algorytmiczną &amp;lt;math&amp;gt;Th_{2.5} = \langle L,C,A \rangle &amp;lt;/math&amp;gt; gdzie&lt;br /&gt;
&amp;lt;math&amp;gt;L&amp;lt;/math&amp;gt; - język, jest językiem struktury liczb naturalnych, algorytmicznym, &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; - operacja konskwencji jest wyznaczona przez zbiór aksjomatów i reguł wnioskowania logiki algorytmicznej (rachunku programów),&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; - zbiór aksjomatów, jest zbiorem wszystkich formuł pierwszego rzędu prawdziwych w standardowym modelu liczb naturalnych.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Czy  formuła &amp;lt;math&amp;gt;\color{blue}\forall x\, \{y:=0;\, \mathbf{while}\ x\neq y\ \mathbf{do}\ y:=y+1\ \mathbf{done}\}(x=y) &amp;lt;/math&amp;gt; jest twierdzeniem tej teorii? &lt;br /&gt;
--[[Użytkownik:AndrzejSalwicki|AndrzejSalwicki]] ([[Dyskusja użytkownika:AndrzejSalwicki|dyskusja]]) 15:34, 30 maj 2018 (CEST) &lt;br /&gt;
* Czy teoria &amp;lt;math&amp;gt;Th_{2.5}&amp;lt;/math&amp;gt; jest zupełna? &lt;br /&gt;
  --[[Użytkownik:AndrzejSalwicki|AndrzejSalwicki]] ([[Dyskusja użytkownika:AndrzejSalwicki|dyskusja]]) 19:09, 31 maj 2018 (CEST)&lt;br /&gt;
* Według Harela, zob. Dynamic Logic,  każda formuła algorytmiczna prawdziwa w standardowym modelu arytmetyki powinna być twierdzeniem teorii &amp;lt;math&amp;gt;Th_{2.5}&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
* Czy teoria kontenerów (tj. słowników, dictionaries) bez aksjomatu algorytmicznego jest zupełna?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
[[Category:Logika Algorytmiczna}}]]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Logika_Algorytmiczna</id>
		<title>Logika Algorytmiczna</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Logika_Algorytmiczna"/>
				<updated>2026-02-25T12:39:18Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;p style=&amp;quot;text-align: right;&amp;quot;&amp;gt;&amp;lt;small&amp;gt;''Felix qui potuit rerum cognoscere causas'' &amp;lt;/small&amp;gt; &amp;lt;/p&amp;gt;&lt;br /&gt;
=Próba zmian&lt;br /&gt;
= Wprowadzenie =&lt;br /&gt;
Zmiana kontrolna Środa 21 maja 2025 g. 19:25&lt;br /&gt;
Logika algorytmiczna AL jest  ''rachunkiem logicznym''.  Nie jest to byle jaki system logiczny. Stworzony został przez nas  jako narzedzie pomocne i niezbędne w pracy nad oprogramowaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
Rachunek programów tj. logika algorytmiczna:&lt;br /&gt;
* uzupełnia język o programy,&lt;br /&gt;
* program jest wyrażeniem zbudowanym z programów atomowych - instrukcji przypisania przy pomocy kilku operatorów programotwócztch: while, if, złożenie,&lt;br /&gt;
* program może poprzedzać formułę i takie wyrażenie jest także formułą,&lt;br /&gt;
&lt;br /&gt;
Rachunek programów AL umożliwia:&lt;br /&gt;
# Wyrażenie własności programu przez odpowiednio napisaną formułę języka systemu AL [[Wyrażalność semantycznych własności programów]]&lt;br /&gt;
# Przeprowadzanie dowodów formuł wyrażających ważne semantyczne własności programów, [[Przykłady dowodów]]. &lt;br /&gt;
# Podanie aksjomatów dla wielu struktur danych.  Aksjomaty takie wykluczają struktury niechciane, czy wręcz struktury patologiczne.[[Aksjomaty struktur]]&lt;br /&gt;
# Specyfikację oprogramowania, [[SpecVer]]&lt;br /&gt;
# Weryfikację oprogramowania względem ustalonej specyfikacji.&lt;br /&gt;
# Aksjomatyczny opis semantyki danego języka programowania.[[Aksjomatyczna definicja języka programowania]]&lt;br /&gt;
# i wiele innych rzeczy.&lt;br /&gt;
[[Plik:4logiki.jpg|thumb|center |750px| Rys. 1  Cztery systemy logiczne ]]&lt;br /&gt;
Powyższy rysunek 1 ilustruje relacje zachodzące pomiędzy tymi czterema rachunkami logicznymi. Strzałki wskazują na zachodzenie następującej relacji &amp;lt;math&amp;gt;\mathcal{L}\rightarrow\mathcal{L}'&amp;lt;/math&amp;gt; pomiędzy dwoma rachunkami logicznymi &amp;lt;math&amp;gt;\mathcal{L}&amp;lt;/math&amp;gt; i &amp;lt;math&amp;gt;\mathcal{L}'&amp;lt;/math&amp;gt;: ''Każda tautologia'' &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; ''rachunku'' &amp;lt;math&amp;gt;\mathcal{L}&amp;lt;/math&amp;gt; ''staje się tautologią rachunku ''&amp;lt;math&amp;gt;\mathcal{L}&amp;lt;/math&amp;gt;' ''po zastąpieniu atomów formuły'' &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; ''przez formuły rachunku'' &amp;lt;math&amp;gt;\mathcal{L}&amp;lt;/math&amp;gt;. Nieco więcej informacji uzyskamy porównując zbiory wyrażeń poprawnie zbudowanych &amp;lt;math&amp;gt;\mathcal{WFF} &amp;lt;/math&amp;gt;.  &amp;lt;br /&amp;gt;&lt;br /&gt;
Języki tych rachunków logicznych różnią się. Każdy język jest parą &amp;lt;alfabet, zbiór wyrażen poprawnie zbudowanych&amp;gt;. Zwróćmy uwagę na to, że za każdym razem struktura zbioru wyrażeń poprawnie zbudowanych &amp;lt;math&amp;gt;\mathcal{WFF} &amp;lt;/math&amp;gt; (''ang''. well formed formulas) jest inna. &amp;lt;br /&amp;gt;&lt;br /&gt;
Oznaczenia przyjete na rysunku: &amp;lt;math&amp;gt;\mathcal{L}&amp;lt;/math&amp;gt; - język, &amp;lt;math&amp;gt;\mathcal{A}&amp;lt;/math&amp;gt; - alfabet, &amp;lt;math&amp;gt;\mathcal{T}&amp;lt;/math&amp;gt; - zbiór termów (wyrażeń arytmetycznych, obiektowych,...), &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; - zbiór formuł, &amp;lt;math&amp;gt;\mathcal{P}&amp;lt;/math&amp;gt; - zbiór programów.&lt;br /&gt;
[[Plik:AxiomPL.jpg|thumb|750px| Rys. 2  Aksjomaty rachunku zdań ]]&lt;br /&gt;
[[Plik:axiomsFOL-AL.jpg|thumb |750px|  Rys. 3  Aksjomaty rachunku predykatów(Ax12 i Ax13) i rachunku programów ]]&lt;br /&gt;
[[Plik:inferenceRules.jpg| thumb  |750px| Rys. 4 Reguły wnioskowania ]]&lt;br /&gt;
Zbiór formuł logiki algorytmicznej zawiera w sobie wszystkie formuły pierwszego rzędu i ponadto, jest zamknięty ze względu na poprzedzanie formuły programem. Jeśli &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; jest formułą i &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; jest programem to wyrazenie postaci &amp;lt;math&amp;gt;K\alpha&amp;lt;/math&amp;gt; jest formułą logiki algorytmicznej, krócej, formułą algorytmiczna.&amp;lt;br /&amp;gt;&lt;br /&gt;
Jak takiej formule &amp;lt;math&amp;gt;K\alpha&amp;lt;/math&amp;gt; przypisać wartość logiczną prawda lub fałsz?&lt;br /&gt;
[[Plik:Kalfa.jpg |thumb|left|300px|Rys. 5  Wyznaczanie wartośći formuły &amp;lt;math&amp;gt;K\alpha&amp;lt;/math&amp;gt; ]]&lt;br /&gt;
Rysunek 5 powinien wszystko wyjaśnić.Pozostaje jednak przypadek gdy obliczenie programu K nie daje wyniku, z powodu zapętlenia się programu lub innego błędu. Oczywiście nie możemy wtedy twierdzić, że ''dla danych v, obliczenie programu K kończy się pomyślnie i wyniki spełniają warunek &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;''. A więc w tym przypadku wartościa formuły &amp;lt;math&amp;gt;K\alpha&amp;lt;/math&amp;gt; jest fałsz.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
O logice algorytmicznej możemy też powiedzieć, że jest [[rachunek programów|''rachunkiem programów'']].   Język logiki algorytmicznej zawiera programy i formuły algorytmiczne. '''Ważne''' jest to, że ''każda semantyczna własność programów np. poprawność, równowazność, kończenie obliczeń lub przeciwnie zapętlanie, ... może być wyrażona przez odpowiednią formułę''. Pozwala to zamienić zadanie wykazania, że pewien program  &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; posiada pewną własnośc semantyczną &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; na zadanie udowodnić formułę &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; należąca do języka logiki algorytmicznej. &amp;lt;br /&amp;gt;'''Przykład''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Własność: ''Dla każdych danych &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;, jeśli  program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; rozpoczyna obliczenia z danymi spełniającymi warunek &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; to jego obliczenie zakończy się (nie będzie zapętlenia, ani przerwania obliczeń) i jego wyniki spełniają warunek &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;'', jest wyrażana formułą &amp;lt;math&amp;gt;\alpha \rightarrow K\beta&amp;lt;/math&amp;gt;. Nie musimy więc podejmować trudu testowania czy dla kazdych danych obliczenie programu K będzie skończone i ... &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Formuły tworzą algebrę z działaniami: konkatenacji, alternatywy, negacji i implikacji oraz z działaniami nieskończonymi tj. kwantyfikatorami, ponadto programy są modalnościami. Programy też tworzą algebrę: działaniami tej algebry są iteracja, rozgałęzienie i złożenie programów. Mamy więc do czynienia ze splotem dwu algebr. Możemy go nazwać rachunkiem programów.  Zadaniem logiki algorytmicznej jest poszukiwanie ''praw rachunku programów''. &lt;br /&gt;
&lt;br /&gt;
Celem jest zebranie praw i reguł wnioskowania, które umożliwią analizę algorytmów i wydawanie opinii o ich własnościach semantycznych, bez wykonywania obliczeń, na podstawie samego tekstu algorytmu i aksjomatów struktury danych w jakiej dany program ma byc interpretowany.&lt;br /&gt;
&lt;br /&gt;
'''Przykład'''&lt;br /&gt;
Rozpatrzmy prosty program&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;small&amp;gt;    (* Dane:  x&amp;gt;0  i  y&amp;gt;0  liczby naturalne *)&lt;br /&gt;
    '''Deklaracje:'''  typ(x, y, n, m, r, q, max)='''N''' &amp;amp;  typ(n_mniejsze)=Boolean &lt;br /&gt;
    &lt;br /&gt;
    n:=x; m:=y;&lt;br /&gt;
    '''while''' n ≠ m '''do'''&lt;br /&gt;
       '''''Oznaczenie''''' niech l=max(n,m)&lt;br /&gt;
       r:=0; &lt;br /&gt;
       '''while''' r ≠n '''and''' r ≠m '''do'''  r:=r+1  '''od'''; &lt;br /&gt;
       '''if''' r=n '''then''' n_miejsze:=true; max:=m '''else''' n_mniejsze:=false; max:=n '''fi'''; &lt;br /&gt;
       '''''Stwierdzenie''''' (n&amp;lt;m &amp;amp; m=max(n,m) lub m&amp;lt;n &amp;amp; n=max(n,m))&lt;br /&gt;
       q:=0; &lt;br /&gt;
       '''while''' r≠max  '''do'''  r:= r+1; q:=q+1  '''od'''; &lt;br /&gt;
       '''''Stwierdzenie''''' q = |m-n| &amp;amp; (1 ≤ q &amp;lt; max(n,m))&amp;amp; r=max(n,m)&lt;br /&gt;
       '''if''' n_mniejsze '''then''' m:=q '''else''' n := q '''fi''' &lt;br /&gt;
       '''''Stwierdzenie''''' max(n,m) &amp;lt;  l&lt;br /&gt;
   '''od''' ( wynik = n) &lt;br /&gt;
(* Wynik:  nwd(x,y)   *)&amp;lt;/small&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Co robi ten program? Czy to jest pytanie dobrze postawione?&lt;br /&gt;
Czy obliczenie tego programu jest skończone dla każdych danych &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; i &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt;?&lt;br /&gt;
Czym są te dane? Jakie znaczenie mają operacje - i + oraz stała 1? Jakie znaczenie ma predykat &amp;lt;?&lt;br /&gt;
&lt;br /&gt;
Wiele osób powie,że przecież to proste. Powyższy program oblicza największy wspólny dzielnik liczb naturalnych &amp;lt;math&amp;gt;xP&amp;lt;/math&amp;gt; i &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt;. No tak, ale skąd wiesz, że środowisko w którym wykonujesz ten program nie jest podejrzane? Na kolejnej stronie możesz zobaczyć klasę która implementuje operacje dodawania liczb naturalnych i relację równości w niestandardowy sposób. Powyższy program w otoczeniu tej klasy zachowuje się niestandardowo. Po pierwsze, obliczenia tego programu sa nieskończone dla pewnych danych. Powiesz mi, ta klasa nie spełnia aksjomatów liczb naturalnych? Otóż '''spełnia'''. Jakie więc aksjomaty należy wziąć pod uwagę i o co mamy pytać?   &lt;br /&gt;
&lt;br /&gt;
Zanim zaczniesz analizować działanie programu powinieneś zdać sobie sprawę z kilku rzeczy:&lt;br /&gt;
# Program zachowuje się różnie w różnych otoczeniach. Czym jest otoczenie? To zależy, może to być pierwotny typ danych np. integer w wielu językach programowania lub struktura danych opisana za pomocą pewnej klasy.&lt;br /&gt;
# Podczas analizy powinniśmy rozpatrywać program &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; w parze z jego otoczeniem &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;. Podczas analizy nie wystarczy nam nazwa otoczenia, ani sygnatura nazywana przez programistów interfejsem (ang, ''interface'').&lt;br /&gt;
# W procesie analizy musimy korzystać z własności otoczenia np. z przemienności i łączności dodawania.&lt;br /&gt;
# Musimy też sobie zadawać sprawę, że wielu podstawowych własności nie da się wyrazić formułami pierwszego rzędu.&lt;br /&gt;
# '''Własności algorytmiczne naszych programów wynikają z własności algorytmicznych otoczenia.'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zechciej przejść na stronę [[Euklides]] by poznać nasze argumenty.&lt;br /&gt;
&lt;br /&gt;
== Program logiki algorytmicznej ==&lt;br /&gt;
Zadaniem logiki algorytmicznej jest dostarczenie narzędzi do analizowania semantycznych własności programów takich jak: własność stopu, poprawność programu, etc.&lt;br /&gt;
W języku logiki algorytmicznej znajdujemy trzy zbiory: zbiór formuł, zbiór wyrażeń (zbiór termów) i zbiór programów (zbiór algorytmów).&lt;br /&gt;
'''Uwaga''' W języku logiki zdaniowej (rachunku zdań) rozważany jest jeden tylko zbiór wyrażeń poprawnie zbudowanych, jest to zbiór formuł (zdaniowych). Formuły stanowią najmniejszy zbiór napisów zawierający zbiór zmiennych zdaniowych i zamknięty ze względu na operatory logiczne.&lt;br /&gt;
W jeżyku logiki pierwszego rzędu zb→ór wyrażen poprawnie zbudowanych jest suma dwu rozłącznych zbiorów: zbioru termów(inaczej zbiór wyrażen nazwowych) i zbioru formuł. W rachunku programów (czyli logice algorytmicznej) w naturalny sposób pojaia się zbiór algorytmów. '''koniec uwagi''' &lt;br /&gt;
Znaczeniem programu &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; jest funkcja ze zbioru &amp;lt;math&amp;gt;W&amp;lt;/math&amp;gt; wartościowań zmiennych w ten sam zbiór. Zazwyczaj funkcję tę określa się przy pomocy pojęcia [[obliczenia programu]].&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\usepackage{tikzcd}&lt;br /&gt;
\begin{tikzcd}&lt;br /&gt;
A\arrow[r] &amp;amp; B&lt;br /&gt;
\end{tikzcd}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{figure}[h]\begin{center}&lt;br /&gt;
\usepackage{tikz}&lt;br /&gt;
  		\tikzstyle{stan}=[rectangle , text=blue]&lt;br /&gt;
  		\tikzstyle{is}=[-&amp;gt;,&amp;gt;=latex,rounded corners=4pt]&lt;br /&gt;
  		\begin{tikzpicture}[scale=0.38]&lt;br /&gt;
  			%\draw [gray, very thin] (-2,-2) grid [step=1cm] (28,50);&lt;br /&gt;
  			\draw (-2,5) -- (4,18) -- (27,18) -- (23,5) -- cycle[fill=green!25];&lt;br /&gt;
  			\node[stan] (T) at (4.44,14)  {$v:\frac{x\, y\, z}{k\,l\,p}$};&lt;br /&gt;
  			\node[stan] (U) at (24,14) {$\frac{true}{false}$};&lt;br /&gt;
  			\node[stan] (V) at (14,6.2) {$v^{\prime}:\frac{x\, y\, z}{n\,l\,p}$};&lt;br /&gt;
  			\draw[is] (T) to[bend left]node[midway,below]{ $\bigl(\alpha(x/\tau)\bigr)_{\color{red}{\mathfrak{A}}\color{black}{}}$ } (U) ; &lt;br /&gt;
  			\draw[is] (T) to[bend right]node[midway,above ]{$\bigl(\{x:=\tau\}\alpha\bigr)_{\color{red}{\mathfrak{A}}\color{black}}$} (U) ;&lt;br /&gt;
  			\draw[is] (V) -- (U)node[midway,right]{$ \alpha(x)_{\color{red}{\mathfrak{A}}\color{black}{\ }}$ }; &lt;br /&gt;
  			\draw[is] (T) -- (V)node[midway,left]{$\{x:=\tau \}_{\color{red}{\mathfrak{A}}\color{black}}$ }; &lt;br /&gt;
  			\draw (0,20) -- (4,24) -- (27,24) -- (23,20) -- cycle[fill=yellow!35];&lt;br /&gt;
  			&lt;br /&gt;
  			\node[stan] (T1) at (9,22)  {$\{x:=\tau\}\alpha $   };&lt;br /&gt;
  			\node[stan] (U1) at (19,22) {$\alpha(x/\tau) $ };&lt;br /&gt;
  			\node[stan] (V1) at (14,22) {$\Leftrightarrow$ };&lt;br /&gt;
  			&lt;br /&gt;
  			\draw [color=red, thick, -&amp;gt;] (9,22) -&amp;gt;   (13,12.4)node[midway,left,near start]{$\mathfrak{A}$} ; &lt;br /&gt;
  			\draw [color=red,  thick, -&amp;gt;] (19,22) -&amp;gt; (16,16.5)node[midway,left]{$\mathfrak{A}$} ;&lt;br /&gt;
  		\end{tikzpicture} &lt;br /&gt;
  		\caption{Aksjomat instrukcji przypisania \\&lt;br /&gt;
  			&amp;quot;\textit{warunek $\alpha(x)$ zachodzi po wykonaniu instrukcji $x\,:=\tau$ wttw, gdy przed wykonaniem tej instrukcji zachodzi warunek $\alpha(x/ \tau)$}&amp;quot;&lt;br /&gt;
  			jest tautologią\\&lt;br /&gt;
  			\begin{scriptsize}&lt;br /&gt;
  				na górnej płaszczyznie wydrukowaliśmy text  aksjomatu, \\&lt;br /&gt;
  				na dolnej płaszczyznie objaśniamy co się dzieje podczas obliczeń i wskazujemy znaczenie (tj. semantykę) aksjomatu, &lt;br /&gt;
  				Litera $\mathfrak{A}$ oznacza dowolny typ (na razie przyjmij, że może to być typ integer lub typ real). Czerwone strzałki łączą formułę   $\alpha(x/\tau) $ (odpowiednio \{x:=$\tau$\}$\alpha $) z funkcją $\alpha(x/\tau)_{\mathfrak{A}}$ (odpowiednio $\{x:=\tau \}(\alpha)_{\mathfrak{A}}$ ). &lt;br /&gt;
  				Stan pamięci $v'$ i dodatkowe strzałki ilustrują sposób obliczania  wartości formuły, $\{x:=\tau \}(\alpha)$, zauważ, wartość $v'(x)=n= \tau_{\mathfrak{A}}( v(x))$. &lt;br /&gt;
  		\end{scriptsize}}\label{rAx18}&lt;br /&gt;
  	\end{center}&lt;br /&gt;
  \end{figure} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Zastosowania ==&lt;br /&gt;
Stosując logikę algorytmiczną czyli rachunek programów potrafimy odpowiedziec twierdząco na nastepujące pytania:&lt;br /&gt;
# Czy można podać aksjomaty i reguły wnioskowania, które opiszą semantykę operacyjną języka programowania?&lt;br /&gt;
# Czy (i jakie) własności struktur danych (systemów algebraicznych) są wyrażalne w języku logiki algorytmicznej?&lt;br /&gt;
# Czy (i jakie) własności programów są wyrażalne formułami algorytmicznymi?&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ad 2. W matematyce rozważa się wiele własności ważnych struktur algebraicznych, których nie można wyrazić w języku pierwszego rzędu. Większość z nich może być wyrażona przy pomocy formuł algorytmicznych &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* bycie liczbą naturalną,&lt;br /&gt;
* aksjomat Archimedesa&lt;br /&gt;
* aksjomat ciał charakterystyki zero&lt;br /&gt;
* aksjomat grup torsyjnych&lt;br /&gt;
* aksjomat grup cyklicznych&lt;br /&gt;
i in.&amp;lt;br /&amp;gt;&lt;br /&gt;
Dla informatyków niezwykle ważny jest fakt, że niemal wszystkie napotykane w programach struktury danych mogą być scharakteryzowane przy pomocy formuł algorytmicznych&lt;br /&gt;
* s jest stosem (skończonym)&lt;br /&gt;
* q jest kolejką FIFO skończoną&lt;br /&gt;
* s jest drzewem binarnym&lt;br /&gt;
* d jest drzewem binarnych poszukiwań&lt;br /&gt;
* q jest kolejką priorytetową&lt;br /&gt;
* d jest strukturą słownika (ang. dictionary)&lt;br /&gt;
* k jest kopcem&lt;br /&gt;
itd.&lt;br /&gt;
== Inne logiki programów ==&lt;br /&gt;
Możesz się zapytać jak się ma rachunek programów (tj. logika algorytmiczna) do innych logik programów : np. rachunek Floyda, logika Hoare'a, rachunek najsłabszego warunku wstępnego Dijkstry, logiki dynamicznaj, etc.?&lt;br /&gt;
&lt;br /&gt;
[[calculus of Floyd|rachunek  Floyda]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[logic of Hoare|logika Hoare'a]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
calculus of weakest precondition of Dijkstra&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[dynamic logic]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Uwagi historyczne ==&lt;br /&gt;
Algorytmy pojawiły sie kilka tysięcy lat temu. W Babilonie, Egipcie i Grecji.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
W czasach nowożytnych studia nad algorytmami podjęli Goedel, Turing, Church, Markov, Kołmogorov i wielu innych. Szkoda, że Tarski nie rozszerzył swych badań nad semantyką na funkcje obliczalne. Szkoda, że studia funkcji obliczalnych skupiły się na samych funkcjach, zaniedbując aspekt językowy. Prawie nie zajmowano się językiem służcym do definiowania funkcji rekurencyjnych. Alonzo Curch był chyba wyjatkiem? D. Kleene był blisko - jego definicja operatora minimum ograniczonego to przeciez petla FOR, a operacja minimum efektywnego to pętla WHILE. Warto pamietac twierdzenie S. Kleene z r. 1942 o tym, że zbiór funkcji obliczalnych jesli jest zamknięty ze względu na superpozycję i minimum efektywne  ( i zawiera kilka funkcji poczatkowych) to definiowanie funkcji obliczalnych przez rekursję prostą może być zastąpione przez operację minimum efektywnego.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Po drugiej wojnie światowej gdy pojawiły się komputery (zwane wtedy maszynami matematycznymi), ich programy zapisywano w kodzie maszynowym lub (później) w assemblerze. Trudno było dostrzec struktury i prawidłowości. W maszynie von Neumanna wszystko jest ciągiem bitów - liczbą. Ale pamiętam odczyt Antoniego Mazurkiewicza (ok 1960 r.) i jego dowód poprawności algorytmu z jedną pętla. Algorytm miał obliczyć sumę liczb zapisanych w tablicy. Kod maszyny XYZ-1 był bardzo ubogi. Program wymagał pobrania instrukcji &amp;quot;''weź kolejną komórkę pamięci do Akumulatora''&amp;quot; do rejestru Akumulator, zwiększenia adresu i zapisaniu tak zmienionej instrukcji w pamięci rozkazów na swoim pierwotnym miejscu. Program był więc ciągiem słów binarnych - każde słowo można jednak interpretować dwoiście, jako liczbę lub jako instrukcję. Nie ma w tym żadnej widocznej struktury.&amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Prekursorzy logiki algorytmicznej&amp;lt;br /&amp;gt;&lt;br /&gt;
Janov - jego praca poprzedza zdaniową logikę dynamiczną. Przedmiotem analizy są schematy programów (zapisywane w bardzo specjalny sposób) i relacja równoważności schematów. Dzisiaj powiedzielibyśmy, że schemat programu jest grafem skończonym. Wierzchołkom grafu przyporządkowano albo zmienną programowa albo formułę zdaniowa. Praca Janova jest nie tylko trudno dostępna, ale przede wszystkim mało czytelna. W książce A.P. Ershova można znaleźć przystępną ekspozycję teorii Janova.&amp;lt;br /&amp;gt;&lt;br /&gt;
Engeler(1967) - zauważył, że własność stopu programu można wyrazić jako formułę logiki &amp;lt;math&amp;gt;L_{\omega1\,\omega} &amp;lt;/math&amp;gt;, a dokładniej jako nieskończoną alternatywę formuł otwartych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Warto też wspomnieć o pracach Glushkova dotyczących systemów algebr algorytmicznych i książkę Helmuta Thielego. &amp;lt;br /&amp;gt;&lt;br /&gt;
''Rasiowa'' - w książce ''Mathematics of metamathematics''(1963) str. 218 sformułowała podstawową własność instrukcji przypisania. Niech &amp;lt;math&amp;gt; s &amp;lt;/math&amp;gt; oznacza jakieś odwzorowanie &amp;lt;math&amp;gt; s\colon V \to T &amp;lt;/math&amp;gt; gdzie &amp;lt;math&amp;gt; V &amp;lt;/math&amp;gt; jest zbiorem zmiennych indywiduowych, a &amp;lt;math&amp;gt; T &amp;lt;/math&amp;gt; jest zbiorem termów. Odwzorowanie &amp;lt;math&amp;gt; s &amp;lt;/math&amp;gt; nazywa się podstawieniem. Jeśli &amp;lt;math&amp;gt; \tau &amp;lt;/math&amp;gt; oznacza jakiś term to &amp;lt;math&amp;gt; s\,\tau &amp;lt;/math&amp;gt; oznacza wyrażenie powstające z termu &amp;lt;math&amp;gt; \tau &amp;lt;/math&amp;gt; przez równoczesne zastąpienie wszystkich wystąpień zmiennych indywiduowych &amp;lt;math&amp;gt; \tau &amp;lt;/math&amp;gt; przez odpowiednie wartości odwzorowania &amp;lt;math&amp;gt; s &amp;lt;/math&amp;gt;. Oznaczmy term &amp;lt;math&amp;gt; \tau &amp;lt;/math&amp;gt; przez &amp;lt;math&amp;gt; \tau(x_1,\dots,x_n)&amp;lt;/math&amp;gt; podkreślając, że zmienne &amp;lt;math&amp;gt; x_1,\dots,x_n &amp;lt;/math&amp;gt; to są wszystkie zmienne występujące w termie &amp;lt;math&amp;gt; \tau &amp;lt;/math&amp;gt;. Wynik równoczesnego podstawienia za zmienne &amp;lt;math&amp;gt; x_1,\dots,x_n &amp;lt;/math&amp;gt; występujące w termie &amp;lt;math&amp;gt; \tau &amp;lt;/math&amp;gt;, termów &amp;lt;math&amp;gt; s(x_1),\dots,s(x_n) &amp;lt;/math&amp;gt;   &amp;lt;br /&amp;gt; oznaczmy &amp;lt;math&amp;gt; s\tau &amp;lt;/math&amp;gt;. Mamy więc równość &amp;lt;math&amp;gt; s\tau(x_1,\dots,x_n)= \tau(s(x_1),\dots,s(x_n)) &amp;lt;/math&amp;gt;. Można bez trudu udowodnić, że wynik jest tez termem. &lt;br /&gt;
Przypomnijmy teraz ten element definicji pojęcia spełniania (Tarski): dla ustalonej interpretacji symboli funkcyjnych &amp;lt;math&amp;gt; R &amp;lt;/math&amp;gt; i ustalonego wartościowania zmiennych &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt;, term &amp;lt;math&amp;gt; \tau  &amp;lt;/math&amp;gt; wyznacza funkcję ze zbioru wartościowań w zbiór wartoścowań.&lt;br /&gt;
Teraz możemy sformułować &amp;lt;br /&amp;gt;&lt;br /&gt;
Niech &amp;lt;math&amp;gt; R &amp;lt;/math&amp;gt; będzie dowolnie ustaloną interpretacją symboli funkcyjnych, niech &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; będzie dowolnym wartościowaniem zmiennych. Dla każdego podstawienia &amp;lt;math&amp;gt; s &amp;lt;/math&amp;gt; i każdego termu &amp;lt;math&amp;gt; \tau &amp;lt;/math&amp;gt; zachodzi równość &lt;br /&gt;
&amp;lt;math&amp;gt; s\tau_R(v)=\tau_R(s_R(v))  &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Zauważmy, że w czasie pisania ksiązki ''Mathematics of metamathematics''(przed r. 1963) ani Rasiowa ani Sikorski nie mieli pojęcia o programowaniu. A jednak, gdy zapisać podstawienie &amp;lt;math&amp;gt; s &amp;lt;/math&amp;gt; w trochę innej formie &amp;lt;math&amp;gt; \{x_1:=\tau_1 \&amp;amp; \dots \&amp;amp; x_n:=\tau_n \} &amp;lt;/math&amp;gt; i zrozumieć, że wartościowanie zmiennych to to samo co stan pamięci, a interpretacja &amp;lt;math&amp;gt; R &amp;lt;/math&amp;gt; to po prostu jednostka arytmetyczna komputera, to wszystko trafia na swoje miejsce.&lt;br /&gt;
&lt;br /&gt;
== Bibliografia ==&lt;br /&gt;
Książki&lt;br /&gt;
&lt;br /&gt;
# [AlgoLog] [[Media:Algorithmic_Logic.pdf | {{cytuj książkę |odn=tak| nazwisko = Mirkowska| imię = Grażyna | nazwisko2 = Salwicki | imię2 = Andrzej | tytuł = Algorithmic Logic | wydawca = PWN | miejsce = Warszawa | data = 1987 | strony = 345}}]] &lt;br /&gt;
# [LogProg1] [[Media:LogikaAlgorytmiczna_1z2.pdf | {{cytuj książkę | odn=tak |imię2=Andrzej | nazwisko2=Salwicki | imię=Grażyna | nazwisko=Mirkowska| tytuł=Logika Algorytmiczna dla Programistów|wydawca=WNT | miejsce=Warszawa| data=1992|strony=294 }}]] cz.1&amp;lt;br /&amp;gt;&lt;br /&gt;
[[book Algorithmic Logic  ]]&lt;br /&gt;
# [LogProg2] [[Media:LogikaAlgorytmiczna_2z2.pdf | {{cytuj książkę | odn=tak |imię2=Andrzej | nazwisko2=Salwicki | imię=Grażyna | nazwisko=Mirkowska| tytuł=Logika Algorytmiczna dla Programistów|wydawca=WNT | miejsce=Warszawa| data=1992|strony=294 }}]] cz.2&lt;br /&gt;
#[AL4software] [[Media:AlgoLogic.pdf| {{cytuj książkę | odn=tak |imię2=Andrzej | nazwisko2=Salwicki | imię=Grażyna | nazwisko=Mirkowska| tytuł=Algorithmic Logic for Software Construction and Verification|wydawca=Dąbrowa Research | miejsce=Dąbrowa Leśna| data=2014|strony=154 }}]]&lt;br /&gt;
# [CentrumBanachAL] [[ Media:bcp211.pdf  |{{Cytuj książkę |odn=tak| nazwisko = Banachowski | imię = Lech | tytuł = An introduction to Algorithmic Logic - Metamathematical Investigations of Theory of Programs | wydawca = PWN | miejsce = Warszawa | data = 1977 | seria = Banach Center Publications | strony = 7-99 | isbn = 123 | nazwisko2 = Kreczmar | imię2 = Antoni | nazwisko3 = Mirkowska | imię3 = Grażyna | nazwisko4 = Rasiowa | imię4 = Helena | nazwisko5 = Salwicki | imię5 = Andrzej | tom = 2 | tytuł tomu = Banach Center Publications  }}]]&lt;br /&gt;
# [HRAL]  {{Cytuj książkę | odn=tak | nazwisko= Rasiowa | imię=Helena | tytuł= Algorithmic Logic - Notes from Seminar  in Simon Fraser University | data=1975 | seria= Reports of Institute of Computer Science PAS | tom=281 | miejsce=Warsaw }}&lt;br /&gt;
# [AB]  {{Cytuj książkę | odn=tak | nazwisko= Biela | imię=Andrzej | tytuł= Algorithmic structural completeness and a retrieval system for proving theorems in algorithmic theories  | data=2000 | wydawca=Wydawnictwo Uniwersytetu Śląskiego | tom=1901 | miejsce=Katowice | strony=122 | url=http://lem12.uksw.edu.pl/images/4/40/A-Biela.pdf }}&lt;br /&gt;
Artykuły (wybór)&lt;br /&gt;
# [GMP] [[Media:GMP1970.pdf | {{cytuj pismo | odn=tak | nazwisko = Góraj | imię = Anna | nazwisko2= Mirkowska | imię2 = Grazyna | nazwisko3 = Paluszkiewicz | imię3 = Anna| tytuł = On the notion of description of program | czasopismo = Bull. Acad. Polon. Sci. Ser. Math. Astr. Phys.| rok= 1970 |strony = 499 - 505 }}]]   &lt;br /&gt;
# [GM1971] {{cytuj pismo | odn=tak |nazwisko= Mirkowska | imię= Grażyna | tytuł = On Formalized Systems of Algorithmic Logic | czasopismo= Bull. Polish Academy Sciences, Ser. Math. Phys. |rok =1971 |tom = 19 | strony=421-428 |url=http://lem12.uksw.edu.pl/images/6/6f/On_Formalized-Mirk.pdf}}  &lt;br /&gt;
# [GM1] [[Media:MirkowskaI-1-17.pdf| {{cytuj pismo | odn=tak | nazwisko= Mirkowska | imię = Grazyna |  tytuł = Algorithmic logic and its applications in the theory of programs I | czasopismo = Fundamenta Informaticae| rok= 1977 |strony = 1-17 }} ]]&lt;br /&gt;
# [GM2] [[Media:Mirkowska-II-147-165.pdf| {{cytuj pismo | odn=tak | nazwisko= Mirkowska | imię = Grazyna |  tytuł = Algorithmic logic and its applications in the theory of programs II | czasopismo = Fundamenta Informaticae| rok= 1977 |strony = 147-165 }} ]]&lt;br /&gt;
# [AS1] [[Media:FormalizedAlgorithmicLanguages.pdf | {{cytuj pismo | odn=tak | nazwisko= Salwicki | imię = Andrzej |  tytuł = Formalized Algorithmic Languages | czasopismo = Bull. Acad. Polon. Sci. Ser. Math. Astr. Phys.| rok= 1970 |tom=18 |strony = 227-232 }} ]]&lt;br /&gt;
# [AS3] [[Media:CalculuswIterationQuantifiers.pdf | {{cytuj pismo | odn=tak | nazwisko= Salwicki | imię = Andrzej |  tytuł = On the predicate calculi with iteration quantifiers | czasopismo = Bull. Acad. Polon. Sci. Ser. Math. Astr. Phys.| rok= 1970 |tom=18 |strony = 279-285 }} ]]&lt;br /&gt;
# [LB1] [[Media:BanI-93-119.pdf| {{cytuj pismo | odn=tak | nazwisko= Banachowski | imię = Lech |  tytuł = Investigations of Properties of Programs by means of Extended Algorithmic Logic I | czasopismo = Fundamenta Informaticae| rok= 1977 |strony = 93-119 }} ]]&lt;br /&gt;
# [LB2] [[Media:Banachowski-II-167-193.pdf| {{cytuj pismo | odn=tak | nazwisko= Banachowski | imię = Lech |  tytuł = Investigations of Properties of Programs by means of Extended Algorithmic Logic II | czasopismo = Fundamenta Informaticae| rok= 1977 |strony = 167-193 }} ]]&lt;br /&gt;
# [LB3] [[Media:BanachowskiDataStruct.pdf| {{cytuj pismo | odn=tak | nazwisko= Banachowski | imię = Lech |  tytuł = An Axiomatic Approach to the Theory of Data Structures | czasopismo = Bull. Acad. Polon. Sci. Ser. Math. Astr. Phys. | rok= 1975 |strony = 315-323 }} ]]&lt;br /&gt;
# [AK1] [[Media:Kreczmar-Program-Fields.pdf| {{Cytuj pismo |odn=a | imię=Antoni | nazwisko=Kreczmar |tytuł=Programmability in Fields |czasopismo=Fundamenta Informaticae |strony=195-230 |rok=1977}}]]&lt;br /&gt;
# [AK2] [[Media:Kreczmar-Efficiency-problems.pdf| {{Cytuj pismo |odn=b | imię=Antoni | nazwisko=Kreczmar |tytuł=Effectivity problems of Algorithmic Logic |czasopismo=Fundamenta Informaticae |strony=19-32 |rok=1977}}]]&lt;br /&gt;
# [MSS2009] [[Media:Verifying-a-class.pdf  |{{cytuj pismo| odn=tak| nazwisko=Mirkowska| imię=Grażyna| nazwisko2=Salwicki| imię2=Andrzej| nazwisko3=Świda| imię3=Oskar| tytuł=Verifying a Class: combining Testing and Proving|czasopismo=Fundamenta Informaticae| strony= 305-324 |rok= 2009 }}]]&lt;br /&gt;
# [AS2017] [[Media:On-Euclids-algorithm-2018.pdf | {{Cytuj pismo| odn=nie| nazwisko=Salwicki| imię=Andrzej| tytuł=A new proof of Euclid's algorithm | czasopismo= }}]]&lt;br /&gt;
# [WD1] [[ Media:WDnonprog.pdf |  {{Cytuj pismo | odn=nie| nazwisko= Dańko | imię=Wiktor | tytuł=Nonprogrammable function defined by a procedure }} ]]&lt;br /&gt;
&lt;br /&gt;
==Protokół rozbieżności==&lt;br /&gt;
Następujący tekst został złożony do druku&lt;br /&gt;
[[Media:On-Euclids-algorithm-2018.pdf | {{Cytuj pismo| odn=nie| nazwisko=Salwicki| imię=Andrzej| tytuł=A new proof of Euclid's algorithm | czasopismo= }}]] &amp;lt;br /&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
Pierwsza recenzja była rzeczowa, pomocna i jej sugestie zostały, z podziękowaniem, wykorzystane http://lem12.uksw.edu.pl/images/8/8c/1pierwszaRec.pdf. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Drugi recenzent przedstawił następującą opinię http://lem12.uksw.edu.pl/images/0/0b/Second-report-08.pdf. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Na to autor odpowiedział prosząc o referencje do zapowiadanych twierdzeń lub o przedstawienie dowodu. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Oto protokół rozbieżności:&lt;br /&gt;
http://lem12.uksw.edu.pl/images/9/9a/DiscrepancyReport.pdf&lt;br /&gt;
&lt;br /&gt;
==Pytania otwarte==&lt;br /&gt;
* Rozpatrzmy teorię algorytmiczną &amp;lt;math&amp;gt;Th_{2.5} = \langle L,C,A \rangle &amp;lt;/math&amp;gt; gdzie&lt;br /&gt;
&amp;lt;math&amp;gt;L&amp;lt;/math&amp;gt; - język, jest językiem struktury liczb naturalnych, algorytmicznym, &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; - operacja konskwencji jest wyznaczona przez zbiór aksjomatów i reguł wnioskowania logiki algorytmicznej (rachunku programów),&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; - zbiór aksjomatów, jest zbiorem wszystkich formuł pierwszego rzędu prawdziwych w standardowym modelu liczb naturalnych.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Czy  formuła &amp;lt;math&amp;gt;\color{blue}\forall x\, \{y:=0;\, \mathbf{while}\ x\neq y\ \mathbf{do}\ y:=y+1\ \mathbf{done}\}(x=y) &amp;lt;/math&amp;gt; jest twierdzeniem tej teorii? &lt;br /&gt;
--[[Użytkownik:AndrzejSalwicki|AndrzejSalwicki]] ([[Dyskusja użytkownika:AndrzejSalwicki|dyskusja]]) 15:34, 30 maj 2018 (CEST) &lt;br /&gt;
* Czy teoria &amp;lt;math&amp;gt;Th_{2.5}&amp;lt;/math&amp;gt; jest zupełna? &lt;br /&gt;
  --[[Użytkownik:AndrzejSalwicki|AndrzejSalwicki]] ([[Dyskusja użytkownika:AndrzejSalwicki|dyskusja]]) 19:09, 31 maj 2018 (CEST)&lt;br /&gt;
* Według Harela, zob. Dynamic Logic,  każda formuła algorytmiczna prawdziwa w standardowym modelu arytmetyki powinna być twierdzeniem teorii &amp;lt;math&amp;gt;Th_{2.5}&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
* Czy teoria kontenerów (tj. słowników, dictionaries) bez aksjomatu algorytmicznego jest zupełna?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
[[Category:Logika Algorytmiczna}}]]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Logika_Algorytmiczna</id>
		<title>Logika Algorytmiczna</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Logika_Algorytmiczna"/>
				<updated>2026-02-25T12:35:51Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;p style=&amp;quot;text-align: right;&amp;quot;&amp;gt;&amp;lt;small&amp;gt;''Felix qui potuit rerum cognoscere causas'' &amp;lt;/small&amp;gt; &amp;lt;/p&amp;gt;&lt;br /&gt;
=Próba zmian&lt;br /&gt;
= Wprowadzenie =&lt;br /&gt;
Zmiana kontrolna Środa 21 maja 2025 g. 19:25&lt;br /&gt;
Logika algorytmiczna AL jest  ''rachunkiem logicznym''.  Nie jest to byle jaki system logiczny. Stworzony został przez nas  jako narzedzie pomocne i niezbędne w pracy nad oprogramowaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
Rachunek programów tj. logika algorytmiczna:&lt;br /&gt;
* uzupełnia język o programy,&lt;br /&gt;
* program jest wyrażeniem zbudowanym z programów atomowych - instrukcji przypisania przy pomocy kilku operatorów programotwócztch: while, if, złożenie,&lt;br /&gt;
* program może poprzedzać formułę i takie wyrażenie jest także formułą,&lt;br /&gt;
&lt;br /&gt;
Rachunek programów AL umożliwia:&lt;br /&gt;
# Wyrażenie własności programu przez odpowiednio napisaną formułę języka systemu AL [[Wyrażalność semantycznych własności programów]]&lt;br /&gt;
# Przeprowadzanie dowodów formuł wyrażających ważne semantyczne własności programów, [[Przykłady dowodów]]. &lt;br /&gt;
# Podanie aksjomatów dla wielu struktur danych.  Aksjomaty takie wykluczają struktury niechciane, czy wręcz struktury patologiczne.[[Aksjomaty struktur]]&lt;br /&gt;
# Specyfikację oprogramowania, [[SpecVer]]&lt;br /&gt;
# Weryfikację oprogramowania względem ustalonej specyfikacji.&lt;br /&gt;
# Aksjomatyczny opis semantyki danego języka programowania.[[Aksjomatyczna definicja języka programowania]]&lt;br /&gt;
# i wiele innych rzeczy.&lt;br /&gt;
[[Plik:4logiki.jpg|thumb|center |750px| Rys. 1  Cztery systemy logiczne ]]&lt;br /&gt;
Powyższy rysunek 1 ilustruje relacje zachodzące pomiędzy tymi czterema rachunkami logicznymi. Strzałki wskazują na zachodzenie następującej relacji &amp;lt;math&amp;gt;\mathcal{L}\rightarrow\mathcal{L}'&amp;lt;/math&amp;gt; pomiędzy dwoma rachunkami logicznymi &amp;lt;math&amp;gt;\mathcal{L}&amp;lt;/math&amp;gt; i &amp;lt;math&amp;gt;\mathcal{L}'&amp;lt;/math&amp;gt;: ''Każda tautologia'' &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; ''rachunku'' &amp;lt;math&amp;gt;\mathcal{L}&amp;lt;/math&amp;gt; ''staje się tautologią rachunku ''&amp;lt;math&amp;gt;\mathcal{L}&amp;lt;/math&amp;gt;' ''po zastąpieniu atomów formuły'' &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; ''przez formuły rachunku'' &amp;lt;math&amp;gt;\mathcal{L}&amp;lt;/math&amp;gt;. Nieco więcej informacji uzyskamy porównując zbiory wyrażeń poprawnie zbudowanych &amp;lt;math&amp;gt;\mathcal{WFF} &amp;lt;/math&amp;gt;.  &amp;lt;br /&amp;gt;&lt;br /&gt;
Języki tych rachunków logicznych różnią się. Każdy język jest parą &amp;lt;alfabet, zbiór wyrażen poprawnie zbudowanych&amp;gt;. Zwróćmy uwagę na to, że za każdym razem struktura zbioru wyrażeń poprawnie zbudowanych &amp;lt;math&amp;gt;\mathcal{WFF} &amp;lt;/math&amp;gt; (''ang''. well formed formulas) jest inna. &amp;lt;br /&amp;gt;&lt;br /&gt;
Oznaczenia przyjete na rysunku: &amp;lt;math&amp;gt;\mathcal{L}&amp;lt;/math&amp;gt; - język, &amp;lt;math&amp;gt;\mathcal{A}&amp;lt;/math&amp;gt; - alfabet, &amp;lt;math&amp;gt;\mathcal{T}&amp;lt;/math&amp;gt; - zbiór termów (wyrażeń arytmetycznych, obiektowych,...), &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; - zbiór formuł, &amp;lt;math&amp;gt;\mathcal{P}&amp;lt;/math&amp;gt; - zbiór programów.&lt;br /&gt;
[[Plik:AxiomPL.jpg|thumb|750px| Rys. 2  Aksjomaty rachunku zdań ]]&lt;br /&gt;
[[Plik:axiomsFOL-AL.jpg|thumb |750px|  Rys. 3  Aksjomaty rachunku predykatów(Ax12 i Ax13) i rachunku programów ]]&lt;br /&gt;
[[Plik:inferenceRules.jpg| thumb  |750px| Rys. 4 Reguły wnioskowania ]]&lt;br /&gt;
Zbiór formuł logiki algorytmicznej zawiera w sobie wszystkie formuły pierwszego rzędu i ponadto, jest zamknięty ze względu na poprzedzanie formuły programem. Jeśli &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; jest formułą i &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; jest programem to wyrazenie postaci &amp;lt;math&amp;gt;K\alpha&amp;lt;/math&amp;gt; jest formułą logiki algorytmicznej, krócej, formułą algorytmiczna.&amp;lt;br /&amp;gt;&lt;br /&gt;
Jak takiej formule &amp;lt;math&amp;gt;K\alpha&amp;lt;/math&amp;gt; przypisać wartość logiczną prawda lub fałsz?&lt;br /&gt;
[[Plik:Kalfa.jpg |thumb|left|300px|Rys. 5  Wyznaczanie wartośći formuły &amp;lt;math&amp;gt;K\alpha&amp;lt;/math&amp;gt; ]]&lt;br /&gt;
Rysunek 5 powinien wszystko wyjaśnić.Pozostaje jednak przypadek gdy obliczenie programu K nie daje wyniku, z powodu zapętlenia się programu lub innego błędu. Oczywiście nie możemy wtedy twierdzić, że ''dla danych v, obliczenie programu K kończy się pomyślnie i wyniki spełniają warunek &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;''. A więc w tym przypadku wartościa formuły &amp;lt;math&amp;gt;K\alpha&amp;lt;/math&amp;gt; jest fałsz.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
O logice algorytmicznej możemy też powiedzieć, że jest [[rachunek programów|''rachunkiem programów'']].   Język logiki algorytmicznej zawiera programy i formuły algorytmiczne. '''Ważne''' jest to, że ''każda semantyczna własność programów np. poprawność, równowazność, kończenie obliczeń lub przeciwnie zapętlanie, ... może być wyrażona przez odpowiednią formułę''. Pozwala to zamienić zadanie wykazania, że pewien program  &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; posiada pewną własnośc semantyczną &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; na zadanie udowodnić formułę &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; należąca do języka logiki algorytmicznej. &amp;lt;br /&amp;gt;'''Przykład''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Własność: ''Dla każdych danych &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;, jeśli  program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; rozpoczyna obliczenia z danymi spełniającymi warunek &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; to jego obliczenie zakończy się (nie będzie zapętlenia, ani przerwania obliczeń) i jego wyniki spełniają warunek &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;'', jest wyrażana formułą &amp;lt;math&amp;gt;\alpha \rightarrow K\beta&amp;lt;/math&amp;gt;. Nie musimy więc podejmować trudu testowania czy dla kazdych danych obliczenie programu K będzie skończone i ... &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Formuły tworzą algebrę z działaniami: konkatenacji, alternatywy, negacji i implikacji oraz z działaniami nieskończonymi tj. kwantyfikatorami, ponadto programy są modalnościami. Programy też tworzą algebrę: działaniami tej algebry są iteracja, rozgałęzienie i złożenie programów. Mamy więc do czynienia ze splotem dwu algebr. Możemy go nazwać rachunkiem programów.  Zadaniem logiki algorytmicznej jest poszukiwanie ''praw rachunku programów''. &lt;br /&gt;
&lt;br /&gt;
Celem jest zebranie praw i reguł wnioskowania, które umożliwią analizę algorytmów i wydawanie opinii o ich własnościach semantycznych, bez wykonywania obliczeń, na podstawie samego tekstu algorytmu i aksjomatów struktury danych w jakiej dany program ma byc interpretowany.&lt;br /&gt;
&lt;br /&gt;
'''Przykład'''&lt;br /&gt;
Rozpatrzmy prosty program&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;small&amp;gt;    (* Dane:  x&amp;gt;0  i  y&amp;gt;0  liczby naturalne *)&lt;br /&gt;
    '''Deklaracje:'''  typ(x, y, n, m, r, q, max)='''N''' &amp;amp;  typ(n_mniejsze)=Boolean &lt;br /&gt;
    &lt;br /&gt;
    n:=x; m:=y;&lt;br /&gt;
    '''while''' n ≠ m '''do'''&lt;br /&gt;
       '''''Oznaczenie''''' niech l=max(n,m)&lt;br /&gt;
       r:=0; &lt;br /&gt;
       '''while''' r ≠n '''and''' r ≠m '''do'''  r:=r+1  '''od'''; &lt;br /&gt;
       '''if''' r=n '''then''' n_miejsze:=true; max:=m '''else''' n_mniejsze:=false; max:=n '''fi'''; &lt;br /&gt;
       '''''Stwierdzenie''''' (n&amp;lt;m &amp;amp; m=max(n,m) lub m&amp;lt;n &amp;amp; n=max(n,m))&lt;br /&gt;
       q:=0; &lt;br /&gt;
       '''while''' r≠max  '''do'''  r:= r+1; q:=q+1  '''od'''; &lt;br /&gt;
       '''''Stwierdzenie''''' q = |m-n| &amp;amp; (1 ≤ q &amp;lt; max(n,m))&amp;amp; r=max(n,m)&lt;br /&gt;
       '''if''' n_mniejsze '''then''' m:=q '''else''' n := q '''fi''' &lt;br /&gt;
       '''''Stwierdzenie''''' max(n,m) &amp;lt;  l&lt;br /&gt;
   '''od''' ( wynik = n) &lt;br /&gt;
(* Wynik:  nwd(x,y)   *)&amp;lt;/small&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Co robi ten program? Czy to jest pytanie dobrze postawione?&lt;br /&gt;
Czy obliczenie tego programu jest skończone dla każdych danych &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; i &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt;?&lt;br /&gt;
Czym są te dane? Jakie znaczenie mają operacje - i + oraz stała 1? Jakie znaczenie ma predykat &amp;lt;?&lt;br /&gt;
&lt;br /&gt;
Wiele osób powie,że przecież to proste. Powyższy program oblicza największy wspólny dzielnik liczb naturalnych &amp;lt;math&amp;gt;xP&amp;lt;/math&amp;gt; i &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt;. No tak, ale skąd wiesz, że środowisko w którym wykonujesz ten program nie jest podejrzane? Na kolejnej stronie możesz zobaczyć klasę która implementuje operacje dodawania liczb naturalnych i relację równości w niestandardowy sposób. Powyższy program w otoczeniu tej klasy zachowuje się niestandardowo. Po pierwsze, obliczenia tego programu sa nieskończone dla pewnych danych. Powiesz mi, ta klasa nie spełnia aksjomatów liczb naturalnych? Otóż '''spełnia'''. Jakie więc aksjomaty należy wziąć pod uwagę i o co mamy pytać?   &lt;br /&gt;
&lt;br /&gt;
Zanim zaczniesz analizować działanie programu powinieneś zdać sobie sprawę z kilku rzeczy:&lt;br /&gt;
# Program zachowuje się różnie w różnych otoczeniach. Czym jest otoczenie? To zależy, może to być pierwotny typ danych np. integer w wielu językach programowania lub struktura danych opisana za pomocą pewnej klasy.&lt;br /&gt;
# Podczas analizy powinniśmy rozpatrywać program &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; w parze z jego otoczeniem &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;. Podczas analizy nie wystarczy nam nazwa otoczenia, ani sygnatura nazywana przez programistów interfejsem (ang, ''interface'').&lt;br /&gt;
# W procesie analizy musimy korzystać z własności otoczenia np. z przemienności i łączności dodawania.&lt;br /&gt;
# Musimy też sobie zadawać sprawę, że wielu podstawowych własności nie da się wyrazić formułami pierwszego rzędu.&lt;br /&gt;
# '''Własności algorytmiczne naszych programów wynikają z własności algorytmicznych otoczenia.'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zechciej przejść na stronę [[Euklides]] by poznać nasze argumenty.&lt;br /&gt;
&lt;br /&gt;
== Program logiki algorytmicznej ==&lt;br /&gt;
Zadaniem logiki algorytmicznej jest dostarczenie narzędzi do analizowania semantycznych własności programów takich jak: własność stopu, poprawność programu, etc.&lt;br /&gt;
W języku logiki algorytmicznej znajdujemy trzy zbiory: zbiór formuł, zbiór wyrażeń (zbiór termów) i zbiór programów (zbiór algorytmów).&lt;br /&gt;
'''Uwaga''' W języku logiki zdaniowej (rachunku zdań) rozważany jest jeden tylko zbiór wyrażeń poprawnie zbudowanych, jest to zbiór formuł (zdaniowych). Formuły stanowią najmniejszy zbiór napisów zawierający zbiór zmiennych zdaniowych i zamknięty ze względu na operatory logiczne.&lt;br /&gt;
W jeżyku logiki pierwszego rzędu zb→ór wyrażen poprawnie zbudowanych jest suma dwu rozłącznych zbiorów: zbioru termów(inaczej zbiór wyrażen nazwowych) i zbioru formuł. W rachunku programów (czyli logice algorytmicznej) w naturalny sposób pojaia się zbiór algorytmów. '''koniec uwagi''' &lt;br /&gt;
Znaczeniem programu &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; jest funkcja ze zbioru &amp;lt;math&amp;gt;W&amp;lt;/math&amp;gt; wartościowań zmiennych w ten sam zbiór. Zazwyczaj funkcję tę określa się przy pomocy pojęcia [[obliczenia programu]].&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{figure}[h]\begin{center}&lt;br /&gt;
\usepackage{tikz}&lt;br /&gt;
  		\tikzstyle{stan}=[rectangle , text=blue]&lt;br /&gt;
  		\tikzstyle{is}=[-&amp;gt;,&amp;gt;=latex,rounded corners=4pt]&lt;br /&gt;
  		\begin{tikzpicture}[scale=0.38]&lt;br /&gt;
  			%\draw [gray, very thin] (-2,-2) grid [step=1cm] (28,50);&lt;br /&gt;
  			\draw (-2,5) -- (4,18) -- (27,18) -- (23,5) -- cycle[fill=green!25];&lt;br /&gt;
  			\node[stan] (T) at (4.44,14)  {$v:\frac{x\, y\, z}{k\,l\,p}$};&lt;br /&gt;
  			\node[stan] (U) at (24,14) {$\frac{true}{false}$};&lt;br /&gt;
  			\node[stan] (V) at (14,6.2) {$v^{\prime}:\frac{x\, y\, z}{n\,l\,p}$};&lt;br /&gt;
  			\draw[is] (T) to[bend left]node[midway,below]{ $\bigl(\alpha(x/\tau)\bigr)_{\color{red}{\mathfrak{A}}\color{black}{}}$ } (U) ; &lt;br /&gt;
  			\draw[is] (T) to[bend right]node[midway,above ]{$\bigl(\{x:=\tau\}\alpha\bigr)_{\color{red}{\mathfrak{A}}\color{black}}$} (U) ;&lt;br /&gt;
  			\draw[is] (V) -- (U)node[midway,right]{$ \alpha(x)_{\color{red}{\mathfrak{A}}\color{black}{\ }}$ }; &lt;br /&gt;
  			\draw[is] (T) -- (V)node[midway,left]{$\{x:=\tau \}_{\color{red}{\mathfrak{A}}\color{black}}$ }; &lt;br /&gt;
  			\draw (0,20) -- (4,24) -- (27,24) -- (23,20) -- cycle[fill=yellow!35];&lt;br /&gt;
  			&lt;br /&gt;
  			\node[stan] (T1) at (9,22)  {$\{x:=\tau\}\alpha $   };&lt;br /&gt;
  			\node[stan] (U1) at (19,22) {$\alpha(x/\tau) $ };&lt;br /&gt;
  			\node[stan] (V1) at (14,22) {$\Leftrightarrow$ };&lt;br /&gt;
  			&lt;br /&gt;
  			\draw [color=red, thick, -&amp;gt;] (9,22) -&amp;gt;   (13,12.4)node[midway,left,near start]{$\mathfrak{A}$} ; &lt;br /&gt;
  			\draw [color=red,  thick, -&amp;gt;] (19,22) -&amp;gt; (16,16.5)node[midway,left]{$\mathfrak{A}$} ;&lt;br /&gt;
  		\end{tikzpicture} &lt;br /&gt;
  		\caption{Aksjomat instrukcji przypisania \\&lt;br /&gt;
  			&amp;quot;\textit{warunek $\alpha(x)$ zachodzi po wykonaniu instrukcji $x\,:=\tau$ wttw, gdy przed wykonaniem tej instrukcji zachodzi warunek $\alpha(x/ \tau)$}&amp;quot;&lt;br /&gt;
  			jest tautologią\\&lt;br /&gt;
  			\begin{scriptsize}&lt;br /&gt;
  				na górnej płaszczyznie wydrukowaliśmy text  aksjomatu, \\&lt;br /&gt;
  				na dolnej płaszczyznie objaśniamy co się dzieje podczas obliczeń i wskazujemy znaczenie (tj. semantykę) aksjomatu, &lt;br /&gt;
  				Litera $\mathfrak{A}$ oznacza dowolny typ (na razie przyjmij, że może to być typ integer lub typ real). Czerwone strzałki łączą formułę   $\alpha(x/\tau) $ (odpowiednio \{x:=$\tau$\}$\alpha $) z funkcją $\alpha(x/\tau)_{\mathfrak{A}}$ (odpowiednio $\{x:=\tau \}(\alpha)_{\mathfrak{A}}$ ). &lt;br /&gt;
  				Stan pamięci $v'$ i dodatkowe strzałki ilustrują sposób obliczania  wartości formuły, $\{x:=\tau \}(\alpha)$, zauważ, wartość $v'(x)=n= \tau_{\mathfrak{A}}( v(x))$. &lt;br /&gt;
  		\end{scriptsize}}\label{rAx18}&lt;br /&gt;
  	\end{center}&lt;br /&gt;
  \end{figure} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Zastosowania ==&lt;br /&gt;
Stosując logikę algorytmiczną czyli rachunek programów potrafimy odpowiedziec twierdząco na nastepujące pytania:&lt;br /&gt;
# Czy można podać aksjomaty i reguły wnioskowania, które opiszą semantykę operacyjną języka programowania?&lt;br /&gt;
# Czy (i jakie) własności struktur danych (systemów algebraicznych) są wyrażalne w języku logiki algorytmicznej?&lt;br /&gt;
# Czy (i jakie) własności programów są wyrażalne formułami algorytmicznymi?&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ad 2. W matematyce rozważa się wiele własności ważnych struktur algebraicznych, których nie można wyrazić w języku pierwszego rzędu. Większość z nich może być wyrażona przy pomocy formuł algorytmicznych &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* bycie liczbą naturalną,&lt;br /&gt;
* aksjomat Archimedesa&lt;br /&gt;
* aksjomat ciał charakterystyki zero&lt;br /&gt;
* aksjomat grup torsyjnych&lt;br /&gt;
* aksjomat grup cyklicznych&lt;br /&gt;
i in.&amp;lt;br /&amp;gt;&lt;br /&gt;
Dla informatyków niezwykle ważny jest fakt, że niemal wszystkie napotykane w programach struktury danych mogą być scharakteryzowane przy pomocy formuł algorytmicznych&lt;br /&gt;
* s jest stosem (skończonym)&lt;br /&gt;
* q jest kolejką FIFO skończoną&lt;br /&gt;
* s jest drzewem binarnym&lt;br /&gt;
* d jest drzewem binarnych poszukiwań&lt;br /&gt;
* q jest kolejką priorytetową&lt;br /&gt;
* d jest strukturą słownika (ang. dictionary)&lt;br /&gt;
* k jest kopcem&lt;br /&gt;
itd.&lt;br /&gt;
== Inne logiki programów ==&lt;br /&gt;
Możesz się zapytać jak się ma rachunek programów (tj. logika algorytmiczna) do innych logik programów : np. rachunek Floyda, logika Hoare'a, rachunek najsłabszego warunku wstępnego Dijkstry, logiki dynamicznaj, etc.?&lt;br /&gt;
&lt;br /&gt;
[[calculus of Floyd|rachunek  Floyda]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[logic of Hoare|logika Hoare'a]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
calculus of weakest precondition of Dijkstra&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[dynamic logic]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Uwagi historyczne ==&lt;br /&gt;
Algorytmy pojawiły sie kilka tysięcy lat temu. W Babilonie, Egipcie i Grecji.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
W czasach nowożytnych studia nad algorytmami podjęli Goedel, Turing, Church, Markov, Kołmogorov i wielu innych. Szkoda, że Tarski nie rozszerzył swych badań nad semantyką na funkcje obliczalne. Szkoda, że studia funkcji obliczalnych skupiły się na samych funkcjach, zaniedbując aspekt językowy. Prawie nie zajmowano się językiem służcym do definiowania funkcji rekurencyjnych. Alonzo Curch był chyba wyjatkiem? D. Kleene był blisko - jego definicja operatora minimum ograniczonego to przeciez petla FOR, a operacja minimum efektywnego to pętla WHILE. Warto pamietac twierdzenie S. Kleene z r. 1942 o tym, że zbiór funkcji obliczalnych jesli jest zamknięty ze względu na superpozycję i minimum efektywne  ( i zawiera kilka funkcji poczatkowych) to definiowanie funkcji obliczalnych przez rekursję prostą może być zastąpione przez operację minimum efektywnego.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Po drugiej wojnie światowej gdy pojawiły się komputery (zwane wtedy maszynami matematycznymi), ich programy zapisywano w kodzie maszynowym lub (później) w assemblerze. Trudno było dostrzec struktury i prawidłowości. W maszynie von Neumanna wszystko jest ciągiem bitów - liczbą. Ale pamiętam odczyt Antoniego Mazurkiewicza (ok 1960 r.) i jego dowód poprawności algorytmu z jedną pętla. Algorytm miał obliczyć sumę liczb zapisanych w tablicy. Kod maszyny XYZ-1 był bardzo ubogi. Program wymagał pobrania instrukcji &amp;quot;''weź kolejną komórkę pamięci do Akumulatora''&amp;quot; do rejestru Akumulator, zwiększenia adresu i zapisaniu tak zmienionej instrukcji w pamięci rozkazów na swoim pierwotnym miejscu. Program był więc ciągiem słów binarnych - każde słowo można jednak interpretować dwoiście, jako liczbę lub jako instrukcję. Nie ma w tym żadnej widocznej struktury.&amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Prekursorzy logiki algorytmicznej&amp;lt;br /&amp;gt;&lt;br /&gt;
Janov - jego praca poprzedza zdaniową logikę dynamiczną. Przedmiotem analizy są schematy programów (zapisywane w bardzo specjalny sposób) i relacja równoważności schematów. Dzisiaj powiedzielibyśmy, że schemat programu jest grafem skończonym. Wierzchołkom grafu przyporządkowano albo zmienną programowa albo formułę zdaniowa. Praca Janova jest nie tylko trudno dostępna, ale przede wszystkim mało czytelna. W książce A.P. Ershova można znaleźć przystępną ekspozycję teorii Janova.&amp;lt;br /&amp;gt;&lt;br /&gt;
Engeler(1967) - zauważył, że własność stopu programu można wyrazić jako formułę logiki &amp;lt;math&amp;gt;L_{\omega1\,\omega} &amp;lt;/math&amp;gt;, a dokładniej jako nieskończoną alternatywę formuł otwartych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Warto też wspomnieć o pracach Glushkova dotyczących systemów algebr algorytmicznych i książkę Helmuta Thielego. &amp;lt;br /&amp;gt;&lt;br /&gt;
''Rasiowa'' - w książce ''Mathematics of metamathematics''(1963) str. 218 sformułowała podstawową własność instrukcji przypisania. Niech &amp;lt;math&amp;gt; s &amp;lt;/math&amp;gt; oznacza jakieś odwzorowanie &amp;lt;math&amp;gt; s\colon V \to T &amp;lt;/math&amp;gt; gdzie &amp;lt;math&amp;gt; V &amp;lt;/math&amp;gt; jest zbiorem zmiennych indywiduowych, a &amp;lt;math&amp;gt; T &amp;lt;/math&amp;gt; jest zbiorem termów. Odwzorowanie &amp;lt;math&amp;gt; s &amp;lt;/math&amp;gt; nazywa się podstawieniem. Jeśli &amp;lt;math&amp;gt; \tau &amp;lt;/math&amp;gt; oznacza jakiś term to &amp;lt;math&amp;gt; s\,\tau &amp;lt;/math&amp;gt; oznacza wyrażenie powstające z termu &amp;lt;math&amp;gt; \tau &amp;lt;/math&amp;gt; przez równoczesne zastąpienie wszystkich wystąpień zmiennych indywiduowych &amp;lt;math&amp;gt; \tau &amp;lt;/math&amp;gt; przez odpowiednie wartości odwzorowania &amp;lt;math&amp;gt; s &amp;lt;/math&amp;gt;. Oznaczmy term &amp;lt;math&amp;gt; \tau &amp;lt;/math&amp;gt; przez &amp;lt;math&amp;gt; \tau(x_1,\dots,x_n)&amp;lt;/math&amp;gt; podkreślając, że zmienne &amp;lt;math&amp;gt; x_1,\dots,x_n &amp;lt;/math&amp;gt; to są wszystkie zmienne występujące w termie &amp;lt;math&amp;gt; \tau &amp;lt;/math&amp;gt;. Wynik równoczesnego podstawienia za zmienne &amp;lt;math&amp;gt; x_1,\dots,x_n &amp;lt;/math&amp;gt; występujące w termie &amp;lt;math&amp;gt; \tau &amp;lt;/math&amp;gt;, termów &amp;lt;math&amp;gt; s(x_1),\dots,s(x_n) &amp;lt;/math&amp;gt;   &amp;lt;br /&amp;gt; oznaczmy &amp;lt;math&amp;gt; s\tau &amp;lt;/math&amp;gt;. Mamy więc równość &amp;lt;math&amp;gt; s\tau(x_1,\dots,x_n)= \tau(s(x_1),\dots,s(x_n)) &amp;lt;/math&amp;gt;. Można bez trudu udowodnić, że wynik jest tez termem. &lt;br /&gt;
Przypomnijmy teraz ten element definicji pojęcia spełniania (Tarski): dla ustalonej interpretacji symboli funkcyjnych &amp;lt;math&amp;gt; R &amp;lt;/math&amp;gt; i ustalonego wartościowania zmiennych &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt;, term &amp;lt;math&amp;gt; \tau  &amp;lt;/math&amp;gt; wyznacza funkcję ze zbioru wartościowań w zbiór wartoścowań.&lt;br /&gt;
Teraz możemy sformułować &amp;lt;br /&amp;gt;&lt;br /&gt;
Niech &amp;lt;math&amp;gt; R &amp;lt;/math&amp;gt; będzie dowolnie ustaloną interpretacją symboli funkcyjnych, niech &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; będzie dowolnym wartościowaniem zmiennych. Dla każdego podstawienia &amp;lt;math&amp;gt; s &amp;lt;/math&amp;gt; i każdego termu &amp;lt;math&amp;gt; \tau &amp;lt;/math&amp;gt; zachodzi równość &lt;br /&gt;
&amp;lt;math&amp;gt; s\tau_R(v)=\tau_R(s_R(v))  &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Zauważmy, że w czasie pisania ksiązki ''Mathematics of metamathematics''(przed r. 1963) ani Rasiowa ani Sikorski nie mieli pojęcia o programowaniu. A jednak, gdy zapisać podstawienie &amp;lt;math&amp;gt; s &amp;lt;/math&amp;gt; w trochę innej formie &amp;lt;math&amp;gt; \{x_1:=\tau_1 \&amp;amp; \dots \&amp;amp; x_n:=\tau_n \} &amp;lt;/math&amp;gt; i zrozumieć, że wartościowanie zmiennych to to samo co stan pamięci, a interpretacja &amp;lt;math&amp;gt; R &amp;lt;/math&amp;gt; to po prostu jednostka arytmetyczna komputera, to wszystko trafia na swoje miejsce.&lt;br /&gt;
&lt;br /&gt;
== Bibliografia ==&lt;br /&gt;
Książki&lt;br /&gt;
&lt;br /&gt;
# [AlgoLog] [[Media:Algorithmic_Logic.pdf | {{cytuj książkę |odn=tak| nazwisko = Mirkowska| imię = Grażyna | nazwisko2 = Salwicki | imię2 = Andrzej | tytuł = Algorithmic Logic | wydawca = PWN | miejsce = Warszawa | data = 1987 | strony = 345}}]] &lt;br /&gt;
# [LogProg1] [[Media:LogikaAlgorytmiczna_1z2.pdf | {{cytuj książkę | odn=tak |imię2=Andrzej | nazwisko2=Salwicki | imię=Grażyna | nazwisko=Mirkowska| tytuł=Logika Algorytmiczna dla Programistów|wydawca=WNT | miejsce=Warszawa| data=1992|strony=294 }}]] cz.1&amp;lt;br /&amp;gt;&lt;br /&gt;
[[book Algorithmic Logic  ]]&lt;br /&gt;
# [LogProg2] [[Media:LogikaAlgorytmiczna_2z2.pdf | {{cytuj książkę | odn=tak |imię2=Andrzej | nazwisko2=Salwicki | imię=Grażyna | nazwisko=Mirkowska| tytuł=Logika Algorytmiczna dla Programistów|wydawca=WNT | miejsce=Warszawa| data=1992|strony=294 }}]] cz.2&lt;br /&gt;
#[AL4software] [[Media:AlgoLogic.pdf| {{cytuj książkę | odn=tak |imię2=Andrzej | nazwisko2=Salwicki | imię=Grażyna | nazwisko=Mirkowska| tytuł=Algorithmic Logic for Software Construction and Verification|wydawca=Dąbrowa Research | miejsce=Dąbrowa Leśna| data=2014|strony=154 }}]]&lt;br /&gt;
# [CentrumBanachAL] [[ Media:bcp211.pdf  |{{Cytuj książkę |odn=tak| nazwisko = Banachowski | imię = Lech | tytuł = An introduction to Algorithmic Logic - Metamathematical Investigations of Theory of Programs | wydawca = PWN | miejsce = Warszawa | data = 1977 | seria = Banach Center Publications | strony = 7-99 | isbn = 123 | nazwisko2 = Kreczmar | imię2 = Antoni | nazwisko3 = Mirkowska | imię3 = Grażyna | nazwisko4 = Rasiowa | imię4 = Helena | nazwisko5 = Salwicki | imię5 = Andrzej | tom = 2 | tytuł tomu = Banach Center Publications  }}]]&lt;br /&gt;
# [HRAL]  {{Cytuj książkę | odn=tak | nazwisko= Rasiowa | imię=Helena | tytuł= Algorithmic Logic - Notes from Seminar  in Simon Fraser University | data=1975 | seria= Reports of Institute of Computer Science PAS | tom=281 | miejsce=Warsaw }}&lt;br /&gt;
# [AB]  {{Cytuj książkę | odn=tak | nazwisko= Biela | imię=Andrzej | tytuł= Algorithmic structural completeness and a retrieval system for proving theorems in algorithmic theories  | data=2000 | wydawca=Wydawnictwo Uniwersytetu Śląskiego | tom=1901 | miejsce=Katowice | strony=122 | url=http://lem12.uksw.edu.pl/images/4/40/A-Biela.pdf }}&lt;br /&gt;
Artykuły (wybór)&lt;br /&gt;
# [GMP] [[Media:GMP1970.pdf | {{cytuj pismo | odn=tak | nazwisko = Góraj | imię = Anna | nazwisko2= Mirkowska | imię2 = Grazyna | nazwisko3 = Paluszkiewicz | imię3 = Anna| tytuł = On the notion of description of program | czasopismo = Bull. Acad. Polon. Sci. Ser. Math. Astr. Phys.| rok= 1970 |strony = 499 - 505 }}]]   &lt;br /&gt;
# [GM1971] {{cytuj pismo | odn=tak |nazwisko= Mirkowska | imię= Grażyna | tytuł = On Formalized Systems of Algorithmic Logic | czasopismo= Bull. Polish Academy Sciences, Ser. Math. Phys. |rok =1971 |tom = 19 | strony=421-428 |url=http://lem12.uksw.edu.pl/images/6/6f/On_Formalized-Mirk.pdf}}  &lt;br /&gt;
# [GM1] [[Media:MirkowskaI-1-17.pdf| {{cytuj pismo | odn=tak | nazwisko= Mirkowska | imię = Grazyna |  tytuł = Algorithmic logic and its applications in the theory of programs I | czasopismo = Fundamenta Informaticae| rok= 1977 |strony = 1-17 }} ]]&lt;br /&gt;
# [GM2] [[Media:Mirkowska-II-147-165.pdf| {{cytuj pismo | odn=tak | nazwisko= Mirkowska | imię = Grazyna |  tytuł = Algorithmic logic and its applications in the theory of programs II | czasopismo = Fundamenta Informaticae| rok= 1977 |strony = 147-165 }} ]]&lt;br /&gt;
# [AS1] [[Media:FormalizedAlgorithmicLanguages.pdf | {{cytuj pismo | odn=tak | nazwisko= Salwicki | imię = Andrzej |  tytuł = Formalized Algorithmic Languages | czasopismo = Bull. Acad. Polon. Sci. Ser. Math. Astr. Phys.| rok= 1970 |tom=18 |strony = 227-232 }} ]]&lt;br /&gt;
# [AS3] [[Media:CalculuswIterationQuantifiers.pdf | {{cytuj pismo | odn=tak | nazwisko= Salwicki | imię = Andrzej |  tytuł = On the predicate calculi with iteration quantifiers | czasopismo = Bull. Acad. Polon. Sci. Ser. Math. Astr. Phys.| rok= 1970 |tom=18 |strony = 279-285 }} ]]&lt;br /&gt;
# [LB1] [[Media:BanI-93-119.pdf| {{cytuj pismo | odn=tak | nazwisko= Banachowski | imię = Lech |  tytuł = Investigations of Properties of Programs by means of Extended Algorithmic Logic I | czasopismo = Fundamenta Informaticae| rok= 1977 |strony = 93-119 }} ]]&lt;br /&gt;
# [LB2] [[Media:Banachowski-II-167-193.pdf| {{cytuj pismo | odn=tak | nazwisko= Banachowski | imię = Lech |  tytuł = Investigations of Properties of Programs by means of Extended Algorithmic Logic II | czasopismo = Fundamenta Informaticae| rok= 1977 |strony = 167-193 }} ]]&lt;br /&gt;
# [LB3] [[Media:BanachowskiDataStruct.pdf| {{cytuj pismo | odn=tak | nazwisko= Banachowski | imię = Lech |  tytuł = An Axiomatic Approach to the Theory of Data Structures | czasopismo = Bull. Acad. Polon. Sci. Ser. Math. Astr. Phys. | rok= 1975 |strony = 315-323 }} ]]&lt;br /&gt;
# [AK1] [[Media:Kreczmar-Program-Fields.pdf| {{Cytuj pismo |odn=a | imię=Antoni | nazwisko=Kreczmar |tytuł=Programmability in Fields |czasopismo=Fundamenta Informaticae |strony=195-230 |rok=1977}}]]&lt;br /&gt;
# [AK2] [[Media:Kreczmar-Efficiency-problems.pdf| {{Cytuj pismo |odn=b | imię=Antoni | nazwisko=Kreczmar |tytuł=Effectivity problems of Algorithmic Logic |czasopismo=Fundamenta Informaticae |strony=19-32 |rok=1977}}]]&lt;br /&gt;
# [MSS2009] [[Media:Verifying-a-class.pdf  |{{cytuj pismo| odn=tak| nazwisko=Mirkowska| imię=Grażyna| nazwisko2=Salwicki| imię2=Andrzej| nazwisko3=Świda| imię3=Oskar| tytuł=Verifying a Class: combining Testing and Proving|czasopismo=Fundamenta Informaticae| strony= 305-324 |rok= 2009 }}]]&lt;br /&gt;
# [AS2017] [[Media:On-Euclids-algorithm-2018.pdf | {{Cytuj pismo| odn=nie| nazwisko=Salwicki| imię=Andrzej| tytuł=A new proof of Euclid's algorithm | czasopismo= }}]]&lt;br /&gt;
# [WD1] [[ Media:WDnonprog.pdf |  {{Cytuj pismo | odn=nie| nazwisko= Dańko | imię=Wiktor | tytuł=Nonprogrammable function defined by a procedure }} ]]&lt;br /&gt;
&lt;br /&gt;
==Protokół rozbieżności==&lt;br /&gt;
Następujący tekst został złożony do druku&lt;br /&gt;
[[Media:On-Euclids-algorithm-2018.pdf | {{Cytuj pismo| odn=nie| nazwisko=Salwicki| imię=Andrzej| tytuł=A new proof of Euclid's algorithm | czasopismo= }}]] &amp;lt;br /&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
Pierwsza recenzja była rzeczowa, pomocna i jej sugestie zostały, z podziękowaniem, wykorzystane http://lem12.uksw.edu.pl/images/8/8c/1pierwszaRec.pdf. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Drugi recenzent przedstawił następującą opinię http://lem12.uksw.edu.pl/images/0/0b/Second-report-08.pdf. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Na to autor odpowiedział prosząc o referencje do zapowiadanych twierdzeń lub o przedstawienie dowodu. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Oto protokół rozbieżności:&lt;br /&gt;
http://lem12.uksw.edu.pl/images/9/9a/DiscrepancyReport.pdf&lt;br /&gt;
&lt;br /&gt;
==Pytania otwarte==&lt;br /&gt;
* Rozpatrzmy teorię algorytmiczną &amp;lt;math&amp;gt;Th_{2.5} = \langle L,C,A \rangle &amp;lt;/math&amp;gt; gdzie&lt;br /&gt;
&amp;lt;math&amp;gt;L&amp;lt;/math&amp;gt; - język, jest językiem struktury liczb naturalnych, algorytmicznym, &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; - operacja konskwencji jest wyznaczona przez zbiór aksjomatów i reguł wnioskowania logiki algorytmicznej (rachunku programów),&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; - zbiór aksjomatów, jest zbiorem wszystkich formuł pierwszego rzędu prawdziwych w standardowym modelu liczb naturalnych.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Czy  formuła &amp;lt;math&amp;gt;\color{blue}\forall x\, \{y:=0;\, \mathbf{while}\ x\neq y\ \mathbf{do}\ y:=y+1\ \mathbf{done}\}(x=y) &amp;lt;/math&amp;gt; jest twierdzeniem tej teorii? &lt;br /&gt;
--[[Użytkownik:AndrzejSalwicki|AndrzejSalwicki]] ([[Dyskusja użytkownika:AndrzejSalwicki|dyskusja]]) 15:34, 30 maj 2018 (CEST) &lt;br /&gt;
* Czy teoria &amp;lt;math&amp;gt;Th_{2.5}&amp;lt;/math&amp;gt; jest zupełna? &lt;br /&gt;
  --[[Użytkownik:AndrzejSalwicki|AndrzejSalwicki]] ([[Dyskusja użytkownika:AndrzejSalwicki|dyskusja]]) 19:09, 31 maj 2018 (CEST)&lt;br /&gt;
* Według Harela, zob. Dynamic Logic,  każda formuła algorytmiczna prawdziwa w standardowym modelu arytmetyki powinna być twierdzeniem teorii &amp;lt;math&amp;gt;Th_{2.5}&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
* Czy teoria kontenerów (tj. słowników, dictionaries) bez aksjomatu algorytmicznego jest zupełna?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
[[Category:Logika Algorytmiczna}}]]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Logika_Algorytmiczna</id>
		<title>Logika Algorytmiczna</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Logika_Algorytmiczna"/>
				<updated>2026-02-25T12:34:11Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: /* Program logiki algorytmicznej */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;p style=&amp;quot;text-align: right;&amp;quot;&amp;gt;&amp;lt;small&amp;gt;''Felix qui potuit rerum cognoscere causas'' &amp;lt;/small&amp;gt; &amp;lt;/p&amp;gt;&lt;br /&gt;
=Próba zmian&lt;br /&gt;
= Wprowadzenie =&lt;br /&gt;
Zmiana kontrolna Środa 21 maja 2025 g. 19:25&lt;br /&gt;
Logika algorytmiczna AL jest  ''rachunkiem logicznym''.  Nie jest to byle jaki system logiczny. Stworzony został przez nas  jako narzedzie pomocne i niezbędne w pracy nad oprogramowaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
Rachunek programów tj. logika algorytmiczna:&lt;br /&gt;
* uzupełnia język o programy,&lt;br /&gt;
* program jest wyrażeniem zbudowanym z programów atomowych - instrukcji przypisania przy pomocy kilku operatorów programotwócztch: while, if, złożenie,&lt;br /&gt;
* program może poprzedzać formułę i takie wyrażenie jest także formułą,&lt;br /&gt;
&lt;br /&gt;
Rachunek programów AL umożliwia:&lt;br /&gt;
# Wyrażenie własności programu przez odpowiednio napisaną formułę języka systemu AL [[Wyrażalność semantycznych własności programów]]&lt;br /&gt;
# Przeprowadzanie dowodów formuł wyrażających ważne semantyczne własności programów, [[Przykłady dowodów]]. &lt;br /&gt;
# Podanie aksjomatów dla wielu struktur danych.  Aksjomaty takie wykluczają struktury niechciane, czy wręcz struktury patologiczne.[[Aksjomaty struktur]]&lt;br /&gt;
# Specyfikację oprogramowania, [[SpecVer]]&lt;br /&gt;
# Weryfikację oprogramowania względem ustalonej specyfikacji.&lt;br /&gt;
# Aksjomatyczny opis semantyki danego języka programowania.[[Aksjomatyczna definicja języka programowania]]&lt;br /&gt;
# i wiele innych rzeczy.&lt;br /&gt;
[[Plik:4logiki.jpg|thumb|center |750px| Rys. 1  Cztery systemy logiczne ]]&lt;br /&gt;
Powyższy rysunek 1 ilustruje relacje zachodzące pomiędzy tymi czterema rachunkami logicznymi. Strzałki wskazują na zachodzenie następującej relacji &amp;lt;math&amp;gt;\mathcal{L}\rightarrow\mathcal{L}'&amp;lt;/math&amp;gt; pomiędzy dwoma rachunkami logicznymi &amp;lt;math&amp;gt;\mathcal{L}&amp;lt;/math&amp;gt; i &amp;lt;math&amp;gt;\mathcal{L}'&amp;lt;/math&amp;gt;: ''Każda tautologia'' &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; ''rachunku'' &amp;lt;math&amp;gt;\mathcal{L}&amp;lt;/math&amp;gt; ''staje się tautologią rachunku ''&amp;lt;math&amp;gt;\mathcal{L}&amp;lt;/math&amp;gt;' ''po zastąpieniu atomów formuły'' &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; ''przez formuły rachunku'' &amp;lt;math&amp;gt;\mathcal{L}&amp;lt;/math&amp;gt;. Nieco więcej informacji uzyskamy porównując zbiory wyrażeń poprawnie zbudowanych &amp;lt;math&amp;gt;\mathcal{WFF} &amp;lt;/math&amp;gt;.  &amp;lt;br /&amp;gt;&lt;br /&gt;
Języki tych rachunków logicznych różnią się. Każdy język jest parą &amp;lt;alfabet, zbiór wyrażen poprawnie zbudowanych&amp;gt;. Zwróćmy uwagę na to, że za każdym razem struktura zbioru wyrażeń poprawnie zbudowanych &amp;lt;math&amp;gt;\mathcal{WFF} &amp;lt;/math&amp;gt; (''ang''. well formed formulas) jest inna. &amp;lt;br /&amp;gt;&lt;br /&gt;
Oznaczenia przyjete na rysunku: &amp;lt;math&amp;gt;\mathcal{L}&amp;lt;/math&amp;gt; - język, &amp;lt;math&amp;gt;\mathcal{A}&amp;lt;/math&amp;gt; - alfabet, &amp;lt;math&amp;gt;\mathcal{T}&amp;lt;/math&amp;gt; - zbiór termów (wyrażeń arytmetycznych, obiektowych,...), &amp;lt;math&amp;gt;\mathcal{F}&amp;lt;/math&amp;gt; - zbiór formuł, &amp;lt;math&amp;gt;\mathcal{P}&amp;lt;/math&amp;gt; - zbiór programów.&lt;br /&gt;
[[Plik:AxiomPL.jpg|thumb|750px| Rys. 2  Aksjomaty rachunku zdań ]]&lt;br /&gt;
[[Plik:axiomsFOL-AL.jpg|thumb |750px|  Rys. 3  Aksjomaty rachunku predykatów(Ax12 i Ax13) i rachunku programów ]]&lt;br /&gt;
[[Plik:inferenceRules.jpg| thumb  |750px| Rys. 4 Reguły wnioskowania ]]&lt;br /&gt;
Zbiór formuł logiki algorytmicznej zawiera w sobie wszystkie formuły pierwszego rzędu i ponadto, jest zamknięty ze względu na poprzedzanie formuły programem. Jeśli &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; jest formułą i &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; jest programem to wyrazenie postaci &amp;lt;math&amp;gt;K\alpha&amp;lt;/math&amp;gt; jest formułą logiki algorytmicznej, krócej, formułą algorytmiczna.&amp;lt;br /&amp;gt;&lt;br /&gt;
Jak takiej formule &amp;lt;math&amp;gt;K\alpha&amp;lt;/math&amp;gt; przypisać wartość logiczną prawda lub fałsz?&lt;br /&gt;
[[Plik:Kalfa.jpg |thumb|left|300px|Rys. 5  Wyznaczanie wartośći formuły &amp;lt;math&amp;gt;K\alpha&amp;lt;/math&amp;gt; ]]&lt;br /&gt;
Rysunek 5 powinien wszystko wyjaśnić.Pozostaje jednak przypadek gdy obliczenie programu K nie daje wyniku, z powodu zapętlenia się programu lub innego błędu. Oczywiście nie możemy wtedy twierdzić, że ''dla danych v, obliczenie programu K kończy się pomyślnie i wyniki spełniają warunek &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;''. A więc w tym przypadku wartościa formuły &amp;lt;math&amp;gt;K\alpha&amp;lt;/math&amp;gt; jest fałsz.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
O logice algorytmicznej możemy też powiedzieć, że jest [[rachunek programów|''rachunkiem programów'']].   Język logiki algorytmicznej zawiera programy i formuły algorytmiczne. '''Ważne''' jest to, że ''każda semantyczna własność programów np. poprawność, równowazność, kończenie obliczeń lub przeciwnie zapętlanie, ... może być wyrażona przez odpowiednią formułę''. Pozwala to zamienić zadanie wykazania, że pewien program  &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; posiada pewną własnośc semantyczną &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; na zadanie udowodnić formułę &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; należąca do języka logiki algorytmicznej. &amp;lt;br /&amp;gt;'''Przykład''' &amp;lt;br /&amp;gt;&lt;br /&gt;
Własność: ''Dla każdych danych &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;, jeśli  program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; rozpoczyna obliczenia z danymi spełniającymi warunek &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; to jego obliczenie zakończy się (nie będzie zapętlenia, ani przerwania obliczeń) i jego wyniki spełniają warunek &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt;'', jest wyrażana formułą &amp;lt;math&amp;gt;\alpha \rightarrow K\beta&amp;lt;/math&amp;gt;. Nie musimy więc podejmować trudu testowania czy dla kazdych danych obliczenie programu K będzie skończone i ... &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Formuły tworzą algebrę z działaniami: konkatenacji, alternatywy, negacji i implikacji oraz z działaniami nieskończonymi tj. kwantyfikatorami, ponadto programy są modalnościami. Programy też tworzą algebrę: działaniami tej algebry są iteracja, rozgałęzienie i złożenie programów. Mamy więc do czynienia ze splotem dwu algebr. Możemy go nazwać rachunkiem programów.  Zadaniem logiki algorytmicznej jest poszukiwanie ''praw rachunku programów''. &lt;br /&gt;
&lt;br /&gt;
Celem jest zebranie praw i reguł wnioskowania, które umożliwią analizę algorytmów i wydawanie opinii o ich własnościach semantycznych, bez wykonywania obliczeń, na podstawie samego tekstu algorytmu i aksjomatów struktury danych w jakiej dany program ma byc interpretowany.&lt;br /&gt;
&lt;br /&gt;
'''Przykład'''&lt;br /&gt;
Rozpatrzmy prosty program&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;small&amp;gt;    (* Dane:  x&amp;gt;0  i  y&amp;gt;0  liczby naturalne *)&lt;br /&gt;
    '''Deklaracje:'''  typ(x, y, n, m, r, q, max)='''N''' &amp;amp;  typ(n_mniejsze)=Boolean &lt;br /&gt;
    &lt;br /&gt;
    n:=x; m:=y;&lt;br /&gt;
    '''while''' n ≠ m '''do'''&lt;br /&gt;
       '''''Oznaczenie''''' niech l=max(n,m)&lt;br /&gt;
       r:=0; &lt;br /&gt;
       '''while''' r ≠n '''and''' r ≠m '''do'''  r:=r+1  '''od'''; &lt;br /&gt;
       '''if''' r=n '''then''' n_miejsze:=true; max:=m '''else''' n_mniejsze:=false; max:=n '''fi'''; &lt;br /&gt;
       '''''Stwierdzenie''''' (n&amp;lt;m &amp;amp; m=max(n,m) lub m&amp;lt;n &amp;amp; n=max(n,m))&lt;br /&gt;
       q:=0; &lt;br /&gt;
       '''while''' r≠max  '''do'''  r:= r+1; q:=q+1  '''od'''; &lt;br /&gt;
       '''''Stwierdzenie''''' q = |m-n| &amp;amp; (1 ≤ q &amp;lt; max(n,m))&amp;amp; r=max(n,m)&lt;br /&gt;
       '''if''' n_mniejsze '''then''' m:=q '''else''' n := q '''fi''' &lt;br /&gt;
       '''''Stwierdzenie''''' max(n,m) &amp;lt;  l&lt;br /&gt;
   '''od''' ( wynik = n) &lt;br /&gt;
(* Wynik:  nwd(x,y)   *)&amp;lt;/small&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Co robi ten program? Czy to jest pytanie dobrze postawione?&lt;br /&gt;
Czy obliczenie tego programu jest skończone dla każdych danych &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; i &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt;?&lt;br /&gt;
Czym są te dane? Jakie znaczenie mają operacje - i + oraz stała 1? Jakie znaczenie ma predykat &amp;lt;?&lt;br /&gt;
&lt;br /&gt;
Wiele osób powie,że przecież to proste. Powyższy program oblicza największy wspólny dzielnik liczb naturalnych &amp;lt;math&amp;gt;xP&amp;lt;/math&amp;gt; i &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt;. No tak, ale skąd wiesz, że środowisko w którym wykonujesz ten program nie jest podejrzane? Na kolejnej stronie możesz zobaczyć klasę która implementuje operacje dodawania liczb naturalnych i relację równości w niestandardowy sposób. Powyższy program w otoczeniu tej klasy zachowuje się niestandardowo. Po pierwsze, obliczenia tego programu sa nieskończone dla pewnych danych. Powiesz mi, ta klasa nie spełnia aksjomatów liczb naturalnych? Otóż '''spełnia'''. Jakie więc aksjomaty należy wziąć pod uwagę i o co mamy pytać?   &lt;br /&gt;
&lt;br /&gt;
Zanim zaczniesz analizować działanie programu powinieneś zdać sobie sprawę z kilku rzeczy:&lt;br /&gt;
# Program zachowuje się różnie w różnych otoczeniach. Czym jest otoczenie? To zależy, może to być pierwotny typ danych np. integer w wielu językach programowania lub struktura danych opisana za pomocą pewnej klasy.&lt;br /&gt;
# Podczas analizy powinniśmy rozpatrywać program &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; w parze z jego otoczeniem &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;. Podczas analizy nie wystarczy nam nazwa otoczenia, ani sygnatura nazywana przez programistów interfejsem (ang, ''interface'').&lt;br /&gt;
# W procesie analizy musimy korzystać z własności otoczenia np. z przemienności i łączności dodawania.&lt;br /&gt;
# Musimy też sobie zadawać sprawę, że wielu podstawowych własności nie da się wyrazić formułami pierwszego rzędu.&lt;br /&gt;
# '''Własności algorytmiczne naszych programów wynikają z własności algorytmicznych otoczenia.'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zechciej przejść na stronę [[Euklides]] by poznać nasze argumenty.&lt;br /&gt;
&lt;br /&gt;
== Program logiki algorytmicznej ==&lt;br /&gt;
Zadaniem logiki algorytmicznej jest dostarczenie narzędzi do analizowania semantycznych własności programów takich jak: własność stopu, poprawność programu, etc.&lt;br /&gt;
W języku logiki algorytmicznej znajdujemy trzy zbiory: zbiór formuł, zbiór wyrażeń (zbiór termów) i zbiór programów (zbiór algorytmów).&lt;br /&gt;
'''Uwaga''' W języku logiki zdaniowej (rachunku zdań) rozważany jest jeden tylko zbiór wyrażeń poprawnie zbudowanych, jest to zbiór formuł (zdaniowych). Formuły stanowią najmniejszy zbiór napisów zawierający zbiór zmiennych zdaniowych i zamknięty ze względu na operatory logiczne.&lt;br /&gt;
W jeżyku logiki pierwszego rzędu zb→ór wyrażen poprawnie zbudowanych jest suma dwu rozłącznych zbiorów: zbioru termów(inaczej zbiór wyrażen nazwowych) i zbioru formuł. W rachunku programów (czyli logice algorytmicznej) w naturalny sposób pojaia się zbiór algorytmów. '''koniec uwagi''' &lt;br /&gt;
Znaczeniem programu &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; jest funkcja ze zbioru &amp;lt;math&amp;gt;W&amp;lt;/math&amp;gt; wartościowań zmiennych w ten sam zbiór. Zazwyczaj funkcję tę określa się przy pomocy pojęcia [[obliczenia programu]].&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{figure}[h]\begin{center}&lt;br /&gt;
  		\tikzstyle{stan}=[rectangle , text=blue]&lt;br /&gt;
  		\tikzstyle{is}=[-&amp;gt;,&amp;gt;=latex,rounded corners=4pt]&lt;br /&gt;
  		\begin{tikzpicture}[scale=0.38]&lt;br /&gt;
  			%\draw [gray, very thin] (-2,-2) grid [step=1cm] (28,50);&lt;br /&gt;
  			\draw (-2,5) -- (4,18) -- (27,18) -- (23,5) -- cycle[fill=green!25];&lt;br /&gt;
  			\node[stan] (T) at (4.44,14)  {$v:\frac{x\, y\, z}{k\,l\,p}$};&lt;br /&gt;
  			\node[stan] (U) at (24,14) {$\frac{true}{false}$};&lt;br /&gt;
  			\node[stan] (V) at (14,6.2) {$v^{\prime}:\frac{x\, y\, z}{n\,l\,p}$};&lt;br /&gt;
  			\draw[is] (T) to[bend left]node[midway,below]{ $\bigl(\alpha(x/\tau)\bigr)_{\color{red}{\mathfrak{A}}\color{black}{}}$ } (U) ; &lt;br /&gt;
  			\draw[is] (T) to[bend right]node[midway,above ]{$\bigl(\{x:=\tau\}\alpha\bigr)_{\color{red}{\mathfrak{A}}\color{black}}$} (U) ;&lt;br /&gt;
  			\draw[is] (V) -- (U)node[midway,right]{$ \alpha(x)_{\color{red}{\mathfrak{A}}\color{black}{\ }}$ }; &lt;br /&gt;
  			\draw[is] (T) -- (V)node[midway,left]{$\{x:=\tau \}_{\color{red}{\mathfrak{A}}\color{black}}$ }; &lt;br /&gt;
  			\draw (0,20) -- (4,24) -- (27,24) -- (23,20) -- cycle[fill=yellow!35];&lt;br /&gt;
  			&lt;br /&gt;
  			\node[stan] (T1) at (9,22)  {$\{x:=\tau\}\alpha $   };&lt;br /&gt;
  			\node[stan] (U1) at (19,22) {$\alpha(x/\tau) $ };&lt;br /&gt;
  			\node[stan] (V1) at (14,22) {$\Leftrightarrow$ };&lt;br /&gt;
  			&lt;br /&gt;
  			\draw [color=red, thick, -&amp;gt;] (9,22) -&amp;gt;   (13,12.4)node[midway,left,near start]{$\mathfrak{A}$} ; &lt;br /&gt;
  			\draw [color=red,  thick, -&amp;gt;] (19,22) -&amp;gt; (16,16.5)node[midway,left]{$\mathfrak{A}$} ;&lt;br /&gt;
  		\end{tikzpicture} &lt;br /&gt;
  		\caption{Aksjomat instrukcji przypisania \\&lt;br /&gt;
  			&amp;quot;\textit{warunek $\alpha(x)$ zachodzi po wykonaniu instrukcji $x\,:=\tau$ wttw, gdy przed wykonaniem tej instrukcji zachodzi warunek $\alpha(x/ \tau)$}&amp;quot;&lt;br /&gt;
  			jest tautologią\\&lt;br /&gt;
  			\begin{scriptsize}&lt;br /&gt;
  				na górnej płaszczyznie wydrukowaliśmy text  aksjomatu, \\&lt;br /&gt;
  				na dolnej płaszczyznie objaśniamy co się dzieje podczas obliczeń i wskazujemy znaczenie (tj. semantykę) aksjomatu, &lt;br /&gt;
  				Litera $\mathfrak{A}$ oznacza dowolny typ (na razie przyjmij, że może to być typ integer lub typ real). Czerwone strzałki łączą formułę   $\alpha(x/\tau) $ (odpowiednio \{x:=$\tau$\}$\alpha $) z funkcją $\alpha(x/\tau)_{\mathfrak{A}}$ (odpowiednio $\{x:=\tau \}(\alpha)_{\mathfrak{A}}$ ). &lt;br /&gt;
  				Stan pamięci $v'$ i dodatkowe strzałki ilustrują sposób obliczania  wartości formuły, $\{x:=\tau \}(\alpha)$, zauważ, wartość $v'(x)=n= \tau_{\mathfrak{A}}( v(x))$. &lt;br /&gt;
  		\end{scriptsize}}\label{rAx18}&lt;br /&gt;
  	\end{center}&lt;br /&gt;
  \end{figure} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Zastosowania ==&lt;br /&gt;
Stosując logikę algorytmiczną czyli rachunek programów potrafimy odpowiedziec twierdząco na nastepujące pytania:&lt;br /&gt;
# Czy można podać aksjomaty i reguły wnioskowania, które opiszą semantykę operacyjną języka programowania?&lt;br /&gt;
# Czy (i jakie) własności struktur danych (systemów algebraicznych) są wyrażalne w języku logiki algorytmicznej?&lt;br /&gt;
# Czy (i jakie) własności programów są wyrażalne formułami algorytmicznymi?&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ad 2. W matematyce rozważa się wiele własności ważnych struktur algebraicznych, których nie można wyrazić w języku pierwszego rzędu. Większość z nich może być wyrażona przy pomocy formuł algorytmicznych &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* bycie liczbą naturalną,&lt;br /&gt;
* aksjomat Archimedesa&lt;br /&gt;
* aksjomat ciał charakterystyki zero&lt;br /&gt;
* aksjomat grup torsyjnych&lt;br /&gt;
* aksjomat grup cyklicznych&lt;br /&gt;
i in.&amp;lt;br /&amp;gt;&lt;br /&gt;
Dla informatyków niezwykle ważny jest fakt, że niemal wszystkie napotykane w programach struktury danych mogą być scharakteryzowane przy pomocy formuł algorytmicznych&lt;br /&gt;
* s jest stosem (skończonym)&lt;br /&gt;
* q jest kolejką FIFO skończoną&lt;br /&gt;
* s jest drzewem binarnym&lt;br /&gt;
* d jest drzewem binarnych poszukiwań&lt;br /&gt;
* q jest kolejką priorytetową&lt;br /&gt;
* d jest strukturą słownika (ang. dictionary)&lt;br /&gt;
* k jest kopcem&lt;br /&gt;
itd.&lt;br /&gt;
== Inne logiki programów ==&lt;br /&gt;
Możesz się zapytać jak się ma rachunek programów (tj. logika algorytmiczna) do innych logik programów : np. rachunek Floyda, logika Hoare'a, rachunek najsłabszego warunku wstępnego Dijkstry, logiki dynamicznaj, etc.?&lt;br /&gt;
&lt;br /&gt;
[[calculus of Floyd|rachunek  Floyda]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[logic of Hoare|logika Hoare'a]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
calculus of weakest precondition of Dijkstra&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[dynamic logic]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Uwagi historyczne ==&lt;br /&gt;
Algorytmy pojawiły sie kilka tysięcy lat temu. W Babilonie, Egipcie i Grecji.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
W czasach nowożytnych studia nad algorytmami podjęli Goedel, Turing, Church, Markov, Kołmogorov i wielu innych. Szkoda, że Tarski nie rozszerzył swych badań nad semantyką na funkcje obliczalne. Szkoda, że studia funkcji obliczalnych skupiły się na samych funkcjach, zaniedbując aspekt językowy. Prawie nie zajmowano się językiem służcym do definiowania funkcji rekurencyjnych. Alonzo Curch był chyba wyjatkiem? D. Kleene był blisko - jego definicja operatora minimum ograniczonego to przeciez petla FOR, a operacja minimum efektywnego to pętla WHILE. Warto pamietac twierdzenie S. Kleene z r. 1942 o tym, że zbiór funkcji obliczalnych jesli jest zamknięty ze względu na superpozycję i minimum efektywne  ( i zawiera kilka funkcji poczatkowych) to definiowanie funkcji obliczalnych przez rekursję prostą może być zastąpione przez operację minimum efektywnego.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Po drugiej wojnie światowej gdy pojawiły się komputery (zwane wtedy maszynami matematycznymi), ich programy zapisywano w kodzie maszynowym lub (później) w assemblerze. Trudno było dostrzec struktury i prawidłowości. W maszynie von Neumanna wszystko jest ciągiem bitów - liczbą. Ale pamiętam odczyt Antoniego Mazurkiewicza (ok 1960 r.) i jego dowód poprawności algorytmu z jedną pętla. Algorytm miał obliczyć sumę liczb zapisanych w tablicy. Kod maszyny XYZ-1 był bardzo ubogi. Program wymagał pobrania instrukcji &amp;quot;''weź kolejną komórkę pamięci do Akumulatora''&amp;quot; do rejestru Akumulator, zwiększenia adresu i zapisaniu tak zmienionej instrukcji w pamięci rozkazów na swoim pierwotnym miejscu. Program był więc ciągiem słów binarnych - każde słowo można jednak interpretować dwoiście, jako liczbę lub jako instrukcję. Nie ma w tym żadnej widocznej struktury.&amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Prekursorzy logiki algorytmicznej&amp;lt;br /&amp;gt;&lt;br /&gt;
Janov - jego praca poprzedza zdaniową logikę dynamiczną. Przedmiotem analizy są schematy programów (zapisywane w bardzo specjalny sposób) i relacja równoważności schematów. Dzisiaj powiedzielibyśmy, że schemat programu jest grafem skończonym. Wierzchołkom grafu przyporządkowano albo zmienną programowa albo formułę zdaniowa. Praca Janova jest nie tylko trudno dostępna, ale przede wszystkim mało czytelna. W książce A.P. Ershova można znaleźć przystępną ekspozycję teorii Janova.&amp;lt;br /&amp;gt;&lt;br /&gt;
Engeler(1967) - zauważył, że własność stopu programu można wyrazić jako formułę logiki &amp;lt;math&amp;gt;L_{\omega1\,\omega} &amp;lt;/math&amp;gt;, a dokładniej jako nieskończoną alternatywę formuł otwartych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Warto też wspomnieć o pracach Glushkova dotyczących systemów algebr algorytmicznych i książkę Helmuta Thielego. &amp;lt;br /&amp;gt;&lt;br /&gt;
''Rasiowa'' - w książce ''Mathematics of metamathematics''(1963) str. 218 sformułowała podstawową własność instrukcji przypisania. Niech &amp;lt;math&amp;gt; s &amp;lt;/math&amp;gt; oznacza jakieś odwzorowanie &amp;lt;math&amp;gt; s\colon V \to T &amp;lt;/math&amp;gt; gdzie &amp;lt;math&amp;gt; V &amp;lt;/math&amp;gt; jest zbiorem zmiennych indywiduowych, a &amp;lt;math&amp;gt; T &amp;lt;/math&amp;gt; jest zbiorem termów. Odwzorowanie &amp;lt;math&amp;gt; s &amp;lt;/math&amp;gt; nazywa się podstawieniem. Jeśli &amp;lt;math&amp;gt; \tau &amp;lt;/math&amp;gt; oznacza jakiś term to &amp;lt;math&amp;gt; s\,\tau &amp;lt;/math&amp;gt; oznacza wyrażenie powstające z termu &amp;lt;math&amp;gt; \tau &amp;lt;/math&amp;gt; przez równoczesne zastąpienie wszystkich wystąpień zmiennych indywiduowych &amp;lt;math&amp;gt; \tau &amp;lt;/math&amp;gt; przez odpowiednie wartości odwzorowania &amp;lt;math&amp;gt; s &amp;lt;/math&amp;gt;. Oznaczmy term &amp;lt;math&amp;gt; \tau &amp;lt;/math&amp;gt; przez &amp;lt;math&amp;gt; \tau(x_1,\dots,x_n)&amp;lt;/math&amp;gt; podkreślając, że zmienne &amp;lt;math&amp;gt; x_1,\dots,x_n &amp;lt;/math&amp;gt; to są wszystkie zmienne występujące w termie &amp;lt;math&amp;gt; \tau &amp;lt;/math&amp;gt;. Wynik równoczesnego podstawienia za zmienne &amp;lt;math&amp;gt; x_1,\dots,x_n &amp;lt;/math&amp;gt; występujące w termie &amp;lt;math&amp;gt; \tau &amp;lt;/math&amp;gt;, termów &amp;lt;math&amp;gt; s(x_1),\dots,s(x_n) &amp;lt;/math&amp;gt;   &amp;lt;br /&amp;gt; oznaczmy &amp;lt;math&amp;gt; s\tau &amp;lt;/math&amp;gt;. Mamy więc równość &amp;lt;math&amp;gt; s\tau(x_1,\dots,x_n)= \tau(s(x_1),\dots,s(x_n)) &amp;lt;/math&amp;gt;. Można bez trudu udowodnić, że wynik jest tez termem. &lt;br /&gt;
Przypomnijmy teraz ten element definicji pojęcia spełniania (Tarski): dla ustalonej interpretacji symboli funkcyjnych &amp;lt;math&amp;gt; R &amp;lt;/math&amp;gt; i ustalonego wartościowania zmiennych &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt;, term &amp;lt;math&amp;gt; \tau  &amp;lt;/math&amp;gt; wyznacza funkcję ze zbioru wartościowań w zbiór wartoścowań.&lt;br /&gt;
Teraz możemy sformułować &amp;lt;br /&amp;gt;&lt;br /&gt;
Niech &amp;lt;math&amp;gt; R &amp;lt;/math&amp;gt; będzie dowolnie ustaloną interpretacją symboli funkcyjnych, niech &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; będzie dowolnym wartościowaniem zmiennych. Dla każdego podstawienia &amp;lt;math&amp;gt; s &amp;lt;/math&amp;gt; i każdego termu &amp;lt;math&amp;gt; \tau &amp;lt;/math&amp;gt; zachodzi równość &lt;br /&gt;
&amp;lt;math&amp;gt; s\tau_R(v)=\tau_R(s_R(v))  &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Zauważmy, że w czasie pisania ksiązki ''Mathematics of metamathematics''(przed r. 1963) ani Rasiowa ani Sikorski nie mieli pojęcia o programowaniu. A jednak, gdy zapisać podstawienie &amp;lt;math&amp;gt; s &amp;lt;/math&amp;gt; w trochę innej formie &amp;lt;math&amp;gt; \{x_1:=\tau_1 \&amp;amp; \dots \&amp;amp; x_n:=\tau_n \} &amp;lt;/math&amp;gt; i zrozumieć, że wartościowanie zmiennych to to samo co stan pamięci, a interpretacja &amp;lt;math&amp;gt; R &amp;lt;/math&amp;gt; to po prostu jednostka arytmetyczna komputera, to wszystko trafia na swoje miejsce.&lt;br /&gt;
&lt;br /&gt;
== Bibliografia ==&lt;br /&gt;
Książki&lt;br /&gt;
&lt;br /&gt;
# [AlgoLog] [[Media:Algorithmic_Logic.pdf | {{cytuj książkę |odn=tak| nazwisko = Mirkowska| imię = Grażyna | nazwisko2 = Salwicki | imię2 = Andrzej | tytuł = Algorithmic Logic | wydawca = PWN | miejsce = Warszawa | data = 1987 | strony = 345}}]] &lt;br /&gt;
# [LogProg1] [[Media:LogikaAlgorytmiczna_1z2.pdf | {{cytuj książkę | odn=tak |imię2=Andrzej | nazwisko2=Salwicki | imię=Grażyna | nazwisko=Mirkowska| tytuł=Logika Algorytmiczna dla Programistów|wydawca=WNT | miejsce=Warszawa| data=1992|strony=294 }}]] cz.1&amp;lt;br /&amp;gt;&lt;br /&gt;
[[book Algorithmic Logic  ]]&lt;br /&gt;
# [LogProg2] [[Media:LogikaAlgorytmiczna_2z2.pdf | {{cytuj książkę | odn=tak |imię2=Andrzej | nazwisko2=Salwicki | imię=Grażyna | nazwisko=Mirkowska| tytuł=Logika Algorytmiczna dla Programistów|wydawca=WNT | miejsce=Warszawa| data=1992|strony=294 }}]] cz.2&lt;br /&gt;
#[AL4software] [[Media:AlgoLogic.pdf| {{cytuj książkę | odn=tak |imię2=Andrzej | nazwisko2=Salwicki | imię=Grażyna | nazwisko=Mirkowska| tytuł=Algorithmic Logic for Software Construction and Verification|wydawca=Dąbrowa Research | miejsce=Dąbrowa Leśna| data=2014|strony=154 }}]]&lt;br /&gt;
# [CentrumBanachAL] [[ Media:bcp211.pdf  |{{Cytuj książkę |odn=tak| nazwisko = Banachowski | imię = Lech | tytuł = An introduction to Algorithmic Logic - Metamathematical Investigations of Theory of Programs | wydawca = PWN | miejsce = Warszawa | data = 1977 | seria = Banach Center Publications | strony = 7-99 | isbn = 123 | nazwisko2 = Kreczmar | imię2 = Antoni | nazwisko3 = Mirkowska | imię3 = Grażyna | nazwisko4 = Rasiowa | imię4 = Helena | nazwisko5 = Salwicki | imię5 = Andrzej | tom = 2 | tytuł tomu = Banach Center Publications  }}]]&lt;br /&gt;
# [HRAL]  {{Cytuj książkę | odn=tak | nazwisko= Rasiowa | imię=Helena | tytuł= Algorithmic Logic - Notes from Seminar  in Simon Fraser University | data=1975 | seria= Reports of Institute of Computer Science PAS | tom=281 | miejsce=Warsaw }}&lt;br /&gt;
# [AB]  {{Cytuj książkę | odn=tak | nazwisko= Biela | imię=Andrzej | tytuł= Algorithmic structural completeness and a retrieval system for proving theorems in algorithmic theories  | data=2000 | wydawca=Wydawnictwo Uniwersytetu Śląskiego | tom=1901 | miejsce=Katowice | strony=122 | url=http://lem12.uksw.edu.pl/images/4/40/A-Biela.pdf }}&lt;br /&gt;
Artykuły (wybór)&lt;br /&gt;
# [GMP] [[Media:GMP1970.pdf | {{cytuj pismo | odn=tak | nazwisko = Góraj | imię = Anna | nazwisko2= Mirkowska | imię2 = Grazyna | nazwisko3 = Paluszkiewicz | imię3 = Anna| tytuł = On the notion of description of program | czasopismo = Bull. Acad. Polon. Sci. Ser. Math. Astr. Phys.| rok= 1970 |strony = 499 - 505 }}]]   &lt;br /&gt;
# [GM1971] {{cytuj pismo | odn=tak |nazwisko= Mirkowska | imię= Grażyna | tytuł = On Formalized Systems of Algorithmic Logic | czasopismo= Bull. Polish Academy Sciences, Ser. Math. Phys. |rok =1971 |tom = 19 | strony=421-428 |url=http://lem12.uksw.edu.pl/images/6/6f/On_Formalized-Mirk.pdf}}  &lt;br /&gt;
# [GM1] [[Media:MirkowskaI-1-17.pdf| {{cytuj pismo | odn=tak | nazwisko= Mirkowska | imię = Grazyna |  tytuł = Algorithmic logic and its applications in the theory of programs I | czasopismo = Fundamenta Informaticae| rok= 1977 |strony = 1-17 }} ]]&lt;br /&gt;
# [GM2] [[Media:Mirkowska-II-147-165.pdf| {{cytuj pismo | odn=tak | nazwisko= Mirkowska | imię = Grazyna |  tytuł = Algorithmic logic and its applications in the theory of programs II | czasopismo = Fundamenta Informaticae| rok= 1977 |strony = 147-165 }} ]]&lt;br /&gt;
# [AS1] [[Media:FormalizedAlgorithmicLanguages.pdf | {{cytuj pismo | odn=tak | nazwisko= Salwicki | imię = Andrzej |  tytuł = Formalized Algorithmic Languages | czasopismo = Bull. Acad. Polon. Sci. Ser. Math. Astr. Phys.| rok= 1970 |tom=18 |strony = 227-232 }} ]]&lt;br /&gt;
# [AS3] [[Media:CalculuswIterationQuantifiers.pdf | {{cytuj pismo | odn=tak | nazwisko= Salwicki | imię = Andrzej |  tytuł = On the predicate calculi with iteration quantifiers | czasopismo = Bull. Acad. Polon. Sci. Ser. Math. Astr. Phys.| rok= 1970 |tom=18 |strony = 279-285 }} ]]&lt;br /&gt;
# [LB1] [[Media:BanI-93-119.pdf| {{cytuj pismo | odn=tak | nazwisko= Banachowski | imię = Lech |  tytuł = Investigations of Properties of Programs by means of Extended Algorithmic Logic I | czasopismo = Fundamenta Informaticae| rok= 1977 |strony = 93-119 }} ]]&lt;br /&gt;
# [LB2] [[Media:Banachowski-II-167-193.pdf| {{cytuj pismo | odn=tak | nazwisko= Banachowski | imię = Lech |  tytuł = Investigations of Properties of Programs by means of Extended Algorithmic Logic II | czasopismo = Fundamenta Informaticae| rok= 1977 |strony = 167-193 }} ]]&lt;br /&gt;
# [LB3] [[Media:BanachowskiDataStruct.pdf| {{cytuj pismo | odn=tak | nazwisko= Banachowski | imię = Lech |  tytuł = An Axiomatic Approach to the Theory of Data Structures | czasopismo = Bull. Acad. Polon. Sci. Ser. Math. Astr. Phys. | rok= 1975 |strony = 315-323 }} ]]&lt;br /&gt;
# [AK1] [[Media:Kreczmar-Program-Fields.pdf| {{Cytuj pismo |odn=a | imię=Antoni | nazwisko=Kreczmar |tytuł=Programmability in Fields |czasopismo=Fundamenta Informaticae |strony=195-230 |rok=1977}}]]&lt;br /&gt;
# [AK2] [[Media:Kreczmar-Efficiency-problems.pdf| {{Cytuj pismo |odn=b | imię=Antoni | nazwisko=Kreczmar |tytuł=Effectivity problems of Algorithmic Logic |czasopismo=Fundamenta Informaticae |strony=19-32 |rok=1977}}]]&lt;br /&gt;
# [MSS2009] [[Media:Verifying-a-class.pdf  |{{cytuj pismo| odn=tak| nazwisko=Mirkowska| imię=Grażyna| nazwisko2=Salwicki| imię2=Andrzej| nazwisko3=Świda| imię3=Oskar| tytuł=Verifying a Class: combining Testing and Proving|czasopismo=Fundamenta Informaticae| strony= 305-324 |rok= 2009 }}]]&lt;br /&gt;
# [AS2017] [[Media:On-Euclids-algorithm-2018.pdf | {{Cytuj pismo| odn=nie| nazwisko=Salwicki| imię=Andrzej| tytuł=A new proof of Euclid's algorithm | czasopismo= }}]]&lt;br /&gt;
# [WD1] [[ Media:WDnonprog.pdf |  {{Cytuj pismo | odn=nie| nazwisko= Dańko | imię=Wiktor | tytuł=Nonprogrammable function defined by a procedure }} ]]&lt;br /&gt;
&lt;br /&gt;
==Protokół rozbieżności==&lt;br /&gt;
Następujący tekst został złożony do druku&lt;br /&gt;
[[Media:On-Euclids-algorithm-2018.pdf | {{Cytuj pismo| odn=nie| nazwisko=Salwicki| imię=Andrzej| tytuł=A new proof of Euclid's algorithm | czasopismo= }}]] &amp;lt;br /&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
Pierwsza recenzja była rzeczowa, pomocna i jej sugestie zostały, z podziękowaniem, wykorzystane http://lem12.uksw.edu.pl/images/8/8c/1pierwszaRec.pdf. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Drugi recenzent przedstawił następującą opinię http://lem12.uksw.edu.pl/images/0/0b/Second-report-08.pdf. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Na to autor odpowiedział prosząc o referencje do zapowiadanych twierdzeń lub o przedstawienie dowodu. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Oto protokół rozbieżności:&lt;br /&gt;
http://lem12.uksw.edu.pl/images/9/9a/DiscrepancyReport.pdf&lt;br /&gt;
&lt;br /&gt;
==Pytania otwarte==&lt;br /&gt;
* Rozpatrzmy teorię algorytmiczną &amp;lt;math&amp;gt;Th_{2.5} = \langle L,C,A \rangle &amp;lt;/math&amp;gt; gdzie&lt;br /&gt;
&amp;lt;math&amp;gt;L&amp;lt;/math&amp;gt; - język, jest językiem struktury liczb naturalnych, algorytmicznym, &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; - operacja konskwencji jest wyznaczona przez zbiór aksjomatów i reguł wnioskowania logiki algorytmicznej (rachunku programów),&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; - zbiór aksjomatów, jest zbiorem wszystkich formuł pierwszego rzędu prawdziwych w standardowym modelu liczb naturalnych.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Czy  formuła &amp;lt;math&amp;gt;\color{blue}\forall x\, \{y:=0;\, \mathbf{while}\ x\neq y\ \mathbf{do}\ y:=y+1\ \mathbf{done}\}(x=y) &amp;lt;/math&amp;gt; jest twierdzeniem tej teorii? &lt;br /&gt;
--[[Użytkownik:AndrzejSalwicki|AndrzejSalwicki]] ([[Dyskusja użytkownika:AndrzejSalwicki|dyskusja]]) 15:34, 30 maj 2018 (CEST) &lt;br /&gt;
* Czy teoria &amp;lt;math&amp;gt;Th_{2.5}&amp;lt;/math&amp;gt; jest zupełna? &lt;br /&gt;
  --[[Użytkownik:AndrzejSalwicki|AndrzejSalwicki]] ([[Dyskusja użytkownika:AndrzejSalwicki|dyskusja]]) 19:09, 31 maj 2018 (CEST)&lt;br /&gt;
* Według Harela, zob. Dynamic Logic,  każda formuła algorytmiczna prawdziwa w standardowym modelu arytmetyki powinna być twierdzeniem teorii &amp;lt;math&amp;gt;Th_{2.5}&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
* Czy teoria kontenerów (tj. słowników, dictionaries) bez aksjomatu algorytmicznego jest zupełna?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
[[Category:Logika Algorytmiczna}}]]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Plik:Notatka15maja.pdf</id>
		<title>Plik:Notatka15maja.pdf</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Plik:Notatka15maja.pdf"/>
				<updated>2026-02-23T08:42:05Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Plik:Argumenty_11Gru2025.pdf</id>
		<title>Plik:Argumenty 11Gru2025.pdf</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Plik:Argumenty_11Gru2025.pdf"/>
				<updated>2026-02-19T09:29:26Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Plik:CollatzConjecturebecomesTheorem2026Jan29.pdf</id>
		<title>Plik:CollatzConjecturebecomesTheorem2026Jan29.pdf</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Plik:CollatzConjecturebecomesTheorem2026Jan29.pdf"/>
				<updated>2026-02-18T17:33:34Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2026-02-05T20:25:45Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: /* Our observations from 2004 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że dowód  hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture&lt;br /&gt;
''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' &lt;br /&gt;
is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic.&amp;lt;br /&amp;gt; &lt;br /&gt;
 end of Abstract 01/10/2025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Have a look==&lt;br /&gt;
&amp;lt;math&amp;gt;			\begin{figure}	&lt;br /&gt;
						\resizebox{\textwidth}{!}{ &lt;br /&gt;
							{\footnotesize  \begin{tikzcd}[ampersand replacement=\&amp;amp;,scale =0.15, column sep=normal,row sep=0.7cm,arrows=&amp;lt;-]&lt;br /&gt;
									%	 	 [arrows=&amp;lt;-]&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {		$ \frac{W_{41}}{&amp;gt;51} $};    \&amp;amp; \color{red}27  \&amp;amp;\cdots \\	\&amp;amp;  	\dots           \\&lt;br /&gt;
									%  		\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_{40}}{26} $};    &amp;amp;   &amp;amp;\cdots \\		\dots &amp;amp; \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_9}{26} $};    \&amp;amp; 121 \&amp;amp; 89  \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_8}{26} $};    \&amp;amp; 33 \&amp;amp; 91    \&amp;amp; 67 \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_7}{26} $};    \&amp;amp; 25 \&amp;amp; 49 \&amp;amp;\color{red}51    \&amp;amp; 101 \&amp;amp;197 \&amp;amp;205\&amp;amp;\cdots \\&lt;br /&gt;
									%								\dots \\	&lt;br /&gt;
									\node[circle,fill=brown!15,align=center,text=black]  {$ \frac{W_6}{24} $}; \&amp;amp; \color{red}9\&amp;amp; 19  \&amp;amp;37 \&amp;amp; 77  \&amp;amp;325   \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_5}{8} $}; \&amp;amp; 7\arrow[u]\arrow[urr] \&amp;amp;\color{red}15   \&amp;amp;29\arrow[ul]\arrow[ur] \&amp;amp; 61\arrow[ur]    \&amp;amp; \cdots \\		&lt;br /&gt;
									\node[circle,fill=blue!30,align=center,text=black]  {$ \frac{W_4}{6} $}; \&amp;amp; 11\arrow[u]\arrow[urr] \&amp;amp; 23\arrow[u]\arrow[urr]  \&amp;amp;\color{red}45 \&amp;amp;\color{red}93  \&amp;amp; 181  \&amp;amp; 373 \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=yellow!30,align=center,text=black]  {$ \frac{W_3}{6} $}; \&amp;amp;17\arrow[urr] \arrow[u]\arrow[urrrr] \&amp;amp; 35\arrow[u] \arrow[urr] \arrow[urrrr] \&amp;amp;  \color{red}69  \&amp;amp;  \color{red}75  \&amp;amp;  \color{red}141\&amp;amp; &lt;br /&gt;
									151  \&amp;amp;277 \&amp;amp; 301 \&amp;amp;\cdots \\&lt;br /&gt;
									\node[circle,fill=gray!30,align=center,text=black]  {$ \frac{W_2}{6} $ }; \&amp;amp;\color{red}3 \&amp;amp; 13\arrow[ul]\arrow[ur]\arrow[urrrrr]\&amp;amp; 53\arrow[ul] \arrow[urr]\&amp;amp; 113\arrow[u] \arrow[urrrr]\&amp;amp; \color{red}213 \&amp;amp; 227\arrow[u] \&amp;amp; \color{red}453  \&amp;amp; 853 \&amp;amp;\color{red}909 \&amp;amp; \cdots 	 \\&lt;br /&gt;
									\node  [circle,fill=red!30,align=center,text=black]  {$ \frac{W_1}{2} $ }; \&amp;amp; 5\arrow[u]\arrow[ur]\arrow[urr]\arrow[urrrr]\&amp;amp;\color{red}21 \&amp;amp; 85\arrow[ur]\arrow[urrrr,near end] \&amp;amp; 341\arrow[urr] \arrow[urrrrr] \&amp;amp; \color{red}1365   \&amp;amp; 5461 \&amp;amp;\cdots \\	   &lt;br /&gt;
									\node  [circle,fill=green,align=center,text=black]  {$ \frac{W_0}{2} $ }; \&amp;amp; \&amp;amp; \&amp;amp; 1\arrow[ull] \arrow[ul]\arrow[u]\arrow[ur] \arrow[urr] \arrow[urrr]    \\&lt;br /&gt;
									%	%\end{scriptsize}  &lt;br /&gt;
							\end{tikzcd}   }&lt;br /&gt;
						} &lt;br /&gt;
						\caption{F \textsc{Ilustracja} fragment grafu $\mathcal{F} $} \label{grafF}&lt;br /&gt;
					\end{figure}  &lt;br /&gt;
	&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2026-02-05T20:22:35Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: /* Have a look */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że dowód  hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture&lt;br /&gt;
''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' &lt;br /&gt;
is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic.&amp;lt;br /&amp;gt; &lt;br /&gt;
 end of Abstract 01/10/2025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Have a look==&amp;lt;math&amp;gt;			\begin{figure}	&lt;br /&gt;
						\resizebox{\textwidth}{!}{ &lt;br /&gt;
							{\footnotesize  \begin{tikzcd}[ampersand replacement=\&amp;amp;,scale =0.15, column sep=normal,row sep=0.7cm,arrows=&amp;lt;-]&lt;br /&gt;
									%	 	 [arrows=&amp;lt;-]&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {		$ \frac{W_{41}}{&amp;gt;51} $};    \&amp;amp; \color{red}27  \&amp;amp;\cdots \\	\&amp;amp;  	\dots           \\&lt;br /&gt;
									%  		\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_{40}}{26} $};    &amp;amp;   &amp;amp;\cdots \\		\dots &amp;amp; \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_9}{26} $};    \&amp;amp; 121 \&amp;amp; 89  \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_8}{26} $};    \&amp;amp; 33 \&amp;amp; 91    \&amp;amp; 67 \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_7}{26} $};    \&amp;amp; 25 \&amp;amp; 49 \&amp;amp;\color{red}51    \&amp;amp; 101 \&amp;amp;197 \&amp;amp;205\&amp;amp;\cdots \\&lt;br /&gt;
									%								\dots \\	&lt;br /&gt;
									\node[circle,fill=brown!15,align=center,text=black]  {$ \frac{W_6}{24} $}; \&amp;amp; \color{red}9\&amp;amp; 19  \&amp;amp;37 \&amp;amp; 77  \&amp;amp;325   \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_5}{8} $}; \&amp;amp; 7\arrow[u]\arrow[urr] \&amp;amp;\color{red}15   \&amp;amp;29\arrow[ul]\arrow[ur] \&amp;amp; 61\arrow[ur]    \&amp;amp; \cdots \\		&lt;br /&gt;
									\node[circle,fill=blue!30,align=center,text=black]  {$ \frac{W_4}{6} $}; \&amp;amp; 11\arrow[u]\arrow[urr] \&amp;amp; 23\arrow[u]\arrow[urr]  \&amp;amp;\color{red}45 \&amp;amp;\color{red}93  \&amp;amp; 181  \&amp;amp; 373 \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=yellow!30,align=center,text=black]  {$ \frac{W_3}{6} $}; \&amp;amp;17\arrow[urr] \arrow[u]\arrow[urrrr] \&amp;amp; 35\arrow[u] \arrow[urr] \arrow[urrrr] \&amp;amp;  \color{red}69  \&amp;amp;  \color{red}75  \&amp;amp;  \color{red}141\&amp;amp; &lt;br /&gt;
									151  \&amp;amp;277 \&amp;amp; 301 \&amp;amp;\cdots \\&lt;br /&gt;
									\node[circle,fill=gray!30,align=center,text=black]  {$ \frac{W_2}{6} $ }; \&amp;amp;\color{red}3 \&amp;amp; 13\arrow[ul]\arrow[ur]\arrow[urrrrr]\&amp;amp; 53\arrow[ul] \arrow[urr]\&amp;amp; 113\arrow[u] \arrow[urrrr]\&amp;amp; \color{red}213 \&amp;amp; 227\arrow[u] \&amp;amp; \color{red}453  \&amp;amp; 853 \&amp;amp;\color{red}909 \&amp;amp; \cdots 	 \\&lt;br /&gt;
									\node  [circle,fill=red!30,align=center,text=black]  {$ \frac{W_1}{2} $ }; \&amp;amp; 5\arrow[u]\arrow[ur]\arrow[urr]\arrow[urrrr]\&amp;amp;\color{red}21 \&amp;amp; 85\arrow[ur]\arrow[urrrr,near end] \&amp;amp; 341\arrow[urr] \arrow[urrrrr] \&amp;amp; \color{red}1365   \&amp;amp; 5461 \&amp;amp;\cdots \\	   &lt;br /&gt;
									\node  [circle,fill=green,align=center,text=black]  {$ \frac{W_0}{2} $ }; \&amp;amp; \&amp;amp; \&amp;amp; 1\arrow[ull] \arrow[ul]\arrow[u]\arrow[ur] \arrow[urr] \arrow[urrr]    \\&lt;br /&gt;
									%	%\end{scriptsize}  &lt;br /&gt;
							\end{tikzcd}   }&lt;br /&gt;
						} &lt;br /&gt;
						\caption{F \textsc{Ilustracja} fragment grafu $\mathcal{F} $} \label{grafF}&lt;br /&gt;
					\end{figure}  &lt;br /&gt;
	&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2026-02-05T20:20:50Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: /* Have a look */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że dowód  hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture&lt;br /&gt;
''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' &lt;br /&gt;
is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic.&amp;lt;br /&amp;gt; &lt;br /&gt;
 end of Abstract 01/10/2025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Have a look==&lt;br /&gt;
	&amp;lt;math&amp;gt;			\begin{figure}	&lt;br /&gt;
						\resizebox{\textwidth}{!}{ &lt;br /&gt;
							{\footnotesize  \begin{tikzcd}[ampersand replacement=\&amp;amp;,scale =0.15, column sep=normal,row sep=0.7cm,arrows=&amp;lt;-]&lt;br /&gt;
									%	 	 [arrows=&amp;lt;-]&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {		$ \frac{W_{41}}{&amp;gt;51} $};    \&amp;amp; \color{red}27  \&amp;amp;\cdots \\	\&amp;amp;  	\dots           \\&lt;br /&gt;
									%  		\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_{40}}{26} $};    &amp;amp;   &amp;amp;\cdots \\		\dots &amp;amp; \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_9}{26} $};    \&amp;amp; 121 \&amp;amp; 89  \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_8}{26} $};    \&amp;amp; 33 \&amp;amp; 91    \&amp;amp; 67 \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_7}{26} $};    \&amp;amp; 25 \&amp;amp; 49 \&amp;amp;\color{red}51    \&amp;amp; 101 \&amp;amp;197 \&amp;amp;205\&amp;amp;\cdots \\&lt;br /&gt;
									%								\dots \\	&lt;br /&gt;
									\node[circle,fill=brown!15,align=center,text=black]  {$ \frac{W_6}{24} $}; \&amp;amp; \color{red}9\&amp;amp; 19  \&amp;amp;37 \&amp;amp; 77  \&amp;amp;325   \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_5}{8} $}; \&amp;amp; 7\arrow[u]\arrow[urr] \&amp;amp;\color{red}15   \&amp;amp;29\arrow[ul]\arrow[ur] \&amp;amp; 61\arrow[ur]    \&amp;amp; \cdots \\		&lt;br /&gt;
									\node[circle,fill=blue!30,align=center,text=black]  {$ \frac{W_4}{6} $}; \&amp;amp; 11\arrow[u]\arrow[urr] \&amp;amp; 23\arrow[u]\arrow[urr]  \&amp;amp;\color{red}45 \&amp;amp;\color{red}93  \&amp;amp; 181  \&amp;amp; 373 \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=yellow!30,align=center,text=black]  {$ \frac{W_3}{6} $}; \&amp;amp;17\arrow[urr] \arrow[u]\arrow[urrrr] \&amp;amp; 35\arrow[u] \arrow[urr] \arrow[urrrr] \&amp;amp;  \color{red}69  \&amp;amp;  \color{red}75  \&amp;amp;  \color{red}141\&amp;amp; &lt;br /&gt;
									151  \&amp;amp;277 \&amp;amp; 301 \&amp;amp;\cdots \\&lt;br /&gt;
									\node[circle,fill=gray!30,align=center,text=black]  {$ \frac{W_2}{6} $ }; \&amp;amp;\color{red}3 \&amp;amp; 13\arrow[ul]\arrow[ur]\arrow[urrrrr]\&amp;amp; 53\arrow[ul] \arrow[urr]\&amp;amp; 113\arrow[u] \arrow[urrrr]\&amp;amp; \color{red}213 \&amp;amp; 227\arrow[u] \&amp;amp; \color{red}453  \&amp;amp; 853 \&amp;amp;\color{red}909 \&amp;amp; \cdots 	 \\&lt;br /&gt;
									\node  [circle,fill=red!30,align=center,text=black]  {$ \frac{W_1}{2} $ }; \&amp;amp; 5\arrow[u]\arrow[ur]\arrow[urr]\arrow[urrrr]\&amp;amp;\color{red}21 \&amp;amp; 85\arrow[ur]\arrow[urrrr,near end] \&amp;amp; 341\arrow[urr] \arrow[urrrrr] \&amp;amp; \color{red}1365   \&amp;amp; 5461 \&amp;amp;\cdots \\	   &lt;br /&gt;
									\node  [circle,fill=green,align=center,text=black]  {$ \frac{W_0}{2} $ }; \&amp;amp; \&amp;amp; \&amp;amp; 1\arrow[ull] \arrow[ul]\arrow[u]\arrow[ur] \arrow[urr] \arrow[urrr]    \\&lt;br /&gt;
									%	%\end{scriptsize}  &lt;br /&gt;
							\end{tikzcd}   }&lt;br /&gt;
						} &lt;br /&gt;
						\caption{F \textsc{Ilustracja} fragment grafu $\mathcal{F} $} \label{grafF}&lt;br /&gt;
					\end{figure}  &lt;br /&gt;
	&amp;lt;/math&amp;gt;	&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2026-02-05T20:19:15Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: /* Correct formulation of the Collatz theorem */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że dowód  hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture&lt;br /&gt;
''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' &lt;br /&gt;
is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic.&amp;lt;br /&amp;gt; &lt;br /&gt;
 end of Abstract 01/10/2025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Have a look==&lt;br /&gt;
	&amp;lt;math&amp;gt;			\begin{figure}	&lt;br /&gt;
						\resizebox{\textwidth}{!}{ &lt;br /&gt;
							{\footnotesize  \begin{tikzcd}[ampersand replacement=\&amp;amp;,scale =0.15, column sep=normal,row sep=0.7cm,arrows=&amp;lt;-]&lt;br /&gt;
									%	 	 [arrows=&amp;lt;-]&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {		$ \frac{W_{41}}{&amp;gt;51} $};    \&amp;amp; \color{red}27  \&amp;amp;\cdots \\	\&amp;amp;  	\dots           \\&lt;br /&gt;
									%  		\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_{40}}{26} $};    &amp;amp;   &amp;amp;\cdots \\		\dots &amp;amp; \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_9}{26} $};    \&amp;amp; 121 \&amp;amp; 89  \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_8}{26} $};    \&amp;amp; 33 \&amp;amp; 91    \&amp;amp; 67 \&amp;amp;\cdots \\	&lt;br /&gt;
									%	\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_7}{26} $};    \&amp;amp; 25 \&amp;amp; 49 \&amp;amp;\color{red}51    \&amp;amp; 101 \&amp;amp;197 \&amp;amp;205\&amp;amp;\cdots \\&lt;br /&gt;
									%								\dots \\	&lt;br /&gt;
									\node[circle,fill=brown!15,align=center,text=black]  {$ \frac{W_6}{24} $}; \&amp;amp; \color{red}9\&amp;amp; 19  \&amp;amp;37 \&amp;amp; 77  \&amp;amp;325   \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=red!15,align=center,text=black]  {$ \frac{W_5}{8} $}; \&amp;amp; 7\arrow[u]\arrow[urr] \&amp;amp;\color{red}15   \&amp;amp;29\arrow[ul]\arrow[ur] \&amp;amp; 61\arrow[ur]    \&amp;amp; \cdots \\		&lt;br /&gt;
									\node[circle,fill=blue!30,align=center,text=black]  {$ \frac{W_4}{6} $}; \&amp;amp; 11\arrow[u]\arrow[urr] \&amp;amp; 23\arrow[u]\arrow[urr]  \&amp;amp;\color{red}45 \&amp;amp;\color{red}93  \&amp;amp; 181  \&amp;amp; 373 \&amp;amp; \cdots \\	&lt;br /&gt;
									\node[circle,fill=yellow!30,align=center,text=black]  {$ \frac{W_3}{6} $}; \&amp;amp;17\arrow[urr] \arrow[u]\arrow[urrrr] \&amp;amp; 35\arrow[u] \arrow[urr] \arrow[urrrr] \&amp;amp;  \color{red}69  \&amp;amp;  \color{red}75  \&amp;amp;  \color{red}141\&amp;amp; &lt;br /&gt;
									151  \&amp;amp;277 \&amp;amp; 301 \&amp;amp;\cdots \\&lt;br /&gt;
									\node[circle,fill=gray!30,align=center,text=black]  {$ \frac{W_2}{6} $ }; \&amp;amp;\color{red}3 \&amp;amp; 13\arrow[ul]\arrow[ur]\arrow[urrrrr]\&amp;amp; 53\arrow[ul] \arrow[urr]\&amp;amp; 113\arrow[u] \arrow[urrrr]\&amp;amp; \color{red}213 \&amp;amp; 227\arrow[u] \&amp;amp; \color{red}453  \&amp;amp; 853 \&amp;amp;\color{red}909 \&amp;amp; \cdots 	 \\&lt;br /&gt;
									\node  [circle,fill=red!30,align=center,text=black]  {$ \frac{W_1}{2} $ }; \&amp;amp; 5\arrow[u]\arrow[ur]\arrow[urr]\arrow[urrrr]\&amp;amp;\color{red}21 \&amp;amp; 85\arrow[ur]\arrow[urrrr,near end] \&amp;amp; 341\arrow[urr] \arrow[urrrrr] \&amp;amp; \color{red}1365   \&amp;amp; 5461 \&amp;amp;\cdots \\	   &lt;br /&gt;
									\node  [circle,fill=green,align=center,text=black]  {$ \frac{W_0}{2} $ }; \&amp;amp; \&amp;amp; \&amp;amp; 1\arrow[ull] \arrow[ul]\arrow[u]\arrow[ur] \arrow[urr] \arrow[urrr]    \\&lt;br /&gt;
									%	%\end{scriptsize}  &lt;br /&gt;
							\end{tikzcd}   }&lt;br /&gt;
						} &lt;br /&gt;
						\caption{F \textsc{Ilustracja} fragment grafu $\mathcal{F} $} \label{grafF}&lt;br /&gt;
					\end{figure}  &lt;br /&gt;
	&amp;lt;math/&amp;gt;	&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Strona_g%C5%82%C3%B3wna</id>
		<title>Strona główna</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Strona_g%C5%82%C3%B3wna"/>
				<updated>2026-01-17T10:44:52Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;p style=&amp;quot;text-align: left;&amp;quot;&amp;gt;[[Plik:22px-English_language.svg.png]]&lt;br /&gt;
[[Main page]]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; [[Plik:ukrainian_language.png|22px]]&lt;br /&gt;
[[Головна сторінка]]  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &lt;br /&gt;
[[Page d'accueil]] &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;&amp;lt;span style=&amp;quot;color: Red&amp;quot;&amp;gt;These pages are under permanent  (re)construction.&amp;lt;/span&amp;gt;&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Nie lękajcie się rachunku programów, bo przed nim kolosalna przyszłość!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Lothar  [[Collatz]] (&amp;lt;small&amp;gt;w roku 1937&amp;lt;/small&amp;gt;) miał rację !&lt;br /&gt;
&lt;br /&gt;
-------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Na tych stronach przedstawiamy cztery projekty badawcze: Logika Algorytmiczna(od 1968), Loglan'82(od 1978), SpecVer(2007), Lem(2012).&lt;br /&gt;
Dwa pierwsze projekty przyniosły wiele wyników i będą stosowane przez wiele lat.&amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
{|  class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
|♥ Projekt badawczy  ''Logika Algorytmiczna'' zajmuje się odkrywaniem praw [[rachunek programów |rachunku programów]] i znajduje zastosowanie w weryfikacji programów tzn. w dowodzeniu prawdziwości takich własności programów jak [[poprawność]], niezapetlanie się i in. Język logiki algorytmicznej pozwala nie tylko wyrażać własności algorytmów(programów) ale także umożliwia aksjomatyzacje wielu struktur danych. Zarówno tych znanych i niezbędnych w algorytmice np. stosy, drzewa binarnych poszukiwań, kopce, etc. jak i wielu struktur badanych w matematyce. Można uznać, że matematyka zajmuje się badaniem, czy dana formuła &amp;lt;math&amp;gt; \alpha &amp;lt;/math&amp;gt; jest prawdziwa w danej strukturze &amp;lt;math&amp;gt; \mathbb{A} &amp;lt;/math&amp;gt;. Ale większośc struktur nie daje sie opisać przy pomocy aksjomatów zapisanych w języku pierwszego rzędu! Przyjęcie języka logiki algorytmicznej (krócej, języka algorytmicznego) umożliwia podanie ...&amp;lt;br /&amp;gt;&lt;br /&gt;
→ '''[[Logika Algorytmiczna]]''' &amp;lt;br /&amp;gt;&lt;br /&gt;
→ '''[[Media:UlotkaLogikaAlgorytmiczna.pdf| ulotka Logika Algorytmiczna]]'''&lt;br /&gt;
&lt;br /&gt;
|width=&amp;quot;50% &amp;quot; | ♥ Projekt badawczy '''Loglan'82'''  wniósł język programowania obiektowego i rozproszonego o tej samej nazwie. Opublikowanie języka i dystrybucja kompilatora poprzedzone zostały badaniami problemów badawczych. Wymieńmy dla przykładu:&amp;lt;br /&amp;gt;&lt;br /&gt;
• Rozwiązanie problemu bezpiecznej i efektywnej dealokacji niepotrzebnych obiektów.  &lt;br /&gt;
• Rozwiązanie problemu (statycznej) semantyki jaki pojawia się gdy moduły klas mogą być zagnieżdżane (klasy wewnętrzne) i rozszerzane (dziedziczenie). &lt;br /&gt;
• Oryginalny protokół współpracy obiektów procesów, jakie programista może alokować w sieci komputerowej (protokół ''alien call''). Język Loglan powstał wiele lat przed językami C++(1986) i Java(1995). Te dwa (oraz inne) języki programowania nie przyswoiły sobie rozwiązań znanych w Loglanie od ponad 30 lat.   Zapoznanie się z Loglanem może całkowicie zmienić Twój pogląd na inżynierię oprogramowania. Wykorzystując wiedzę i umiejętności oferowane przez Loglan możesz w znaczący sposób podnieść swoje kwalifikacje.   &amp;lt;br /&amp;gt;&lt;br /&gt;
→ '''[[Loglan'82]]'''&amp;lt;br /&amp;gt;&lt;br /&gt;
→ '''[[Media:UlotkaLoglan.pdf|ulotka Loglan'82]]'''&amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
|-&lt;br /&gt;
|♥ LEM jest nazwą nowego projektu badawczego.&lt;br /&gt;
Celem tego projektu jest zbadanie czy można stworzyć język programowania o pewnych określonych cechach (zob. [[specyfikacja LEM]]).&lt;br /&gt;
Język LEM ma oprzeć się na osiągnięciach projektu Loglan'82 i wykorzystać to co dobre w językach programowania obiektowego nowszych generacji: Java, C++, C#, python etc.&amp;lt;br /&amp;gt;&lt;br /&gt;
→ '''[[LEM]]'''&lt;br /&gt;
|♥ Projekt SpecVer ma potwierdzić przydatność  stosowania praw logiki algorytmicznej w inżynierii oprogramowania. Język LEM może okazać się przydatny w pracach  projektu SpecVer.&amp;lt;br /&amp;gt;&lt;br /&gt;
→ '''[[SpecVer]]'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|  class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
|♥ Biblioteka klas i wiedzy matematycznej przydatnej programistiom. &amp;lt;br /&amp;gt;&lt;br /&gt;
 Wizja przyszłości (jeszcze jeden projekt na lata pracy dla wielu osób).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zacznijmy od paru pytań: Czy można zawrzeć wiedzę matematyczną w komputerze? Czy można zawrzeć wiedzę informatyczną w komputerze? D. Knuth w latach 70-tych XX wieku miał taką ambicję rozpoczynając tworzenie swojej ''The Art of Programming''. Dziś po prawie 50 latach wiedza informatyczna rozrosła się i  wydaje się niemozliwym, by można ją było zawrzeć w komputerze. A jednak, po pierwsze komputery są znacznie większe i znacznie szybsze niż kiedyś, po drugie istnieje sieć komputerowa. (Spełniła sie wizja S. Lema z lat 50-tych). Pozwala to nam przejść do szkicowania koncepcji:&lt;br /&gt;
Należałoby : &lt;br /&gt;
# stworzyć magazyn wiedzy z jakiej korzystają twórcy oprogramowania. Znajdą się w nim biblioteki klas i metod i ponadto wiedza o strukturach danych w jakich przeprowadzane są obliczenia. Dotyczy to zarówno struktur relacyjnych (algebraicznych) rozpatrywanych przez matematyków jak i struktur danych definiowanych i wykorzystywanych przez inżynierów oprogramowania.&lt;br /&gt;
# stworzyć język w jakim twórcy oprogramowania będą zapisywac swoje argumenty na rzecz wygłaszanych (drukowanych, rozpowszechnianych, ...) komunikatów, Język taki powinien być czytelny dla ludzi i na tyle sformalizowany by możliwa była komputerowa analiza przedstawianych dowodów.&lt;br /&gt;
# narzędzie do weryfikacji poprawności dowodów. Potrzebny będzie proof checker, ale istotnie inny od Mizara i jemu podobnych, ponieważ dowody będą zapisywane w rachunku programów (tj. systemie AL) bogatszym od rachunku predykatów,&lt;br /&gt;
# obmyśleć sposób gromadzenia i udostępniania wiedzy.  Czy ma to być swego rodzaju wyszukiwarka Google matematyczno-algorytmiczna?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Pytania ==&lt;br /&gt;
Na programowanie funkcyjne i temu podobne.&lt;br /&gt;
# Nie rozumiem: jestem namawiany do programowania funkcyjnego. Co na tym zyskam? Powiadają, w programowaniu funkcyjnym nie ma efektów ubocznych, ani instrukcji przypisania. No i co z tego? Czy istnieją narzędzia do wyrażenia własności takich jak: a) obliczenie będzie skończone, b) zestaw definicji nie zawiera sprzeczności, c) wyniki będa poprawne, itp.&lt;br /&gt;
# W r. 1943 S.C. Kleene udowodnił, że każda funkcja rekurencyjna w sensie Goedla-Herbranda jest wyrażalna przez operator minimum efektywnego &amp;lt;math&amp;gt;\mu&amp;lt;/math&amp;gt;. Czy nie ozncza to tyle, że w dziedzinie liczb naturalnych (całkowitych) programowanie funkcyjne i programowanie za pomoca operacji while i in. definiuja ten sam zbiór ffunkcji obliczalnych?&lt;br /&gt;
# Czy w programowaniu funkcyjnym można opisać składnię takiej klasy programów, że obliczenia będą skończone? Dla programowania iteracyjnego (alias strukturalne) jest takie kryterium.&lt;br /&gt;
# Przeczytałem nastepujące zdania: ''Gdyby jakiś tyran zabronił stosowania procedur i funkcji, wówczas cała informatyka by padła. Są one tak ważnym narzędziem, że trudno sobie wyobrazić programowanie bez stosowania procedur i funkcji. '' Jak to się ma do twierdzenia Kleenego? do tezy Turinga-Churcha?&lt;br /&gt;
# Koszt? Weźmy pod uwagę funkcję (ciąg) Fibonacciego. Jaki jest najlepszy koszt obliczenia n-tego wyrazu tego ciągu? &lt;br /&gt;
W sprawie zarządzania pamięcią (odśmiecanie, wiszące referencje)&lt;br /&gt;
# Czy warto arbitralnie decydować o odrzuceniu instrukcji usuwającej obiekt?&lt;br /&gt;
[[próba]]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Nowa</id>
		<title>Nowa</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Nowa"/>
				<updated>2026-01-17T10:44:36Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: Utworzono nową stronę &amp;quot;Dzień dobry.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Dzień dobry.&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Strona_g%C5%82%C3%B3wna</id>
		<title>Strona główna</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Strona_g%C5%82%C3%B3wna"/>
				<updated>2026-01-17T10:44:19Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;p style=&amp;quot;text-align: left;&amp;quot;&amp;gt;[[Plik:22px-English_language.svg.png]]&lt;br /&gt;
[[Main page]]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; [[Plik:ukrainian_language.png|22px]]&lt;br /&gt;
[[Головна сторінка]]  &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &lt;br /&gt;
[[Page d'accueil]] &amp;lt;/p&amp;gt;&lt;br /&gt;
[[Nowa]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;&amp;lt;span style=&amp;quot;color: Red&amp;quot;&amp;gt;These pages are under permanent  (re)construction.&amp;lt;/span&amp;gt;&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Nie lękajcie się rachunku programów, bo przed nim kolosalna przyszłość!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Lothar  [[Collatz]] (&amp;lt;small&amp;gt;w roku 1937&amp;lt;/small&amp;gt;) miał rację !&lt;br /&gt;
&lt;br /&gt;
-------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Na tych stronach przedstawiamy cztery projekty badawcze: Logika Algorytmiczna(od 1968), Loglan'82(od 1978), SpecVer(2007), Lem(2012).&lt;br /&gt;
Dwa pierwsze projekty przyniosły wiele wyników i będą stosowane przez wiele lat.&amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
{|  class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
|♥ Projekt badawczy  ''Logika Algorytmiczna'' zajmuje się odkrywaniem praw [[rachunek programów |rachunku programów]] i znajduje zastosowanie w weryfikacji programów tzn. w dowodzeniu prawdziwości takich własności programów jak [[poprawność]], niezapetlanie się i in. Język logiki algorytmicznej pozwala nie tylko wyrażać własności algorytmów(programów) ale także umożliwia aksjomatyzacje wielu struktur danych. Zarówno tych znanych i niezbędnych w algorytmice np. stosy, drzewa binarnych poszukiwań, kopce, etc. jak i wielu struktur badanych w matematyce. Można uznać, że matematyka zajmuje się badaniem, czy dana formuła &amp;lt;math&amp;gt; \alpha &amp;lt;/math&amp;gt; jest prawdziwa w danej strukturze &amp;lt;math&amp;gt; \mathbb{A} &amp;lt;/math&amp;gt;. Ale większośc struktur nie daje sie opisać przy pomocy aksjomatów zapisanych w języku pierwszego rzędu! Przyjęcie języka logiki algorytmicznej (krócej, języka algorytmicznego) umożliwia podanie ...&amp;lt;br /&amp;gt;&lt;br /&gt;
→ '''[[Logika Algorytmiczna]]''' &amp;lt;br /&amp;gt;&lt;br /&gt;
→ '''[[Media:UlotkaLogikaAlgorytmiczna.pdf| ulotka Logika Algorytmiczna]]'''&lt;br /&gt;
&lt;br /&gt;
|width=&amp;quot;50% &amp;quot; | ♥ Projekt badawczy '''Loglan'82'''  wniósł język programowania obiektowego i rozproszonego o tej samej nazwie. Opublikowanie języka i dystrybucja kompilatora poprzedzone zostały badaniami problemów badawczych. Wymieńmy dla przykładu:&amp;lt;br /&amp;gt;&lt;br /&gt;
• Rozwiązanie problemu bezpiecznej i efektywnej dealokacji niepotrzebnych obiektów.  &lt;br /&gt;
• Rozwiązanie problemu (statycznej) semantyki jaki pojawia się gdy moduły klas mogą być zagnieżdżane (klasy wewnętrzne) i rozszerzane (dziedziczenie). &lt;br /&gt;
• Oryginalny protokół współpracy obiektów procesów, jakie programista może alokować w sieci komputerowej (protokół ''alien call''). Język Loglan powstał wiele lat przed językami C++(1986) i Java(1995). Te dwa (oraz inne) języki programowania nie przyswoiły sobie rozwiązań znanych w Loglanie od ponad 30 lat.   Zapoznanie się z Loglanem może całkowicie zmienić Twój pogląd na inżynierię oprogramowania. Wykorzystując wiedzę i umiejętności oferowane przez Loglan możesz w znaczący sposób podnieść swoje kwalifikacje.   &amp;lt;br /&amp;gt;&lt;br /&gt;
→ '''[[Loglan'82]]'''&amp;lt;br /&amp;gt;&lt;br /&gt;
→ '''[[Media:UlotkaLoglan.pdf|ulotka Loglan'82]]'''&amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
|-&lt;br /&gt;
|♥ LEM jest nazwą nowego projektu badawczego.&lt;br /&gt;
Celem tego projektu jest zbadanie czy można stworzyć język programowania o pewnych określonych cechach (zob. [[specyfikacja LEM]]).&lt;br /&gt;
Język LEM ma oprzeć się na osiągnięciach projektu Loglan'82 i wykorzystać to co dobre w językach programowania obiektowego nowszych generacji: Java, C++, C#, python etc.&amp;lt;br /&amp;gt;&lt;br /&gt;
→ '''[[LEM]]'''&lt;br /&gt;
|♥ Projekt SpecVer ma potwierdzić przydatność  stosowania praw logiki algorytmicznej w inżynierii oprogramowania. Język LEM może okazać się przydatny w pracach  projektu SpecVer.&amp;lt;br /&amp;gt;&lt;br /&gt;
→ '''[[SpecVer]]'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|  class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
|♥ Biblioteka klas i wiedzy matematycznej przydatnej programistiom. &amp;lt;br /&amp;gt;&lt;br /&gt;
 Wizja przyszłości (jeszcze jeden projekt na lata pracy dla wielu osób).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zacznijmy od paru pytań: Czy można zawrzeć wiedzę matematyczną w komputerze? Czy można zawrzeć wiedzę informatyczną w komputerze? D. Knuth w latach 70-tych XX wieku miał taką ambicję rozpoczynając tworzenie swojej ''The Art of Programming''. Dziś po prawie 50 latach wiedza informatyczna rozrosła się i  wydaje się niemozliwym, by można ją było zawrzeć w komputerze. A jednak, po pierwsze komputery są znacznie większe i znacznie szybsze niż kiedyś, po drugie istnieje sieć komputerowa. (Spełniła sie wizja S. Lema z lat 50-tych). Pozwala to nam przejść do szkicowania koncepcji:&lt;br /&gt;
Należałoby : &lt;br /&gt;
# stworzyć magazyn wiedzy z jakiej korzystają twórcy oprogramowania. Znajdą się w nim biblioteki klas i metod i ponadto wiedza o strukturach danych w jakich przeprowadzane są obliczenia. Dotyczy to zarówno struktur relacyjnych (algebraicznych) rozpatrywanych przez matematyków jak i struktur danych definiowanych i wykorzystywanych przez inżynierów oprogramowania.&lt;br /&gt;
# stworzyć język w jakim twórcy oprogramowania będą zapisywac swoje argumenty na rzecz wygłaszanych (drukowanych, rozpowszechnianych, ...) komunikatów, Język taki powinien być czytelny dla ludzi i na tyle sformalizowany by możliwa była komputerowa analiza przedstawianych dowodów.&lt;br /&gt;
# narzędzie do weryfikacji poprawności dowodów. Potrzebny będzie proof checker, ale istotnie inny od Mizara i jemu podobnych, ponieważ dowody będą zapisywane w rachunku programów (tj. systemie AL) bogatszym od rachunku predykatów,&lt;br /&gt;
# obmyśleć sposób gromadzenia i udostępniania wiedzy.  Czy ma to być swego rodzaju wyszukiwarka Google matematyczno-algorytmiczna?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Pytania ==&lt;br /&gt;
Na programowanie funkcyjne i temu podobne.&lt;br /&gt;
# Nie rozumiem: jestem namawiany do programowania funkcyjnego. Co na tym zyskam? Powiadają, w programowaniu funkcyjnym nie ma efektów ubocznych, ani instrukcji przypisania. No i co z tego? Czy istnieją narzędzia do wyrażenia własności takich jak: a) obliczenie będzie skończone, b) zestaw definicji nie zawiera sprzeczności, c) wyniki będa poprawne, itp.&lt;br /&gt;
# W r. 1943 S.C. Kleene udowodnił, że każda funkcja rekurencyjna w sensie Goedla-Herbranda jest wyrażalna przez operator minimum efektywnego &amp;lt;math&amp;gt;\mu&amp;lt;/math&amp;gt;. Czy nie ozncza to tyle, że w dziedzinie liczb naturalnych (całkowitych) programowanie funkcyjne i programowanie za pomoca operacji while i in. definiuja ten sam zbiór ffunkcji obliczalnych?&lt;br /&gt;
# Czy w programowaniu funkcyjnym można opisać składnię takiej klasy programów, że obliczenia będą skończone? Dla programowania iteracyjnego (alias strukturalne) jest takie kryterium.&lt;br /&gt;
# Przeczytałem nastepujące zdania: ''Gdyby jakiś tyran zabronił stosowania procedur i funkcji, wówczas cała informatyka by padła. Są one tak ważnym narzędziem, że trudno sobie wyobrazić programowanie bez stosowania procedur i funkcji. '' Jak to się ma do twierdzenia Kleenego? do tezy Turinga-Churcha?&lt;br /&gt;
# Koszt? Weźmy pod uwagę funkcję (ciąg) Fibonacciego. Jaki jest najlepszy koszt obliczenia n-tego wyrazu tego ciągu? &lt;br /&gt;
W sprawie zarządzania pamięcią (odśmiecanie, wiszące referencje)&lt;br /&gt;
# Czy warto arbitralnie decydować o odrzuceniu instrukcji usuwającej obiekt?&lt;br /&gt;
[[próba]]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2025-10-01T16:53:04Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że dowód  hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture&lt;br /&gt;
''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' &lt;br /&gt;
is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic.&amp;lt;br /&amp;gt; &lt;br /&gt;
 end of Abstract 01/10/2025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2025-10-01T16:52:02Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że dowód  hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture&lt;br /&gt;
''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' &lt;br /&gt;
is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic.&amp;lt;br /&amp;gt; &lt;br /&gt;
 &amp;lt;math&amp;gt;\qquad \ \qquad\ &amp;lt;/math&amp;gt; end of Abstract 01-10-2025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2025-10-01T16:49:21Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że dowód  hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture&lt;br /&gt;
''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' &lt;br /&gt;
is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic. &lt;br /&gt;
 &amp;lt;math&amp;gt;\qquad \ \qquad\ &amp;lt;/math&amp;gt; end of Abstract 01-10-2025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2025-10-01T16:48:30Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że dowód  hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture&lt;br /&gt;
 ''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' &lt;br /&gt;
is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic. &lt;br /&gt;
 &amp;lt;math&amp;gt;\qquad \ \qquad\ &amp;lt;/math&amp;gt; end of Abstract 01-10-2025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2025-10-01T13:39:49Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że dowód  hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture ''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic. &lt;br /&gt;
 &amp;lt;math&amp;gt;\qquad \ \qquad\ &amp;lt;/math&amp;gt; end of Abstract 01-10-2025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2025-10-01T13:37:52Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że dowód  hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture ''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic. &lt;br /&gt;
 \qquad \ \qquad end of Abstract &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2025-10-01T13:36:24Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że dowód  hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture ''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic. &lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2025-10-01T13:35:18Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że dowód  hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture ''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic. &lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2025-10-01T13:33:41Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że dowód  hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture ''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set &amp;lt;math&amp;gt;St_0&amp;lt;math&amp;gt; is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic. &lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2025-10-01T13:32:26Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że dowód  hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture ''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule &amp;lt;math&amp;gt;R_3&amp;lt;/math&amp;gt; of the algorithmic logic &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;.  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set &amp;lt;math&amp;gt;St_0&amp;lt;math&amp;gt;.   \\&lt;br /&gt;
		 Note, that  that  the set $St_{0}$ is a recursive set  of formulas without variables and that all its elements are theorems of Presburger's arithmetic. &lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2025-10-01T13:23:31Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że dowód  hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture ''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
%	\label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;, see p. .  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set $St_{0} $.   \\&lt;br /&gt;
		 Note, that  that  the set $St_{0}$ is a recursive set  of formulas without variables and that all its elements are theorems of Peano's arithmetic. &lt;br /&gt;
  &lt;br /&gt;
Work on the problem took 83 years.&amp;lt;br /&amp;gt;&lt;br /&gt;
We succeeded. We are changing the status of the &amp;quot;Collatz conjecture&amp;quot; to [http://lem12.uksw.edu.pl/images/3/37/CollatzConjecturebecomesTheorem20Nov23.pdf]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2025-10-01T13:20:14Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że dowód  hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture ''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
	\[ \label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F&amp;lt;small&amp;gt;unction &amp;lt;math&amp;gt;\kappa&amp;lt;/math&amp;gt; for a given natural number &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; returns the multiplicity of 2 in the factorization of the number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;, see p. .  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set $St_{0} $.   \\&lt;br /&gt;
		 Note, that  that  the set $St_{0}$ is a recursive set  of formulas without variables and that all its elements are theorems of Peano's arithmetic. &lt;br /&gt;
  &lt;br /&gt;
Work on the problem took 83 years.&amp;lt;br /&amp;gt;&lt;br /&gt;
We succeeded. We are changing the status of the &amp;quot;Collatz conjecture&amp;quot; to [http://lem12.uksw.edu.pl/images/3/37/CollatzConjecturebecomesTheorem20Nov23.pdf]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2025-10-01T13:15:31Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że dowód  hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture ''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
	\[ \label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{IF\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {THEN\ the\ computation\   for\ n\ is\ finite\ FI} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;, see p. .  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set $St_{0} $.   \\&lt;br /&gt;
		 Note, that  that  the set $St_{0}$ is a recursive set  of formulas without variables and that all its elements are theorems of Peano's arithmetic. &lt;br /&gt;
  &lt;br /&gt;
Work on the problem took 83 years.&amp;lt;br /&amp;gt;&lt;br /&gt;
We succeeded. We are changing the status of the &amp;quot;Collatz conjecture&amp;quot; to [http://lem12.uksw.edu.pl/images/3/37/CollatzConjecturebecomesTheorem20Nov23.pdf]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2025-10-01T13:10:55Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że dowód  hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture ''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &lt;br /&gt;
&amp;lt;math&amp;gt; \begin{array}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
	\[ \label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{\textsc{IF}\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {\textsc{THEN}\ the\ computation\   for\ n\ is\ finite\ \textsc{FI}} } &lt;br /&gt;
\end{array}   &amp;lt;/math&amp;gt;&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;, see p. .  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set $St_{0} $.   \\&lt;br /&gt;
		 Note, that  that  the set $St_{0}$ is a recursive set  of formulas without variables and that all its elements are theorems of Peano's arithmetic. &lt;br /&gt;
  &lt;br /&gt;
Work on the problem took 83 years.&amp;lt;br /&amp;gt;&lt;br /&gt;
We succeeded. We are changing the status of the &amp;quot;Collatz conjecture&amp;quot; to [http://lem12.uksw.edu.pl/images/3/37/CollatzConjecturebecomesTheorem20Nov23.pdf]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	<entry>
		<id>https://lem12.uksw.edu.pl/wiki/Collatz</id>
		<title>Collatz</title>
		<link rel="alternate" type="text/html" href="https://lem12.uksw.edu.pl/wiki/Collatz"/>
				<updated>2025-10-01T13:07:25Z</updated>
		
		<summary type="html">&lt;p&gt;AndrzejSalwicki: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Możemy ogłosić, że dowód  hipotezy Collatza został ukończony. &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;big&amp;gt;Absract&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
		We are showing that the  following conjecture ''For every &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is a natural number then Collatz computation is finite.'' is a semantically valid statement.   	&amp;lt;br /&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
		This is asserted by  the Main lemma.  &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		 A corollary of the lemma says:  every instance of the cnjecture where the variable &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is replaced by any natural number &amp;lt;math&amp;gt;r \neq 0&amp;lt;/math&amp;gt;, is a theorem of arithmetic, in which the addition is the only operation. &amp;lt;br /&amp;gt;&lt;br /&gt;
Note, the set &amp;lt;math&amp;gt;St_0&amp;lt;/math&amp;gt;of is a recursive set of theorems of Presburger arithmetic, hence the theorems of algorithmic theory of natural numbers. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
		 Paradoxically, the Collatz conjecture itself is not a theorem of number theory (Peano's arithmetic), nor any mathematical theory that uses the first-order  language and the classical predicate logic.   &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		It is so because, '''1''') there is no first-order theory such that all its models are isomorphic to the standard model of natural numbers                                                                      &lt;br /&gt;
		and hence '''2''') the  infinite computations   can be n observed  in a ''non-standard computable'' model of   the elementary theory of natural numbers with addition. &amp;lt;br /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
		 To avoid the paradox, we will use the   calculus of programs &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt; instead of the predicate calculus. The halting condition &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;  of the Collatz  computations is written as an algorithmic formula. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \qquad  	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {the\ computation\   for\ n\ is\ finite} }  \qquad (H)  &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no finite, traditional proof the following  theorem . &lt;br /&gt;
&amp;lt;math&amp;gt; \begin{tabular}{p{14cm}}&lt;br /&gt;
%	  We are  answering to the question (\textit{i}) formulating the thesis of the  \textsc{Theorem}\eqref{thM}.     &lt;br /&gt;
	\[ \label{main}&lt;br /&gt;
			 \mathcal{ATN}\vdash  &lt;br /&gt;
			\forall_{n \neq 0}	\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						q:=1; \\&lt;br /&gt;
						\mathbf{while}\ n \neq q \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad q:=q+1  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(n=q)   }  }_{\color{black}{\textsc{IF}\ n&amp;gt;0 \ is\ a\ natural\ number\ }}&lt;br /&gt;
			\implies &lt;br /&gt;
			\underbrace{\boxed{\left\lbrace \begin{array}{l}&lt;br /&gt;
						m:=n \div 2^{\kappa(n)}; \\&lt;br /&gt;
%						(*\ \   m= 2^{\kappa(n)} (2 \rho(m)+1) \ \ *) \\&lt;br /&gt;
						\mathbf{while}\ m \neq 1 \\&lt;br /&gt;
						 \mathbf{do}  \\&lt;br /&gt;
						\quad m:=3 \cdot m +1;  \\&lt;br /&gt;
						\quad m:= m \div 2^{\kappa(m)}  \\&lt;br /&gt;
						\mathbf{od} 	 		&lt;br /&gt;
					\end{array}\right\rbrace(m=1)} }_{ {\textsc{THEN}\ the\ computation\   for\ n\ is\ finite\ \textsc{FI}} } &lt;br /&gt;
	 \ \ \ \ \ \ \ (6.1) \]&lt;br /&gt;
\end{tabular}   &amp;lt;/math&amp;gt;&lt;br /&gt;
Instead,  we are presenting an  rgument  showing that the proof can be   carried out in the calculus of programs  &amp;lt;math&amp;gt;\mathcal{AL}&amp;lt;/math&amp;gt;. To achieve his goal  one has to construct an infinite tree &amp;lt;math&amp;gt;\mathcal{D}&amp;lt;/math&amp;gt;. The root of the tree is the halting  formula . The formula is the consequence of the  infinitary inference rule R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;, see p. .  For each premise one can construct a a finite subtree, i.e. a finite proof  which is  using one formula of the  set $St_{0} $.   \\&lt;br /&gt;
		 Note, that  that  the set $St_{0}$ is a recursive set  of formulas without variables and that all its elements are theorems of Peano's arithmetic. &lt;br /&gt;
  &lt;br /&gt;
Work on the problem took 83 years.&amp;lt;br /&amp;gt;&lt;br /&gt;
We succeeded. We are changing the status of the &amp;quot;Collatz conjecture&amp;quot; to [http://lem12.uksw.edu.pl/images/3/37/CollatzConjecturebecomesTheorem20Nov23.pdf]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Let's consider the statement&amp;lt;br/&amp;gt;&lt;br /&gt;
for every natural number &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;, the following program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\color{blue}\qquad Cl:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
We begin by noting that the truth of the above statement entails the truth of Collatz's thesis as it was formulated before World War II. &amp;lt;br /&amp;gt;&lt;br /&gt;
But in 1937, neither computers nor programming languages existed.&amp;lt;br /&amp;gt;&lt;br /&gt;
On the other hand, the theory of algorithms did exist and was already well developed. The theory of recursive functions was developed in Göttingen (David Hilbert and his students), Budapest (Rozsza Pterer, Laszlo Kalmar), ...&amp;lt;br /&amp;gt;&lt;br /&gt;
In London, Alan Turing created the abstract Turing machine.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Moscow, Kolmogorov and in Kazan, Maltsev explored the concept of a computable function.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In Warsaw, Alfred Tarski, together with his students Mojżesz Presburger and Stanisław Jaskowski, obtained important results concerning the theory of addition of natural numbers.&lt;br /&gt;
&lt;br /&gt;
==Our observations from 2004==&lt;br /&gt;
* The Collatz algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; does not require multiplication or division operations. Multiplying by 3 (because 3x=x+x+x) and dividing by 2 (a simple algorithm adding every other 1 is sufficient), is sufficient.&lt;br /&gt;
* In the algebraic structure &amp;lt;math&amp;gt;\mathfrak{M}&amp;lt;/math&amp;gt;, which is a non-standard model of the elementary theory of addition of natural numbers (there is one, see below), the algorithm &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has an infinite computation for many arguments.&lt;br /&gt;
* Therefore, the Collatz theorem cannot be proven based on the axioms of the elementary theory of addition of natural numbers.&lt;br /&gt;
* Moreover, in the language of elementary theory of addition, there is no stopping formula for the Collatz algorithm! It is a corollary from the Goedel incompleteness theorem. &amp;lt;br /&amp;gt;&lt;br /&gt;
So what do we have to prove?&lt;br /&gt;
&lt;br /&gt;
==Correct formulation of the Collatz theorem==&lt;br /&gt;
In the standard structure of natural numbers with the addition operation,&lt;br /&gt;
our program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; has a finite computation for each argument ''n''.&lt;br /&gt;
&lt;br /&gt;
==Stop formula==&lt;br /&gt;
i.e.&lt;br /&gt;
=== A necessary and sufficient condition for the computation to be finite===&lt;br /&gt;
Therefore, we need to create a formula &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; (a logical expression) such that it evaluates to true if and only if the computation of the program &amp;lt;math&amp;gt;Cl&amp;lt;/math&amp;gt; is finite. There are many such formulas in the language of program calculation, i.e. algorithmic logic.&amp;lt;br/&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \theta:\,\left\{\begin{array}{l} \mathbf{while}\ n \neq 0 \ \mathbf{do} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{od} \end{array}\right\} (n=1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The value of the &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; formula depends only on the initial value of the &amp;quot;n&amp;quot; variable. This formula is satisfied by the value of the variable &amp;quot;n&amp;quot; if and only if the evaluation of the while ... program is finished and the final value of the variable &amp;quot;n&amp;quot; is equal to 1. &amp;lt;br /&amp;gt;&lt;br /&gt;
Other formulas can also be considered, e.g., &amp;lt;br /&amp;gt;&lt;br /&gt;
,&amp;lt;math&amp;gt;\qquad \xi:\,\bigcup \left\{\overbrace{\begin{array}{l} \mathbf{if}\ n \neq 0 \ \mathbf{then} \\&lt;br /&gt;
\quad \mathbf{if}\ odd(n) \ \mathbf{then}\ n:=3n+1 \ \mathbf{else}\ n:=n/2\ \mathbf{fi} \\&lt;br /&gt;
\mathbf{fi} \end{array} }^{K}\right\} (n=1) &amp;lt;/math&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
{co reads: &amp;quot;there exists an iteration &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; of the program &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; such that after executing &amp;lt;math&amp;gt;K^i&amp;lt;/math&amp;gt; the equality &amp;lt;math&amp;gt;n=1&amp;lt;/math&amp;gt; is satisfied.&amp;quot;} &amp;lt;br/&amp;gt;&lt;br /&gt;
In other words, we are dealing with an upper bound on the values of the formulas &amp;lt;math&amp;gt;K^i(n=1)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i= 0,1,2 \dots&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second part of the problem is much more difficult: we must prove the stopping formula using the axioms of program calculus and the axioms of the algorithmic theory of natural numbers.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Elementary Theory of Addition of Natural Numbers==&lt;br /&gt;
The previous observation that Collatz's theorem cannot be proved in this theory remains valid. However, the properties of the non-standard model of this theory and a few of its theorems will be helpful in further considerations.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This theory is defined by specifying three components:&lt;br /&gt;
*  the language,&lt;br /&gt;
* the logic, i.e., the consequence operation, and &lt;br /&gt;
* the axioms specific to this theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Language.''' The expressions of the language are composed of the following symbols: variable symbols, e.g., x, y, n, the + symbol for a binary operation, the = symbol for a binary relation, constant symbols, logical functor symbols, and auxiliary symbols, e.g., parentheses.&amp;lt;br /&amp;gt;&lt;br /&gt;
. Examples of expressions are...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Logic.''' The consequence (inference) operation is determined by specifying the axioms of first-order logic and the rules of inference.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Axioms.'''&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align} &lt;br /&gt;
		\tag{a}   \forall_x\ x+1 &amp;amp;\neq 0  \\&lt;br /&gt;
		\tag{b}   \forall_x\, \forall_y\ x+1=y+1 &amp;amp;\implies  x=y  \\&lt;br /&gt;
		\tag{c}   \forall_{x}\ x+0&amp;amp;=x  \\&lt;br /&gt;
		\tag{d}   \forall_{x,y}\ (y+1)+x&amp;amp;=(y+x)+1  \\&lt;br /&gt;
		\tag{I}    \Phi(0)\land \forall_x\,[\Phi(x) \implies \Phi(x+1)]&amp;amp;\implies \forall_x\Phi(x)   &lt;br /&gt;
	\end{align}    &lt;br /&gt;
  &amp;lt;/math&amp;gt;&lt;br /&gt;
	The expression &amp;lt;math&amp;gt;\Phi(x)&amp;lt;/math&amp;gt; may be replaced by any formula.   The result is an axiom of theory &lt;br /&gt;
	This is the induction scheme.   &amp;lt;br /&amp;gt;&lt;br /&gt;
  	We augment the set of axioms adding four axioms that define a coiple of useful notions. &amp;lt;br /&amp;gt;&lt;br /&gt;
   &amp;lt;math&amp;gt;&lt;br /&gt;
	\begin{align}&lt;br /&gt;
	  	\tag{e}  even(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y  \\&lt;br /&gt;
	%	\tag{o}  odd(x) &amp;amp;\stackrel{df}{\equiv} \exists_y\, x=y+y+1  \\&lt;br /&gt;
	%	\tag{D2}  x\, div\, 2 = y &amp;amp;\equiv (x=y+y\, \lor\, x=y+y+1)  \\&lt;br /&gt;
	%	\tag{3x}  3x&amp;amp;\stackrel{df}{=} x+x+x&lt;br /&gt;
	\end{align} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Models of Presburger Arithmetic'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As expected, the sequence of standard values 0, 1, 2, 3, ... is a model of this theory.&lt;br /&gt;
&lt;br /&gt;
Stanisław Jaśkowski discovered another, nonstandard model of Presburger arithmetic in 1929.&lt;br /&gt;
&lt;br /&gt;
[[File:MonStandardModel.png|center|thumb|600px|Nonstandard model of Presburger arithmetic]]&lt;br /&gt;
The universe of the model is a subset of the set of complex numbers &amp;lt;math&amp;gt;a+\math b&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a \in \mathbb{Z} &amp;lt;/math&amp;gt; i.e. a is an integer number and &amp;lt;math&amp;gt;b \in \mathbb{Q}^+ &amp;lt;/math&amp;gt; is a positive rational number. Additionally, whenever &amp;lt;math&amp;gt;b=0 &amp;lt;/math&amp;gt; we have &amp;lt;math&amp;gt;a&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
Addition is defined as usual addition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
Both models are computable. There are also unpredictable models with arbitrarily high power.&lt;br /&gt;
&lt;br /&gt;
==Algorithmic Theory of Natural Numbers==&lt;br /&gt;
* Language. The alphabet of a language contains a set of variables, e.g., x,y. a functor + a two-argument addition operation, two constants 0 and 1, a relation sign = equality.&amp;lt;br /&amp;gt;&lt;br /&gt;
Terms (i.e., nomenclature expressions): this is the smallest set of expressions containing variables, constants, and closed under the combination of two terms in this way (t1 + t2).&amp;lt;br /&amp;gt;&lt;br /&gt;
Formulae.&lt;br /&gt;
* Logic. Program calculus. Program calculus includes first-order logic. In addition to first-order formulas, the language of program calculus also contains algorithmic formulas. The simplest such formula is a string consisting of a program and a formula (usually a first-order formula) following it.&lt;br /&gt;
To the axioms of first-order logic, axioms describing the properties of program-generating connectives should be added; see [[Algorithmic Logic]].&lt;br /&gt;
To the inference rules of first-order logic, rules specific to program calculus should be added.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Axioms of the theory.&amp;lt;br /&amp;gt;&lt;br /&gt;
Only three formulas.&amp;lt;br /&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{eqnarray}&lt;br /&gt;
\tag{ATN1} \forall_x\, x+1 \neq 0 &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN2} \forall_{x,y}\,x+1=y+1 \implies x=y &amp;amp;&amp;amp;\\&lt;br /&gt;
\tag{ATN3}\forall_x\, \{y :=0; \mathbf{while}\ y\neq x\ \mathbf{do}\ y:=y+1\ \mathbf{od} \}\,(y=x) &amp;amp;&amp;amp;&lt;br /&gt;
\end{eqnarray} &amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are essentially the axioms of the successor theory.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN1 formula states that 0 is not the successor of any natural number.&amp;lt;br/&amp;gt;&lt;br /&gt;
The ATN2 formula states that the successor is a one-to-one function.&amp;lt;br/&amp;gt;&lt;br /&gt;
The formula ATN3 states that every natural number is ''reachable'' from zero by adding a finite number of ones.&amp;lt;br/&amp;gt;&lt;br /&gt;
In this theory, one can write definitions for addition, multiplication, and any computable function.&lt;br /&gt;
&lt;br /&gt;
==Analiza formuły stopu==&lt;br /&gt;
xxx&lt;br /&gt;
&lt;br /&gt;
==Trójki ==&lt;br /&gt;
Spostrzeżenie (wynikłe z przygladania się formule stopu).&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\forall_{n \neq 0} \exists_{x,y,z}\ n \cdot 3^x+y=2^z  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drzewo Collatza==&lt;br /&gt;
[[Plik:StratDrzewoCollatza.png|thumb|center |750px| Rys. 1  Fragmenty warstw &amp;lt;math&amp;gt;W_0, \dots W_4  &amp;lt;/math&amp;gt; drzewa Collatza ]]&lt;br /&gt;
&lt;br /&gt;
==Własności obliczeń na trójkach==&lt;br /&gt;
Tutaj napiszemy więcej&amp;lt;br /&amp;gt;&lt;br /&gt;
==Kalejdoskop==&lt;br /&gt;
&lt;br /&gt;
Oglądaj rysunki, wykonuj obliczenia, rozwiązuj zadania, formułuj swoje zdanie, próbuj je uzasadnić, ...&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tu znajdziesz ....&amp;lt;br /&amp;gt;&lt;br /&gt;
===Obliczenia utemperowane===&lt;br /&gt;
[[Plik:ObliczN19.pdf.png|thumb|center|750px|Utemperowane obliczenie dla n=76]]&lt;br /&gt;
Trzy zadania. Odpowiedz czy są one jakos powiązane?&amp;lt;br /&amp;gt;&lt;br /&gt;
* Masz do dyspozycji bardzo wiele trójkątnych płytek, w dwu kolorach. &lt;br /&gt;
Czy potrafisz ułożyć chodnik łączący posesje o numerze n z numerem 1?&lt;br /&gt;
*[[Ułamek piętrowy]]&lt;br /&gt;
* Czy obliczenie 3x+1 jest skończone dla każdej liczby naturalnej?&lt;br /&gt;
&lt;br /&gt;
===Struktury algebraiczne===&lt;br /&gt;
Struktura liczb naturalnych. &amp;lt;br /&amp;gt;&lt;br /&gt;
Algebra Jaśkowskiego.&amp;lt;br /&amp;gt;&lt;br /&gt;
===Teorie===&lt;br /&gt;
elementarna teoria liczb naturalnych z dodawaniem.&amp;lt;br /&amp;gt;&lt;br /&gt;
algorytmiczna teoria  liczb naturalnych&amp;lt;br /&amp;gt;&lt;br /&gt;
===Zadania===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archiwum kolejnych wersji pracy ==&lt;br /&gt;
[CollatzConjecturebecomesTheorem11Aug23    http://lem12.uksw.edu.pl/images/3/3b/CollatzConjecturebecomesTheorem11Aug23.pdf]&lt;br /&gt;
&lt;br /&gt;
[https://dx.doi.org/10.2139/ssrn.4158238 \On Collatz theorem II.pdf wersja z 5 czerwca 2022 ]&lt;br /&gt;
&lt;br /&gt;
][http://lem12.uksw.edu.pl/images/a/ab/On-Collatz-thm17-09-21.pdf wersja z 20 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/7/7d/Algorytmy-bliskie-Collatzowi.pdf  algorytmy wokół Collatzowe]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/c/c0/On-Collatz-thm-27-09-21.pdf  wersja z 27 wrzesnia 2021]&lt;br /&gt;
&lt;br /&gt;
[http://lem12.uksw.edu.pl/images/8/8f/On-Collatz-thm-7-10-21.pdf   wersja z 7 pażdziernika 2021]&lt;/div&gt;</summary>
		<author><name>AndrzejSalwicki</name></author>	</entry>

	</feed>