Talk:Contains everything
Jump to navigation
Jump to search
This is a fairly straightforward Boolean logic, assuming that we're working over something like ZFC or FinSet. The following Python interprets statements and decides in linear time whether they are True or False. The trick is understanding that universal claims of elementhood will always fail, so that there is no point in tracking what's in each set, merely whether the variable has been universally quantified; since there are no other quantifiers, this is just a scope check. Extending this with support for input variables should be straightforward. Corbin (talk) 22:41, 15 November 2025 (UTC)
constFalse = lambda _: False
# the constructors
univ = lambda x, p: lambda c: p(c + [x])
elt = lambda s, t: constFalse if s == t else lambda c: s not in c and t not in c
implies = lambda p, q: lambda c: (not p(c)) or q(c)
# example programs
false = univ("x", elt("x", "x"))
true = univ("x", implies(elt("x", "x"), elt("x", "x")))
# running programs and printing results
print("false", false([]))
print("true", true([]))