Piecewise Affine Function: Difference between revisions

From BusyBeaverWiki
Jump to navigation Jump to search
m Sligocki moved page Linear-Inequality Affine Transformation Automata to Piecewise Affine Function: Switch to name more common in literature
Rewrite article using PAF terminology and definitions from Ben-Amram's paper.
Line 1: Line 1:
<blockquote>Note: This article is currently in flux as we investigate previous literature on the topic (called '''piecewise affine functions''' (PAF)) shared by @savask: https://discord.com/channels/960643023006490684/1239205785913790465/1422997913558323392</blockquote>'''Linear-Inequality Affine Transformation Automata (LIATA)''' are a model for computation based upon applying affine transformations to vectors based on cases defined by linear inequalities. They are a generalization of the rules for [[BMO1]] and were proven to be Turing complete.
A '''Piecewise Affine Function (PAF)''' is a piecewise-defined function where each case is affine (and the case constraints are polyhedra). Many [[Cryptids]] are modeled by iterated PAFs, for example, [[BMO1]]. Like [[Generalized Collatz Problems]], iterated PAFs are also proven to be Turing complete. On the [[bbchallenge]] Discord, these were originally called "Linear-Inequality Affine Transformation Automata (LIATA)" before we knew about the existing name in published literature.
 
== Formal Definition ==
== Formal Definition ==
A ''n''-dimension, ''k''-case LIATA is a piecewise defined partial function <math>f: \Z^n \to \Z^n</math>:<math display="block">f(\vec{x}) = \begin{cases}
A ''n''-dimension, ''p''-region PAF is a piecewise defined partial function <math>f: \Z^n \to \Z^n</math>:<math display="block">f(\vec{x}) = \begin{cases}
   f_0(\vec{x}) & \text{if } C_0(\vec{x}) \\
   f_0(\vec{x}) & \text{for } \vec{x} \in H_0 \\
   f_1(\vec{x}) & \text{if } C_1(\vec{x}) \\
   f_1(\vec{x}) & \text{if } \vec{x} \in H_1 \\
   & \vdots \\
   & \vdots \\
   f_{k-1}(\vec{x}) & \text{if } C_{k-1}(\vec{x}) \\
   f_{p-1}(\vec{x}) & \text{if } \vec{x} \in H_{p-1} \\
\end{cases}</math>Where each <math>f_i: \Z^n \to \Z^n</math> is an affine function and each <math>C_i: \Z^n \to \{T,F\}</math> is a "linear inequality condition" (defined below) such that for all <math>\vec{x}</math> at most one condition <math>C_i(\vec{x})</math> applies. If none of the conditions apply to <math>\vec{x}</math>, we say that it halts on that configuration.
\end{cases}</math>Where each <math>f_i(\vec{x}) = A_i \vec{x} + \vec{b_i}</math> is an affine function and the <math>H_i \subset \Z^n</math> are non-overlapping "polyhedral regions" (defined below). If <math>\vec{x}</math> is not in any region <math>H_i</math>, we say that it halts on that configuration.


Let a '''linear inequality term''' be any equation of the form <math>g(\vec{x}) \sim c</math> where <math>g: \Z^n \to \Z</math> is a linear function and ~ is replaced by any (in)equality relation (=,<,≤,>,≥). Then let a '''linear inequality condition''' be any combination of linear inequality terms using logical AND, OR and NOT operations.
We define a closed, rational ''half-space'' to be a region <math>\{ \vec{x} \in \mathbb{R}^n : \vec{c} \cdot \vec{x} + d \ge 0 \}</math> for some <math>\vec{c} \in \mathbb{Q}^n</math> and <math>d \in \mathbb{Q}</math>. In other words, it is the half of n-dimensional Euclidean space on one side of a hyperplane (a subspace defined by an affine function). And let an open, rational half-space be the same thing but using strict inequality (<math>\{ \vec{x} \in \mathbb{R}^n : \vec{c} \cdot \vec{x} + d > 0 \}</math>).


So, for example, the following are all linear inequality conditions:
Finally, define a ''polyhedral regions'' (or simply ''polyhedron'') as the intersection of a finite number of rational half-spaces (any combination of closed and open ones). So, for example, the following are all polyhedral regions:


* <math>a<b</math> represented formally as <math>a-b < 0</math>
* <math>a<b</math> represented formally as <math>b-a > 0</math>
* <math>3a \le b < 4a</math> represented formally as <math>(b-3a \ge 0) \and (4a-b > 0)</math>
* <math>3a \le b < 4a</math> represented formally as <math>(b-3a \ge 0) \and (4a-b > 0)</math>
* <math>a = 2</math> (note that we allow equalities as well)
* <math>a = 2</math> represented formally as <math>(a - 2 \ge 0) \and (-a + 2 \ge 0)</math>


Given a LIATA ''f'', we say that it halts in ''k'' steps starting from configuration <math>\vec{x}</math> iff <math>f^k(\vec{x})</math> is undefined.
Given a PAF ''f'', we say that it halts in ''k'' steps starting from configuration <math>\vec{x}</math> iff <math>f^k(\vec{x})</math> is undefined.


== Example ==
== Example ==
An example of a LIATA are the rules for BMO1:<math display="block">f(a,b) = \begin{cases}
An example of a PAF are the rules for BMO1:<math display="block">f(a,b) = \begin{cases}
   (a-b, 4b+2) & \text{if } a > b \\
   (a-b, 4b+2) & \text{if } a > b \\
   (2a+1, b-a) & \text{if } a < b  
   (2a+1, b-a) & \text{if } a < b  
\end{cases}</math>where <math>f(n,n)</math> is undefined. BMO1 halts iff there exists k such that <math>f^k(1,2)</math> is undefined (in other words <math>f^{k-1}(1,2) = (n,n)</math> for some n).
\end{cases}</math>where <math>f(n,n)</math> is undefined. BMO1 halts iff there exists k such that <math>f^k(1,2)</math> is undefined (in other words <math>f^{k-1}(1,2) = (n,n)</math> for some n).


This is a 2-dimension, 2-case LIATA. The 2 dimensions are the parameters ''a,b'' and the two cases are the <math>a<b</math> and <math>a>b</math> rows. For each case the parameters are transformed via an affine transformation.
This is a 2-dimension, 2-region PAF. The 2 dimensions are the parameters ''a,b'' and the two regions are the half-spaces <math>a<b</math> and <math>a>b</math>. For each case the parameters are transformed via an affine transformation.


== Turing Complete ==
== Turing Complete ==
LIATA are Turing complete. This has been proven by implementing Minsky machines as LIATA:
PAF are Turing complete. This has been proven by implementing Generalized Collatz Problems and Minsky machines as iterated PAF problems: Amir M. Ben-Amram proved in 2015 that 2-dimensional PAF are Turing complete by implementing arbitrary GCP<ref>Amir M. Ben-Amram. [https://drops.dagstuhl.de/storage/00lipics/lipics-vol020-stacs2013/LIPIcs.STACS.2013.514/LIPIcs.STACS.2013.514.pdf Mortality of iterated piecewise affine functions over the integers: Decidability and complexity]. ''Computability''. 2015;4(1):19-56. [https://doi.org/10.3233/COM-150032 doi:10.3233/COM-150032]</ref> and also that 2-region PAF are Turing complete.
* @Bard's proved that 3-dim LIATA are Turing complete: [https://discord.com/channels/960643023006490684/1239205785913790465/1420457986564030641 Discord link]
 
* @star's proved that 2-dim LIATA are Turing complete: [https://discord.com/channels/960643023006490684/1239205785913790465/1421271424588451915 Discord link]
Independently, similar results were proven on the bbchallenge Discord in 2025: @Bard proved that 3-dim PAF are Turing complete: [https://discord.com/channels/960643023006490684/1239205785913790465/1420457986564030641 Discord link], @star proved that 2-dim PAF are Turing complete: [https://discord.com/channels/960643023006490684/1239205785913790465/1421271424588451915 Discord link] and Shawn Ligocki wrote up a proof sketch that 2-region PAF are Turing complete: [https://discord.com/channels/960643023006490684/1239205785913790465/1422772752980639866 Discord link].
* In progress: Shawn Ligocki is working on a proof that 2-case LIATA are Turing complete: [https://discord.com/channels/960643023006490684/1239205785913790465/1422772752980639866 Discord link]
 
== References ==
<references />

Revision as of 16:03, 28 October 2025

A Piecewise Affine Function (PAF) is a piecewise-defined function where each case is affine (and the case constraints are polyhedra). Many Cryptids are modeled by iterated PAFs, for example, BMO1. Like Generalized Collatz Problems, iterated PAFs are also proven to be Turing complete. On the bbchallenge Discord, these were originally called "Linear-Inequality Affine Transformation Automata (LIATA)" before we knew about the existing name in published literature.

Formal Definition

A n-dimension, p-region PAF is a piecewise defined partial function f:nn:f(x)={f0(x)for xH0f1(x)if xH1fp1(x)if xHp1Where each fi(x)=Aix+bi is an affine function and the Hin are non-overlapping "polyhedral regions" (defined below). If x is not in any region Hi, we say that it halts on that configuration.

We define a closed, rational half-space to be a region {xn:cx+d0} for some cn and d. In other words, it is the half of n-dimensional Euclidean space on one side of a hyperplane (a subspace defined by an affine function). And let an open, rational half-space be the same thing but using strict inequality ({xn:cx+d>0}).

Finally, define a polyhedral regions (or simply polyhedron) as the intersection of a finite number of rational half-spaces (any combination of closed and open ones). So, for example, the following are all polyhedral regions:

  • a<b represented formally as ba>0
  • 3ab<4a represented formally as (b3a0)(4ab>0)
  • a=2 represented formally as (a20)(a+20)

Given a PAF f, we say that it halts in k steps starting from configuration x iff fk(x) is undefined.

Example

An example of a PAF are the rules for BMO1:f(a,b)={(ab,4b+2)if a>b(2a+1,ba)if a<bwhere f(n,n) is undefined. BMO1 halts iff there exists k such that fk(1,2) is undefined (in other words fk1(1,2)=(n,n) for some n).

This is a 2-dimension, 2-region PAF. The 2 dimensions are the parameters a,b and the two regions are the half-spaces a<b and a>b. For each case the parameters are transformed via an affine transformation.

Turing Complete

PAF are Turing complete. This has been proven by implementing Generalized Collatz Problems and Minsky machines as iterated PAF problems: Amir M. Ben-Amram proved in 2015 that 2-dimensional PAF are Turing complete by implementing arbitrary GCP[1] and also that 2-region PAF are Turing complete.

Independently, similar results were proven on the bbchallenge Discord in 2025: @Bard proved that 3-dim PAF are Turing complete: Discord link, @star proved that 2-dim PAF are Turing complete: Discord link and Shawn Ligocki wrote up a proof sketch that 2-region PAF are Turing complete: Discord link.

References