Fix ASI for Python in Set Theory

def p ():
 w = set()
 N = [w]
 i = [w]
 p = [w]
 x = [i, p]
 o = 0
 for o in range(len(N)):
  w = set(w)
  N = N.append(w)
  i = i.append(w)
  o = o + 1
  return N
  if o == float('inf'):
   p = i.append(i)
 k = N.index(float('inf')) is x in x.union(2 >= N) | all(i) in N(x.index(i) >= x.index(p))
 return k
 global X
 X = 0  
 while X <= 2:
  X = X + 1
  any(k) in X(p(k) is 0) or all(k) in X(p(k) is 1)
while True:
 while i < 126:
   i= i + 1
   o = chr(i)
   p ()
   v = p()
   if v == 1:
    q = q + o
   elif v == 0:
    q = q
 if q == q + "":
print (q)

The equations for this can be found on the first page of this article

It’s kind of a mess, but i feel it’s worth my time.

So without further ado, why won’t this code work?

can you explain what you want your code to do instead of giving an article to read?

I can but it’d take me a while


Here X is a number

Here you are using X as a function.

A number is not a function.

Between the terse variable names and the lack of comments, I am not sure what you want this code to do. It’s really unreasonable to ask people to decipher a research paper and divine the intent of your code from that paper. I could, but I don’t have the time, and most people here don’t have advanced degrees in Math or CS.

1 Like

X is supposed to limit recursion…

It can’t be both a single number and a recursive function.


What do you actually understand about programming? I think you may need to back way up and learn some basics. Python looks friendly, but you can’t quite write equations directly from a research paper and get it to run.

You’re basically saying ‘Ok, let’s use a car instead of a motorcyle or an airplane. Can I also use the car as a boat?’

A symbol can only be one type of thing. In this case, X could be a number OR a function OR an object, but not all three in the same scope.

X is a for loop

You’d already pointed that out

I was wondering if you could point out all he problems on the program regardless of whether or not it’s programming related or set theory related

I’m knowledgeable but I’m spacy…

Your code makes no sense. Your questions do not make sense. Based on the questions you are asking, you do not seem to know the difference between a variable, a function, and a loop. I don’t know what you are trying to do, and as we said before, I’m not going to read the entire paper to try to figure out your code.

1 Like

The first two equations on the article are all that in using (for now)
I can do it alone
Just thought I’d share
I’ll wait

You’ll wait for what?

Those ‘first two equations’ don’t seem to actually correlate to your code.

First you complain about Python not being an exact representation of the equations involved, then you say the correlation isn’t good enough. I’m through. Please stop spamming my page.

Here you have defined p as a function.

Here you have redefined p as an array holding a single set.

Here you have redefined w as as set containing itself.

Here you have said that you wish to loop over the length of N

But here you keep increasing the length of N

Here you have a return statement which will halt your function and prevent the rest of the code from running.

This seems to be saying that you intend to take the length of N out to infinity, which is not possible.


This is treating X as a number.

This is treating X as a function.

Here you have declared q as a string.

And here you’re making the character codes Vertical tab through Tilde? Why?


When won’t a string be equal to itself with nothing added?

This is not a sensible representation of the two equations that are in your linked paper, even if you could actually just write equations straight from a paper as Python code.

So, you seem to lack fundamental knowledge about how to use Python and I recommend you learn the basics of how to write Python before you try to make programs to explore set theory.

There just isn’t a sensible way to represent an infinite set in Python, let alone test “every function p” against an infinite set in Python.

1 Like

Long story short I accidentally use multiple Instances of the same variable

I’ll fix that and we’ll see how far we are

I mean actually not sure half of those are problems

Like I said I need to wait before I have proper explanations

Your problems are deeper.

  1. You can’t represent infinite sets in Python

  2. You can’t test an infinite set against all possible two valued functions in Python

  3. You don’t seem to know how to use fundamental control structures in Python

Python just doesn’t work the way you are attempting to use it.

You could use Python to verify that a specific finite set meets the omniscience principle for a specific two valued function. But that is disregarded as a trivial case in Escardo’s paper (understandably so).

Actually for loops do the entire thing at once and when referenced infinity jump directly to the infinite recursion

No. For loops do not ‘do the entire thing at once’. Loops repeat their entire body for every value in the control set

for i in range(10):
    print("i: " + str(i))

Infinite recursion is a separate thing. Infinite recursion leads to a stack overflow.

Python won’t automatically sum infinite series for you, if that’s what you are thinking of. You may get sympy to compute the sum of some infinite series.

Well let’s just say it were possible
How do I count the number of sets within sets for I

The returns I will do if needed

And x I’m sure is sound


Understood that N is not a function either