Prerequisites. Direct starred prerequisites: none. No later core chapter depends on this route.
An intuitionistic realizer of an implication is a program that turns realizers of the premise into realizers of the conclusion. Try to build one for double-negation elimination. Write ¬𝐴 for 𝐴 ⇒⊥. A realizer of ¬¬𝐴 ⇒𝐴 must accept a program 𝑧 that, given any refutation of 𝐴, produces an absurdity, and must return a realizer of 𝐴. The only material available is 𝑧, and the only way to use 𝑧 is to supply it with a refutation of 𝐴; but a refutation of 𝐴 is not something the realizer has, and manufacturing one is exactly the problem to be solved. The attempt 𝜆𝑧.𝑧(𝜆𝑤.?) stalls at the hole: whatever is written there must already be a realizer of 𝐴.
The repair changes what a proposition denotes. Instead of interpreting 𝐴 by the programs that establish it, interpret 𝐴 by the stacks that refute it, and recover the programs by an orthogonality condition against a fixed set of forbidden interactions. A program then realizes 𝐴 when it survives every refutation of 𝐴; and a program may survive a refutation by using it, which is what a control operator does. With that change the hole above is filled by a captured continuation, and the term 𝜆𝑧. 𝖼𝖼 (𝜆𝑘. 𝑧 𝑘) realizes double-negation elimination.
Three parameters are fixed before anything is proved: a machine, a set of processes called the pole, and a language. This chapter fixes the machine and the pole first (section 145.1, section 145.2), then the interpretation (section 145.3), then proves that control operators realize the classical axioms (section 145.4) and that every proof of the frozen system realizes its conclusion (section 145.5). The tripos and forcing connections are named only after all of that, in section 145.6, and no theorem of this chapter depends on them.
The 𝜆𝑐-calculus and its machine
Fix a countable set K of instructions containing a distinguished element 𝖼𝖼, and a nonempty countable set Π0 of stack constants. Terms, stacks and processes are generated by 𝑡,𝑢::=𝑥∣𝜆𝑥.𝑡∣𝑡𝑢∣𝜅∣𝑘𝜋(𝜅∈K),𝜋,𝜋′::=𝛼∣𝑡⋅𝜋(𝛼∈Π0, 𝑡 closed),𝑝,𝑞::=𝑡∗𝜋(𝑡 closed). Write Λ for the closed terms, Π for the stacks and Λ ∗Π for the processes. A term containing no continuation constant 𝑘𝜋 is proof-like; PL denotes the set of closed proof-like terms.
Referenced from 5 locations
The two sets are defined by a simultaneous induction: a stack 𝑡 ⋅𝜋 contains a term, and a term 𝑘𝜋 contains a stack. Π is nonempty because Π0 is, and that is used in corollary 145.23.
Evaluation is a preorder ≻ on Λ ∗Π containing 𝑃𝑢𝑠ℎ𝑡𝑢∗𝜋≻𝑡∗𝑢⋅𝜋𝐺𝑟𝑎𝑏(𝜆𝑥.𝑡)∗𝑢⋅𝜋≻𝑡[𝑢/𝑥]∗𝜋𝑆𝑎𝑣𝑒𝖼𝖼∗𝑢⋅𝜋≻𝑢∗𝑘𝜋⋅𝜋𝑅𝑒𝑠𝑡𝑜𝑟𝑒𝑘𝜋∗𝑢⋅𝜋′≻𝑢∗𝜋 and closed under reflexivity and transitivity. The relation is a parameter of the calculus, exactly like K and Π0: it is required to contain these four rules and is not required to be the least such relation.
Referenced from 9 locations
Push and Grab implement weak head reduction. Save hands the current stack to the program as the term 𝑘𝜋; Restore discards whatever stack has since accumulated and reinstalls 𝜋. The pattern in which 𝖼𝖼 is normally used chains the two: 𝖼𝖼(𝜆𝑘.𝑡)∗𝜋𝑃𝑢𝑠ℎ≻𝖼𝖼∗(𝜆𝑘.𝑡)⋅𝜋𝑆𝑎𝑣𝑒≻(𝜆𝑘.𝑡)∗𝑘𝜋⋅𝜋𝐺𝑟𝑎𝑏≻𝑡[𝑘𝜋/𝑘]∗𝜋. The body 𝑡 runs with the name 𝑘 bound to the stack that was current when 𝖼𝖼 was reached. Applying 𝑘 to an argument abandons the computation in progress and restarts that stack.
Let 𝑡:=𝖼𝖼 (𝜆𝑘. 𝜆𝑥. 𝑘 (𝜆𝑦. 𝑢)) and evaluate 𝑡 ∗𝑣 ⋅𝜋. By (145.1) with the stack 𝑣 ⋅𝜋, 𝑡∗𝑣⋅𝜋≻(𝜆𝑥.𝑘𝑣⋅𝜋(𝜆𝑦.𝑢))∗𝑣⋅𝜋𝐺𝑟𝑎𝑏≻𝑘𝑣⋅𝜋(𝜆𝑦.𝑢)∗𝜋𝑃𝑢𝑠ℎ≻𝑘𝑣⋅𝜋∗(𝜆𝑦.𝑢)⋅𝜋, and then Restore gives (𝜆𝑦. 𝑢) ∗𝑣 ⋅𝜋 ≻𝑢[𝑣/𝑦] ∗𝜋. The argument 𝑣 has been consumed twice: once by the abandoned 𝜆𝑥 and once by the reinstated 𝜆𝑦. No pure 𝜆-term behaves this way: the rules Push and Grab by themselves never lengthen a stack that has already been shortened.
Referenced from 3 locations
Put ――0:=𝜆𝑥𝑦.𝑥,𝗌:=𝜆𝑛𝑥𝑦.𝑦(𝑛𝑥𝑦),――――𝑛+1:=𝗌――𝑛. Every ――𝑛 is proof-like.
Referenced from 4 locations
★☆☆ Evaluate (𝜆𝑥𝑦. 𝑡) 𝑢 𝑣 ∗𝜋 to the process 𝑡[𝑢/𝑥][𝑣/𝑦] ∗𝜋, naming the rule used at each of the four steps.
Referenced from 2 locations
★★☆ Evaluate ――2 ∗𝑢 ⋅𝑣 ⋅𝜋 and show that the result is 𝑣 (𝑣 𝑢) ∗𝜋 up to the rules of definition 145.2. Then explain why ――𝑛 is not the Church numeral, and exhibit the 𝛽-equivalence between them.
Referenced from 2 locations
Poles and orthogonality
A pole is a set ⟂ ⟂ ⊆Λ ∗Π closed under anti-evaluation: if 𝑝 ≻𝑞 and 𝑞 ∈⟂ ⟂ then 𝑝 ∈⟂ ⟂.
Referenced from 4 locations
Read 𝑝 ∈⟂ ⟂ as “the interaction 𝑝 is admissible”. The closure condition is stated backwards along evaluation because a process is judged by what it becomes.
Fix a pole. For 𝑆 ⊆Π and 𝑇 ⊆Λ put 𝑆⟂:={𝑡∈Λ∣𝑡∗𝜋∈⟂⟂ for every 𝜋∈𝑆},𝑇⟂:={𝜋∈Π∣𝑡∗𝜋∈⟂⟂ for every 𝑡∈𝑇}.
Referenced from 2 locations
For all 𝑆,𝑆′ ⊆Π and 𝑇 ⊆Λ:
if 𝑆 ⊆𝑆′ then 𝑆′⟂ ⊆𝑆⟂, and likewise for subsets of Λ;
𝑆 ⊆𝑆⟂⟂ and 𝑇 ⊆𝑇⟂⟂;
𝑆⟂⟂⟂ =𝑆⟂;
(⋃𝑖𝑆𝑖)⟂ =⋂𝑖𝑆⟂𝑖.
Referenced from 4 locations
Proof of Lemma 145.7 — Orthogonality is a Galois connection
Proof. (1) A term orthogonal to every stack in the larger set is orthogonal to every stack in the smaller one.
(2) Let 𝜋 ∈𝑆 and 𝑡 ∈𝑆⟂. By the definition of 𝑆⟂, 𝑡 ∗𝜋 ∈⟂ ⟂. As 𝑡 was arbitrary in 𝑆⟂, this says 𝜋 ∈𝑆⟂⟂.
(3) By (2) applied to 𝑆⟂ ⊆Λ we get 𝑆⟂ ⊆𝑆⟂⟂⟂. By (2) applied to 𝑆 and then (1), 𝑆 ⊆𝑆⟂⟂ gives 𝑆⟂⟂⟂ ⊆𝑆⟂.
(4) 𝑡 ∈(⋃𝑖𝑆𝑖)⟂ says 𝑡 ∗𝜋 ∈⟂ ⟂ for every 𝜋 lying in some 𝑆𝑖, which is the conjunction over 𝑖 of 𝑡 ∈𝑆⟂𝑖. ◻
The empty set is a pole: the closure condition is vacuous. For it, 𝑆⟂ =Λ when 𝑆 =∅ and 𝑆⟂ =∅ otherwise. For a fixed process 𝑞, the set ⟂ ⟂𝑞:={𝑝 ∣𝑝 ≻𝑞} is a pole, because ≻ is transitive. The second is used to prove converses: membership in ⟂ ⟂𝑞 is the statement that a process eventually reaches 𝑞.
Referenced from 5 locations
Falsity values, truth values, and realizability
Fix a pole. For a closed formula with parameters, define ‖𝐴‖ ⊆Π by ‖˙𝐹(𝑒1,…,𝑒𝑘)‖:=𝐹(𝑒ℕ1,…,𝑒ℕ𝑘),‖𝐴⇒𝐵‖:=|𝐴|⋅‖𝐵‖={𝑡⋅𝜋∣𝑡∈|𝐴|, 𝜋∈‖𝐵‖},‖∀𝑥𝐴‖:=⋃𝑛∈ℕ‖𝐴[――𝑛ℕ/𝑥]‖,‖∀𝑋𝐴‖:=⋃𝐹:ℕ𝑘→P(Π)‖𝐴[˙𝐹/𝑋]‖, where 𝑒ℕ is the value of the closed first-order term 𝑒 in the standard model, and |𝐴|:=‖𝐴‖⟂. A term 𝑡 realizes 𝐴 with respect to the pole when 𝑡 ∈|𝐴|, and 𝑡 is a universal realizer of 𝐴 when 𝑡 ∈|𝐴| for every pole. Both truth and falsity values depend on the pole; the notation suppresses it, and the dependence is displayed whenever two poles occur in one argument.
Referenced from 13 locations
The definition of ‖ ⋅‖ is by induction on the formula; the clause for ⇒ mentions |𝐴|, which is ‖𝐴‖⟂ and therefore already defined at the smaller formula 𝐴. Nothing is defined by induction on truth values.
For every closed 𝐴 with parameters, |∀𝑥𝐴|=⋂𝑛∈ℕ|𝐴[――𝑛ℕ/𝑥]|,|∀𝑋𝐴|=⋂𝐹|𝐴[˙𝐹/𝑋]|, and |𝐴 ⇒𝐵| ⊆|𝐴| →|𝐵|, where |𝐴| →|𝐵|:={𝑡 ∈Λ ∣𝑡 𝑢 ∈|𝐵| for all 𝑢 ∈|𝐴|}.
Referenced from 3 locations
Proof of Lemma 145.11 — Truth values of quantifiers
Proof. The two equalities are lemma 145.7(4) applied to the unions in definition 145.10. For the inclusion, let 𝑡 ∈|𝐴 ⇒𝐵|, 𝑢 ∈|𝐴| and 𝜋 ∈‖𝐵‖. Then 𝑢 ⋅𝜋 ∈‖𝐴 ⇒𝐵‖, so 𝑡 ∗𝑢 ⋅𝜋 ∈⟂ ⟂. Since 𝑡 𝑢 ∗𝜋 𝑃𝑢𝑠ℎ≻𝑡 ∗𝑢 ⋅𝜋 and the pole is closed under anti-evaluation, 𝑡 𝑢 ∗𝜋 ∈⟂ ⟂. As 𝜋 was arbitrary, 𝑡 𝑢 ∈|𝐵|. ◻
★☆☆ Compute ‖∀𝑋 𝑋‖ and |∀𝑋 𝑋| for the empty pole, and for the pole ⟂ ⟂𝑞 of example 145.8. Which of the two makes ∀𝑋 𝑋 realized?
Referenced from 2 locations
★★☆ Prove the claim of remark 145.12 that 𝑡 ∈|𝐴| →|𝐵| implies 𝜆𝑥. 𝑡 𝑥 ∈|𝐴 ⇒𝐵|, naming the rule of definition 145.2 and the closure property of the pole used at each step (four lines).
Referenced from 2 locations
Control operators realize the classical axioms
Fix a pole throughout this section. The two theorems below are the reason the interpretation was arranged around stacks: they read a computational rule of definition 145.2 directly as a logical property, with no induction on formulas.
If 𝜋 ∈‖𝐴‖ then 𝑘𝜋 ∈|𝐴 ⇒𝐵| for every closed 𝐵 with parameters.
Referenced from 4 locations
Proof of Proposition 145.13 — Typing a continuation constant
Proof. Let 𝜋′ ∈‖𝐴 ⇒𝐵‖. By definition 145.10, 𝜋′ =𝑢 ⋅𝜋″ with 𝑢 ∈|𝐴| and 𝜋″ ∈‖𝐵‖. Then 𝑘𝜋∗𝜋′=𝑘𝜋∗𝑢⋅𝜋″𝑅𝑒𝑠𝑡𝑜𝑟𝑒≻𝑢∗𝜋, and 𝑢 ∗𝜋 ∈⟂ ⟂ because 𝑢 ∈|𝐴| and 𝜋 ∈‖𝐴‖. Closure under anti-evaluation gives 𝑘𝜋 ∗𝜋′ ∈⟂ ⟂. As 𝜋′ was arbitrary, 𝑘𝜋 ∈‖𝐴 ⇒𝐵‖⟂. ◻
The stack 𝜋″ is discarded by Restore and never examined; that is why 𝐵 may be any formula. A continuation constant is a realizer of an implication whose conclusion it never has to produce.
For all closed 𝐴,𝐵 with parameters, 𝖼𝖼 ∈|((𝐴 ⇒𝐵) ⇒𝐴) ⇒𝐴|. Since the pole was arbitrary, 𝖼𝖼 is a universal realizer.
Referenced from 6 locations
Proof of Theorem 145.14 — cc realizes Peirce's law
Proof. Let 𝜋 ∈‖((𝐴 ⇒𝐵) ⇒𝐴) ⇒𝐴‖. By definition 145.10, 𝜋 =𝑡 ⋅𝜋′ with 𝑡 ∈|(𝐴 ⇒𝐵) ⇒𝐴| and 𝜋′ ∈‖𝐴‖. By Save, 𝖼𝖼∗𝑡⋅𝜋′≻𝑡∗𝑘𝜋′⋅𝜋′. Now 𝜋′ ∈‖𝐴‖, so proposition 145.13 gives 𝑘𝜋′ ∈|𝐴 ⇒𝐵|, whence 𝑘𝜋′⋅𝜋′∈|𝐴⇒𝐵|⋅‖𝐴‖=‖(𝐴⇒𝐵)⇒𝐴‖. Since 𝑡 realizes that formula, 𝑡 ∗𝑘𝜋′ ⋅𝜋′ ∈⟂ ⟂, and closure under anti-evaluation gives 𝖼𝖼 ∗𝜋 ∈⟂ ⟂. ◻
Neither proof used any property of the pole beyond definition 145.5, and neither inspected 𝐴 or 𝐵. The next proposition shows that the correspondence between machine behavior and realized formulas runs in both directions.
A closed term 𝑡 is identity-like when 𝑡 ∗𝑢 ⋅𝜋 ≻𝑢 ∗𝜋 for all 𝑢 ∈Λ and 𝜋 ∈Π.
Referenced from 2 locations
A closed term 𝑡 is identity-like if and only if 𝑡 is a universal realizer of ∀𝑋 (𝑋 ⇒𝑋).
Referenced from 4 locations
Proof of Proposition 145.16 — Behavior determines the formula
Proof. From behavior to realizability. Let 𝑡 be identity-like, fix a pole, and let 𝜋 ∈‖∀𝑋 (𝑋 ⇒𝑋)‖. By definition 145.10 that set is ⋃𝑆⊆Π‖˙𝑆 ⇒˙𝑆‖, so 𝜋 ∈‖˙𝑆 ⇒˙𝑆‖ =𝑆⟂ ⋅𝑆 for some 𝑆, that is, 𝜋 =𝑢 ⋅𝜋′ with 𝑢 ∈𝑆⟂ and 𝜋′ ∈𝑆. Then 𝑢 ∗𝜋′ ∈⟂ ⟂ by the definition of 𝑆⟂, and 𝑡 ∗𝜋 =𝑡 ∗𝑢 ⋅𝜋′ ≻𝑢 ∗𝜋′, so 𝑡 ∗𝜋 ∈⟂ ⟂ by anti-evaluation.
From realizability to behavior. Let 𝑡 realize ∀𝑋 (𝑋 ⇒𝑋) for every pole, and fix 𝑢 ∈Λ and 𝜋 ∈Π. Choose the pole ⟂ ⟂ :={𝑝 ∣𝑝 ≻𝑢 ∗𝜋} of example 145.8 and the falsity value 𝑆:={𝜋}. Then 𝑢 ∗𝜋 ∈⟂ ⟂ by reflexivity of ≻, so 𝑢 ∈𝑆⟂, and therefore 𝑢⋅𝜋∈𝑆⟂⋅𝑆=‖˙𝑆⇒˙𝑆‖⊆‖∀𝑋(𝑋⇒𝑋)‖. Since 𝑡 realizes the formula at this pole, 𝑡 ∗𝑢 ⋅𝜋 ∈⟂ ⟂, which by the definition of this particular pole says 𝑡 ∗𝑢 ⋅𝜋 ≻𝑢 ∗𝜋. ◻
The second half is the pattern used throughout classical realizability to prove converses: a single process is turned into a pole, and a single stack into a falsity value, so that “realizes” collapses to the one behavioral statement wanted.
Each of 𝜆𝑥. 𝑥, 𝜆𝑥. 𝖼𝖼 (𝜆𝑘. 𝑥) and 𝜆𝑥. 𝖼𝖼 (𝜆𝑘. 𝑘 𝑥) is identity-like, hence by proposition 145.16 a universal realizer of ∀𝑋 (𝑋 ⇒𝑋). For the second, by (145.1), (𝜆𝑥. 𝖼𝖼 (𝜆𝑘. 𝑥)) ∗𝑢 ⋅𝜋 ≻𝖼𝖼 (𝜆𝑘. 𝑢) ∗𝜋 ≻𝑢 ∗𝜋, the captured continuation being discarded. For the third, the captured 𝑘𝜋 is applied to 𝑢, and Restore sends 𝑢 to the same 𝜋. A realizer therefore carries no information about which proof produced it.
Referenced from 3 locations
★★☆ Show that 𝜆𝑧. 𝖼𝖼 (𝜆𝑘. 𝑧 𝑘) is a universal realizer of ∀𝑋 ((¬𝑋 ⇒⊥) ⇒𝑋), where ¬𝐴:=𝐴 ⇒⊥ and ⊥:=∀𝑋 𝑋. Reduce to theorem 145.14 by identifying the instance of Peirce’s law used, and say which step needs ‖⊥‖ =Π.
Referenced from 2 locations
★★☆ Show that no proof-like term built from 𝜆-abstraction and application alone is a universal realizer of Peirce’s law. Hint: for such a term, every process it produces from 𝑡 ⋅𝜋′ has a stack extending 𝜋′, and no rule shortens a stack; choose a pole recording that invariant.
Referenced from 2 locations
Adequacy
Proof terms are 𝑡,𝑢 ::=𝑥 ∣𝜆𝑥. 𝑡 ∣𝑡 𝑢 ∣𝖼𝖼 and a typing context is Γ =𝑧1 :𝐴1,…,𝑧𝑛 :𝐴𝑛. The judgment Γ ⊢𝑡 :𝐴 is generated by (𝑧:𝐴)∈ΓΓ⊢𝑧:𝐴 𝐴𝑥Γ⊢𝖼𝖼:((𝐴⇒𝐵)⇒𝐴)⇒𝐴 𝑃𝑒𝑖𝑟𝑐𝑒Γ,𝑧:𝐴⊢𝑡:𝐵Γ⊢𝜆𝑧.𝑡:𝐴⇒𝐵 ⇒−𝐼Γ⊢𝑡:𝐴⇒𝐵Γ⊢𝑢:𝐴Γ⊢𝑡𝑢:𝐵 ⇒−𝐸Γ⊢𝑡:𝐴𝑥∉FV(Γ)Γ⊢𝑡:∀𝑥𝐴 ∀1−𝐼Γ⊢𝑡:∀𝑥𝐴Γ⊢𝑡:𝐴[𝑒/𝑥] ∀1−𝐸Γ⊢𝑡:𝐴𝑋∉FV(Γ)Γ⊢𝑡:∀𝑋𝐴 ∀2−𝐼Γ⊢𝑡:∀𝑋𝐴Γ⊢𝑡:𝐴[𝑃/𝑋] ∀2−𝐸 where 𝑒 ranges over first-order terms and 𝑃 over predicates 𝜆𝑥1…𝑥𝑘. 𝐶 of the language.
Referenced from 6 locations
Only ⇒ and the two universal quantifiers are primitive; the other connectives are the usual second-order abbreviations, and no rule mentions them. Proof terms are proof-like: no continuation constant occurs in definition 145.18.
A valuation 𝜌 assigns a natural number 𝜌(𝑥) to each first-order variable and a falsity function 𝜌(𝑋) :ℕ𝑘 →P(Π) to each second-order variable of arity 𝑘. 𝐴[𝜌] is the closed formula with parameters obtained by replacing each free 𝑥 by (the numeral naming) 𝜌(𝑥) and each free 𝑋 by ˙𝜌(𝑋). Fix a pole. The judgment 𝑧1 :𝐴1,…,𝑧𝑛 :𝐴𝑛 ⊢𝑡 :𝐴 is adequate when for every valuation 𝜌 and all 𝑢1 ∈|𝐴1[𝜌]|,…,𝑢𝑛 ∈|𝐴𝑛[𝜌]|, 𝑡[𝑢1/𝑧1,…,𝑢𝑛/𝑧𝑛]∈|𝐴[𝜌]|. A rule is adequate when adequacy of its premises implies adequacy of its conclusion.
Referenced from 3 locations
For every formula 𝐴, valuation 𝜌, first-order term 𝑒 and predicate 𝑃 =𝜆⃗𝑥. 𝐶, (𝐴[𝑒/𝑥])[𝜌]=𝐴[𝜌[𝑥↦𝑒ℕ[𝜌]]],(𝐴[𝑃/𝑋])[𝜌]=𝐴[𝜌[𝑋↦𝐹𝑃,𝜌]], where 𝐹𝑃,𝜌(⃗𝑛):=‖𝐶[𝜌][⃗𝑛/⃗𝑥]‖.
Referenced from 4 locations
Proof of Lemma 145.20 — Substitution in falsity values
Proof. Induction on 𝐴. At an atom 𝑋(𝑒1,…,𝑒𝑘) with 𝑋 the substituted variable, the left-hand side is ‖𝐶[𝜌][⃗𝑒ℕ/⃗𝑥]‖ by definition 145.10 and the right-hand side is 𝐹𝑃,𝜌(⃗𝑒ℕ), the same set by the definition of 𝐹𝑃,𝜌. At an atom whose head is a different variable or a parameter, both sides are unchanged. The clause for ⇒ applies the induction hypotheses to the two immediate subformulas, and the two quantifier clauses apply them under each substitution instance, the bound variable being chosen outside dom(𝜌), outside the free variables of 𝑒 and outside those of 𝐶. ◻
Fix a pole. Every rule of definition 145.18 is adequate, and therefore every derivable judgment is adequate.
Referenced from 4 locations
Proof of Theorem 145.21 — Adequacy
Proof. Induction on the derivation; each case checks definition 145.19 for the conclusion. Fix a valuation 𝜌, fix realizers 𝑢𝑖 of 𝐴𝑖[𝜌], and abbreviate the simultaneous substitution by 𝜃:=[𝑢1/𝑧1,…,𝑢𝑛/𝑧𝑛].
Ax. 𝑡 =𝑧𝑗 and 𝐴 =𝐴𝑗, so 𝑡[𝜃] =𝑢𝑗, which lies in |𝐴𝑗[𝜌]| by hypothesis.
Peirce. 𝑡 =𝖼𝖼, which is closed, so 𝑡[𝜃] =𝖼𝖼; theorem 145.14 at the formulas 𝐴[𝜌] and 𝐵[𝜌] gives the membership.
⇒-I. Let 𝜋 ∈‖𝐴[𝜌] ⇒𝐵[𝜌]‖, so 𝜋 =𝑢 ⋅𝜋′ with 𝑢 ∈|𝐴[𝜌]| and 𝜋′ ∈‖𝐵[𝜌]‖. Then (𝜆𝑧.𝑡)[𝜃]∗𝑢⋅𝜋′=(𝜆𝑧.𝑡[𝜃])∗𝑢⋅𝜋′𝐺𝑟𝑎𝑏≻𝑡[𝜃][𝑢/𝑧]∗𝜋′, the bound name 𝑧 being chosen distinct from every 𝑧𝑖 and fresh for every 𝑢𝑖. The induction hypothesis for the premise, applied to the extended list of realizers 𝑢1,…,𝑢𝑛,𝑢, gives 𝑡[𝜃][𝑢/𝑧] ∈|𝐵[𝜌]|, hence 𝑡[𝜃][𝑢/𝑧] ∗𝜋′ ∈⟂ ⟂; anti-evaluation finishes the case.
⇒-E. By the induction hypotheses 𝑡[𝜃] ∈|𝐴[𝜌] ⇒𝐵[𝜌]| and 𝑢[𝜃] ∈|𝐴[𝜌]|. Lemma 145.11 gives 𝑡[𝜃] 𝑢[𝜃] ∈|𝐵[𝜌]|, and (𝑡 𝑢)[𝜃] =𝑡[𝜃] 𝑢[𝜃].
∀1-I. By definition 145.10, ‖(∀𝑥 𝐴)[𝜌]‖ =⋃𝑛‖𝐴[𝜌[𝑥 ↦𝑛]]‖, so by lemma 145.7(4) |(∀𝑥 𝐴)[𝜌]| =⋂𝑛|𝐴[𝜌[𝑥 ↦𝑛]]|. Fix 𝑛. Since 𝑥 is not free in Γ, the hypotheses 𝑢𝑖 ∈|𝐴𝑖[𝜌]| read equally as 𝑢𝑖 ∈|𝐴𝑖[𝜌[𝑥 ↦𝑛]]|, so the induction hypothesis at the valuation 𝜌[𝑥 ↦𝑛] gives 𝑡[𝜃] ∈|𝐴[𝜌[𝑥 ↦𝑛]]|. As 𝑛 was arbitrary, 𝑡[𝜃] lies in the intersection.
∀1-E. By the induction hypothesis 𝑡[𝜃] ∈|(∀𝑥 𝐴)[𝜌]| =⋂𝑛|𝐴[𝜌[𝑥 ↦𝑛]]|. Take 𝑛:=𝑒ℕ[𝜌]; then 𝑡[𝜃] ∈|𝐴[𝜌[𝑥 ↦𝑛]]|, which equals |(𝐴[𝑒/𝑥])[𝜌]| by lemma 145.20.
∀2-I and ∀2-E. The same two arguments with falsity functions in place of natural numbers: the union in definition 145.10 is over all 𝐹 :ℕ𝑘 →P(Π), the side condition 𝑋 ∉FV(Γ) makes the hypotheses on the 𝑢𝑖 independent of 𝐹, and the elimination case instantiates 𝐹 at 𝐹𝑃,𝜌, which is the falsity function named by lemma 145.20.
Every rule being adequate, an induction on the derivation gives adequacy of every derivable judgment. ◻
If ⊢𝑡 :𝐴 with 𝐴 closed, then 𝑡 ∈PL and 𝑡 ∈|𝐴| for every pole.
Referenced from 3 locations
Proof of Corollary 145.22 — Proofs give universal realizers
Proof. 𝑡 is proof-like because definition 145.18 produces no continuation constant. Apply theorem 145.21 with 𝑛 =0 at an arbitrary pole and an arbitrary valuation; 𝐴 is closed, so 𝐴[𝜌] =𝐴. ◻
There is no proof term 𝑡 with ⊢𝑡 :∀𝑋 𝑋.
Referenced from 4 locations
Proof of Corollary 145.23 — Consistency
Proof. By definition 145.10, ‖∀𝑋 𝑋‖ is the union of ‖˙𝐹‖ =𝐹 over all 𝐹 :P(Π) of arity 0, that is, over all subsets of Π; so ‖∀𝑋 𝑋‖ =Π. Take the empty pole (example 145.8). Then |∀𝑋𝑋|=Π⟂={𝑡∈Λ∣𝑡∗𝜋∈∅ for every 𝜋∈Π}=∅, the last equality because Π ≠∅: the set Π0 of stack constants is nonempty by definition 145.1. If ⊢𝑡 :∀𝑋 𝑋 held, corollary 145.22 would put 𝑡 in the empty set. ◻
Corollary 145.23 is the payoff of the arrangement. It uses the whole chapter: the syntax to know that Π is nonempty, the pole axiom to know that ∅ is admissible, the definition of falsity values to compute ‖∀𝑋 𝑋‖, and adequacy to connect the computation to derivability.
What the model does not do
The machine of definition 145.2 is not required to normalize, and nothing above uses confluence. Definition 145.2 fixes ≻ as a parameter containing four rules; adding instructions and rules to K and to ≻ preserves every proof in this chapter, because each proof used only closure of the pole under anti-evaluation and the four displayed rules in the forward direction. That extensibility is the point of axiomatizing evaluation rather than defining it.
Suggested first pass.
Begin with exercise 145.7 and exercise 145.9, then complete exercise 145.11.
★★☆ Write the complete machine trace of 𝖼𝖼 (𝜆𝑘. 𝜆𝑥. 𝑘 𝑥) ∗𝑢 ⋅𝜋, naming the rule at each step, and identify the stack that is discarded. Then say which line of the proof of theorem 145.14 corresponds to each step.
Referenced from 3 locations
★★☆ Show that the poles of definition 145.5 are closed under arbitrary intersection and arbitrary union, so that they form a complete lattice ordered by inclusion. Identify its top and bottom elements, and show that 𝐴 is realized with respect to the top pole for every closed 𝐴.
Referenced from 2 locations
★★★ (Storage.) Call a closed term 𝑀 a storage operator when 𝑀∗𝑡⋅𝑢⋅𝜋≻𝑡∗――𝑛⋅𝑢⋅𝜋 for every 𝑡 realizing ――𝑛 ∈N, where N is the relativization predicate of remark 145.24. Prove that 𝑀:=𝜆𝑛.𝜆𝑓.𝑛(𝜆𝑔.𝑔――0)(𝜆ℎ.𝜆𝑔.ℎ(𝜆𝑦.𝑔(𝗌𝑦)))(𝜆𝑧.𝑧)𝑓 satisfies this specification for the numerals of definition 145.4, or repair it and prove the repaired term correct. State exactly which clause of definition 145.10 makes the specification a statement about all poles.
Referenced from 3 locations
★★★ Practical project.krivine-machine-and-realizer-checker Implement the Krivine machine of definition 145.2 together with a checker for the two decidable specifications used in this chapter. The machine takes a closed term and a stack, both given as syntax trees over the grammar of definition 145.1, and a step budget; it returns either the process reached after that many steps or the first process on which no rule applies. Continuation constants are represented by the stack they carry, so that Restore is a genuine stack replacement and not a return.
Invariant. After every step the machine’s state is a well-formed process: the term is closed, and every 𝑘𝜋 occurring in it carries a stack built only from closed terms and stack constants. The implementation checks this invariant after each step and aborts, naming the offending subterm, rather than continuing on a malformed state.
Concrete result. For the identity-like test the program takes a closed term 𝑡, a finite list of test pairs (𝑢,𝜋), and reports for each pair either identity-like together with the trace witnessing 𝑡 ∗𝑢 ⋅𝜋 ≻𝑢 ∗𝜋, or not identity-like together with the process at which the trace stopped. For the storage test it takes a term 𝑀 and a bound 𝑁 and reports, for each 𝑛 ≤𝑁, whether 𝑀 ∗――𝑛 ⋅𝑢 ⋅𝜋 reaches 𝑢 ∗――𝑛 ⋅𝜋.
Acceptance test. With Π0 ={𝛼} and 𝑢:=𝜆𝑥. 𝑥: the three terms of example 145.17 must all report identity-like on the pair (𝑢,𝛼); the trace of the third must contain a Save step followed by a Restore step, and the trace of the second must contain a Save step and no Restore step. On the pair (𝜔,𝛼) with 𝜔:=𝜆𝑧. 𝑧 𝑧, the term 𝜆𝑥. 𝑥 𝑥 must report not identity-like with budget exhausted, and the printed last process must have a stack strictly longer than 𝛼. Finally, run the term of example 145.3 applied to two copies of 𝑢, against the stack 𝛼, for nine steps: the trace must contain two Grab steps and must end with a Restore step whose stack is the saved 𝑢 ⋅𝛼 and not the caller’s 𝛼. A run in which Restore returns to the caller instead of installing 𝜋 passes the three identity-like checks unchanged and fails only here, which is why the acceptance test includes it: the two stacks coincide on the identity-like probes and differ exactly on this one.
Referenced from 3 locations
Sources. The 𝜆𝑐-calculus, the Krivine abstract machine, poles, falsity and truth values, and the adequacy theorem follow A. Miquel, An Introduction to Krivine Realizability, course notes, Universidad de la República, 2021 (79 slides). Definition 145.1 and definition 145.4 are on physical page 30 and 31; the machine rules of definition 145.2 and the derived pattern (145.1) are on physical pages 31–32; the type system of definition 145.18 is on physical page 15, and the classical axioms it derives on page 17; the second-order arithmetic of remark 145.24 and the relativization 𝐴 ↦𝐴N are on physical pages 19–21; poles, falsity values and truth values by orthogonality are on physical pages 40–42; the typing of 𝑘𝜋 and of 𝖼𝖼 proved as proposition 145.13, theorem 145.14 and the identity-like characterization of proposition 145.16 are on physical pages 45–46 and 43–45; and the definition of adequate judgment together with the statement proved here as theorem 145.21 is on physical page 53, where the source leaves the proof as an exercise. The peer-reviewed development of the same apparatus, with the specification and witness-extraction results that this chapter does not import, is M. Guillermo and É. Miquey, Classical realizability and arithmetical formulæ, Mathematical Structures in Computer Science 27 (2017), 1068–1107. A gradual route with solved exercises is Barbarossa and Guerrieri [BG25]; the comparison with forcing, including the machine-checked historical development, is Rieg [Rie14b, Rie14a], and the categorical reading is Miquey [Miq17]. Realizability as a source of categorical models is developed in chapter 144; see remark 145.25 for what would have to be proved to connect the two.