MathFin
Map / Risk · Value at risk and expected shortfall / MathFin.Risk.ContractRisk

The risk of a contract position

MathFin.Risk.ContractRiskMSC 91G70JEL G32 source

A position in a contract c, bought at price p, loses p − pathPV along each outcome: the price paid less the discounted payoff (Contract.loss). Its value-at-risk and expected shortfall are those of Risk/ValueAtRisk.lean, taken under a law P of the outcomes. P is the measure the risk is measured under, and need not be the pricing measure: the price p is an input, typically a Contract.value under some Q.

  • A book's expected shortfall is at most the sum of its contracts' (expectedShortfall_loss_both_le), which is the subadditivity of expected shortfall (expectedShortfall_add_le) read through Contract.pathPV_both. Value-at-risk has no such bound.
  • A position whose payoff is never negative cannot lose more than its price (valueAtRisk_loss_le_of_nonneg), so a long call's value-at-risk is at most its premium (valueAtRisk_loss_europeanCall_le).
  • In the binomial tree, a seller who receives a European contract's value and follows its hedge (Binomial.pathPV_eq_value_add_gains) carries zero value-at-risk and zero expected shortfall, under every law of the coin flips (Binomial.valueAtRisk_hedged_eq_zero).

Main definitions

  • Contract.loss — the loss of a position in a contract bought at a given price.

Main results

  • expectedShortfall_loss_both_le, valueAtRisk_loss_le_of_nonneg, valueAtRisk_loss_europeanCall_le, Binomial.valueAtRisk_hedged_eq_zero.

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

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

value at risk, expected shortfall, subadditivity, position loss, hedged position, risk of a derivative book, MSC 91G70, JEL G32

Import neighbourhood

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

Corpus entries

mf-contract-book-es-subadditive · contracts.json · full statement
A Book's Expected Shortfall Is at Most the Sum of Its Contracts'

For contracts a, b bought at prices p_a, p_b, with integrable discounted payoffs under a probability measure P on the outcomes, the loss of holding both (bought at p_a + p_b) has expected shortfall at every level alpha in (0, 1) at most the sum of the two positions' expected shortfalls. P is the measure the risk is measured under and need not be a pricing measure.

mf-contract-long-call-var-le-premium · contracts.json · full statement
A Long Call's Value-at-Risk Is at Most Its Premium

For a nonnegative discount factor D(T) and an a.e.-measurable discounted payoff, the position long the European call bought at price p has value-at-risk at most p at every level alpha in (0, 1), under any probability measure on the outcomes: the call never pays a negative amount, and VaR is monotone.

mf-contract-binomial-hedged-zero-risk · contracts.json · full statement
A Hedged Binomial Seller Has Zero Value-at-Risk and Expected Shortfall

In the binomial model under no-arbitrage with S0 != 0, for a single cash flow at T = N steps paying g of the underlying at T, there is a predictable strategy H such that, under every probability measure P on coin-flip paths and at every level alpha in (0, 1), the seller who receives the contract's risk-neutral Contract.value and follows H has loss pathPV - (value + gains) with value-at-risk 0 and expected shortfall 0: the loss is 0 on every path.

Declarations 5

defMathFin.Contracts.Contract.losssource
{Ω : Type u_1} → {ι : Type u_2} → ℝ → (NNReal → ℝ) → (ι → NNReal → Ω → ℝ) → Contract ι → Ω → ℝ

The loss of a position in the contract c bought at price p: along each outcome, the price paid less the discounted payoff.

theoremMathFin.Contracts.expectedShortfall_loss_both_lesource
∀ {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {P : Measure Ω} {α : ℝ} {ι : Type u_2} {D : NNReal → ℝ} {X : ι → NNReal → Ω → ℝ} [IsProbabilityMeasure P], α ∈ Set.Ioo 0 1 → ∀ {a b : Contract ι}, Integrable (fun ω => Contract.pathPV D (scenarioAt X ω) a) P → Integrable (fun ω => Contract.pathPV D (scenarioAt X ω) b) P → ∀ (pa pb : ℝ), expectedShortfall (Contract.loss (pa + pb) D X (a.both b)) P α ≤ expectedShortfall (Contract.loss pa D X a) P α + expectedShortfall (Contract.loss pb D X b) P α

A book's expected shortfall is at most the sum of its contracts'. Holding a bought at p_a and b bought at p_b loses what the two positions lose together (Contract.pathPV_both), and expected shortfall is subadditive (expectedShortfall_add_le).

theoremMathFin.Contracts.valueAtRisk_loss_le_of_nonnegsource
∀ {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {P : Measure Ω} {α : ℝ} {ι : Type u_2} {D : NNReal → ℝ} {X : ι → NNReal → Ω → ℝ} [IsProbabilityMeasure P], α ∈ Set.Ioo 0 1 → ∀ {c : Contract ι}, AEMeasurable (fun ω => Contract.pathPV D (scenarioAt X ω) c) P → (∀ (ω : Ω), 0 ≤ Contract.pathPV D (scenarioAt X ω) c) → ∀ (p : ℝ), valueAtRisk (Contract.loss p D X c) P α ≤ p

A position that never pays a negative amount cannot lose more than its price. If the discounted payoff of c is nonnegative on every outcome, the value-at-risk of the position bought at p is at most p.

theoremMathFin.Contracts.valueAtRisk_loss_europeanCall_lesource
∀ {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {P : Measure Ω} {α : ℝ} {D : NNReal → ℝ} [IsProbabilityMeasure P], α ∈ Set.Ioo 0 1 → ∀ {X : Unit → NNReal → Ω → ℝ} {K : ℝ} {T : NNReal}, 0 ≤ D T → AEMeasurable (fun ω => Contract.pathPV D (scenarioAt X ω) (europeanCall K T)) P → ∀ (p : ℝ), valueAtRisk (Contract.loss p D X (europeanCall K T)) P α ≤ p

A long call's value-at-risk is at most its premium, for a nonnegative discount factor.

theoremMathFin.Contracts.Binomial.valueAtRisk_hedged_eq_zerosource
∀ {u d ρ h : ℝ} {q : NNReal} (hq : q ≤ 1),
  crrUpProb u d ρ = ↑q →
    ∀ (S₀ : ℝ) {T : NNReal} {N : ℕ},
      ↑T / h = ↑N →
        BinomialNoArb u d ρ →
          S₀ ≠ 0 →
            ∀ {a : Payoff Unit} {g : ℝ → ℝ},
              (∀ (s : Scenario Unit), Payoff.eval s a = g (s () T)) →
                ∃ H,
                  (StronglyAdapted flipFiltration fun n => H (n + 1)) ∧
                    ∀ (P : Measure (ℕ → Bool)) [IsProbabilityMeasure P],
                      ∀ α ∈ Set.Ioo 0 1,
                        have L := fun ω => Contract.pathPV (discount ρ h) (scenarioAt (assets S₀ u d h) ω) (Contract.pay T a) - (Contract.value (coinFlipMeasure q hq) (fun t x => discount ρ h t) (assets S₀ u d h) (Contract.pay T a) + martingaleTransform H (discountedSpot S₀ u d ρ) N ω);
                        valueAtRisk L P α = 0 ∧ expectedShortfall L P α = 0

A hedged seller carries no risk. In the binomial tree under no-arbitrage, a seller of a European contract who receives its value and follows the hedge of pathPV_eq_value_add_gains loses pathPV − (value + gains) = 0 on every path. So under every law P of the coin flips, physical or not, the hedged position has zero value-at-risk and zero expected shortfall at every level.