Let 𝑋 and 𝑌 be sets and 𝑓 :𝑋 →𝑌 a function. A predicate on 𝑌 is a subset 𝑉 ⊆𝑌, and substituting 𝑓 into it produces the predicate 𝑓−1(𝑉) ⊆𝑋. Two further operations turn a predicate on 𝑋 back into a predicate on 𝑌: ∃𝑓(𝑈):={𝑦∈𝑌∣𝑦=𝑓(𝑥) for some 𝑥∈𝑈},∀𝑓(𝑈):={𝑦∈𝑌∣𝑥∈𝑈 for every 𝑥 with 𝑓(𝑥)=𝑦}. Take 𝑌 =ℕ, 𝑋 =ℕ ×ℕ, 𝑓(𝑚,𝑛) =𝑚, and 𝑈 ={(𝑚,𝑛) ∣𝑚 ≤𝑛}. Then ∃𝑓(𝑈) =ℕ, because every 𝑚 has some 𝑛 above it, and ∀𝑓(𝑈) =∅, because no 𝑚 is below every 𝑛. These are the sets denoted by ∃𝑛. 𝑚 ≤𝑛 and ∀𝑛. 𝑚 ≤𝑛.
The three operations are not independent. For 𝑈 ⊆𝑋 and 𝑉 ⊆𝑌, ∃𝑓(𝑈)⊆𝑉⟺𝑈⊆𝑓−1(𝑉),𝑓−1(𝑉)⊆𝑈⟺𝑉⊆∀𝑓(𝑈), each of which is checked by expanding both sides on an element. Read the first as a rule of inference: a proof of 𝑉 from ∃𝑥. 𝑈 is the same thing as a proof of 𝑉 from 𝑈, in a context where 𝑉 does not mention 𝑥. That is the elimination rule for the existential quantifier, and the side condition “𝑥 not free in 𝑉” is not a restriction imposed on the rule but the statement that 𝑉 is a predicate on 𝑌 rather than on 𝑋.
Equation 143.2 says that ∃𝑓 and ∀𝑓 are adjoint to 𝑓−1 in the sense of exercise 142.11: in a preorder an adjunction is exactly a pair of two-way rules. This chapter takes that observation as a definition, proves what it forces, and stops where the proofs stop.
Predicates and reindexing
Fix a set 𝑋 and let P(𝑋) be its powerset, preordered by inclusion and regarded as a category as in example 142.5: one arrow 𝑈 ⟶𝑈′ when 𝑈 ⊆𝑈′, none otherwise. Meets are intersections, joins are unions, the top element is 𝑋 and the bottom is ∅. One further operation is needed before any quantifier appears.
A Heyting algebra is a preorder 𝐻 with finite meets ⊤, ∧ and finite joins ⊥, ∨ in the sense of example 142.5 and its dual, together with a binary operation ⇒ satisfying, for all 𝑎,𝑏,𝑐 ∈𝐻, 𝑎∧𝑏≤𝑐⟺𝑎≤(𝑏⇒𝑐). A homomorphism of Heyting algebras is a monotone map that preserves each of ⊤, ⊥, ∧, ∨ and ⇒ up to the equivalence of the preorder. We write 𝐇𝐞𝐲𝐭 for the category of Heyting algebras and homomorphisms.
Referenced from 4 locations
Equation 143.3 is the statement that ( −) ∧𝑏 ⊣(𝑏 ⇒ −), so a Heyting algebra is a preorder that is cartesian closed in the sense of definition 142.26 and also has finite joins. Nothing else is assumed: 𝑎 ∨(𝑎 ⇒⊥) =⊤ is not required and generally fails.
In P(𝑋) put 𝑉 ⇒𝑊:={𝑥 ∈𝑋 ∣𝑥 ∈𝑉 implies 𝑥 ∈𝑊}, which is (𝑋 ∖𝑉) ∪𝑊. For 𝑈 ∩𝑉 ⊆𝑊 and 𝑥 ∈𝑈: if 𝑥 ∈𝑉 then 𝑥 ∈𝑊, so 𝑥 ∈𝑉 ⇒𝑊; conversely if 𝑈 ⊆𝑉 ⇒𝑊 and 𝑥 ∈𝑈 ∩𝑉 then 𝑥 ∈𝑊. This algebra is Boolean, since 𝑉 ∨(𝑉 ⇒⊥) =𝑉 ∪(𝑋 ∖𝑉) =𝑋.
Referenced from 3 locations
Let O(ℝ) be the open subsets of the real line ordered by inclusion, with ∧ intersection and ∨ union. Both are open, so these are meets and joins. Put 𝑉 ⇒𝑊:=int((ℝ ∖𝑉) ∪𝑊), the largest open set contained in the displayed union; (143.3) holds because an open 𝑈 is contained in that union exactly when it is contained in its interior. Take 𝑉 =ℝ ∖{0}. Then 𝑉 ⇒⊥ =int{0} =∅, so 𝑉 ∨(𝑉 ⇒⊥) =𝑉 ≠ℝ. Excluded middle therefore fails in this algebra, while every clause of definition 143.1 holds.
Referenced from 3 locations
For 𝑓 :𝑋 →𝑌 the map 𝑓∗:=𝑓−1( −) :P(𝑌) →P(𝑋) preserves ⊤,⊥, ∧, ∨ and ⇒, and id∗𝑋=idP(𝑋),(𝑔∘𝑓)∗=𝑓∗∘𝑔∗for 𝑔:𝑌→𝑍.
Referenced from 4 locations
Proof of Proposition 143.4 — Inverse image is a homomorphism
Proof. Each clause is an equality of subsets, checked on an element 𝑥 ∈𝑋. For the meet, 𝑥 ∈𝑓−1(𝑉 ∩𝑊) iff 𝑓(𝑥) ∈𝑉 and 𝑓(𝑥) ∈𝑊 iff 𝑥 ∈𝑓−1(𝑉) ∩𝑓−1(𝑊); joins, ⊤ and ⊥ are the same calculation. For implication, 𝑥∈𝑓−1(𝑉⇒𝑊)⟺(𝑓(𝑥)∈𝑉 implies 𝑓(𝑥)∈𝑊)⟺(𝑥∈𝑓∗𝑉 implies 𝑥∈𝑓∗𝑊), which is 𝑥 ∈𝑓∗𝑉 ⇒𝑓∗𝑊. For (143.4), 𝑥 ∈(𝑔 ∘𝑓)−1(𝑊) iff 𝑔(𝑓(𝑥)) ∈𝑊 iff 𝑓(𝑥) ∈𝑔−1(𝑊) iff 𝑥 ∈𝑓−1(𝑔−1(𝑊)); and id−1𝑋(𝑉) =𝑉. ◻
The second equation of (143.4) is an identity of operations, not an isomorphism. It is the same strictness that equation 142.11 demanded of type substitution, and here it holds on the nose because 𝑓∗ is defined by a formula rather than by a universal property.
★☆☆ In any Heyting algebra put ¬𝑎:=(𝑎 ⇒⊥). Prove 𝑎 ≤¬¬𝑎 from (143.3) alone, and exhibit an element of O(ℝ) with ¬¬𝑎 ≠𝑎.
Referenced from 2 locations
★★☆ Show that the direct image ∃𝑓 of (143.1) preserves ⊥ and ∨ but need not preserve ∧: take 𝑓 :{0,1} →{ ∗} and two disjoint singletons. Which clause of corollary 142.24 explains why 𝑓∗ preserves ∧ while ∃𝑓 need not?
Referenced from 2 locations
Quantifiers as adjoints
Let 𝑓 :𝑋 →𝑌. With ∃𝑓 and ∀𝑓 as in (143.1) and 𝑓∗ =𝑓−1( −), ∃𝑓⊣𝑓∗⊣∀𝑓 as functors between the preorders P(𝑋) and P(𝑌).
Referenced from 3 locations
Proof of Theorem 143.5 — The powerset quantifiers
Proof. All three maps are monotone: if 𝑈 ⊆𝑈′ then every witness for ∃𝑓(𝑈) is one for ∃𝑓(𝑈′), every 𝑦 all of whose preimages lie in 𝑈 has them all in 𝑈′, and inverse images preserve inclusion. By exercise 142.11 an adjunction between preorders is exactly the displayed two-way rule, so it suffices to prove (143.2).
First rule. Suppose ∃𝑓(𝑈) ⊆𝑉 and let 𝑥 ∈𝑈. Then 𝑓(𝑥) ∈∃𝑓(𝑈) by taking 𝑥 itself as the witness, so 𝑓(𝑥) ∈𝑉, that is, 𝑥 ∈𝑓−1(𝑉). Conversely suppose 𝑈 ⊆𝑓−1(𝑉) and let 𝑦 ∈∃𝑓(𝑈), say 𝑦 =𝑓(𝑥) with 𝑥 ∈𝑈. Then 𝑥 ∈𝑓−1(𝑉), so 𝑦 =𝑓(𝑥) ∈𝑉.
Second rule. Suppose 𝑓−1(𝑉) ⊆𝑈 and let 𝑦 ∈𝑉. For every 𝑥 with 𝑓(𝑥) =𝑦 we have 𝑥 ∈𝑓−1(𝑉), hence 𝑥 ∈𝑈; so 𝑦 ∈∀𝑓(𝑈). Conversely suppose 𝑉 ⊆∀𝑓(𝑈) and let 𝑥 ∈𝑓−1(𝑉). Then 𝑓(𝑥) ∈𝑉 ⊆∀𝑓(𝑈), and 𝑥 is a preimage of 𝑓(𝑥), so 𝑥 ∈𝑈. ◻
Specialize to the projection that discards one variable. Let Γ and 𝐴 be sets and 𝑝 :Γ ×𝐴 →Γ the first projection. Then 𝑝∗(𝑉) =𝑉 ×𝐴 adds a dummy variable, and ∃𝑝(𝑈)={𝑔∣(𝑔,𝑎)∈𝑈 for some 𝑎∈𝐴},∀𝑝(𝑈)={𝑔∣(𝑔,𝑎)∈𝑈 for all 𝑎∈𝐴}, so the two-way rules read ∃𝑎.𝑈≤𝑉𝑈≤𝑝∗𝑉,𝑝∗𝑉≤𝑈𝑉≤∀𝑎.𝑈, each read in both directions. The premise “𝑎 does not occur free in 𝑉” of the usual ∃-elimination and ∀-introduction rules is carried entirely by the requirement that 𝑉 be an element of P(Γ).
In any preorder-valued situation with ∃𝑓 ⊣𝑓∗, the map 𝑓∗ preserves all meets that exist. In particular 𝑓∗(⊤) =⊤ and 𝑓∗(𝑉 ∧𝑊) =𝑓∗𝑉 ∧𝑓∗𝑊.
Referenced from 2 locations
Proof of Proposition 143.6 — Weakening is a right adjoint, hence preserves meets
Proof. Theorem 142.23 applied to the adjunction ∃𝑓 ⊣𝑓∗: a right adjoint preserves limits, and in a preorder the limits are exactly the meets. Corollary 142.24 names the two instances used. ◻
Lawvere records this consequence in the paper that introduced the notion: “the existence of existential quantification implies that substitution commutes with conjunction; usually substitution does not commute with implication” (Adjointness in Foundations, physical page 12). The powerset is one of the cases where substitution does commute with implication, by proposition 143.4; exercise 143.4 gives a hyperdoctrine where it does not.
Hyperdoctrines
The powerset construction used three facts about 𝐒𝐞𝐭: it has finite products, so contexts can be formed; each P(𝑋) is a Heyting algebra; and reindexing has both adjoints. One further condition is needed, and it is the condition that makes substitution commute with quantification.
Let C be a category with finite products and 𝑃 :Cop →𝐇𝐞𝐲𝐭 a functor such that each 𝑃(𝑓), written 𝑓∗, has adjoints ∃𝑓 ⊣𝑓∗ ⊣∀𝑓. The Beck–Chevalley condition requires that for every pullback square
Diagram in C and every 𝜑 ∈𝑃(𝐵), ℎ∗(∃𝑓𝜑)=∃𝑔(𝑘∗𝜑),ℎ∗(∀𝑓𝜑)=∀𝑔(𝑘∗𝜑).
Referenced from 3 locations
A hyperdoctrine is a pair (C,𝑃) where C is a category with finite products and 𝑃 :Cop →𝐇𝐞𝐲𝐭 is a functor such that for every arrow 𝑓 of C the homomorphism 𝑓∗ has a left adjoint ∃𝑓 and a right adjoint ∀𝑓, and the Beck–Chevalley condition (143.6) holds for every pullback square that exists in C.
Referenced from 11 locations
The base is required to have finite products only. That is enough for the condition to be usable, because the squares the interpretation actually needs are always pullbacks.
Let C have finite products, let 𝜎 :Δ ⟶Γ, and let 𝐴 be an object. Write 𝑝 :Γ ×𝐴 ⟶Γ and 𝑞 :Δ ×𝐴 ⟶Δ for the first projections and 𝜎 ×id𝐴:=⟨𝜎 ∘𝑞,𝗉𝗋2⟩. Then
Diagram is a pullback square.
Referenced from 5 locations
Proof of Lemma 143.9 — Substitution squares are pullbacks
Proof. It commutes: 𝑝 ∘⟨𝜎 ∘𝑞,𝗉𝗋2⟩ =𝜎 ∘𝑞 by (142.2). Let 𝑢 :𝑋 ⟶Δ and 𝑣 :𝑋 ⟶Γ ×𝐴 satisfy 𝜎 ∘𝑢 =𝑝 ∘𝑣, and put 𝑚:=⟨𝑢,𝗉𝗋2 ∘𝑣⟩ :𝑋 ⟶Δ ×𝐴. Then 𝑞 ∘𝑚 =𝑢, and (𝜎×id𝐴)∘𝑚𝑙𝑒𝑚𝑚𝑎142.2(2)=⟨𝜎∘𝑞∘𝑚, 𝗉𝗋2∘𝑚⟩(142.2)=⟨𝜎∘𝑢, 𝗉𝗋2∘𝑣⟩ℎ𝑦𝑝.=⟨𝑝∘𝑣,𝗉𝗋2∘𝑣⟩𝑙𝑒𝑚𝑚𝑎142.2=𝑣. If 𝑚′ also satisfies the two equations then 𝑞 ∘𝑚′ =𝑢 and 𝗉𝗋2 ∘𝑚′ =𝗉𝗋2 ∘(𝜎 ×id𝐴) ∘𝑚′ =𝗉𝗋2 ∘𝑣, so 𝑚′ =⟨𝑞 ∘𝑚′,𝗉𝗋2 ∘𝑚′⟩ =𝑚 by lemma 142.2(1). ◻
This is the posetal formulation, following Awodey, Introduction to Categorical Logic, Definition 3.4.1 (physical page 176 of the course draft). Lawvere’s original definition, Adjointness in Foundations, physical pages 11–12, is more general in two respects recorded here and not used later: his base T is required to be cartesian closed, and his 𝑃(𝑋) is a cartesian closed category of attributes whose arrows are deductions, so that two proofs of the same entailment may differ. Definition 143.8 is the special case in which each 𝑃(𝑋) is a preorder, that is, in which entailment is proof-irrelevant, and in which the base is only required to have finite limits. No theorem below is transferred from the proof-relevant setting.
The powerset hyperdoctrine satisfies (143.6).
Referenced from 3 locations
Proof of Theorem 143.11 — Beck–Chevalley in the powerset
Proof. By proposition 142.9 the pullback square may be taken to be 𝐷={(𝑐,𝑏)∈𝐶×𝐵∣ℎ(𝑐)=𝑓(𝑏)},𝑔(𝑐,𝑏)=𝑐,𝑘(𝑐,𝑏)=𝑏, since any other pullback of the same pair differs from this one by a unique isomorphism commuting with 𝑔 and 𝑘, and both sides of (143.6) are transported along that isomorphism. Let 𝜑 ⊆𝐵 and 𝑐 ∈𝐶.
Existential clause. 𝑐∈ℎ∗(∃𝑓𝜑)⟺ℎ(𝑐)∈∃𝑓𝜑definition of ℎ∗⟺ℎ(𝑐)=𝑓(𝑏) for some 𝑏∈𝜑definition of ∃𝑓⟺(𝑐,𝑏)∈𝐷 for some 𝑏∈𝜑definition of 𝐷⟺𝑐=𝑔(𝑑) for some 𝑑∈𝑘∗𝜑definitions of 𝑔,𝑘⟺𝑐∈∃𝑔(𝑘∗𝜑)definition of ∃𝑔. The middle step is where the square being a pullback is used: an element of 𝐷 over 𝑐 is exactly a 𝑏 with ℎ(𝑐) =𝑓(𝑏), so the two existential statements have the same witnesses.
Universal clause. 𝑐 ∈ℎ∗(∀𝑓𝜑) says that every 𝑏 with 𝑓(𝑏) =ℎ(𝑐) lies in 𝜑, and 𝑐 ∈∀𝑔(𝑘∗𝜑) says that every 𝑑 ∈𝐷 with 𝑔(𝑑) =𝑐 lies in 𝑘∗𝜑. The elements 𝑑 with 𝑔(𝑑) =𝑐 are the pairs (𝑐,𝑏) with 𝑓(𝑏) =ℎ(𝑐), and (𝑐,𝑏) ∈𝑘∗𝜑 means 𝑏 ∈𝜑; so the two statements quantify over the same 𝑏 and assert the same thing. ◻
Let 𝐴 ={0,1}, 𝐵 ={𝑏}, 𝐶 ={𝑐}, 𝐷 =∅, with 𝑓(𝑏) =0, ℎ(𝑐) =0, and 𝑔,𝑘 the empty maps. The square commutes, since both composites have empty domain. Take 𝜑 ={𝑏}. Then ∃𝑓𝜑 ={0} and ℎ∗(∃𝑓𝜑) ={𝑐}, whereas 𝑘∗𝜑 =∅ and ∃𝑔(∅) =∅. So (143.6) fails. The square is not a pullback: the pullback of 𝑓 along ℎ is {(𝑐,𝑏)}, a one-element set, not ∅. The condition is therefore a condition on pullback squares and not on commuting squares.
Referenced from 2 locations
In the powerset hyperdoctrine, for 𝑓 :𝑋 →𝑌, 𝑈 ⊆𝑋 and 𝑉 ⊆𝑌, ∃𝑓(𝑈∧𝑓∗𝑉)=∃𝑓(𝑈)∧𝑉.
Referenced from 3 locations
Proof of Proposition 143.13 — Frobenius
Proof. Let 𝑦 ∈𝑌. Membership in the left-hand side says: there is 𝑥 with 𝑓(𝑥) =𝑦, 𝑥 ∈𝑈 and 𝑓(𝑥) ∈𝑉. Membership in the right-hand side says: there is 𝑥 with 𝑓(𝑥) =𝑦 and 𝑥 ∈𝑈, and moreover 𝑦 ∈𝑉. Since 𝑓(𝑥) =𝑦, the two conditions 𝑓(𝑥) ∈𝑉 and 𝑦 ∈𝑉 are the same statement, and it does not depend on 𝑥; so it may be moved outside the existential quantifier in either direction. ◻
Equation 143.7 is what allows an existential hypothesis to be eliminated in the presence of other hypotheses. Without it, the rule (143.5) discharges ∃𝑎. 𝑈 only when the ambient context of assumptions is empty.
★★☆ Derive the usual sequent form of ∃-elimination, Θ∧𝑈≤𝑝∗𝑉Θ∧∃𝑝𝑈≤𝑉(Θ,𝑉∈𝑃(Γ), 𝑈∈𝑃(Γ×𝐴)), from (143.5) together with (143.7), and identify the step at which Frobenius is used.
Referenced from 2 locations
★★★ Let C =𝐒𝐞𝐭 and let 𝑃(𝑋) be the Heyting algebra of O(ℝ)-valued predicates, that is, functions 𝑋 →O(ℝ) ordered pointwise, with the operations of example 143.3 computed pointwise and 𝑓∗(𝜓) =𝜓 ∘𝑓. Verify that (C,𝑃) is a hyperdoctrine with ∃𝑓(𝜑)(𝑦) =⋃𝑓(𝑥)=𝑦𝜑(𝑥) and ∀𝑓(𝜑)(𝑦) =int⋂𝑓(𝑥)=𝑦𝜑(𝑥). Then decide whether 𝑓∗ preserves ⇒, and give the smallest example that settles it.
Referenced from 5 locations
★★☆ Specialize (143.6) to the pullback square formed by a map 𝜎 :Δ →Γ and the projection 𝑝 :Γ ×𝐴 →Γ, and read the resulting equation as the syntactic law (∃𝑎. 𝜑)[𝜎] =∃𝑎. (𝜑[𝜎 ×id𝐴]). Which arrow of the square is 𝜎 ×id𝐴?
Referenced from 2 locations
Equality and comprehension
Equality is not a primitive of definition 143.8. It is constructed from one adjoint at one arrow, the diagonal.
Let (C,𝑃) be a hyperdoctrine and 𝐴 an object of C. Let 𝛿𝐴:=⟨id𝐴,id𝐴⟩ :𝐴 ⟶𝐴 ×𝐴 be the diagonal. Put Eq𝐴:=∃𝛿𝐴(⊤)∈𝑃(𝐴×𝐴).
Referenced from 2 locations
For every 𝜌 ∈𝑃(𝐴 ×𝐴), Eq𝐴≤𝜌in 𝑃(𝐴×𝐴)⟺⊤≤𝛿∗𝐴𝜌in 𝑃(𝐴). Consequently Eq𝐴 is reflexive, in the sense ⊤ ≤𝛿∗𝐴Eq𝐴, and it is the least reflexive element of 𝑃(𝐴 ×𝐴).
Referenced from 3 locations
Proof of Theorem 143.15 — Lawvere's law
Proof. Equation 143.8 is the adjunction ∃𝛿𝐴 ⊣𝛿∗𝐴 read as a two-way rule (exercise 142.11), instantiated at ⊤ ∈𝑃(𝐴) and 𝜌 ∈𝑃(𝐴 ×𝐴). Reflexivity is the instance 𝜌:=Eq𝐴 of the direction from left to right, applied to Eq𝐴 ≤Eq𝐴. If 𝜌 is any reflexive element, the direction from right to left gives Eq𝐴 ≤𝜌. ◻
Writing 𝜌 with its two variables displayed, 𝛿∗𝐴𝜌 is 𝜌(𝑥,𝑥), so (143.8) is the two-way rule 𝑥:𝐴∣⊤⊢𝜌(𝑥,𝑥)𝑥:𝐴,𝑦:𝐴∣Eq𝐴(𝑥,𝑦)⊢𝜌(𝑥,𝑦) read in both directions: Eq𝐴 is the least reflexive relation. The upward direction is the introduction rule for equality and the downward direction is substitution of equals, so the elimination rule is not an extra assumption.
For a set 𝐴, 𝛿𝐴(𝑎) =(𝑎,𝑎) and ⊤ =𝐴, so Eq𝐴 =∃𝛿𝐴(𝐴) ={(𝑎,𝑎) ∣𝑎 ∈𝐴}, the diagonal subset. Reflexivity says 𝐴 ⊆𝛿−1𝐴(Eq𝐴), which holds because (𝑎,𝑎) ∈Eq𝐴; and any 𝜌 containing every (𝑎,𝑎) contains the diagonal.
Referenced from 2 locations
A predicate carves out a subobject only if the base category has the objects to carve with. That is an extra requirement.
A hyperdoctrine (C,𝑃) has comprehension if for every object Γ and every 𝜑 ∈𝑃(Γ) there are an object {Γ ∣𝜑} and an arrow 𝑖𝜑 :{Γ ∣𝜑} ⟶Γ such that ⊤ ≤𝑖∗𝜑𝜑, and such that every 𝑓 :Δ ⟶Γ with ⊤ ≤𝑓∗𝜑 factors as 𝑓 =𝑖𝜑 ∘¯𝑓 for exactly one ¯𝑓.
Referenced from 4 locations
Take {Γ ∣𝜑}:=𝜑 as a set and 𝑖𝜑 the inclusion. Then definition 143.17 holds, and 𝑖𝜑 is a monomorphism.
Referenced from 2 locations
Proof of Proposition 143.18 — The powerset hyperdoctrine has comprehension
Proof. 𝑖−1𝜑(𝜑) =𝜑, which is the top element of P(𝜑), so the first condition holds. Let 𝑓 :Δ →Γ satisfy Δ ⊆𝑓−1(𝜑), that is, 𝑓(𝑑) ∈𝜑 for every 𝑑. Then ¯𝑓(𝑑):=𝑓(𝑑) is a function Δ →𝜑 with 𝑖𝜑 ∘¯𝑓 =𝑓, and it is the only one, since 𝑖𝜑 is injective. Injectivity also gives the monomorphism claim by proposition 141.29. ◻
Let 𝑇 be the empty theory over one sort 𝑆 with no function symbols and one unary relation symbol 𝑅, and let (C𝑇,𝑃𝑇) be its syntactic hyperdoctrine (theorem 143.28). An arrow Δ ⟶(𝑥 :𝑆) of C𝑇 is a term of sort 𝑆 in context Δ, hence a variable of Δ. Suppose {(𝑥 :𝑆) ∣𝑅(𝑥)} existed with structure map 𝑖𝑅. Taking 𝑓:=𝑖𝑅 itself in the factorization clause is not needed; it is enough that the first clause gives ⊤ ≤𝑖∗𝑅𝑅(𝑥), that is, a variable 𝑧 of the context {(𝑥 :𝑆) ∣𝑅(𝑥)} with ⊤ ⊢𝑅(𝑧) derivable in 𝑇. No such sequent is derivable in the empty theory: the interpretation of example 143.10 that sends 𝑆 to a two-element set and 𝑅 to a proper nonempty subset satisfies every axiom of 𝑇 and refutes ⊤ ⊢𝑅(𝑧), so by theorem 143.24 the sequent has no derivation. Hence (C𝑇,𝑃𝑇) has no comprehension.
Referenced from 2 locations
The calculus and its interpretation
A first-order signature Σ consists of a set of sorts; a set of function symbols, each with an arity (𝑆1,…,𝑆𝑛) →𝑆 of sorts; and a set of relation symbols, each with an arity (𝑆1,…,𝑆𝑛). A context Γ =𝑥1 :𝑆1,…,𝑥𝑛 :𝑆𝑛 declares distinct variables. Terms and formulas in context are generated by (𝑥:𝑆)∈ΓΓ⊢𝑥:𝑆Γ⊢𝑡𝑖:𝑆𝑖 (1≤𝑖≤𝑛)Γ⊢𝖿(𝑡1,…,𝑡𝑛):𝑆(𝖿:(𝑆1,…,𝑆𝑛)→𝑆),𝜑::=⊤∣⊥∣𝖱(𝑡1,…,𝑡𝑛)∣𝑡=𝑆𝑡′∣𝜑∧𝜑∣𝜑∨𝜑∣𝜑⇒𝜑∣∃𝑥:𝑆.𝜑∣∀𝑥:𝑆.𝜑, where every 𝑡𝑖 is a term of the declared sort and the two quantifiers bind 𝑥 in a context extended by 𝑥 :𝑆. A sequent Γ ∣𝜑 ⊢𝜓 has 𝜑,𝜓 formulas in context Γ. A theory is a set of sequents, its axioms.
Referenced from 3 locations
The rules are those of intuitionistic first-order logic in sequent form, with one formula on the left.
The derivable sequents of a theory 𝑇 are generated by the axioms of 𝑇 together with 𝐼𝑑 Γ∣𝜑⊢𝜑𝐶𝑢𝑡 Γ∣𝜑⊢𝜒Γ∣𝜒⊢𝜓Γ∣𝜑⊢𝜓𝑆𝑢𝑏𝑠𝑡 Γ∣𝜑⊢𝜓Δ∣𝜑[𝜎]⊢𝜓[𝜎] for every 𝜎 :Δ →Γ, a list of terms of Δ of the sorts of Γ; the lattice rules Γ∣𝜑⊢⊤Γ∣⊥⊢𝜑Γ∣𝜑⊢𝜓1Γ∣𝜑⊢𝜓2Γ∣𝜑⊢𝜓1∧𝜓2Γ∣𝜓1∧𝜓2⊢𝜓𝑖Γ∣𝜓𝑖⊢𝜓1∨𝜓2Γ∣𝜓1⊢𝜒Γ∣𝜓2⊢𝜒Γ∣𝜓1∨𝜓2⊢𝜒 the two-way implication rule Γ∣𝜑∧𝜓⊢𝜒Γ∣𝜑⊢𝜓⇒𝜒(both directions), the two-way quantifier rules, for 𝜑 ∈ formulas over Γ,𝑥 :𝑆 and 𝜓 over Γ, Γ,𝑥:𝑆∣𝜑⊢𝜓Γ∣∃𝑥:𝑆.𝜑⊢𝜓Γ,𝑥:𝑆∣𝜓⊢𝜑Γ∣𝜓⊢∀𝑥:𝑆.𝜑(both directions), where 𝜓 on the upper line abbreviates its weakening to Γ,𝑥 :𝑆; the Frobenius rule Γ∣𝜃∧∃𝑥:𝑆.𝜑⊢𝜒Γ∣∃𝑥:𝑆.(𝜃∧𝜑)⊢𝜒(both directions); and the equality rules, for 𝜌 a formula over Γ,𝑥 :𝑆,𝑦 :𝑆, Γ,𝑥:𝑆∣⊤⊢𝜌[𝑥/𝑦]Γ,𝑥:𝑆,𝑦:𝑆∣𝑥=𝑆𝑦⊢𝜌(both directions).
Referenced from 7 locations
The two-way rules are the two-way rules of (143.2), (143.3) and (143.8), transcribed. This is the exact respect in which the calculus is designed for the semantics: each connective is presented by the adjunction that will interpret it, so the soundness proof has one case per adjunction rather than one case per introduction and elimination rule.
Let (C,𝑃) be a hyperdoctrine. A structure 𝑀 for Σ assigns an object [[𝑆]] to each sort, an arrow [[𝖿]] :[[𝑆1]] ×⋯ ×[[𝑆𝑛]] ⟶[[𝑆]] to each function symbol, and an element [[𝖱]] ∈𝑃([[𝑆1]] ×⋯ ×[[𝑆𝑛]]) to each relation symbol. Put [[Γ]]:=[[𝑆1]] ×⋯ ×[[𝑆𝑛]] for Γ =𝑥1 :𝑆1,…,𝑥𝑛 :𝑆𝑛. Terms are interpreted as arrows by [[Γ⊢𝑥𝑖:𝑆𝑖]]:=𝗉𝗋𝑖,[[Γ⊢𝖿(𝑡1,…,𝑡𝑛):𝑆]]:=[[𝖿]]∘⟨[[𝑡1]],…,[[𝑡𝑛]]⟩, and formulas as elements of 𝑃([[Γ]]) by [[𝖱(𝑡1,…,𝑡𝑛)]]:=⟨[[𝑡1]],…,[[𝑡𝑛]]⟩∗[[𝖱]],[[𝑡=𝑆𝑡′]]:=⟨[[𝑡]],[[𝑡′]]⟩∗Eq[[𝑆]],[[𝜑∧𝜓]]:=[[𝜑]]∧[[𝜓]],[[𝜑⇒𝜓]]:=[[𝜑]]⇒[[𝜓]], with ⊤,⊥, ∨ interpreted by the corresponding operations of 𝑃([[Γ]]), and [[∃𝑥:𝑆.𝜑]]:=∃𝑝[[𝜑]],[[∀𝑥:𝑆.𝜑]]:=∀𝑝[[𝜑]], where 𝑝 :[[Γ]] ×[[𝑆]] ⟶[[Γ]] is the first projection and [[𝜑]] ∈𝑃([[Γ]] ×[[𝑆]]) is the interpretation of 𝜑 in the context Γ,𝑥 :𝑆. A sequent Γ ∣𝜑 ⊢𝜓 is valid in 𝑀 when [[𝜑]] ≤[[𝜓]] in 𝑃([[Γ]]).
Referenced from 6 locations
The soundness proof needs one lemma, and that lemma is where Beck–Chevalley is used.
Let 𝜎 :Δ →Γ be a list of terms and write [[𝜎]]:=⟨[[𝜎1]],…,[[𝜎𝑛]]⟩ :[[Δ]] ⟶[[Γ]]. Then for every term Γ ⊢𝑡 :𝑆 and every formula 𝜑 over Γ, [[𝑡[𝜎]]]=[[𝑡]]∘[[𝜎]],[[𝜑[𝜎]]]=[[𝜎]]∗[[𝜑]].
Referenced from 5 locations
Proof of Lemma 143.23 — Substitution
Proof. Terms. Induct on 𝑡. For 𝑡 =𝑥𝑖, 𝑡[𝜎] =𝜎𝑖 and [[𝑥𝑖]] ∘[[𝜎]] =𝗉𝗋𝑖 ∘[[𝜎]] =[[𝜎𝑖]] by (142.2). For 𝑡 =𝖿(𝑡1,…,𝑡𝑘), [[𝖿(⃗𝑡)[𝜎]]]𝑑𝑒𝑓.=[[𝖿]]∘⟨[[𝑡1[𝜎]]],…⟩𝐼𝐻=[[𝖿]]∘⟨[[𝑡1]]∘[[𝜎]],…⟩𝑙𝑒𝑚𝑚𝑎142.2(2)=[[𝖿(⃗𝑡)]]∘[[𝜎]].
Formulas. Induct on 𝜑.
Atomic. For 𝖱(⃗𝑡), the term clause and lemma 142.2(2) give ⟨[[𝑡𝑖[𝜎]]]⟩ =⟨[[𝑡𝑖]]⟩ ∘[[𝜎]], and 𝑃 is a functor, so (⟨[[𝑡𝑖]]⟩ ∘[[𝜎]])∗ =[[𝜎]]∗ ∘⟨[[𝑡𝑖]]⟩∗ by (143.4). The equality formula is the same calculation with Eq[[𝑆]] in place of [[𝖱]].
Propositional. [[𝜎]]∗ is a Heyting homomorphism by definition 143.8, so it commutes with ⊤,⊥, ∧, ∨, ⇒; combine with the induction hypotheses.
Quantifier. Let 𝜑 be a formula over Γ,𝑥 :𝑆, and let 𝑝 :[[Γ]] ×[[𝑆]] ⟶[[Γ]] and 𝑞 :[[Δ]] ×[[𝑆]] ⟶[[Δ]] be the first projections. The substitution 𝜎 extends to 𝜎+:=(𝜎,𝑥) on the extended contexts, and [[𝜎+]] =[[𝜎]] ×id[[𝑆]]. The square
Diagram is a pullback by lemma 143.9. Hence Beck–Chevalley (143.6) applies: [[(∃𝑥:𝑆.𝜑)[𝜎]]]𝑑𝑒𝑓.=∃𝑞[[𝜑[𝜎+]]]𝐼𝐻=∃𝑞([[𝜎+]]∗[[𝜑]])(143.6)=[[𝜎]]∗(∃𝑝[[𝜑]])𝑑𝑒𝑓.=[[𝜎]]∗[[∃𝑥:𝑆.𝜑]], and the universal clause of (143.6) gives the same for ∀. ◻
Let 𝑀 be a structure in a hyperdoctrine (C,𝑃) in which every axiom of 𝑇 is valid. Then every sequent derivable in 𝑇 is valid in 𝑀.
Referenced from 8 locations
Proof of Theorem 143.24 — Soundness
Proof. Induct on the derivation. Axioms are valid by hypothesis.
Id and Cut. Reflexivity and transitivity of ≤ in 𝑃([[Γ]]).
Subst. By the induction hypothesis [[𝜑]] ≤[[𝜓]] in 𝑃([[Γ]]). Applying the monotone map [[𝜎]]∗ gives [[𝜎]]∗[[𝜑]] ≤[[𝜎]]∗[[𝜓]], which by lemma 143.23 is [[𝜑[𝜎]]] ≤[[𝜓[𝜎]]].
Lattice rules. Each is a clause of the universal property of the meet or join in 𝑃([[Γ]]); for instance the rule with two premises concluding 𝜑 ⊢𝜓1 ∧𝜓2 is the existence half of definition 142.1 in the preorder 𝑃([[Γ]]).
Implication. The two-way rule is (143.3) at [[𝜑]],[[𝜓]],[[𝜒]].
Quantifiers. The two-way rule for ∃ is the adjunction ∃𝑝 ⊣𝑝∗ evaluated at [[𝜑]] and [[𝜓]], once it is checked that the weakening of 𝜓 to Γ,𝑥 :𝑆 is interpreted as 𝑝∗[[𝜓]]; that check is lemma 143.23 for the substitution that forgets 𝑥. The rule for ∀ is the adjunction 𝑝∗ ⊣∀𝑝.
Frobenius. By proposition 143.13 in the powerset case, and in general by the hypothesis that the hyperdoctrine satisfies (143.7); proposition 143.25 shows that Beck–Chevalley together with the adjunctions already forces it when C has finite products, so no further assumption is needed.
Equality. Write 𝛿 for the arrow id[[Γ]] ×𝛿[[𝑆]], the diagonal of [[𝑆]] taken in the context Γ. By lemma 143.23, [[𝜌[𝑥/𝑦]]] is 𝛿∗[[𝜌]], and the two-way rule is then theorem 143.15 at [[𝜌]]. ◻
Let (C,𝑃) be a hyperdoctrine and 𝑝 :Γ ×𝐴 ⟶Γ a product projection. Then for 𝜃 ∈𝑃(Γ) and 𝜑 ∈𝑃(Γ ×𝐴), ∃𝑝(𝑝∗𝜃 ∧𝜑) =𝜃 ∧∃𝑝𝜑.
Referenced from 3 locations
Proof of Proposition 143.25 — Frobenius from Beck–Chevalley
Proof. From left to right. Both 𝑝∗𝜃 ∧𝜑 ≤𝜑 and 𝑝∗𝜃 ∧𝜑 ≤𝑝∗𝜃 hold. Applying the monotone ∃𝑝 to the first gives ∃𝑝(𝑝∗𝜃 ∧𝜑) ≤∃𝑝𝜑. For the second, the adjunction ∃𝑝 ⊣𝑝∗ turns 𝑝∗𝜃 ∧𝜑 ≤𝑝∗𝜃 into ∃𝑝(𝑝∗𝜃 ∧𝜑) ≤𝜃. The two together give the inequality into the meet.
From right to left. By (143.3) it suffices to show ∃𝑝𝜑 ≤(𝜃 ⇒∃𝑝(𝑝∗𝜃 ∧𝜑)), and by ∃𝑝 ⊣𝑝∗ this is equivalent to 𝜑≤𝑝∗(𝜃⇒∃𝑝(𝑝∗𝜃∧𝜑)). Now 𝑝∗ preserves ⇒, being a Heyting homomorphism, so the right-hand side is 𝑝∗𝜃 ⇒𝑝∗∃𝑝(𝑝∗𝜃 ∧𝜑), and by (143.3) again the displayed inequality is equivalent to 𝜑∧𝑝∗𝜃≤𝑝∗∃𝑝(𝑝∗𝜃∧𝜑), which is the unit of the adjunction ∃𝑝 ⊣𝑝∗ at the element 𝑝∗𝜃 ∧𝜑. ◻
The syntactic hyperdoctrine and the internal language
Every theory produces a hyperdoctrine, and every hyperdoctrine produces a theory. Both constructions are performed here; neither is claimed to invert the other.
The first construction needs one fact about the equality rule of definition 143.21, and that fact is what makes substitution well defined on provable-equality classes of terms.
In every theory 𝑇 the following are derivable, for Γ,𝑥 :𝑆,𝑦 :𝑆 a context, 𝑡 a term with a distinguished variable of sort 𝑆, and 𝜑 a formula with a distinguished variable of sort 𝑆:
Γ,𝑥 :𝑆 ∣⊤ ⊢𝑥 =𝑆𝑥;
Γ,𝑥 :𝑆,𝑦 :𝑆 ∣𝑥 =𝑆𝑦 ⊢𝑦 =𝑆𝑥;
Γ,𝑥 :𝑆,𝑦 :𝑆 ∣𝑥 =𝑆𝑦 ⊢𝑡[𝑥] =𝑡[𝑦];
Γ,𝑥 :𝑆,𝑦 :𝑆 ∣𝑥 =𝑆𝑦 ⊢𝜑[𝑥] ⇒𝜑[𝑦].
Referenced from 7 locations
Proof of Lemma 143.27 — Equality is a congruence
Proof. Each clause instantiates the two-way equality rule at a chosen 𝜌.
(1) Take 𝜌:=(𝑥 =𝑆𝑦). The lower line is 𝑥 =𝑆𝑦 ⊢𝑥 =𝑆𝑦, an instance of Id, so the upward direction gives the upper line ⊤ ⊢𝜌[𝑥/𝑦], which is ⊤ ⊢𝑥 =𝑆𝑥.
(2) Take 𝜌:=(𝑦 =𝑆𝑥). Then 𝜌[𝑥/𝑦] is 𝑥 =𝑆𝑥, derivable by (1), so the downward direction gives 𝑥 =𝑆𝑦 ⊢𝑦 =𝑆𝑥.
(3) Take 𝜌:=(𝑡[𝑥] =𝑡[𝑦]). Then 𝜌[𝑥/𝑦] is 𝑡[𝑥] =𝑡[𝑥], which is derived from (1) by Subst along the substitution sending the distinguished variable to 𝑡[𝑥]. The downward direction gives the claim.
(4) Take 𝜌:=(𝜑[𝑥] ⇒𝜑[𝑦]). Then 𝜌[𝑥/𝑦] is 𝜑[𝑥] ⇒𝜑[𝑥], and ⊤ ⊢𝜑[𝑥] ⇒𝜑[𝑥] follows from ⊤ ∧𝜑[𝑥] ⊢𝜑[𝑥] by the two-way implication rule. The downward direction gives the claim. ◻
Let 𝑇 be a theory over Σ. Define
C𝑇: objects are the contexts over Σ; an arrow Δ ⟶Γ is a list 𝜎 =(𝑡1,…,𝑡𝑛) of terms of Δ with 𝑡𝑖 of the sort of the 𝑖-th declaration of Γ, taken modulo the equivalence identifying 𝜎 and 𝜎′ when Δ ∣⊤ ⊢𝑡𝑖 =𝑡′𝑖 is derivable for each 𝑖; composition is substitution and the identity is the variable list;
𝑃𝑇(Γ): the formulas over Γ, preordered by 𝜑 ≤𝜓 when Γ ∣𝜑 ⊢𝜓 is derivable, and 𝜎∗𝜑:=𝜑[𝜎].
Then (C𝑇,𝑃𝑇) is a hyperdoctrine.
Referenced from 4 locations
Proof of Theorem 143.28 — The syntactic hyperdoctrine
Proof. C𝑇 is a category with finite products. Composition is well defined on equivalence classes: if 𝑡𝑖 =𝑡′𝑖 is derivable over Δ and 𝑢𝑗 =𝑢′𝑗 over Ξ, then 𝑡𝑖[⃗𝑢] =𝑡′𝑖[⃗𝑢′] is derivable by lemma 143.27(3) applied once for each variable, together with Subst and transitivity. The category laws are those of proposition 141.7, which hold already for representatives. The empty context is terminal and concatenation is a product, by the proof of proposition 142.7, which used only entrywise composition.
𝑃𝑇(Γ) is a Heyting algebra. The lattice rules of definition 143.21 are exactly the universal properties of ⊤,⊥, ∧, ∨ in the preorder, and the two-way implication rule is (143.3).
𝜎∗ is a homomorphism and 𝑃𝑇 is a functor. Substitution commutes with every propositional connective by the definition of substitution on formulas, so 𝜎∗ preserves each operation on the nose; it is monotone by Subst. Functoriality (𝜎 ∘𝜏)∗ =𝜏∗ ∘𝜎∗ is the syntactic law 𝜑[𝜎][𝜏] =𝜑[𝜎 ∘𝜏], and id∗ =id is 𝜑[⃗𝑥] =𝜑.
Adjoints along a projection. For 𝑝 :Γ ×(𝑥 :𝑆) ⟶Γ the two-way quantifier rules of definition 143.21 state precisely ∃𝑥 :𝑆. ( −) ⊣𝑝∗ ⊣∀𝑥 :𝑆. ( −).
Adjoints along an arbitrary arrow. Let 𝜎 =(𝑡1,…,𝑡𝑛) :Δ ⟶Γ with Δ =𝑦1 :𝑅1,…,𝑦𝑚 :𝑅𝑚 and Γ =𝑥1 :𝑆1,…,𝑥𝑛 :𝑆𝑛. Write 𝐸𝜎:=⋀𝑛𝑖=1(𝑥𝑖 =𝑆𝑖𝑡𝑖), a formula over the concatenated context ΓΔ, and for 𝜑 over Δ put ∃𝜎𝜑:=∃𝑦1:𝑅1…∃𝑦𝑚:𝑅𝑚.(𝐸𝜎∧𝜑),∀𝜎𝜑:=∀𝑦1:𝑅1…∀𝑦𝑚:𝑅𝑚.(𝐸𝜎⇒𝜑), both formulas over Γ. We verify the two adjunctions.
Existential. Suppose Γ ∣∃𝜎𝜑 ⊢𝜓. Applying the iterated ∃-rule upward gives ΓΔ ∣𝐸𝜎 ∧𝜑 ⊢𝜓. Substitute 𝜎 for the variables of Γ by Subst; this replaces each 𝑥𝑖 by 𝑡𝑖, turning 𝐸𝜎 into ⋀𝑖(𝑡𝑖 =𝑡𝑖), which is derivable from ⊤ by lemma 143.27(1). Hence Δ ∣𝜑 ⊢𝜓[𝜎], which is 𝜑 ≤𝜎∗𝜓.
Conversely suppose Δ ∣𝜑 ⊢𝜓[𝜎]. Weakening to ΓΔ and using lemma 143.27(4) once for each 𝑖, the hypothesis 𝐸𝜎 rewrites 𝜓[𝜎] into 𝜓: ΓΔ∣𝐸𝜎∧𝜑⊢𝐸𝜎∧𝜓[𝜎]⊢𝜓. The iterated ∃-rule downward gives Γ ∣∃𝜎𝜑 ⊢𝜓.
Universal. Suppose Γ ∣𝜎∗𝜓 ⊢𝜑 read in Δ, that is, Δ ∣𝜓[𝜎] ⊢𝜑. Weaken to ΓΔ and use lemma 143.27(4) in the other direction: 𝐸𝜎 ∧𝜓 ⊢𝜓[𝜎] ⊢𝜑, so ΓΔ ∣𝜓 ⊢𝐸𝜎 ⇒𝜑 by the implication rule. The iterated ∀-rule gives Γ ∣𝜓 ⊢∀𝜎𝜑. Conversely, from Γ ∣𝜓 ⊢∀𝜎𝜑 the ∀-rule gives ΓΔ ∣𝜓 ⊢𝐸𝜎 ⇒𝜑; substituting 𝜎 for the variables of Γ makes 𝐸𝜎 derivable from ⊤ as above, so Δ ∣𝜓[𝜎] ⊢𝜑.
Beck–Chevalley. By lemma 143.9 the squares to be checked are formed by a substitution 𝜎 :Δ ⟶Γ and a projection, and there the condition reads (∃𝑥:𝑆.𝜑)[𝜎]=∃𝑥:𝑆.(𝜑[𝜎+]), where 𝜎+ extends 𝜎 by 𝑥 ↦𝑥 and the bound variable is chosen outside the variables of Δ and the terms of 𝜎. That is the definition of substitution into a quantified formula, so both sides are the same formula and in particular provably equivalent. The universal clause is identical. For a pullback square that is not of this form, the condition follows by factoring the substitution through the product projections, using the strict functoriality just proved. ◻
Let (C,𝑃) be a hyperdoctrine. Its internal language is the signature ΣC,𝑃 whose sorts are the objects of C, whose function symbols 𝑔―― :(𝐴1,…,𝐴𝑛) →𝐵 are the arrows 𝑔 :𝐴1 ×⋯ ×𝐴𝑛 ⟶𝐵 of C, and whose relation symbols 𝜑―― :(𝐴1,…,𝐴𝑛) are the elements 𝜑 ∈𝑃(𝐴1 ×⋯ ×𝐴𝑛). Its internal theory 𝑇C,𝑃 has as axioms every sequent Γ ∣𝛼 ⊢𝛽 that is valid in the canonical structure 𝑀C,𝑃, which interprets each sort, function symbol and relation symbol by the object, arrow and predicate it names.
Referenced from 3 locations
In the canonical structure of definition 143.29:
[[Γ ⊢𝑔――(𝑥1,…,𝑥𝑛) :𝐵]] =𝑔 for the context Γ =𝑥1 :𝐴1,…,𝑥𝑛 :𝐴𝑛;
[[𝜑――(𝑥1,…,𝑥𝑛)]] =𝜑;
a sequent is derivable in 𝑇C,𝑃 only if it is valid in 𝑀C,𝑃.
Referenced from 3 locations
Proof of Theorem 143.30 — The canonical structure computes names
Proof. (1) By lemma 142.2(1) the pairing of all the projections is the identity, ⟨𝗉𝗋1,…,𝗉𝗋𝑛⟩=id𝐴1×⋯×𝐴𝑛, so definition 143.22 gives [[𝑔――(⃗𝑥)]]=[[𝑔――]]∘⟨𝗉𝗋1,…,𝗉𝗋𝑛⟩=𝑔∘id=𝑔.
(2) The same calculation: [[𝜑――(⃗𝑥)]] =⟨𝗉𝗋1,…,𝗉𝗋𝑛⟩∗𝜑 =id∗𝜑 =𝜑 by (143.4).
(3) Every axiom of 𝑇C,𝑃 is valid in 𝑀C,𝑃 by construction, so theorem 143.24 applies. ◻
The converse of theorem 143.30(3) is immediate here, since the axioms were taken to be all valid sequents; that is why it is not a completeness theorem. The mathematical content of the two constructions is that they translate between the two vocabularies without loss on atoms (clauses (1) and (2)) and preserve derivability in one direction (clause (3)). A theorem relating a syntactically presented theory to the class of all its hyperdoctrine models requires a separately frozen statement and is not proved here (remark 143.26).
Take the powerset hyperdoctrine. Its internal language has one sort for each set, one function symbol for each function, and one relation symbol for each subset of a finite product. The canonical structure interprets them back as themselves, and a sequent 𝑥 :𝐴 ∣𝑈――(𝑥) ⊢𝑉――(𝑥) is valid exactly when 𝑈 ⊆𝑉. A derivation of that sequent from the propositional and quantifier rules is therefore a proof of an inclusion of subsets, written without mentioning elements.
Referenced from 2 locations
★☆☆ Check directly that the empty context is terminal in C𝑇 and that the concatenation of two contexts satisfies definition 142.1, naming the rule of definition 143.21 used for the uniqueness clause.
Referenced from 2 locations
★★☆ For 𝜎 :Δ ⟶Γ in a hyperdoctrine define the graph of 𝜎 as ∃⟨idΔ,𝜎⟩(⊤) ∈𝑃(Δ ×Γ). Compute it in the powerset hyperdoctrine, and prove that in C𝑇 it is provably equivalent to 𝐸𝜎 from the proof of theorem 143.28.
Referenced from 2 locations
★☆☆ Derive transitivity, Γ,𝑥,𝑦,𝑧 ∣𝑥 =𝑦 ∧𝑦 =𝑧 ⊢𝑥 =𝑧, from lemma 143.27 by choosing an appropriate 𝜌. One line.
Referenced from 2 locations
Suggested first pass.
Begin with exercise 143.9 and exercise 143.10, then complete exercise 143.13.
★★☆ Write out the omitted lattice cases of theorem 143.24 in full: the two projection rules for ∧, the two injection rules for ∨, and the case rule for ∨. For each, name the clause of the universal property in the preorder 𝑃([[Γ]]) that it instantiates.
Referenced from 3 locations
★★☆ Let C =𝐒𝐞𝐭 and let 𝑓 :𝑋 →𝑌 be surjective. Show that ∃𝑓 ∘𝑓∗ =id on P(𝑌) and that 𝑓∗ is injective. Then exhibit a non-surjective 𝑓 for which ∃𝑓 ∘𝑓∗ ≠id, and locate the failing inclusion.
Referenced from 3 locations
★★☆ The powerset hyperdoctrine has Boolean fibers (example 143.2). Show that adding the sequent Γ ∣⊤ ⊢𝜑 ∨(𝜑 ⇒⊥) for all Γ,𝜑 to definition 143.21 remains sound for it, and that the resulting calculus is not sound for the hyperdoctrine of exercise 143.4. Give the refuting instance.
Referenced from 2 locations
★★★ Suppose (C,𝑃) has comprehension (definition 143.17). Prove that the assignment 𝜑 ↦{Γ ∣𝜑} extends to a functor 𝑃(Γ) →C/Γ right adjoint to the functor sending 𝑓 :Δ ⟶Γ to ∃𝑓(⊤). Check both triangle identities of (142.6) in the powerset hyperdoctrine.
Referenced from 2 locations
★★★ Practical project.hyperdoctrine-sequent-checker Implement a checker for validity of first-order sequents in a finite powerset hyperdoctrine. The input is: a finite list of sorts, each with a finite carrier given as a list of elements; a finite list of function symbols, each with an explicit table; a finite list of relation symbols, each with an explicit list of satisfying tuples; and a sequent Γ ∣𝜑 ⊢𝜓 of definition 143.20. The program computes [[𝜑]] and [[𝜓]] as subsets of the finite set [[Γ]], by the clauses of definition 143.22, and reports whether [[𝜑]] ⊆[[𝜓]].
Invariant. Every intermediate value is a subset of the product carrier of the context in which its formula lives; the program checks the arity and sort of each subterm before evaluating, and rejects an ill-sorted input rather than producing a subset of the wrong set.
Concrete result. For a valid sequent the program prints valid; for an invalid one it prints invalid together with one element of [[𝜑]] ∖[[𝜓]], displayed as a tuple of carrier elements, which is a counterexample to the sequent.
Acceptance test. Use one sort 𝑆 with carrier {0,1,2}, one binary relation symbol 𝖱 interpreted as {(𝑚,𝑛) ∣𝑚 ≤𝑛}, and check the following four inputs. The sequent 𝑥 :𝑆 ∣⊤ ⊢∃𝑦 :𝑆. 𝖱(𝑥,𝑦) must print valid; the sequent 𝑥 :𝑆 ∣⊤ ⊢∀𝑦 :𝑆. 𝖱(𝑥,𝑦) must print invalid with counterexample 𝑥 =1 or 𝑥 =2; the Frobenius equation (143.7) must be confirmed in both directions on 𝜃:=𝖱(𝑥,𝑥) and 𝜑:=𝖱(𝑥,𝑦); and the Beck–Chevalley equation (143.6) must be confirmed for the square of lemma 143.9 with 𝜎 the constant map at 0. A run reporting the second sequent valid has interpreted ∀𝑝 as a union rather than the intersection required by (143.1).
Referenced from 3 locations
Sources. Hyperdoctrines and the reading of quantifiers as adjoints to substitution are due to F. W. Lawvere, Adjointness in Foundations, Dialectica 23 (1969), 281–296, reprinted in Reprints in Theory and Applications of Categories 16 (2006); the four data of a hyperdoctrine and the powerset and higher-order-theory examples are on physical pages 11–13 of that reprint, and the observation that the existence of ∃ forces substitution to commute with conjunction is on page 12. The equality predicate as ∃𝛿(⊤) and comprehension as an adjoint are developed in Lawvere’s companion paper Equality in hyperdoctrines and comprehension schema as an adjoint functor, Proceedings of Symposia in Pure Mathematics 17 (1970), 1–14. The posetal definition used here, together with the syntactic, powerset and subobject examples, is Awodey, Introduction to Categorical Logic, Definition 3.4.1 and the surrounding section (course draft of 15 September 2024, physical pages 176–178) [Awo24]; the systematic fibrational treatment, including the proof-relevant version of definition 143.8, is Jacobs [Jac99], and a book-length bridge from typed calculi to these models is Asperti and Longo [AL91]. The realizability quotients that turn a hyperdoctrine into a category of extensional objects are the subject of chapter 144, whose construction and invariant differ from the ones proved here.