MathFin
Map / Positions and markets / MathFin.Contracts.Instruments.Options

Options, as contracts

MathFin.Contracts.Instruments.OptionsMSC 91G20JEL G13 source

The instruments: the European call and put, the cash-or-nothing digital, the forward, the capped call and the power call, each a Contract Unit written in the payoff language of Contracts/Core.lean; the exchange option is a Contract (Fin 2) on two underlyings. Nothing here assumes a model or a pricing measure. What is proved is what the instruments pay, along every scenario. What follows for their values in every model, through the linearity of Contract.value, is in Pricing/Parity.lean, and their prices in a particular model live in that model's file (Models/BlackScholes/BlackScholes.lean).

The capped call is defined by composition, as a long call at K₁ and a short call at K₂; cappedCall_payoff_eq is what earns it the name: for K₁ ≤ K₂ it pays min(max(S − K₁, 0), K₂ − K₁) (MathFin.cappedCall_eq_bull_spread).

Main definitions

  • europeanCallPayoff, europeanPutPayoff — the call's and the put's payoff on their own.
  • europeanCall, europeanPut, digitalCall, forward — the single-maturity instruments.
  • cappedCall — a long europeanCall K₁ T combined with a short europeanCall K₂ T.
  • powerCall — the call on S_T ^ a, the power being the payoff language's rpow node.
  • geomAsianCall — the call on the geometric average of the underlying over n dates, from Payoff.obsProd and rpow at 1/n.
  • upAndIn — the discretely monitored up-and-in knock-in on a payoff f, from the running maximum Payoff.obsMax and indicatorLt.
  • chooser — the chooser option as the static portfolio of a call and a put at the chooser date.
  • exchangeOption — pays max (S¹_T − S²_T) 0.

Main results

  • pathPV_europeanCall_eq_put_add_forward — a call pays a put plus a forward on every path.
  • cappedCall_payoff_eq — for K₁ ≤ K₂, cappedCall K₁ K₂ T pays the capped payoff.
  • eval_upAndInPayoff — the knock-in pays f exactly on the scenarios observed at or above the barrier at a monitoring date.

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).

Compositional contract construction — building an instrument from simpler ones and pricing it by composition — is the core of Bilokon's DSL and of Peyton Jones, Eber and Seward before him; what is added here is that the composition is priced through the library's own closed forms rather than left as a denotational identity.

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

  • P. Bilokon, The Contract Is Not the Model [Bilokon2026]
  • J. C. Hull, Options, Futures, and Other Derivatives [Hull], 12.3

Tags

European option, digital option, capped call, chooser option, power call, exchange option, geometric Asian, barrier option, knock-in, MSC 91G20, JEL G13

Import neighbourhood

Above: what it imports. Below: what imports it.

Corpus entries

mf-contract-capped-call · contracts.json · full statement
Capped Call as a Composed Contract

The composed contract cappedCall K1 K2 T -- a long call at K1 plus a short call at K2 -- really pays min(max(S_T - K1, 0), K2 - K1) in every scenario. This payoff identity is what earns the composed object its name; the contract's Black-Scholes value is a separate theorem, published as mf-contract-capped-call-value.

Declarations 20

defMathFin.Contracts.europeanCallPayoffsource
ℝ → NNReal → Payoff Unit

The European call payoff max (S_T - K) 0, on its own so that every consumer builds against the same term rather than re-spelling it.

defMathFin.Contracts.europeanCallsource
ℝ → NNReal → Contract Unit

The reified European call: pays max (S_T - K) 0 at maturity T.

defMathFin.Contracts.europeanPutPayoffsource
ℝ → NNReal → Payoff Unit

The European put payoff max (K - S_T) 0. As a family in T it is the exercise right of the American put (Market.americanPrice).

defMathFin.Contracts.europeanPutsource
ℝ → NNReal → Contract Unit

The reified European put: pays max (K - S_T) 0 at maturity T.

defMathFin.Contracts.digitalCallsource
ℝ → NNReal → Contract Unit

The reified cash-or-nothing digital call: pays 1 at maturity T iff S_T > K.

defMathFin.Contracts.powerCallsource
ℕ → ℝ → NNReal → Contract Unit

The reified power call: pays max (S_T ^ a - K) 0 at maturity T, the power being the payoff language's rpow node at the natural exponent a.

used by 1: value_powerCall
defMathFin.Contracts.Payoff.obsProdsource
{ι : Type u_2} → ι → List NNReal → Payoff ι

The product of the observations of underlying i at the dates ts, built from Payoff.mul.

theoremMathFin.Contracts.Payoff.eval_obsProdsource
∀ {ι : Type u_2} (s : Scenario ι) (i : ι) (ts : List NNReal), Payoff.eval s (Payoff.obsProd i ts) = (List.map (s i) ts).prod

Evaluating Payoff.obsProd is the product of the observed values.

defMathFin.Contracts.Payoff.obsMaxsource
{ι : Type u_2} → ι → NNReal → List NNReal → Payoff ι

The running maximum of the observations of underlying i at the dates t :: ts, built from Payoff.max.

theoremMathFin.Contracts.Payoff.le_eval_obsMax_iffsource
∀ {ι : Type u_2} (sc : Scenario ι) (i : ι) (t : NNReal) (ts : List NNReal) (B : ℝ), B ≤ Payoff.eval sc (Payoff.obsMax i t ts) ↔ ∃ τ ∈ t :: ts, B ≤ sc i τ

The running maximum reaches a level exactly when one of the observations does.

defMathFin.Contracts.upAndInPayoffsource
{ι : Type u_2} → ℝ → Payoff ι → ι → NNReal → List NNReal → Payoff ι

The payoff of the up-and-in knock-in on f: f when underlying i is observed at or above the barrier B at one of the monitoring dates T :: ts, and 0 otherwise.

defMathFin.Contracts.upAndInsource
{ι : Type u_2} → ℝ → Payoff ι → ι → NNReal → List NNReal → Contract ι

The reified discretely monitored up-and-in knock-in: pays f at T if underlying i has been observed at or above the barrier B at one of the monitoring dates T :: ts.

theoremMathFin.Contracts.eval_upAndInPayoffsource
∀ {ι : Type u_2} (sc : Scenario ι) (B : ℝ) (f : Payoff ι) (i : ι) (T : NNReal) (ts : List NNReal), Payoff.eval sc (upAndInPayoff B f i T ts) = if ∃ τ ∈ T :: ts, B ≤ sc i τ then Payoff.eval sc f else 0

The knock-in pays f on the paths that reach the barrier.

defMathFin.Contracts.geomAsianCallsource
ℝ → NNReal → {n : ℕ} → (Fin n → NNReal) → Contract Unit

The reified geometric-average Asian call over the n averaging dates τ: pays max ((∏ᵢ S_{τᵢ}) ^ (1/n) - K) 0 at maturity T, the geometric average being Payoff.obsProd under the rpow node at the exponent 1/n.

defMathFin.Contracts.choosersource
ℝ → ℝ → NNReal → NNReal → Contract Unit

The reified simple chooser option, by static replication. At the chooser date t₁ ≤ T the holder takes the more valuable of the call and the put, max (C_{t₁}, P_{t₁}); put–call parity at t₁ (MathFin.chooserPayoff_decompose_BS) writes that as C_{t₁} + max (K e^{−r(T−t₁)} − S_{t₁}, 0). The first term is what a call struck at K maturing at T is worth at t₁, the second pays at t₁, so the chooser is the call at K, T together with a put maturing at t₁ struck at K e^{−r(T−t₁)}. The payoff language has no node for the conditional value at t₁, so this is the replicating portfolio, not the holder's choice written as a payoff; the rate r enters only through the put's strike.

defMathFin.Contracts.exchangeOptionsource
NNReal → Contract (Fin 2)

The reified exchange option (Margrabe) on two underlyings indexed by Fin 2: pays max (S¹_T - S²_T) 0 at maturity T.

defMathFin.Contracts.forwardsource
ℝ → NNReal → Contract Unit

The reified forward struck at K: pays S_T − K at maturity T.

defMathFin.Contracts.cappedCallsource
ℝ → ℝ → NNReal → Contract Unit

A capped call struck at K₁ and capped at K₂, built as a long call at K₁ and a short call at K₂. cappedCall_payoff_eq proves this composed object really does pay min (max (S - K₁) 0) (K₂ - K₁).

theoremMathFin.Contracts.cappedCall_payoff_eqsource
∀ {K₁ K₂ : ℝ}, K₁ ≤ K₂ → ∀ {T : NNReal} (s : Scenario Unit), Contract.pathPV (fun x => 1) s (cappedCall K₁ K₂ T) = min (max (s () T - K₁) 0) (K₂ - K₁)

The capped call really pays the capped payoff. For K₁ ≤ K₂, cappedCall K₁ K₂ T, the composed long-call/short-call contract, pays exactly min(max(S − K₁, 0), K₂ − K₁) along any scenario — the identity MathFin.cappedCall_eq_bull_spread transported from a pointwise real equation to the contract's own pathPV. This is what earns the definition its name.

theoremMathFin.Contracts.pathPV_europeanCall_eq_put_add_forwardsource
∀ (D : NNReal → ℝ) (s : Scenario Unit) (K : ℝ) (T : NNReal), Contract.pathPV D s (europeanCall K T) = Contract.pathPV D s ((europeanPut K T).both (forward K T))

A call is a put plus a forward, on every path. Along any scenario and for any discount, the call struck at K pays what the put struck at K and the forward struck at K pay together: max (S_T − K) 0 = max (K − S_T) 0 + (S_T − K). No model is involved.