Skip to main content

Universality witnesses for elementary functions over the EML routing tree.

Project description

eml-witness — ARCHIVED

🗄 This package is archived as of 2026-04-25 (E-129 consolidation).

The functionality has been folded into the main monogate package as of monogate 2.4.0+. New users should install:

pip install monogate[witness]

and use:

from monogate.witness import universality_witness
# or, equivalently (via lazy alias on the package root):
from monogate import universality_witness

The standalone eml-witness PyPI / GitHub package is frozen at 0.2.0 and will receive no further updates. Existing installs continue to work, but please migrate to monogate[witness] for ongoing improvements.

See monogate's CHANGELOG entry for 2.4.0 for details.


eml-witness (historical)

Universality witnesses for elementary functions over the EML routing tree. A witness is a finite, structured certificate that an expression admits an EML routing tree — composed of the expression's Pfaffian profile, its closest registry match (if any), and a rewrite path to a lower-cost equivalent (if one exists).

from eml_witness import universality_witness

w = universality_witness("1/(1+exp(-x))")
print(w.profile.predicted_depth)       # 2
print(w.identified.name)               # 'sigmoid (canonical)'
print(w.verified_in_lean)              # False (until Lean lands)

Serialise to JSON:

from eml_witness import witness_to_dict
import json
print(json.dumps(witness_to_dict(w), indent=2))

Lean integration

verified_in_lean defaults to False and is the link to the formal half of the universality story. It will flip to True once EML_Universality.lean lands in the monogate-lean repository AND the user has personally verified the file via the VS Code lean4 extension (per the project's feedback_lean_writing_protocol_2026_04_25 rule).

When verified, the upstream consumer can patch the witness post-construction:

w = universality_witness("sin(x)")
w_verified = dataclasses.replace(
    w,
    verified_in_lean=True,
    lean_url="https://github.com/almaguer1986/monogate-lean/blob/main/MonogateEML/Universality.lean",
)

Why a separate package?

The witness API composes three other packages:

Provided by Used for
eml-cost profile (analyze + fingerprint + fingerprint_axes)
eml-discover identification
eml-rewrite canonical path + best-rewrite walk

Putting it as a leaf-level package keeps the dependency story clean: the eml-* substrate stays unchanged, and downstream clients (eml-explore, eml-jupyter, eml-vscode, eml-discover-server) can pull witness-shaped data through one entry point.

Status

Beta. v0.1.0. Patent pending.

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

eml_witness-0.2.1.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eml_witness-0.2.1-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file eml_witness-0.2.1.tar.gz.

File metadata

  • Download URL: eml_witness-0.2.1.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for eml_witness-0.2.1.tar.gz
Algorithm Hash digest
SHA256 4602b972bc59d0031513b17b7a0c0f964303297479cf70e22b9634c9ab64f8f8
MD5 6e84ba9b37deac975b746ed84f0f1d51
BLAKE2b-256 50e9e8691d9f5f6724f06e6d1f5b1d58338c42443a90600f3e9da6069df0fd28

See more details on using hashes here.

File details

Details for the file eml_witness-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: eml_witness-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for eml_witness-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 756851f42092a82914b056ad56cc1447eb9eabc39b68f632d1f3d17eded4c04a
MD5 a9eefccfd7e29fa310b1dd9dca5dd14d
BLAKE2b-256 6f262b801778d4e8a8705822236adaa400139bbe1c4bf01484dee24effdd24c4

See more details on using hashes here.

Supported by

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