Prerequisites. Direct starred prerequisites: Chapter 157. No later core chapter depends on this route.
The model of chapter 157 is sound and adequate, and those two properties leave the central question open in both directions. A strategy might describe behaviour that no program performs; and two programs indistinguishable by every context might still receive different strategies. Both possibilities are real, and this chapter settles them for one exact pair of a language and a model.
Take the strategy on (𝑜 ×𝑜) ⇒𝑜 that answers 𝗍𝗍 as soon as either argument answers 𝗍𝗍, without interrogating the other. It is deterministic, innocent and well-bracketed, so it lives in Gi. No PCF term denotes it. Take next the two terms 𝑇1:=𝜆𝑓.Ω𝜄,𝑇2:=𝜆𝑓.𝗂𝖿 (𝑓Ω𝜄) 𝗍𝗁𝖾𝗇 Ω𝜄 𝖾𝗅𝗌𝖾 Ω𝜄 of type (𝜄 →𝑜) →𝜄, where Ω𝜄 diverges. No context distinguishes them, since both diverge in every context; but their strategies differ, because [[𝑇2]] contains the play in which the argument is interrogated and [[𝑇1]] does not.
So the model is too small in one direction — it omits nothing, but a term cannot reach every strategy — and too large in the other. The first defect disappears once “strategy” is restricted to the compact ones; the second disappears once strategies are compared by what contexts can observe.
Observation
A context 𝐶[ ] of type 𝜄 for terms of type 𝜎 in context Γ is a term of type 𝜄 in the empty context with one hole, such that ⋅ ⊢𝐶[𝑀] :𝜄 whenever Γ ⊢𝑀 :𝜎. Define Γ⊢𝑀 ≲ 𝑁:𝜎ifffor all such 𝐶[] and all 𝑛, 𝐶[𝑀]⇓𝑛―― ⇒ 𝐶[𝑁]⇓𝑛――, and write 𝑀 ≈𝑁 when both approximations hold.
Referenced from 2 locations
Let Γ ⊢𝑀 :𝜎1 →⋯ →𝜎𝑘 →𝜄 and 𝑁 likewise. Then 𝑀 ≲𝑁 if and only if for every closing substitution 𝛾 of Γ by closed terms and all closed 𝑃1 :𝜎1,…,𝑃𝑘 :𝜎𝑘, 𝑀[𝛾]𝑃1⋯𝑃𝑘⇓𝑛―― ⟹ 𝑁[𝛾]𝑃1⋯𝑃𝑘⇓𝑛――.
Referenced from 6 locations
Proof of Lemma 158.2 — Context lemma
Proof. ( ⇒) is immediate: the applications are particular contexts.
( ⇐) Assume the right-hand condition and let 𝐶[ ] be a context with 𝐶[𝑀] ⇓𝑛――. Argue by induction on the length of the evaluation. PCF evaluation is deterministic and proceeds by decomposing the term into an evaluation context and a redex (lemma 154.3 applies verbatim to the recursion-free redexes and to 𝖿𝗂𝗑). If the hole is not in the redex position, the same decomposition applies to 𝐶[𝑁] and the induction hypothesis finishes. If the hole is in redex position, then the occurrence of 𝑀 is applied to some closed arguments 𝑃1,…,𝑃𝑗 and the whole is in an evaluation context, so the computation reaches 𝑀[𝛾] 𝑃1⋯𝑃𝑗 and this converges; the assumed condition supplies the same convergence for 𝑁, and the induction hypothesis applies to the remainder of the evaluation. Note that the arguments are closed because the surrounding context binds every variable of Γ at the moment the redex is reached. ◻
If [[𝑀]] ⊆[[𝑁]] then 𝑀 ≲𝑁.
Referenced from 3 locations
Proof of Proposition 158.3 — Soundness gives one half
Proof. The interpretation is functorial (theorem 157.11) and monotone in each argument for inclusion (lemma 157.18), so [[𝐶[𝑀]]] ⊆[[𝐶[𝑁]]] for every context. If 𝐶[𝑀] ⇓𝑛―― then 𝑞 𝑛 ∈[[𝐶[𝑀]]] by proposition 157.20, hence 𝑞 𝑛 ∈[[𝐶[𝑁]]], hence 𝐶[𝑁] ⇓𝑛―― by theorem 157.21. ◻
Proposition 158.3 cannot be reversed, as 𝑇1 and 𝑇2 above show: they are contextually equivalent and their strategies are incomparable. The correct semantic comparison is not inclusion.
For strategies 𝜌,𝜌′ on an arena [[𝜎]] put 𝜌≲int𝜌′iff𝑞𝑛∈𝛼∘𝜌 ⇒ 𝑞𝑛∈𝛼∘𝜌′ for every 𝛼 :[[𝜎]] ⇒𝜄 in Gi and every 𝑛. Write 𝜌 ≈int𝜌′ when both hold, and Gi/ ≈int for the quotient, whose morphisms are the ≈int-classes.
Referenced from 5 locations
≈int is a congruence for composition, pairing and currying, and the quotient of Gi by it is cartesian closed with the induced structure.
Referenced from 3 locations
Proof of Lemma 158.5 — The quotient is a cartesian closed category
Proof. Congruence for composition: if 𝜌 ≲int𝜌′ and 𝛽 is a strategy, then for every test 𝛼 the composite 𝛼 ∘𝛽 is again a test, so 𝛽 ∘𝜌 ≲int𝛽 ∘𝜌′; and precomposition is handled by the same argument with 𝛼 ∘( − ∘𝛾). Pairing and currying are congruences because by proposition 157.16 currying is the identity on sets of plays, and by proposition 157.15 a test on a product factors through one summand. The cartesian closed structure descends because its equations hold already in Gi. ◻
Compact strategies and decomposition
A strategy 𝜌 is compact when its view function f𝜌 is a finite set of 𝑃-views.
Referenced from 3 locations
Every innocent strategy is the union of the directed set of compact innocent strategies contained in it, and the compact ones are exactly the finite elements of the dcppo of lemma 157.18.
Referenced from 4 locations
Proof of Lemma 158.7 — Compact approximation
Proof. An innocent strategy is determined by its view function (definition 157.12), and every finite subset of a view function that is closed under even-length prefixes of views generates an innocent strategy contained in it; these form a directed family with union the whole. Finiteness in the dcppo: if 𝜌 is compact and 𝜌 ⊆⋃𝑖𝜌𝑖 with the family directed, each of the finitely many views of 𝜌 lies in some 𝜌𝑖, and directedness gives a single one. Conversely a finite element is contained in the union of its compact approximations, hence equals one of them. ◻
The definability argument analyses a compact strategy by its first move. The following normal form is what makes the analysis terminate.
Every PCF type is uniquely 𝜎 =𝜎1 →⋯ →𝜎𝑘 →𝛾 with 𝛾 ∈{𝜄,𝑜}. Write ar(𝜎) =𝑘.
Referenced from 2 locations
Let 𝜌 be an innocent strategy on [[𝜎1 →⋯ →𝜎𝑘 →𝛾]], regarded as a morphism [[𝜎1]] ×⋯ ×[[𝜎𝑘]] →𝛾 via proposition 157.16. The initial move is the question 𝑞 of 𝛾. Either 𝜌 has no response — and then 𝜌 =∅ — or its response is one of:
an answer 𝑐 of 𝛾, in which case f𝜌 ={𝑞 𝑐};
the initial question of some [[𝜎𝑖]], that is the head variable is 𝑥𝑖.
Referenced from 5 locations
Proof of Lemma 158.9 — First move
Proof. The initial move of an arrow arena is initial in the result arena by definition 157.3, so it is 𝑞. A 𝑃-move after 𝑞 must be enabled by a move in the current 𝑃-view, which is 𝑞 alone; the moves enabled by 𝑞 are the answers of 𝛾 and the initial moves of the [[𝜎𝑖]], again by definition 157.3. In case (1) well-bracketing closes the only pending question, so no further move is legal and the view function is as displayed. ◻
Let 𝜌 be a compact innocent well-bracketed strategy as in lemma 158.9, case (2), with first response the initial question of [[𝜎𝑖]], where 𝜎𝑖 =𝜏1 →⋯ →𝜏𝑚 →𝛿. Then there are compact innocent well-bracketed strategies 𝜌1,…,𝜌𝑚on[[𝜎1]]×⋯×[[𝜎𝑘]]→𝜏𝑗,and(𝜌𝑐)𝑐 indexed by the answers 𝑐 of 𝛿, each on [[𝜎1]] ×⋯ ×[[𝜎𝑘]] →𝛾, all with view functions strictly smaller than f𝜌, such that 𝜌 = [[𝖼𝖺𝗌𝖾]](𝑥𝑖𝜌1⋯𝜌𝑚; (𝑐↦𝜌𝑐)), where 𝖼𝖺𝗌𝖾 is the 𝛾-indexed conditional built from 𝗂𝖿 and 𝗓𝖾𝗋𝗈.
Referenced from 8 locations
Proof of Lemma 158.10 — Decomposition
Proof. After 𝑞 and the initial question of [[𝜎𝑖]], the legal 𝑂-moves are the initial questions of the [[𝜏𝑗]] — the argument asking for its 𝑗th input — and the answers 𝑐 of 𝛿. Innocence means 𝜌 is determined by its behaviour on each of these branches separately. Define 𝜌𝑗 to be the strategy whose view function consists of the views of f𝜌 beginning with 𝑞, the question of [[𝜎𝑖]], and the initial question of [[𝜏𝑗]], with that three-move prefix replaced by the initial question of 𝜏𝑗; and 𝜌𝑐 similarly for the branch after the answer 𝑐, with the prefix replaced by 𝑞. Each is innocent by construction, well-bracketed because the deleted prefix opens and closes nothing, and compact because f𝜌 is finite. Each has strictly fewer views than 𝜌, since the view 𝑞 followed by the question of [[𝜎𝑖]] belongs to f𝜌 and to none of them. The displayed equation is the statement that 𝜌’s behaviour on every play is recovered by dispatching on the branch, which is exactly innocence together with the case analysis of the legal 𝑂-moves. ◻
Every compact innocent well-bracketed strategy 𝜌 :[[Γ]] →[[𝜎]] is [[𝑀]] for some Γ ⊢𝑀 :𝜎.
Referenced from 11 locations
Proof of Theorem 158.11 — Definability
Proof. Induction on the size of f𝜌, with lemma 158.9 and lemma 158.10 as the case analysis. Write 𝜎 =𝜎1 →⋯ →𝜎𝑘 →𝛾 and, using proposition 157.16, regard 𝜌 as a morphism out of [[Γ]] ×[[𝜎1]] ×⋯ ×[[𝜎𝑘]].
If f𝜌 =∅, take 𝑀:=𝜆⃗𝑥. Ω𝛾; its strategy is ∅ by definition 157.19. If 𝜌 answers immediately with 𝑐, take 𝑀:=𝜆⃗𝑥. 𝑐. Otherwise lemma 158.10 supplies the smaller strategies; by the induction hypothesis they are [[𝑀𝑗]] and [[𝑀𝑐]] for terms in the extended context, and 𝑀:=𝜆⃗𝑥.𝖼𝖺𝗌𝖾 (𝑥𝑖𝑀1⋯𝑀𝑚) 𝗈𝖿 (𝑐↦𝑀𝑐) has [[𝑀]] =𝜌, since the interpretation of 𝖼𝖺𝗌𝖾 and of application are exactly the dispatch and the question in lemma 158.10, and the interpretation is functorial. Two points require care and are the only ones where the argument is delicate. First, the case analysis over answers 𝑐 of 𝛿 is infinite when 𝛿 =𝜄; compactness makes all but finitely many branches equal to ∅, and the finitely many exceptions are enumerated by a nest of 𝗂𝖿-tests on equality with a numeral, definable in PCF. Second, the pointer structure must be respected: the term above reconstructs the pointer of each 𝑂-move as the occurrence of 𝑥𝑖 that asked, which is correct because a compact innocent strategy’s views determine the justifiers uniquely (lemma 157.5). ◻
Full abstraction
For Γ ⊢𝑀 :𝜎 and Γ ⊢𝑁 :𝜎, 𝑀≲𝑁if and only if[[𝑀]]≲int[[𝑁]].
Referenced from 10 locations
Proof of Theorem 158.13 — Inequational full abstraction
Proof. ( ⇐) Let 𝐶[ ] be a context with 𝐶[𝑀] ⇓𝑛――. The interpretation of a context is a strategy 𝛼 with [[𝐶[𝑀]]] =𝛼 ∘[[𝑀]], by functoriality (theorem 157.11). By proposition 157.20 and theorem 157.21, 𝑞 𝑛 ∈𝛼 ∘[[𝑀]]; the hypothesis gives 𝑞 𝑛 ∈𝛼 ∘[[𝑁]]; and adequacy again gives 𝐶[𝑁] ⇓𝑛――.
( ⇒) Let 𝛼 :[[𝜎]] ⇒𝜄 and suppose 𝑞 𝑛 ∈𝛼 ∘[[𝑀]]. A single interaction sequence witnesses this, and it is finite, so by lemma 158.7 there are compact 𝛼0 ⊆𝛼 and a compact 𝜌0 ⊆[[𝑀]] with 𝑞 𝑛 ∈𝛼0 ∘𝜌0. By theorem 158.11 there is a term 𝑥 :𝜎 ⊢𝐴 :𝜄 with [[𝐴]] =𝛼0. Take the context 𝐶[ ]:=𝐴[ /𝑥], closing Γ by any closed terms. Then 𝑞 𝑛 ∈[[𝐶[𝑀]]] because 𝛼0 ∘𝜌0 ⊆[[𝐶[𝑀]]] and inclusion is monotone, so 𝐶[𝑀] ⇓𝑛―― by theorem 157.21. The hypothesis 𝑀 ≲𝑁 gives 𝐶[𝑁] ⇓𝑛――, hence 𝑞 𝑛 ∈𝛼0 ∘[[𝑁]] by soundness, hence 𝑞 𝑛 ∈𝛼 ∘[[𝑁]] by monotonicity. As 𝛼 and 𝑛 were arbitrary, this is [[𝑀]] ≲int[[𝑁]]. ◻
𝑀 ≈𝑁 if and only if [[𝑀]] ≈int[[𝑁]]; equivalently, the interpretation into the quotient Gi/ ≈int of lemma 158.5 is fully abstract for PCF.
Referenced from 3 locations
Proof of Corollary 158.14 — Equational full abstraction
Proof. Apply theorem 158.13 in both directions; the reformulation is the definition of the quotient. ◻
The uninquotiented model is not fully abstract: 𝑇1 ≈𝑇2 for the terms of the chapter opening, while [[𝑇1]] ≠[[𝑇2]].
Referenced from 4 locations
Proof of Corollary 158.15 — Why the quotient is needed
Proof. Both terms diverge in every context, since every application of either to any argument reduces to Ω𝜄; hence 𝑇1 ≈𝑇2 by lemma 158.2. Their strategies differ because [[𝑇2]] contains the play in which the argument’s initial question is asked — the interpretation of 𝑓 Ω𝜄 asks 𝑓 before diverging — and [[𝑇1]] has empty view function beyond the initial question. ◻
Let 𝜌:=[[𝐹1]] for 𝐹1 =𝜆𝑓. 𝑓 (𝑓 0) of example 157.22, and let 𝐹3:=𝜆𝑓.𝑓0 : (𝜄→𝜄)→𝜄,𝜌′:=[[𝐹3]]. Both strategies answer the initial question by interrogating 𝑓. They differ at the 𝑃-view 𝑞0 𝑞1 𝑞2: there 𝜌 plays 𝑞′1, a second interrogation of 𝑓, while 𝜌′ plays the literal 0.
Following the proof of theorem 158.13, take the compact test that supplies an argument answering 0 by 1 and 1 by 0; by theorem 158.11 it is denoted by a term, and unwinding lemma 158.10 that term is 𝐴:=𝜆𝑔.𝑔(𝜆𝑦.𝗂𝖿 𝗓𝖾𝗋𝗈(𝑦) 𝗍𝗁𝖾𝗇 1 𝖾𝗅𝗌𝖾 0). Then 𝐴 𝐹1 ⇓0――, because the inner call returns 1 and the outer call at 1 returns 0; while 𝐴 𝐹3 ⇓1――, because the single call at 0 returns 1. The context was not guessed: it is the term denoted by the compact strategy witnessing the first difference of the two view functions.
The pair 𝐹1,𝐹2 of example 157.22 would not serve here. Those two strategies also differ, but the terms are contextually equivalent: when 𝑓 0 evaluates to 0 the two branches of 𝐹2 agree, and when it does not, 𝐹2 computes 𝑓 (𝑓 0), which is what 𝐹1 computes. By theorem 158.13 their strategies are therefore ≈int-equal while remaining distinct, which is corollary 158.15 once more.
Referenced from 3 locations
★★☆ Use lemma 158.2 to prove that Ω𝜎 ≲𝑀 for every closed 𝑀 :𝜎, and then show semantically that [[Ω𝜎]] =∅ is ≲int-least, checking the two directions of theorem 158.13 on this instance.
Referenced from 2 locations
★★☆ Show that the compact strategies are not closed under composition in general by exhibiting two compact strategies whose composite is not compact, or prove that no such pair exists. Then say where theorem 158.13 uses only the existence of some compact approximants and not closure.
Referenced from 2 locations
★★★ Let por be the strategy of the chapter opening on (𝑜 ×𝑜) ⇒𝑜. Show that it is compact, and conclude from theorem 158.11 that it must be PCF-definable — then find the error in that conclusion by checking por against definition 157.4. State precisely which condition it violates.
Referenced from 2 locations
Boundary and seminar
The results are lemma 158.2, theorem 158.11, theorem 158.13 and corollary 158.14, for one exact pair: the language PCF of definition 157.17 and the model Gi of corollary 157.14, compared by the intrinsic preorder of definition 158.4. Five boundaries belong to the statements.
First, definability is for compact strategies (definition 158.6); an arbitrary innocent strategy is only a directed union of denotable ones (lemma 158.7), and the union need not be denotable. Second, the model without the quotient is not fully abstract, and corollary 158.15 proves it; no statement above should be read as full abstraction for Gi itself. Third, remark 158.12 names the single imported step and its exact signature; the rest of theorem 158.11 is proved here. Fourth, all three play conditions of definition 157.4 are used: relaxing them changes which strategies exist and therefore both directions of theorem 158.13. Fifth, nothing here transfers to a language with probabilistic or nondeterministic choice: lemma 158.2 uses determinism of evaluation, definition 158.4 uses a single observation at 𝜄, and a probabilistic language requires its own model, its own observation and its own proof.
Two independent primary developments own the definability and full-abstraction results for PCF, and they are kept separate above rather than merged: the arena-and-innocent-strategy presentation followed here, and the presentation using histories and the intrinsic quotient. The conceptual distinctions among definability, universality, full completeness and full abstraction are [Cur07]; the lecture route through finite strategies and decomposition is [Abr03]; the operational background, including the context lemma, is [Har16, Plo77]; and the historical origin of contextual observation is Morris’s thesis on the lambda calculus, retained in the chapter’s dossier for that purpose alone.
[4]
Suggested first pass.
Begin with exercise 158.4, then exercise 158.5, and finish with exercise 158.7.
★★★ Carry out lemma 158.10 completely for a compact strategy on ((𝜄 →𝜄) →𝜄) →𝜄 of your choosing with at least five views: display the branches, the smaller strategies, and the term produced by theorem 158.11, and check by hand that the term’s strategy is the one you started from.
Referenced from 3 locations
★★★ Prove that ≲int of definition 158.4 is a preorder and that inclusion implies it, and give two strategies that are ≈int-equal and incomparable under inclusion. Then show that ≈int is not equality on any arena with at least two answers, and identify the smallest such arena.
Referenced from 3 locations
★★★ Extend PCF by a constant 𝗉𝗈𝗋 :𝑜 →𝑜 →𝑜 with the three evaluation rules that make it the parallel disjunction. State the play condition of definition 157.4 that must be relaxed for [[𝗉𝗈𝗋]] to exist, and determine which steps of proposition 157.9, theorem 158.11 survive the relaxation. Do not assert a full-abstraction theorem for the extended language.
Referenced from 2 locations
★★★ Practical project.strategy-definability-compiler Implement the algorithm of theorem 158.11: read a compact innocent well-bracketed strategy as a finite view-function table over the arenas of definition 157.17, and emit a PCF term. The program must implement lemma 158.9 as the top-level case split and lemma 158.10 as the recursive step, and it must maintain the invariant that every recursive call receives a table with strictly fewer views, so that the recursion terminates. It must print, for each named input, the emitted term, the view function recomputed from that term by the interpreter of exercise 157.8, and whether the two tables are equal. The acceptance test is: the empty table emits a diverging term; a table answering immediately emits a constant; the table of [[𝐹1]] from example 157.22 round-trips to an equal table; the table of [[𝐹3]] from example 158.16 round-trips to an equal table, and applying the context 𝐴 of that example to the two emitted terms evaluates to the two printed numerals 0 and 1; and a table violating innocence is rejected before compilation begins. Round-tripping finitely many tables is evidence for theorem 158.11 on those inputs; it proves neither that theorem nor theorem 158.13, and it says nothing about non-compact strategies.
Referenced from 3 locations