 # Formalizing the Cox-Ross-Rubinstein pricing of European derivatives in Isabelle/HOL

We formalize in the proof assistant Isabelle essential basic notions and results in financial mathematics. We provide generic formal definitions of concepts such as markets, portfolios, derivative products, arbitrages or fair prices, and we show that, under the usual no-arbitrage condition, the existence of a replicating portfolio for a derivative implies that the latter admits a unique fair price. Then, we provide a formalization of the Cox-Rubinstein model and we show that the market is complete in this model, i.e., that every derivative product admits a replicating portfolio. This entails that in this model, every derivative product admits a unique fair price.

## Authors

##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1 Introduction

The basic securities that are traded on financial markets –such as shares on the equity market or bonds on the fixed-income market– have a price that is submitted to the law of supply and demand, and depends on the needs of financial actors. Things are not that simple for all securities traded on financial markets, and in particular, determining the price of so-called derivative products can be a far from trivial task. A derivative product is a security the value of which depends on that of one or several underlying securities; a typical example is a vanilla call on a share, which gives its holder the right, but not the obligation, to buy the share on a predetermined date at a predetermined price. Obviously, the price of a derivative product should depend on that of its underlyings, but what exactly is this dependency? In fact, is there even a unique price for any derivative? An intuitive answer to the second question is that the price of a derivative should be unique: if this were not the case, an investor could buy the derivative at the lower price and simultaneously sell it at the higher price, making a profit without investing any money or taking any risks. The investor would have exploited what is called an arbitrage opportunity and although such opportunities do exist on financial markets, they are exploited by financial actors called arbitragists and tend to disappear quickly. This is the reason why many results in quantitative finance rely on a no-arbitrage hypothesis. Such a hypothesis also permits to provide a more precise definition of what a price for a derivative should be: this should be any value that is neither so high as to induce an arbitrage opportunity for the seller of the derivative, nor so low as to induce an arbitrage opportunity for the buyer. Any price satisfying these conditions is called a fair price for the derivative.

One of the most important results in financial mathematics was the proof by Black, Scholes and Merton [BlackScholes, Merton] that, in the so-called Black-Scholes model of an equity market, every derivative admits a unique price, along with a formula permitting to compute this price, either numerically or explicitly. Along with the no-arbitrage hypothesis, the authors assume that (1) the market is frictionless, meaning that securities can be bought or sold with no transaction costs, and (2) investors can buy and sell any amount of the securities, meaning that the quantity of a security withheld in a portfolio can be any real number, even a negative one if the security has been sold short (i.e., sold by an investor not owning the asset). Since then, there have been a wide variety of mathematical models devised for the pricing of derivative products, adapting the hypotheses of the Black-Scholes-Merton model or modeling other markets, such as the foreign-exchange or commodities markets.

A discrete-time model of an equity market was introduced in 1979 by Cox, Ross and Rubinstein [CRR]. This model is based on hypotheses similar to those of the Black-Scholes-Merton model, in which time is continuous, and can actually be viewed as a discrete-time approximation of this model. The complexity of evaluating the price of a derivative in this model implies that it is not frequently used for the pricing of simpler derivatives. But several financial institutions still rely on this model for the pricing of more complex derivative, such american options, which can be exercised by their buyer at any time until a given maturity.

In this paper, we present a formalization in Isabelle/HOL [Nipkow:2002:IPA:1791547] of (1) fair prices for derivative products on equity financial markets, (2) the proof of their uniqueness when a replicating portfolio exists in a fair market, and (3) an algorithm to compute fair prices under a risk-neutral probability space. We also formalize the Cox-Ross-Rubinstein model and prove that in this model, every derivative admits a replicating portfolio, i.e., a portfolio with a value at maturity identical to the payoff of the derivative. The work presented here strictly subsumes the formalization carried out in [EPCRR], which was mainly devoted to the proof that in the model of a market defined by Cox, Ross and Rubinstein [CRR], every derivative product admits a replicating portfolio. The results presented in this paper can be found in many financial mathematics textbooks, with one main difference: in general, the results are presented by considering an arbitrary derivative with a given maturity

, and taking the finite probability space with outcomes consisting of all sequences of

coin tosses. Here we formalize a setting in which any derivative can be priced, and use Isabelle’s codatatypes [Blanchette13] to consider non-denumerable probability space with outcomes consisting of all infinite streams of coin tosses.

#### Related work.

Many results related to financial mathematics have already been formalized in Isabelle. Large parts of Probability theory have been formalized, building up on

[hoelzl2012thesis]

; and results and concepts frequently used in financial mathematics such as Markov processes or the Central Limit Theorem are also available in Isabelle

[HolzlJAR, CentralLimit]. To the best of our knowledge, other than [EPCRR], there has been no formalization of financial mathematics.

#### Organization.

This paper is organized as follows. Section 2 contains basic financial notions as well as a summary of the notions from Probality theory that will be used throughout the paper and are already formalized in Isabelle. In Section 3, we define equity markets in discrete time, introducing the notions of portfolios and their values, as well as trading strategies which represent the only reasonable portfolios that can be constructed. Arbitrage opportunities are introduced in Section 4, they permit to define the notion of af air price for a derivative, and we show that if a derivative admits a portfolio whose value at maturity is identical to the derivative payoff, then the fair price for this derivative is unique. Section 5 is devoted to the definition of risk-neutral probability spaces, which are based on the existence of martingales, and permit to represent the fair price of a derivative as an expectation. In Section 6, these results are applied to the Cox-Ross-Rubinstein model, and an explicit formula for computing the fair price of any derivative is provided. Section 7 contains a detailed illustrative example, showing how in the Cox-Ross-Rubinstein model, a replicating portfolio is computed, and the fair price of a derivative is obtained. The theory files described in this paper are available on the Archive of Formal Proofs, at https://www.isa-afp.org/entries/DiscretePricing.html.

## 2 Preliminary notions

### 2.1 Some notions in finance

We begin by briefly reviewing some basic standard definitions about equity markets. This treatment is mainly based on Shreve [Shreve], Vol. 1. An equity market consists of a set of assets or securities that can be traded at prices that evolve with time. An actor trading on different assets will own a portfolio containing different quantities of the traded assets. These quantities are real numbers that can be positive if the corresponding asset was bought, or negative if the asset was the object of a short sale. A portfolio can be static if its composition is fixed once and for all, and dynamic if its composition can evolve over time. Clearly, almost all portfolios on markets are dynamic ones. Among the dynamic portfolios, those of a particular interest are the trading strategies; these are the dynamic portfolios for which the composition at time

is a random variable that only depends on the available information up to time

; trading strategies are thus meant to represent portfolios for which no insider trading can occur. A portfolio in which cash is only invested at inception, after what all future trades are financed by buying or selling assets in the portfolio is a self-financing portfolio. An arbitrage represents a “free lunch”: it is defined as a self-financing trading strategy with a 0 initial investment that offers a risk-free possibility of making a profit. A market is viable if it offers no arbitrage opportunities.

Some of the securities that can be traded are basic securities, such as bonds, which are generally assumed to be risk-free assets, or stocks, which are risky assets. Others are derivative securities, with payoffs (the amount of cash that should be exchanged at exercise time) that depend on the evolution and values of underlying securities. On the equity market, these derivative securities often have an expiry date, or maturity, after which they are no longer valid. An option, for instance, is a derivative that can be viewed as an insurance: when it is exercised, it gives the beholder the right—but not the obligation—to trade an instrument at a given price. In this paper we will focus on European options, which can only be exercised at the maturity, see, e.g., [Hull]. The best-known options are the call and the put options. A call (resp. put) option gives its beholder the right, at time , to buy (resp. sell) the underlying security at the strike price , thus guaranteeing that there is a cap (resp. floor) on the price that will be payed at a future time for the security. In practice, when at time the price of the underlying security, denoted by , is greater than the strike price , the buyer of a call receives from the seller of the option, and buys the instrument on the market for , in effect only spending to obtain the instrument. When , the seller of the call does not deliver any cash, as the buyer will directly buy the instrument on the market for a value that is less than . Thus, a call option is a derivative that, at maturity , delivers a payoff of . In a similar way, a put option delivers at time a payoff of .

Once a derivative is sold, the seller is meant to invest the cash by creating a trading strategy, in order to be able to pay the required amount of money when the derivative is exercised. A natural question is the following: how much should a buyer be expected to pay for a given derivative? Ideally, this price should not be so low that the buyer could make a riskless profit, and it should not be so high that the seller could make a riskless profit. As we will see, the answer to this question is quite straightforward when the seller is capable of creating a trading strategy that generates at exercise time exactly the payoff of the derivative, i.e., of creating a replicating portfolio. In this case, the fair price for the derivative is the investment needed to initiate the trading strategy. A market is complete if every derivative admits a replicating portfolio; in a complete market, every derivative admits a fair price.

The construction of replicating portfolios is clearly not straightforward, and it may not be guaranteed that such portfolios actually exist. An answer to the existence of replicating portfolios for European options was given by Fischer Black and Myron Scholes, and by Robert Merton in [BlackScholes, Merton], in the so-called Black-Scholes-Merton model. They consider a risky asset, the stock, that pays no dividends and whose evolution is described by a geometric Brownian motion (see, e.g., [Hull]), and showed that, under some simple market hypotheses such as identical bidding and asking prices for the stock and the absence of arbitrage opportunities, a European option over a single stock can be replicated with a portfolio consisting of the stock and a cash account. Their proof is based on the construction of a dynamic portfolio, the composition of which changes continuously (it is called a delta-neutral portfolio), which is guaranteed to replicate the option under consideration. Along with the construction of replicating portfolios, the authors provide a formula that permits to compute the fair price of any European option.

The Cox-Ross-Rubinstein model [CRR] that we consider in Section 6 of this paper can be viewed as an approximation of the Black-Scholes-Merton model to the case where time is no longer continuous but discrete; i.e., to the case where securities are only traded at discrete times In this setting, the evolution of the stock price is described by a geometric random walk, which can be viewed as a discrete version of the geometric Brownian motion: if the stock has a price at time , then at time , this price is either (upward movement) or (downward movement). The probability of the price going up is always , and the probability of it going down is . The authors show that under these conditions, the market is complete: every derivative admits a replicating portfolio.

### 2.2 Probability theory in Isabelle: existing notions

A large part of the formalization of measure and probability theory in Isabelle was carried out by Hölzl [hoelzl2012thesis] and is now included in Isabelle’s distribution. We briefly recap some of the notions that will be used throughout the paper and the way they are formalized in Isabelle. We assume the reader has knowledge of fundamental concepts of measure and probability theory; any missing notions can be found in Durrett [Durrett] for example. For the sake of readability, in what follows, a term will sometimes be written .

Probability spaces are particular measure spaces. A measure space over a set consists of a function that associates a nonnegative number or to some subsets of . The subsets of that can be measured are closed under complement and countable unions and make up a -algebra. The -algebra generated by a set is the smallest -algebra containing ; it is denoted in Isabelle by .

The functions that measure the elements of a -algebra are positive and sigma additive111This property is also called countable additivity in the literature.: if is a -algebra and the sequence consists of pairwise disjoint elements in , then . In Isabelle, measure spaces are defined as follows (where denotes and ):

 measure-space::αset→αsetset→(αset→¯¯¯¯R)→Bmeasure-space Ω A μ⇔σ-algebra Ω A ∧ positive%  A μ ∧ countably-additive A μ\span\span

A measure type is defined by fixing the measure of non-measurable sets to :

 typedef α measure={(Ω,A,μ)∣∣(∀A∉A.μA=0)∧measure-space ΩAμ}

If is an element of type measure, then the corresponding space, -algebra and measure are respectively denoted by , and .

The definition of a measure type may seem surprising, especially to mathematicians, because setting the measure of a set not in to can be counter-intuitive: there is for example no relationship between elements with a measure 0 and negligible elements on a measure space. The reason for this is that in Isabelle, a function cannot be partial and it is necessary to define the measure function on every subset of ; the choice of setting these measures to is arbitrary but does not entail any contradiction.

We can associate to any -algebra a measure space with a uniformly null measure: . In Isabelle, this measure space is denoted by .

A function between two measurable spaces is measurable if the preimage of every measurable set is measurable. In Isabelle, sets of measurable functions are defined as follow:

Probability measures are measure spaces on which the measure of is finite and equal to . In Isabelle, they are defined by a locale; this allows one to delimit a range in which the existence of a measure satisfying the desired assumptions is assumed, instead of having to explicitly add the corresponding hypotheses in every theorem, which would be tedious.

 locale prob-space=finite-measure +assumes μM(ΩM) = 1

A random variable on a probability space is a measurable function with domain . Collections of random variables are called stochastic processes. In most cases, stochastic processes are indexed by a totally ordered set, representing time, such as or . In what follows, we will consider properties that hold almost surely (or almost everywhere), i.e., are such that the elements for which they do not hold reside within a set of measure :

 lemma \textscAE−iff : (\textscAEMx. P x) ⇔(∃N∈AM.μM(N)=0∧{x∣∣¬P x}⊆N)

Given measure spaces and , we say that is a subalgebra of if and .

## 3 Modeling equity markets in discrete time

### 3.1 General definitions

 discr-mkt::β set→(β→(N→α→R))→Bdiscr-mkt S P⇔S≠UNIV

Equity markets are defined as a type, from which the stocks and prices can be obtained:

 typedef(α,β)discrete-market={(S,P)∣∣discr-mkt S P}
 stocks::(α,β)discrete-market% →β setstocks Mkt=fst (Rep-% discrete-market Mkt)
 prices::(α,β)discrete-market% →β→N→α→Rprices Mkt=snd (Rep-% discrete-market Mkt)

We next consider quantity processes. These are used to represent the fact that assets can be bought and sold; in particular, it is possible on financial markets to sell an asset that is not withheld: when this occurs, we say the seller is short on the asset and owns a negative amount of the asset. When the holder owns a positive amount of the asset, we say the holder is long on the asset. We assume that any portion of the asset may be traded, thus the quantity withheld is a real number. Quantity processes are formalized as functions that associate a stochastic process to each asset. By convention, for , if is a quantity process and is an asset, then represents the quantity (positive if we are long the asset and negative if we are short the asset) of asset withheld on the time interval for scenario . The value of a quantity process at time is thus unimportant. Intuitively, the reason for such a convention is that, at time , a quantity process is meant to only depend on the information available up to time . More formally, in both discrete and continuous-time models, quantity processes of interest will be required to be predictable processes, and the convention on quantity processes allows for a uniform presentation. We define operators that permit to construct and combine quantity processes.

 qty-empty::β→N→α→Rqty-empty=(λx n w. 0)
 qty-single::β→(N→α→R)→β→N→α→Rqty-single asset prc=qty-empty(%asset:=prc)
 qty-sum::(β→N→α→R)→(β→N→α→R)→β→N→α→Rqty-sum q1 q2=(λx n w. (q1 x n w)+(q2 x n w))
 qty-mult-comp::(β→N→α→R)→(N→α→R)→β→N→α→Rqty-mult-comp q prd=(λx n w. (q x n w).(prd n w))
 qty-rem-comp::(β→N→α→R)→(N→α→R)→β→N→α→Rqty-rem-comp q asset=q(asset:=(λn w.0))

Intuitively, qty-empty represents the quantity process in which no asset is bought or sold, and qty-single is the process for which a single asset is potentially bought or sold333Recall that in Isabelle, the notation represents an update of function so that the image of becomes . The other operators permit to respectively add quantity processes, to multiply all of them by another process, and to nullify the quantity of an asset.

Related to the notion of a quantity process is that of its support set, which consists of all the assets that are potentially bought or sold at some point for some scenario. This leads to the definition of portfolios, which are quantity processes that admit a finite support set. Stock portfolios are portfolios for which the support set consists only of stocks.

 support-set::(β→N→α→R)→β setsupport-set q={a∣∣∃nw. q a n w≠0}
 portfolio::(β→N→α→R)→Bportfolio p⇔finite (support-set p)
 stock-portfolio::(α,β)% discrete-market→(β→N→α→R)→Bstock-portfolio p⇔portfolio p∧%support−set p⊆stocks Mkt
###### Example

Consider a market Mkt with stocks including shares on Apple, Facebook and Google: . We can construct the following portfolio

 p1\tiny def=qty-sum (% qty-single Apl (λ n w.n)) (qty-single Goog (λ n w.−n)).

This is portfolio in which we are long shares of Apple and short shares of Google until time for all scenarios; it has a support set consisting of Apple and Google and is thus a stock portfolio.

 Time1234Apl quantity1234Goog quantity−1−2−3−4

We now define value processes and closing value process for portfolios. Intuitively, the value process of a portfolio at time represents the total amount of cash that is necessary to invest in the assets of the portfolio until time , and the closing value process of a portfolio at time represents the total amount of cash received/owed when closing out all positions at time . The closing value process of a portfolio at time can be defined arbitrarily; a standard practice consists in setting its value to that of the value process of the portfolio at time . Note that if the composition of the portfolio does not change between times and , then the value of the closing value process at time is the same as that of the value process.

 val-process::(α,β)discrete-% market→(β→N→α→R)→N→α→Rval-process Mkt p=if ¬(portfolio p) then (λn w. 0) else(λn w. ∑a∈support-set p((% prices Mkt) a n w)∗(p a (n+1) w))\span\span
 tmp-cl-val::(α,β)discrete-% market→(β→N→α→R)→N→α→Rtmp-cl-val Mkt p 0=val-process Mkt p 0tmp-cl-val Mkt p (n+1)=(λw. ∑a∈support-set p((prices%  Mkt) a (n+1) w)∗(p a (n+1) w))\span\span
 cls-val-process::(α,β)% discrete-market→(β→N→α→R)→N→α→Rcls-val-process Mkt p=if ¬(% portfolio p) then (λn w. 0) else(λn w. tmp-cl-val Mkt p n w)\span\span
###### Example

Assume the Apple and Google shares have deterministic prices given by the table below. Then the value process and closing value process of portfolio defined in Example 3.1 are given in the same table.

 Time0123Apl quantity−123Goog quantity−−1−2−3Apl value100989698Goog value90929895.5val-process Mkt p11012−610cls-val-process Mkt p1106−47.5

Self-financing portfolios are portfolios in which no cash is invested except possibly at inception. A portfolio is self-financing if its closing value and value at time are identical; this means that the value of the portfolio may be affected by the evolution of the market but not by the changes in its composition.

 self-financing::(α,β)% discrete-market→(β→N→α→R)→Bself-financing Mkt p⇔∀n.val-process Mkt p (n+1)=cls% -val-process Mkt p (n+1)\span\span

A self-financing portfolio with initial value can be obtained starting from an arbitrary portfolio, provided the market contains an asset that never admits a price equal to 0, by buying (resp. selling) the required quantity of the asset with the extra (resp. missing) cash.

###### Example

Portfolio of Example 3.1 is not self-financing. Assume the stock price of Facebook is deterministic and given in the table below.

 Time0123Fbk5445

Then we can construct a self-financing portfolio with initial value , that has the same quantity processes as for Apple and Google. The quantities of stocks and the value and closing value processes of are given in the following table.

 Time01234Apl quantity−1234Goog quantity−−1−2−3−4Fbk quantity−−2−3.5−3−3.5Apl value100989698−Goog value90929895.5−Fbk value5445−val-process Mkt p20−2−18−7.5−cls-val-process Mkt p20−2−18−7.5−

The value process of at time 3 is computed by having a quantity of Facebook stock in the portfolio until time 4. For instance, at time , the holder buys a share of Apple for 100€ and sells a (borrowed) share of Google for 90€, creating a portfolio for a total cost of €. To make the portfolio self-financed with initial value 0, this cost is compensated by selling (borrowed) shares of Facebook at 5€ each, the total cost of the created portfolio is then €.

### 3.2 Modeling time-dependent information

Filtrations are used to represent information accumulated over time. Formally, they are defined as a collection of increasing subalgebras over a totally ordered set with a minimal element –typically or .

 class linorder-bot=linorder+bot
 filtration::αmeasure→((ι::linorder-bot)→αmeasure)→Bfiltration M F⇔(∀t. subalgebra M Ft) ∧(∀s t. s≤t⇒ subalgebra Ft Fs)

In general, when a filtration representing available information is provided, we will mainly be interested in stochastic processes that depend on this information. There are two categories of such stochastic processes of interest for our purpose: adapted stochastic process, that at time are -measurable; and predictable stochastic processes, that at time are -measurable. The definition of adapted stochastic processes in the more general case is a straightforward generalization of that in the discrete case, which is the one that is formalized below. We also introduce abbreviations for stochastic processes with a range in a borel measure space.

 predict-sp::(N→αmeasure)→(N→α→β)→βmeasure→Bpredict-sp F X N⇔X0∈measurable F0 N∧∀n. Xn+1∈measurable Fn N

In our context, filtrations are meant to represent the currently available information. A standard filtration used in financial mathematics is the one defined as follows: for all , is the smallest subalgebra of in which for any stock and time , the price process is borel-measurable. It is straightforward to verify that is indeed a filtration. In particular, at time , there is no information available, thus the measure space is trivial. Filtrations satisfying such a requirement are called initially trivial filtrations.

 init-triv-filt::αmeasure→(ι→αmeasure)→Binit-triv-filt M F⇔% filtration M F∧sets F⊥={∅,ΩM}

We define a locale for discrete equity markets by fixing a market and considering a probability space equipped with an arbitrary filtration that is initially trivial.

 locale init-triv-prob-space = % prob-space +fixes F::N→(α% measure)assumes init-triv-filt Flocale disc-equity-market = init-triv-prob-space +fixes Mkt::(α,β)discrete-market

Most of the assets that we will be considering in this locale are those that have an adapted price process w.r.t. the given filtration. Quantity processes in which only assets with an adapted price process are bought or sold are called support-adapted quantity processes.

The portfolios that can reasonably be constructed are those for which the amounts that are bought or sold of each asset on the time interval is known at time . In other words, these are portfolios for which the quantity of each asset is a predictable process; such portfolios are called trading strategies.

Since the filtration is assumed to be initially trivial, such a strategy necessarily admits a constant value at inception:

We denote by the constant value equal to the value process of a trading strategy at time 0.

## 4 The notion of a fair price

### 4.1 Definitions

We define the notion of a fair price, which is meant to represent the price at which a derivative should be bought or sold. Intuitively, a fair price for an asset is one that does not allow a buyer or seller of the asset of making a risk-free profit thanks to this transaction. Making a risk-free profit is called an arbitrage. We begin by formally defining the notion of an arbitrage. This is a self-financing trading strategy with a zero initial value, that at some point in time is almost surely positive and with a strictly positive probability of making a gain. Although such arbitrage opportunities do exist in real financial markets, they are generally quickly exploited and disappear: in fact, there is an entire category of traders on markets with the goal of detecting and exploiting arbitrages as quickly as possible. Pricing results in financial mathematics are based on a no-arbitrage assumption.

 arbitrage-process::(α,β)% discrete-market→(β→N→α→R)→Barbitrage-process Mkt p⇔(∃m∈N.\span\span(trading-strat p) ∧ (self-financing p) ∧\span\span(∀ω∈ΩM. (val-process p) 0 ω=0) ∧\span\span(\textscAEM ω. (cls-val-process p) m ω≥0) ∧\span\span(P({ω∈ΩM∣∣(cls-val-process p) m ω>0})>0))\span\span

Next we define the notion of a price structure for a derivative. Derivatives are characterized by their maturity and the payoff they deliver at maturity; a price structure is a stochastic process with a constant initial value that coincides with the payoff of the derivative almost everywhere at maturity. The initial value of a price structure will represent the price of the derivative under consideration.

 price-struct::(α→R)→N→R→(N→α→R)→Bprice-struct κ T π pr⇔(∀ω∈ΩM. pr 0 ω=π) ∧(\textscAEM ω. pr T ω=κ ω) ∧(pr T∈borel-measurable FT)

In order to formalize the notion of a fair price for a derivative, we need to formalize the fact that buying or selling the derivative at that price does not lead to any arbitrage opportunity. More precisely, it should not be possible to obtain an arbitrage process using only stocks from the market and an asset with a price process identical to a price structure of the derivative, with an initial value . In order to guarantee the existence of such an asset, we define the notion of coincidence between two markets.

 coincides::(α,β)discrete-% market→(α,β)discrete-market→β set→Bcoincides Mkt Mkt′ A⇔stocks Mkt=stocks Mkt′ ∧∀x. x∈A⇒prices Mkt a=prices%  Mkt′ a
 fair-price::(α,β)discrete-% market→R→(α→R)→N→Bfair-price Mkt π κ T⇔(∃pr. price-struct κ T π pr∧(∀a Mkt′ p. a∉stocks % Mkt⇒(coincides Mkt Mkt′) ∧(prices Mkt′ a=pr) ∧(portfolio p) ∧(support-set p⊆stocks Mkt% ∪{a})⇒¬arbitrage-process Mkt′ p))

### 4.2 Replicating portfolios

We prove the central result that, under the hypothesis that a replicating portfolio exists for a given derivative, the latter admits a fair price that is unique. A replicating portfolio for a given derivative is a self-financing trading strategy that consists of stocks only, and that at maturity, has a value identical to the payoff of the derivative almost everywhere. If such a portfolio exists, then the derivative is attainable, and if every derivative available on a market is attainable, then the market is complete:

 replic-pf::(β→N→α→R)→(α→R)→ N→Breplic-pf p κ T⇔(stock-portfolio Mkt  p) ∧(self-financing p)∧(trading-strat p)∧(\textscAEM ω. cls-val-process Mkt p T ω=κ w)
 attainable::(α→R)→N→Battainable κ T⇔(∃p. replic-pf p κ T)
 complete-market::Bcomplete-market⇔∀T. ∀κ∈(% borel-measurable FT). attainable κ T

The existence of a replicating portfolio by itself is not sufficient to guarantee the existence of a fair price: indeed, if for example it is already possible to construct an arbitrage process on the market using only stocks, then there clearly cannot be any fair price for any derivative product. It is thus necessary to forbid arbitrage opportunities using only stocks from the market. This is captured by the notion of a viable market.

 viable-market::(α,β)discrete% -market→Bviable-market Mkt⇔∀p. stock% -portfolio p ⇒¬arbitrage-process Mkt p

We obtain the following results. We first show that, if the market is viable, every derivative admitting a replicating portfolio has a fair price that is the initial value of the replicating portfolio.

 lemma \textscreplicating−fair−priceassumes viable-market Mktand replic-pf p κ Tand support-adapt Mkt pshows fair-price Mkt (init-value p) κ T

We then provide a proof of the uniqueness of a fair price for attainable derivatives based on the existence of a stock on the market with a strictly positive price process. The proof could also be carried out assuming the existence of a stock on the market with a strictly negative price process, but that does not really make sense from a financial point of view. We also assume that the price processes of all stocks in the market are adapted to the filtration under consideration.

 locale disc-mkt-pos-stock = % disc-equity-market +fixes pos-stock::βassumes pos-stock∈stocks Mktand ∀n ω. prices Mkt %pos−stock n ω>0and ∀a∈stocks Mkt. borel-% adapt-sp F (prices Mkt a)
 lemma \textscreplicating−fair−price−uniqueassumes replic-pf p κ Tand fair-price Mkt π κ Tshows π= (init-value p)

## 5 Risk-neutral probability spaces

### 5.1 Interest rates and discounted values

We begin by defining the notion of interest rates. The existence of an interest rate is modeled by assuming that the market contains a stock with a deterministic return. The price process of this stock is parameterized by an interest rate . In this setting, the interest rate is constant, although there exist more general models in which the interest rate can be time-dependent, and even stochastic.

 disc-rfr-proc::R→N→α→Rdisc-rfr-proc r 0 ω=1disc-rfr-proc r (n+1) ω=(1+r).(disc-rfr-proc n ω)

We call risk-free asset any asset such that for some rate , and define a locale for a market containing a risk-free asset.

 locale risk-free-stock-market = %disc−equity−market +fixes rf-asset::βand r::Rassumes −1

Having a risk-free asset as a stock in a market makes it possible to deposit (by buying the asset) or borrow (by shorting the asset) cash on this market.

###### Example

Assume there is a risk-free asset with an annual rate of on the market. This means that buying € worth of the asset today will permit to obtain € by selling the asset in one year. Assuming the time lapse between times and is a day and there are 252 business days in one year, the daily rate in the definition of disc-rfr-proc then satisfies the equation , so we have .

###### Remark.

Observe that if the market is viable, then all risk-free assets must have the same rate. Indeed, if there exist two risk-free assets with interest rates then an arbitrage can be constructed: it suffices to buy 1 share of the second asset and sell 1 share of the first one. The initial investment is , and at time the closing value of the portfolio is .

We also define the discounted value of a stochastic process. This notion is related to that of the present value of a future cash-flow, given an interest rate.

 discount-factor::R→N→α→Rdiscount-factor r n ω=inverse (disc-rfr-% proc r n ω)
###### Example

Assume we have a viable market that contains a risk-free asset with a rate of per year, and that the price of a share of Apple today is 95€. Consider a forward contract for buying a share of Apple stock at a strike price of € in two years. The fair price for this contract is obtained by computing the discounted value of the strike and subtracting it from the current price of a share today. Here the discounted value of the strike is , hence the fair price of this contract is €. Indeed, this amount of money can be used to construct a replicating portfolio as follows.

1. Borrow € today.

2. Use the cash, along with the € received at the sale of the contract to buy a share of Apple stock today.

3. Wait for two years.

4. Sell the share of Apple stock to the buyer of the forward contract for 98€.

5. Use this to reimburse the cash that was borrowed at the start and is now worth €.

### 5.2 Conditional expectations and martingales

The results of Section 4.2 show that when a replicating portfolio exists for a given derivative, the fair price for this derivative is unique and equal to the initial value of the portfolio. In this section we prove that this initial value can be computed without explicitly constructing any replicating portfolio under the hypothesis of the existence of a risk-neutral probability space. From a financial point of view, assets carry different levels of risk, and the more risky an asset, the higher the return buyers will be expecting when investing in the asset; this additional return is called the market price of risk. A risk-neutral probability space is meant to represent a world in which investors do not expect an increased return for a more risky asset: they are neutral to risk and expect the returns of all assets to be identical.

The expected returns of assets are modeled using the notion of conditional expectations. A conditional expectation is meant to represent the best approximation of a random variable given the currently available information. Formally, a conditional expectation of a random variable given a measure space that is a subalgebra of is any random variable that is -measurable, and such that for any set ,

 ∫NXNdμM = ∫NXdμM.

A conditional expectation of given always exists as long as is integrable, and is almost surely unique, meaning that two conditional expectations of given are identical almost everywhere. In what follows, we will therefore refer to the conditional expectation of given , and denote it by . Conditional expectations are already formalized in Isabelle.

Conditional expectations are used to define martingales. Given a filtration , these are stochastic processes such that for all ,

is the best estimation of

given the information . In other words, and are equal almost everywhere.

Because the risk-free asset we defined has a deterministic price process with a constant return rate, it is straightforward to verify that the discounted value of this price process is constant, and is trivially a martingale. In a risk-neutral probability space, the martingale property holds for all the stocks of the market:

 risk-neutral-prob-space::α% measure→Brisk-neutral-prob-space N⇔prob-% space N ∧∀a∈(stocks Mkt). martingale N F (discounted-value r (prices Mkt a))\span\span

### 5.3 Filtration-equivalence

If there were no relationship whatsoever between a risk-neutral probability space and the actual probability space, the former would not be of much use. In general, both spaces are assumed to be equivalent, meaning that they agree on the events that have a zero probability. It turns out that when there is a filtration associated with a probability space, this notion can be relaxed into that of filtration-equivalence, which is sufficient for our purpose.

When probability spaces are filtration-equivalent, almost everywhere properties propagate from one space to the other. In particular, a replicating portfolio for a derivative in one given probability space will necessarily be a replicating portfolio for the derivative in a filtration-equivalent probability space, even if the probabilities assigned to different events may defer.

Provided integrability properties are guaranteed for the assets of a self-financing trading strategy, the latter is a martingale in a filtration-equivalent risk-neutral probability space.

We obtain the following result, which in a viable market, provides an effective way of computing the fair price of an attainable derivative when a filtration-equivalent risk-neutral probability space exists:

## 6 Fair prices in the Cox-Ross-Rubinstein model

The CRR model is a discrete-time model consisting of a market in which there are two stocks, a risk-free asset and a risky one. At every time , the risky asset can only move upward or downward with respective probabilities and . This means that the evolution of the risky asset price can be modeled by tossing at each time a coin that lands on its head with a probability , and having the price move upward at time exactly when the coin lands on its head. The evolution of this price is thus controlled by sequences of coin tosses. In most introductory textbooks on the CRR model, these sequences are finite as the results are presented for a given derivative with a finite maturity. We choose to consider infinite sequences—or streams—of coin tosses for the sake of generality. Since at time

no event other than the outcome of the coin toss is required, this outcome can be represented by a Bernoulli distribution of parameter

. In Isabelle, because discrete probability distributions and probability mass functions are isomorphic, the type of probability mass functions are defined as a subtype of measures

[HolzlLT15], along with an injective representation function . The Bernoulli distribution is thus defined as . The measure space for infinite sequences of independent coin tosses is isomorphic to the infinite product of Bernoulli distributions with the same parameter. In Isabelle, this measure space is defined using the function . The measure space thus defined is the smallest one in which the function such that is the th element of stream is measurable [HolzlJAR]. The measure spaces we consider are defined as follows:

We define a locale in which we impose that , and thus obtain a probability space:

 locale infinite-coin-toss-space=fixes p and Massumes 0≤p≤1 and M=bernoulli-stream p

The maximal amount of information that should be available at time is the outcome of the first coin tosses, and we define a filtration accordingly: intuitively, in this filtration, two streams of coin tosses with the same first outcomes cannot occur in distinct sets that are measurable in . In our setting, each restricted measure space can be defined as generated by an arbitrary measurable function which maps all streams that agree on the first coin tosses to the same element. We thus considered the sequence of so-called pseudo-projection functions , where:

 π⊤n:ΩM→ΩM(w1,⋯,wn,wn+1,⋯)↦(w1,⋯,wn,⊤,⊤,⋯)

These functions are measurable and permit to define a sequence of restricted measure spaces which is indeed a filtration:

 Fnat::N→(B stream) measureFnat n=M(π⊤n)

We can thus define a locale for the infinite coin toss space along with this filtration:

 locale infinite-cts-filtration=% infinite-coin-toss-space +fixes F assumes F=Fnat

Any other considered filtration on this probability space will be a sub-filtration of the natural filtration.

An important feature of the natural filtration is that the expectation of any -measurable function is very similar to that of a function on a finite probability space: for and , if , then we have

 lemma \textscexpect−prob−compassumes f∈borel-measurable Fnatnshows E[f]=∑ω∈π⊤n(ΩM)(∏ni=1νi(ωi).f(ω))

In the CRR model, the price of the risky asset is modeled by a geometric random walk with parameters specifying the upward and downward movements as well as the price of the asset at time :

 geom-rand-walk::R→R→R→(N→(B stream)→R)(geom-rand-walk u d v) 0 ω=v(geom-rand-walk u d v) (n+1) ω=(if ωn then u else d) ×((geom-rand-walk u d v)