Skip to main content

TinyLean

Supported Python versions Lines of Python Test codecov

Tiny theorem prover in Python, with syntax like Lean 4.

Tour

An identity function in TinyLean:

def id {T: Type} (a: T): T := a

example := id Type

Inductive data types:

inductive Maybe (A: Type) where
| Nothing
| Just (a: A)
open Maybe

inductive N where
| Z
| S (n: N)
open N

inductive Vec (A: Type) (n: N) where
| Nil (n := Z)
| Cons {m: N} (a: A) (v: Vec A m) (n := S m)
open Vec

The typechecker knows if any case is impossible (i.e. dependent pattern matching):

def v0: Vec N Z := Nil

example :=
  match v0 with
  | Nil => Z
  /- Cons is impossible, leaving it here yields errors. -/

So a bottom type eliminator is trivial via DPM:

inductive Weird (n: N) where
| MkWeird (n := Z)
open Weird

/- Impossible to construct a term for type `Weird (S Z)`. -/
example {A: Type} (x: Weird (S Z)): A := nomatch x

License

MIT

Release files for TinyLean 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for TinyLean 0.7.0
File Size Uploaded
tinylean-0.7.0.tar.gz 21.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for TinyLean 0.7.0
File Interpreter ABI Platform
tinylean-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 45.1 kB

Release files / tinylean-0.7.0.tar.gz

Download URL tinylean-0.7.0.tar.gz
Size 21.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3dd660e625158a927645803cee77c15c3d7ec916f50ce2cec073cf5a58e3299f
BLAKE2b-256 checksum
How to use checksums
b7d26bbe44460a0d9043a863495e1394da4b3787680fd5fa7756d7835c43a1a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 11, 2025.

Transparency log

Release files / tinylean-0.7.0-py3-none-any.whl

Download URL tinylean-0.7.0-py3-none-any.whl
Size 23.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
92b60fa7c9775257423be75865ec3ff95cc2b302852c8256283a2dfdaef0a00f
BLAKE2b-256 checksum
How to use checksums
d3c52f4f815c83be359c0f43a17d821c162733b454896fdf5023627f72c7b94e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 11, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page