Defining Logic Algebraically, Math Functions & Integers

82 Views Asked by At

Introduction

I wanted to define some functions algebraically to be used as "logical conditions" that would be assigned to a term $t$ to "control" its value.

Or in some other words, I wanted to define logical operations in a algebraic way to be used with integers. Note, that I'm not trying to redefine logic operators. (Which is actually very easy to do in a similar way I defined my functions)

To be able to do it in a simple way, I considered using the definition: $0^0= 1$
(I know that "$0^0$ is mostly undefined, but sometimes defined as $1$")

I came up with $3$ functions to check the specific property of a given integer $n$


$(1)$ $d^x_n$ "Is Divisible", $d^x_n:= 0^{(n)mod(x)}$

This checks if a number $n$ is divisible by $x$ by either being $1$ or $0$

For example, $d^3_{10}=0$ since $10$ isn't divisible by $3$


$(2)$ $p_n$ "Is Positive", $p_n := 0^{|n|-n}$

This checks if a number $n$ is positive or not, saying it by being either $1$ or $0$

Note; this also outputs $0$ as positive.


$(3)$ $l^n_{a,b}$ "Is Located", $(3)$ $l^n_{a,b} := 0^{|(n-a)...(n-b)|}$

This checks if a number $n$ is located within the interval $[a,b]$ or not.
The $(n-a)\dots(n-b)$ can be written using the product notation like $\prod ^b _{x=a}(n-x)$
The absolute value is there to prevent negative powers of $0$, since we don't want do divide by zero.

For Example, if we insert $n$ from $1$ to $7$ into for example $l^n_{2,5}$, We will get the following results: $0,1,1,1,1,0,0$ Telling us which $n$s were in the interval $[2,5]$

We can also use this one to check if a integer $n_1$ is less, equal or greater than another integer $n_2$ with a help of "Is Not".

EDIT: This function can be written in a better way as proposed by Dhruv, but instead of using his direct definition, we can write a new function out of it and redefine the "Is Located" with it;

$(4)$ $g_{n,x}$"Is greater than or equal", $g_{n,x} := 0^{|(n-a)|-n+a}$

$(3^*)$ $l^n_{a,b}$ "Is Located", $(3)$ $l^n_{a,b} := g_{n,a}\cdot g_{b,n}$


$(*)$ We can use the "Is Not$\dots$" on any of the functions by writing $(1-f)$ to reverse ones with zeroes and zeroes with ones.
We can also negate (reverse) functions by writing $0^f$

$(**)$ We can use "Is$\dots$ And$\dots$" by multiplying functions with each other.

$(***)$ We can use "Is$\dots$ Or$\dots$" by using $1-0^k$ to connect the functions with the operator "Or", where $k$ is the sum of functions we want to connect.



Now these functions $f$ can be used with a term $t$ to either make it $=0$ or itself, $=t$. They can also be used with themselves to check if $n$ satisfies certain conditions.


I'm wondering...

What do you think about this idea? I still haven't figured out if there are real practical uses for these things, other than defining "wild" looking number sequences;

For example: $1,2,8,4,5,38,35,44,71,65,77,113...\dots$
Which is defined using the functions like:

$$n+d^3_n(2n-1)+(1-l^n _{1,5})(\frac{n(n+1)}{2})$$

What I've realized, is that with these functions you can describe any set of numbers even if they are randomly generated, as a valid sequence. This is possible since you can force a value specifically to any position in the sequence using the "Is located" function if needed.


The Question I'm Looking an Answer For

I was wondering if these functions that I defined can be defined algebraically without the use of the $0^0=1$ ? In a way that they would still work the same, and could still work with "And","Or" operators in some way?

Note, to feel free to ask for any clarifications on any part of this topic if its not clear enough to you of what I meant.