Payoff ι and Contract ι represent what an instrument pays, independently of any stochastic model. Market outcomes enter through Scenario ι = ι → ℝ≥0 → ℝ; a stochastic model is a law on that type, and appears only from Pricing/Value.lean onward.
Every other payoff in this library — Models/BlackScholes/Call.lean, Digital.lean, CappedCall.lean — is written inline as a lambda inside the integral that prices it, so the payoff and the model are the same syntactic object. This file separates them, which is what lets Models/BlackScholes/BlackScholes.lean price a capped call by composing two European call values rather than by evaluating a third integral.
Payments at a random date
Contract.pay fixes its date. Contract.payAtHit i A amount pays at the first time the observed underlying i enters the set A (Scenario.hitTime, Mathlib's hittingAfter of the observed path), which is how a payment at a default time is written: the underlying is the default indicator 1{τ ≤ u} and A = [1, ∞). The model-free results below hold for every contract; the integrability theorem of Contracts/Adapted.lean is for Contract.FixedDated ones, since a hitting time of an arbitrary path is not measurable and an unbounded discount factor evaluated at it need not be integrable.
Deliberately absent
Branching contracts (ifThen), currency, and the lifecycle layer (outstanding notional, termination, partial redemption). Each is additive and each waits for the corpus entry that forces it; see docs/specs/2026-08-16-contracts-tower-design.md §2.3.
Main definitions
Scenario ι: a market scenario ι → ℝ≥0 → ℝ, the realized value of each underlying at each time.Payoff ι: payoff formulas as data (constants, observations, add, sub, mul, max, min, indicatorLt, and rpow with an ℝ≥0 exponent); Payoff.eval interprets one against a scenario.Payoff.obsList: the (underlying, date) observations a payoff reads, found syntactically.Contract.obsList: the observations a contract's payoffs read.Scenario.hitTime: the first time the observed underlying i lies in A, as Mathlib's hittingAfter of the observed path.Contract ι: contracts built from zero, pay t amount, payAtHit i A amount, both and scale.Contract.cashflows: the list of (time, amount) cashflows of a contract along a scenario.Contract.FixedDated: the contract contains no payAtHit.Contract.dates: the payment dates of a contract's pay nodes.Contract.pathPV: the present value of a contract along one scenario path, for a discount function D : ℝ≥0 → ℝ.
Main results
Contract.pathPV_both, Contract.pathPV_scale — pathPV is additive over both and homogeneous over scale. These are what Pricing/Value.lean integrates to get linearity of value.Contract.pathPV_const — a constant discount factor comes out of pathPV.Payoff.eval_congr, Contract.cashflows_congr — a payoff, and a fixed-dated contract's cash flows, are the same on two scenarios that agree at the observations they read (Payoff.obsList, Contract.obsList). Pricing/Value.lean lifts this to models that agree almost surely (Contract.value_congr_ae).Contract.pathPV_congr — a fixed-dated contract's present value depends on the scenario only at c.obsList and on the discount factor only at c.dates. Pricing/Value.lean lifts this to models whose observations have one law (Contract.value_eq_of_map_observation_eq).
Source
The layered separation of contract semantics from pricing semantics, and the framing "the contract is not the model", are due to Paul Bilokon, The Contract Is Not the Model: Proof-Carrying Exotic Derivatives and the Economics of Model Risk (working paper, 9 August 2026; Mathematical Finance, Imperial College London), with code at <https://github.com/thalesians/lean_contracts> (Apache-2.0). That paper in turn builds on the compositional contract-DSL of Peyton Jones, Eber and Seward (2000) and the certified-contract work of Bahr, Berthold and Elsman (2015) and Annenkov (2018).
This file takes his separation of the payoff object from the probability law. The type design is ours: a typed underlying index rather than String keys, a single inductive rather than a mutual NumExpr / BoolExpr pair, and ℝ≥0 time matching Filtration ℝ≥0 mΩ.
No code is copied from lean_contracts; every definition and proof here is written for this library. See docs/specs/2026-08-16-contracts-tower-design.md §6 for the full credit line.
References
Tags
contract language, reified payoff, contract DSL, Bilokon, Peyton Jones, payment at default time, MSC 91G20, JEL G13