Skip to main content

funcprops

funcprops is a SymPy-backed package for global mathematical properties of real, complex, and multivariate functions — including domains, ranges, zeros, monotonicity, convexity, regularity, singularities, extrema, mapping properties, and transformation geometry —while supporting assumptions, parameter-dependent answers, and replayable proof certificates. It combines a conditional function property registry, exact semialgebraic reasoning from the semialgebraic geometry package semialg, transcendental interval analysis, special-function zero geometry, and branch-cut/singularity analysis.

When a result cannot be established by the available symbolic, semialgebraic, theorem-based, or validated numerical methods, funcprops preserves unresolved conditions or returns "unknown" for the result.

Installation

pip install funcprops

The runtime requires Python 3.11+, SymPy 1.14+, mpmath 1.3+, semialg 1.3+ and exprtest 0.1.0+.

Quick start

import sympy as sp
import funcprops as fp

x, y = sp.symbols("x y", real=True)
z = sp.Symbol("z")

fp.domain(sp.sqrt(x - 1), x)
# x >= 1

fp.range(x**2, x, y)
# y >= 0

fp.monotonicity(sp.exp(x), x)
# Monotonicity.STRICTLY_INCREASING

fp.convexity(x**2, x)
# Convexity.STRONGLY_CONVEX

fp.complete_monotonicity(sp.exp(-x), x, domain=sp.Interval(0, sp.oo))
# TruthValue.TRUE

fp.periodicity(sp.sin(2*x) + sp.cos(3*x), x, return_result=True).period
# 2*pi

fp.branch_cuts(sp.log(1 - z), z)
# (z > 1,)

fp.geometry(x**2, x).minimum_exists.exists
# True

fp.jacobian((2*x + y, x - y), (x, y))
# Matrix([[2, 1], [1, -1]])

fp.change_of_variables((2*x + y, x - y), (x, y)).volume_factor
# 3

All root-level property queries use the same public conventions: scalar analysis variables are named variable, multivariate variables are named variables, assumptions= carries symbolic assumptions, and return_result=True requests the detailed result/proof view (without changing the default mathematical answer).

a = sp.symbols("a", real=True)

fp.injective(a*x, x)
# parameter-stratified answer: a != 0 -> true; a = 0 -> false

detail = fp.convexity(x**2, x, return_result=True)
print(fp.explain_result(detail))

To discover supported high-level properties interactively:

fp.properties()
fp.properties(category="mapping")
fp.properties(category="regularity")

Property model

Root-level property queries return exact classifications when the available proof machinery is sufficient. PropertyResult and ConditionalExpression retain parameter strata instead of collapsing unresolved guards into one answer, and PropertyResult.as_piecewise() provides a Piecewise-style view when useful.

Result conventions

Mathematical values are the default. Boolean-style properties use TruthValue.TRUE, TruthValue.FALSE, and TruthValue.UNKNOWN; categorical properties use their corresponding enum with an UNKNOWN member. Parameter dependence is represented explicitly by PropertyResult rather than guessed away.

Detailed results are opt-in (via the option return_result=True) and consistent across the root API:

result = fp.monotonicity(a*x, x, return_result=True)
print(result)
print(fp.explain_result(result))

In notebooks, conditional and detailed results render as compact tables so the mathematical answer is prominent and proof metadata remains secondary.

Real-domain analysis

funcprops owns the public property vocabulary. For semialgebraic functions on semialgebraic real domains it delegates exact domain, range, sign, monotonicity, convexity, smoothness, and mapping problems to semialg, while retaining stronger funcprops certificates when they are already available.

The main real-analysis queries are:

  • domain() and range();
  • sign() and boundedness();
  • monotonicity() and oscillation();
  • convexity() and complete_monotonicity();
  • injective(), surjective(), and bijective();
  • continuous(), differentiability(), smoothness(), and analytic();
  • periodicity(), symmetry(), and homogeneity().

Mixed variable/parameter domains are split by shared stratification layer and analyzed branch by branch. Finite Piecewise expressions use the same effective branch representation, with each property adding only the interface conditions it requires.

Monotonic partitions, inverse solving, and real roots

MonotonicPartition is the shared exact interval representation used by monotonicity, range, injectivity, inverse solving, oscillation, and extrema. Finite partitions retain exact critical points and endpoint behavior; infinite oscillatory partitions retain indexed zero geometry without truncating an infinite sequence.

solve_monotonic_inverse() and certified_monotonic_inverse() reuse those cells to isolate inverse solutions. Real-root isolation is domain-cell aware: poles, logarithmic boundaries, radical boundaries, Piecewise switch points, and other exact exclusions split the problem before interval certificates are constructed. Identically-zero interval cells remain part of the mathematical zero set.

For supported exponential polynomials, exponential_fourier_count() provides a restricted derivative-sequence root counter. Exact endpoint and critical-point signs then certify the number of distinct roots on an interval.

Zero geometry and oscillatory extrema

Special-function zeros are represented symbolically when closed forms are not available. IndexedZero, ZeroOrdering, ZeroInterlacing, and ZeroGeometryCertificate encode support, simplicity, ordering, interlacing, and completeness.

IndexedExtremumValue, ExtremumEnvelope, and indexed-tail inversion extend the same exact representation to infinite extremum families. Supported Airy, Bessel, and classical orthogonal-polynomial families can therefore participate in range, boundedness, and inverse reasoning without numerical truncation.

Singularities, branch cuts, and complex zeros

singularity_analysis() performs condition-aware structural traversal of poles, removable and essential singularities, branch points, branch cuts, definition cuts, and discontinuities. Multivariate loci retain their joint conditions instead of being projected onto an artificial scalar coordinate.

branch_cuts() provides inexpensive structural pullback of principal cuts; boundary-value and jump computations are available under funcprops.branchcuts.

complex_zeros() isolates zeros in finite complex rectangles. It uses exact complex solving when available, otherwise a validated argument-principle contour with structural holomorphy checks, complex-interval boundary enclosures, winding-number counting, and count-preserving rational subdivision. Uncertified numerical winding estimates remain only diagnostic.

Function geometry and attainment

geometry() combines regularity, singularity, convexity, boundary escape, level-boundedness, and structural mode-existence information in one summary. Related focussed queries are:

  • boundary_behavior() for certified limits at unbounded boundaries;
  • level_boundedness() for a compact coercivity classification, with certificates via return_result=True;
  • mode_existence() for compact structural minimum/maximum attainment, with proof metadata via return_result=True.

The attainment machinery is implication-based. Failure to establish continuity, closedness, or level-boundedness yields an unresolved result.

Transformation geometry

For an explicit coordinate map, funcprops can compute and certify:

  • jacobian() — exact Jacobian matrices by default, with derivative certificates via return_result=True;
  • determinant_nonvanishing() — domain-wide nonvanishing of det J;
  • local_invertibility() — inverse-function-theorem certificates;
  • change_of_variables() — the local volume factor Abs(det J);
  • transformation_geometry() — combined transformation summary.

A nonzero Jacobian determinant proves local invertibility, not global injectivity. The API keeps those claims separate so change-of-variables reasoning does not silently overstate a local theorem.

Statistical special functions

The theorem registry includes probability- and statistics-oriented facts for loggamma, digamma/polygamma, incomplete and regularized Gamma/Beta functions, erf/erfc, modified Bessel families, and generalized Marcum Q.

For statistical functions not represented by the supported SymPy release, funcprops provides lightweight symbolic heads:

  • OwenT(h, a);
  • MittagLefflerE(alpha, z) and MittagLefflerE(alpha, beta, z);
  • RegularizedGammaP(a, x) and RegularizedGammaQ(a, x).

These heads are simply symbolic theorem carriers, not replacements for numerical libraries. Parameter-sensitive statements are guarded: outside a certified parameter/domain stratum the property engine returns a conditional or unknown result. Complete-monotonicity support includes elementary exponential kernels, Pollard-type Mittag-Leffler results, and supported Bessel-K regimes.

See Statistical special functions for the current theorem coverage and provenance notes.

Special-function registry and provenance

The conditional registry stores audited special-function metadata and exact parameter guards in deterministic SymPy constructor syntax. Concrete overloads are matched before guards are instantiated, and more-specific rules take precedence over generic ones.

Selected identities and real-variable facts are cross-checked against the NIST Digital Library of Mathematical Functions (DLMF). The machine-readable audit manifest is src/funcprops/data/dlmf_audit.json; see the DLMF audit methodology.

Proof cache and certificate replay

Reusable proof primitives are coordinated through lazy PropertyProofContext objects. Independent bounded caches hold derivatives, natural domains, sign results, endpoint limits, zero geometry, singularity analyses, and monotonic partitions. Cache-key normalization is syntactic and avoids expensive proof work to construct a key.

Proof objects can be "replayed" with verify_certificate() and specialized verifiers. For replay, an undecidable comparison never counts as a successful verification.

Documentation and examples

The canonical examples live in examples/property_examples.py. Documentation specification tests execute those examples and verify that the reference and notebook stay synchronized with the public API.

Development

Contributions – whether they are bug reports, suggestions, or code – are welcome!

Run the source-tree tests with:

PYTHONPATH=src:. pytest

Run the static gates with:

ruff format --check src tests examples tools
ruff check src tests examples tools
python -m compileall -q src tests examples tools

The package keeps exact fast paths ahead of heavier partition, root-isolation, or semialgebraic machinery. Structural refactors should preserve that ordering unless a benchmark and correctness argument justify changing it.

License

funcprops is licensed under the GNU General Public License version 3 only (GPL-3.0-only). See LICENSE.

Metadata

Release files for funcprops 0.3.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 funcprops 0.3.0
File Size Uploaded
funcprops-0.3.0.tar.gz 480.5 kB Details

Built distribution (wheel)

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

Total release size: 968.7 kB

Release files / funcprops-0.3.0.tar.gz

Download URL funcprops-0.3.0.tar.gz
Size 480.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3e2a54c21040595cd1e96daece37dfb5383c9ae180456c8a30becb791ce27890
BLAKE2b-256 checksum
How to use checksums
befa20970364dc22cb92eb6973582eadd1c5f7f63b94b8f7853ffe38f3d35c2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 1, 2026.

Transparency log

Release files / funcprops-0.3.0-py3-none-any.whl

Download URL funcprops-0.3.0-py3-none-any.whl
Size 488.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c5800e0a855c4339dea04d43f3082fc0ac4d990768385c9be97c292b9c885f3a
BLAKE2b-256 checksum
How to use checksums
7b6c4dcbb1b87c533de9ce46fb5596027e0ba2bc626a2e570800841313edb172
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 1, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.0 This release

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