The simplest, and most direct, way to include quantifiers that stays within the bounds of first-order logic (as you wish for), while avoiding the better-known constructions seen in higher-order type theory, is to expand the treatment used for finite conjunctions to handle conjunctions indexed by sets $T$. Taking $T$ to be finite, this subsumes both the ‟true” predicate $⊤$ (by taking $T = ∅$), and the ‟and” connective ∧ (by taking $T = 2$), as well as the universal quantifier $∀$ for a single-sorted logic (taking $T$ to be the set of all terms) or for a multi-sorted logic, (where we may have different instances of $T$, one for each type of term). In the last case, we get an algebra for bounded quantifiers that avoids the need for any excursion into dependent types or higher-order type theory / logic and stays strictly first-order.
The key observation is this: if all of the inferences hold $f(t): C ⊢ A(t)$, for every $t∈T$ - in particular, if we have any inference $f(c): C ⊢ A(c)$, where $c$ is a free variable not present in either $C$ or $(∀x)A(x)$ - then we may apply generalization to $f(c)$ to produce the inference $‹x¦f(x)› ≡ {Gen}_c^x f(c): C ⊢ (∀x)A(x)$. We can make this independent of $c$ by imposing an identity ${Gen}_c'^x f(c') = {Gen}_c^x f(c)$, where $c'$ is any other free variable satisfying the same requirement.
Conversely, if we have the inference $h: C ⊢ (∀x)A(x)$, then we may combine it with the instantiation rule $π_At: (∀x)A(x) ⊢ A(t)$ to produce the result $(Πt)h ≡ π_At∘h: C ⊢ A(t)$. It is understood that the usual convention is adopted to take everything modulo α-equivalence to avoid any issues with free-bound capture.
If the categorical algebra is suitably-defined, then these two processes should be inverses, i.e. $‹x¦(Πx)h› = h$ and $(Πt)‹x¦f(x)› = f(t)$ for every $t∈T$, and certain naturality conditions should also hold true. Natural bijections, alone, entail an underlying infrastructure which provides a bundle of rules/operators and related proof algebra sufficient to capture all of what we need.
In the following, I will use the conventions that for a category $𝐗$:
- $|𝐗|$ = the objects of $𝐗$,
- for $X, X' ∈ |𝐗|$, $𝐗(X,X')$ = the set of arrows/morphisms $X → X'$,
along with the definitions
- $𝐗^+$ is the dual category:
- $|𝐗^+| = |𝐗|$,
- for $X, X' ∈ |𝐗|$, $𝐗^+(X,X') = 𝐗(X',X)$,
- identities in $𝐗^+$ are the same as those in $𝐗$,
- compositions in $𝐗^+$ are the reverse of those in $𝐗$.
- $𝐗×𝐘$ is the direct product category:
- $|𝐗×𝐘| = |𝐗|×|𝐘|$,
- for $(X,Y),(X',Y') ∈ |𝐗×𝐘|$, $(𝐗×𝐘)((X,Y),(X',Y')) = 𝐗(X,X')×𝐘(Y,Y')$.
- $1$ is the unit category:
- $|1| = \left\{0\right\}$,
- $1(0,0) = \left\{1_0\right\}$,
- $𝐗^T$ is the indexed product category, with indexing set $T$:
- $|𝐗^T| = |𝐗|^T$,
- for $A,B ∈ |𝐗|^T$, $𝐗^T(A,B) = ⨅_{t∈T} 𝐗(A(t),B(t))$
- for $A ∈ |𝐗|^T$, $1_A = [t∈T ↦ A(t)] ∈ 𝐗^T(A,A)$,
- for $A,B,C ∈ |𝐗|^T$, $f: B → C$, $g: A → B$, $f∘g ≡ [t∈T ↦ f(t)∘g(t)] ∈ 𝐗^T(A,C)$
In a category $𝐋$ for logic, objects are predicates, arrows $A → B$ are inference relations $A ⊢ B$ between predicates $A$ and $B$, while morphisms $f: A → B$ are proofs that bear witness to the respective inference, the relation which we may also write $f: A ⊢ B$.
Within this framework, the distinguished object $⊤$ (for ‟true”), and connective $∧$ (for ‟and”) may be directly implemented by functors
- True (‟terminal object”) ― $⊤: 1 → 𝐋$,
- And (‟product”) ― $∧: 𝐋×𝐋 → 𝐋$,
and proof rules *all* implemented via *natural bijections*, as follows:
$$𝐋(C,⊤) ⇔ 1(0,0) = \{1_0\},$$
$$𝐋(C,A∧B) ⇔ 𝐋(C,A)×𝐋(C,B),$$
To extend this to the universal quantifier - treating it as an indexed product - we add in another functor
- All (‟indexed product” indexed by a set $T$) ― $∀: 𝐋^T → 𝐋$,
and another natural bijection:
$$𝐋(C,∀A) ⇔ 𝐋^T(C,A).$$
For True, the bijection is trivial and is given by
$$h: C ⊢ ⊤ ⇔ 1_0: 0 → 0.$$
For And (conjunctions), the bijection is given by
$$h: C ⊢ A∧B ⇔ f: C ⊢ A, g: C ⊢ B.$$
For All (universal quantifiers), it is given by
$$h: C ⊢ (∀x)A(x) ⇔ [t∈T ↦ f(t): C ⊢ A(t)].$$
So, let's see how this works for conjunctions, first, and then more generally for indexed conjunctions - subsuming $⊤$, $∧$ and $∀$ within this treatment as special cases.
The Natural Bijection for Conjunctions
For conjunctions, the bijection is given by
$$f: C ⊢ A, g: C ⊢ B ⇔ h: C ⊢ A∧B$$
this works as follows:
- There is a functor
$$∧: 𝐋 × 𝐋 → 𝐋$$
such that
- Objects: $A,B∈|𝐋| ↦ A∧B∈|𝐋|$,
- Morphisms: for $A,A',B,B'∈|𝐋|$, $f: A ⊢ A', g: B ⊢ B' ↦ f∧g: A∧A' ⊢ B∧B'$.
The defining properties of a functor, when applied here, entail the identities:
- for $A,B ∈ |𝐋|$, $1_A∧1_B = 1_{A∧B}$,
- for $A,A',A'',B,B',B'' ∈ |𝐋|$, and for $f:A⊢A', f':A'⊢A'', g:B⊢B', g':B'⊢B''$, $(f'∘f)∧(g'∘g) = (f'∧g')∘(f∧g)$.
- There is a bijective natural transform
- for $A,B,C∈|𝐋|$, $(f: C ⊢ A, g: C ⊢ B) ↦ ‹f,g›: C ⊢ A∧B$,
- for $A,B,C∈|𝐋|$, $(h: C ⊢ A∧B) ↦ (⊤h: C ⊢ A, ⊥h: C ⊢ B)$,
with inverse relations:
$$⊤‹f,g› = f, ⊥‹f,g› = g, ‹⊤h,⊥h› = h,$$
and naturality conditions described equivalently either as:
$$‹k∘f∘m,l∘g∘m› = k∧l∘‹f,g›∘m$$
or
$$⊤(k∧l∘h∘m) = k∘⊤h∘m, ⊥(k∧l∘h∘m) = l∘⊥h∘m$$
- More precisely:
- $‹⋯,⋯›: 𝐅 → 𝐆$ and $(⊤⋯,⊥⋯): 𝐆 → 𝐅$ are natural transforms between the functors $𝐅$ and $𝐆$ given by
- $𝐅: 𝐋×𝐋×𝐋^+ → 𝐒𝐞𝐭$, with
- Objects: $𝐅: A,B,C∈|𝐋| ↦ 𝐋(C,A) × 𝐋(C,B)$,
- Morphisms: $𝐅: (k:A⊢A',l:B⊢B',m:C'⊢C) ↦ (𝐅(k,l,m): (f,g) ∈ 𝐋(C,A) × 𝐋(C,B) ↦ (k∘f∘m, l∘g∘m) ∈ 𝐋(C',A') × 𝐋(C',B'))$,
- $𝐆: 𝐋×𝐋×𝐋^+ → 𝐒𝐞𝐭$, with
- Objects: $𝐆: A,B,C∈|𝐋| ↦ 𝐋(C,A∧B)$,
- Morphisms: $𝐆: (k:A⊢A',l:B⊢B',m:C'⊢C) ↦ (𝐆(k,l,m): h ∈ 𝐋(C,A∧B) ↦ k∧l∘h∘m ∈ 𝐋(C',A'∧B'))$,
- 𝐆iven by
- For $A,B,C∈|𝐋|$, $‹⋯,⋯›_{A,B,C}: (f,g) ∈ 𝐅(A,B,C) ↦ ‹f,g› ∈ 𝐆(A,B,C),$
- For $A,B,C∈|𝐋|$, $(⊤⋯,⊥⋯)_{A,B,C}: h ∈ 𝐆(A,B,C) ↦ (⊤h,⊥h) ∈ 𝐅(A,B,C),$
- which satisfies the requisite properties for natural transforms that for
$$(k,l,m) ∈ 𝐋×𝐋×𝐋^+((A,B,C),(A',B',C'))$$
(i.e. for $k: A⊢A'$, $l: B⊢B'$, $m: C'⊢C$),
$$‹⋯,⋯›_{A',B',C'}∘𝐅(k,l,m) = 𝐆(k,l,m)∘‹⋯,⋯›_{A,B,C}$$
(i.e. $‹k∘f∘m,l∘g∘m› = k∧l∘‹f,g›∘m$, for $(f,g) ∈ 𝐅(A,B,C)$), and
$$(⊤⋯,⊥⋯)_{A',B',C'}∘𝐆(k,l,m) = 𝐅(k,l,m)∘(⊤⋯,⊥⋯)_{A,B,C}$$
(i.e. $(⊤(k∧l∘h∘m),⊥(k∧l∘h∘m))$ = $(k∘⊤h∘m,l∘⊥h∘m)$ for $h ∈ 𝐆(A,B,C)$)
The operators $‹⋯,⋯›$, $⊤(⋯)$, $⊥(⋯)$ are equivalently described as ‟polymorphic operators” with polymorphism parametrized by $A,B,C∈|𝐋|$. On account of these identities, each of the operators, as well as the functor $∧$ can be reduced to a small set of primitives, given by
$$L_{A,B} ≡ ⊤ 1_{A∧B}: A∧B ⊢ A,$$
$$R_{A,B} ≡ ⊥ 1_{A∧B}: A∧B ⊢ B,$$
as follows:
- for $A,B,C∈|𝐋|$ and $h: C⊢A∧B$,
$$⊤h = ⊤(1_{A∧B}∘h) = ⊤1_{A∧B}∘h = L_{A,B}∘h,$$
$$⊥h = ⊥(1_{A∧B}∘h) = ⊥1_{A∧B}∘h = R_{A,B}∘h,$$
- for $A,A',B,B'∈|𝐋|$, and $k:A⊢A'$, $l:B⊢B'$,
$$k∧l = k∧l∘‹⊤1_{A∧B},⊥1_{A∧B}›∘1_{A∧B} = ‹k∘L_{A,B},l∘R_{A,B}›$$
with the smaller set of identities:
- for $A,B,C∈|𝐋|$ and $f:C⊢A, g:C⊢B$, $L_{A,B}∘‹f,g› = f$ and $R_{A,B}∘‹f,g› = g$,
- for $A,B,C.C'∈|𝐋|$ and $f:C⊢A, g:C⊢B, m:C'⊢C$, $‹f∘m,g∘m› = ‹f,g›∘m$,
- for $A,B∈|𝐋|$, $‹L_{A,B},R_{A,B}› = 1_{A∧B}$
from which *all* of the previously stated identities follow (which are all well-known, by the way, seen for instance in Girard's formalism).
These, too, are polymorphic operators, and it is generally the case that all of the above relations can be stated more succinctly without the extra parametrization made explicit, without any loss of relevant context, like so:
$$⊤h = L∘h, ⊥h = R∘h,$$
$$L = ⊤1, R = ⊥1,$$
$$L∘‹f,g› = f, R∘‹f,g› = g,$$
$$‹L,R› = 1, k∧l = ‹k∘L,l∘R›.$$
The Natural Bijections for Indexed Conjunctions and Universal Quantifiers
For the universal quantifier, this works as follows:
- There is a functor
$$∀: 𝐋^T → 𝐋$$
such that
- Objects: $A∈|𝐋^T| ↦ (∀x)A(x) ≡ ∀A∈|𝐋|$,
- Morphisms: for $A,A'∈|𝐋^T|$, $(∀x)f(x) ≡ ∀f: ∀A ⊢ ∀A'$ in $𝐋$
The key defining properties, for $∀$ to be a functor, are
- for $A∈|𝐋^T|$, $(∀x)1_{A(x)} = 1_{(∀x)A(x)}$,
- for $A,A',A''∈|𝐋^T|$ and for $f:A⊢A'$, $f':A'⊢A''$, $∀(f'∘f) = ∀f'∘∀f$, i.e. $(∀x)(f'(x)∘f(x)) = (∀x)f'(x)∘(∀x)f(x)$
By taking $T$, to be finite sets or natural numbers, we can use the same formalism described here to formulate the natural bijections for finitely-indexed conjunctions. That subsumes the treatments for both the conjunction $A∧B = ⋀(A,B)$ for $T = 2$ and $(A,B) ∈ |𝐋|²$ and $⊤ = ⋀()$ for $T = 0$, for $() ∈ |𝐋|⁰ ≅ 1$, as special cases.
- A bijective natural transform is given by
- for $A∈|𝐋^T|$, $C∈|𝐋|$, $[t∈T ↦ f(t): C ⊢ A(t)] ↦ ‹x¦f(x)›: C ⊢ ∀A$,
- for $A∈|𝐋^T|$, $C∈|𝐋|$, $h: C ⊢ ∀A ↦ [t∈T ↦ (Πt)h: C ⊢ A(t)]$,
with inverse relations $(Πt)‹x¦f(x)› = f(t)$, for $t∈T$ and $‹x¦(Πx)h› = h$, and naturality conditions described equivalently as:
$$‹x¦k(x)∘f(x)∘m› = (∀x)k(x)∘‹x¦f(x)›∘m$$
or
$$(Πt)((∀x)k(x)∘h∘m) = k(t)∘(Πt)h∘m$$
for $t∈T$.
- More precisely:
- $‹⋯¦⋯›: 𝐅 → 𝐆$ and $((Πt)⋯¦t∈T): 𝐆 → 𝐅$ are natural transforms between the functors $𝐅$ and $𝐆$ given by
- $𝐅: 𝐋^T×𝐋^+ → 𝐒𝐞𝐭$
- Objects: $𝐅: A∈|𝐋^T|, C∈|𝐋| ↦ 𝐋^T(C,A)$,
- Morphisms: for $A,A'∈|𝐋^T|, C,C'∈|𝐋|$, $𝐅: (k:A⊢A',m:C'⊢C) ↦ (𝐅(k,m): f ∈ 𝐋^T(C,A) ↦ (t∈T ↦ k(t)∘f(t)∘m) ∈ 𝐋^T(C',A'))$
- $𝐆: 𝐋^T×𝐋^+ → 𝐒𝐞𝐭$
- Objects: $𝐆: A∈|𝐋^T|, C∈|𝐋| ↦ 𝐋(C,∀A)$,
- Morphisms: for $A,A'∈|𝐋^T|, C,C'∈|𝐋|$, $𝐆: (k:A⊢A',m:C'⊢C) ↦ (𝐆(k,m): h ∈ 𝐋(C,∀A) ↦ ∀k∘h∘m ∈ 𝐋(C',∀A'))$,
- 𝐆iven by
- for $A∈|𝐋^T|, C∈|𝐋|$, $‹⋯¦⋯›_{A,C}: f ∈ 𝐅(A,C) ↦ ‹x¦f(x)› ∈ 𝐆(A,C)$,
- for $A∈|𝐋^T|, C∈|𝐋|$, $((Πt)⋯¦t∈T)_{A,C}: h ∈ 𝐆(A,C) ↦ ((Πt)h:t∈T) ∈ 𝐅(A,C),$
- which satisfies the requisite properties for natural transforms that for
$$(k,m) ∈ 𝐋^T×𝐋^+((A,C),(A',C')),$$
i.e. $k: A⊢A', m: C'⊢C$,
$$‹⋯¦⋯›_{A',C'}∘𝐅(k,m) = 𝐆(k,m)∘‹⋯,⋯›_{A,C}$$
i.e. $‹x¦k(x)∘f(x)∘m› = (∀x)k(x)∘‹x¦f(x)›∘m$, for $f ∈ 𝐅(A,C)$, and
$$((Πt)⋯:t∈T)_{A',C'}∘𝐆(k,m) = 𝐅(k,m)∘((Πt)⋯:t∈T)_{A,C}$$
i.e. $(Πt)((∀x)k(x)∘h∘m) = (k(t)∘(Πt)h∘m)$ for $h ∈ 𝐆(A,C)$ and $t∈T$.
The operators $‹⋯¦⋯›$, $(Πt)(⋯)$ are, likewise, described equivalently as ‟polymorphic operators” with polymorphism parametrized by $A∈|𝐋^T|$ and $C∈|𝐋|$.
A reduction similar to that for conjunctions yields, equivalently, the following reduced set of operators and identities:
$$π_A(t) ≡ (Πt)1_{∀A}: (∀x)A(x) ⊢ A(t)$$
for $t∈T$ as follows:
- for $A∈|𝐋^T|$, $C∈|𝐋|$ and $h: C⊢∀A$, $t∈T$, $(Πt)h = π_A(t)∘h$,
- for $A,A'∈|𝐋^T|$, and $k:A⊢A'$, $∀k = ‹x¦k(x)∘π_A(x)›$
with the smaller set of identities:
- for $A∈|𝐋^T|$, $C∈|𝐋|$, $[t∈T ↦ f(t):C⊢A(t)]$, $π_A(t)∘‹x¦f(x)› = f(t)$,
- for $A∈|𝐋^T|$, $C,C'∈|𝐋|$, $[t∈T ↦ f(t):C⊢A(t)]$, $m:C'⊢C$, $‹x¦f(x)∘m› = ‹x¦f(x)›∘m$,
- for $A∈|𝐋^T|$, $‹x¦π_A(x)› = 1_{∀A}$
from which *all* of the previously stated identities follow.
These, too, can be written more succinctly, without loss of context, by omitting the extra parametrization of the polymorphic operators as:
$$(Πt)h = π(t)∘h, π(t) = (Πt)1, π(t)∘‹x¦f(x)› = f(t)$$
for $t∈T$ and
$$‹x¦π(x)› = 1, ∀k = ‹x¦k(x)∘π(x)›.$$
By dualizing everything, the treatments for $⊤$, $∧$ and $∀$ can be transformed into treatments respectively for their duals False ($⊥$), Or ($∨$) and Some ($∃$), the existential quantifier, as well as indexed disjunctions.