Skip to main content

(ZFC) set-theoretic definition of natural numbers.

Project description

ZFC: set-theoretic definition of natural numbers in Python

build lint coverage

pypi support-version license commit

Installation

pip install pyZFC

Introduction and examples

NaturalNumber is the class of natural numbers defined as von Neumann ordinals in the ZFC set theory.

0 is defined as the empty set {}, and the rest of the natural numbers are defined recursively as n + 1 = n ∪ {n}, i.e.,

0 = {},
1 = {0},
2 = {0, 1},
3 = {0, 1, 2},
...

Following the definition, you can do all kinds of set operations on natural numbers, e.g., checking whether a NaturalNumber contains another.

>>> from zfc import NaturalNumber

>>> NaturalNumber(1) in NaturalNumber(2)
True

>>> NaturalNumber(1) & NaturalNumber(2)
1  # the intersection of 1={0} and 2={0,1} is {0}, which is exactly 1.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyZFC-0.2.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

pyZFC-0.2.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file pyZFC-0.2.0.tar.gz.

File metadata

  • Download URL: pyZFC-0.2.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pyZFC-0.2.0.tar.gz
Algorithm Hash digest
SHA256 26664b32643f681393c595062d69919e8d2ef5de55cc68b4a69eeddf30f0147e
MD5 dfd2536bbd1d564d0da86d8b6c609995
BLAKE2b-256 5ee3ed3419b75adacde5557daa2960f0e1a6121e4760d73d5a1319b8861c8545

See more details on using hashes here.

File details

Details for the file pyZFC-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pyZFC-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pyZFC-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3663de07afbd0c67baa5c1f807c51f98830b9ddf6b694de1521b7f58c1220eca
MD5 3fbd1fffe8a796abaa47e7b8cbd0b5e4
BLAKE2b-256 5808036477e81b7a1b8012b8b2c153ea357e1028a63fede0b9e08380a7be7ffe

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page