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,

[0]≔βŠ₯
[π—Œπ—Žπ–Ό(𝑛)]β‰”βŠ€βŠ•[𝑛]

These obey nice algebraic properties.

[π‘›π‘š]β‰…[𝑛]Γ—[π‘š]
[𝑛+π‘š]β‰…[𝑛]βŠ•[π‘š]
[π‘›π‘š]β‰…[π‘š]β†’[𝑛]

The case of βŠ— is more problematic. Semantically, for all 𝑀:String we may bound the size of the set of parse trees

|(π΄βŠ—π΅)𝑀|≀Σ𝑀1++𝑀2=𝑀|𝐴𝑀1||𝐡𝑀2|

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.

finiteness-preserving-connectives note entries/parsing/finiteness-preserving-connectives.hel