Realizability algebras: a program to well order R

The theory of classical realizability is a framework in which we can develop the proof-program correspondence. Using this framework, we show how to transform into programs the proofs in classical analysis with dependent choice and the existence of a well ordering of the real line. The principal tools are: The notion of realizability algebra, which is a three-sorted variant of the well known combinatory algebra of Curry. An adaptation of the method of forcing used in set theory to prove consistency results. Here, it is used in another way, to obtain programs associated with a well ordering of R and the existence of a non trivial ultrafilter on N.


Introduction
When we want to obtain programs from mathematical proofs, the main problem is, naturally, raised by the axioms: indeed, it has been a long time since we know how to transform a proof in pure (i.e.without axioms) intuitionistic logic, even at second order [2,7,4].The very first of these axioms is the excluded middle, and it seemed completely hopeless for decades.The solution, given by T. Griffin [5] in 1990, was absolutely surprising.It was an essential discovery in logic because, at this moment, it became clear that all other axioms will follow, as soon as we will work in a suitable framework.The theory of classical realizability is such a framework: it was developed in [12,13], where we treat the axioms of Analysis (second order arithmetic with dependent choice).In [15], we attack a more difficult case of the general axiom of choice, which is the existence of a non trivial ultrafilter on N ; the main tool is the notion of realizability structure, in which the programs are written in λ-calculus.
In the present paper, we replace it with the notion of realizability algebra, which has many advantages: it is simpler, first order and much more practical for implementation.It is a three-sorted variant of the usual notion of combinatory algebra.Thus, the programming language is no longer the λ-calculus, but a suitable set of combinators ; remarkably enough, this is almost exactly the original set given by Curry.The λ-terms are now considered only as notations or abbreviations, very useful in fact: a λ-term is infinitely more readable than 1.Realizability algebras A realizability algebra is composed of three sets: Λ (the set of terms), Π (the set of stacks), Λ ⋆ Π (the set of processes) with the following operations: (ξ, η) → (ξ)η from Λ 2 into Λ (application) ; (ξ, π) → ξ .π from Λ×Π into Π (push) ; (ξ, π) → ξ ⋆ π from Λ×Π into Λ ⋆ Π (process) ; π → k π from Π into Λ (continuation).We have, in Λ, the distinguished elements B, C, E, I, K, W, cc, called elementary combinators or instructions.Notation.The term (. . .(((ξ)η 1 )η 2 ) . ..)η n will be also denoted by (ξ)η 1 η 2 . . .η n or even ξη 1 η 2 . . .η n .For example: ξηζ = (ξ)ηζ = (ξη)ζ = ((ξ)η)ζ.We define on Λ ⋆ Π a preorder relation, denoted by ≻.It is the least reflexive and transitive relation such that we have, for any ξ, η, ζ ∈ Λ and π, ̟ ∈ Π: Finally, we are given a subset ⊥ ⊥ of Λ ⋆ Π which is a terminal segment for this preorder, which means that: p ∈ ⊥ ⊥, p ′ ≻ p ⇒ p ′ ∈ ⊥ ⊥.In other words, we ask that ⊥ ⊥ be such that: c-terms and λ-terms.We call c-term a term which is built with variables, the elementary combinators B, C, E, I, K, W , cc and the application (binary function).A c-term is called closed if it contains no variable ; it will then also be called proof-like ; a proof-like term has a value in Λ.
Given a c-term t and a variable x, we define inductively on t, a new c-term denoted by λx t.
To this aim, we apply the first possible case in the following list: 1. λx t = (K)t if t does not contain x.
We easily see that this rewriting is finite, for any given c-term t: indeed, during the rewriting, no combinator is introduced inside t, but only in front of it.Moreover, the only changes in t are: moving parentheses and erasing occurrences of x.Now, rules 1 to 5 strictly decrease the part of t which remains under λx, and rule 6 can be applied consecutively only finitely many times.The λ-terms are defined as usual.But, in this paper, we consider λ-terms only as a notation for particular c-terms, by means of the above translation.This notation is essential, because almost every c-term we shall use, will be given as a λ-term.Theorem 1.2 gives the fundamental property of this translation.
Proof.By induction on n ; the case n = 0 is trivial.
Natural deduction.Before giving the formal language that we shall use, it is perhaps useful to describe informally the structures (models) we have in mind.They are second order structures, with two types of objects: individuals also called conditions and predicates (of various arity).Since we remain at an intuitive level, we start with a full model which we call the ground model.Such a model consists of: • an infinite set P (the set of individuals or conditions).
• the set of k-ary predicates is P(P k ) (full model).
• some functions from P k into P .
In particular, there is an individual 0 and a bijective function s : P → (P \ {0}).This enables us to define the set of integers N as the least set which contains 0 and which is closed for s.
There is also a particular condition denoted by 1 and an application denoted by ∧ from P 2 into P .
• some relations (fixed predicates) on P .In particular, we have the equality relation on individuals and the subset C of non trivial conditions.C[p∧q] reads as: "p and q are two compatible conditions".We now come to the formal language, in order to write formulas and proofs about such structures.It consists of: • individual variables or variables of conditions called x, y, . . .or p, q, . . .• predicate variables or second order variables X, Y, . . .; each predicate variable has an arity which is in N.
• function symbols on individuals f, g, . . .; each one has an arity which is in N.
In particular, there is a function symbol of arity k for each recursive function f : N k → N.This symbol will also be written as f .There is also a constant symbol 1 (which represents the greatest condition) and a binary function symbol ∧ (which represents the inf of two conditions).
The terms are built in the usual way with variables and function symbols.The atomic formulas are the expressions X(t 1 , . . ., t n ), where X is an n-ary predicate variable, and t 1 , . . ., t n are terms.
Formulas are built as usual, from atomic formulas, with the only logical symbols →, ∀: • each atomic formula is a formula ; • if A, B are formulas, then A → B is a formula ; • if A is a formula, then ∀x A and ∀X A are formulas.
We shall sometimes write F for a finite sequence of formulas F 1 , . . ., F k .Then, we shall also write ∃ y{ F } and ∀ y( F → ⊥) → ⊥.
x = y is the formula ∀Z(Zx → Zy), where Z is a unary predicate variable.
The rules of natural deduction are the following (the A i 's are formulas, the x i 's are variables of c-terms, t, u are c-terms): 1.
where x is an individual variable and τ is a term.6.
where X is a predicate variable of arity k and F an arbitrary formula.

Remark.
In the notation A[F/Xy 1 . . .y k ], the variables y 1 , . . ., y k are bound.A more usual notation is: A[λy 1 . . .λy k F/X].I prefer this one, to avoid confusion with the λ defined for c-terms.
Realizability.Given a realizability algebra A = (Λ, Π, Λ ⋆ Π, ⊥ ⊥), a A-model M consists of the following data: • An infinite set P which is the domain of variation of individual variables.
• The domain of variation of k-ary predicate variables is P(Π) P k .
• We associate with each k-ary function symbol f , a function from P k into P , denoted by f or even f if there is no ambiguity.
In particular, there is a distinguished element 0 in P and a function s : P → P (which is the interpretation of the symbol s).We suppose that s is a bijection from P onto P \ {0}.Then, we can identify s n 0 ∈ P with the integer n, and therefore, we have N ⊂ P .Each recursive function f : N k → N is, by hypothesis, a function symbol.Of course, we assume that its interpretation f : P k → P takes the same values as f on N k .Finally, we have also a condition 1 ∈ P and a binary function ∧ from P 2 into P .A closed term (resp.a closed formula) with parameters in the model M is, by definition, a term (resp.a formula) in which all free occurrences of each variable have been replaced with a parameter, i.e. an object of the same type in the model M: a condition for an individual variable, an application from P k into P(Π) for a k-ary predicate variable.Each closed term t, with parameters in M has a value t ∈ P .An interpretation I is an application which associates an individual (condition) with each individual variable and a parameter of arity k with each second order k-ary variable.
) is, by definition, the interpretation obtained by changing, in I, the value of the variable x (resp.X) and giving to it the value p ∈ P (resp.X ∈ P(Π) P k ).
For each formula F (resp. term t), we denote by F I (resp.t I ) the closed formula (resp.term) with parameters obtained by replacing each free variable with the value given by I.
For each closed formula F I with parameters in M, we define two truth values: F I is defined by recurrence on F : • F is atomic: then F I has the form X (t 1 , . . ., t k ) where X : P k → P(Π) and the t i 's are closed terms with parameters in M. We set X (t 1 , . . ., t k ) = X (t 1 , . . ., t k ).
Proof.By recurrence on the length of the derivation of x 1 : A 1 , . . ., x n : A n ⊢ t : A. We consider the last used rule.1.We have t = x i , A ≡ A i .Now, we have assumed that ξ i || − A I i ; and it is the desired result.2. We have t = uv and we already obtained:

By hypothesis on
By the induction hypothesis, we have v[ξ 1 /x 1 , . . ., ξ k /x k ] || − B I and therefore: But, by the induction hypothesis, we have also u

By hypothesis on ⊥ ⊥ and lemma
This follows from the induction hypothesis applied to x 1 : A 1 , . . ., x n : A n , x : B ⊢ u : C. 4. We have A ≡ ∀X B, and X is not free in A 1 , . . ., A n .We must show: indeed, since X is not free in A i , we have: Then, the induction hypothesis gives the result.6.We have A = B[F/Xy 1 . . .y n ] and we must show: X←X ] where X : P n → P(Π) is defined by: Proof.The proof is by induction on B. That is trivial if X is not free in B. Indeed, the only non trivial case of the induction is B = ∀Y C ; and then, we have Y = X and: Proof.We want to show that cc || − ((X → Y) → X ) → X .Thus, we take ξ || − (X → Y) → X and π ∈ X ; we must show that cc ⋆ ξ .π ∈ ⊥ ⊥, that is ξ ⋆ k π .π ∈ ⊥ ⊥.By hypothesis on ξ and π, it is sufficient to show that k π || − X → Y, which results from lemma 1.5.
Predicate symbols.In the following, we shall use extended formulas which contain predicate symbols (or predicate constants) R,S, . . . on individuals.Each one has an arity, which is an integer.In particular, we have a unary predicate symbol C (which represents the set of non trivial conditions).We have to add some rules of construction of formulas: • If F is a formula, R is a n-ary predicate constant and t 1 , . . ., t n are terms, then R(t 1 , . . ., t n ) → F and R(t 1 , . . ., t n ) → F are formulas.
• ⊤ is an atomic formula.In the definition of a A-model M, we add the following clause: • With each relation symbol R of arity n, we associate an application, denoted by R M or R, from P n into P(Λ).We shall also write |R(p 1 , . . ., p n )|, instead of R(p 1 , . . ., p n ), for p 1 , . . ., p n ∈ P .In particular, we have an application C : P → P(Λ), which we denote as |C[p]|.We define as follows the truth value in M of an extended formula: ii) If we have |R(p 1 , . . ., p n )| = ∅ ⇒ I ∈ |R(p 1 , . . ., p n )| for every p 1 , . . ., p n ∈ P , then:

Proof. Trivial.
Remark.By means of proposition 1.8, we see that, if the application R : P n → P(Λ) takes only the values {I} and ∅, we can replace R(t 1 , . . ., t n ) → F with R(t 1 , . . ., t n ) → F .
We define the binary predicate ≃ by putting |p ≃ q| = {I} if p = q and |p ≃ q| = ∅ if p = q.By the above remark, we can replace p ≃ q → F with p ≃ q → F .Proposition 1.9 shows that we can also replace p = q → F with p ≃ q → F .Notations.We shall write p = q → F instead of p ≃ q → F .Thus, we have: We shall write p = q for p = q → ⊥.Thus, we have: p = q = Π if p = q and p = q = ∅ if p = q.Using p = q → F instead of p = q → F , and p = q instead of p = q → ⊥, greatly simplifies the computation of the truth value of a formula which contains the symbol =.
In both cases, we get the desired result.

Remark.
Let R be a subset of P k and 1 R : P k → {0, 1} its characteristic function, defined as follows: Let us define the predicate R in the model M by putting: . By propositions 1.8 and 1.9, we see that R(x 1 , . . ., x n ) and 1 R (x 1 , . . ., x n ) = 1 are interchangeable.More precisely, we have: For each formula A[x 1 , . . ., x k ], we can define the k-ary predicate symbol N A , by putting 10 below shows that N A and ¬A are interchangeable ; this may simplify truth value computations.
Integers, storage and recursive functions.Recall that we have a constant symbol 0 and a unary function symbol s which is interpreted, in the model M by a bijective function s : P → (P \ {0}).
And also, that we have identified s n 0 with the integer n ; thus, we suppose N ⊂ P .We denote by int(x) the formula ∀X(∀y(Xy → Xsy), X0 → Xx).Let u = (u n ) n∈N be a sequence of elements of Λ.We define the unary predicate symbol e u by putting: Theorem 1.12.Let T u , S u ∈ Λ be such that S u || − (⊤ → ⊥), ⊤ → ⊥ and: for every ν, φ, ψ ∈ Λ and π ∈ Π. Then: T u is called a storage operator.
• If p / ∈ N, we define the unary predicate Y by putting: By hypothesis on ν, φ, π, we have: Thus, it suffices to show that S u || − ∀y(Y y → Y sy), i.e. S u || − Y q → Y sq for every q ∈ P .This is clear if q / ∈ {s i 0; 0 ≤ i < p}, since then Y sq = ∅.
Notation.We define the closed c-terms 0 = λxλy y ; σ = λnλf λx(f )(n)f x ; and, for each n ∈ N, we put n = (σ) n 0. We define the unary predicate symbol ent(x) by putting: In other words, ent(x) is the predicate e u (x) when the sequence u is (n) n∈N .Theorem 1.13.We put T = λf λn(n)Sf 0, with S = λgλx(g)(σ)x.Then, we have: Therefore, T is a storage operator (theorem 1.12).

Proof.
i) We immediately have, by theorem 1.2: Then, the result follows immediately, from theorem 1.12.ii) We must show I || − ent(p) → int(p) for every p ∈ P .We may suppose p ∈ N (otherwise ent(p) = ∅ and the result is trivial).Then, we must show: Therefore, we can find a unary predicate X : To move up from p to p + 1, let π ∈ Xs p+1 0 .We have: But, by induction hypothesis, we have σ p 0 ⋆ φ .ω .ρ ∈ ⊥ ⊥ for every ρ ∈ Xs p 0 .It follows that (σ p 0)φω || − Xs p 0. Since φ || − Xs p 0 → Xs p+1 0, we obtain φ ⋆ (σ p 0)φω .π ∈ ⊥ ⊥.Theorem 1.13 shows that we can use the predicate ent(x) instead of int(x), which greatly simplifies many computations.In particular, we define the universal quantifier restricted to integers ∀x int by putting ∀x int F ≡ ∀x(int(x) → F ). Thus, we can replace it with the universal quantifier restricted to ent(x) defined as follows: Therefore, the truth value of the formula ∀x ent F is much simpler than the one of the formula ∀x int F .
Theorem 1.14.Let φ : N → N be a recursive function.There exists a closed λ-term θ such that, if m ∈ N, n = φ(m) and f is a λ-variable, then θmf reduces into f n by weak head reduction.
This is a variant of the theorem of representation of recursive functions by λ-terms.It is proved in [13].
Theorem 1.15.Let φ : N k → N be a recursive function.We define, in M, a function symbol f , by putting f (s m 1 0, . . ., s m k 0) = s n 0 with n = φ(m 1 , . . ., m k ) ; we extend f on P k \ N k in an arbitrary way.Then, there exists a proof-like term θ such that: Proof.For simplicity, we assume k = 1.By theorem 1.13, it suffices to find a proof-like In other words: We can suppose that p = s m 0 (otherwise, -ent(p)| = ∅ and the result is trivial).Thus, we have ent(p) = {m} ; we must show: Take the λ-term θ given by theorem 1.14.From this theorem, we get: Remark.We have now found proof-like terms which realize all the axioms of second order arithmetic, with a function symbol for each recursive function.

Standard realizability algebras
A realizability algebra A is called standard if its set of terms Λ and its set of stacks Π are defined as follows: We have a countable set Π 0 which is the set of stack constants.
The terms and the stacks of A are finite sequences of elements of the set: . } which are obtained by the following rules: • if ξ is a term and π a stack, then ξ .π is a stack ; The set of processes of the algebra A is Λ×Π.If ξ ∈ Λ and π ∈ Π, the ordered pair (ξ, π) is denoted as ξ ⋆ π.
We define a preorder relation ≻, on Λ ⋆ Π.It is the least reflexive and transitive relation such that, for all ξ, η, ζ ∈ Λ and π, ̟ ∈ Π, we have: Finally, we have a subset ⊥ ⊥ of Λ ⋆ Π which is a final segment for this preorder, which means that: In other words, we ask that ⊥ ⊥ has the following properties: Remark.Thus, the only arbitrary elements in a standard realizability algebra are the set Π 0 of stack constants and the set ⊥ ⊥ of processes.
The axiom of choice for individuals (ACI).Let A be a standard realizability algebra and M a A-model, the set of individuals of which is denoted as P .Then, we have: For each closed formula ∀x 1 . . .∀x m ∀y F with parameters, there exists a function f : Proof.For p 1 , . . ., p m , k ∈ P , we define f (p 1 , . . ., p m , k) in an arbitrary way if k / ∈ N. If k ∈ N, we have k = n π k for one and only one stack π k ∈ Π.We define the function f (p 1 , . . ., p m , k) by means of the axiom of choice, in such a way that, if there exists q ∈ P such that: ] by hypothesis on π and by definition of f .ii) The proof is the same ; in fact, (ii) is weaker than

Remarks.
1.A seemingly simpler formulation of this axiom of choice is the existence of a function φ : This clearly follows from theorem 2.1: simply define φ(x 1 , . . ., x m ) as f (x 1 , . . ., x m , x) for the first integer x such that ¬F [f (x 1 , . . ., x m , x)/y] if there is such an integer ; otherwise, φ(x 1 , . . ., x m ) is arbitrary.But this function φ is not a function symbol, i.e. it cannot be defined in the ground model.For this reason, we prefer to use this axiom in the form stated in theorem 2.1, which is, after all, much simpler.
Generic models.Given a standard realizability algebra A and a A-model M, we now build a new realizability algebra B and a B-model N , which is called generic over M.Then, we shall define the notion of forcing, which is a syntactic transformation on formulas ; it is the essential tool in order to compute truth values in the generic model N .Thus, we consider a standard realizability algebra A and a A-model M, the set of individuals of which is P .We have a unary predicate C : P → P(Λ), a binary function ∧ : P2 → P and a distinguished individual 1 ∈ P .We suppose that the data {C, ∧, 1} constitute what we call a forcing structure in M, which means that we have the following property: There exist six proof-like terms α 0 , α 1 , α 2 , β 0 , β 1 , β 2 such that: We shall call C-expression any finite sequence of symbols of the form γ = (δ 0 )(δ 1 ) . . .(δ k ) where each δ i is one of the proof-like terms α 0 , α 1 , α 2 , β 0 , β 1 , β 2 .Such an expression is not a c-term, but γτ is, for every c-term τ ; the term γτ = (δ 0 )(δ 1 ) . . .(δ k )τ will also be written (γ)τ .Notation.A ∧-term is, by definition, a term which is written with the variables p 1 , . . ., p k , the constant 1 and the binary function symbol ∧.Let t(p 1 , . . ., p k ), u(p 1 , . . ., p k ) be two ∧terms.The notation: Thus, with this notation, the above hypothesis can be written as follows: α 0 :: (p∧q)∧r ⇒ p∧(q∧r) ; α 1 :: p ⇒ p∧1 ; α 2 :: p∧q ⇒ q ; β 0 :: p ⇒ p∧p ; β 1 :: p∧q ⇒ q∧p ; β 2 :: ((p∧q)∧r)∧s ⇒ (p∧(q∧r))∧s.
Theorem 2.5.Let t, u be two ∧-terms such that each variable of u appears in t.Then, there exists a C-expression γ such that γ :: t ⇒ u.
We define the elementary combinators B, C, E, I, K, W, cc of the algebra B by putting: Theorem 2.10.For every ξ, η, ζ ∈ Λ and π, ̟ ∈ Π, we have: Proof.We shall prove only the cases W, B, k π, cc.
For each closed c-term t (proof-like term), let us denote by t B its value in the algebra B (its value in the standard algebra A is t itself).Thus, we have t B = (t * , 1 t ), where t * is a proof-like term and 1 t a condition written with 1, ∧ and parentheses, which are obtained as follows, by recurrence on t: The model N .The B-model N has the same set P of individuals and the same functions as M.
By definition, the k-ary predicates of N are the applications from P k into P(Π).But, since Π = Π×P , they are the same as the applications from P k+1 into P(Π), i.e. the k + 1-ary predicates of the model M.
Each predicate constant R, of arity k, is interpreted, in the model M, by an application R M from P k into P(Λ).In the model N , this predicate constant is interpreted by the application R N : P k → P(Λ), where R N (p 1 , . . ., p k ) = R M (p 1 , . . ., p k )×{1}.
Theorem 2.11.If we have ⊢ t : A in classical second order logic, where A is a closed formula, then Proof.Immediate application of theorem 1.3 (adequacy lemma) in the B-model N .
The integers of the model N .Recall that we have put: σ = λnλf λx(f )(n)f x, 0 = λxλy y and n = (σ) n 0 for every integer n.Thus, we have σ B = (σ * , 1 σ ) and n B = ((σ Thus, the recursive definitions of n * , 1 n are the following: We can define the unary predicate ent(x) in the model N in two distinct ways: i) From the predicate ent(x) of the model M, by putting: ∈ N. ii) By using directly the definition of ent(x) in the model N ; we denote this predicate by ent N (x).Therefore, we have: ∈ N. From theorem 1.13, applied in the model N , we know that the predicates int(x) and ent N (x) are interchangeable.Theorem 2.13 shows that the predicates int(x) and ent(x) are also interchangeable.Thus, we have three predicates which define the integers in the model N ; it is the predicate ent(x) that we shall mostly use in the sequel.In particular, we shall often replace the quantifier ∀x int with ∀x ent .

Theorem 2.13.
There exist two proof-like terms T, J such that: Proof.i) We apply theorem 1.12 to the sequence u : N → Λ defined by u n = (n, 1).

Forcing
Forcing is a method to compute truth values of formulas in the generic B-model N .
For each k-ary predicate variable X, we add to the language a new predicate variable, denoted by X + , which has arity k + 1.In the A-model M, we use the variables X and X + ; in the B-model N , only the variables X.
With each k-ary second order parameter X : P k → P(Π) of the model N , we associate a (k + 1)-ary second order parameter X + : P k+1 → P(Π) of the model M. It is defined in an obvious way, since Π = Π×P ; we put: For each formula F written without the variables X + , with parameters in the model N , we define, by recurrence on F , a formula denoted by p [] − F (read " p forces F "), with parameters in the model A, written with the variables X + and a free condition variable p: Thus we have, in particular: Lemma 3.1.Let F be a formula the free variables of which are amongst X 1 , . . ., X k and let X 1 , . . ., X k be second order parameters in the model N , with corresponding arities.Then, we have: Proof.Immediate, by recurrence on F .
For each closed formula F with parameters in the model N , there exist two proof-like terms χ F , χ ′ F , which only depend on the propositional structure of F , such that we have: The propositional structure of F is the simple type built with only one atom O and the connective →, which is obtained from F by deleting all quantifiers, all symbols → with their hypothesis, and by identifying all atomic formulas with O.For instance, the propositional structure of the formula: Proof.By recurrence on the length of F .

By the recurrence hypothesis, we have (χ
), and therefore: The result is immediate, from the recurrence hypothesis.
The result is immediate, from the recurrence hypothesis.

Applying again the recurrence hypothesis, we have (χ
A formula F is said to be first order if it is obtained by the following rules: • ⊥ is first order.
• If A, B are first order, then A → B is first order.
• If B is first order, R is a predicate symbol and t 1 , . . ., t k are terms with parameters, then R(t 1 , . . ., t k ) → B, t 1 = t 2 → B are first order.
• If A is first order, then ∀x A is first order (x is an individual variable).

Remarks. i) If
A is a first order formula, it is the same for ∀x ent A. ii) This notion will be extended below (see proposition 4.3).Theorem 3.3.Let F be a closed first order formula.There exist two proof-like terms δ F , δ ′ F , which depend only on the propositional structure of F , such that we have: Proof.The proof is by recurrence on the construction of F following the above rules.
Hence the result, by the recurrence hypothesis.Suppose now that (ξ, p) Hence the result, by the recurrence hypothesis.
The generic ideal.We define a unary predicate J : P → P(Π) in the model N (second order parameter of arity 1), by putting J (p) = Π×{p} ; we call it the generic ideal.Thus, the binary predicate J + : P 2 → P(Π) which corresponds to it in the model M, is such that J + (p, q) = ∅ (resp.Π) if p = q (resp.p = q).In other words: J + (p, q) is the predicate p = q.The formula p || − J (q) is ∀r(C[p∧r] → J + (r, q)).Therefore, we have:
In the sequel, we shall often write Remark.We recall that C[p] is not a formula, but a subset of Λ ; in fact, in some realizability models which will be considered below, there will exist a formula C[p] such that: • If F is a closed formula, we shall write | − F to mean that there exists a proof-like term θ such that (θ, 1) | − F .From proposition 2.12(i), this is equivalent to say that there exists a proof-like term θ such that (θ, p) | − F for every p ∈ P .

Countable downward chain condition
In this section, we consider a standard realizability algebra A and a A-model M. We suppose that the set P (domain of variation of individual variables) has a power ≥ 2 ℵ 0 .We choose a surjection ε : P → P(Π) N and we define a binary predicate in the model M, which we denote also by ε, by putting: ∈ N (we use, for the predicate ε, the notation n ε p instead of ε(n, p)).Therefore, the predicate ε enables us to associate, with each individual, a set of integers which are its elements.Proposition 4.1 shows that the following axiom is realized: For every set, there exists an individual which has the same integer elements.This axiom will be called axiom of representation of predicates on N and denoted by RPN.Proof.This formula is ∀X(∀x[∀n(ent(n), Xn → n ε x), ∀n(ent(n), n ε x → Xn) → ⊥] → ⊥).Thus, we consider a unary parameter X : P → P(Π) and a term ξ ∈ Λ such that: We must show that λx(x)0 0 ⋆ ξ .π ∈ ⊥ ⊥, or else ξ ⋆ 0 .0 .π ∈ ⊥ ⊥ for every stack π ∈ Π.
By definition of ε, there exists p 0 ∈ P such that X n = n ε p 0 for every integer n.

But, we have
Recall that the predicate ent(x) is defined as follows: ∈ N. Therefore, we have to show: But this follows from η ⋆ρ ∈ ⊥ ⊥ and η ′ ⋆ρ ′ ∈ ⊥ ⊥, which is trivially true, since X n = n ε p 0 .
We suppose now that {C, ∧, 1} is a forcing structure in M. Then we define also the symbol ε in the B-model N by putting: where δ ′ = λxλy(χ ′ x)(α ′ )y and α ′ :: p ⇒ p∧1.

Proof.
We have (ξ, p) | − n ε p ⇔ (ξ, p) ⋆ (π, 1) ∈ ⊥ ⊥ ⊥ for all π ∈ n ε p , or else: p∧1] and π ∈ n ε p .Then,we have: ii) Suppose that (ξ, p) || − n ε q, τ ∈ C[p] and π ∈ n ε p .Then,we have: The notion of first order formula has been defined previously (see theorem 3.3).We extend this definition with the following clause: • t ε u is first order, for all terms t, u.Proposition 4.3 shows that theorem 3.3 remains true for this extended notion.We say that the forcing structure {C, ∧, 1} satisfies the countable downward chain condition (in abridged form c.d.c.) if there exists a proof-like term cdc such that: cdc || − ∀X[∀n ent ∃p X(n, p), ∀n ent ∀p∀q(X(n, p), X(n, q) → p = q), ∀n ent ∀p∀q(X(n, p), X(sn, q) → q ⊑ p) → ∃p ′ {∀n ent ∀p(X(n, p) → p ′ ⊑ p), (∀n ent ∀p(X(n, p) The intuitive meaning of this formula is: If X(n, p) is a decreasing sequence of conditions, then there exists a condition p ′ which is less than all of them ; moreover, if all these conditions are non trivial, then p ′ is non trivial.
The remaining of this section is devoted to the proof of theorem 4.5.
Definition of a sequence by dependent choices.In this section, we are given a fixed element p 0 ∈ P and a finite sequence of formulas with parameters F (n, p, p ′ ).We are also given a proof-like term dse such that: dse || − ∀n∀p∃p ′ F (n, p, p ′ ).
Remark.The aim of this section is to write down a formula Φ(x, y) which represents the graph of a function φ : N → P such that the formulas φ(0) = p 0 and ∀n ent F (n, φ(n), φ(n + 1)) are realized by proof-like terms.We shall only apply the results of this section to a particular sequence F of length 3.
This results immediately from: ) and thus: We now define the binary predicate: Φ(x, y) ≡ ∀X(∀n∀p∀k ent ( H(n, p, k), X(n, p) → X(sn, f (n, p, k))), X(0, p 0 ) → X(x, y)) and we show that Φ(x, y) is a sequence of conditions (functional relation on N) and also some other properties of Φ.
Remark.Intuitively, the predicate Φ is the graph of the function φ of domain N, recursively defined by the conditions: φ(0) = p 0 ; φ(n + 1) = f ′ (n, φ(n)) where f ′ (n, p) is f (n, p, k) for the least k such that F (n, p, f (n, p, k)).Unfortunately, we cannot introduce f ′ as a function symbol because, unlike f , it is not defined in the ground model.where rec = λkλxλ yλx ′ λzλu(zkx y)(x ′ )zu and y is a sequence of distinct variables of the same length as F .
Proof.We give a detailed proof, by recurrence on n.It enables us to write explicitly the proof-like term cdc2.

The ultrafilter axiom on N
Let us consider a standard realizability algebra A and a A-model M in which the individual set (which is also the set of conditions) is P = P(Π) N .The binary relation ε is defined by The axiom of representation of predicates on N (RPN).We define the following recursive function of arity k, denoted by (n 1 , . . ., n k ) (coding of k-uples): Proof.Let X : P k → P(Π) be a predicate of arity k.We define a ∈ P by putting: a(n) = X (n 1 , . . ., n k ) for n ∈ N, n = (n 1 , . . ., n k ).Then, we have immediately: The comprehension scheme for N (CSN).Let F [y, x 1 , . . ., x k ] be a formula the free variables of which are taken among y, x 1 , . . ., x k .We define a k-ary function g F : P k → P , in other words g F : P k ×N → P(Π) by putting g Proof.Indeed, we have trivially: Then, it suffices to apply theorem 1.13.
• t = u for all closed terms t, u which take distinct values in M. • ∀x int 1 . . .∀x int k (t(x 1 , . . ., x k ) = u(x 1 , . . ., x k )) for all the equations between terms which are true in N.
• The foundation scheme (SCF, see theorem 1.11ii) which consists of the formulas: → ∀x int (X 1 x, . . ., X k x → ⊥)} where f : P 2 → P is such that the relation f (y, x) = 1 is well founded on N.
• The axiom of choice scheme for individuals (ACI, see theorem 2.1) which consists of the formulas ∀ x(∀y int F ( x, f F ( x, y)) → ∀y F ( x, y)) ; x = (x 1 , . . ., x k ) is a finite sequence of variables, ∀ x∀y int F is an arbitrary closed formula, and f F is a function symbol of arity k + 1.
• The axiom of representation of predicates on N (RPN, see proposition 5.1) which consists of the formulas ∀X∃x∀ y int ((y 1 , . . ., y k ) ε x ↔ X y) ; y = (y 1 , . . ., y k ) is a sequence of k variables and X is a predicate variable of arity k.
• The comprehension scheme for integers (CSN, see proposition 5.2), which consists of the formulas ∀ x∀y int (y ε g F ( x) ↔ F [y, x]) ; x = (x 1 , . . ., x k ) is a sequence of k variables, ∀ x∀y int F is an arbitrary closed formula, and g F is a function symbol of arity k.Lemma 5.4.⊢ ∀p∀q(p ⊑ q ↔ ∃m int ∀n int (n + m ε p → n + m ε q)).
Remark.The intuitive meaning of D(h, X) is: h is the individual associated with the decreasing sequence of conditions X ′ , the n-th term of which is the intersection of the n first terms of the sequence X.
Remark.The intuitive meaning of Φ(k, h, n) is: " k is the first element of h n which is ≥ n ".
For each a ∈ P , we have δ(φ(q, a)) = q.But the application a → φ(q, a) is obviously injective, since φ(q, a) 1 = a.Thus, the set {φ(q, a); a ∈ P } is of cardinal 2 ℵ 0 .Now, by hypothesis on ⊳, every proper initial segment of P , for the well ordering ⊳, is of cardinal Theorem 6.11.The following formulas are realized in N : i) There exists a well ordering on the set of individuals.ii) There exists a well ordering on the power set of N.
Proof.i) Lemma 6.8 shows that, in N , the function δ is a surjection from G onto the set P of individuals.But, we have seen that the formula: " G is well ordered by ⊳ " is realized in N .ii) By theorems 4.4 and 6.4, the following formula is realized in N : " Every subset of N is represented by an individual ".Hence the result, by (i).Theorem 6.11(ii) enables us to transform into a program any proof of a formula of second order arithmetic, which uses the existence of a well ordering on R. The method is the same as the one explained above for the ultrafilter axiom.