ReductionBounds

reduction_bounds is an experimental Elixir library for deriving symbolic cost bounds for supported Erlang and Elixir functions and checking them in Lean. Relating those bounds to reductions charged by a concrete BEAM runtime remains separate work.

Installation

Use a Mix project with Elixir 1.20 or later in the 1.x series and a compatible Erlang/OTP version. Install Elan, Lean's toolchain manager, and ensure lean and lake are on PATH.

Add the Hex package to deps/0 in your project's mix.exs:

{:reduction_bounds, "~> 0.1.0"}

From your project's root, fetch dependencies and install the exact Lean toolchain required by the resolved Lynx package:

mix deps.get
export ELAN_TOOLCHAIN="$(cat deps/lynx/lean-toolchain)"
elan toolchain install "$ELAN_TOOLCHAIN"
lean --version
lake --version
mix compile

Set ELAN_TOOLCHAIN from that file in each shell used for building or proof checking, unless your project has a matching lean-toolchain file. See toolchain maintenance for Elan and Lynx updates and instructions for working in this repository.

Verify proofs from within the consuming Mix project. See toolchain compatibility for the release check configuration. The 0.1 series is experimental, and future minor releases may change APIs and proof models.

Getting started and Case Studies

Follow Getting Started to install the toolchain, check your first bound, and read the result's proof scope.

The Case Studies provide compiled-source and IEx routes for constants, branches, recursion, list traversal and conditional reversal, integer sizes and contract reuse, CRC/variance kernels, maps, periodic rules, ring buffers, Port and RPC workflows. The examples index links to detailed API guides.

The proof reference explains the checked theorems, assumptions, and reproduction commands. Future directions are in the roadmap.

Limitations

License

Copyright 2026 University of Kitakyushu.

Licensed under the Apache License, Version 2.0. See LICENSE.md.