What Connectives Preserve Finiteness?
In order to bridge the gap between finite unambiguity and unambiguity, we can try to restrict to grammars that have finitely many parse trees. Weβd expect this to address the concern semantically, as that fixes the problem when the parses are interpreted in .
We can define when a grammar is finite, and then try to prove that finiteness is preserved on some sane operations on grammars. For instance, , , and each preserve finiteness. I havenβt proven this myself (which would be a useful exercise), but the following is substantiated in any topos with a natural numbers object [johnstone-2002].
1 Finite Cardinal Arithmetic in a Topos finite-cardinal-arithmetic-topos
In a topos with a natural numbers object , you can define finite cardinals as objects that arise as the pullback along a morphism of the generic finite cardinal. Write for the cardinal corresponding to .
The above characterization is a little obtuse and does warrant some more explanation. One way to make it more concrete is that and , and that finite cardinals warrant a nice induction principle. If is a property expressible in the internal language such that satisfies , and that whenever satisfies then satisfies ; then every finite cardinal satisfies . That is, forms a -closed subobject of and thus is all of .
My working mental model is in a presheaf topos, where the natural numbers object can be defined explicitly as .
Definition 1.1. Constant Presheaf constant-presheaf
The constant presheaf of a set on a category is a functor such that
I often call this the discrete presheaf for , but I donβt know if thatβs standard.
The finite cardinals with respect to can be characterized then as,
These obey nice algebraic properties.
The case of is more problematic. Semantically, for all we may bound the size of the set of parse trees
Precisely knowing this bound isnβt too important, but certainly it exists. We could capture this behavior by just adding an axiom that if and are each finite, then is finite. Although, Iβd rather not add an axiom.
We could directly try to prove that preserves finiteness. The statement would follow from showing that preserves monomorphisms. That is, if and , it suffices to show that is a monomorphism. This would imply finiteness, because you may then apply this for and as . However, you would also need to show that is finite, which isnβt immediately clear.