hcju/proofwikiqa huggingface dataset:
We note that: :$n = m \iff \size {n - m} = 0$ :$n \ne m \iff \size {n - m} > 0$ So it can be seen that the characteristic function of $\operatorname{eq}$ is given by: :$\map {\chi_{\operatorname {eq} } } {n, m} = \overline {\map \sgn {\map {\operatorname {adf} } {n, m} } }$. So $\map {\chi_{\operatorname {eq} } } {n, m}$ is defined by substitution from: :the primitive recursive function $\overline \sgn$ :the primitive recursive function $\operatorname {adf}$. Thus $\chi_{\operatorname {eq} }$ is primitive recursive. Hence the result. {{qed}} Category:Primitive Recursive Functions 3mhxju2w14zy60wrzqxyz4rmrvauwcf
Let $p$ be prime. Let $G$ be a finite group such that $\order G = k p^n$ where $p \nmid k$. By definition, a Sylow $p$-subgroup $H$ of $G$ is a subgroup of $G$ of order $p^n$. By Lagrange's Theorem, the index of $H$ in $G$ is given by: :$\index G H = \dfrac {\order G} {\order H}$ So in this case: :$\index G H = \dfrac {k p^n} {p^n} = k$ As $p \nmid k$ it follows from Prime not Divisor implies Coprime that $k \perp p$. The result follows from the definition of Hall subgroup. {{qed}} Category:Sylow p-Subgroups Category:Hall Subgroups m6tcippqglz4o46bqw2svf79j7noq7g
By hypothesis, the characteristic functions $\chi_{\RR_1}, \chi_{\RR_2}$ of $\RR_1$ and $\RR_2$ are primitive recursive. Then we have that the characteristic functions of $\TT, \UU, \VV$ are given by: :$\chi_\TT = \map {\overline \sgn} {\chi_{\RR_1} }$ :$\chi_\UU = \chi_{\RR_1} \times \chi_{\RR_2}$ :$\chi_\VV = \map {\overline \sgn} {\chi_{\RR_1} + \chi_{\RR_2} }$ Compare Complement of Primitive Recursive Set, Intersection of Primitive Recursive Sets and Union of Primitive Recursive Sets. Hence the result. {{qed}} Category:Primitive Recursive Functions rcvbteaj8kbg1m207heg755ubhc6ssg
We note that: : $n < m \iff m \mathop{\dot -} n > 0$ : $n \ge m \iff m \mathop{\dot -} n = 0$ So it can be seen that the characteristic function of $<$ is given by: :$\chi_< \left({n, m}\right) = \operatorname{sgn} \left({m \mathop{\dot -} n}\right)$ So $\chi_{<}$ is defined by substitution from: : the primitive recursive function $\operatorname{sgn}$ : the primitive recursive function $\dot -$ Thus $\chi_<$ is primitive recursive. So $<$ is a primitive recursive relation. Next we see that $n \le m \iff n < m \lor n = m$ from the definition of strictly precedes. From Equality Relation is Primitive Recursive, we have that $=$ is primitive recursive. From above, we have that $<$ is primitive recursive. Thus $\le$ is primitive recursive from Set Operations on Primitive Recursive Relations. We could use the same reasoning for $>$ and $\ge$ but there's a different approach. Note that $n \le m \iff n \not > m$, and so $>$ is primitive recursive from Set Operations on Primitive Recursive Relations. Finally the same applies to $\ge$. Hence the result. {{qed}} Category:Primitive Recursive Functions j4jqu1qfaeq6n6rjpbyvsxw36m8yess
We have that: :$\forall j: 1 \le j \le k: n_{\sigma \left({j}\right)} = \operatorname{pr}^k_{\sigma \left({j}\right)}$. Thus $h$ is obtained by substitution from $f$ and the projection functions $\operatorname{pr}^k_{\sigma \left({j}\right)}$. The result follows. {{qed}} It follows that if a function $h$ can be obtained from known primitive recursive functions by primitive recursion where a variable other than the last one is taken as the recursion variable, then $h$ is primitive recursive. Category:Primitive Recursive Functions pxm8bkuciiztzv4ivz1shvcb1041jz0
We have: {{begin-eqn}}      {{eqn | l = \map f {n_1, n_2, \ldots, n_l}       | r = \map {g_1} {n_1, n_2, \ldots, n_l} \times \map {\chi_{\mathcal R_1} } {n_1, n_2, \ldots, n_l}       | c =  }} {{eqn | o =        | ro= +       | r = \map {g_2} {n_1, n_2, \ldots, n_l} \times \map {\chi_{\mathcal R_2} } {n_1, n_2, \ldots, n_l}       | c =  }} {{eqn | o =        | ro= +       | r = \cdots       | c =  }} {{eqn | o =        | ro= +       | r = \map {g_k} {n_1, n_2, \ldots, n_l} \times \map {\chi_{\mathcal R_k} } {n_1, n_2, \ldots, n_l}       | c =  }} {{end-eqn}} because if $\tuple {n_1, n_2, \ldots, n_l} \in \N^k$, there is a unique $r$ such that $\map {\mathcal R_r} {n_1, n_2, \ldots, n_l}$. Then $\map {\chi_{\mathcal R_r} } {n_1, n_2, \ldots, n_l} = 1$ and $\map {\chi_{\mathcal R_s} } {n_1, n_2, \ldots, n_l} = 0$ for $s \ne r$. Then the value of the {{RHS}} is $\map {g_r} {n_1, n_2, \ldots, n_l}$ as required. Since $\mathcal R_1, \mathcal R_2, \ldots, \mathcal R_k$ are primitive recursive, the functions $\chi_{\mathcal R_1}, \chi_{\mathcal R_2}, \ldots, \chi_{\mathcal R_k}$ are primitive recursive as well. Hence $f$ is obtained by substitution from: :the primitive recursive function $\operatorname{add}$ :the primitive recursive functions $g_j$ :the primitive recursive functions $\chi_{\mathcal R_j}$. Hence the result. {{Qed}} === Proof of Corollary === Immediate from the main proof and Set Operations on Primitive Recursive Relations. {{qed}} Category:Primitive Recursive Functions 0o99l3ecimzdexg51bsckelv6epgk5z
From the definition of the factorial, we have that: :$\operatorname{fac} \left({n}\right) = \begin{cases} 1 & : n = 0 \\ \operatorname{mult} \left({n, \operatorname{fac} \left({n - 1}\right)}\right) & : n > 0 \end{cases}$ Thus $\operatorname{fac}$ is obtained by primitive recursion from the constant $1$ and the primitive recursive function $\operatorname{mult}$. Hence $\operatorname{fac}$ is primitive recursive. {{qed}} Category:Primitive Recursive Functions hsvytfvlncsrbxuwe7stbguh1m2jp0s
Since $Y$ is countable, there exists an injection $g: Y \to \N$. From Composite of Injections is Injection, $g \circ f: X \to \N$ is also an injection. That is, $X$ is countable. {{qed}} Category:Injections Category:Countable Sets s54rmrwnmbz2900fs883itl41t5hk5a
Each basic URM instruction is of one of the following forms: {| border="1" |- | <tt>Zero</tt>  | $Z \left({n}\right)$ |- | <tt>Successor</tt>  | $S \left({n}\right)$ |- | <tt>Copy</tt>  | $C \left({m, n}\right)$ |- | <tt>Jump</tt>  | $J \left({m, n, q}\right)$ |} Let $\Bbb I$ be the set of all basic URM instructions. We define the mapping $\beta: \Bbb I \to \N$ as follows: * $\beta \left({Z \left({n}\right)}\right) = 6 n - 3$ * $\beta \left({S \left({n}\right)}\right) = 6 n$ * $\beta \left({C \left({m, n}\right)}\right) = 2^m 3^n + 1$ * $\beta \left({J \left({m, n, q}\right)}\right) = 2^m 3^n 5^q + 2$ We note that: * $\beta \left({Z \left({n}\right)}\right) \equiv 3 \pmod 6$ * $\beta \left({S \left({n}\right)}\right) \equiv 0 \pmod 6$ * $\beta \left({C \left({m, n}\right)}\right) \equiv 1 \pmod 3$ * $\beta \left({J \left({m, n, q}\right)}\right) \equiv 2 \pmod 3$ So, if $\beta \left({I_1}\right) = \beta \left({I_2}\right)$, then both instructions must be of the same type. Hence it follows from the Fundamental Theorem of Arithmetic that $\beta$ is uniquely specified for any given basic URM instruction. Thus $\beta$ is an injection. {{qed}}
We can immediately see that $\Bbb I$ is infinite as, for example, $\phi: \N \to \Bbb I$ defined as: :$\phi \left({n}\right) = Z \left({n}\right)$ is definitely injective. From Unique Code for URM Instruction, we see that $\beta: \Bbb I \to \N$ is also an injection. The result follows from Domain of Injection to Countable Set is Countable. {{qed}} Category:URM Programs Category:Countable Sets n69gjs30q6i5j68nxtq7ihj5mlfxb16
We can immediately see that $\mathbf P$ is infinite as the number of URM instructions is infinite. From Unique Code for URM Program, we see that $\gamma: \mathbf P \to \N$ is also an injection. The result follows from Domain of Injection to Countable Set is Countable. {{qed}} Category:URM Programs Category:Countable Sets tf5zjy0plb8azcrkkhzbnumrur7l5sb
Let $\mathbf P$ be the set of all URM programs. Let $P \in \mathbf P$ be a URM program with $k$ basic instructions: {| |- ! align="right" | Line !! ! align="left" | Command !! |- | align="right" | $1$ || | align="left" | $I_1$ || |- | align="right" | $2$ || | align="left" | $I_2$ || |- | align="right" | $\vdots$ || | align="left" | $\vdots$ || |- | align="right" | $k$ || | align="left" | $I_k$ || |} We define the mapping $\gamma: \mathbf P \to \N$ as follows: :$\displaystyle \gamma \left({P}\right) = \prod_{i=1}^k p_i^{\beta \left({I_i}\right)}$ where: * $p_i$ is the $i$th prime number; * $\beta \left({I_i}\right)$ is the unique code for instruction $i$. Hence it follows from the Fundamental Theorem of Arithmetic that $\gamma$ is uniquely specified for any given URM program. Thus $\gamma$ is an injection. {{qed}} For a given $P$, the number $\gamma \left({P}\right)$ is referred to as the '''code number of $P$'''.
Let $\mathbf U$ be the set of all URM computable functions. For each $f \in \mathbf U$, let $P_f$ be a URM program which computes $f$. Such a program is very probably not unique, so in order to be definite about it, we can pick $P_f$ to be the URM program with the smallest code $\gamma \left({P_f}\right)$. This is possible from the Well-Ordering Principle. Let us define the function $h: \mathbf U \to \N$ as: :$h \left({f}\right) = \gamma \left({P_f}\right)$ Since the same URM program can not compute two different functions of $1$ variable, it can be seen that $h$ is injective. The result follows from Domain of Injection to Countable Set is Countable. {{qed}} Category:URM Programs Category:Countable Sets ep1nq4tsj6obs9kfxfnz1ms7j0mzu5u
Let $\Bbb F$ be the set of all functions from $\N$ to $\N$. Clearly $\Bbb F$ is infinite because it contains for each $k \in \N$ the constant function $f_k: \N \to \N: \map {f_k} n = k$ and these are all different and (trivially) countably infinite in number. Let $\Phi: \N \to \Bbb F$ be a function. For each $n \in \N$ let $f_n: \N \to \N$ be the function $\map \Phi n$. Let us define $g: \N \to \N$ by: :$\map g n = \map {f_n} n + 1$ Then $g \in \Bbb F$, but $\forall n \in \N$, $\map g n \ne \map {f_n} n$ and so $g \ne f_n$. Since $g$ is an element of $\Bbb F$ which is different from all the values taken by $\Phi$, it follows that $\Phi$ is not a surjection and hence not a bijection. Thus no bijection exists between $\Bbb F$ and $\N$ and so $\Bbb F$ is not equivalent to $\N$. Thus from Countably Infinite Iff Equivalent to Natural Numbers, $\Bbb F$ is uncountable. {{qed}} Category:Mapping Theory Category:Uncountable Sets jhoc6t2rpej55z9c6nn52t8wuoy9r46
All primitive recursive functions are URM computable. The set of $\mathbf U$ of URM programs is countably infinite. The set of $\Bbb F$ of natural number functions is uncountably infinite. Hence there is no surjection from $\mathbf U \to \Bbb F$. Hence $\mathbf U \subsetneq \Bbb F$. Hence $\exists f \in \Bbb F: f \notin \mathbf U$. {{qed}} Category:Primitive Recursive Functions 0urfc305jilu8erji55syap7v41nfft
The function $g$ satisfies: * $g \left({n_1, n_2, \ldots, n_k, 0}\right) = 0$ * $g \left({n_1, n_2, \ldots, n_k, z+1}\right) = g \left({n_1, n_2, \ldots, n_k, z}\right) + f \left({n_1, n_2, \ldots, n_k, z + 1}\right)$. Hence $g$ is defined by primitive recursion from: * the primitive recursive function $\operatorname{add}$ * $f$, which is primitive recursive * and constants, which are primitive recursive. Hence the result. {{Qed}}
The function $g$ satisfies: * $g \left({n_1, n_2, \ldots, n_k, z}\right) = 0$ * $g \left({n_1, n_2, \ldots, n_k, z+1}\right) = g \left({n_1, n_2, \ldots, n_k, z}\right) \times f \left({n_1, n_2, \ldots, n_k, z + 1}\right)$ Hence $g$ is defined by primitive recursion from: * the primitive recursive function $\operatorname{mult}$ * $f$, which is primitive recursive * and constants, which are primitive recursive. Hence the result. {{Qed}}
We note that $m \divides n \iff n = q m$ where $q \in \Z$. So we see that $m \divides n \iff \map \rem {n, m} = 0$ (see Remainder is Primitive Recursive). Thus we define the function $\operatorname{div}: \N^2 \to \N$ as: :$\map {\operatorname {div} } {n, m} = \map {\chi_{\operatorname {eq} } } {\map \rem {n, m}, 0}$ where $\map {\chi_{\operatorname {eq} } } {n, m}$ denotes the characteristic function of the equality relation. So we have: :$\map {\operatorname {div} } {n, y} = \begin{cases} 1 & : y \divides n \\ 0 & : y \nmid n \end{cases}$ So $\map {\operatorname {div} } {n, m}$ is defined by substitution from: :the primitive recursive function $\rem$ :the primitive recursive relation $\operatorname {eq}$ :the constants $1$ and $0$. Thus $\operatorname {div}$ is primitive recursive. Hence the result. {{qed}} Category:Primitive Recursive Functions 8wsr1duvmpkzioguxnb1iq0ghwdqwlv
The divisor counting function $\tau: \N \to \N$ is defined as: :$\displaystyle \map \tau n = \sum_{d \mathop \divides n} 1$ where $\displaystyle \sum_{d \mathop \divides n}$ is the sum over all divisors of $n$. Thus we can define $\map \tau n$ as: :$\displaystyle \map \tau n = \sum_{y \mathop = 1}^n \map {\operatorname {div} } {n, y}$ where :$\map {\operatorname {div} } {n, y} = \begin{cases} 1 & : y \divides n \\ 0 & : y \nmid n \end{cases}$ Hence $\tau$ is defined by substitution from: :the primitive recursive function $\operatorname {div}$ :the primitive recursive bounded summation $\displaystyle \sum_{y \mathop = 1}^n$. Hence the result. {{qed}} Category:Primitive Recursive Functions Category:Tau Function 55a5ce50wppg7is4xlyy550vl88uu34
A prime number is defined as an element of $\N$ with '''exactly two''' positive divisors. So, we have that $n > 0$ is prime {{iff}} $\map \tau n = 2$, where $\tau: \N \to \N$ is the divisor counting function. Thus we can define the characteristic function of the set of prime numbers $\Bbb P$ as: :$\forall n > 0: \map {\chi_\Bbb P} n := \map {\chi_{\operatorname {eq} } } {\map \tau n, 2}$ Now we let $g: \N^2 \to \N$ be the function given by: :$\displaystyle \map g {n, z} = \begin{cases} 0 & : z = 0 \\ \displaystyle \sum_{y \mathop = 1}^z \map {\operatorname {div} } {n, y} & : z > 0 \end{cases}$ As: :$\operatorname {div}$ is primitive recursive :$\displaystyle \sum_{y \mathop = 1}^z$ is primitive recursive it follows that $g$ is primitive recursive. Then for $n > 0$: :$\displaystyle \map g {n, n} = \sum_{y \mathop = 1}^n \map {\operatorname {div} } {n, y} = \map \tau n$ and from Divisor Counting Function is Primitive Recursive we have that $g$ is primitive recursive. Then let $h: \N \to \N$ be the function defined as: :$\map h n = \map g {n, n}$ which is also primitive recursive. So we have, for all $n \in \N$: :$\map {\chi_\Bbb P} n = \map {\chi_{\operatorname {eq} } } {\map h n, 2}$ Hence the result. {{qed}} Category:Primitive Recursive Functions k1a4wt3d0sgg3ejb08p2yslykgh1m52
We can define $p$ recursively by: :$p \left({n + 1}\right) = \text{the smallest } y \in \N \text { such that } y \text { is prime and } p \left({n}\right) \le y$ Hence we can express it as: :$p \left({n + 1}\right) = \mu y \left({\chi_\Bbb P \left({y}\right) = 1 \land p \left({n}\right) \le y}\right)$ where: * $\chi_\Bbb P \left({y}\right)$ is the characteristic function of the set of prime numbers $\Bbb P$ * $\mu y \left({\mathcal R}\right)$ means '''the smallest $y \in \N$ such that the relation $\mathcal R$ holds'''. {{questionable|Sure about the less-than-or equal-to at the end of those expressions? Surely it should be less-than? See talk page.}} Now consider the relation $\mathcal S$ given by: :$\mathcal S \left({m, y}\right) \iff \chi_\Bbb P \left({y}\right) = 1$. We have a reason for making $\mathcal S$ a binary relation, even though $m$ is not actually invoked in its definition. Then we have: :$\chi_\mathcal S \left({m, y}\right) = \chi_{\operatorname{eq}} \left({\chi_\Bbb P \left({y}\right), 1}\right)$. So $\chi_\mathcal S$ is primitive recursive as it is obtained by substitution from: * the primitive recursive function $\chi_{\operatorname{eq}}$ * the primitive recursive function $\chi_\Bbb P$. Then we have that $<$ is primitive recursive. So we define the relation $\mathcal R$ by: :$\mathcal R \left({m, y}\right) \iff \mathcal S \left({m, y}\right) \land m < y \iff \chi_\Bbb P \left({y}\right) = 1 \land m < y$. This is primitive recursive from the above and Set Operations on Primitive Recursive Relations. Now let us define the function $g: \N^2 \to \N$ as: :$g \left({m, z}\right) = \mu y \le z \left({\chi_\Bbb P \left({y}\right) = 1 \land m < y}\right)$ which is primitive recursive by Bounded Minimization is Primitive Recursive. We note that $g \left({p \left({n}\right), z}\right) = p \left({n + 1}\right)$ as long as $p \left({n + 1}\right) \le z$. Next, let $h: \N \to \N$ be defined as $h \left({n}\right) = \exp \left({2, \exp \left({2, n}\right)}\right)$. Then $h$ is primitive recursive since it is obtained by substitution from: * the primitive recursive function $\exp$; * the constant $2$. From Upper Bounds for Prime Numbers, we have $p \left({n+1}\right) \le 2^{2^n} = h \left({n}\right)$. It follows that: :$p \left({n+1}\right) = g \left({p \left({n}\right), h \left({n}\right)}\right)$ where $g$ and $h$ are both primitive recursive. So using the definition of $p$ as given above, we have: :$p \left({0}\right) = 1$ :$p \left({n+1}\right) = g \left({p \left({n}\right), h \left({n}\right)}\right)$. So $p$ is defined by primitive recursion from the constant $1$ and the primitive recursive functions $g$ and $h$. {{qed}}
Clearly $\map \len 0 = 0$. For $n > 0$, we have: :$\displaystyle \map \len n = \sum_{y \mathop = 1}^n \map {\operatorname {div} } {n, \map p y}$ where: :$\map {\operatorname {div} } {n, m}$ is defined as: ::$\map {\operatorname {div} } {n, y} = \begin{cases} 1 & : y \divides n \\ 0 & : y \nmid n \end{cases}$ :$\map p y$ is the $y$th prime number. Let $g: \N^2 \to \N$ be the function defined by: :$\displaystyle \map g {n, z} = \begin{cases} 0 & : z = 0 \\ \displaystyle \sum_{y \mathop = 1}^z \map {\operatorname {div} } {n, \map p y} & : z > 0 \end{cases}$ We have that: :$\operatorname{div}$ is primitive recursive :$p: \N \to \N$ is primitive recursive :Bounded Summation is Primitive Recursive. So it follows that $g$ is also primitive recursive. Finally, as $\map \len n = \map g {n, n}$ it follows that $\len$ is primitive recursive. {{qed}} Category:Primitive Recursive Functions b2iqin2w62d35didrb6ccj0hijnve70
Let $p \left({j}\right)$ be the prime enumeration function. For $n \ne 0$ and $j \ne 0$, we see that $\left({n}\right)_j$ is the largest value of $k$ for which $p \left({j}\right)^k$ is a divisor of $n$. Thus $\left({n}\right)_j$ is the ''smallest'' value of $k$ for which $p \left({j}\right)^{k+1}$ is ''not'' a divisor of $n$. We note that if $r \ge n$ and $j \ne 0$, we have $p \left({j}\right)^r \ge 2^r \ge 2^n> n$. Thus $n$ is a (generous) upper bound of $\left({n}\right)_j$. The condition that $p \left({j}\right)^{k+1}$ is not a divisor of $n$ can be expressed as: :$\operatorname{div} \left({n, p \left({j}\right)^{k+1}}\right) = 0$ where: : $\operatorname{div}$ is primitive recursive : The Equality Relation is Primitive Recursive : $p \left({j}\right)$ is primitive recursive : Exponentiation is Primitive Recursive : Addition is Primitive Recursive. So we see that the relation: :$\mathcal R \left({n, j, k}\right) \iff \operatorname{div} \left({n, p \left({j}\right)^{k+1}}\right) = 0$ is primitive recursive. From Bounded Minimization is Primitive Recursive, we also see that: :$\left({n}\right)_j = \begin{cases} \mu k \le n \mathcal R \left({n, j, k}\right) & : n \ne 0 \land j \ne 0 \\ 0 & : \text{otherwise} \end{cases}$ is primitive recursive. The result follows. {{qed}} Category:Primitive Recursive Functions r4rtulcl7hz4vjh4k8lh3amsarwife2
By the definition of a primitive recursive set, it is sufficient to show that the characteristic function $\chi_{\operatorname{Seq}}$ of $\operatorname{Seq}$ is primitive recursive. Let $p: \N \to \N$ be the prime enumeration function. Let $\operatorname{len} \left({n}\right)$ be the length of $n$. We note that $\chi_{\operatorname{Seq}} \left({n}\right) = 1$ iff $p \left({y}\right)$ divides $n$ for $1 \le y \le \operatorname{len} \left({n}\right)$. That is, iff $\operatorname{div} \left({n, p \left({y}\right)}\right) = 1$ for $1 \le y \le \operatorname{len} \left({n}\right)$, where $\operatorname{div}$ is the divisor relation. We then see that $\operatorname{div} \left({n, p \left({y}\right)}\right) = 1$ for $1 \le y \le \operatorname{len} \left({n}\right)$ iff their product equals $1$. So we can define $\chi_{\operatorname{Seq}}$ by: :$\displaystyle \chi_{\operatorname{Seq}} \left({n}\right) = \begin{cases} \prod_{y \mathop = 1}^{\operatorname{len} \left({n}\right)} \operatorname{div} \left({n, p \left({y}\right)}\right) & : n > 1 \\ 0 & : \text{otherwise} \end{cases}$ Then we define $g: \N^2 \to \N$ as: :$\displaystyle g \left({n, z}\right) = \begin{cases} 1 & : z = 0 \\ \prod_{y \mathop = 1}^z \operatorname{div} \left({n, p \left({y}\right)}\right) & : z \ne 0 \end{cases}$ We then apply Bounded Product is Primitive Recursive to the primitive recursive function $\operatorname{div} \left({n, p \left({y}\right)}\right)$, and see that $g$ is primitive recursive. Finally, we have that: :$\chi_{\operatorname{Seq}} \left({n}\right) = \begin{cases} g \left({n, \operatorname{len} \left({n}\right)}\right) & : n > 1 \\ 0 & : \text{otherwise} \end{cases}$ is obtained by substitution from: * the primitive recursive function $\operatorname{len}$ * the primitive recursive function $g$ * the primitive recursive relation $>$ * the constant $1$ So $\chi_{\operatorname{Seq}}$ is primitive recursive. Hence the result. {{qed}} Category:Primitive Recursive Functions d39jvc3slqqjbbrclhx85h9ewrxkazp
A natural number $n$ codes a URM program {{iff}} it codes a sequence of positive integers which are the code numbers of URM instructions. Suppose $n$ codes such a sequence. Then $\operatorname{len} \left({n}\right)$ is the number of terms in this sequence, where $\operatorname{len} \left({n}\right)$ is the length of $n$. Also, for $1 \le j \le \operatorname{len} \left({n}\right)$, $\left({n}\right)_j$ is the exponent of the $j$th prime in the prime decomposition of $n$. So $\left({n}\right)_j$ is the $j$th number in the sequence coded by $n$. So: :$n \in \operatorname{Prog}$ {{iff}} $\chi_{\operatorname{Seq}} \left({n}\right) = 1$ and $\left({n}\right)_j \in \operatorname{Instr}$ for $1 \le j \le \operatorname{len} \left({n}\right)$ where $\chi_{\operatorname{Seq}}$ is the characteristic function of the set of code numbers of finite sequences of positive integers. Now $\left({n}\right)_j \in \operatorname{Instr} \iff \chi_{\operatorname{Instr}} \left({\left({n}\right)_j}\right) = 1$. So $\left({n}\right)_j \in \operatorname{Instr}$ for $1 \le j \le \operatorname{len} \left({n}\right)$ {{iff}} $\chi_{\operatorname{Instr}} \left({\left({n}\right)_j}\right) = 1$ for $1 \le j \le \operatorname{len} \left({n}\right)$. This is the case {{iff}}: :$\displaystyle \prod_{j \mathop = 1}^{\operatorname{len} \left({n}\right)} = 1$ Thus $n \in \operatorname{Prog}$ {{iff}}: :$\displaystyle \chi_{\operatorname{Seq}} \left({n}\right) \times \prod_{j \mathop = 1}^{\operatorname{len} \left({n}\right)} = 1$ Now we define the function $g: \N^2 \to \N$ by: :$\displaystyle g \left({n, z}\right) = \begin{cases} 1 & : z = 0 \\ \displaystyle \prod_{j \mathop = 1}^z \chi_{\operatorname{Instr}} \left({\left({n}\right)_j}\right) & : \text{otherwise} \end{cases}$ We use $g$ to obtain the characteristic function of the set $\operatorname{Prog}$: :$\chi_{\operatorname{Prog}} \left({n}\right) = \chi_{\operatorname{Seq}} \left({n}\right) g \left({n, \operatorname{len} \left({n}\right)}\right)$ (We need to introduce $g$ to ensure $\chi_{\operatorname{Prog}}$ is defined if $\operatorname{len} \left({n}\right) = 0$.) Now we have that: * $\left({n}\right)_j$ is primitive recursive; * $\operatorname{Instr}$ is primitive recursive. So $g$ is therefore primitive recursive, as it is obtained by substitution from these. Therefore $\chi_{\operatorname{Prog}}$ is primitive recursive as it is obtained by substitution from: * the primitive recursive function $\operatorname{mult}$; * the primitive recursive function $\chi_{\operatorname{Seq}}$; * the primitive recursive function $g$; * the primitive recursive function $\operatorname{len}$. Hence $\operatorname{Prog}$ is a primitive recursive set. Category:URM Programs Category:Primitive Recursive Functions cxyyd5ymfd8c25stbprdgvsvniuwh86