Type theory MOC

Product type

Given types 𝐴 and 𝐵, the product type 𝐴 ×𝐵 contains ordered pairs (𝑎,𝑏) for 𝑎 :𝐴 and 𝑏 :𝐵, i.e. it generalizes the cartesian product. Under propositions as types, this corresponds to conjunction, since a proof of 𝐴 ×𝐵 gives a proof of 𝐴 and a proof of 𝐵.

Standard presentation

In the cartesian calculus of substitutions we can introduce product types with the following typing rules. The formation, introduction, and elimination rules are

Γ𝐴Γ𝐵Γ𝐴×Γ𝐵(×)Γ𝑎:𝐴Γ𝑏:𝐵Γ𝑎,𝑏Γ,𝐴,𝐵:𝐴×𝐵(×I) Γ𝑝:𝐴×𝐵Γ𝐟𝐬𝐭Γ,𝐴,𝐵(𝑝):𝐴(×E1)Γ𝑝:𝐴×𝐵Γ𝐬𝐧𝐝Γ,𝐴,𝐵(𝑝):𝐵(×E2)

while we also have the substitution naturality rules

Δ𝛾:ΓΓ𝐴Γ𝐵Δ(𝐴×𝐵)[𝛾]=𝐴[𝛾]×𝐵[𝛾](×-N) Δ𝛾:ΓΓ𝑎:𝐴Γ𝑏:𝐵Δ𝑎,𝑏[𝛾]=𝑎[𝛾],𝑏[𝛾]:𝐴[𝛾]×𝐵[𝛾](×I-N) Δ𝛾:ΓΓ𝑝:𝐴×𝐵Δ𝐟𝐬𝐭(𝑝)[𝛾]=𝐟𝐬𝐭(𝑝[𝛾]):𝐴[𝛾](×E1-N) Δ𝛾:ΓΓ𝑝:𝐴×𝐵Δ𝐬𝐧𝐝(𝑝)[𝛾]=𝐬𝐧𝐝(𝑝[𝛾]):𝐵[𝛾](×E2-N)

and judgemental computation rules for 𝛽-computation and 𝜂-unicity

Γ𝑎:𝐴Γ𝑏:𝐵Γ𝐟𝐬𝐭(𝑎,𝑏)=𝑎:𝐴(×𝛽1) Γ𝑎:𝐴Γ𝑏:𝐵Γ𝐬𝐧𝐝(𝑎,𝑏)=𝑏:𝐵(×𝛽2) Γ𝑝:𝐴×𝐵Γ𝑝=𝐟𝐬𝐭(𝑝),𝐬𝐧𝐝(𝑝):𝐴×𝐵(×𝜂)

From Σ-types

In the Cartesian calculus of substitutions with Σ-types, it is not necessary to give separate typing rules to establish product types. Instead we have

Γ𝐴Γ.𝐴𝐩:Γ(W)Γ𝐵Γ.𝐴𝐵[𝐩]Γ𝚺(𝐴,𝐵[𝐩])(Σ)

and so we can define 𝐴 ×Γ𝐵 :=𝚺Γ(𝐴,𝐵[𝐩]).

Derivation of above typing rules

For ×I, we have

Γ𝑎:𝐴Γ𝑏:𝐵Γ.𝐴𝑏[𝐩]:𝐵[𝐩](W)Γ𝑎,𝑏[𝐩]:𝚺(𝐴,𝐵[𝐩])

so we take 𝑎,𝑏Γ,𝐴,𝐵 :=𝑎,𝑏[𝐩]Γ,𝐴,𝐵[𝐩].

For ×E1 we have

Γ𝑝:𝚺(𝐴,𝐵[𝐩])Γ𝐟𝐬𝐭(𝑝):𝐴

so we take 𝐟𝐬𝐭Γ,𝐴,𝐵 :=𝐟𝐬𝐭Γ,𝐴,𝐵[𝐩].

For ×E2 we have

Γ𝑝:𝚺(𝐴,𝐵[𝐩])Γ𝐬𝐧𝐝(𝑝):𝐵[𝐩𝐢𝐝.𝐟𝐬𝐭(𝑝)]Γ𝐬𝐧𝐝(𝑝):𝐵

so we take 𝐬𝐧𝐝Γ,𝐴,𝐵 :=𝐬𝐧𝐝Γ,𝐴,𝐵[𝐩].

The equalities follow.

Internalizing judgemental structure

In terms of Internalizing judgemental structure, we have an operation

(×Γ):Ty(Γ)×Ty(Γ)Ty(Γ)

natural in Γ with a family of bijections

𝜄Γ,𝐴,𝐵:Tm(Γ,𝐴×Γ𝐵)Tm(Γ,𝐴)×Tm(Γ,𝐵)

also natural in Γ.


#state/tidy | #lang/en | #SemBr