Exercise 91.1.
The pair 𝑝 is canonical as soon as its outer pair constructor is visible. Neither (𝜆𝑥. 0) Ω nor 1 +2 is evaluated to establish that fact. The first spread performs 𝗌𝗉𝗋𝖾𝖺𝖽(𝑝;𝑥,𝑦.𝑥)⟶∗(𝜆𝑥.0)Ω⟶∗0. The first contraction inspects only the outer constructor of 𝑝; the second substitutes Ω into a body in which the bound variable does not occur. Thus no step evaluates Ω. The second spread performs 𝗌𝗉𝗋𝖾𝖺𝖽(𝑝;𝑥,𝑦.𝑦)⟶∗1+2⟶∗3. Here the left component, including its occurrence of Ω, is discarded. Only the selected right component is evaluated.
Exercise 91.2.
If 𝑆(𝑚,𝑛), then |𝑛 −𝑚| =|𝑚 −𝑛| =1, so 𝑆 is symmetric. It is not transitive: 𝑆(0,1) and 𝑆(1,2) hold, whereas 𝑆(0,2) does not. Its PER domain would be {𝑚∈ℤ∣𝑆(𝑚,𝑚)}={𝑚∈ℤ∣0=1}=∅. The empty domain does not repair the failure of transitivity on arguments outside that domain; 𝑆 is therefore not a PER.
Write 𝑇(𝑚,𝑛) when 2 divides 𝑚 −𝑛. Reflexivity follows from 2 ∣0, symmetry from 2 ∣𝑑 ⇒2 ∣ −𝑑, and transitivity from closure of divisibility under addition: 2∣(𝑚−𝑛),2∣(𝑛−𝑘)⟹2∣(𝑚−𝑘). Hence 𝑇 is an equivalence relation, in particular a PER, and 𝑇(𝑚,𝑚) holds for every integer. Its domain is all of ℤ.
Exercise 91.3.
Integer addition gives 2 +1 ⇓3, while the canonical integer 3 evaluates to itself. Thus 𝑅ℤ(2 +1,3) holds by (91.1). The witness 𝖺𝗑𝗂𝗈𝗆 also evaluates to itself, so all three conjuncts of (91.4) hold. Therefore 𝖬𝖾𝗆𝑖(𝖺𝗑𝗂𝗈𝗆;𝖤𝗊𝖨𝗇𝗍(2+1,3)). Evaluation is used first to compute the two endpoints and then to expose the canonical equality witness; integer equality is used to see that both endpoints compute to the same integer.
For 𝖤𝗊𝖨𝗇𝗍(2,3), the endpoints are distinct canonical integers. Determinism rules out an integer 𝑧 to which both evaluate, so 𝑅ℤ(2,3) is false. Equation (91.4) therefore assigns the empty member relation to this equality type, independently of the proposed witness. It has no member.
Exercise 91.4.
Apply (91.11) in each case: −1⇓−1,−1<0,so −1 is not a member;0⇓0,0≥0,so 0 is a member;(𝜆𝑥.𝑥)4⟶∗4,4≥0,so (𝜆𝑥.𝑥)4 is a member. Root contraction of Ω reproduces Ω, so it does not evaluate to any integer. The existential in (91.11) has no witness, and Ω is not a member. Divergence and convergence to a negative integer are distinct reasons for rejection.
Exercise 91.5.
Take the two raw representatives 𝑟:=0,𝑠:=(𝜆𝑧.𝑧)0. Both evaluate to 0 and are therefore equal in ℕ. On the abstract two-element set {𝑟,𝑠}, this is the total PER. Write 𝑡 ≡𝗋𝖺𝗐𝑠 for literal equality of raw syntax. Define a total, representation-sensitive assignment on every closed representative 𝑡 by 𝐵(𝑡):={ℕ,if 𝑡≡𝗋𝖺𝗐𝑠,𝖨𝗇𝗍,otherwise. Thus 𝐵(𝑟) =𝖨𝗇𝗍 and 𝐵(𝑠) =ℕ. Every closed instance is a type, so a test that substitutes one representative at a time accepts it. Pointwise functionality also compares the equal substitutions [𝑟/𝑥] and [𝑠/𝑥] and would require 𝖳𝗒𝖤𝗊𝑖(𝖨𝗇𝗍,ℕ). This is false: −1 belongs to the integer PER but not to the natural-number PER. The pair [𝑟/𝑥] ≡𝑥:ℕ[𝑠/𝑥] therefore exposes the failure. Such source-spelling inspection is not a valid functional Nuprl family; the example isolates exactly what the two-substitution condition excludes.
Exercise 91.6.
At input 𝑛, successor has raw output 𝑛 +1 in the set type 𝖨𝗇𝖼(𝑛)={𝑚:ℕ∣𝖤𝗊ℕ(𝑚,𝑛+1)}. The predicate is inhabited by 𝖺𝗑𝗂𝗈𝗆, but (91.5) relates the ambient members themselves and does not pair them with predicate evidence. At 𝑛 =2, the result is therefore the program 2 +1 ⇓3.
For the dependent pair ∑𝑚:ℕ𝖤𝗊ℕ(𝑚,𝑛+1), the dependent-pair specification uses (𝑛 +1,𝖺𝗑𝗂𝗈𝗆). At 𝑛 =2, beta contraction gives 𝑠2⇝0(2+1,𝖺𝗑𝗂𝗈𝗆). This pair is canonical before either component is evaluated. Projecting its first component and demanding a natural numeral gives 2 +1 ⇓3; the second projection gives 𝖺𝗑𝗂𝗈𝗆. Thus its observed components are 3 and 𝖺𝗑𝗂𝗈𝗆, although lazy evaluation does not reduce under the pair constructor merely to expose the outer value. Equation (91.3) retains both components, whereas (91.5) uses only inhabitance of the predicate relation. This accounts for the visible 𝖺𝗑𝗂𝗈𝗆 in exactly one result.
Exercise 91.7.
Define the relation program 𝐸3(𝑚,𝑛):=𝖤𝗊𝖨𝗇𝗍((𝑚−𝑛)mod3,0), where mod is signed integer remainder. At every old-system level 𝑖, equality formation derives 𝖳𝗒𝑖(𝐸3(𝑚,𝑛)). If equal integer representatives replace 𝑚,𝑛, their computed values are unchanged, so both instances normalize to the same canonical equality type 𝖤𝗊𝖨𝗇𝗍(𝑟,0), where 𝑟 is their common signed remainder. Thus 𝖳𝗒𝖤𝗊𝑖 relates the two instances, proving the functionality clause. The condition 𝖨𝗇𝗁𝑖(𝐸3(𝑚,𝑛)) holds exactly when 𝑟 =0, so it is equivalent to 3 ∣(𝑚 −𝑛), and the other admissibility clauses are 3∣(𝑚−𝑚)=0,3∣(𝑚−𝑛)⟹3∣(𝑛−𝑚)=−(𝑚−𝑛),3∣(𝑚−𝑛), 3∣(𝑛−𝑘)⟹3∣(𝑚−𝑘)=(𝑚−𝑛)+(𝑛−𝑘). Thus 𝐸3 is admissible at every old-system level.
As candidate endomaps 𝖨𝗇𝗍/𝐸3 →𝖨𝗇𝗍/𝐸3, successor respects the quotient because (𝑚+1)−(𝑛+1)=𝑚−𝑛. Absolute value does not. The representatives 1 and −2 are equal modulo 3, since 1 −( −2) =3, but their absolute values are 1 and 2, whose difference is not divisible by 3.
Exercise 91.8.
For function transitivity, assume 𝑅Π(𝑓,𝑔) and 𝑅Π(𝑔,ℎ) and take 𝑅𝐴(𝑎,𝑐). The PER laws give 𝑅𝐴(𝑐,𝑐). Instantiating the first function relation at (𝑎,𝑐) and the second at (𝑐,𝑐) gives 𝑅𝑎,𝑐𝐵(𝑓𝑎,𝑔𝑐),𝑅𝑐,𝑐𝐵(𝑔𝑐,ℎ𝑐). The middle application is 𝑔 𝑐. Functionality identifies 𝑅𝑎,𝑐𝐵 with 𝑅𝑐,𝑐𝐵, and transitivity in that common fiber relates 𝑓 𝑎 to ℎ 𝑐. Symmetry reverses the domain relation and then uses symmetry in the identified fiber.
For pairs, write the two premises as 𝑝⇓(𝑎,𝑢),𝑞⇓(𝑏,𝑣),𝑅𝐴(𝑎,𝑏),𝑅𝑎,𝑏𝐵(𝑢,𝑣),𝑞⇓(𝑏′,𝑣′),𝑟⇓(𝑐,𝑤),𝑅𝐴(𝑏′,𝑐),𝑅𝑏′,𝑐𝐵(𝑣′,𝑤). Determinism of evaluation gives (𝑏,𝑣) =(𝑏′,𝑣′), hence 𝑏 =𝑏′ and 𝑣 =𝑣′. Base transitivity gives 𝑅𝐴(𝑎,𝑐); functionality puts the two component relations in the fiber 𝑅𝑎,𝑐𝐵; fiber transitivity then gives 𝑅𝑎,𝑐𝐵(𝑢,𝑤).
The need for functionality is witnessed by a finite countermodel. Give {0,1} the total base PER and take four distinct results 𝑢,𝑣,𝑤,𝑧. Let the nontrivial equivalence classes of the four fiber PERs be (0,0){𝑢,𝑤}(0,1){𝑢,𝑣},{𝑤,𝑧}(1,0){𝑢,𝑣,𝑤}(1,1){𝑢,𝑣,𝑧}. With 𝑓(0) =𝑓(1) =𝑢, 𝑔(0) =𝑤, 𝑔(1) =𝑣, ℎ(0) =𝑤, and ℎ(1) =𝑧, the four fiber checks show 𝑅Π(𝑓,𝑔) and 𝑅Π(𝑔,ℎ). But the (0,1) check for 𝑅Π(𝑓,ℎ) asks that 𝑢 and 𝑧 lie in one class of the (0,1) fiber, which they do not. Likewise, (0,𝑢) 𝑅Σ (1,𝑣),(1,𝑣) 𝑅Σ (1,𝑧), but the first and last pairs are not related. Every displayed fiber is a PER; the failure is precisely that equal base inputs do not identify the fiber PERs.
Exercise 91.9.
Write 𝜎=(𝑎,𝑢,𝑔),𝜏=(𝑎′,𝑢′,𝑔′) for substitutions into the three hypotheses. They are equal exactly when the left-to-right construction yields 𝖬𝖾𝗆𝖤𝗊𝑖(𝑎,𝑎′;ℕ),𝖬𝖾𝗆𝖤𝗊𝑖(𝑢,𝑢′;𝖤𝗊ℕ(𝑎,𝑎)),𝖬𝖾𝗆𝖤𝗊𝑖(𝑔,𝑔′;∏𝑥:ℕℕ), together with the type equalities that make the second components legitimate. The first hypothesis is functional because ℕ is closed. For the second, equality of 𝑎,𝑎′ makes 𝖤𝗊ℕ(𝑎,𝑎) and 𝖤𝗊ℕ(𝑎′,𝑎′) equal types. The third type is closed, so it is functional independently of the prefix.
For the extract 𝑓 𝑛, (91.14) becomes 𝖳𝗒𝖤𝗊𝑖(ℕ,ℕ)and𝖬𝖾𝗆𝖤𝗊𝑖(𝑔𝑎,𝑔′𝑎′;ℕ). The last conjunct in the definition of equal substitutions is a function-PER relation; its instance at the related arguments 𝑎,𝑎′ gives the member equality.
After replacing the last hypothesis by 𝑓 :∏𝑥:ℕ𝖤𝗊ℕ(𝑥,𝑛), functionality requires the additional cross-fiber obligation 𝖳𝗒𝖤𝗊𝑖(𝖤𝗊ℕ(𝑥,𝑎),𝖤𝗊ℕ(𝑥′,𝑎′)),whenever 𝖬𝖾𝗆𝖤𝗊𝑖(𝑥,𝑥′;ℕ) and 𝖬𝖾𝗆𝖤𝗊𝑖(𝑎,𝑎′;ℕ). An equal pair of substituted functions must in addition return equal 𝖺𝗑𝗂𝗈𝗆 witnesses in those fibers. In fact the modified function type has no closed member: a member would have to inhabit 𝖤𝗊ℕ(𝑥,𝑎) for every natural 𝑥, including one whose numeral is different from the numeral denoted by 𝑎. The context may still be proved functional, but it admits no closed substitution for its final hypothesis.
Exercise 91.10.
Put 𝐴:=∑𝑥:𝖨𝗇𝗍𝖨𝗇𝗍,𝗌𝗎𝗆(𝑝):=𝗌𝗉𝗋𝖾𝖺𝖽(𝑝;𝑥,𝑦.𝑥+𝑦),𝐸(𝑝,𝑞):=𝖤𝗊𝖨𝗇𝗍(𝗌𝗎𝗆(𝑝),𝗌𝗎𝗆(𝑞)). These are old-system programs; in particular, the quotient is not used in the definition of 𝐸. Let 𝑝,𝑞 ∈dom(𝑅𝐴). Sigma inversion gives evaluations of 𝑝 and 𝑞 to canonical pairs whose two components belong to the integer PER. Spread followed by addition therefore evaluates each sum to a canonical integer. The old equality-type generator then proves 𝖳𝗒𝑖(𝐸(𝑝,𝑞)) for every old-system level 𝑖.
It remains to check functionality for arbitrary program representatives, not only written pairs. Suppose 𝑅𝐴(𝑝,𝑝′) and 𝑅𝐴(𝑞,𝑞′). Sigma inversion and the integer PER identify the two component values of 𝑝,𝑝′ and those of 𝑞,𝑞′. Hence 𝗌𝗎𝗆(𝑝) and 𝗌𝗎𝗆(𝑝′) evaluate to the same integer, as do the two sums from 𝑞,𝑞′. The equality generator consequently gives 𝖳𝗒𝖤𝗊𝑖(𝐸(𝑝,𝑞),𝐸(𝑝′,𝑞′)). Moreover, 𝖨𝗇𝗁𝑖(𝐸(𝑝,𝑞))⟺𝗌𝗎𝗆(𝑝) and 𝗌𝗎𝗆(𝑞) evaluate to the same integer. Reflexivity, symmetry, and transitivity of integer equality establish admissibility clauses (2)–(4). Thus all four clauses hold on the entire Sigma-PER domain.
Three nontrivial equalities in 𝐴/𝐸 are (0,3)𝐸(1,2),(−1,5)𝐸(4,0),(7,−2)𝐸(0,5).
Use the lazy programs at the signatures printed in the exercise: 𝖿𝗂𝗋𝗌𝗍:=𝜆𝑝.𝗌𝗉𝗋𝖾𝖺𝖽(𝑝;𝑥,𝑦.𝑥),𝗍𝗈𝗍𝖺𝗅:=𝜆𝑝.𝗌𝗉𝗋𝖾𝖺𝖽(𝑝;𝑥,𝑦.𝑥+𝑦),𝗌𝗐𝖺𝗉:=𝜆𝑝.𝗌𝗉𝗋𝖾𝖺𝖽(𝑝;𝑥,𝑦.(𝑦,𝑥)). First projection does not respect 𝐸: the 𝐸-equal programs (0,3) and (1,2) produce the unequal integers 0 and 1. Sigma inversion shows that 𝗍𝗈𝗍𝖺𝗅 𝑝 evaluates to an integer whenever 𝑝 is a member of 𝐴. It also shows that 𝗌𝗐𝖺𝗉 𝑝 evaluates to a pair of integer components, hence is a member of 𝐴 and therefore of 𝐴/𝐸 by quotient reflexivity. Total respects 𝐸 by its defining condition. Swapping respects 𝐸 because 𝑎+𝑏=𝑐+𝑑⟹𝑏+𝑎=𝑑+𝑐. If swapping instead had the unquotiented pair type as codomain, the same representatives would be a counterexample: (3,0) and (2,1) are not componentwise equal. The codomain equality is therefore part of the congruence claim.