Chatzikyriakidis & Luo (2020): MTT semantics via coercive subtyping #
Modern Type Theory (MTT) analysis where common nouns denote types,
not predicates, and subtyping is coercive — A ≤_c B whenever
there is a unique implicit coercion c : A → B that the elaborator
inserts on demand (paper §2.4, eqs. CA/CD on p. 40).
Coercive vs subsumptive. C&L explicitly reject subsumptive
subtyping for MTT (p. 39): "subsumptive subtyping is incompatible
with some key properties of modern type theories and, as a
consequence, cannot be employed for an MTT." This file uses Lean's
Coe typeclass, which is the canonical coercive-subtyping mechanism
(value-level coercion functions, automatic elaboration-time
insertion).
Coherence. Paper p. 40 fn 18 requires unique coercions between
any two types. Lean's typeclass resolution picks an instance by
priority rather than enforcing uniqueness; coherence is therefore
the file author's responsibility, documented via CoherentCoercion
Props below.
Main definitions #
- Paper §3.2.1 CNs-as-types:
Human,Bookas inductive types. - Paper §3.2.2 eq. 3.30-3.33 paradigm:
Man = Σx:Human.male(x),heavy_book = Σx:Book.heavy(x),read : Human → Book → Prop, withread john_man warAndPeace_heavywell-typed via projective coercive subtyping. CoherentCoercion A B: Prop axiom stating any twoCoepaths fromAtoBagree (paper coherence requirement, not enforced by Lean — proved per-instance).
References #
- [CL20] §2.4 (coercive subtyping), §3.2.1 (CNs as types), §3.2.2 (subtyping in MTT-semantics, esp. eq. 3.30-3.33 and projective subtyping at eq. 3.33).
Paper §3.2.1: CNs as types #
Equations
- ChatzikyriakidisLuo2020.instDecidableEqHuman x✝ y✝ = if h : x✝.ctorIdx = y✝.ctorIdx then isTrue ⋯ else isFalse ⋯
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- ChatzikyriakidisLuo2020.instDecidableEqBook x✝ y✝ = if h : x✝.ctorIdx = y✝.ctorIdx then isTrue ⋯ else isFalse ⋯
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Paper §3.2.2: projective subtyping via Σ-types #
Man := Σx:Human.male(x) (paper eq. 2.41); Man ≤_π₁ Human
(eq. 2.42, p. 41) — the first projection is the coercion. In Lean,
this is {h : Human // Male h} with Coe ... Human via
Subtype.val.
Equations
Instances For
Equations
- ChatzikyriakidisLuo2020.instCoeManHuman = { coe := Subtype.val }
Equations
Instances For
Equations
- ChatzikyriakidisLuo2020.instCoeHeavyBookBook = { coe := Subtype.val }
Paper §3.2.2: read : Human → Book → Prop.
Equations
- ChatzikyriakidisLuo2020.read x✝¹ x✝ = True
Instances For
The expanded form: applying the explicit coercions yields the
same term Lean's elaborator produces implicitly (paper rule CD,
p. 40: f(a) = f(c(a))).
Coherence (paper p. 41 fn 18) #
Coherence of coercions between two types: any two Coe-derived
coercion functions agree. Lean's typeclass resolution does not
enforce this (it picks by priority); the user declares and proves
coherence on a case-by-case basis.
- coh (c₁ c₂ : A → B) : c₁ = Coe.coe → c₂ = Coe.coe → c₁ = c₂
Instances
The Man-to-Human coercion is trivially coherent: there is only
one Coe instance declared.
The HeavyBook-to-Book coercion is trivially coherent.
Paper §3.2.2: subtyping propagates through function types #
C&L p. 55: if A' ≤ A and B ≤ B', then A → B ≤ A' → B'
(contravariance + covariance). In Lean this is automatic — any
f : Human → Prop accepts m : Man via Coe insertion.
Equations
- ChatzikyriakidisLuo2020.Talks x✝ = True
Instances For
Failure case: missing coercion is a type error #
The paper's selectional-restriction argument: if there is no
Coe Book Human, then Talks warAndPeace fails to elaborate.
Lean's type error IS the paper's "category mistake" (paper §3.2.1,
table 3.1 commentary). The following would not typecheck:
example : Prop := Talks Book.warAndPeace